Update difficulty and set gamemode to survival when creating a new island

This commit is contained in:
Len 2024-02-11 15:16:08 +01:00
parent da2f50032d
commit 9e84142ca2
2 changed files with 4 additions and 4 deletions

View File

@ -5,6 +5,7 @@ import com.alttd.cometskyblock.commands.PlayerSubCommand;
import com.alttd.cometskyblock.island.Island;
import com.alttd.cometskyblock.island.IslandPlayer;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.Player;
@ -58,6 +59,7 @@ public class IslandGo extends PlayerSubCommand {
player.setExp(0);
player.setFoodLevel(20);
player.setSaturation(20);
player.setGameMode(GameMode.SURVIVAL);
player.getInventory().addItem(
new ItemStack(Material.LAVA_BUCKET),
new ItemStack(Material.WATER_BUCKET)

View File

@ -2,10 +2,7 @@ package com.alttd.cometskyblock.worldgenerator;
import com.alttd.cometskyblock.CometSkyBlockPlugin;
import com.alttd.cometskyblock.configuration.PluginConfiguration;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.bukkit.WorldType;
import org.bukkit.*;
import org.codehaus.plexus.util.FileUtils;
import java.io.File;
@ -86,6 +83,7 @@ public class MasterWorldGenerator {
if (newIsland == null) {
return;
}
newIsland.setDifficulty(Difficulty.EASY);
// TODO Load a schematic into this world?
// Currently random islands are generated by CometIslandGenerator()
plugin.getServer().getWorlds().add(newIsland);