Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/main/java/com/bartz24/voidislandcontrol/EventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,21 +283,23 @@ private static void mainSpawn(World world, BlockPos spawn) {

@SubscribeEvent
public void onPlayerRespawn(PlayerRespawnEvent event) {
EntityPlayer player = event.player;
if (ConfigOptions.islandSettings.handleRespawn) {
EntityPlayer player = event.player;

if (player.getEntityWorld().getWorldInfo().getTerrainType() instanceof WorldTypeVoid) {
if (player.getBedLocation() == null
|| player.getBedSpawnLocation(player.getEntityWorld(), player.getBedLocation(), true) == null) {
if (player.getEntityWorld().getWorldInfo().getTerrainType() instanceof WorldTypeVoid) {
if (player.getBedLocation() == null
|| player.getBedSpawnLocation(player.getEntityWorld(), player.getBedLocation(), true) == null) {

IslandPos iPos = IslandManager.getPlayerIsland(player.getGameProfile().getId());
IslandPos iPos = IslandManager.getPlayerIsland(player.getGameProfile().getId());

BlockPos pos = new BlockPos(0, ConfigOptions.islandSettings.islandYLevel, 0);
if (iPos != null)
pos = new BlockPos(iPos.getX() * ConfigOptions.islandSettings.islandDistance,
ConfigOptions.islandSettings.islandYLevel,
iPos.getY() * ConfigOptions.islandSettings.islandDistance);
BlockPos pos = new BlockPos(0, ConfigOptions.islandSettings.islandYLevel, 0);
if (iPos != null)
pos = new BlockPos(iPos.getX() * ConfigOptions.islandSettings.islandDistance,
ConfigOptions.islandSettings.islandYLevel,
iPos.getY() * ConfigOptions.islandSettings.islandDistance);

IslandManager.tpPlayerToPos(player, pos, iPos);
IslandManager.tpPlayerToPos(player, pos, iPos);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ public static class IslandSettings {
public boolean forceSpawn = false;
@Config.Comment("Sets how long the buffs are given when spawning on an island in ticks (I think)")
public int buffTimer = 1200;
@Config.Comment("Shoule VoidIslandControl handle player respawn? Disabling this would make players without a island respawn at worldspawn instead of 0,0")
public boolean handleRespawn = true;

@Config.Comment("Settings for the grass island")
public GrassIslandSettings grassSettings = new GrassIslandSettings();
Expand Down