mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-13 16:54:06 +00:00
Separate worldgen islands from fabricated islands.
This commit is contained in:
1 parent
a318352b6f
commit
37ae63cb8c
2 files changed
+9
-7
No files matched your search
@@ -41,7 +41,7 @@ public class CommandSkyblockSpread extends CommandBase {
|
||||
ChunkCoordinates spawn = player.worldObj.getSpawnPoint();
|
||||
int x = player.worldObj.rand.nextInt(maxrange) - maxrange / 2 + spawn.posX;
|
||||
int z = player.worldObj.rand.nextInt(maxrange) - maxrange / 2 + spawn.posZ;
|
||||
SkyblockWorldEvents.spawnPlayer(player, x, spawn.posY, z);
|
||||
SkyblockWorldEvents.spawnPlayer(player, x, spawn.posY, z, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public final class SkyblockWorldEvents {
|
||||
if(WorldTypeSkyblock.isWorldSkyblock(world)) {
|
||||
ChunkCoordinates coords = world.getSpawnPoint();
|
||||
if(world.getBlock(coords.posX, coords.posY - 4, coords.posZ) != Blocks.bedrock && world.provider.dimensionId == 0)
|
||||
spawnPlayer(player, coords.posX, coords.posY, coords.posZ);
|
||||
spawnPlayer(player, coords.posX, coords.posY, coords.posZ, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ public final class SkyblockWorldEvents {
|
||||
}
|
||||
}
|
||||
|
||||
public static void spawnPlayer(EntityPlayer player, int x, int y, int z) {
|
||||
public static void spawnPlayer(EntityPlayer player, int x, int y, int z, boolean fabricated) {
|
||||
NBTTagCompound data = player.getEntityData();
|
||||
if(!data.hasKey(EntityPlayer.PERSISTED_NBT_TAG))
|
||||
data.setTag(EntityPlayer.PERSISTED_NBT_TAG, new NBTTagCompound());
|
||||
@@ -136,10 +136,12 @@ public final class SkyblockWorldEvents {
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.lexicon));
|
||||
}
|
||||
|
||||
persist.setBoolean(TAG_HAS_OWN_ISLAND, true);
|
||||
persist.setDouble(TAG_ISLAND_X, player.posX);
|
||||
persist.setDouble(TAG_ISLAND_Y, player.posY);
|
||||
persist.setDouble(TAG_ISLAND_Z, player.posZ);
|
||||
if(fabricated) {
|
||||
persist.setBoolean(TAG_HAS_OWN_ISLAND, true);
|
||||
persist.setDouble(TAG_ISLAND_X, player.posX);
|
||||
persist.setDouble(TAG_ISLAND_Y, player.posY);
|
||||
persist.setDouble(TAG_ISLAND_Z, player.posZ);
|
||||
}
|
||||
} else {
|
||||
double posX = persist.getDouble(TAG_ISLAND_X);
|
||||
double posY = persist.getDouble(TAG_ISLAND_Y);
|
||||
|
||||
Reference in new issue
Block a user