Update difficulty and set gamemode to survival when creating a new island
This commit is contained in:
parent
da2f50032d
commit
9e84142ca2
|
|
@ -5,6 +5,7 @@ import com.alttd.cometskyblock.commands.PlayerSubCommand;
|
||||||
import com.alttd.cometskyblock.island.Island;
|
import com.alttd.cometskyblock.island.Island;
|
||||||
import com.alttd.cometskyblock.island.IslandPlayer;
|
import com.alttd.cometskyblock.island.IslandPlayer;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
@ -58,6 +59,7 @@ public class IslandGo extends PlayerSubCommand {
|
||||||
player.setExp(0);
|
player.setExp(0);
|
||||||
player.setFoodLevel(20);
|
player.setFoodLevel(20);
|
||||||
player.setSaturation(20);
|
player.setSaturation(20);
|
||||||
|
player.setGameMode(GameMode.SURVIVAL);
|
||||||
player.getInventory().addItem(
|
player.getInventory().addItem(
|
||||||
new ItemStack(Material.LAVA_BUCKET),
|
new ItemStack(Material.LAVA_BUCKET),
|
||||||
new ItemStack(Material.WATER_BUCKET)
|
new ItemStack(Material.WATER_BUCKET)
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,7 @@ package com.alttd.cometskyblock.worldgenerator;
|
||||||
|
|
||||||
import com.alttd.cometskyblock.CometSkyBlockPlugin;
|
import com.alttd.cometskyblock.CometSkyBlockPlugin;
|
||||||
import com.alttd.cometskyblock.configuration.PluginConfiguration;
|
import com.alttd.cometskyblock.configuration.PluginConfiguration;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.*;
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.WorldCreator;
|
|
||||||
import org.bukkit.WorldType;
|
|
||||||
import org.codehaus.plexus.util.FileUtils;
|
import org.codehaus.plexus.util.FileUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
@ -86,6 +83,7 @@ public class MasterWorldGenerator {
|
||||||
if (newIsland == null) {
|
if (newIsland == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
newIsland.setDifficulty(Difficulty.EASY);
|
||||||
// TODO Load a schematic into this world?
|
// TODO Load a schematic into this world?
|
||||||
// Currently random islands are generated by CometIslandGenerator()
|
// Currently random islands are generated by CometIslandGenerator()
|
||||||
plugin.getServer().getWorlds().add(newIsland);
|
plugin.getServer().getWorlds().add(newIsland);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user