From 67d5d65902dba34db2928cd3dd308d31ef19c367 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Fri, 13 Nov 2015 19:53:37 -0600 Subject: [PATCH] Shotgun tile.getWorldObj into tile.getWorld. May cause some individual errors but fix later --- .../botania/api/corporea/CorporeaHelper.java | 2 +- .../api/internal/VanillaPacketDispatcher.java | 2 +- .../api/subtile/SubTileFunctional.java | 18 +++++------ .../api/subtile/SubTileGenerating.java | 30 +++++++++---------- .../client/render/tile/RenderTileAvatar.java | 2 +- .../client/render/tile/RenderTileBellows.java | 2 +- .../client/render/tile/RenderTileBrewery.java | 2 +- .../tile/RenderTileCorporeaCrystalCube.java | 4 +-- .../render/tile/RenderTileEnchanter.java | 2 +- .../render/tile/RenderTileFloatingFlower.java | 6 ++-- .../render/tile/RenderTileHourglass.java | 2 +- .../render/tile/RenderTileIncensePlate.java | 2 +- .../client/render/tile/RenderTilePool.java | 10 +++---- .../client/render/tile/RenderTilePump.java | 2 +- .../client/render/tile/RenderTilePylon.java | 4 +-- .../render/tile/RenderTileRuneAltar.java | 2 +- .../render/tile/RenderTileSpreader.java | 2 +- .../render/tile/RenderTileTeruTeruBozu.java | 2 +- .../render/tile/RenderTileTinyPotato.java | 2 +- .../common/block/subtile/SubTileManastar.java | 4 +-- .../block/subtile/SubTilePureDaisy.java | 10 +++---- .../functional/SubTileAgricarnation.java | 18 +++++------ .../subtile/functional/SubTileBellethorn.java | 2 +- .../subtile/functional/SubTileBubbell.java | 6 ++-- .../subtile/functional/SubTileClayconia.java | 14 ++++----- .../subtile/functional/SubTileDaffomill.java | 6 ++-- .../subtile/functional/SubTileExoflame.java | 6 ++-- .../functional/SubTileFallenKanade.java | 4 +-- .../functional/SubTileHeiseiDream.java | 2 +- .../subtile/functional/SubTileHopperhock.java | 16 +++++----- .../subtile/functional/SubTileHyacidus.java | 2 +- .../functional/SubTileJadedAmaranthus.java | 18 +++++------ .../subtile/functional/SubTileLoonuim.java | 8 ++--- .../functional/SubTileMarimorphosis.java | 16 +++++----- .../subtile/functional/SubTileMedumone.java | 2 +- .../subtile/functional/SubTileOrechid.java | 16 +++++----- .../functional/SubTileOrechidIgnem.java | 2 +- .../functional/SubTilePollidisiac.java | 8 ++--- .../functional/SubTileRannuncarpus.java | 24 +++++++-------- .../subtile/functional/SubTileSolegnolia.java | 2 +- .../functional/SubTileSpectranthemum.java | 6 ++-- .../functional/SubTileTangleberrie.java | 6 ++-- .../subtile/functional/SubTileTigerseye.java | 2 +- .../subtile/functional/SubTileVinculotus.java | 2 +- .../subtile/generating/SubTileArcaneRose.java | 2 +- .../generating/SubTileDandelifeon.java | 8 ++--- .../subtile/generating/SubTileDaybloom.java | 10 +++---- .../subtile/generating/SubTileEndoflame.java | 10 +++---- .../generating/SubTileEntropinnyum.java | 10 +++---- .../generating/SubTileGourmaryllis.java | 8 ++--- .../generating/SubTileHydroangeas.java | 26 ++++++++-------- .../subtile/generating/SubTileKekimurus.java | 14 ++++----- .../subtile/generating/SubTileMunchdew.java | 14 ++++----- .../subtile/generating/SubTileNarslimmus.java | 2 +- .../subtile/generating/SubTileNightshade.java | 2 +- .../subtile/generating/SubTileRafflowsia.java | 12 ++++---- .../subtile/generating/SubTileSpectrolus.java | 4 +-- .../subtile/generating/SubTileThermalily.java | 4 +-- .../common/block/tile/TileAlfPortal.java | 2 +- .../common/block/tile/TileRuneAltar.java | 2 +- .../block/tile/mana/TileManaDetector.java | 2 +- .../common/block/tile/mana/TileManaVoid.java | 2 +- .../core/handler/ManaNetworkHandler.java | 8 ++--- .../common/core/helper/InventoryHelper.java | 2 +- .../common/entity/EntityManaBurst.java | 2 +- .../buildcraft/TriggerManaDetector.java | 2 +- .../botania/common/item/ItemManaMirror.java | 4 +-- .../common/item/rod/ItemDiviningRod.java | 2 +- .../botania/common/item/rod/ItemFireRod.java | 2 +- .../common/item/rod/ItemMissileRod.java | 2 +- .../common/item/rod/ItemRainbowRod.java | 2 +- .../common/item/rod/ItemTornadoRod.java | 2 +- 72 files changed, 231 insertions(+), 231 deletions(-) diff --git a/src/main/java/vazkii/botania/api/corporea/CorporeaHelper.java b/src/main/java/vazkii/botania/api/corporea/CorporeaHelper.java index a2b82f06c..4bebf6ebc 100644 --- a/src/main/java/vazkii/botania/api/corporea/CorporeaHelper.java +++ b/src/main/java/vazkii/botania/api/corporea/CorporeaHelper.java @@ -237,7 +237,7 @@ public final class CorporeaHelper { return null; TileEntity tile = (TileEntity) inv; - return getSparkForBlock(tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord); + return getSparkForBlock(tile.getWorld(), tile.xCoord, tile.yCoord, tile.zCoord); } /** diff --git a/src/main/java/vazkii/botania/api/internal/VanillaPacketDispatcher.java b/src/main/java/vazkii/botania/api/internal/VanillaPacketDispatcher.java index dff8b9636..d62088a53 100644 --- a/src/main/java/vazkii/botania/api/internal/VanillaPacketDispatcher.java +++ b/src/main/java/vazkii/botania/api/internal/VanillaPacketDispatcher.java @@ -19,7 +19,7 @@ import net.minecraft.world.World; public final class VanillaPacketDispatcher { public static void dispatchTEToNearbyPlayers(TileEntity tile) { - World world = tile.getWorldObj(); + World world = tile.getWorld(); List players = world.playerEntities; for(Object player : players) if(player instanceof EntityPlayerMP) { diff --git a/src/main/java/vazkii/botania/api/subtile/SubTileFunctional.java b/src/main/java/vazkii/botania/api/subtile/SubTileFunctional.java index d6156eafe..54863c864 100644 --- a/src/main/java/vazkii/botania/api/subtile/SubTileFunctional.java +++ b/src/main/java/vazkii/botania/api/subtile/SubTileFunctional.java @@ -73,16 +73,16 @@ public class SubTileFunctional extends SubTileEntity { if(acceptsRedstone()) { redstoneSignal = 0; for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - int redstoneSide = supertile.getWorldObj().getIndirectPowerLevelTo(supertile.xCoord + dir.offsetX, supertile.yCoord + dir.offsetY, supertile.zCoord + dir.offsetZ, dir.ordinal()); + int redstoneSide = supertile.getWorld().getIndirectPowerLevelTo(supertile.xCoord + dir.offsetX, supertile.yCoord + dir.offsetY, supertile.zCoord + dir.offsetZ, dir.ordinal()); redstoneSignal = Math.max(redstoneSignal, redstoneSide); } } - if(supertile.getWorldObj().isRemote) { + if(supertile.getWorld().isRemote) { double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F; Color color = new Color(getColor()); if(Math.random() > particleChance) - BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); + BotaniaAPI.internalHandler.sparkleFX(supertile.getWorld(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); } } @@ -93,9 +93,9 @@ public class SubTileFunctional extends SubTileEntity { if(cachedPoolCoordinates != null) { needsNew = false; - if(supertile.getWorldObj().blockExists(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ)) { + if(supertile.getWorld().blockExists(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ)) { needsNew = true; - TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ); + TileEntity tileAt = supertile.getWorld().getTileEntity(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ); if(tileAt != null && tileAt instanceof IManaPool && !tileAt.isInvalid()) { linkedPool = tileAt; needsNew = false; @@ -104,17 +104,17 @@ public class SubTileFunctional extends SubTileEntity { } } } else { - TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); + TileEntity tileAt = supertile.getWorld().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); if(tileAt != null && tileAt instanceof IManaPool) linkedPool = tileAt; } if(needsNew && ticksExisted == 1) { // Only for new flowers IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance(); - int size = network.getAllPoolsInWorld(supertile.getWorldObj()).size(); + int size = network.getAllPoolsInWorld(supertile.getWorld()).size(); if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) { ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); - linkedPool = network.getClosestPool(coords, supertile.getWorldObj(), RANGE); + linkedPool = network.getClosestPool(coords, supertile.getWorld(), RANGE); sizeLastCheck = size; } } @@ -207,7 +207,7 @@ public class SubTileFunctional extends SubTileEntity { } public boolean isValidBinding() { - return linkedPool != null && !linkedPool.isInvalid() && supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord) == linkedPool; + return linkedPool != null && !linkedPool.isInvalid() && supertile.getWorld().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord) == linkedPool; } @Override diff --git a/src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java b/src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java index 0dd2f329a..71bac81f2 100644 --- a/src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java +++ b/src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java @@ -71,7 +71,7 @@ public class SubTileGenerating extends SubTileEntity { if(canGeneratePassively()) { int delay = getDelayBetweenPassiveGeneration(); - if(delay > 0 && ticksExisted % delay == 0 && !supertile.getWorldObj().isRemote) { + if(delay > 0 && ticksExisted % delay == 0 && !supertile.getWorld().isRemote) { if(shouldSyncPassiveGeneration()) sync(); addMana(getValueForPassiveGeneration()); @@ -82,27 +82,27 @@ public class SubTileGenerating extends SubTileEntity { if(acceptsRedstone()) { redstoneSignal = 0; for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - int redstoneSide = supertile.getWorldObj().getIndirectPowerLevelTo(supertile.xCoord + dir.offsetX, supertile.yCoord + dir.offsetY, supertile.zCoord + dir.offsetZ, dir.ordinal()); + int redstoneSide = supertile.getWorld().getIndirectPowerLevelTo(supertile.xCoord + dir.offsetX, supertile.yCoord + dir.offsetY, supertile.zCoord + dir.offsetZ, dir.ordinal()); redstoneSignal = Math.max(redstoneSignal, redstoneSide); } } - if(supertile.getWorldObj().isRemote) { + if(supertile.getWorld().isRemote) { double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F; Color color = new Color(getColor()); if(Math.random() > particleChance) - BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); + BotaniaAPI.internalHandler.sparkleFX(supertile.getWorld(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); } boolean passive = isPassiveFlower(); - if(!supertile.getWorldObj().isRemote) { + if(!supertile.getWorld().isRemote) { int muhBalance = BotaniaAPI.internalHandler.getPassiveFlowerDecay(); if(passive && muhBalance > 0 && passiveDecayTicks > muhBalance) { - supertile.getWorldObj().playAuxSFX(2001, supertile.xCoord, supertile.yCoord, supertile.zCoord, Block.getIdFromBlock(supertile.getBlockType())); - if(supertile.getWorldObj().getBlock(supertile.xCoord, supertile.yCoord - 1, supertile.zCoord).isSideSolid(supertile.getWorldObj(), supertile.xCoord, supertile.yCoord - 1, supertile.zCoord, ForgeDirection.UP)) - supertile.getWorldObj().setBlock(supertile.xCoord, supertile.yCoord, supertile.zCoord, Blocks.deadbush); - else supertile.getWorldObj().setBlockToAir(supertile.xCoord, supertile.yCoord, supertile.zCoord); + supertile.getWorld().playAuxSFX(2001, supertile.xCoord, supertile.yCoord, supertile.zCoord, Block.getIdFromBlock(supertile.getBlockType())); + if(supertile.getWorld().getBlock(supertile.xCoord, supertile.yCoord - 1, supertile.zCoord).isSideSolid(supertile.getWorld(), supertile.xCoord, supertile.yCoord - 1, supertile.zCoord, ForgeDirection.UP)) + supertile.getWorld().setBlock(supertile.xCoord, supertile.yCoord, supertile.zCoord, Blocks.deadbush); + else supertile.getWorld().setBlockToAir(supertile.xCoord, supertile.yCoord, supertile.zCoord); } } @@ -117,9 +117,9 @@ public class SubTileGenerating extends SubTileEntity { if(cachedCollectorCoordinates != null) { needsNew = false; - if(supertile.getWorldObj().blockExists(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ)) { + if(supertile.getWorld().blockExists(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ)) { needsNew = true; - TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ); + TileEntity tileAt = supertile.getWorld().getTileEntity(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ); if(tileAt != null && tileAt instanceof IManaCollector && !tileAt.isInvalid()) { linkedCollector = tileAt; needsNew = false; @@ -128,17 +128,17 @@ public class SubTileGenerating extends SubTileEntity { } } } else { - TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord); + TileEntity tileAt = supertile.getWorld().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord); if(tileAt != null && tileAt instanceof IManaCollector) linkedCollector = tileAt; } if(needsNew && ticksExisted == 1) { // New flowers only IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance(); - int size = network.getAllCollectorsInWorld(supertile.getWorldObj()).size(); + int size = network.getAllCollectorsInWorld(supertile.getWorld()).size(); if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) { ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); - linkedCollector = network.getClosestCollector(coords, supertile.getWorldObj(), RANGE); + linkedCollector = network.getClosestCollector(coords, supertile.getWorld(), RANGE); sizeLastCheck = size; } } @@ -298,7 +298,7 @@ public class SubTileGenerating extends SubTileEntity { public boolean isValidBinding() { - return linkedCollector != null && !linkedCollector.isInvalid() && supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord) == linkedCollector; + return linkedCollector != null && !linkedCollector.isInvalid() && supertile.getWorld().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord) == linkedCollector; } @Override diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileAvatar.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileAvatar.java index 03dd328c6..37c9d1074 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileAvatar.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileAvatar.java @@ -51,7 +51,7 @@ public class RenderTileAvatar extends TileEntitySpecialRenderer { GL11.glTranslated(d0, d1, d2); Minecraft.getMinecraft().renderEngine.bindTexture(texture); - int meta = avatar.getWorldObj() != null ? avatar.getBlockMetadata() : 0; + int meta = avatar.getWorld() != null ? avatar.getBlockMetadata() : 0; GL11.glTranslatef(0.5F, 1.6F, 0.5F); GL11.glScalef(1F, -1F, -1F); diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileBellows.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileBellows.java index 77cd86806..a67b02c3e 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileBellows.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileBellows.java @@ -41,7 +41,7 @@ public class RenderTileBellows extends TileEntitySpecialRenderer { GL11.glTranslated(d0, d1, d2); Minecraft.getMinecraft().renderEngine.bindTexture(texture); - int meta = bellows.getWorldObj() != null ? bellows.getBlockMetadata() : 0; + int meta = bellows.getWorld() != null ? bellows.getBlockMetadata() : 0; GL11.glTranslatef(0.5F, 1.5F, 0.5F); GL11.glScalef(1F, -1F, -1F); diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileBrewery.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileBrewery.java index d649d0edc..4cb1e4f9d 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileBrewery.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileBrewery.java @@ -71,7 +71,7 @@ public class RenderTileBrewery extends TileEntitySpecialRenderer { float s = 0.25F; GL11.glScalef(s, s, s); GL11.glScalef(2F, 2F, 2F); - if(!ForgeHooksClient.renderEntityItem(new EntityItem(brewery.getWorldObj(), brewery.xCoord, brewery.yCoord, brewery.zCoord, stack), stack, 0F, 0F, brewery.getWorldObj().rand, mc.renderEngine, RenderBlocks.getInstance(), 1)) { + if(!ForgeHooksClient.renderEntityItem(new EntityItem(brewery.getWorld(), brewery.xCoord, brewery.yCoord, brewery.zCoord, stack), stack, 0F, 0F, brewery.getWorld().rand, mc.renderEngine, RenderBlocks.getInstance(), 1)) { GL11.glScalef(0.5F, 0.5F, 0.5F); if(stack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(stack.getItem()).getRenderType())) { GL11.glScalef(0.5F, 0.5F, 0.5F); diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaCrystalCube.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaCrystalCube.java index 71f7d6eef..81dcbb099 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaCrystalCube.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaCrystalCube.java @@ -40,14 +40,14 @@ public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer { TileCorporeaCrystalCube cube = (TileCorporeaCrystalCube) tileentity; if(entity == null) - entity = new EntityItem(cube.getWorldObj(), cube.xCoord, cube.yCoord, cube.zCoord, new ItemStack(Blocks.stone)); + entity = new EntityItem(cube.getWorld(), cube.xCoord, cube.yCoord, cube.zCoord, new ItemStack(Blocks.stone)); entity.age = ClientTickHandler.ticksInGame; ItemStack stack = cube.getRequestTarget(); entity.setEntityItemStack(stack); double time = ClientTickHandler.ticksInGame + f; - double worldTicks = tileentity.getWorldObj() == null ? 0 : time; + double worldTicks = tileentity.getWorld() == null ? 0 : time; Minecraft mc = Minecraft.getMinecraft(); GL11.glPushMatrix(); diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileEnchanter.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileEnchanter.java index 6d9b654fa..2538210de 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileEnchanter.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileEnchanter.java @@ -48,7 +48,7 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer { if(enchanter.itemToEnchant != null) { if(item == null) - item = new EntityItem(enchanter.getWorldObj(), enchanter.xCoord, enchanter.yCoord + 1, enchanter.zCoord, enchanter.itemToEnchant); + item = new EntityItem(enchanter.getWorld(), enchanter.xCoord, enchanter.yCoord + 1, enchanter.zCoord, enchanter.itemToEnchant); item.age = ClientTickHandler.ticksInGame; item.setEntityItemStack(enchanter.itemToEnchant); diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileFloatingFlower.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileFloatingFlower.java index bea58c6d8..f0269d566 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileFloatingFlower.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileFloatingFlower.java @@ -38,15 +38,15 @@ public class RenderTileFloatingFlower extends TileEntitySpecialRenderer { GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glTranslated(d0, d1, d2); - double worldTime = tile.getWorldObj() == null ? 0 : (double) (ClientTickHandler.ticksInGame + t); - if(tile.getWorldObj() != null) + double worldTime = tile.getWorld() == null ? 0 : (double) (ClientTickHandler.ticksInGame + t); + if(tile.getWorld() != null) worldTime += new Random(tile.xCoord ^ tile.yCoord ^ tile.zCoord).nextInt(1000); GL11.glTranslatef(0.5F, 0F, 0.5F); GL11.glRotatef(-((float) worldTime * 0.5F), 0F, 1F, 0F); GL11.glTranslatef(-0.5F, 0F, -0.5F); - if(tile.getWorldObj() != null) { + if(tile.getWorld() != null) { GL11.glTranslatef(0F, (float) Math.sin(worldTime * 0.05F) * 0.1F, 0F); GL11.glRotatef(4F * (float) Math.sin(worldTime * 0.04F), 1F, 0F, 0F); } diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileHourglass.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileHourglass.java index c5bb50574..5d9ffbcd4 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileHourglass.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileHourglass.java @@ -41,7 +41,7 @@ public class RenderTileHourglass extends TileEntitySpecialRenderer { GL11.glTranslated(d0, d1, d2); Minecraft.getMinecraft().renderEngine.bindTexture(texture); - int wtime = tileentity.getWorldObj() == null ? 0 : ClientTickHandler.ticksInGame; + int wtime = tileentity.getWorld() == null ? 0 : ClientTickHandler.ticksInGame; if(wtime != 0) wtime += new Random(tileentity.xCoord ^ tileentity.yCoord ^ tileentity.zCoord).nextInt(360); diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileIncensePlate.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileIncensePlate.java index 3a786db70..36970017f 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileIncensePlate.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileIncensePlate.java @@ -42,7 +42,7 @@ public class RenderTileIncensePlate extends TileEntitySpecialRenderer { public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float ticks) { TileIncensePlate plate = (TileIncensePlate) tileentity; - int meta = plate.getWorldObj() != null ? plate.getBlockMetadata() : 0; + int meta = plate.getWorld() != null ? plate.getBlockMetadata() : 0; GL11.glPushMatrix(); GL11.glEnable(GL12.GL_RESCALE_NORMAL); diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTilePool.java b/src/main/java/vazkii/botania/client/render/tile/RenderTilePool.java index 5aca76994..b0ad21f9d 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTilePool.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTilePool.java @@ -57,8 +57,8 @@ public class RenderTilePool extends TileEntitySpecialRenderer { float a = MultiblockRenderHandler.rendering ? 0.6F : 1F; GL11.glColor4f(1F, 1F, 1F, a); GL11.glTranslated(d0, d1, d2); - boolean inf = tileentity.getWorldObj() == null ? forceMeta == 1 : tileentity.getBlockMetadata() == 1; - boolean dil = tileentity.getWorldObj() == null ? forceMeta == 2 : tileentity.getBlockMetadata() == 2; + boolean inf = tileentity.getWorld() == null ? forceMeta == 1 : tileentity.getBlockMetadata() == 1; + boolean dil = tileentity.getWorld() == null ? forceMeta == 2 : tileentity.getBlockMetadata() == 2; Minecraft.getMinecraft().renderEngine.bindTexture(inf ? textureInf : dil ? textureDil : texture); @@ -89,10 +89,10 @@ public class RenderTilePool extends TileEntitySpecialRenderer { float v = 1F / 8F; float w = -v * 3.5F; - if(pool.getWorldObj() != null) { - Block below = pool.getWorldObj().getBlock(pool.xCoord, pool.yCoord - 1, pool.zCoord); + if(pool.getWorld() != null) { + Block below = pool.getWorld().getBlock(pool.xCoord, pool.yCoord - 1, pool.zCoord); if(below instanceof IPoolOverlayProvider) { - IIcon overlay = ((IPoolOverlayProvider) below).getIcon(pool.getWorldObj(), pool.xCoord, pool.yCoord - 1, pool.zCoord); + IIcon overlay = ((IPoolOverlayProvider) below).getIcon(pool.getWorld(), pool.xCoord, pool.yCoord - 1, pool.zCoord); if(overlay != null) { GL11.glPushMatrix(); GL11.glEnable(GL11.GL_BLEND); diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTilePump.java b/src/main/java/vazkii/botania/client/render/tile/RenderTilePump.java index 62e561177..0ab0d3825 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTilePump.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTilePump.java @@ -41,7 +41,7 @@ public class RenderTilePump extends TileEntitySpecialRenderer { GL11.glTranslated(d0, d1, d2); Minecraft.getMinecraft().renderEngine.bindTexture(texture); - int meta = pump.getWorldObj() != null ? pump.getBlockMetadata() : 0; + int meta = pump.getWorld() != null ? pump.getBlockMetadata() : 0; GL11.glTranslatef(0.5F, 0.5F, 0.5F); GL11.glScalef(1F, -1F, -1F); diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTilePylon.java b/src/main/java/vazkii/botania/client/render/tile/RenderTilePylon.java index 209fe9596..650592657 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTilePylon.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTilePylon.java @@ -56,7 +56,7 @@ public class RenderTilePylon extends TileEntitySpecialRenderer { GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); float a = MultiblockRenderHandler.rendering ? 0.6F : 1F; GL11.glColor4f(1F, 1F, 1F, a); - if(tileentity.getWorldObj() != null) { + if(tileentity.getWorld() != null) { green = tileentity.getBlockMetadata() == 1; pink = tileentity.getBlockMetadata() == 2; } @@ -65,7 +65,7 @@ public class RenderTilePylon extends TileEntitySpecialRenderer { Minecraft.getMinecraft().renderEngine.bindTexture(pink ? texturePinkOld : green ? textureGreenOld : textureOld); else Minecraft.getMinecraft().renderEngine.bindTexture(pink ? texturePink : green ? textureGreen : texture); - double worldTime = tileentity.getWorldObj() == null ? 0 : (double) (ClientTickHandler.ticksInGame + pticks); + double worldTime = tileentity.getWorld() == null ? 0 : (double) (ClientTickHandler.ticksInGame + pticks); if(tileentity != null) worldTime += new Random(tileentity.xCoord ^ tileentity.yCoord ^ tileentity.zCoord).nextInt(360); diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileRuneAltar.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileRuneAltar.java index 245c62cd9..691abc521 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileRuneAltar.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileRuneAltar.java @@ -74,7 +74,7 @@ public class RenderTileRuneAltar extends TileEntitySpecialRenderer { mc.renderEngine.bindTexture(stack.getItem() instanceof ItemBlock ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture); GL11.glScalef(2F, 2F, 2F); - if(!ForgeHooksClient.renderEntityItem(new EntityItem(altar.getWorldObj(), altar.xCoord, altar.yCoord, altar.zCoord, stack), stack, 0F, 0F, altar.getWorldObj().rand, mc.renderEngine, renderBlocks, 1)) { + if(!ForgeHooksClient.renderEntityItem(new EntityItem(altar.getWorld(), altar.xCoord, altar.yCoord, altar.zCoord, stack), stack, 0F, 0F, altar.getWorld().rand, mc.renderEngine, renderBlocks, 1)) { GL11.glScalef(0.5F, 0.5F, 0.5F); if(stack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(stack.getItem()).getRenderType())) { GL11.glScalef(0.5F, 0.5F, 0.5F); diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileSpreader.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileSpreader.java index e13a116c7..230e5215d 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileSpreader.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileSpreader.java @@ -77,7 +77,7 @@ public class RenderTileSpreader extends TileEntitySpecialRenderer { GL11.glColor3f(1F, 1F, 1F); GL11.glPushMatrix(); - double worldTicks = tileentity.getWorldObj() == null ? 0 : time; + double worldTicks = tileentity.getWorld() == null ? 0 : time; GL11.glRotatef((float) worldTicks % 360, 0F, 1F, 0F); GL11.glTranslatef(0F, (float) Math.sin(worldTicks / 20.0) * 0.05F, 0F); model.renderCube(); diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileTeruTeruBozu.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileTeruTeruBozu.java index adcb0cbc9..e66f634aa 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileTeruTeruBozu.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileTeruTeruBozu.java @@ -43,7 +43,7 @@ public class RenderTileTeruTeruBozu extends TileEntitySpecialRenderer { Minecraft.getMinecraft().renderEngine.bindTexture(ClientProxy.dootDoot ? textureHalloween : texture); GL11.glRotatef(180F, 1F, 0F, 0F); double time = Botania.proxy.getWorldElapsedTicks() + f; - boolean hasWorld = tileentity.getWorldObj() != null; + boolean hasWorld = tileentity.getWorld() != null; if(hasWorld) time += new Random(tileentity.xCoord ^ tileentity.yCoord ^ tileentity.zCoord).nextInt(1000); diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileTinyPotato.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileTinyPotato.java index d8883a54a..f8b8aa176 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileTinyPotato.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileTinyPotato.java @@ -85,7 +85,7 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer { GL11.glTranslatef(0.5F, 1.5F, 0.5F); GL11.glScalef(1F, -1F, -1F); - int meta = potato.getWorldObj() == null ? 3 : potato.getBlockMetadata(); + int meta = potato.getWorld() == null ? 3 : potato.getBlockMetadata(); float rotY = meta * 90F - 180F; GL11.glRotatef(rotY, 0F, 1F, 0F); diff --git a/src/main/java/vazkii/botania/common/block/subtile/SubTileManastar.java b/src/main/java/vazkii/botania/common/block/subtile/SubTileManastar.java index 4c5c45c19..821a86c9d 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/SubTileManastar.java +++ b/src/main/java/vazkii/botania/common/block/subtile/SubTileManastar.java @@ -29,14 +29,14 @@ public class SubTileManastar extends SubTileEntity { int mana = 0; for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) { - TileEntity tile = supertile.getWorldObj().getTileEntity(supertile.xCoord + dir.offsetX, supertile.yCoord, supertile.zCoord + dir.offsetZ); + TileEntity tile = supertile.getWorld().getTileEntity(supertile.xCoord + dir.offsetX, supertile.yCoord, supertile.zCoord + dir.offsetZ); if(tile instanceof IManaPool) mana += ((IManaPool) tile).getCurrentMana(); } if(manaLastTick != -1 && mana != manaLastTick && Math.random() > 0.6) { boolean more = mana > manaLastTick; - Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.75 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, more ? 0.05F : 1F, 0.05F, more ? 1F : 0.05F, (float) Math.random() / 7, (float) -Math.random() / 50); + Botania.proxy.wispFX(supertile.getWorld(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.75 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, more ? 0.05F : 1F, 0.05F, more ? 1F : 0.05F, (float) Math.random() / 7, (float) -Math.random() / 50); } if(ticksExisted % 60 == 0) diff --git a/src/main/java/vazkii/botania/common/block/subtile/SubTilePureDaisy.java b/src/main/java/vazkii/botania/common/block/subtile/SubTilePureDaisy.java index 3ff872c9a..a603711f0 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/SubTilePureDaisy.java +++ b/src/main/java/vazkii/botania/common/block/subtile/SubTilePureDaisy.java @@ -52,7 +52,7 @@ public class SubTilePureDaisy extends SubTileEntity { int[] acoords = POSITIONS[positionAt]; ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord + acoords[0], supertile.yCoord + acoords[1], supertile.zCoord + acoords[2]); - World world = supertile.getWorldObj(); + World world = supertile.getWorld(); if(!world.isAirBlock(coords.posX, coords.posY, coords.posZ)) { Block block = world.getBlock(coords.posX, coords.posY, coords.posZ); int meta = world.getBlockMetadata(coords.posX, coords.posY, coords.posZ); @@ -67,7 +67,7 @@ public class SubTilePureDaisy extends SubTileEntity { if(recipe != null) { ticksRemaining[positionAt] = ticksRemaining[positionAt] - 1; - Botania.proxy.sparkleFX(supertile.getWorldObj(), coords.posX + Math.random(), coords.posY + Math.random(), coords.posZ + Math.random(), 1F, 1F, 1F, (float) Math.random(), 5); + Botania.proxy.sparkleFX(supertile.getWorld(), coords.posX + Math.random(), coords.posY + Math.random(), coords.posZ + Math.random(), 1F, 1F, 1F, (float) Math.random(), 5); if(ticksRemaining[positionAt] <= 0) { ticksRemaining[positionAt] = 200; @@ -78,10 +78,10 @@ public class SubTilePureDaisy extends SubTileEntity { double y = coords.posY + Math.random() + 0.5; double z = coords.posZ + Math.random(); - Botania.proxy.wispFX(supertile.getWorldObj(), x, y, z, 1F, 1F, 1F, (float) Math.random() / 2F); + Botania.proxy.wispFX(supertile.getWorld(), x, y, z, 1F, 1F, 1F, (float) Math.random() / 2F); } if(ConfigHandler.blockBreakParticles) - supertile.getWorldObj().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(recipe.getOutput()) + (recipe.getOutputMeta() << 12)); + supertile.getWorld().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(recipe.getOutput()) + (recipe.getOutputMeta() << 12)); } } } else ticksRemaining[positionAt] = 200; @@ -97,7 +97,7 @@ public class SubTilePureDaisy extends SubTileEntity { public void readFromPacketNBT(NBTTagCompound cmp) { positionAt = cmp.getInteger(TAG_POSITION); - if(supertile.getWorldObj() != null && !supertile.getWorldObj().isRemote) + if(supertile.getWorld() != null && !supertile.getWorld().isRemote) for(int i = 0; i < ticksRemaining.length; i++) ticksRemaining[i] = cmp.getInteger(TAG_TICKS_REMAINING + i); } diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileAgricarnation.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileAgricarnation.java index 63d466819..5ee99fe17 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileAgricarnation.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileAgricarnation.java @@ -34,22 +34,22 @@ public class SubTileAgricarnation extends SubTileFunctional { if(ticksExisted % 6 == 0 && redstoneSignal == 0) { int range = getRange(); - int x = supertile.xCoord + supertile.getWorldObj().rand.nextInt(range * 2 + 1) - range; - int z = supertile.zCoord + supertile.getWorldObj().rand.nextInt(range * 2 + 1) - range; + int x = supertile.xCoord + supertile.getWorld().rand.nextInt(range * 2 + 1) - range; + int z = supertile.zCoord + supertile.getWorld().rand.nextInt(range * 2 + 1) - range; for(int i = 4; i > -2; i--) { int y = supertile.yCoord + i; - if(supertile.getWorldObj().isAirBlock(x, y, z)) + if(supertile.getWorld().isAirBlock(x, y, z)) continue; if(isPlant(x, y, z) && mana > 5) { - Block block = supertile.getWorldObj().getBlock(x, y, z); + Block block = supertile.getWorld().getBlock(x, y, z); mana -= 5; - supertile.getWorldObj().scheduleBlockUpdate(x, y, z, block, 1); + supertile.getWorld().scheduleBlockUpdate(x, y, z, block, 1); if(ConfigHandler.blockBreakParticles) - supertile.getWorldObj().playAuxSFX(2005, x, y, z, 6 + supertile.getWorldObj().rand.nextInt(4)); - supertile.getWorldObj().playSoundEffect(x, y, z, "botania:agricarnation", 0.1F, 0.5F + (float) Math.random() * 0.5F); + supertile.getWorld().playAuxSFX(2005, x, y, z, 6 + supertile.getWorld().rand.nextInt(4)); + supertile.getWorld().playSoundEffect(x, y, z, "botania:agricarnation", 0.1F, 0.5F + (float) Math.random() * 0.5F); break; } @@ -63,12 +63,12 @@ public class SubTileAgricarnation extends SubTileFunctional { } boolean isPlant(int x, int y, int z) { - Block block = supertile.getWorldObj().getBlock(x, y, z); + Block block = supertile.getWorld().getBlock(x, y, z); if(block == Blocks.grass || block == Blocks.leaves || block == Blocks.leaves2 || block instanceof BlockBush && !(block instanceof BlockCrops) && !(block instanceof BlockSapling)) return false; Material mat = block.getMaterial(); - return mat != null && (mat == Material.plants || mat == Material.cactus || mat == Material.grass || mat == Material.leaves || mat == Material.gourd) && block instanceof IGrowable && ((IGrowable) block).func_149851_a(supertile.getWorldObj(), x, y, z, supertile.getWorldObj().isRemote); + return mat != null && (mat == Material.plants || mat == Material.cactus || mat == Material.grass || mat == Material.leaves || mat == Material.gourd) && block instanceof IGrowable && ((IGrowable) block).func_149851_a(supertile.getWorld(), x, y, z, supertile.getWorld().isRemote); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBellethorn.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBellethorn.java index 22e12e409..b533a2594 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBellethorn.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBellethorn.java @@ -49,7 +49,7 @@ public class SubTileBellethorn extends SubTileFunctional { if(ticksExisted % 5 == 0) { int range = getRange(); - List entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range + 1, supertile.yCoord + 1, supertile.zCoord + range + 1)); + List entities = supertile.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range + 1, supertile.yCoord + 1, supertile.zCoord + range + 1)); IEntitySelector selector = getSelector(); for(EntityLivingBase entity : entities) { diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBubbell.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBubbell.java index 10c62757c..eeb28f972 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBubbell.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileBubbell.java @@ -47,10 +47,10 @@ public class SubTileBubbell extends SubTileFunctional { for(int j = -range; j < range + 1; j++) for(int k = -range; k < range + 1; k++) if(MathHelper.pointDistanceSpace(i, j, k, 0, 0, 0) < range) { - Block block = supertile.getWorldObj().getBlock(supertile.xCoord + i, supertile.yCoord + j, supertile.zCoord + k); + Block block = supertile.getWorld().getBlock(supertile.xCoord + i, supertile.yCoord + j, supertile.zCoord + k); if(block.getMaterial() == Material.water) { - supertile.getWorldObj().setBlock(supertile.xCoord + i, supertile.yCoord + j, supertile.zCoord + k, ModBlocks.fakeAir, 0, 2); - TileFakeAir air = (TileFakeAir) supertile.getWorldObj().getTileEntity(supertile.xCoord + i, supertile.yCoord + j, supertile.zCoord + k); + supertile.getWorld().setBlock(supertile.xCoord + i, supertile.yCoord + j, supertile.zCoord + k, ModBlocks.fakeAir, 0, 2); + TileFakeAir air = (TileFakeAir) supertile.getWorld().getTileEntity(supertile.xCoord + i, supertile.yCoord + j, supertile.zCoord + k); air.setFlower(supertile); } } diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileClayconia.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileClayconia.java index 9686fdbf8..fc7d053fc 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileClayconia.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileClayconia.java @@ -33,16 +33,16 @@ public class SubTileClayconia extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if(!supertile.getWorldObj().isRemote && ticksExisted % 5 == 0) { + if(!supertile.getWorld().isRemote && ticksExisted % 5 == 0) { int manaCost = 80; if(mana >= manaCost) { ChunkCoordinates coords = getCoordsToPut(); if(coords != null) { - supertile.getWorldObj().setBlockToAir(coords.posX, coords.posY, coords.posZ); + supertile.getWorld().setBlockToAir(coords.posX, coords.posY, coords.posZ); if(ConfigHandler.blockBreakParticles) - supertile.getWorldObj().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(Block.getBlockFromName("sand"))); - EntityItem item = new EntityItem(supertile.getWorldObj(), coords.posX + 0.5, coords.posY + 0.5, coords.posZ + 0.5, new ItemStack(Items.clay_ball)); - supertile.getWorldObj().spawnEntityInWorld(item); + supertile.getWorld().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(Block.getBlockFromName("sand"))); + EntityItem item = new EntityItem(supertile.getWorld(), coords.posX + 0.5, coords.posY + 0.5, coords.posZ + 0.5, new ItemStack(Items.clay_ball)); + supertile.getWorld().spawnEntityInWorld(item); mana -= manaCost; } } @@ -58,14 +58,14 @@ public class SubTileClayconia extends SubTileFunctional { int x = supertile.xCoord + i; int y = supertile.yCoord + j; int z = supertile.zCoord + k; - Block block = supertile.getWorldObj().getBlock(x, y, z); + Block block = supertile.getWorld().getBlock(x, y, z); if(block == Block.getBlockFromName("sand")) possibleCoords.add(new ChunkCoordinates(x, y, z)); } if(possibleCoords.isEmpty()) return null; - return possibleCoords.get(supertile.getWorldObj().rand.nextInt(possibleCoords.size())); + return possibleCoords.get(supertile.getWorld().rand.nextInt(possibleCoords.size())); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileDaffomill.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileDaffomill.java index a4f5b4167..0c3ddf91b 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileDaffomill.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileDaffomill.java @@ -37,8 +37,8 @@ public class SubTileDaffomill extends SubTileFunctional { super.onUpdate(); ForgeDirection dir = ForgeDirection.getOrientation(orientation + 2); - if(supertile.getWorldObj().rand.nextInt(4) == 0) - Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + Math.random(), supertile.yCoord + Math.random(), supertile.zCoord + Math.random(), 0.05F, 0.05F, 0.05F, 0.25F + (float) Math.random() * 0.15F, dir.offsetX * 0.1F, dir.offsetY * 0.1F, dir.offsetZ * 0.1F); + if(supertile.getWorld().rand.nextInt(4) == 0) + Botania.proxy.wispFX(supertile.getWorld(), supertile.xCoord + Math.random(), supertile.yCoord + Math.random(), supertile.zCoord + Math.random(), 0.05F, 0.05F, 0.05F, 0.25F + (float) Math.random() * 0.15F, dir.offsetX * 0.1F, dir.offsetY * 0.1F, dir.offsetZ * 0.1F); if(windTicks == 0 && mana > 0) { windTicks = 20; @@ -49,7 +49,7 @@ public class SubTileDaffomill extends SubTileFunctional { AxisAlignedBB axis = aabbForOrientation(); if(axis != null) { - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, axis); + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, axis); for(EntityItem item : items) { item.motionX += dir.offsetX * 0.05; item.motionY += dir.offsetY * 0.05; diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileExoflame.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileExoflame.java index 91ca70e39..e959132ba 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileExoflame.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileExoflame.java @@ -43,8 +43,8 @@ public class SubTileExoflame extends SubTileFunctional { int y = supertile.yCoord + j; int z = supertile.zCoord + k; - TileEntity tile = supertile.getWorldObj().getTileEntity(x, y, z); - Block block = supertile.getWorldObj().getBlock(x, y, z); + TileEntity tile = supertile.getWorld().getTileEntity(x, y, z); + Block block = supertile.getWorld().getBlock(x, y, z); if(tile != null) { if(tile instanceof TileEntityFurnace && (block == Blocks.furnace || block == Blocks.lit_furnace)) { TileEntityFurnace furnace = (TileEntityFurnace) tile; @@ -52,7 +52,7 @@ public class SubTileExoflame extends SubTileFunctional { if(canSmelt && mana > 2) { if(furnace.furnaceBurnTime < 2) { if(furnace.furnaceBurnTime == 0) - BlockFurnace.updateFurnaceBlockState(true, supertile.getWorldObj(), x, y, z); + BlockFurnace.updateFurnaceBlockState(true, supertile.getWorld(), x, y, z); furnace.furnaceBurnTime = 200; mana = Math.max(0, mana - cost); } diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileFallenKanade.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileFallenKanade.java index 028f16762..8ee26f47d 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileFallenKanade.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileFallenKanade.java @@ -31,8 +31,8 @@ public class SubTileFallenKanade extends SubTileFunctional { final int cost = 120; - if(!supertile.getWorldObj().isRemote && supertile.getWorldObj().provider.dimensionId != 1) { - List players = supertile.getWorldObj().getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); + if(!supertile.getWorld().isRemote && supertile.getWorld().provider.dimensionId != 1) { + List players = supertile.getWorld().getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); for(EntityPlayer player : players) { if(player.getActivePotionEffect(Potion.regeneration) == null && mana >= cost ) { player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 60, 2)); diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHeiseiDream.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHeiseiDream.java index e7bd32c67..cc8abe791 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHeiseiDream.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHeiseiDream.java @@ -37,7 +37,7 @@ public class SubTileHeiseiDream extends SubTileFunctional { final int cost = 100; - List mobs = supertile.getWorldObj().getEntitiesWithinAABB(IMob.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); + List mobs = supertile.getWorld().getEntitiesWithinAABB(IMob.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); if(mobs.size() > 1 && mana >= cost) for(IMob mob : mobs) { if(mob instanceof EntityLiving) { diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java index 132c291d4..13640f273 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java @@ -53,7 +53,7 @@ public class SubTileHopperhock extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if(redstoneSignal > 0 || supertile.getWorldObj().isRemote) + if(redstoneSignal > 0 || supertile.getWorld().isRemote) return; boolean pulledAny = false; @@ -63,7 +63,7 @@ public class SubTileHopperhock extends SubTileFunctional { int y = supertile.yCoord; int z = supertile.zCoord; - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(x - range, y - range, z - range, x + range + 1, y + range + 1, z + range + 1)); + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(x - range, y - range, z - range, x + range + 1, y + range + 1, z + range + 1)); for(EntityItem item : items) { if(item.age < 60 || item.age >= 105 && item.age < 110 || item.isDead) continue; @@ -79,7 +79,7 @@ public class SubTileHopperhock extends SubTileFunctional { int y_ = y + dir.offsetY; int z_ = z + dir.offsetZ; - IInventory inv = InventoryHelper.getInventory(supertile.getWorldObj(), x_, y_, z_); + IInventory inv = InventoryHelper.getInventory(supertile.getWorld(), x_, y_, z_); if(inv != null) { List filter = getFilterForInventory(inv, x_, y_, z_, true); boolean canAccept = canAcceptItem(stack, filter, filterType); @@ -152,13 +152,13 @@ public class SubTileHopperhock extends SubTileFunctional { List filter = new ArrayList(); if(recursiveForDoubleChests) { - TileEntity tileEntity = supertile.getWorldObj().getTileEntity(x, y, z); - Block chest = supertile.getWorldObj().getBlock(x, y, z); + TileEntity tileEntity = supertile.getWorld().getTileEntity(x, y, z); + Block chest = supertile.getWorld().getBlock(x, y, z); if(tileEntity instanceof TileEntityChest) for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) - if(supertile.getWorldObj().getBlock(x + dir.offsetX, y, z + dir.offsetZ) == chest) { - filter.addAll(getFilterForInventory((IInventory) supertile.getWorldObj().getTileEntity(x + dir.offsetX, y, z + dir.offsetZ), x + dir.offsetX, y, z + dir.offsetZ, false)); + if(supertile.getWorld().getBlock(x + dir.offsetX, y, z + dir.offsetZ) == chest) { + filter.addAll(getFilterForInventory((IInventory) supertile.getWorld().getTileEntity(x + dir.offsetX, y, z + dir.offsetZ), x + dir.offsetX, y, z + dir.offsetZ, false)); break; } } @@ -169,7 +169,7 @@ public class SubTileHopperhock extends SubTileFunctional { for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) { AxisAlignedBB aabb = new AxisAlignedBB(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, x + dir.offsetX + 1, y + dir.offsetY + 1, z + dir.offsetZ + 1); - List frames = supertile.getWorldObj().getEntitiesWithinAABB(EntityItemFrame.class, aabb); + List frames = supertile.getWorld().getEntitiesWithinAABB(EntityItemFrame.class, aabb); for(EntityItemFrame frame : frames) { int orientation = frame.hangingDirection; if(orientationToDir[orientation] == dir.ordinal()) diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHyacidus.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHyacidus.java index c0a0e900f..d6488c6e5 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHyacidus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHyacidus.java @@ -36,7 +36,7 @@ public class SubTileHyacidus extends SubTileFunctional { final int cost = 20; - List entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); + List entities = supertile.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); for(EntityLivingBase entity : entities) { if(!(entity instanceof EntityPlayer) && entity.getActivePotionEffect(Potion.poison) == null && mana >= cost && !entity.worldObj.isRemote && entity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD) { entity.addPotionEffect(new PotionEffect(Potion.poison.id, 60, 0)); diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileJadedAmaranthus.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileJadedAmaranthus.java index 8501cd179..315b60e3f 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileJadedAmaranthus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileJadedAmaranthus.java @@ -31,19 +31,19 @@ public class SubTileJadedAmaranthus extends SubTileFunctional { if(redstoneSignal > 0) return; - if(mana >= COST && !supertile.getWorldObj().isRemote && ticksExisted % 30 == 0) { - int x = supertile.xCoord - RANGE + supertile.getWorldObj().rand.nextInt(RANGE * 2 + 1); + if(mana >= COST && !supertile.getWorld().isRemote && ticksExisted % 30 == 0) { + int x = supertile.xCoord - RANGE + supertile.getWorld().rand.nextInt(RANGE * 2 + 1); int y = supertile.yCoord + RANGE; - int z = supertile.zCoord - RANGE + supertile.getWorldObj().rand.nextInt(RANGE * 2 + 1); + int z = supertile.zCoord - RANGE + supertile.getWorld().rand.nextInt(RANGE * 2 + 1); for(int i = 0; i < RANGE * 2; i++) { - Block blockAbove = supertile.getWorldObj().getBlock(x, y + 1, z); - if((supertile.getWorldObj().isAirBlock(x, y + 1, z) || blockAbove.isReplaceable(supertile.getWorldObj(), x, y + 1, z)) && blockAbove.getMaterial() != Material.water && ModBlocks.flower.canPlaceBlockAt(supertile.getWorldObj(), x, y + 1, z)) { - int color = supertile.getWorldObj().rand.nextInt(16); - if(ModBlocks.flower.canBlockStay(supertile.getWorldObj(), x, y + 1, z)) { + Block blockAbove = supertile.getWorld().getBlock(x, y + 1, z); + if((supertile.getWorld().isAirBlock(x, y + 1, z) || blockAbove.isReplaceable(supertile.getWorld(), x, y + 1, z)) && blockAbove.getMaterial() != Material.water && ModBlocks.flower.canPlaceBlockAt(supertile.getWorld(), x, y + 1, z)) { + int color = supertile.getWorld().rand.nextInt(16); + if(ModBlocks.flower.canBlockStay(supertile.getWorld(), x, y + 1, z)) { if(ConfigHandler.blockBreakParticles) - supertile.getWorldObj().playAuxSFX(2001, x, y + 1, z, Block.getIdFromBlock(ModBlocks.flower) + (color << 12)); - supertile.getWorldObj().setBlock(x, y + 1, z, ModBlocks.flower, color, 1 | 2); + supertile.getWorld().playAuxSFX(2001, x, y + 1, z, Block.getIdFromBlock(ModBlocks.flower) + (color << 12)); + supertile.getWorld().setBlock(x, y + 1, z, ModBlocks.flower, color, 1 | 2); } mana -= COST; diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileLoonuim.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileLoonuim.java index ce14cfaed..f20f1200d 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileLoonuim.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileLoonuim.java @@ -30,7 +30,7 @@ public class SubTileLoonuim extends SubTileFunctional { public void onUpdate() { super.onUpdate(); if(redstoneSignal == 0 && ticksExisted % 200 == 0 && mana >= COST) { - Random rand = supertile.getWorldObj().rand; + Random rand = supertile.getWorld().rand; ItemStack stack; do { @@ -38,13 +38,13 @@ public class SubTileLoonuim extends SubTileFunctional { } while(stack == null || BotaniaAPI.looniumBlacklist.contains(stack.getItem())); int bound = RANGE * 2 + 1; - EntityItem entity = new EntityItem(supertile.getWorldObj(), supertile.xCoord - RANGE + rand.nextInt(bound) , supertile.yCoord + 1, supertile.zCoord - RANGE + rand.nextInt(bound), stack); + EntityItem entity = new EntityItem(supertile.getWorld(), supertile.xCoord - RANGE + rand.nextInt(bound) , supertile.yCoord + 1, supertile.zCoord - RANGE + rand.nextInt(bound), stack); entity.motionX = 0; entity.motionY = 0; entity.motionZ = 0; - if(!supertile.getWorldObj().isRemote) - supertile.getWorldObj().spawnEntityInWorld(entity); + if(!supertile.getWorld().isRemote) + supertile.getWorld().spawnEntityInWorld(entity); mana -= COST; sync(); diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMarimorphosis.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMarimorphosis.java index 1df3dc62d..b1886c818 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMarimorphosis.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMarimorphosis.java @@ -53,16 +53,16 @@ public class SubTileMarimorphosis extends SubTileFunctional { if(redstoneSignal > 0) return; - if(!supertile.getWorldObj().isRemote && mana >= COST && ticksExisted % 2 == 0) { + if(!supertile.getWorld().isRemote && mana >= COST && ticksExisted % 2 == 0) { ChunkCoordinates coords = getCoordsToPut(); if(coords != null) { ItemStack stack = getStoneToPut(coords); if(stack != null) { Block block = Block.getBlockFromItem(stack.getItem()); int meta = stack.getItemDamage(); - supertile.getWorldObj().setBlock(coords.posX, coords.posY, coords.posZ, block, meta, 1 | 2); + supertile.getWorld().setBlock(coords.posX, coords.posY, coords.posZ, block, meta, 1 | 2); if(ConfigHandler.blockBreakParticles) - supertile.getWorldObj().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(block) + (meta << 12)); + supertile.getWorld().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(block) + (meta << 12)); mana -= COST; sync(); @@ -72,7 +72,7 @@ public class SubTileMarimorphosis extends SubTileFunctional { } public ItemStack getStoneToPut(ChunkCoordinates coords) { - List types = Arrays.asList(BiomeDictionary.getTypesForBiome(supertile.getWorldObj().getBiomeGenForCoords(coords.posX, coords.posZ))); + List types = Arrays.asList(BiomeDictionary.getTypesForBiome(supertile.getWorld().getBiomeGenForCoords(coords.posX, coords.posZ))); List values = new ArrayList(); for(int i = 0; i < 8; i++) { @@ -84,7 +84,7 @@ public class SubTileMarimorphosis extends SubTileFunctional { values.add(i); } - return new ItemStack(ModFluffBlocks.biomeStoneA, 1, values.get(supertile.getWorldObj().rand.nextInt(values.size()))); + return new ItemStack(ModFluffBlocks.biomeStoneA, 1, values.get(supertile.getWorld().rand.nextInt(values.size()))); } public ChunkCoordinates getCoordsToPut() { @@ -99,14 +99,14 @@ public class SubTileMarimorphosis extends SubTileFunctional { int x = supertile.xCoord + i; int y = supertile.yCoord + j; int z = supertile.zCoord + k; - Block block = supertile.getWorldObj().getBlock(x, y, z); - if(block != null && block.isReplaceableOreGen(supertile.getWorldObj(), x, y, z, Blocks.stone)) + Block block = supertile.getWorld().getBlock(x, y, z); + if(block != null && block.isReplaceableOreGen(supertile.getWorld(), x, y, z, Blocks.stone)) possibleCoords.add(new ChunkCoordinates(x, y, z)); } if(possibleCoords.isEmpty()) return null; - return possibleCoords.get(supertile.getWorldObj().rand.nextInt(possibleCoords.size())); + return possibleCoords.get(supertile.getWorld().rand.nextInt(possibleCoords.size())); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMedumone.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMedumone.java index 0e8709d80..0a35c5de7 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMedumone.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMedumone.java @@ -31,7 +31,7 @@ public class SubTileMedumone extends SubTileFunctional { super.onUpdate(); if(mana > 0) { - List entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + 1, supertile.zCoord + RANGE + 1)); + List entities = supertile.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + 1, supertile.zCoord + RANGE + 1)); for(EntityLivingBase entity : entities) if(!(entity instanceof EntityPlayer)) { diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechid.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechid.java index 8a027957b..a0054b7ae 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechid.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechid.java @@ -47,17 +47,17 @@ public class SubTileOrechid extends SubTileFunctional { return; int cost = getCost(); - if(!supertile.getWorldObj().isRemote && mana >= cost && ticksExisted % getDelay() == 0) { + if(!supertile.getWorld().isRemote && mana >= cost && ticksExisted % getDelay() == 0) { ChunkCoordinates coords = getCoordsToPut(); if(coords != null) { ItemStack stack = getOreToPut(); if(stack != null) { Block block = Block.getBlockFromItem(stack.getItem()); int meta = stack.getItemDamage(); - supertile.getWorldObj().setBlock(coords.posX, coords.posY, coords.posZ, block, meta, 1 | 2); + supertile.getWorld().setBlock(coords.posX, coords.posY, coords.posZ, block, meta, 1 | 2); if(ConfigHandler.blockBreakParticles) - supertile.getWorldObj().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(block) + (meta << 12)); - supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "botania:orechid", 2F, 1F); + supertile.getWorld().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(block) + (meta << 12)); + supertile.getWorld().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "botania:orechid", 2F, 1F); mana -= cost; sync(); @@ -72,7 +72,7 @@ public class SubTileOrechid extends SubTileFunctional { for(String s : map.keySet()) values.add(new StringRandomItem(map.get(s), s)); - String ore = ((StringRandomItem) WeightedRandom.getRandomItem(supertile.getWorldObj().rand, values)).s; + String ore = ((StringRandomItem) WeightedRandom.getRandomItem(supertile.getWorld().rand, values)).s; List ores = OreDictionary.getOres(ore); @@ -106,14 +106,14 @@ public class SubTileOrechid extends SubTileFunctional { int x = supertile.xCoord + i; int y = supertile.yCoord + j; int z = supertile.zCoord + k; - Block block = supertile.getWorldObj().getBlock(x, y, z); - if(block != null && block.isReplaceableOreGen(supertile.getWorldObj(), x, y, z, source)) + Block block = supertile.getWorld().getBlock(x, y, z); + if(block != null && block.isReplaceableOreGen(supertile.getWorld(), x, y, z, source)) possibleCoords.add(new ChunkCoordinates(x, y, z)); } if(possibleCoords.isEmpty()) return null; - return possibleCoords.get(supertile.getWorldObj().rand.nextInt(possibleCoords.size())); + return possibleCoords.get(supertile.getWorld().rand.nextInt(possibleCoords.size())); } public boolean canOperate() { diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechidIgnem.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechidIgnem.java index 0b6a21f0e..eca3772c3 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechidIgnem.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileOrechidIgnem.java @@ -24,7 +24,7 @@ public class SubTileOrechidIgnem extends SubTileOrechid { @Override public boolean canOperate() { - return supertile.getWorldObj().provider.isHellWorld; + return supertile.getWorld().provider.isHellWorld; } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTilePollidisiac.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTilePollidisiac.java index b9f2a3fde..5e6438cc4 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTilePollidisiac.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTilePollidisiac.java @@ -31,11 +31,11 @@ public class SubTilePollidisiac extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if(!supertile.getWorldObj().isRemote) { + if(!supertile.getWorld().isRemote) { int manaCost = 12; - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + 1 + RANGE, supertile.yCoord + 1, supertile.zCoord + 1 +RANGE)); - List animals = supertile.getWorldObj().getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + 1 +RANGE, supertile.yCoord + 1, supertile.zCoord + 1 +RANGE)); + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + 1 + RANGE, supertile.yCoord + 1, supertile.zCoord + 1 +RANGE)); + List animals = supertile.getWorld().getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + 1 +RANGE, supertile.yCoord + 1, supertile.zCoord + 1 +RANGE)); for(EntityAnimal animal : animals) { if(mana < manaCost) break; @@ -56,7 +56,7 @@ public class SubTilePollidisiac extends SubTileFunctional { ReflectionHelper.setPrivateValue(EntityAnimal.class, animal, 1200, LibObfuscation.IN_LOVE); animal.setTarget(null); - supertile.getWorldObj().setEntityState(animal, (byte)18); + supertile.getWorld().setEntityState(animal, (byte)18); } } } diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileRannuncarpus.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileRannuncarpus.java index fb71bb954..c891d3472 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileRannuncarpus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileRannuncarpus.java @@ -76,7 +76,7 @@ public class SubTileRannuncarpus extends SubTileFunctional { int y = supertile.yCoord; int z = supertile.zCoord; - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(x - RANGE, y - RANGE_Y, z - RANGE, x + RANGE + 1, y + RANGE_Y, z + RANGE + 1)); + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(x - RANGE, y - RANGE_Y, z - RANGE, x + RANGE + 1, y + RANGE_Y, z + RANGE + 1)); for(EntityItem item : items) { if(item.age < 60 || item.isDead) continue; @@ -91,9 +91,9 @@ public class SubTileRannuncarpus extends SubTileFunctional { int xp = x + i; int yp = y + j; int zp = z + l; - Block blockAbove = supertile.getWorldObj().getBlock(xp, yp + 1, zp); + Block blockAbove = supertile.getWorld().getBlock(xp, yp + 1, zp); - if(filter.equals(supertile.getWorldObj(), xp, yp, zp) && (blockAbove.isAir(supertile.getWorldObj(), xp, yp + 1, zp) || blockAbove.isReplaceable(supertile.getWorldObj(), xp, yp + 1, zp))) + if(filter.equals(supertile.getWorld(), xp, yp, zp) && (blockAbove.isAir(supertile.getWorld(), xp, yp + 1, zp) || blockAbove.isReplaceable(supertile.getWorld(), xp, yp + 1, zp))) validPositions.add(new ChunkCoordinates(xp, yp + 1, zp)); } @@ -101,7 +101,7 @@ public class SubTileRannuncarpus extends SubTileFunctional { } - if(!validPositions.isEmpty() && !supertile.getWorldObj().isRemote) { + if(!validPositions.isEmpty() && !supertile.getWorld().isRemote) { Block blockToPlace = null; if(stackItem instanceof ItemBlock) blockToPlace = ((ItemBlock) stackItem).field_150939_a; @@ -111,23 +111,23 @@ public class SubTileRannuncarpus extends SubTileFunctional { blockToPlace = Blocks.redstone_wire; if(blockToPlace != null) { - ChunkCoordinates coords = validPositions.get(supertile.getWorldObj().rand.nextInt(validPositions.size())); - if(blockToPlace.canPlaceBlockAt(supertile.getWorldObj(), coords.posX, coords.posY, coords.posZ)) { - supertile.getWorldObj().setBlock(coords.posX, coords.posY, coords.posZ, blockToPlace, stack.getItemDamage(), 1 | 2); + ChunkCoordinates coords = validPositions.get(supertile.getWorld().rand.nextInt(validPositions.size())); + if(blockToPlace.canPlaceBlockAt(supertile.getWorld(), coords.posX, coords.posY, coords.posZ)) { + supertile.getWorld().setBlock(coords.posX, coords.posY, coords.posZ, blockToPlace, stack.getItemDamage(), 1 | 2); if(ConfigHandler.blockBreakParticles) - supertile.getWorldObj().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(blockToPlace) + (stack.getItemDamage() << 12)); + supertile.getWorld().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(blockToPlace) + (stack.getItemDamage() << 12)); validPositions.remove(coords); - TileEntity tile = supertile.getWorldObj().getTileEntity(coords.posX, coords.posY, coords.posZ); + TileEntity tile = supertile.getWorld().getTileEntity(coords.posX, coords.posY, coords.posZ); if(tile != null && tile instanceof ISubTileContainer) { ISubTileContainer container = (ISubTileContainer) tile; String subtileName = ItemBlockSpecialFlower.getType(stack); container.setSubTile(subtileName); SubTileEntity subtile = container.getSubTile(); - subtile.onBlockPlacedBy(supertile.getWorldObj(), coords.posX, coords.posY, coords.posZ, null, stack); + subtile.onBlockPlacedBy(supertile.getWorld(), coords.posX, coords.posY, coords.posZ, null, stack); } - if(!supertile.getWorldObj().isRemote) { + if(!supertile.getWorld().isRemote) { stack.stackSize--; if(stack.stackSize == 0) item.setDead(); @@ -145,7 +145,7 @@ public class SubTileRannuncarpus extends SubTileFunctional { } public BlockData getUnderlyingBlock() { - return new BlockData(supertile.getWorldObj(), supertile.xCoord, supertile.yCoord - (supertile instanceof IFloatingFlower ? 1 : 2), supertile.zCoord); + return new BlockData(supertile.getWorld(), supertile.xCoord, supertile.yCoord - (supertile instanceof IFloatingFlower ? 1 : 2), supertile.zCoord); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSolegnolia.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSolegnolia.java index 1840e111b..6a4b0e010 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSolegnolia.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSolegnolia.java @@ -50,7 +50,7 @@ public class SubTileSolegnolia extends SubTileFunctional { public static boolean hasSolegnoliaAround(Entity e) { for(SubTileSolegnolia flower : existingFlowers) { - if(flower.mana == 0 || flower.redstoneSignal > 0 || flower.supertile.getWorldObj() != e.worldObj || flower.supertile.getWorldObj().getTileEntity(flower.supertile.xCoord, flower.supertile.yCoord, flower.supertile.zCoord) != flower.supertile) + if(flower.mana == 0 || flower.redstoneSignal > 0 || flower.supertile.getWorld() != e.worldObj || flower.supertile.getWorld().getTileEntity(flower.supertile.xCoord, flower.supertile.yCoord, flower.supertile.zCoord) != flower.supertile) continue; double range = flower.getRange(); diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSpectranthemum.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSpectranthemum.java index 041862061..ffd292e5c 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSpectranthemum.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSpectranthemum.java @@ -47,13 +47,13 @@ public class SubTileSpectranthemum extends SubTileFunctional { public void onUpdate() { super.onUpdate(); - if(redstoneSignal == 0 && supertile.getWorldObj().blockExists(bindX, bindY, bindZ)) { + if(redstoneSignal == 0 && supertile.getWorld().blockExists(bindX, bindY, bindZ)) { int x = supertile.xCoord; int y = supertile.yCoord; int z = supertile.zCoord; boolean did = false; - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(x - RANGE, y - RANGE, z - RANGE, x + RANGE + 1, y + RANGE, z + RANGE + 1)); + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(x - RANGE, y - RANGE, z - RANGE, x + RANGE + 1, y + RANGE, z + RANGE + 1)); for(EntityItem item : items) { if(item.age < 60 || item.isDead || item.getEntityData().getBoolean(TAG_TELEPORTED)) continue; @@ -71,7 +71,7 @@ public class SubTileSpectranthemum extends SubTileFunctional { item.getEntityData().setBoolean(TAG_TELEPORTED, true); item.motionX = item.motionY = item.motionZ = 0; spawnExplosionParticles(item); - if(!supertile.getWorldObj().isRemote) { + if(!supertile.getWorld().isRemote) { mana -= cost; did = true; } diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTangleberrie.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTangleberrie.java index 282244148..5445929da 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTangleberrie.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTangleberrie.java @@ -39,7 +39,7 @@ public class SubTileTangleberrie extends SubTileFunctional { double range = getRange(); AxisAlignedBB boundingBox = new AxisAlignedBB(x1 - range, y1 - range, z1 - range, x1 + range + 1, y1 + range + 1, z1 + range + 1); - List entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, boundingBox); + List entities = supertile.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, boundingBox); for(EntityLivingBase entity : entities) { if(entity instanceof EntityPlayer || entity instanceof IBossDisplayData) @@ -53,8 +53,8 @@ public class SubTileTangleberrie extends SubTileFunctional { if(distance > maxDist && distance < range) { MathHelper.setEntityMotionFromVector(entity, new Vector3(x1, y1, z1), getMotionVelocity()); - if(supertile.getWorldObj().rand.nextInt(3) == 0) - Botania.proxy.sparkleFX(supertile.getWorldObj(), x2 + Math.random() * entity.width, y2 + Math.random() * entity.height, z2 + Math.random() * entity.width, 0.5F, 0.5F, 0.5F, 1F, 3); + if(supertile.getWorld().rand.nextInt(3) == 0) + Botania.proxy.sparkleFX(supertile.getWorld(), x2 + Math.random() * entity.width, y2 + Math.random() * entity.height, z2 + Math.random() * entity.width, 0.5F, 0.5F, 0.5F, 1F, 3); } } diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTigerseye.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTigerseye.java index 8d33342a3..3c5bedfe1 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTigerseye.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTigerseye.java @@ -41,7 +41,7 @@ public class SubTileTigerseye extends SubTileFunctional { boolean shouldAfffect = mana >= cost; - List entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE_Y, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE_Y + 1, supertile.zCoord + RANGE + 1)); + List entities = supertile.getWorld().getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE_Y, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE_Y + 1, supertile.zCoord + RANGE + 1)); for(EntityLiving entity : entities) { List entries = new ArrayList(entity.tasks.taskEntries); diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileVinculotus.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileVinculotus.java index 8a8a3f5e4..e2ad05103 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileVinculotus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileVinculotus.java @@ -82,7 +82,7 @@ public class SubTileVinculotus extends SubTileFunctional { if(event.entity instanceof EntityEnderman) { List possibleFlowers = new ArrayList(); for(SubTileVinculotus flower : existingFlowers) { - if(flower.redstoneSignal > 0 || flower.mana <= cost || flower.supertile.getWorldObj() != event.entity.worldObj || flower.supertile.getWorldObj().getTileEntity(flower.supertile.xCoord, flower.supertile.yCoord, flower.supertile.zCoord) != flower.supertile) + if(flower.redstoneSignal > 0 || flower.mana <= cost || flower.supertile.getWorld() != event.entity.worldObj || flower.supertile.getWorld().getTileEntity(flower.supertile.xCoord, flower.supertile.yCoord, flower.supertile.zCoord) != flower.supertile) continue; double x = flower.supertile.xCoord + 0.5; diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileArcaneRose.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileArcaneRose.java index c1ec31099..cddd7d61d 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileArcaneRose.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileArcaneRose.java @@ -31,7 +31,7 @@ public class SubTileArcaneRose extends SubTileGenerating { if(mana >= getMaxMana()) return; - List players = supertile.getWorldObj().getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + 1, supertile.zCoord + RANGE + 1)); + List players = supertile.getWorld().getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + 1, supertile.zCoord + RANGE + 1)); for(EntityPlayer player : players) if(ExperienceHelper.getPlayerXP(player) >= 1 && player.onGround) { ExperienceHelper.drainPlayerXP(player, 1); diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDandelifeon.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDandelifeon.java index 7489df288..987bb38c6 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDandelifeon.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDandelifeon.java @@ -45,7 +45,7 @@ public class SubTileDandelifeon extends SubTileGenerating { public void onUpdate() { super.onUpdate(); - if(!supertile.getWorldObj().isRemote && redstoneSignal > 0 && ticksExisted % SPEED == 0) + if(!supertile.getWorld().isRemote && redstoneSignal > 0 && ticksExisted % SPEED == 0) runSimulation(); } @@ -121,7 +121,7 @@ public class SubTileDandelifeon extends SubTileGenerating { } int getCellGeneration(int x, int y, int z) { - TileEntity tile = supertile.getWorldObj().getTileEntity(x, y, z); + TileEntity tile = supertile.getWorld().getTileEntity(x, y, z); if(tile instanceof TileCell) return ((TileCell) tile).isSameFlower(supertile) ? ((TileCell) tile).getGeneration() : 0; @@ -163,7 +163,7 @@ public class SubTileDandelifeon extends SubTileGenerating { } void setBlockForGeneration(int x, int y, int z, int gen, int prevGen) { - World world = supertile.getWorldObj(); + World world = supertile.getWorld(); Block blockAt = world.getBlock(x, y, z); TileEntity tile = world.getTileEntity(x, y, z); if(gen == -2) { @@ -174,7 +174,7 @@ public class SubTileDandelifeon extends SubTileGenerating { if(gen < 0 || gen > MAX_GENERATIONS) world.setBlockToAir(x, y, z); else ((TileCell) tile).setGeneration(supertile, gen); - } else if(gen >= 0 && blockAt.isAir(supertile.getWorldObj(), x, y, z)) { + } else if(gen >= 0 && blockAt.isAir(supertile.getWorld(), x, y, z)) { world.setBlock(x, y, z, ModBlocks.cellBlock); tile = world.getTileEntity(x, y, z); ((TileCell) tile).setGeneration(supertile, gen); diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java index e0437b97a..d53c11a76 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java @@ -43,7 +43,7 @@ public class SubTileDaybloom extends SubTilePassiveGenerating { super.onUpdate(); if(isPrime() && (!savedPosition || primePositionX != supertile.xCoord || primePositionY != supertile.yCoord || primePositionZ != supertile.zCoord)) - supertile.getWorldObj().setBlockToAir(supertile.xCoord, supertile.yCoord, supertile.zCoord); + supertile.getWorld().setBlockToAir(supertile.xCoord, supertile.yCoord, supertile.zCoord); } public void setPrimusPosition() { @@ -64,8 +64,8 @@ public class SubTileDaybloom extends SubTilePassiveGenerating { @Override public boolean canGeneratePassively() { - boolean rain = supertile.getWorldObj().getWorldChunkManager().getBiomeGenAt(supertile.xCoord, supertile.zCoord).getIntRainfall() > 0 && (supertile.getWorldObj().isRaining() || supertile.getWorldObj().isThundering()); - return supertile.getWorldObj().isDaytime() && !rain && supertile.getWorldObj().canBlockSeeTheSky(supertile.xCoord, supertile.yCoord + 1, supertile.zCoord); + boolean rain = supertile.getWorld().getWorldChunkManager().getBiomeGenAt(supertile.xCoord, supertile.zCoord).getIntRainfall() > 0 && (supertile.getWorld().isRaining() || supertile.getWorld().isThundering()); + return supertile.getWorld().isDaytime() && !rain && supertile.getWorld().canBlockSeeTheSky(supertile.xCoord, supertile.yCoord + 1, supertile.zCoord); } @Override @@ -76,7 +76,7 @@ public class SubTileDaybloom extends SubTilePassiveGenerating { public int getSurroundingFlowers() { int flowers = 0; for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) { - TileEntity tile = supertile.getWorldObj().getTileEntity(supertile.xCoord + dir.offsetX, supertile.yCoord, supertile.zCoord + dir.offsetZ); + TileEntity tile = supertile.getWorld().getTileEntity(supertile.xCoord + dir.offsetX, supertile.yCoord, supertile.zCoord + dir.offsetZ); if(tile != null && tile instanceof ISubTileContainer) { ISubTileContainer flower = (ISubTileContainer) tile; if(flower.getSubTile() != null && flower.getSubTile().getClass() == getClass()) { @@ -89,7 +89,7 @@ public class SubTileDaybloom extends SubTilePassiveGenerating { float m = 0.045F; if(ticksExisted % 10 == 0) - Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.5, supertile.yCoord + 0.05, supertile.zCoord + 0.5, r, g, b, 0.1F, dir.offsetX * m, dir.offsetY * m, dir.offsetZ * m); + Botania.proxy.wispFX(supertile.getWorld(), supertile.xCoord + 0.5, supertile.yCoord + 0.05, supertile.zCoord + 0.5, r, g, b, 0.1F, dir.offsetX * m, dir.offsetY * m, dir.offsetZ * m); } } } diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java index 00d9be03b..880fdfe82 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java @@ -39,10 +39,10 @@ public class SubTileEndoflame extends SubTileGenerating { if(linkedCollector != null) { if(burnTime == 0) { - if(mana < getMaxMana() && !supertile.getWorldObj().isRemote) { + if(mana < getMaxMana() && !supertile.getWorld().isRemote) { boolean didSomething = false; - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); for(EntityItem item : items) { if(item.age >= 59 && !item.isDead) { ItemStack stack = item.getEntityItem(); @@ -54,7 +54,7 @@ public class SubTileEndoflame extends SubTileGenerating { this.burnTime = Math.min(FUEL_CAP, burnTime) / 2; stack.stackSize--; - supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "botania:endoflame", 0.2F, 1F); + supertile.getWorld().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "botania:endoflame", 0.2F, 1F); if(stack.stackSize == 0) item.setDead(); @@ -70,8 +70,8 @@ public class SubTileEndoflame extends SubTileGenerating { sync(); } } else { - if(supertile.getWorldObj().rand.nextInt(8) == 0) - Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60); + if(supertile.getWorld().rand.nextInt(8) == 0) + Botania.proxy.wispFX(supertile.getWorld(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60); burnTime--; } diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEntropinnyum.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEntropinnyum.java index 977d756f2..ce0f590c6 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEntropinnyum.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEntropinnyum.java @@ -30,20 +30,20 @@ public class SubTileEntropinnyum extends SubTileGenerating { super.onUpdate(); if(mana == 0) { - List tnts = supertile.getWorldObj().getEntitiesWithinAABB(EntityTNTPrimed.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); + List tnts = supertile.getWorld().getEntitiesWithinAABB(EntityTNTPrimed.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); for(EntityTNTPrimed tnt : tnts) { - if(tnt.fuse == 1 && !tnt.isDead && !supertile.getWorldObj().getBlock(MathHelper.floor_double(tnt.posX), MathHelper.floor_double(tnt.posY), MathHelper.floor_double(tnt.posZ)).getMaterial().isLiquid()) { - if(!supertile.getWorldObj().isRemote) { + if(tnt.fuse == 1 && !tnt.isDead && !supertile.getWorld().getBlock(MathHelper.floor_double(tnt.posX), MathHelper.floor_double(tnt.posY), MathHelper.floor_double(tnt.posZ)).getMaterial().isLiquid()) { + if(!supertile.getWorld().isRemote) { tnt.setDead(); mana += getMaxMana(); - supertile.getWorldObj().playSoundEffect(tnt.posX, tnt.posY, tnt.posZ, "random.explode", 0.2F, (1F + (supertile.getWorldObj().rand.nextFloat() - supertile.getWorldObj().rand.nextFloat()) * 0.2F) * 0.7F); + supertile.getWorld().playSoundEffect(tnt.posX, tnt.posY, tnt.posZ, "random.explode", 0.2F, (1F + (supertile.getWorld().rand.nextFloat() - supertile.getWorld().rand.nextFloat()) * 0.2F) * 0.7F); sync(); } for(int i = 0; i < 50; i++) Botania.proxy.sparkleFX(tnt.worldObj, tnt.posX + Math.random() * 4 - 2, tnt.posY + Math.random() * 4 - 2, tnt.posZ + Math.random() * 4 - 2, 1F, (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, (float) (Math.random() * 0.65F + 1.25F), 12); - supertile.getWorldObj().spawnParticle("hugeexplosion", tnt.posX, tnt.posY, tnt.posZ, 1D, 0D, 0D); + supertile.getWorld().spawnParticle("hugeexplosion", tnt.posX, tnt.posY, tnt.posZ, 1D, 0D, 0D); return; } } diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java index a3b4ad73c..66d7525a6 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java @@ -36,14 +36,14 @@ public class SubTileGourmaryllis extends SubTileGenerating { if(cooldown > 0) cooldown--; - if(cooldown == 0 && !supertile.getWorldObj().isRemote) { + if(cooldown == 0 && !supertile.getWorld().isRemote) { mana = Math.min(getMaxMana(), mana + storedMana); storedMana = 0; sync(); } - if(!supertile.getWorldObj().isRemote) { - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); + if(!supertile.getWorld().isRemote) { + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); for(EntityItem item : items) { ItemStack stack = item.getEntityItem(); if(stack != null && stack.getItem() instanceof ItemFood && !item.isDead) { @@ -51,7 +51,7 @@ public class SubTileGourmaryllis extends SubTileGenerating { int val = ((ItemFood) stack.getItem()).func_150905_g(stack); storedMana = val * val * 64; cooldown = val * 10; - supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "random.eat", 0.2F, 0.5F + (float) Math.random() * 0.5F); + supertile.getWorld().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "random.eat", 0.2F, 0.5F + (float) Math.random() * 0.5F); sync(); } diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java index c5a461744..e28053ded 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java @@ -47,12 +47,12 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating { if(cooldown > 0) { cooldown--; for(int i = 0; i < 3; i++) - Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.5 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.5 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5 + Math.random() * 0.2 - 0.1, 0.1F, 0.1F, 0.1F, (float) Math.random() / 6, (float) -Math.random() / 30); + Botania.proxy.wispFX(supertile.getWorld(), supertile.xCoord + 0.5 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.5 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5 + Math.random() * 0.2 - 0.1, 0.1F, 0.1F, 0.1F, (float) Math.random() / 6, (float) -Math.random() / 30); return; } if(burnTime == 0) { - if(mana < getMaxMana() && !supertile.getWorldObj().isRemote) { + if(mana < getMaxMana() && !supertile.getWorld().isRemote) { List offsets = Arrays.asList(OFFSETS); Collections.shuffle(offsets); @@ -63,17 +63,17 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating { }; Material search = getMaterialToSearchFor(); - if(supertile.getWorldObj().getBlock(positions[0], supertile.yCoord, positions[1]).getMaterial() == search && (getBlockToSearchBelow() == null || supertile.getWorldObj().getBlock(positions[0], supertile.yCoord - 1, positions[1]) == getBlockToSearchBelow()) && supertile.getWorldObj().getBlockMetadata(positions[0], supertile.yCoord, positions[1]) == 0) { + if(supertile.getWorld().getBlock(positions[0], supertile.yCoord, positions[1]).getMaterial() == search && (getBlockToSearchBelow() == null || supertile.getWorld().getBlock(positions[0], supertile.yCoord - 1, positions[1]) == getBlockToSearchBelow()) && supertile.getWorld().getBlockMetadata(positions[0], supertile.yCoord, positions[1]) == 0) { if(search != Material.water) - supertile.getWorldObj().setBlockToAir(positions[0], supertile.yCoord, positions[1]); + supertile.getWorld().setBlockToAir(positions[0], supertile.yCoord, positions[1]); else { int waterAround = 0; for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) - if(supertile.getWorldObj().getBlock(positions[0] + dir.offsetX, supertile.yCoord, positions[1] + dir.offsetZ).getMaterial() == search) + if(supertile.getWorld().getBlock(positions[0] + dir.offsetX, supertile.yCoord, positions[1] + dir.offsetZ).getMaterial() == search) waterAround++; if(waterAround < 2) - supertile.getWorldObj().setBlockToAir(positions[0], supertile.yCoord, positions[1]); + supertile.getWorld().setBlockToAir(positions[0], supertile.yCoord, positions[1]); } burnTime += getBurnTime(); @@ -84,7 +84,7 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating { } } } else { - if(supertile.getWorldObj().rand.nextInt(8) == 0) + if(supertile.getWorld().rand.nextInt(8) == 0) doBurnParticles(); burnTime--; if(burnTime == 0) { @@ -97,7 +97,7 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating { public int getSurroundingFlowers() { int flowers = 0; for(int[] offsetArray : OFFSETS) { - TileEntity tile = supertile.getWorldObj().getTileEntity(supertile.xCoord + offsetArray[0], supertile.yCoord, supertile.zCoord + offsetArray[1]); + TileEntity tile = supertile.getWorld().getTileEntity(supertile.xCoord + offsetArray[0], supertile.yCoord, supertile.zCoord + offsetArray[1]); if(tile != null && tile instanceof ISubTileContainer) { ISubTileContainer flower = (ISubTileContainer) tile; if(flower.getSubTile() != null && flower.getSubTile().getClass() == getClass()) { @@ -110,7 +110,7 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating { float m = 0.045F; if(ticksExisted % 10 == 0) - Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.5, supertile.yCoord + 0.05, supertile.zCoord + 0.5, r, g, b, 0.1F, offsetArray[0] * m, 0, offsetArray[1] * m); + Botania.proxy.wispFX(supertile.getWorld(), supertile.xCoord + 0.5, supertile.yCoord + 0.05, supertile.zCoord + 0.5, r, g, b, 0.1F, offsetArray[0] * m, 0, offsetArray[1] * m); } } } @@ -119,7 +119,7 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating { } public void doBurnParticles() { - Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.05F, 0.05F, 0.7F, (float) Math.random() / 6, (float) -Math.random() / 60); + Botania.proxy.wispFX(supertile.getWorld(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.05F, 0.05F, 0.7F, (float) Math.random() / 6, (float) -Math.random() / 60); } public Material getMaterialToSearchFor() { @@ -131,7 +131,7 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating { } public void playSound() { - supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "random.drink", 0.01F, 0.5F + (float) Math.random() * 0.5F); + supertile.getWorld().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "random.drink", 0.01F, 0.5F + (float) Math.random() * 0.5F); } public int getBurnTime() { @@ -194,12 +194,12 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating { @Override public boolean canGeneratePassively() { int adj = getSurroundingFlowers(); - return supertile.getWorldObj().rand.nextInt(adj + 1) == 0 && burnTime > 0; + return supertile.getWorld().rand.nextInt(adj + 1) == 0 && burnTime > 0; } @Override public int getDelayBetweenPassiveGeneration() { - boolean rain = supertile.getWorldObj().getWorldChunkManager().getBiomeGenAt(supertile.xCoord, supertile.zCoord).getIntRainfall() > 0 && (supertile.getWorldObj().isRaining() || supertile.getWorldObj().isThundering()); + boolean rain = supertile.getWorld().getWorldChunkManager().getBiomeGenAt(supertile.xCoord, supertile.zCoord).getIntRainfall() > 0 && (supertile.getWorld().isRaining() || supertile.getWorld().isThundering()); return rain ? 1 : 2; } diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileKekimurus.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileKekimurus.java index cbb2a15e1..fe797faf1 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileKekimurus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileKekimurus.java @@ -27,22 +27,22 @@ public class SubTileKekimurus extends SubTileGenerating { int mana = 1800; - if(getMaxMana() - this.mana >= mana && !supertile.getWorldObj().isRemote && ticksExisted % 80 == 0) { + if(getMaxMana() - this.mana >= mana && !supertile.getWorld().isRemote && ticksExisted % 80 == 0) { for(int i = 0; i < RANGE * 2 + 1; i++) for(int j = 0; j < RANGE * 2 + 1; j++) for(int k = 0; k < RANGE * 2 + 1; k++) { int x = supertile.xCoord + i - RANGE; int y = supertile.yCoord + j - RANGE; int z = supertile.zCoord + k - RANGE; - Block block = supertile.getWorldObj().getBlock(x, y, z); + Block block = supertile.getWorld().getBlock(x, y, z); if(block instanceof BlockCake) { - int meta = supertile.getWorldObj().getBlockMetadata(x, y, z) + 1; + int meta = supertile.getWorld().getBlockMetadata(x, y, z) + 1; if(meta == 6) - supertile.getWorldObj().setBlockToAir(x, y, z); - else supertile.getWorldObj().setBlockMetadataWithNotify(x, y, z, meta, 1 | 2); + supertile.getWorld().setBlockToAir(x, y, z); + else supertile.getWorld().setBlockMetadataWithNotify(x, y, z, meta, 1 | 2); - supertile.getWorldObj().playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12)); - supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "random.eat", 1F, 0.5F + (float) Math.random() * 0.5F); + supertile.getWorld().playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12)); + supertile.getWorld().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "random.eat", 1F, 0.5F + (float) Math.random() * 0.5F); this.mana += mana; sync(); return; diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileMunchdew.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileMunchdew.java index 0b7a66f58..9213d3e6b 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileMunchdew.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileMunchdew.java @@ -53,7 +53,7 @@ public class SubTileMunchdew extends SubTileGenerating { int manaPerLeaf = 160; eatLeaves : { - if(getMaxMana() - mana >= manaPerLeaf && !supertile.getWorldObj().isRemote && ticksExisted % 4 == 0) { + if(getMaxMana() - mana >= manaPerLeaf && !supertile.getWorld().isRemote && ticksExisted % 4 == 0) { List coords = new ArrayList(); int x = supertile.xCoord; int y = supertile.yCoord; @@ -65,11 +65,11 @@ public class SubTileMunchdew extends SubTileGenerating { int xp = x + i; int yp = y + j; int zp = z + k; - Block block = supertile.getWorldObj().getBlock(xp, yp, zp); + Block block = supertile.getWorld().getBlock(xp, yp, zp); if(block.getMaterial() == Material.leaves) { boolean exposed = false; for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - if(supertile.getWorldObj().getBlock(xp + dir.offsetX, yp + dir.offsetY, zp + dir.offsetZ).isAir(supertile.getWorldObj(), xp + dir.offsetX, yp + dir.offsetY, zp + dir.offsetZ)) { + if(supertile.getWorld().getBlock(xp + dir.offsetX, yp + dir.offsetY, zp + dir.offsetZ).isAir(supertile.getWorld(), xp + dir.offsetX, yp + dir.offsetY, zp + dir.offsetZ)) { exposed = true; break; } @@ -84,13 +84,13 @@ public class SubTileMunchdew extends SubTileGenerating { Collections.shuffle(coords); ChunkCoordinates breakCoords = coords.get(0); - Block block = supertile.getWorldObj().getBlock(breakCoords.posX, breakCoords.posY, breakCoords.posZ); - int meta = supertile.getWorldObj().getBlockMetadata(breakCoords.posX, breakCoords.posY, breakCoords.posZ); - supertile.getWorldObj().setBlockToAir(breakCoords.posX, breakCoords.posY, breakCoords.posZ); + Block block = supertile.getWorld().getBlock(breakCoords.posX, breakCoords.posY, breakCoords.posZ); + int meta = supertile.getWorld().getBlockMetadata(breakCoords.posX, breakCoords.posY, breakCoords.posZ); + supertile.getWorld().setBlockToAir(breakCoords.posX, breakCoords.posY, breakCoords.posZ); ticksWithoutEating = 0; ateOnce = true; if(ConfigHandler.blockBreakParticles) - supertile.getWorldObj().playAuxSFX(2001, breakCoords.posX, breakCoords.posY, breakCoords.posZ, Block.getIdFromBlock(block) + (meta << 12)); + supertile.getWorld().playAuxSFX(2001, breakCoords.posX, breakCoords.posY, breakCoords.posZ, Block.getIdFromBlock(block) + (meta << 12)); mana += manaPerLeaf; } } diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNarslimmus.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNarslimmus.java index e55337af6..4c46ce37e 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNarslimmus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNarslimmus.java @@ -36,7 +36,7 @@ public class SubTileNarslimmus extends SubTileGenerating { super.onUpdate(); if(ticksExisted % 5 == 0) { - List slimes = supertile.getWorldObj().getEntitiesWithinAABB(EntitySlime.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE, supertile.zCoord + RANGE + 1)); + List slimes = supertile.getWorld().getEntitiesWithinAABB(EntitySlime.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE, supertile.zCoord + RANGE + 1)); for(EntitySlime slime : slimes) { if(slime.getEntityData().getBoolean(TAG_WORLD_SPAWNED) && !slime.isDead) { int size = slime.getSlimeSize(); diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNightshade.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNightshade.java index 585b982d4..534332263 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNightshade.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNightshade.java @@ -22,7 +22,7 @@ public class SubTileNightshade extends SubTileDaybloom { @Override public boolean canGeneratePassively() { - return !super.canGeneratePassively() && !supertile.getWorldObj().isDaytime(); + return !super.canGeneratePassively() && !supertile.getWorld().isDaytime(); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileRafflowsia.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileRafflowsia.java index 07a42d947..f254ee3a5 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileRafflowsia.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileRafflowsia.java @@ -42,15 +42,15 @@ public class SubTileRafflowsia extends SubTileGenerating { int mana = 2100; - if(getMaxMana() - this.mana >= mana && !supertile.getWorldObj().isRemote && ticksExisted % 40 == 0) { + if(getMaxMana() - this.mana >= mana && !supertile.getWorld().isRemote && ticksExisted % 40 == 0) { for(int i = 0; i < RANGE * 2 + 1; i++) for(int j = 0; j < RANGE * 2 + 1; j++) for(int k = 0; k < RANGE * 2 + 1; k++) { int x = supertile.xCoord + i - RANGE; int y = supertile.yCoord + j - RANGE; int z = supertile.zCoord + k - RANGE; - Block block = supertile.getWorldObj().getBlock(x, y, z); - TileEntity tile = supertile.getWorldObj().getTileEntity(x, y, z); + Block block = supertile.getWorld().getBlock(x, y, z); + TileEntity tile = supertile.getWorld().getTileEntity(x, y, z); if(tile instanceof ISubTileContainer) { SubTileEntity stile = ((ISubTileContainer) tile).getSubTile(); String name = stile.getUnlocalizedName(); @@ -66,10 +66,10 @@ public class SubTileRafflowsia extends SubTileGenerating { float mod = 1F / lastFlowerTimes; - int meta = supertile.getWorldObj().getBlockMetadata(x, y, z) + 1; - supertile.getWorldObj().setBlockToAir(x, y, z); + int meta = supertile.getWorld().getBlockMetadata(x, y, z) + 1; + supertile.getWorld().setBlockToAir(x, y, z); - supertile.getWorldObj().playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12)); + supertile.getWorld().playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12)); this.mana += mana * mod; sync(); return; diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileSpectrolus.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileSpectrolus.java index f4720b661..7e8383f5c 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileSpectrolus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileSpectrolus.java @@ -43,9 +43,9 @@ public class SubTileSpectrolus extends SubTileGenerating { public void onUpdate() { super.onUpdate(); - if(!supertile.getWorldObj().isRemote) { + if(!supertile.getWorld().isRemote) { Item wool = Item.getItemFromBlock(Blocks.wool); - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); + List items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); for(EntityItem item : items) { ItemStack stack = item.getEntityItem(); if(stack != null && stack.getItem() == wool) { diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java index c8eff10fb..f8168ea31 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java @@ -29,7 +29,7 @@ public class SubTileThermalily extends SubTileHydroangeas { @Override public void doBurnParticles() { - Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.9 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60); + Botania.proxy.wispFX(supertile.getWorld(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.9 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60); } @Override @@ -49,7 +49,7 @@ public class SubTileThermalily extends SubTileHydroangeas { @Override public void playSound() { - supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "botania:thermalily", 0.2F, 1F); + supertile.getWorld().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "botania:thermalily", 0.2F, 1F); } @Override diff --git a/src/main/java/vazkii/botania/common/block/tile/TileAlfPortal.java b/src/main/java/vazkii/botania/common/block/tile/TileAlfPortal.java index faa92405b..d85f95dea 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileAlfPortal.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileAlfPortal.java @@ -178,7 +178,7 @@ public class TileAlfPortal extends TileMod { pos = CONVERTER_X_Z_FP.apply(pos); float motionMul = 0.2F; - Botania.proxy.wispFX(getWorldObj(), xCoord + pos[0], yCoord + pos[1], zCoord + pos[2], (float) (Math.random() * 0.25F), (float) (Math.random() * 0.5F + 0.5F), (float) (Math.random() * 0.25F), (float) (Math.random() * 0.15F + 0.1F), (float) (Math.random() - 0.5F) * motionMul, (float) (Math.random() - 0.5F) * motionMul, (float) (Math.random() - 0.5F) * motionMul); + Botania.proxy.wispFX(getWorld(), xCoord + pos[0], yCoord + pos[1], zCoord + pos[2], (float) (Math.random() * 0.25F), (float) (Math.random() * 0.5F + 0.5F), (float) (Math.random() * 0.25F), (float) (Math.random() * 0.15F + 0.1F), (float) (Math.random() - 0.5F) * motionMul, (float) (Math.random() - 0.5F) * motionMul, (float) (Math.random() - 0.5F) * motionMul); } public boolean onWanded() { diff --git a/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java b/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java index 6f84f3438..192c0a203 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java @@ -102,7 +102,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor if(cooldown > 0) { cooldown--; - Botania.proxy.wispFX(getWorldObj(), xCoord + Math.random(), yCoord + 0.8, zCoord + Math.random(), 0.2F, 0.2F, 0.2F, 0.2F, -0.025F); + Botania.proxy.wispFX(getWorld(), xCoord + Math.random(), yCoord + 0.8, zCoord + Math.random(), 0.2F, 0.2F, 0.2F, 0.2F, -0.025F); } int newSignal = 0; diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileManaDetector.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileManaDetector.java index a5a316420..ac9cd95f9 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileManaDetector.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileManaDetector.java @@ -28,7 +28,7 @@ public class TileManaDetector extends TileMod implements IManaCollisionGhost { if(expectedMeta == 1) for(int i = 0; i < 4; i++) - Botania.proxy.sparkleFX(getWorldObj(), xCoord + Math.random(), yCoord + Math.random(), zCoord + Math.random(), 1F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5); + Botania.proxy.sparkleFX(getWorld(), xCoord + Math.random(), yCoord + Math.random(), zCoord + Math.random(), 1F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileManaVoid.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileManaVoid.java index d4b240ed0..a0574202a 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileManaVoid.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileManaVoid.java @@ -35,7 +35,7 @@ public class TileManaVoid extends TileMod implements IClientManaHandler { public void recieveMana(int mana) { if(mana > 0) for(int i = 0; i < 10; i++) - Botania.proxy.sparkleFX(getWorldObj(), xCoord + Math.random(), yCoord + Math.random(), zCoord + Math.random(), 0.2F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5); + Botania.proxy.sparkleFX(getWorld(), xCoord + Math.random(), yCoord + Math.random(), zCoord + Math.random(), 0.2F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5); } @Override diff --git a/src/main/java/vazkii/botania/common/core/handler/ManaNetworkHandler.java b/src/main/java/vazkii/botania/common/core/handler/ManaNetworkHandler.java index 611183393..ff20ca4b8 100644 --- a/src/main/java/vazkii/botania/common/core/handler/ManaNetworkHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/ManaNetworkHandler.java @@ -70,7 +70,7 @@ public final class ManaNetworkHandler implements IManaNetwork { } private synchronized boolean isIn(TileEntity tile, Map> map) { - List list = map.get(tile.getWorldObj()); + List list = map.get(tile.getWorld()); if(list == null) return false; @@ -106,7 +106,7 @@ public final class ManaNetworkHandler implements IManaNetwork { } private synchronized void remove(Map> map, TileEntity tile) { - World world = tile.getWorldObj(); + World world = tile.getWorld(); if(!map.containsKey(world)) return; @@ -120,7 +120,7 @@ public final class ManaNetworkHandler implements IManaNetwork { } private synchronized void add(Map> map, TileEntity tile) { - World world = tile.getWorldObj(); + World world = tile.getWorld(); List tiles; if(!map.containsKey(world)) @@ -129,7 +129,7 @@ public final class ManaNetworkHandler implements IManaNetwork { tiles = map.get(world); if(!tiles.contains(tile)) - tiles.add(new TileSignature(tile, tile.getWorldObj().isRemote)); + tiles.add(new TileSignature(tile, tile.getWorld().isRemote)); } @Override diff --git a/src/main/java/vazkii/botania/common/core/helper/InventoryHelper.java b/src/main/java/vazkii/botania/common/core/helper/InventoryHelper.java index d553eda94..663f20e5e 100644 --- a/src/main/java/vazkii/botania/common/core/helper/InventoryHelper.java +++ b/src/main/java/vazkii/botania/common/core/helper/InventoryHelper.java @@ -192,7 +192,7 @@ public class InventoryHelper { public static IInventory getInventory(IInventory inventory) { if(inventory instanceof TileEntityChest) { TileEntity te = (TileEntity)inventory; - return getInventory(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord); + return getInventory(te.getWorld(), te.xCoord, te.yCoord, te.zCoord); } return inventory; } diff --git a/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java b/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java index 07a5560fb..728acdcec 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java +++ b/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java @@ -100,7 +100,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { } public EntityManaBurst(IManaSpreader spreader, boolean fake) { - this(((TileEntity)spreader).getWorldObj()); + this(((TileEntity)spreader).getWorld()); TileEntity tile = (TileEntity) spreader; diff --git a/src/main/java/vazkii/botania/common/integration/buildcraft/TriggerManaDetector.java b/src/main/java/vazkii/botania/common/integration/buildcraft/TriggerManaDetector.java index fd84e758a..1b6dda0bd 100644 --- a/src/main/java/vazkii/botania/common/integration/buildcraft/TriggerManaDetector.java +++ b/src/main/java/vazkii/botania/common/integration/buildcraft/TriggerManaDetector.java @@ -31,7 +31,7 @@ public class TriggerManaDetector extends StatementBase implements ITriggerIntern @Override public boolean isTriggerActive(IStatementContainer source, IStatementParameter[] parameters) { - World world = source.getTile().getWorldObj(); + World world = source.getTile().getWorld(); int x = source.getTile().xCoord, y = source.getTile().yCoord, z = source.getTile().zCoord; boolean output = world.getEntitiesWithinAABB(IManaBurst.class, new AxisAlignedBB(x, y, z, x + 1, y + 1, z + 1)).size() != 0; diff --git a/src/main/java/vazkii/botania/common/item/ItemManaMirror.java b/src/main/java/vazkii/botania/common/item/ItemManaMirror.java index 27d99c709..2c3fd28e1 100644 --- a/src/main/java/vazkii/botania/common/item/ItemManaMirror.java +++ b/src/main/java/vazkii/botania/common/item/ItemManaMirror.java @@ -160,7 +160,7 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte if(pool != null) { pool.recieveMana(mana); TileEntity tile = (TileEntity) pool; - tile.getWorldObj().func_147453_f(tile.xCoord, tile.yCoord, tile.zCoord, tile.getWorldObj().getBlock(tile.xCoord, tile.yCoord, tile.zCoord)); + tile.getWorld().func_147453_f(tile.xCoord, tile.yCoord, tile.zCoord, tile.getWorld().getBlock(tile.xCoord, tile.yCoord, tile.zCoord)); } }*/ @@ -168,7 +168,7 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte ItemNBTHelper.setInt(stack, TAG_POS_X, pool == null ? 0 : pool.xCoord); ItemNBTHelper.setInt(stack, TAG_POS_Y, pool == null ? -1 : pool.yCoord); ItemNBTHelper.setInt(stack, TAG_POS_Z, pool == null ? 0 : pool.zCoord); - ItemNBTHelper.setInt(stack, TAG_DIM, pool == null ? 0 : pool.getWorldObj().provider.dimensionId); + ItemNBTHelper.setInt(stack, TAG_DIM, pool == null ? 0 : pool.getWorld().provider.dimensionId); } public ChunkCoordinates getPoolCoords(ItemStack stack) { diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemDiviningRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemDiviningRod.java index c8bfde267..d187da6cf 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemDiviningRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemDiviningRod.java @@ -89,7 +89,7 @@ public class ItemDiviningRod extends ItemMod implements IManaUsingItem, IAvatarW @Override public void onAvatarUpdate(IAvatarTile tile, ItemStack stack) { TileEntity te = (TileEntity) tile; - World world = te.getWorldObj(); + World world = te.getWorld(); if(tile.getCurrentMana() >= COST && tile.getElapsedFunctionalTicks() % 200 == 0 && tile.isEnabled()) { doHighlight(world, te.xCoord, te.yCoord, te.zCoord, 18, te.xCoord ^ te.yCoord ^ te.zCoord); tile.recieveMana(-COST); diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemFireRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemFireRod.java index 32f3b0ffd..6f0ebf691 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemFireRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemFireRod.java @@ -73,7 +73,7 @@ public class ItemFireRod extends ItemMod implements IManaUsingItem, IAvatarWield @Override public void onAvatarUpdate(IAvatarTile tile, ItemStack stack) { TileEntity te = (TileEntity) tile; - World world = te.getWorldObj(); + World world = te.getWorld(); if(!world.isRemote && tile.getCurrentMana() >= COST && tile.getElapsedFunctionalTicks() % 300 == 0 && tile.isEnabled()) { EntityFlameRing entity = new EntityFlameRing(world); diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemMissileRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemMissileRod.java index fd694ffda..3943c14be 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemMissileRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemMissileRod.java @@ -98,7 +98,7 @@ public class ItemMissileRod extends ItemMod implements IManaUsingItem, IAvatarWi @Override public void onAvatarUpdate(IAvatarTile tile, ItemStack stack) { TileEntity te = (TileEntity) tile; - World world = te.getWorldObj(); + World world = te.getWorld(); if(tile.getCurrentMana() >= COST_AVATAR && tile.getElapsedFunctionalTicks() % 3 == 0 && tile.isEnabled()) if(spawnMissile(world, null, te.xCoord + 0.5 + (Math.random() - 0.5 * 0.1), te.yCoord + 2.5 + (Math.random() - 0.5 * 0.1), te.zCoord + (Math.random() - 0.5 * 0.1))) { if(!world.isRemote) diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemRainbowRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemRainbowRod.java index 16357cbe4..5687d2e2d 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemRainbowRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemRainbowRod.java @@ -138,7 +138,7 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem, IAvatarWi @Override public void onAvatarUpdate(IAvatarTile tile, ItemStack stack) { TileEntity te = (TileEntity) tile; - World world = te.getWorldObj(); + World world = te.getWorld(); if(world.isRemote || tile.getCurrentMana() < MANA_COST_AVATAR * 25 || !tile.isEnabled()) return; diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemTornadoRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemTornadoRod.java index 76d54900e..98b6fc407 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemTornadoRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemTornadoRod.java @@ -155,7 +155,7 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi @Override public void onAvatarUpdate(IAvatarTile tile, ItemStack stack) { TileEntity te = (TileEntity) tile; - World world = te.getWorldObj(); + World world = te.getWorld(); if(tile.getCurrentMana() >= COST && tile.isEnabled()) { int range = 5; int rangeY = 3;