From 7321f50d39d333799de09fa117b7fb6fb80f10bf Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Mon, 2 Jan 2017 12:24:45 -0600 Subject: [PATCH] Update mappings to stable_29 for 1.10.2, no functional changes --- build.properties | 2 +- .../botania/api/internal/IManaNetwork.java | 4 +- .../api/subtile/SubTileFunctional.java | 6 +- .../api/subtile/SubTileGenerating.java | 6 +- .../core/handler/AstrolabePreviewHandler.java | 2 +- .../handler/BlockHighlightRenderHandler.java | 6 +- .../core/handler/BoundTileRenderer.java | 4 +- .../core/handler/ClientTickHandler.java | 6 +- .../client/core/handler/ColorHandler.java | 2 +- .../client/core/handler/DebugHandler.java | 6 +- .../client/core/handler/HUDHandler.java | 60 ++++++------ .../client/core/handler/LightningHandler.java | 2 +- .../core/handler/MiscellaneousIcons.java | 2 +- .../core/handler/MultiblockBlockAccess.java | 4 +- .../core/handler/MultiblockRenderHandler.java | 18 ++-- .../core/handler/RedStringRenderer.java | 2 +- .../client/core/handler/RenderLexicon.java | 14 +-- .../TooltipAdditionDisplayHandler.java | 8 +- .../client/core/proxy/ClientProxy.java | 16 ++-- .../vazkii/botania/client/fx/FXLightning.java | 6 +- .../vazkii/botania/client/fx/FXSparkle.java | 14 +-- .../botania/client/gui/bag/GuiFlowerBag.java | 4 +- .../botania/client/gui/box/GuiBaubleBox.java | 4 +- .../client/gui/lexicon/GuiLexicon.java | 4 +- .../client/gui/lexicon/GuiLexiconEntry.java | 4 +- .../client/model/ModelTeruTeruBozu.java | 2 +- .../botania/client/model/PlatformModel.java | 4 +- .../render/entity/RenderCorporeaSpark.java | 2 +- .../tile/RenderTileCorporeaCrystalCube.java | 2 +- .../render/tile/RenderTileGaiaHead.java | 2 +- .../render/world/SkyblockRenderEvents.java | 4 +- .../render/world/SkyblockSkyRenderer.java | 10 +- .../botania/common/block/BlockCamo.java | 2 +- .../botania/common/block/BlockFakeAir.java | 2 +- .../botania/common/block/BlockFelPumpkin.java | 4 +- .../botania/common/block/BlockGhostRail.java | 12 +-- .../botania/common/block/BlockHourglass.java | 4 +- .../botania/common/block/BlockManaBomb.java | 2 +- .../common/block/BlockPistonRelay.java | 2 +- .../botania/common/block/BlockStorage.java | 2 +- .../block/corporea/BlockCorporeaIndex.java | 8 +- .../decor/quartz/BlockSpecialQuartz.java | 4 +- .../decor/quartz/BlockSpecialQuartzSlab.java | 2 +- .../block/decor/slabs/BlockModSlab.java | 2 +- .../block/dispenser/BehaviourCocoaBeans.java | 2 +- .../dispenser/BehaviourPoolMinecart.java | 2 +- .../block/dispenser/BehaviourSeeds.java | 2 +- .../common/block/mana/BlockEnchanter.java | 2 +- .../common/block/mana/BlockTerraPlate.java | 8 +- .../subtile/functional/SubTileClayconia.java | 2 +- .../subtile/functional/SubTileDaffomill.java | 2 +- .../functional/SubTileHeiseiDream.java | 2 +- .../subtile/functional/SubTileHyacidus.java | 2 +- .../subtile/functional/SubTileLoonuim.java | 14 +-- .../functional/SubTileMarimorphosis.java | 2 +- .../subtile/functional/SubTileSolegnolia.java | 2 +- .../functional/SubTileSpectranthemum.java | 4 +- .../subtile/functional/SubTileVinculotus.java | 4 +- .../subtile/generating/SubTileEndoflame.java | 4 +- .../generating/SubTileHydroangeas.java | 2 +- .../subtile/generating/SubTileNarslimmus.java | 12 +-- .../common/block/tile/TileAlfPortal.java | 36 +++---- .../botania/common/block/tile/TileAltar.java | 50 +++++----- .../common/block/tile/TileAnimatedTorch.java | 16 ++-- .../botania/common/block/tile/TileAvatar.java | 4 +- .../common/block/tile/TileBifrost.java | 4 +- .../common/block/tile/TileBrewery.java | 24 ++--- .../common/block/tile/TileCacophonium.java | 2 +- .../botania/common/block/tile/TileCamo.java | 2 +- .../botania/common/block/tile/TileCell.java | 2 +- .../botania/common/block/tile/TileCocoon.java | 34 +++---- .../common/block/tile/TileCraftCrate.java | 8 +- .../common/block/tile/TileEnchanter.java | 36 +++---- .../common/block/tile/TileEnderEye.java | 14 +-- .../common/block/tile/TileFakeAir.java | 2 +- .../common/block/tile/TileFloatingFlower.java | 4 +- .../common/block/tile/TileForestEye.java | 6 +- .../common/block/tile/TileHourglass.java | 12 +-- .../common/block/tile/TileIncensePlate.java | 12 +-- .../common/block/tile/TileLightRelay.java | 36 +++---- .../common/block/tile/TileManaFlame.java | 2 +- .../common/block/tile/TileOpenCrate.java | 12 +-- .../common/block/tile/TilePlatform.java | 4 +- .../botania/common/block/tile/TilePylon.java | 26 ++--- .../common/block/tile/TileRuneAltar.java | 40 ++++---- .../common/block/tile/TileSparkChanger.java | 8 +- .../common/block/tile/TileSpawnerClaw.java | 4 +- .../common/block/tile/TileSpecialFlower.java | 8 +- .../common/block/tile/TileSpiritShrine.java | 2 +- .../common/block/tile/TileStarfield.java | 8 +- .../common/block/tile/TileTerraPlate.java | 20 ++-- .../common/block/tile/TileTeruTeruBozu.java | 12 +-- .../common/block/tile/TileTinyPlanet.java | 2 +- .../common/block/tile/TileTinyPotato.java | 8 +- .../block/tile/corporea/TileCorporeaBase.java | 2 +- .../corporea/TileCorporeaCrystalCube.java | 12 +-- .../tile/corporea/TileCorporeaFunnel.java | 20 ++-- .../tile/corporea/TileCorporeaIndex.java | 16 ++-- .../corporea/TileCorporeaInterceptor.java | 10 +- .../tile/corporea/TileCorporeaRetainer.java | 6 +- .../common/block/tile/mana/TileBellows.java | 34 +++---- .../block/tile/mana/TileDistributor.java | 6 +- .../block/tile/mana/TileManaDetector.java | 8 +- .../common/block/tile/mana/TilePool.java | 44 ++++----- .../common/block/tile/mana/TilePrism.java | 2 +- .../common/block/tile/mana/TilePump.java | 14 +-- .../block/tile/mana/TileRFGenerator.java | 4 +- .../common/block/tile/mana/TileSpreader.java | 56 +++++------ .../common/block/tile/mana/TileTurntable.java | 8 +- .../block/tile/string/TileRedString.java | 10 +- .../tile/string/TileRedStringComparator.java | 6 +- .../tile/string/TileRedStringContainer.java | 2 +- .../tile/string/TileRedStringDispenser.java | 6 +- .../tile/string/TileRedStringFertilizer.java | 2 +- .../tile/string/TileRedStringInterceptor.java | 8 +- .../block/tile/string/TileRedStringRelay.java | 4 +- .../core/command/CommandDownloadLatest.java | 10 +- .../common/core/command/CommandOpen.java | 6 +- .../common/core/command/CommandShare.java | 4 +- .../core/command/CommandSkyblockSpread.java | 10 +- .../core/handler/BiomeDecorationHandler.java | 6 +- .../common/core/handler/ConfigHandler.java | 4 +- .../common/core/handler/PixieHandler.java | 8 +- .../common/core/handler/SheddingHandler.java | 4 +- .../common/core/helper/InventoryHelper.java | 2 +- .../common/core/proxy/ServerProxy.java | 2 +- .../common/core/version/AdaptorNotifier.java | 4 +- .../core/version/ThreadDownloadMod.java | 12 +-- .../common/core/version/VersionChecker.java | 10 +- .../common/entity/EntityBabylonWeapon.java | 18 ++-- .../common/entity/EntityCorporeaSpark.java | 20 ++-- .../common/entity/EntityDoppleganger.java | 94 +++++++++---------- .../common/entity/EntityEnderAirBottle.java | 12 +-- .../common/entity/EntityFallingStar.java | 12 +-- .../common/entity/EntityFlameRing.java | 10 +- .../common/entity/EntityMagicLandmine.java | 8 +- .../common/entity/EntityMagicMissile.java | 18 ++-- .../common/entity/EntityManaBurst.java | 42 ++++----- .../common/entity/EntityManaStorm.java | 8 +- .../common/entity/EntityPinkWither.java | 2 +- .../botania/common/entity/EntityPixie.java | 6 +- .../common/entity/EntityPoolMinecart.java | 18 ++-- .../botania/common/entity/EntitySpark.java | 24 ++--- .../common/entity/EntityThornChakram.java | 18 ++-- .../common/entity/EntityThrowableCopy.java | 24 ++--- .../common/entity/EntityThrownItem.java | 24 ++--- .../botania/common/entity/EntityVineBall.java | 14 +-- .../botania/common/item/ItemAstrolabe.java | 18 ++-- .../common/item/ItemBlackHoleTalisman.java | 2 +- .../botania/common/item/ItemBlackLotus.java | 6 +- .../botania/common/item/ItemBottledMana.java | 58 ++++++------ .../botania/common/item/ItemCacophonium.java | 4 +- .../common/item/ItemCorporeaSpark.java | 2 +- .../botania/common/item/ItemCraftingHalo.java | 8 +- .../botania/common/item/ItemEnderHand.java | 4 +- .../botania/common/item/ItemFertilizer.java | 2 +- .../botania/common/item/ItemFlowerBag.java | 4 +- .../botania/common/item/ItemGaiaHead.java | 2 +- .../botania/common/item/ItemGrassHorn.java | 8 +- .../botania/common/item/ItemLaputaShard.java | 24 ++--- .../botania/common/item/ItemLexicon.java | 2 +- .../botania/common/item/ItemManaGun.java | 2 +- .../botania/common/item/ItemManaMirror.java | 2 +- .../common/item/ItemObedienceStick.java | 2 +- .../botania/common/item/ItemPinkinator.java | 2 +- .../botania/common/item/ItemPoolMinecart.java | 4 +- .../botania/common/item/ItemSextant.java | 4 +- .../botania/common/item/ItemSlimeBottle.java | 4 +- .../botania/common/item/ItemSlingshot.java | 2 +- .../vazkii/botania/common/item/ItemSpark.java | 2 +- .../botania/common/item/ItemSpawnerMover.java | 2 +- .../botania/common/item/ItemThornChakram.java | 2 +- .../botania/common/item/ItemTwigWand.java | 2 +- .../botania/common/item/ItemVineBall.java | 2 +- .../vazkii/botania/common/item/ItemVirus.java | 4 +- .../item/block/ItemBlockTinyPotato.java | 2 +- .../armor/terrasteel/ItemTerrasteelArmor.java | 2 +- .../equipment/bauble/ItemBalanceCloak.java | 2 +- .../item/equipment/bauble/ItemBauble.java | 4 +- .../equipment/bauble/ItemBloodPendant.java | 2 +- .../equipment/bauble/ItemCloudPendant.java | 2 +- .../item/equipment/bauble/ItemDivaCharm.java | 6 +- .../item/equipment/bauble/ItemDodgeRing.java | 6 +- .../equipment/bauble/ItemFlightTiara.java | 6 +- .../equipment/bauble/ItemGoldenLaurel.java | 4 +- .../item/equipment/bauble/ItemHolyCloak.java | 2 +- .../item/equipment/bauble/ItemIcePendant.java | 4 +- .../bauble/ItemInvisibilityCloak.java | 2 +- .../item/equipment/bauble/ItemItemFinder.java | 8 +- .../equipment/bauble/ItemKnockbackBelt.java | 2 +- .../item/equipment/bauble/ItemMagnetRing.java | 10 +- .../item/equipment/bauble/ItemMiningRing.java | 2 +- .../item/equipment/bauble/ItemMonocle.java | 4 +- .../item/equipment/bauble/ItemSwapRing.java | 4 +- .../item/equipment/bauble/ItemThirdEye.java | 2 +- .../item/equipment/bauble/ItemTinyPlanet.java | 4 +- .../item/equipment/bauble/ItemTravelBelt.java | 4 +- .../equipment/bauble/ItemUnholyCloak.java | 4 +- .../item/equipment/tool/ItemEnderDagger.java | 4 +- .../item/equipment/tool/ItemStarSword.java | 4 +- .../item/equipment/tool/ItemThunderSword.java | 12 +-- .../item/equipment/tool/ToolCommons.java | 2 +- .../equipment/tool/bow/ItemLivingwoodBow.java | 2 +- .../tool/elementium/ItemElementiumAxe.java | 6 +- .../tool/elementium/ItemElementiumShears.java | 8 +- .../tool/elementium/ItemElementiumShovel.java | 2 +- .../tool/manasteel/ItemManasteelShears.java | 18 ++-- .../tool/terrasteel/ItemTerraAxe.java | 4 +- .../tool/terrasteel/ItemTerraPick.java | 6 +- .../tool/terrasteel/ItemTerraSword.java | 12 +-- .../botania/common/item/lens/ItemLens.java | 2 +- .../botania/common/item/lens/LensDamage.java | 4 +- .../common/item/lens/LensExplosive.java | 4 +- .../botania/common/item/lens/LensFire.java | 16 ++-- .../common/item/lens/LensFirework.java | 6 +- .../common/item/lens/LensInfluence.java | 10 +- .../botania/common/item/lens/LensLight.java | 14 +-- .../botania/common/item/lens/LensMagnet.java | 4 +- .../botania/common/item/lens/LensMine.java | 8 +- .../botania/common/item/lens/LensPaint.java | 20 ++-- .../botania/common/item/lens/LensPiston.java | 14 +-- .../common/item/lens/LensRedirect.java | 6 +- .../botania/common/item/lens/LensStorm.java | 4 +- .../common/item/lens/LensTripwire.java | 4 +- .../botania/common/item/lens/LensWarp.java | 6 +- .../botania/common/item/lens/LensWeight.java | 14 +-- .../item/material/ItemManaResource.java | 2 +- .../common/item/material/ItemPetal.java | 4 +- .../common/item/relic/ItemAesirRing.java | 8 +- .../botania/common/item/relic/ItemDice.java | 6 +- .../common/item/relic/ItemFlugelEye.java | 4 +- .../common/item/relic/ItemKingKey.java | 10 +- .../common/item/relic/ItemLokiRing.java | 16 ++-- .../common/item/relic/ItemOdinRing.java | 2 +- .../common/item/rod/ItemExchangeRod.java | 8 +- .../botania/common/item/rod/ItemFireRod.java | 6 +- .../common/item/rod/ItemGravityRod.java | 24 ++--- .../common/item/rod/ItemMissileRod.java | 6 +- .../common/item/rod/ItemRainbowRod.java | 6 +- .../common/item/rod/ItemSkyDirtRod.java | 6 +- .../botania/common/item/rod/ItemSmeltRod.java | 14 +-- .../common/item/rod/ItemTerraformRod.java | 2 +- .../common/item/rod/ItemTornadoRod.java | 4 +- .../common/lexicon/RelicLexiconEntry.java | 2 +- .../botania/common/lexicon/page/PageBrew.java | 2 +- .../common/lexicon/page/PageEntity.java | 8 +- .../common/lexicon/page/PageRecipe.java | 4 +- .../common/lexicon/page/PageShedding.java | 4 +- .../common/lexicon/page/PageTutorial.java | 2 +- .../common/network/PacketBotaniaEffect.java | 14 +-- .../botania/common/network/PacketDodge.java | 4 +- .../common/world/SkyblockWorldEvents.java | 8 +- 252 files changed, 1100 insertions(+), 1100 deletions(-) diff --git a/build.properties b/build.properties index 93d37e310..cb9bd0cd3 100644 --- a/build.properties +++ b/build.properties @@ -4,7 +4,7 @@ mod_name=Botania cf_meta_version=1.10.2 forge_version=12.18.1.2076 dir_repo=./ -mc_mappings=snapshot_20160518 +mc_mappings=stable_29 version=r1.9 dir_output=../Build Output/Botania/ mc_version=1.10.2 diff --git a/src/main/java/vazkii/botania/api/internal/IManaNetwork.java b/src/main/java/vazkii/botania/api/internal/IManaNetwork.java index f45b5087d..51813c187 100644 --- a/src/main/java/vazkii/botania/api/internal/IManaNetwork.java +++ b/src/main/java/vazkii/botania/api/internal/IManaNetwork.java @@ -32,7 +32,7 @@ public interface IManaNetwork { /** * Gets the closest Mana Collector (eg. Mana Spreader) in the network to the Chunk * Coordinates passed in, in the given dimension.
- * A way of getting the dimension is via worldObj.provider.dimensionId
+ * A way of getting the dimension is via world.provider.dimensionId
* Note that this function *can* get performance intensive, it's reccomended you * call it sparingly and take cache of the value returned. * @param limit The maximum distance the closest block can be, if the closest block @@ -43,7 +43,7 @@ public interface IManaNetwork { /** * Gets the closest Mana Pool in the network to the Chunk Coordinates passed in, * in the given dimension.
- * A way of getting the dimension is via worldObj.provider.dimensionId
+ * A way of getting the dimension is via world.provider.dimensionId
* Note that this function *can* get performance intensive, it's reccomended you * call it sparingly and take cache of the value returned. * @param limit The maximum distance the closest block can be, if the closest block diff --git a/src/main/java/vazkii/botania/api/subtile/SubTileFunctional.java b/src/main/java/vazkii/botania/api/subtile/SubTileFunctional.java index 4eb541368..da56a4f32 100644 --- a/src/main/java/vazkii/botania/api/subtile/SubTileFunctional.java +++ b/src/main/java/vazkii/botania/api/subtile/SubTileFunctional.java @@ -137,7 +137,7 @@ public class SubTileFunctional extends SubTileEntity { return false; knownMana = mana; - player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.1F, 1F); + player.world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.1F, 1F); return super.onWanded(player, wand); } @@ -199,7 +199,7 @@ public class SubTileFunctional extends SubTileEntity { double dist = pos.distanceSq(supertile.getPos()); if(range >= dist) { - TileEntity tile = player.worldObj.getTileEntity(pos); + TileEntity tile = player.world.getTileEntity(pos); if(tile instanceof IManaPool) { linkedPool = tile; return true; @@ -210,7 +210,7 @@ public class SubTileFunctional extends SubTileEntity { } public boolean isValidBinding() { - return linkedPool != null && linkedPool.hasWorldObj() && !linkedPool.isInvalid() && supertile.getWorld().isBlockLoaded(linkedPool.getPos(), false) && supertile.getWorld().getTileEntity(linkedPool.getPos()) == linkedPool; + return linkedPool != null && linkedPool.hasWorld() && !linkedPool.isInvalid() && supertile.getWorld().isBlockLoaded(linkedPool.getPos(), false) && supertile.getWorld().getTileEntity(linkedPool.getPos()) == linkedPool; } @SideOnly(Side.CLIENT) diff --git a/src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java b/src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java index ce7da0c25..349b04a3d 100644 --- a/src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java +++ b/src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java @@ -220,11 +220,11 @@ public class SubTileGenerating extends SubTileEntity { if(player == null) return false; - if(!player.worldObj.isRemote) + if(!player.world.isRemote) sync(); knownMana = mana; - player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.1F, 1F); + player.world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.1F, 1F); return super.onWanded(player, wand); } @@ -289,7 +289,7 @@ public class SubTileGenerating extends SubTileEntity { double dist = pos.distanceSq(supertile.getPos()); if(range >= dist) { - TileEntity tile = player.worldObj.getTileEntity(pos); + TileEntity tile = player.world.getTileEntity(pos); if(tile instanceof IManaCollector) { linkedCollector = tile; return true; diff --git a/src/main/java/vazkii/botania/client/core/handler/AstrolabePreviewHandler.java b/src/main/java/vazkii/botania/client/core/handler/AstrolabePreviewHandler.java index fd9ec4129..894e8b8f8 100644 --- a/src/main/java/vazkii/botania/client/core/handler/AstrolabePreviewHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/AstrolabePreviewHandler.java @@ -36,7 +36,7 @@ public final class AstrolabePreviewHandler { @SubscribeEvent public static void onWorldRenderLast(RenderWorldLastEvent event) { - World world = Minecraft.getMinecraft().theWorld; + World world = Minecraft.getMinecraft().world; List playerEntities = world.playerEntities; for (EntityPlayer player : playerEntities) { ItemStack currentStack = player.getHeldItemMainhand(); diff --git a/src/main/java/vazkii/botania/client/core/handler/BlockHighlightRenderHandler.java b/src/main/java/vazkii/botania/client/core/handler/BlockHighlightRenderHandler.java index ef7db6ce0..3f4ac9313 100644 --- a/src/main/java/vazkii/botania/client/core/handler/BlockHighlightRenderHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/BlockHighlightRenderHandler.java @@ -55,14 +55,14 @@ public final class BlockHighlightRenderHandler { if(Botania.proxy.isClientPlayerWearingMonocle() && pos != null && pos.entityHit == null) { BlockPos bPos = pos.getBlockPos(); - ItemStack stackHeld = PlayerHelper.getFirstHeldItem(mc.thePlayer, ModItems.twigWand); + ItemStack stackHeld = PlayerHelper.getFirstHeldItem(mc.player, ModItems.twigWand); if(stackHeld != null && ItemTwigWand.getBindMode(stackHeld)) { BlockPos coords = ItemTwigWand.getBoundTile(stackHeld); if(coords.getY() != -1) bPos = coords; } - TileEntity tile = mc.theWorld.getTileEntity(bPos); + TileEntity tile = mc.world.getTileEntity(bPos); if(tile == null || !(tile instanceof ISubTileContainer)) break boundTile; ISubTileContainer container = (ISubTileContainer) tile; @@ -80,7 +80,7 @@ public final class BlockHighlightRenderHandler { } double offY = -1.0 / 16 + 0.005; - for(Entity e : mc.theWorld.loadedEntityList) + for(Entity e : mc.world.loadedEntityList) if(e instanceof EntityMagicLandmine) { BlockPos bpos = e.getPosition(); AxisAlignedBB aabb = new AxisAlignedBB(bpos).offset(0, offY, 0).expand(2.5, 0, 2.5); diff --git a/src/main/java/vazkii/botania/client/core/handler/BoundTileRenderer.java b/src/main/java/vazkii/botania/client/core/handler/BoundTileRenderer.java index c053e4f7d..f999ee522 100644 --- a/src/main/java/vazkii/botania/client/core/handler/BoundTileRenderer.java +++ b/src/main/java/vazkii/botania/client/core/handler/BoundTileRenderer.java @@ -50,7 +50,7 @@ public final class BoundTileRenderer { GlStateManager.disableTexture2D(); GlStateManager.enableBlend(); - EntityPlayer player = Minecraft.getMinecraft().thePlayer; + EntityPlayer player = Minecraft.getMinecraft().player; int color = Color.HSBtoRGB(ClientTickHandler.ticksInGame % 200 / 200F, 0.6F, 1F); if(player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof ICoordBoundItem) { @@ -112,7 +112,7 @@ public final class BoundTileRenderer { Color colorRGB = new Color(color); GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 255); - World world = Minecraft.getMinecraft().theWorld; + World world = Minecraft.getMinecraft().world; IBlockState state = world.getBlockState(pos); Block block = state.getBlock(); drawWireframe : { diff --git a/src/main/java/vazkii/botania/client/core/handler/ClientTickHandler.java b/src/main/java/vazkii/botania/client/core/handler/ClientTickHandler.java index 55d1de7b6..36f6aa854 100644 --- a/src/main/java/vazkii/botania/client/core/handler/ClientTickHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/ClientTickHandler.java @@ -61,7 +61,7 @@ public final class ClientTickHandler { RedStringRenderer.tick(); ItemsRemainingRenderHandler.tick(); - if(Minecraft.getMinecraft().theWorld == null) { + if(Minecraft.getMinecraft().world == null) { ManaNetworkHandler.instance.clear(); TileCorporeaIndex.indexes.clear(); SubTileVinculotus.existingFlowers.clear(); @@ -72,10 +72,10 @@ public final class ClientTickHandler { ticksInGame++; partialTicks = 0; - EntityPlayer player = Minecraft.getMinecraft().thePlayer; + EntityPlayer player = Minecraft.getMinecraft().player; if(player != null) { if(PlayerHelper.hasHeldItemClass(player, ModItems.twigWand)) { - for(TileSignature sig : ImmutableList.copyOf(ManaNetworkHandler.instance.getAllCollectorsInWorld(Minecraft.getMinecraft().theWorld))) { + for(TileSignature sig : ImmutableList.copyOf(ManaNetworkHandler.instance.getAllCollectorsInWorld(Minecraft.getMinecraft().world))) { if(!sig.isRemote()) continue; diff --git a/src/main/java/vazkii/botania/client/core/handler/ColorHandler.java b/src/main/java/vazkii/botania/client/core/handler/ColorHandler.java index 3154a1f10..a3b0f2068 100644 --- a/src/main/java/vazkii/botania/client/core/handler/ColorHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/ColorHandler.java @@ -142,7 +142,7 @@ public final class ColorHandler { return Minecraft.getMinecraft().getItemColors().getColorFromItemstack(lens, t); if(t == 2) { - EntityManaBurst burst = ((ItemManaGun) s.getItem()).getBurst(Minecraft.getMinecraft().thePlayer, s, false); + EntityManaBurst burst = ((ItemManaGun) s.getItem()).getBurst(Minecraft.getMinecraft().player, s, false); Color color = new Color(burst == null ? 0x20FF20 : burst.getColor()); float mul = (float) (Math.sin((double) ClientTickHandler.ticksInGame / 5) * 0.15F); diff --git a/src/main/java/vazkii/botania/client/core/handler/DebugHandler.java b/src/main/java/vazkii/botania/client/core/handler/DebugHandler.java index 2e9386b27..bf9183bea 100644 --- a/src/main/java/vazkii/botania/client/core/handler/DebugHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/DebugHandler.java @@ -45,7 +45,7 @@ public final class DebugHandler { @SubscribeEvent public static void onDrawDebugText(RenderGameOverlayEvent.Text event) { - World world = Minecraft.getMinecraft().theWorld; + World world = Minecraft.getMinecraft().world; if(Minecraft.getMinecraft().gameSettings.showDebugInfo) { event.getLeft().add(""); String version = LibMisc.VERSION; @@ -56,10 +56,10 @@ public final class DebugHandler { event.getLeft().add(PREFIX + "(CLIENT) netColl: " + ManaNetworkHandler.instance.getAllCollectorsInWorld(world).size() + ", netPool: " + ManaNetworkHandler.instance.getAllPoolsInWorld(world).size() + ", rv: " + version); if (Minecraft.getMinecraft().isSingleplayer()) { - UUID id = Minecraft.getMinecraft().thePlayer.getUniqueID(); + UUID id = Minecraft.getMinecraft().player.getUniqueID(); Entity ent = Minecraft.getMinecraft().getIntegratedServer().getEntityFromUuid(id); if (ent != null) { - World serverWorld = Minecraft.getMinecraft().getIntegratedServer().getEntityFromUuid(id).worldObj; + World serverWorld = Minecraft.getMinecraft().getIntegratedServer().getEntityFromUuid(id).world; event.getLeft().add(PREFIX + String.format("(INTEGRATED SERVER DIM %d) netColl : %d, netPool: %d", serverWorld.provider.getDimension(), ManaNetworkHandler.instance.getAllCollectorsInWorld(serverWorld).size(), ManaNetworkHandler.instance.getAllPoolsInWorld(serverWorld).size())); } } diff --git a/src/main/java/vazkii/botania/client/core/handler/HUDHandler.java b/src/main/java/vazkii/botania/client/core/handler/HUDHandler.java index 592c40973..886c99e33 100644 --- a/src/main/java/vazkii/botania/client/core/handler/HUDHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/HUDHandler.java @@ -88,11 +88,11 @@ public final class HUDHandler { if(event.getType() == ElementType.HEALTH) { profiler.startSection("botania-hud"); - IInventory baublesInv = BaublesApi.getBaubles(mc.thePlayer); + IInventory baublesInv = BaublesApi.getBaubles(mc.player); ItemStack headpiece = baublesInv.getStackInSlot(4); if(headpiece != null && headpiece.getItem() == ModItems.flightTiara) { profiler.startSection("flugelTiara"); - ItemFlightTiara.renderHUD(event.getResolution(), mc.thePlayer, headpiece); + ItemFlightTiara.renderHUD(event.getResolution(), mc.player, headpiece); profiler.endSection(); } @@ -105,7 +105,7 @@ public final class HUDHandler { } profiler.startSection("dodgeRing"); - ItemDodgeRing.renderHUD(event.getResolution(), mc.thePlayer, ring, event.getPartialTicks()); + ItemDodgeRing.renderHUD(event.getResolution(), mc.player, ring, event.getPartialTicks()); profiler.endSection(); } @@ -117,31 +117,31 @@ public final class HUDHandler { public static void onDrawScreenPost(RenderGameOverlayEvent.Post event) { Minecraft mc = Minecraft.getMinecraft(); Profiler profiler = mc.mcProfiler; - ItemStack main = mc.thePlayer.getHeldItemMainhand(); - ItemStack offhand = mc.thePlayer.getHeldItemOffhand(); + ItemStack main = mc.player.getHeldItemMainhand(); + ItemStack offhand = mc.player.getHeldItemOffhand(); if(event.getType() == ElementType.ALL) { profiler.startSection("botania-hud"); RayTraceResult pos = mc.objectMouseOver; if(pos != null) { - IBlockState state = pos.typeOfHit == RayTraceResult.Type.BLOCK ? mc.theWorld.getBlockState(pos.getBlockPos()) : null; + IBlockState state = pos.typeOfHit == RayTraceResult.Type.BLOCK ? mc.world.getBlockState(pos.getBlockPos()) : null; Block block = state == null ? null : state.getBlock(); - TileEntity tile = pos.typeOfHit == RayTraceResult.Type.BLOCK ? mc.theWorld.getTileEntity(pos.getBlockPos()) : null; + TileEntity tile = pos.typeOfHit == RayTraceResult.Type.BLOCK ? mc.world.getTileEntity(pos.getBlockPos()) : null; - if(PlayerHelper.hasAnyHeldItem(mc.thePlayer)) { - if(pos != null && PlayerHelper.hasHeldItem(mc.thePlayer, ModItems.twigWand)) { - renderWandModeDisplay(PlayerHelper.getFirstHeldItem(mc.thePlayer, ModItems.twigWand), event.getResolution()); + if(PlayerHelper.hasAnyHeldItem(mc.player)) { + if(pos != null && PlayerHelper.hasHeldItem(mc.player, ModItems.twigWand)) { + renderWandModeDisplay(PlayerHelper.getFirstHeldItem(mc.player, ModItems.twigWand), event.getResolution()); if(block instanceof IWandHUD) { profiler.startSection("wandItem"); - ((IWandHUD) block).renderHUD(mc, event.getResolution(), mc.theWorld, pos.getBlockPos()); + ((IWandHUD) block).renderHUD(mc, event.getResolution(), mc.world, pos.getBlockPos()); profiler.endSection(); } - } else if(block != null && PlayerHelper.hasHeldItemClass(mc.thePlayer, ILexicon.class)) - drawLexiconHUD(PlayerHelper.getFirstHeldItemClass(mc.thePlayer, ILexicon.class), state, pos, event.getResolution()); - if(tile != null && tile instanceof TilePool && mc.thePlayer.getHeldItemMainhand() != null) - renderPoolRecipeHUD(event.getResolution(), (TilePool) tile, mc.thePlayer.getHeldItemMainhand()); + } else if(block != null && PlayerHelper.hasHeldItemClass(mc.player, ILexicon.class)) + drawLexiconHUD(PlayerHelper.getFirstHeldItemClass(mc.player, ILexicon.class), state, pos, event.getResolution()); + if(tile != null && tile instanceof TilePool && mc.player.getHeldItemMainhand() != null) + renderPoolRecipeHUD(event.getResolution(), (TilePool) tile, mc.player.getHeldItemMainhand()); } if(tile != null && tile instanceof TileAltar) ((TileAltar) tile).renderHUD(mc, event.getResolution()); @@ -153,7 +153,7 @@ public final class HUDHandler { } TileCorporeaIndex.getInputHandler(); - if(!InputHandler.getNearbyIndexes(mc.thePlayer).isEmpty() && mc.currentScreen != null && mc.currentScreen instanceof GuiChat) { + if(!InputHandler.getNearbyIndexes(mc.player).isEmpty() && mc.currentScreen != null && mc.currentScreen instanceof GuiChat) { profiler.startSection("nearIndex"); renderNearIndexDisplay(event.getResolution()); profiler.endSection(); @@ -168,35 +168,35 @@ public final class HUDHandler { if(main != null && main.getItem() instanceof ItemCraftingHalo) { profiler.startSection("craftingHalo_main"); - ItemCraftingHalo.renderHUD(event.getResolution(), mc.thePlayer, main); + ItemCraftingHalo.renderHUD(event.getResolution(), mc.player, main); profiler.endSection(); } else if(offhand != null && offhand.getItem() instanceof ItemCraftingHalo) { profiler.startSection("craftingHalo_off"); - ItemCraftingHalo.renderHUD(event.getResolution(), mc.thePlayer, offhand); + ItemCraftingHalo.renderHUD(event.getResolution(), mc.player, offhand); profiler.endSection(); } if(main != null && main.getItem() instanceof ItemSextant) { profiler.startSection("sextant"); - ItemSextant.renderHUD(event.getResolution(), mc.thePlayer, main); + ItemSextant.renderHUD(event.getResolution(), mc.player, main); profiler.endSection(); } /*if(equippedStack != null && equippedStack.getItem() == ModItems.flugelEye) { profiler.startSection("flugelEye"); - ItemFlugelEye.renderHUD(event.getResolution(), mc.thePlayer, equippedStack); + ItemFlugelEye.renderHUD(event.getResolution(), mc.player, equippedStack); profiler.endSection(); }*/ if(Botania.proxy.isClientPlayerWearingMonocle()) { profiler.startSection("monocle"); - ItemMonocle.renderHUD(event.getResolution(), mc.thePlayer); + ItemMonocle.renderHUD(event.getResolution(), mc.player); profiler.endSection(); } profiler.startSection("manaBar"); - EntityPlayer player = mc.thePlayer; + EntityPlayer player = mc.player; if(!player.isSpectator()) { int totalMana = 0; int totalMaxMana = 0; @@ -322,7 +322,7 @@ public final class HUDHandler { int y = res.getScaledHeight() / 2 + 10; int u = tile.getCurrentMana() >= recipe.getManaToConsume() ? 0 : 22; - int v = mc.thePlayer.getName().equals("haighyorkie") && mc.thePlayer.isSneaking() ? 23 : 8; + int v = mc.player.getName().equals("haighyorkie") && mc.player.isSneaking() ? 23 : 8; GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); @@ -386,7 +386,7 @@ public final class HUDHandler { int sy = res.getScaledHeight() / 2 + 2; if(block instanceof ILexiconable) { - LexiconEntry entry = ((ILexiconable) block).getEntry(mc.theWorld, pos.getBlockPos(), mc.thePlayer, stack); + LexiconEntry entry = ((ILexiconable) block).getEntry(mc.world, pos.getBlockPos(), mc.player, stack); if(entry != null) { if(!((ILexicon) stack.getItem()).isKnowledgeUnlocked(stack, entry.getKnowledgeType())) font = mc.standardGalacticFontRenderer; @@ -399,12 +399,12 @@ public final class HUDHandler { if(!draw && pos.entityHit == null) { profiler.startSection("wikiLookup"); - if(!block.isAir(state, mc.theWorld, pos.getBlockPos()) && !(block instanceof BlockLiquid)) { + if(!block.isAir(state, mc.world, pos.getBlockPos()) && !(block instanceof BlockLiquid)) { IWikiProvider provider = WikiHooks.getWikiFor(block); - String url = provider.getWikiURL(mc.theWorld, pos, mc.thePlayer); + String url = provider.getWikiURL(mc.world, pos, mc.player); if(url != null && !url.isEmpty()) { - String name = provider.getBlockName(mc.theWorld, pos, mc.thePlayer); - String wikiName = provider.getWikiName(mc.theWorld, pos, mc.thePlayer); + String name = provider.getBlockName(mc.world, pos, mc.player); + String wikiName = provider.getWikiName(mc.world, pos, mc.player); drawStr = name + " @ " + TextFormatting.AQUA + wikiName; draw = true; } @@ -413,7 +413,7 @@ public final class HUDHandler { } if(draw) { - if(!mc.thePlayer.isSneaking()) { + if(!mc.player.isSneaking()) { drawStr = "?"; secondLine = ""; font = mc.fontRendererObj; @@ -424,7 +424,7 @@ public final class HUDHandler { font.drawStringWithShadow(drawStr, sx + 20, sy + 4, 0xFFFFFFFF); font.drawStringWithShadow(secondLine, sx + 20, sy + 14, 0xFFAAAAAA); - if(!mc.thePlayer.isSneaking()) { + if(!mc.player.isSneaking()) { GlStateManager.scale(0.5F, 0.5F, 1F); mc.fontRendererObj.drawStringWithShadow(TextFormatting.BOLD + "Shift", (sx + 10) * 2 - 16, (sy + 8) * 2 + 20, 0xFFFFFFFF); GlStateManager.scale(2F, 2F, 1F); diff --git a/src/main/java/vazkii/botania/client/core/handler/LightningHandler.java b/src/main/java/vazkii/botania/client/core/handler/LightningHandler.java index a3668f29f..2056401f2 100644 --- a/src/main/java/vazkii/botania/client/core/handler/LightningHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/LightningHandler.java @@ -49,7 +49,7 @@ public class LightningHandler { profiler.endStartSection("lightning"); float frame = event.getPartialTicks(); - Entity entity = Minecraft.getMinecraft().thePlayer; + Entity entity = Minecraft.getMinecraft().player; TextureManager render = Minecraft.getMinecraft().renderEngine; double interpPosX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * frame; diff --git a/src/main/java/vazkii/botania/client/core/handler/MiscellaneousIcons.java b/src/main/java/vazkii/botania/client/core/handler/MiscellaneousIcons.java index 7cfb4b395..b19ca6801 100644 --- a/src/main/java/vazkii/botania/client/core/handler/MiscellaneousIcons.java +++ b/src/main/java/vazkii/botania/client/core/handler/MiscellaneousIcons.java @@ -179,7 +179,7 @@ public class MiscellaneousIcons { @SubscribeEvent public void dumpAtlas(ArrowLooseEvent evt) { - if (!evt.getEntityPlayer().worldObj.isRemote || !((Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment")) + if (!evt.getEntityPlayer().world.isRemote || !((Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment")) || !evt.getEntityPlayer().isSneaking()) return; Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); diff --git a/src/main/java/vazkii/botania/client/core/handler/MultiblockBlockAccess.java b/src/main/java/vazkii/botania/client/core/handler/MultiblockBlockAccess.java index 5e3656d79..e5be50d3e 100644 --- a/src/main/java/vazkii/botania/client/core/handler/MultiblockBlockAccess.java +++ b/src/main/java/vazkii/botania/client/core/handler/MultiblockBlockAccess.java @@ -85,9 +85,9 @@ public class MultiblockBlockAccess implements IBlockAccess { @Nonnull @Override - public Biome getBiomeGenForCoords(@Nonnull BlockPos pos) { + public Biome getBiome(@Nonnull BlockPos pos) { if(hasBlockAccess) - return originalBlockAccess.getBiomeGenForCoords(pos); + return originalBlockAccess.getBiome(pos); return null; } diff --git a/src/main/java/vazkii/botania/client/core/handler/MultiblockRenderHandler.java b/src/main/java/vazkii/botania/client/core/handler/MultiblockRenderHandler.java index bab099fee..7f427e658 100644 --- a/src/main/java/vazkii/botania/client/core/handler/MultiblockRenderHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/MultiblockRenderHandler.java @@ -77,21 +77,21 @@ public final class MultiblockRenderHandler { angle = EnumFacing.SOUTH; Minecraft mc = Minecraft.getMinecraft(); - if(mc.theWorld != null) - dimension = mc.theWorld.provider.getDimension(); + if(mc.world != null) + dimension = mc.world.provider.getDimension(); } @SubscribeEvent public static void onWorldRenderLast(RenderWorldLastEvent event) { Minecraft mc = Minecraft.getMinecraft(); - if(mc.thePlayer != null && mc.objectMouseOver != null && mc.objectMouseOver.getBlockPos() != null && (!mc.thePlayer.isSneaking() || anchor != null)) { - renderPlayerLook(mc.thePlayer, mc.objectMouseOver); + if(mc.player != null && mc.objectMouseOver != null && mc.objectMouseOver.getBlockPos() != null && (!mc.player.isSneaking() || anchor != null)) { + renderPlayerLook(mc.player, mc.objectMouseOver); } } @SubscribeEvent public static void onPlayerInteract(PlayerInteractEvent.RightClickBlock event) { - if(currentMultiblock != null && anchor == null && event.getEntityPlayer() == Minecraft.getMinecraft().thePlayer) { + if(currentMultiblock != null && anchor == null && event.getEntityPlayer() == Minecraft.getMinecraft().player) { anchor = event.getPos(); angle = event.getEntityPlayer().getHorizontalFacing(); event.setCanceled(true); @@ -99,7 +99,7 @@ public final class MultiblockRenderHandler { } private static void renderPlayerLook(EntityPlayer player, RayTraceResult src) { - if(currentMultiblock != null && dimension == player.worldObj.provider.getDimension()) { + if(currentMultiblock != null && dimension == player.world.provider.getDimension()) { BlockPos anchorPos = anchor != null ? anchor : src.getBlockPos(); GlStateManager.pushMatrix(); @@ -111,7 +111,7 @@ public final class MultiblockRenderHandler { Multiblock mb = anchor != null ? currentMultiblock.getForFacing(angle) : currentMultiblock.getForEntity(player); boolean didAny = false; - blockAccess.update(player.worldObj, mb, anchorPos); + blockAccess.update(player.world, mb, anchorPos); ShaderHelper.useShader(ShaderHelper.alpha, shader -> { int alpha = ARBShaderObjects.glGetUniformLocationARB(shader, "alpha"); @@ -119,7 +119,7 @@ public final class MultiblockRenderHandler { }); for(MultiblockComponent comp : mb.getComponents()) { - if(renderComponentInWorld(player.worldObj, mb, comp, anchorPos)) + if(renderComponentInWorld(player.world, mb, comp, anchorPos)) didAny = true; } @@ -131,7 +131,7 @@ public final class MultiblockRenderHandler { if(!didAny) { setMultiblock(null); - player.addChatComponentMessage(new TextComponentTranslation("botaniamisc.structureComplete").setStyle(new Style().setColor(TextFormatting.GREEN))); + player.sendMessage(new TextComponentTranslation("botaniamisc.structureComplete").setStyle(new Style().setColor(TextFormatting.GREEN))); } } } diff --git a/src/main/java/vazkii/botania/client/core/handler/RedStringRenderer.java b/src/main/java/vazkii/botania/client/core/handler/RedStringRenderer.java index 9108e8f4f..cb5e3f9f9 100644 --- a/src/main/java/vazkii/botania/client/core/handler/RedStringRenderer.java +++ b/src/main/java/vazkii/botania/client/core/handler/RedStringRenderer.java @@ -56,7 +56,7 @@ public final class RedStringRenderer { } public static void tick() { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; + EntityPlayer player = Minecraft.getMinecraft().player; boolean hasWand = player != null && PlayerHelper.hasHeldItem(player, ModItems.twigWand); if(sizeAlpha > 0F && !hasWand) sizeAlpha -= 0.1F; diff --git a/src/main/java/vazkii/botania/client/core/handler/RenderLexicon.java b/src/main/java/vazkii/botania/client/core/handler/RenderLexicon.java index 7db04ae49..403977921 100644 --- a/src/main/java/vazkii/botania/client/core/handler/RenderLexicon.java +++ b/src/main/java/vazkii/botania/client/core/handler/RenderLexicon.java @@ -44,12 +44,12 @@ public class RenderLexicon { Minecraft mc = Minecraft.getMinecraft(); if(!ConfigHandler.lexicon3dModel || mc.gameSettings.thirdPersonView != 0 - || mc.thePlayer.getHeldItem(evt.getHand()) == null - || mc.thePlayer.getHeldItem(evt.getHand()).getItem() != ModItems.lexicon) + || mc.player.getHeldItem(evt.getHand()) == null + || mc.player.getHeldItem(evt.getHand()).getItem() != ModItems.lexicon) return; evt.setCanceled(true); try { - renderItemInFirstPerson(mc.thePlayer, evt.getPartialTicks(), evt.getInterpolatedPitch(), evt.getHand(), evt.getSwingProgress(), evt.getItemStack(), evt.getEquipProgress()); + renderItemInFirstPerson(mc.player, evt.getPartialTicks(), evt.getInterpolatedPitch(), evt.getHand(), evt.getSwingProgress(), evt.getItemStack(), evt.getEquipProgress()); } catch (Throwable throwable) { Botania.LOGGER.warn("Failed to render lexicon"); } @@ -61,8 +61,8 @@ public class RenderLexicon { EnumHandSide enumhandside = flag ? player.getPrimaryHand() : player.getPrimaryHand().opposite(); GlStateManager.pushMatrix(); boolean flag1 = enumhandside == EnumHandSide.RIGHT; - float f = -0.4F * MathHelper.sin(MathHelper.sqrt_float(swingProgress) * (float)Math.PI); - float f1 = 0.2F * MathHelper.sin(MathHelper.sqrt_float(swingProgress) * ((float)Math.PI * 2F)); + float f = -0.4F * MathHelper.sin(MathHelper.sqrt(swingProgress) * (float)Math.PI); + float f1 = 0.2F * MathHelper.sin(MathHelper.sqrt(swingProgress) * ((float)Math.PI * 2F)); float f2 = -0.2F * MathHelper.sin(swingProgress * (float)Math.PI); int i = flag1 ? 1 : -1; GlStateManager.translate(i * f, f1, f2); @@ -115,7 +115,7 @@ public class RenderLexicon { font.drawString(TextFormatting.ITALIC + "" + TextFormatting.BOLD + I18n.format("botaniamisc.edition", ItemLexicon.getEdition()), 0, 0, 0xA07100); if(quote == -1) - quote = mc.theWorld.rand.nextInt(QUOTES.length); + quote = mc.world.rand.nextInt(QUOTES.length); String quoteStr = QUOTES[quote]; @@ -159,7 +159,7 @@ public class RenderLexicon { // End add float f = MathHelper.sin(p_187453_2_ * p_187453_2_ * (float)Math.PI); GlStateManager.rotate(i * (45.0F + f * -20.0F), 0.0F, 1.0F, 0.0F); - float f1 = MathHelper.sin(MathHelper.sqrt_float(p_187453_2_) * (float)Math.PI); + float f1 = MathHelper.sin(MathHelper.sqrt(p_187453_2_) * (float)Math.PI); GlStateManager.rotate(i * f1 * -20.0F, 0.0F, 0.0F, 1.0F); GlStateManager.rotate(f1 * -80.0F, 1.0F, 0.0F, 0.0F); GlStateManager.rotate(i * -45.0F, 0.0F, 1.0F, 0.0F); diff --git a/src/main/java/vazkii/botania/client/core/handler/TooltipAdditionDisplayHandler.java b/src/main/java/vazkii/botania/client/core/handler/TooltipAdditionDisplayHandler.java index 522462968..a6d2e5c92 100644 --- a/src/main/java/vazkii/botania/client/core/handler/TooltipAdditionDisplayHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/TooltipAdditionDisplayHandler.java @@ -66,7 +66,7 @@ public final class TooltipAdditionDisplayHandler { ItemStack lexiconStack = null; for(int i = 0; i < InventoryPlayer.getHotbarSize(); i++) { - ItemStack stackAt = mc.thePlayer.inventory.getStackInSlot(i); + ItemStack stackAt = mc.player.inventory.getStackInSlot(i); if(stackAt != null && stackAt.getItem() instanceof ILexicon && ((ILexicon) stackAt.getItem()).isKnowledgeUnlocked(stackAt, data.entry.getKnowledgeType())) { lexiconStack = stackAt; lexSlot = i; @@ -115,11 +115,11 @@ public final class TooltipAdditionDisplayHandler { GlStateManager.shadeModel(GL11.GL_FLAT); if(lexiconLookupTime >= time) { - mc.thePlayer.inventory.currentItem = lexSlot; + mc.player.inventory.currentItem = lexSlot; Botania.proxy.setEntryToOpen(data.entry); Botania.proxy.setLexiconStack(lexiconStack); - mc.thePlayer.closeScreen(); - ItemLexicon.openBook(mc.thePlayer, lexiconStack, mc.theWorld, false); + mc.player.closeScreen(); + ItemLexicon.openBook(mc.player, lexiconStack, mc.world, false); } } else lexiconLookupTime = 0F; diff --git a/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java b/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java index a3fc3d2e3..cebf193c8 100644 --- a/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java +++ b/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java @@ -317,23 +317,23 @@ public class ClientProxy implements IProxy { @Override public boolean isTheClientPlayer(EntityLivingBase entity) { - return entity == Minecraft.getMinecraft().thePlayer; + return entity == Minecraft.getMinecraft().player; } @Override public EntityPlayer getClientPlayer() { - return Minecraft.getMinecraft().thePlayer; + return Minecraft.getMinecraft().player; } @Override public boolean isClientPlayerWearingMonocle() { - return ItemMonocle.hasMonocle(Minecraft.getMinecraft().thePlayer); + return ItemMonocle.hasMonocle(Minecraft.getMinecraft().player); } @Override public void setExtraReach(EntityLivingBase entity, float reach) { Minecraft mc = Minecraft.getMinecraft(); - EntityPlayer player = mc.thePlayer; + EntityPlayer player = mc.player; if(entity == player) { if(!(mc.playerController instanceof IExtendedPlayerController)) { NetHandlerPlayClient net = ReflectionHelper.getPrivateValue(PlayerControllerMP.class, mc.playerController, LibObfuscation.NET_CLIENT_HANDLER); @@ -353,7 +353,7 @@ public class ClientProxy implements IProxy { @Override public boolean openWikiPage(World world, Block block, RayTraceResult pos) { IWikiProvider wiki = WikiHooks.getWikiFor(block); - String url = wiki.getWikiURL(world, pos, Minecraft.getMinecraft().thePlayer); + String url = wiki.getWikiURL(world, pos, Minecraft.getMinecraft().player); if(url != null && !url.isEmpty()) { try { Desktop.getDesktop().browse(new URI(url)); @@ -441,7 +441,7 @@ public class ClientProxy implements IProxy { if(!doParticle() && !fake) return; - FXSparkle sparkle = new FXSparkle(Minecraft.getMinecraft().theWorld, x, y, z, size, r, g, b, m); + FXSparkle sparkle = new FXSparkle(Minecraft.getMinecraft().world, x, y, z, size, r, g, b, m); sparkle.fake = sparkle.noClip = fake; if(noclipEnabled) sparkle.noClip = true; @@ -468,7 +468,7 @@ public class ClientProxy implements IProxy { if(!doParticle()) return; - FXWisp wisp = new FXWisp(Minecraft.getMinecraft().theWorld, x, y, z, size, r, g, b, distanceLimit, depthTest, maxAgeMul); + FXWisp wisp = new FXWisp(Minecraft.getMinecraft().world, x, y, z, size, r, g, b, distanceLimit, depthTest, maxAgeMul); wisp.setSpeed(motionx, motiony, motionz); Minecraft.getMinecraft().effectRenderer.addEffect(wisp); } @@ -491,7 +491,7 @@ public class ClientProxy implements IProxy { @Override public void lightningFX(Vector3 vectorStart, Vector3 vectorEnd, float ticksPerMeter, long seed, int colorOuter, int colorInner) { - Minecraft.getMinecraft().effectRenderer.addEffect(new FXLightning(Minecraft.getMinecraft().theWorld, vectorStart, vectorEnd, ticksPerMeter, seed, colorOuter, colorInner)); + Minecraft.getMinecraft().effectRenderer.addEffect(new FXLightning(Minecraft.getMinecraft().world, vectorStart, vectorEnd, ticksPerMeter, seed, colorOuter, colorInner)); } @Override diff --git a/src/main/java/vazkii/botania/client/fx/FXLightning.java b/src/main/java/vazkii/botania/client/fx/FXLightning.java index edcb9c92a..3b5a8aa1f 100644 --- a/src/main/java/vazkii/botania/client/fx/FXLightning.java +++ b/src/main/java/vazkii/botania/client/fx/FXLightning.java @@ -180,15 +180,15 @@ public class FXLightning extends Particle { } private float rayTraceResistance(Vector3 start, Vector3 end, float prevresistance) { - RayTraceResult mop = worldObj.rayTraceBlocks(start.toVec3D(), end.toVec3D()); + RayTraceResult mop = world.rayTraceBlocks(start.toVec3D(), end.toVec3D()); if(mop == null) return prevresistance; if(mop.typeOfHit == RayTraceResult.Type.BLOCK) { - Block block = worldObj.getBlockState(mop.getBlockPos()).getBlock(); + Block block = world.getBlockState(mop.getBlockPos()).getBlock(); - if(worldObj.isAirBlock(mop.getBlockPos())) + if(world.isAirBlock(mop.getBlockPos())) return prevresistance; return prevresistance + block.getExplosionResistance(null) + 0.3F; diff --git a/src/main/java/vazkii/botania/client/fx/FXSparkle.java b/src/main/java/vazkii/botania/client/fx/FXSparkle.java index f777627a6..be59cbaf7 100644 --- a/src/main/java/vazkii/botania/client/fx/FXSparkle.java +++ b/src/main/java/vazkii/botania/client/fx/FXSparkle.java @@ -141,7 +141,7 @@ public class FXSparkle extends Particle { motionY -= 0.04D * particleGravity; if (!noClip && !fake) - wiggleAround(posX, (getEntityBoundingBox().minY + getEntityBoundingBox().maxY) / 2.0D, posZ); + wiggleAround(posX, (getBoundingBox().minY + getBoundingBox().maxY) / 2.0D, posZ); posX += motionX; posY += motionY; @@ -175,37 +175,37 @@ public class FXSparkle extends Particle { double d2 = z - blockpos.getZ(); // Botania - change collision box list check to !airblock check - if (!worldObj.isAirBlock(blockpos)) + if (!world.isAirBlock(blockpos)) { EnumFacing enumfacing = EnumFacing.UP; double d3 = Double.MAX_VALUE; - if (!worldObj.isBlockFullCube(blockpos.west()) && d0 < d3) + if (!world.isBlockFullCube(blockpos.west()) && d0 < d3) { d3 = d0; enumfacing = EnumFacing.WEST; } - if (!worldObj.isBlockFullCube(blockpos.east()) && 1.0D - d0 < d3) + if (!world.isBlockFullCube(blockpos.east()) && 1.0D - d0 < d3) { d3 = 1.0D - d0; enumfacing = EnumFacing.EAST; } - if (!worldObj.isBlockFullCube(blockpos.north()) && d2 < d3) + if (!world.isBlockFullCube(blockpos.north()) && d2 < d3) { d3 = d2; enumfacing = EnumFacing.NORTH; } - if (!worldObj.isBlockFullCube(blockpos.south()) && 1.0D - d2 < d3) + if (!world.isBlockFullCube(blockpos.south()) && 1.0D - d2 < d3) { d3 = 1.0D - d2; enumfacing = EnumFacing.SOUTH; } - if (!worldObj.isBlockFullCube(blockpos.up()) && 1.0D - d1 < d3) + if (!world.isBlockFullCube(blockpos.up()) && 1.0D - d1 < d3) { d3 = 1.0D - d1; enumfacing = EnumFacing.UP; diff --git a/src/main/java/vazkii/botania/client/gui/bag/GuiFlowerBag.java b/src/main/java/vazkii/botania/client/gui/bag/GuiFlowerBag.java index e6b1b3830..cad65e4ef 100644 --- a/src/main/java/vazkii/botania/client/gui/bag/GuiFlowerBag.java +++ b/src/main/java/vazkii/botania/client/gui/bag/GuiFlowerBag.java @@ -53,8 +53,8 @@ public class GuiFlowerBag extends GuiContainer { SlotItemHandler slotf = (SlotItemHandler) slot; if(!slotf.getHasStack()) { ItemStack stack = new ItemStack(ModBlocks.flower, 0, slotf.getSlotIndex()); // index matches colors - int x = guiLeft + slotf.xDisplayPosition; - int y = guiTop + slotf.yDisplayPosition; + int x = guiLeft + slotf.xPos; + int y = guiTop + slotf.yPos; RenderHelper.enableGUIStandardItemLighting(); mc.getRenderItem().renderItemIntoGUI(stack, x, y); RenderHelper.disableStandardItemLighting(); diff --git a/src/main/java/vazkii/botania/client/gui/box/GuiBaubleBox.java b/src/main/java/vazkii/botania/client/gui/box/GuiBaubleBox.java index 003ad47dc..4f5e72a58 100644 --- a/src/main/java/vazkii/botania/client/gui/box/GuiBaubleBox.java +++ b/src/main/java/vazkii/botania/client/gui/box/GuiBaubleBox.java @@ -36,10 +36,10 @@ public class GuiBaubleBox extends GuiContainer { for(int i1 = 0; i1 < 7; ++i1) { Slot slot = inventorySlots.inventorySlots.get(i1); if(slot.getHasStack() && slot.getSlotStackLimit() == 1) - drawTexturedModalRect(guiLeft+slot.xDisplayPosition, guiTop+slot.yDisplayPosition, 200, 0, 16, 16); + drawTexturedModalRect(guiLeft+slot.xPos, guiTop+slot.yPos, 200, 0, 16, 16); } -// GuiInventory.drawEntityOnScreen(guiLeft + 43, guiTop + 61, 20, guiLeft + 43 - mouseX, guiTop + 45 - 30 - mouseY, mc.thePlayer); +// GuiInventory.drawEntityOnScreen(guiLeft + 43, guiTop + 61, 20, guiLeft + 43 - mouseX, guiTop + 45 - 30 - mouseY, mc.player); } } diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexicon.java b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexicon.java index bf10e44c5..70b9bc45e 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexicon.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexicon.java @@ -291,7 +291,7 @@ public class GuiLexicon extends GuiScreen { bookmarksNeedPopulation = false; } - if(mc.thePlayer.getName().equals("haighyorkie")) { + if(mc.player.getName().equals("haighyorkie")) { GlStateManager.color(1F, 1F, 1F, 1F); mc.renderEngine.bindTexture(texture); drawTexturedModalRect(left - 19, top + 42, 67, 180, 19, 26); @@ -435,7 +435,7 @@ public class GuiLexicon extends GuiScreen { mc.displayGuiScreen(new GuiBotaniaConfig(this)); break; case -2 : - mc.displayGuiScreen(new GuiAchievementsHacky(this, mc.thePlayer.getStatFileWriter())); + mc.displayGuiScreen(new GuiAchievementsHacky(this, mc.player.getStatFileWriter())); break; case -3 : mc.displayGuiScreen(new GuiLexiconChallengesList()); diff --git a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconEntry.java b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconEntry.java index 78b59053a..7d882c7ac 100644 --- a/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconEntry.java +++ b/src/main/java/vazkii/botania/client/gui/lexicon/GuiLexiconEntry.java @@ -165,7 +165,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa String cmd = "/botania-share " + entry.getUnlocalizedName(); mc.ingameGUI.getChatGUI().addToSentMessages(cmd); - mc.thePlayer.sendChatMessage(cmd); + mc.player.sendChatMessage(cmd); break; case 4 : try { @@ -213,7 +213,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa tutorial.poll(); positionTutorialArrow(); if(tutorial.isEmpty()) { - mc.thePlayer.addChatMessage(new TextComponentTranslation("botaniamisc.tutorialEnded").setStyle(new Style().setColor(TextFormatting.RED))); + mc.player.sendMessage(new TextComponentTranslation("botaniamisc.tutorialEnded").setStyle(new Style().setColor(TextFormatting.RED))); hasTutorialArrow = false; } } diff --git a/src/main/java/vazkii/botania/client/model/ModelTeruTeruBozu.java b/src/main/java/vazkii/botania/client/model/ModelTeruTeruBozu.java index a53331925..674139255 100644 --- a/src/main/java/vazkii/botania/client/model/ModelTeruTeruBozu.java +++ b/src/main/java/vazkii/botania/client/model/ModelTeruTeruBozu.java @@ -43,7 +43,7 @@ public class ModelTeruTeruBozu extends ModelBase { public void render() { float f5 = 1F / 16F; - if(Minecraft.getMinecraft().theWorld.isRaining()) + if(Minecraft.getMinecraft().world.isRaining()) sadFace.render(f5); else happyFace.render(f5); thread.render(f5); diff --git a/src/main/java/vazkii/botania/client/model/PlatformModel.java b/src/main/java/vazkii/botania/client/model/PlatformModel.java index f9fdaee48..4be0e62de 100644 --- a/src/main/java/vazkii/botania/client/model/PlatformModel.java +++ b/src/main/java/vazkii/botania/client/model/PlatformModel.java @@ -148,8 +148,8 @@ public class PlatformModel implements IBakedModel { @Nonnull @Override - public Biome getBiomeGenForCoords(@Nonnull BlockPos pos) { - return compose.getBiomeGenForCoords(pos); + public Biome getBiome(@Nonnull BlockPos pos) { + return compose.getBiome(pos); } @Override diff --git a/src/main/java/vazkii/botania/client/render/entity/RenderCorporeaSpark.java b/src/main/java/vazkii/botania/client/render/entity/RenderCorporeaSpark.java index 87ef9febd..5fa4078f8 100644 --- a/src/main/java/vazkii/botania/client/render/entity/RenderCorporeaSpark.java +++ b/src/main/java/vazkii/botania/client/render/entity/RenderCorporeaSpark.java @@ -76,7 +76,7 @@ public class RenderCorporeaSpark extends RenderSparkBase { GlStateManager.translate(0F, 0F, -2F + (time < 0 ? -absTime : absTime) / 6); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); - TextureAtlasSprite icon = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(stack, entity.worldObj, null).getParticleTexture(); + TextureAtlasSprite icon = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(stack, entity.world, null).getParticleTexture(); if(icon != null) { float minU = icon.getMinU(); 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 02da83533..70ebe9605 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaCrystalCube.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaCrystalCube.java @@ -170,7 +170,7 @@ public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer 0.0F) { @@ -375,7 +375,7 @@ public class SkyblockSkyRenderer extends IRenderHandler { // Botania - no horizon rendering /* GlStateManager.disableTexture2D(); GlStateManager.color(0.0F, 0.0F, 0.0F); - double d0 = this.mc.thePlayer.getPositionEyes(partialTicks).yCoord - this.theWorld.getHorizon(); + double d0 = this.mc.player.getPositionEyes(partialTicks).yCoord - this.world.getHorizon(); if (d0 < 0.0D) { @@ -424,7 +424,7 @@ public class SkyblockSkyRenderer extends IRenderHandler { tessellator.draw(); } - if (this.theWorld.provider.isSkyColored()) + if (this.world.provider.isSkyColored()) { GlStateManager.color(f * 0.2F + 0.04F, f1 * 0.2F + 0.04F, f2 * 0.6F + 0.1F); } diff --git a/src/main/java/vazkii/botania/common/block/BlockCamo.java b/src/main/java/vazkii/botania/common/block/BlockCamo.java index 2360fd1af..7d9a9b414 100644 --- a/src/main/java/vazkii/botania/common/block/BlockCamo.java +++ b/src/main/java/vazkii/botania/common/block/BlockCamo.java @@ -44,7 +44,7 @@ public abstract class BlockCamo extends BlockMod { && Block.getBlockFromItem(currentStack.getItem()) != null && tile instanceof TileCamo) { TileCamo camo = (TileCamo) tile; - IBlockState changeState = Block.getBlockFromItem(currentStack.getItem()).onBlockPlaced(world, pos, side, hitX, hitY, hitZ, currentStack.getItemDamage(), player); + IBlockState changeState = Block.getBlockFromItem(currentStack.getItem()).getStateForPlacement(world, pos, side, hitX, hitY, hitZ, currentStack.getItemDamage(), player); if(isValidBlock(changeState) && !(changeState.getBlock() instanceof BlockCamo) && changeState.getMaterial() != Material.AIR) { camo.camoState = changeState; diff --git a/src/main/java/vazkii/botania/common/block/BlockFakeAir.java b/src/main/java/vazkii/botania/common/block/BlockFakeAir.java index b0d6db7d0..25532c760 100644 --- a/src/main/java/vazkii/botania/common/block/BlockFakeAir.java +++ b/src/main/java/vazkii/botania/common/block/BlockFakeAir.java @@ -38,7 +38,7 @@ public class BlockFakeAir extends BlockMod { private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 0, 0, 0); public BlockFakeAir() { - super(Material.field_189963_J, LibBlockNames.FAKE_AIR); + super(Material.STRUCTURE_VOID, LibBlockNames.FAKE_AIR); setTickRandomly(true); } diff --git a/src/main/java/vazkii/botania/common/block/BlockFelPumpkin.java b/src/main/java/vazkii/botania/common/block/BlockFelPumpkin.java index e41b7ab23..e6dd0bc45 100644 --- a/src/main/java/vazkii/botania/common/block/BlockFelPumpkin.java +++ b/src/main/java/vazkii/botania/common/block/BlockFelPumpkin.java @@ -82,7 +82,7 @@ public class BlockFelPumpkin extends BlockMod implements ILexiconable { EntityBlaze blaze = new EntityBlaze(world); blaze.setLocationAndAngles(pos.getX() + 0.5D, pos.getY() - 1.95D, pos.getZ() + 0.5D, 0.0F, 0.0F); blaze.getEntityData().setBoolean(TAG_FEL_SPAWNED, true); - world.spawnEntityInWorld(blaze); + world.spawnEntity(blaze); world.notifyNeighborsOfStateChange(pos, Blocks.AIR); world.notifyNeighborsOfStateChange(pos.down(), Blocks.AIR); world.notifyNeighborsOfStateChange(pos.down(2), Blocks.AIR); @@ -98,7 +98,7 @@ public class BlockFelPumpkin extends BlockMod implements ILexiconable { public static void onDrops(LivingDropsEvent event) { if(event.getEntityLiving() instanceof EntityBlaze && event.getEntityLiving().getEntityData().getBoolean(TAG_FEL_SPAWNED)) if(event.getDrops().isEmpty()) - event.getDrops().add(new EntityItem(event.getEntityLiving().worldObj, event.getEntityLiving().posX, event.getEntityLiving().posY, event.getEntityLiving().posZ, new ItemStack(Items.BLAZE_POWDER, 6))); + event.getDrops().add(new EntityItem(event.getEntityLiving().world, event.getEntityLiving().posX, event.getEntityLiving().posY, event.getEntityLiving().posZ, new ItemStack(Items.BLAZE_POWDER, 6))); else for(EntityItem item : event.getDrops()) { ItemStack stack = item.getEntityItem(); if(stack.getItem() == Items.BLAZE_ROD) diff --git a/src/main/java/vazkii/botania/common/block/BlockGhostRail.java b/src/main/java/vazkii/botania/common/block/BlockGhostRail.java index 1a248b1ae..7e5badc23 100644 --- a/src/main/java/vazkii/botania/common/block/BlockGhostRail.java +++ b/src/main/java/vazkii/botania/common/block/BlockGhostRail.java @@ -75,9 +75,9 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable, IMode @SubscribeEvent public static void onMinecartUpdate(MinecartUpdateEvent event) { BlockPos entPos = new BlockPos(event.getEntity()); - IBlockState state = event.getEntity().worldObj.getBlockState(entPos); + IBlockState state = event.getEntity().world.getBlockState(entPos); Block block = state.getBlock(); - boolean air = block.isAir(state, event.getEntity().worldObj, entPos); + boolean air = block.isAir(state, event.getEntity().world, entPos); int floatTicks = event.getEntity().getEntityData().getInteger(TAG_FLOAT_TICKS); if(block == ModBlocks.ghostRail) @@ -85,21 +85,21 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable, IMode else if(block instanceof BlockRailBase || block == ModBlocks.dreamwood) { event.getEntity().getEntityData().setInteger(TAG_FLOAT_TICKS, 0); if(floatTicks > 0) - event.getEntity().worldObj.playEvent(2003, entPos, 0); + event.getEntity().world.playEvent(2003, entPos, 0); } floatTicks = event.getEntity().getEntityData().getInteger(TAG_FLOAT_TICKS); if(floatTicks > 0) { - IBlockState stateBelow = event.getEntity().worldObj.getBlockState(entPos.down()); + IBlockState stateBelow = event.getEntity().world.getBlockState(entPos.down()); Block blockBelow = stateBelow.getBlock(); - boolean airBelow = blockBelow.isAir(stateBelow, event.getEntity().worldObj, entPos.down()); + boolean airBelow = blockBelow.isAir(stateBelow, event.getEntity().world, entPos.down()); if(air && airBelow || !air && !airBelow) event.getEntity().noClip = true; event.getEntity().motionY = 0.2; event.getEntity().motionX *= 1.4; event.getEntity().motionZ *= 1.4; event.getEntity().getEntityData().setInteger(TAG_FLOAT_TICKS, floatTicks - 1); - event.getEntity().worldObj.playEvent(2000, entPos, 0); + event.getEntity().world.playEvent(2000, entPos, 0); } else event.getEntity().noClip = false; } diff --git a/src/main/java/vazkii/botania/common/block/BlockHourglass.java b/src/main/java/vazkii/botania/common/block/BlockHourglass.java index 3345015de..300a0e106 100644 --- a/src/main/java/vazkii/botania/common/block/BlockHourglass.java +++ b/src/main/java/vazkii/botania/common/block/BlockHourglass.java @@ -98,8 +98,8 @@ public class BlockHourglass extends BlockMod implements IManaTrigger, IWandable, return false; if(hourglass.lock) { - if(!player.worldObj.isRemote) - player.addChatMessage(new TextComponentTranslation("botaniamisc.hourglassLock")); + if(!player.world.isRemote) + player.sendMessage(new TextComponentTranslation("botaniamisc.hourglassLock")); return true; } diff --git a/src/main/java/vazkii/botania/common/block/BlockManaBomb.java b/src/main/java/vazkii/botania/common/block/BlockManaBomb.java index 2c7378280..bf131f652 100644 --- a/src/main/java/vazkii/botania/common/block/BlockManaBomb.java +++ b/src/main/java/vazkii/botania/common/block/BlockManaBomb.java @@ -44,7 +44,7 @@ public class BlockManaBomb extends BlockMod implements IManaTrigger, ILexiconabl world.setBlockToAir(pos); EntityManaStorm storm = new EntityManaStorm(world); storm.setPosition(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); - world.spawnEntityInWorld(storm); + world.spawnEntity(storm); } } diff --git a/src/main/java/vazkii/botania/common/block/BlockPistonRelay.java b/src/main/java/vazkii/botania/common/block/BlockPistonRelay.java index 9c5ffee66..d030d770f 100644 --- a/src/main/java/vazkii/botania/common/block/BlockPistonRelay.java +++ b/src/main/java/vazkii/botania/common/block/BlockPistonRelay.java @@ -222,7 +222,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl world.setBlockState(pos.offset(dir), ModBlocks.pistonRelay.getDefaultState()); else if(!world.isRemote) { ItemStack stack = new ItemStack(ModBlocks.pistonRelay); - world.spawnEntityInWorld(new EntityItem(world, x + dir.getFrontOffsetX(), y + dir.getFrontOffsetY(), z + dir.getFrontOffsetZ(), stack)); + world.spawnEntity(new EntityItem(world, x + dir.getFrontOffsetX(), y + dir.getFrontOffsetY(), z + dir.getFrontOffsetZ(), stack)); } checkedCoords.add(s); newPos = new DimWithPos(world.provider.getDimension(), pos.offset(dir)); diff --git a/src/main/java/vazkii/botania/common/block/BlockStorage.java b/src/main/java/vazkii/botania/common/block/BlockStorage.java index 1100263d9..f463592aa 100644 --- a/src/main/java/vazkii/botania/common/block/BlockStorage.java +++ b/src/main/java/vazkii/botania/common/block/BlockStorage.java @@ -89,7 +89,7 @@ public class BlockStorage extends BlockMod implements ILexiconable { } @Override - public boolean isBeaconBase(IBlockAccess worldObj, BlockPos pos, BlockPos beaconPos) { + public boolean isBeaconBase(IBlockAccess world, BlockPos pos, BlockPos beaconPos) { return true; } diff --git a/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaIndex.java b/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaIndex.java index 381ade470..817bf67d6 100644 --- a/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaIndex.java +++ b/src/main/java/vazkii/botania/common/block/corporea/BlockCorporeaIndex.java @@ -76,15 +76,15 @@ public class BlockCorporeaIndex extends BlockCorporeaBase implements ILexiconabl } @Override - public boolean addLandingEffects(IBlockState state, net.minecraft.world.WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles ) + public boolean addLandingEffects(IBlockState state, net.minecraft.world.WorldServer world, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles ) { - float f = MathHelper.ceiling_float_int(entity.fallDistance - 3.0F); + float f = MathHelper.ceil(entity.fallDistance - 3.0F); double d0 = Math.min(0.2F + f / 15.0F, 10.0F); if (d0 > 2.5D) { d0 = 2.5D; } int i = (int)(150.0D * d0); - worldObj.spawnParticle(EnumParticleTypes.BLOCK_DUST, entity.posX, entity.posY, entity.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, Block.getStateId(ModBlocks.storage.getDefaultState().withProperty(BotaniaStateProps.STORAGE_VARIANT, StorageVariant.ELEMENTIUM))); + world.spawnParticle(EnumParticleTypes.BLOCK_DUST, entity.posX, entity.posY, entity.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, Block.getStateId(ModBlocks.storage.getDefaultState().withProperty(BotaniaStateProps.STORAGE_VARIANT, StorageVariant.ELEMENTIUM))); return true; } @@ -101,7 +101,7 @@ public class BlockCorporeaIndex extends BlockCorporeaBase implements ILexiconabl double d0 = pos.getX() + (j + 0.5D) / i; double d1 = pos.getY() + (k + 0.5D) / i; double d2 = pos.getZ() + (l + 0.5D) / i; - effectRenderer.addEffect(factory.getEntityFX(-1, world, d0, d1, d2, d0 - pos.getX() - 0.5D, d1 - pos.getY() - 0.5D, d2 - pos.getZ() - 0.5D, Block.getStateId(ModBlocks.storage.getDefaultState().withProperty(BotaniaStateProps.STORAGE_VARIANT, StorageVariant.ELEMENTIUM)))); + effectRenderer.addEffect(factory.createParticle(-1, world, d0, d1, d2, d0 - pos.getX() - 0.5D, d1 - pos.getY() - 0.5D, d2 - pos.getZ() - 0.5D, Block.getStateId(ModBlocks.storage.getDefaultState().withProperty(BotaniaStateProps.STORAGE_VARIANT, StorageVariant.ELEMENTIUM)))); } } } diff --git a/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartz.java b/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartz.java index 2ff571e9c..b7c93c6fd 100644 --- a/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartz.java +++ b/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartz.java @@ -89,7 +89,7 @@ public class BlockSpecialQuartz extends BlockMod implements ILexiconable { @Nonnull @Override - public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing side, float par6, float par7, float par8, int meta, EntityLivingBase placer) { + public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing side, float par6, float par7, float par8, int meta, EntityLivingBase placer) { if (meta == 2) { // Pillar quartz variant switch (side.getAxis()) { case Y: @@ -114,7 +114,7 @@ public class BlockSpecialQuartz extends BlockMod implements ILexiconable { } @Override - public ItemStack createStackedBlock(@Nonnull IBlockState state) { + public ItemStack getSilkTouchDrop(@Nonnull IBlockState state) { return new ItemStack(this, 1, damageDropped(state)); } diff --git a/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartzSlab.java b/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartzSlab.java index 9ecb9c682..920e90a84 100644 --- a/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartzSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/quartz/BlockSpecialQuartzSlab.java @@ -92,7 +92,7 @@ public class BlockSpecialQuartzSlab extends BlockModSlab { } @Override - public ItemStack createStackedBlock(@Nonnull IBlockState par1) { + public ItemStack getSilkTouchDrop(@Nonnull IBlockState par1) { return new ItemStack(getSingleBlock()); } diff --git a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockModSlab.java b/src/main/java/vazkii/botania/common/block/decor/slabs/BlockModSlab.java index b57242572..c2d4fdbeb 100644 --- a/src/main/java/vazkii/botania/common/block/decor/slabs/BlockModSlab.java +++ b/src/main/java/vazkii/botania/common/block/decor/slabs/BlockModSlab.java @@ -96,7 +96,7 @@ public abstract class BlockModSlab extends BlockSlab implements ILexiconable, IM } @Override - public ItemStack createStackedBlock(@Nonnull IBlockState par1) { + public ItemStack getSilkTouchDrop(@Nonnull IBlockState par1) { return new ItemStack(getSingleBlock()); } diff --git a/src/main/java/vazkii/botania/common/block/dispenser/BehaviourCocoaBeans.java b/src/main/java/vazkii/botania/common/block/dispenser/BehaviourCocoaBeans.java index ad7b67a1c..9ed09f791 100644 --- a/src/main/java/vazkii/botania/common/block/dispenser/BehaviourCocoaBeans.java +++ b/src/main/java/vazkii/botania/common/block/dispenser/BehaviourCocoaBeans.java @@ -37,7 +37,7 @@ public class BehaviourCocoaBeans extends BehaviorDefaultDispenseItem { public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { if(par2ItemStack.getItemDamage() == EnumDyeColor.BROWN.getDyeDamage()) { Block block = Blocks.COCOA; - EnumFacing facing = par1IBlockSource.func_189992_e().getValue(BlockDispenser.FACING); + EnumFacing facing = par1IBlockSource.getBlockState().getValue(BlockDispenser.FACING); BlockPos pos = par1IBlockSource.getBlockPos().offset(facing); World world = par1IBlockSource.getWorld(); diff --git a/src/main/java/vazkii/botania/common/block/dispenser/BehaviourPoolMinecart.java b/src/main/java/vazkii/botania/common/block/dispenser/BehaviourPoolMinecart.java index 1ed122a0d..73f460879 100644 --- a/src/main/java/vazkii/botania/common/block/dispenser/BehaviourPoolMinecart.java +++ b/src/main/java/vazkii/botania/common/block/dispenser/BehaviourPoolMinecart.java @@ -53,7 +53,7 @@ public class BehaviourPoolMinecart extends BehaviorDefaultDispenseItem { if(stack.hasDisplayName()) entityminecart.setCustomNameTag(stack.getDisplayName()); - world.spawnEntityInWorld(entityminecart); + world.spawnEntity(entityminecart); stack.splitStack(1); return stack; } diff --git a/src/main/java/vazkii/botania/common/block/dispenser/BehaviourSeeds.java b/src/main/java/vazkii/botania/common/block/dispenser/BehaviourSeeds.java index 83472686a..3891b7616 100644 --- a/src/main/java/vazkii/botania/common/block/dispenser/BehaviourSeeds.java +++ b/src/main/java/vazkii/botania/common/block/dispenser/BehaviourSeeds.java @@ -29,7 +29,7 @@ public class BehaviourSeeds extends BehaviorDefaultDispenseItem { @Override public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { - EnumFacing facing = par1IBlockSource.func_189992_e().getValue(BlockDispenser.FACING); + EnumFacing facing = par1IBlockSource.getBlockState().getValue(BlockDispenser.FACING); BlockPos pos = par1IBlockSource.getBlockPos().offset(facing); World world = par1IBlockSource.getWorld(); diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockEnchanter.java b/src/main/java/vazkii/botania/common/block/mana/BlockEnchanter.java index 85b7ca055..4adbf853b 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockEnchanter.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockEnchanter.java @@ -147,7 +147,7 @@ public class BlockEnchanter extends BlockMod implements IWandable, ILexiconable, float f1 = random.nextFloat() * 0.8F + 0.1F; EntityItem entityitem; - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntityInWorld(entityitem)) { + for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntity(entityitem)) { int k1 = random.nextInt(21) + 10; if (k1 > itemstack.stackSize) diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockTerraPlate.java b/src/main/java/vazkii/botania/common/block/mana/BlockTerraPlate.java index 4dff71a15..21e28f707 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockTerraPlate.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockTerraPlate.java @@ -53,7 +53,7 @@ public class BlockTerraPlate extends BlockMod implements ILexiconable { } @Override - public boolean onBlockActivated(World worldObj, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing s, float xs, float ys, float zs) { + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing s, float xs, float ys, float zs) { if(stack != null && stack.getItem() == ModItems.manaResource && stack.getItemDamage() < 3) { if(player == null || !player.capabilities.isCreativeMode) { stack.stackSize--; @@ -63,11 +63,11 @@ public class BlockTerraPlate extends BlockMod implements ILexiconable { ItemStack target = stack.copy(); target.stackSize = 1; - EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, target); + EntityItem item = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, target); item.setPickupDelay(40); item.motionX = item.motionY = item.motionZ = 0; - if(!worldObj.isRemote) - worldObj.spawnEntityInWorld(item); + if(!world.isRemote) + world.spawnEntity(item); return true; } 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 03e2e6f94..568720730 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 @@ -46,7 +46,7 @@ public class SubTileClayconia extends SubTileFunctional { if(ConfigHandler.blockBreakParticles) supertile.getWorld().playEvent(2001, coords, Block.getStateId(Blocks.SAND.getDefaultState())); EntityItem item = new EntityItem(supertile.getWorld(), coords.getX() + 0.5, coords.getY() + 0.5, coords.getZ() + 0.5, new ItemStack(Items.CLAY_BALL)); - supertile.getWorld().spawnEntityInWorld(item); + supertile.getWorld().spawnEntity(item); mana -= COST; } } 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 123ecc4e8..213e786af 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 @@ -108,7 +108,7 @@ public class SubTileDaffomill extends SubTileFunctional { return false; if(player.isSneaking()) { - if(!player.worldObj.isRemote) { + if(!player.world.isRemote) { orientation = orientation.rotateY(); sync(); } 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 3b1c756b6..0a558eaef 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 @@ -65,7 +65,7 @@ public class SubTileHeiseiDream extends SubTileFunctional { if(target == null || !(target instanceof IMob)) { IMob newTarget; - do newTarget = mobs.get(entity.worldObj.rand.nextInt(mobs.size())); + do newTarget = mobs.get(entity.world.rand.nextInt(mobs.size())); while(newTarget == entity); if(newTarget instanceof EntityLiving) { 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 6e61b5aef..7be43e2e7 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 @@ -38,7 +38,7 @@ public class SubTileHyacidus extends SubTileFunctional { List entities = supertile.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); for(EntityLivingBase entity : entities) { - if(!(entity instanceof EntityPlayer) && entity.getActivePotionEffect(MobEffects.POISON) == null && mana >= cost && !entity.worldObj.isRemote && entity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD) { + if(!(entity instanceof EntityPlayer) && entity.getActivePotionEffect(MobEffects.POISON) == null && mana >= cost && !entity.world.isRemote && entity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD) { entity.addPotionEffect(new PotionEffect(MobEffects.POISON, 60, 0)); 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 2cacb631a..74ab0c27b 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 @@ -89,7 +89,7 @@ public class SubTileLoonuim extends SubTileFunctional { pos = pos.up(); if(pos.getY() >= 254) return; - } while(world.getBlockState(pos).getBlock().isVisuallyOpaque()); + } while(world.getBlockState(pos).getBlock().causesSuffocation()); pos = pos.up(); double x = pos.getX() + Math.random(); @@ -108,12 +108,12 @@ public class SubTileLoonuim extends SubTileFunctional { case 0: entity = new EntityZombie(world); if(world.rand.nextInt(10) == 0) - ((EntityZombie) entity).func_189778_a(ZombieType.HUSK); // set zombie type + ((EntityZombie) entity).setZombieType(ZombieType.HUSK); break; case 1: entity = new EntitySkeleton(world); if(world.rand.nextInt(10) == 0) - ((EntitySkeleton) entity).func_189768_a(SkeletonType.STRAY); // set skeleton type + ((EntitySkeleton) entity).setSkeletonType(SkeletonType.STRAY); break; case 2: if(world.rand.nextInt(10) == 0) @@ -126,8 +126,8 @@ public class SubTileLoonuim extends SubTileFunctional { entity.motionX = entity.motionY = entity.motionZ = 0; Multimap map = HashMultimap.create(); - map.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier("Loonium Modififer Health", 2, 1)); - map.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier("Loonium Modififer Damage", 1.5, 1)); + map.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier("Loonium Modififer Health", 2, 1)); + map.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier("Loonium Modififer Damage", 1.5, 1)); entity.getAttributeMap().applyAttributeModifiers(map); entity.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, Integer.MAX_VALUE, 0)); @@ -137,7 +137,7 @@ public class SubTileLoonuim extends SubTileFunctional { stack.writeToNBT(cmp); entity.getEntityData().setTag(TAG_ITEMSTACK_TO_DROP, cmp); - world.spawnEntityInWorld(entity); + world.spawnEntity(entity); entity.onInitialSpawn(world.getDifficultyForLocation(pos), null); SubTileSpectranthemum.spawnExplosionParticles(entity, 5); @@ -193,7 +193,7 @@ public class SubTileLoonuim extends SubTileFunctional { NBTTagCompound cmp = e.getEntityData().getCompoundTag(TAG_ITEMSTACK_TO_DROP); ItemStack stack = ItemStack.loadItemStackFromNBT(cmp); event.getDrops().clear(); - event.getDrops().add(new EntityItem(e.worldObj, e.posX, e.posY, e.posZ, stack)); + event.getDrops().add(new EntityItem(e.world, e.posX, e.posY, e.posZ, stack)); } } 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 03d6f1bdd..961f6f761 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 @@ -75,7 +75,7 @@ public class SubTileMarimorphosis extends SubTileFunctional { } public ItemStack getStoneToPut(BlockPos coords) { - List types = Arrays.asList(BiomeDictionary.getTypesForBiome(supertile.getWorld().getBiomeGenForCoords(coords))); + List types = Arrays.asList(BiomeDictionary.getTypesForBiome(supertile.getWorld().getBiome(coords))); TIntArrayList values = new TIntArrayList(); for(int i = 0; i < 8; i++) { 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 26c21b11f..ba5d563df 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 @@ -45,7 +45,7 @@ public class SubTileSolegnolia extends SubTileFunctional { public static boolean hasSolegnoliaAround(Entity e) { return existingFlowers.stream() .filter(f -> f.redstoneSignal == 0) - .filter(f -> f.supertile.getWorld() == e.worldObj) + .filter(f -> f.supertile.getWorld() == e.world) .filter(f -> f.supertile.getWorld().getTileEntity(f.supertile.getPos()) == f.supertile) .filter(f -> f.supertile.getDistanceSq(e.posX, e.posY, e.posZ) <= f.getRange() * f.getRange()) .findAny().isPresent(); 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 a2c9d37e5..f1a5fa287 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 @@ -95,7 +95,7 @@ public class SubTileSpectranthemum extends SubTileFunctional { } static void spawnExplosionParticles(Entity item, int p) { - PacketHandler.sendToNearby(item.worldObj, new BlockPos(item), new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ITEM_SMOKE, item.posX, item.posY, item.posZ, item.getEntityId(), p)); + PacketHandler.sendToNearby(item.world, new BlockPos(item), new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ITEM_SMOKE, item.posX, item.posY, item.posZ, item.getEntityId(), p)); } @Override @@ -153,7 +153,7 @@ public class SubTileSpectranthemum extends SubTileFunctional { @Override @SideOnly(Side.CLIENT) public BlockPos getBinding() { - return Minecraft.getMinecraft().thePlayer.isSneaking() && bindPos.getY() != -1 ? bindPos : super.getBinding(); + return Minecraft.getMinecraft().player.isSneaking() && bindPos.getY() != -1 ? bindPos : super.getBinding(); } @Override 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 0f60132ea..d0695431a 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 @@ -79,7 +79,7 @@ public class SubTileVinculotus extends SubTileFunctional { if(event.getEntityLiving() instanceof EntityEnderman) { List possibleFlowers = new ArrayList<>(); for(SubTileVinculotus flower : existingFlowers) { - if(flower.redstoneSignal > 0 || flower.mana <= cost || flower.supertile.getWorld() != event.getEntityLiving().worldObj || flower.supertile.getWorld().getTileEntity(flower.supertile.getPos()) != flower.supertile) + if(flower.redstoneSignal > 0 || flower.mana <= cost || flower.supertile.getWorld() != event.getEntityLiving().world || flower.supertile.getWorld().getTileEntity(flower.supertile.getPos()) != flower.supertile) continue; double x = flower.supertile.getPos().getX() + 0.5; @@ -91,7 +91,7 @@ public class SubTileVinculotus extends SubTileFunctional { } if(!possibleFlowers.isEmpty()) { - SubTileVinculotus flower = possibleFlowers.get(event.getEntityLiving().worldObj.rand.nextInt(possibleFlowers.size())); + SubTileVinculotus flower = possibleFlowers.get(event.getEntityLiving().world.rand.nextInt(possibleFlowers.size())); double x = flower.supertile.getPos().getX() + 0.5; double y = flower.supertile.getPos().getY() + 1.5; 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 ac24c082c..c6925253d 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 @@ -74,8 +74,8 @@ public class SubTileEndoflame extends SubTileGenerating { didSomething = true; } else { - item.worldObj.spawnParticle(EnumParticleTypes.SMOKE_LARGE, item.posX, item.posY + 0.1, item.posZ, 0.0D, 0.0D, 0.0D); - item.worldObj.spawnParticle(EnumParticleTypes.FLAME, item.posX, item.posY, item.posZ, 0.0D, 0.0D, 0.0D); + item.world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, item.posX, item.posY + 0.1, item.posZ, 0.0D, 0.0D, 0.0D); + item.world.spawnParticle(EnumParticleTypes.FLAME, item.posX, item.posY, item.posZ, 0.0D, 0.0D, 0.0D); } 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 f04711f05..915953e68 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 @@ -179,7 +179,7 @@ public class SubTileHydroangeas extends SubTileGenerating { @Override public int getDelayBetweenPassiveGeneration() { - boolean rain = supertile.getWorld().getBiomeGenForCoords(supertile.getPos()).getRainfall() > 0 && (supertile.getWorld().isRaining() || supertile.getWorld().isThundering()); + boolean rain = supertile.getWorld().getBiome(supertile.getPos()).getRainfall() > 0 && (supertile.getWorld().isRaining() || supertile.getWorld().isThundering()); return rain ? 2 : 3; } 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 7ad7b66e4..76affc26a 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 @@ -45,7 +45,7 @@ public class SubTileNarslimmus extends SubTileGenerating { int size = slime.getSlimeSize(); int mul = (int) Math.pow(2, size); int mana = 820 * mul; - if(!slime.worldObj.isRemote) { + if(!slime.world.isRemote) { slime.setDead(); slime.playSound(size > 1 ? SoundEvents.ENTITY_SLIME_SQUISH : SoundEvents.ENTITY_SMALL_SLIME_SQUISH, 1, 0.02F); this.mana = Math.min(getMaxMana(), this.mana + mana); @@ -53,12 +53,12 @@ public class SubTileNarslimmus extends SubTileGenerating { } for (int j = 0; j < mul * 8; ++j) { - float f = slime.worldObj.rand.nextFloat() * (float)Math.PI * 2.0F; - float f1 = slime.worldObj.rand.nextFloat() * 0.5F + 0.5F; + float f = slime.world.rand.nextFloat() * (float)Math.PI * 2.0F; + float f1 = slime.world.rand.nextFloat() * 0.5F + 0.5F; float f2 = MathHelper.sin(f) * size * 0.5F * f1; float f3 = MathHelper.cos(f) * size * 0.5F * f1; - float f4 = slime.worldObj.rand.nextFloat() * size * 0.5F * f1; - slime.worldObj.spawnParticle(EnumParticleTypes.SLIME, slime.posX + f2, slime.getEntityBoundingBox().minY + f4, slime.posZ + f3, 0.0D, 0.0D, 0.0D); + float f4 = slime.world.rand.nextFloat() * size * 0.5F * f1; + slime.world.spawnParticle(EnumParticleTypes.SLIME, slime.posX + f2, slime.getEntityBoundingBox().minY + f4, slime.posZ + f3, 0.0D, 0.0D, 0.0D); } break; } @@ -90,7 +90,7 @@ public class SubTileNarslimmus extends SubTileGenerating { @SubscribeEvent public static void onSpawn(LivingSpawnEvent.CheckSpawn event) { - if(event.getEntityLiving() instanceof EntitySlime && event.getResult() != Result.DENY && isSlimeChunk(event.getEntityLiving().worldObj, MathHelper.floor_double(event.getX()), MathHelper.floor_double(event.getZ()))) + if(event.getEntityLiving() instanceof EntitySlime && event.getResult() != Result.DENY && isSlimeChunk(event.getEntityLiving().world, MathHelper.floor(event.getX()), MathHelper.floor(event.getZ()))) event.getEntityLiving().getEntityData().setBoolean(TAG_WORLD_SPAWNED, true); } 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 6e28c18ba..edee5db81 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileAlfPortal.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileAlfPortal.java @@ -101,7 +101,7 @@ public class TileAlfPortal extends TileMod { @Override public void update() { - IBlockState iBlockState = worldObj.getBlockState(getPos()); + IBlockState iBlockState = world.getBlockState(getPos()); if(iBlockState.getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.OFF) { ticksOpen = 0; return; @@ -121,8 +121,8 @@ public class TileAlfPortal extends TileMod { if(ConfigHandler.elfPortalParticlesEnabled) blockParticle(state); - List items = worldObj.getEntitiesWithinAABB(EntityItem.class, aabb); - if(!worldObj.isRemote) + List items = world.getEntitiesWithinAABB(EntityItem.class, aabb); + if(!world.isRemote) for(EntityItem item : items) { if(item.isDead) continue; @@ -147,13 +147,13 @@ public class TileAlfPortal extends TileMod { } if(ticksSinceLastItem >= 4) { - if(!worldObj.isRemote) + if(!world.isRemote) resolveRecipes(); } } if(closeNow) { - worldObj.setBlockState(getPos(), ModBlocks.alfPortal.getDefaultState(), 1 | 2); + world.setBlockState(getPos(), ModBlocks.alfPortal.getDefaultState(), 1 | 2); for(int i = 0; i < 36; i++) blockParticle(state); closeNow = false; @@ -161,12 +161,12 @@ public class TileAlfPortal extends TileMod { if(newState == AlfPortalState.OFF) for(int i = 0; i < 36; i++) blockParticle(state); - worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.ALFPORTAL_STATE, newState), 1 | 2); + world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.ALFPORTAL_STATE, newState), 1 | 2); } } private void blockParticle(AlfPortalState state) { - int i = worldObj.rand.nextInt(AIR_POSITIONS.length); + int i = world.rand.nextInt(AIR_POSITIONS.length); double[] pos = new double[] { AIR_POSITIONS[i].getX() + 0.5F, AIR_POSITIONS[i].getY() + 0.5F, AIR_POSITIONS[i].getZ() + 0.5F }; @@ -178,11 +178,11 @@ public class TileAlfPortal extends TileMod { } public boolean onWanded() { - AlfPortalState state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE); + AlfPortalState state = world.getBlockState(getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE); if(state == AlfPortalState.OFF) { AlfPortalState newState = getValidState(); if(newState != AlfPortalState.OFF) { - worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.ALFPORTAL_STATE, newState), 1 | 2); + world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.ALFPORTAL_STATE, newState), 1 | 2); return true; } } @@ -192,7 +192,7 @@ public class TileAlfPortal extends TileMod { private AxisAlignedBB getPortalAABB() { AxisAlignedBB aabb = new AxisAlignedBB(pos.add(-1, 1, 0), pos.add(2, 4, 1)); - if(worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.ON_X) + if(world.getBlockState(getPos()).getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.ON_X) aabb = new AxisAlignedBB(pos.add(0, 1, -1), pos.add(1, 4, 2)); return aabb; @@ -234,9 +234,9 @@ public class TileAlfPortal extends TileMod { } private void spawnItem(ItemStack stack) { - EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, stack); + EntityItem item = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, stack); item.getEntityData().setBoolean(TAG_PORTAL_FLAG, true); - worldObj.spawnEntityInWorld(item); + world.spawnEntity(item); ticksSinceLastItem = 0; } @@ -337,7 +337,7 @@ public class TileAlfPortal extends TileMod { List pylons = locatePylons(); for(BlockPos pos : pylons) { - TileEntity tile = worldObj.getTileEntity(getPos().add(pos)); + TileEntity tile = world.getTileEntity(getPos().add(pos)); if(tile instanceof TilePylon) { TilePylon pylon = (TilePylon) tile; pylon.activated = true; @@ -365,21 +365,21 @@ public class TileAlfPortal extends TileMod { int expectedConsumption = costPer * pylons.size(); for(BlockPos pos : pylons) { - TileEntity tile = worldObj.getTileEntity(getPos().add(pos)); + TileEntity tile = world.getTileEntity(getPos().add(pos)); if(tile instanceof TilePylon) { TilePylon pylon = (TilePylon) tile; pylon.activated = true; pylon.centerPos = getPos(); } - tile = worldObj.getTileEntity(getPos().add(pos).down()); + tile = world.getTileEntity(getPos().add(pos).down()); if(tile instanceof TilePool) { TilePool pool = (TilePool) tile; if(pool.getCurrentMana() < costPer) { closeNow = closeNow || close; return false; - } else if(!worldObj.isRemote) { + } else if(!world.isRemote) { consumePools.add(pool); consumed += costPer; } @@ -412,10 +412,10 @@ public class TileAlfPortal extends TileMod { private boolean checkPosition(BlockPos pos, IBlockState state, boolean onlyCheckBlock) { BlockPos pos_ = getPos().add(pos); - IBlockState stateat = worldObj.getBlockState(pos_); + IBlockState stateat = world.getBlockState(pos_); Block blockat = stateat.getBlock(); - if(state.getBlock() == Blocks.AIR ? blockat.isAir(stateat, worldObj, pos_) : blockat == state.getBlock()) + if(state.getBlock() == Blocks.AIR ? blockat.isAir(stateat, world, pos_) : blockat == state.getBlock()) return onlyCheckBlock || stateat == state; return false; diff --git a/src/main/java/vazkii/botania/common/block/tile/TileAltar.java b/src/main/java/vazkii/botania/common/block/tile/TileAltar.java index 2f020c975..f6ca8d30d 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileAltar.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileAltar.java @@ -72,24 +72,24 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary { if(stack == null || item.isDead) return false; - if(!isMossy && worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.ALTAR_VARIANT) == AltarVariant.DEFAULT) { + if(!isMossy && world.getBlockState(getPos()).getValue(BotaniaStateProps.ALTAR_VARIANT) == AltarVariant.DEFAULT) { if(stack.getItem() == Item.getItemFromBlock(Blocks.VINE)) { isMossy = true; - if (worldObj.isRemote) { - worldObj.markBlockRangeForRenderUpdate(getPos(), getPos()); + if (world.isRemote) { + world.markBlockRangeForRenderUpdate(getPos(), getPos()); } else { - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); stack.stackSize--; if(stack.stackSize == 0) item.setDead(); - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } return true; } } - if(!hasWater() && !hasLava() && !worldObj.isRemote) { + if(!hasWater() && !hasLava() && !world.isRemote) { if(stack.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null)) { IFluidHandler fluidHandler = stack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null); @@ -99,12 +99,12 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary { if(drainWater != null && drainWater.getFluid() == FluidRegistry.WATER && drainWater.amount == Fluid.BUCKET_VOLUME) { setWater(true); - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); fluidHandler.drain(new FluidStack(FluidRegistry.WATER, Fluid.BUCKET_VOLUME), true); return true; } else if(drainLava != null && drainLava.getFluid() == FluidRegistry.LAVA && drainLava.amount == Fluid.BUCKET_VOLUME) { setLava(true); - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); fluidHandler.drain(new FluidStack(FluidRegistry.LAVA, Fluid.BUCKET_VOLUME), true); return true; } @@ -124,7 +124,7 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary { if(itemHandler.getStackInSlot(getSizeInventory() - 1) != null) return false; - if(!worldObj.isRemote) { + if(!world.isRemote) { stack.stackSize--; if(stack.stackSize == 0) item.setDead(); @@ -135,7 +135,7 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary { stackToPut.stackSize = 1; itemHandler.setStackInSlot(i, stackToPut); didChange = true; - worldObj.playSound(null, pos, SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F); + world.playSound(null, pos, SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F); break; } } @@ -144,7 +144,7 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary { if(recipe.matches(itemHandler)) { saveLastRecipe(); - if(!worldObj.isRemote) { + if(!world.isRemote) { for(int i = 0; i < getSizeInventory(); i++) itemHandler.setStackInSlot(i, null); @@ -153,11 +153,11 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary { item.setDead(); ItemStack output = recipe.getOutput().copy(); - EntityItem outputItem = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output); - worldObj.spawnEntityInWorld(outputItem); + EntityItem outputItem = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output); + world.spawnEntity(outputItem); setWater(false); - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); } craftingFanciness(); @@ -185,11 +185,11 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary { public void trySetLastRecipe(EntityPlayer player) { tryToSetLastRecipe(player, itemHandler, lastRecipe); if(!isEmpty()) - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } public static void tryToSetLastRecipe(EntityPlayer player, IItemHandlerModifiable inv, List lastRecipe) { - if(lastRecipe == null || lastRecipe.isEmpty() || player.worldObj.isRemote) + if(lastRecipe == null || lastRecipe.isEmpty() || player.world.isRemote) return; int index = 0; @@ -217,7 +217,7 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary { if(didAny) { if(inv instanceof TileAltar) - player.worldObj.playSound(null, ((TileAltar) inv).getPos(), SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F); + player.world.playSound(null, ((TileAltar) inv).getPos(), SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F); if(player instanceof EntityPlayerMP) { EntityPlayerMP mp = (EntityPlayerMP) player; mp.inventoryContainer.detectAndSendChanges(); @@ -226,7 +226,7 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary { } private void craftingFanciness() { - worldObj.playSound(null, pos, BotaniaSoundEvents.altarCraft, SoundCategory.BLOCKS, 1F, 1F); + world.playSound(null, pos, BotaniaSoundEvents.altarCraft, SoundCategory.BLOCKS, 1F, 1F); for(int i = 0; i < 25; i++) { float red = (float) Math.random(); float green = (float) Math.random(); @@ -245,14 +245,14 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary { @Override public void update() { - List items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.add(0, 1D / 16D * 20D, 0), pos.add(1, 1D / 16D * 32D, 1))); + List items = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.add(0, 1D / 16D * 20D, 0), pos.add(1, 1D / 16D * 32D, 1))); boolean didChange = false; for(EntityItem item : items) didChange = collideEntityItem(item) || didChange; if(didChange) - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); for(int i = 0; i < getSizeInventory(); i++) { ItemStack stackAt = itemHandler.getStackInSlot(i); @@ -265,16 +265,16 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary { float green = color.getGreen() / 255F; float blue = color.getBlue() / 255F; if(Math.random() >= 0.75F) - worldObj.playSound(null, pos, SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F); + world.playSound(null, pos, SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F); Botania.proxy.sparkleFX(pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10); } } if(hasLava()) { isMossy = false; - worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.05, 0); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.05, 0); if(Math.random() > 0.9) - worldObj.spawnParticle(EnumParticleTypes.LAVA, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.01, 0); + world.spawnParticle(EnumParticleTypes.LAVA, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.01, 0); } if(recipeKeepTicks > 0) @@ -318,12 +318,12 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary { @Override public void setWater(boolean water) { hasWater = water; - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } public void setLava(boolean lava) { hasLava = lava; - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } @Override diff --git a/src/main/java/vazkii/botania/common/block/tile/TileAnimatedTorch.java b/src/main/java/vazkii/botania/common/block/tile/TileAnimatedTorch.java index 5125aeaf6..3e82da9ec 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileAnimatedTorch.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileAnimatedTorch.java @@ -52,8 +52,8 @@ public class TileAnimatedTorch extends TileMod { @Override public void onLoad() { - if(!worldObj.isRemote) - nextRandomRotation = worldObj.rand.nextInt(4); + if(!world.isRemote) + nextRandomRotation = world.rand.nextInt(4); } public void handRotate() { @@ -63,8 +63,8 @@ public class TileAnimatedTorch extends TileMod { public void toggle() { rotateTo(torchMode.modeSwitcher.rotate(this, side)); - if(!worldObj.isRemote) { - nextRandomRotation = worldObj.rand.nextInt(4); + if(!world.isRemote) { + nextRandomRotation = world.rand.nextInt(4); VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this); } } @@ -96,7 +96,7 @@ public class TileAnimatedTorch extends TileMod { this.side = side; rotating = true; - worldObj.notifyNeighborsOfStateChange(getPos(), getBlockType()); + world.notifyNeighborsOfStateChange(getPos(), getBlockType()); } @SideOnly(Side.CLIENT) @@ -117,7 +117,7 @@ public class TileAnimatedTorch extends TileMod { if(rotationTicks <= 0) { rotating = false; - worldObj.notifyNeighborsOfStateChange(getPos(), getBlockType()); + world.notifyNeighborsOfStateChange(getPos(), getBlockType()); } } else rotation = side * 90; @@ -128,7 +128,7 @@ public class TileAnimatedTorch extends TileMod { double z = getPos().getZ() + 0.5 + Math.sin((rotation + 90) / 180.0 * Math.PI) * 0.35; for(int i = 0; i < amt; i++) - worldObj.spawnParticle(EnumParticleTypes.REDSTONE, x, y, z, 0.0D, 0.0D, 0.0D, new int[0]); + world.spawnParticle(EnumParticleTypes.REDSTONE, x, y, z, 0.0D, 0.0D, 0.0D, new int[0]); } @Override @@ -145,7 +145,7 @@ public class TileAnimatedTorch extends TileMod { public void readPacketNBT(NBTTagCompound cmp) { side = cmp.getInteger(TAG_SIDE); rotating = cmp.getBoolean(TAG_ROTATING); - if(worldObj != null && !worldObj.isRemote) + if(world != null && !world.isRemote) rotationTicks = cmp.getInteger(TAG_ROTATION_TICKS); anglePerTick = cmp.getDouble(TAG_ANGLE_PER_TICK); nextRandomRotation = cmp.getInteger(TAG_NEXT_RANDOM_ROTATION); diff --git a/src/main/java/vazkii/botania/common/block/tile/TileAvatar.java b/src/main/java/vazkii/botania/common/block/tile/TileAvatar.java index dd7877dd2..cb5be528d 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileAvatar.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileAvatar.java @@ -34,7 +34,7 @@ public class TileAvatar extends TileSimpleInventory implements IAvatarTile { public void update() { enabled = true; for(EnumFacing dir : EnumFacing.VALUES) { - int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir); + int redstoneSide = world.getRedstonePower(pos.offset(dir), dir); if(redstoneSide > 0) { enabled = false; break; @@ -109,7 +109,7 @@ public class TileAvatar extends TileSimpleInventory implements IAvatarTile { @Override public EnumFacing getAvatarFacing() { - return worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.CARDINALS); + return world.getBlockState(getPos()).getValue(BotaniaStateProps.CARDINALS); } @Override diff --git a/src/main/java/vazkii/botania/common/block/tile/TileBifrost.java b/src/main/java/vazkii/botania/common/block/tile/TileBifrost.java index 10f90eac1..74998df45 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileBifrost.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileBifrost.java @@ -23,9 +23,9 @@ public class TileBifrost extends TileMod { @Override public void update() { - if(!worldObj.isRemote) { + if(!world.isRemote) { if(ticks <= 0) { - worldObj.setBlockToAir(pos); + world.setBlockToAir(pos); } else ticks--; } else if(Math.random() < 0.1) Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6); diff --git a/src/main/java/vazkii/botania/common/block/tile/TileBrewery.java b/src/main/java/vazkii/botania/common/block/tile/TileBrewery.java index 245f19bac..7392d7914 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileBrewery.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileBrewery.java @@ -70,11 +70,11 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver { } if(did) { - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); for(RecipeBrew recipe : BotaniaAPI.brewRecipes) if(recipe.matches(itemHandler) && recipe.getOutput(itemHandler.getStackInSlot(0)) != null) { this.recipe = recipe; - worldObj.setBlockState(pos, ModBlocks.brewery.getDefaultState().withProperty(BotaniaStateProps.POWERED, true), 1 | 2); + world.setBlockState(pos, ModBlocks.brewery.getDefaultState().withProperty(BotaniaStateProps.POWERED, true), 1 | 2); } } @@ -87,7 +87,7 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver { for(RecipeBrew recipe : BotaniaAPI.brewRecipes) if(recipe.matches(itemHandler)) { this.recipe = recipe; - worldObj.setBlockState(pos, ModBlocks.brewery.getDefaultState().withProperty(BotaniaStateProps.POWERED, true), 1 | 2); + world.setBlockState(pos, ModBlocks.brewery.getDefaultState().withProperty(BotaniaStateProps.POWERED, true), 1 | 2); } if(recipe == null) @@ -97,8 +97,8 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver { // Update every tick. recieveMana(0); - if(!worldObj.isRemote && recipe == null) { - List items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1)); + if(!world.isRemote && recipe == null) { + List items = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1)); for(EntityItem item : items) if(!item.isDead && item.getEntityItem() != null) { ItemStack stack = item.getEntityItem(); @@ -110,7 +110,7 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver { if(recipe != null) { if(!recipe.matches(itemHandler)) { recipe = null; - worldObj.setBlockState(pos, ModBlocks.brewery.getDefaultState(), 1 | 2); + world.setBlockState(pos, ModBlocks.brewery.getDefaultState(), 1 | 2); } if(recipe != null) { @@ -126,13 +126,13 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver { } } - if(mana >= getManaCost() && !worldObj.isRemote) { + if(mana >= getManaCost() && !world.isRemote) { int mana = getManaCost(); recieveMana(-mana); - if(!worldObj.isRemote) { + if(!world.isRemote) { ItemStack output = recipe.getOutput(itemHandler.getStackInSlot(0)); - EntityItem outputItem = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output); - worldObj.spawnEntityInWorld(outputItem); + EntityItem outputItem = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output); + world.spawnEntity(outputItem); } for(int i = 0; i < getSizeInventory(); i++) @@ -149,7 +149,7 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver { if(newSignal != signal) { signal = newSignal; - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); } manaLastTick = mana; @@ -164,7 +164,7 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver { } public void craftingFanciness() { - worldObj.playSound(null, pos, BotaniaSoundEvents.potionCreate, SoundCategory.BLOCKS, 1F, 1.5F + (float) Math.random() * 0.25F); + world.playSound(null, pos, BotaniaSoundEvents.potionCreate, SoundCategory.BLOCKS, 1F, 1.5F + (float) Math.random() * 0.25F); for(int i = 0; i < 25; i++) { Color color = new Color(recipe.getBrew().getColor(itemHandler.getStackInSlot(0))); float r = color.getRed() / 255F; diff --git a/src/main/java/vazkii/botania/common/block/tile/TileCacophonium.java b/src/main/java/vazkii/botania/common/block/tile/TileCacophonium.java index 78328b463..6d4007b9b 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileCacophonium.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileCacophonium.java @@ -22,7 +22,7 @@ public class TileCacophonium extends TileMod { public ItemStack stack; public void annoyDirewolf() { - ItemCacophonium.playSound(worldObj, stack, pos.getX(), pos.getY(), pos.getZ(), SoundCategory.BLOCKS, 1F); + ItemCacophonium.playSound(world, stack, pos.getX(), pos.getY(), pos.getZ(), SoundCategory.BLOCKS, 1F); } @Override diff --git a/src/main/java/vazkii/botania/common/block/tile/TileCamo.java b/src/main/java/vazkii/botania/common/block/tile/TileCamo.java index 9ef0f7720..30f7026f3 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileCamo.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileCamo.java @@ -43,6 +43,6 @@ public class TileCamo extends TileMod { @Override public void onDataPacket(NetworkManager manager, SPacketUpdateTileEntity packet) { super.onDataPacket(manager, packet); - worldObj.markBlockRangeForRenderUpdate(pos, pos); + world.markBlockRangeForRenderUpdate(pos, pos); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileCell.java b/src/main/java/vazkii/botania/common/block/tile/TileCell.java index dc86cc8e9..d20fb60c6 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileCell.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileCell.java @@ -37,7 +37,7 @@ public class TileCell extends TileMod { validCoords = getPos(); ticked = true; } else if(!matchCoords(validCoords, this) || !matchCoords(flowerCoords, flower)) - worldObj.setBlockToAir(pos); + world.setBlockToAir(pos); } public boolean isSameFlower(TileEntity flower) { diff --git a/src/main/java/vazkii/botania/common/block/tile/TileCocoon.java b/src/main/java/vazkii/botania/common/block/tile/TileCocoon.java index 121d45766..e12a13433 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileCocoon.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileCocoon.java @@ -44,52 +44,52 @@ public class TileCocoon extends TileMod { } private void hatch() { - if(!worldObj.isRemote) { - worldObj.playEvent(2001, pos, Block.getStateId(getBlockType().getStateFromMeta(getBlockMetadata()))); - worldObj.setBlockToAir(pos); + if(!world.isRemote) { + world.playEvent(2001, pos, Block.getStateId(getBlockType().getStateFromMeta(getBlockMetadata()))); + world.setBlockToAir(pos); EntityAgeable entity = null; float villagerChance = Math.min(1F, (float) emeraldsGiven / (float) MAX_EMERALDS); if(Math.random() < villagerChance) { - EntityVillager villager = new EntityVillager(worldObj); - VillagerRegistry.setRandomProfession(villager, worldObj.rand); + EntityVillager villager = new EntityVillager(world); + VillagerRegistry.setRandomProfession(villager, world.rand); entity = villager; } else { float specialChance = 0.05F; if(Math.random() < specialChance) { - int entityType = worldObj.rand.nextInt(3); + int entityType = world.rand.nextInt(3); switch(entityType) { case 0: - entity = new EntityHorse(worldObj); + entity = new EntityHorse(world); break; case 1: - entity = new EntityWolf(worldObj); + entity = new EntityWolf(world); break; case 2: - entity = new EntityOcelot(worldObj); + entity = new EntityOcelot(world); break; } } else { - int entityType = worldObj.rand.nextInt(5); + int entityType = world.rand.nextInt(5); switch(entityType) { case 0: - entity = new EntitySheep(worldObj); + entity = new EntitySheep(world); break; case 1: if(Math.random() < 0.01) - entity = new EntityMooshroom(worldObj); - else entity = new EntityCow(worldObj); + entity = new EntityMooshroom(world); + else entity = new EntityCow(world); break; case 2: - entity = new EntityPig(worldObj); + entity = new EntityPig(world); break; case 3: - entity = new EntityChicken(worldObj); + entity = new EntityChicken(world); break; case 4: - entity = new EntityRabbit(worldObj); + entity = new EntityRabbit(world); break; } } @@ -98,7 +98,7 @@ public class TileCocoon extends TileMod { if(entity != null) { entity.setPosition(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); entity.setGrowingAge(-24000); - worldObj.spawnEntityInWorld(entity); + world.spawnEntity(entity); entity.spawnExplosionParticle(); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileCraftCrate.java b/src/main/java/vazkii/botania/common/block/tile/TileCraftCrate.java index 2544e49d8..ee269a100 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileCraftCrate.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileCraftCrate.java @@ -102,7 +102,7 @@ public class TileCraftCrate extends TileOpenCrate { @Override public void update() { - if (worldObj.isRemote) + if (world.isRemote) return; if(craft(true) && canEject() || isFull()) @@ -115,7 +115,7 @@ public class TileCraftCrate extends TileOpenCrate { if(newSignal != signal) { signal = newSignal; - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); } } @@ -140,7 +140,7 @@ public class TileCraftCrate extends TileOpenCrate { List recipes = CraftingManager.getInstance().getRecipeList(); for(IRecipe recipe : recipes) - if(recipe.matches(craft, worldObj)) { + if(recipe.matches(craft, world)) { itemHandler.setStackInSlot(9, recipe.getCraftingResult(craft)); for(int i = 0; i < 9; i++) { @@ -212,7 +212,7 @@ public class TileCraftCrate extends TileOpenCrate { int lastPattern = pattern; super.onDataPacket(manager, packet); if(pattern != lastPattern) - worldObj.markBlockRangeForRenderUpdate(pos, pos); + world.markBlockRangeForRenderUpdate(pos, pos); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileEnchanter.java b/src/main/java/vazkii/botania/common/block/tile/TileEnchanter.java index 6fbccb4d4..5768f441c 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileEnchanter.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileEnchanter.java @@ -117,10 +117,10 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { if(stage != State.IDLE || itemToEnchant == null || !itemToEnchant.isItemEnchantable()) return; - List items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX() - 2, pos.getY(), pos.getZ() - 2, pos.getX() + 3, pos.getY() + 1, pos.getZ() + 3)); + List items = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX() - 2, pos.getY(), pos.getZ() - 2, pos.getX() + 3, pos.getY() + 1, pos.getZ() + 3)); int count = items.size(); - if(count > 0 && !worldObj.isRemote) { + if(count > 0 && !world.isRemote) { for(EntityItem entity : items) { ItemStack item = entity.getEntityItem(); if(item.getItem() == Items.ENCHANTED_BOOK) { @@ -140,11 +140,11 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { @Override public void update() { - IBlockState state = worldObj.getBlockState(getPos()); + IBlockState state = world.getBlockState(getPos()); EnumFacing.Axis axis = state.getValue(BotaniaStateProps.ENCHANTER_DIRECTION); for(BlockPos pylon : PYLON_LOCATIONS.get(axis)) { - TileEntity tile = worldObj.getTileEntity(pos.add(pylon)); + TileEntity tile = world.getTileEntity(pos.add(pylon)); if(tile != null && tile instanceof TilePylon) { ((TilePylon) tile).activated = stage == State.GATHER_MANA; if(stage == State.GATHER_MANA) @@ -155,24 +155,24 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { if(stage != State.IDLE) stageTicks++; - if(worldObj.isRemote) + if(world.isRemote) return; - if(!canEnchanterExist(worldObj, pos, axis)) { - worldObj.setBlockState(pos, Blocks.LAPIS_BLOCK.getDefaultState(), 1 | 2); - PacketHandler.sendToNearby(worldObj, pos, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ENCHANTER_DESTROY, + if(!canEnchanterExist(world, pos, axis)) { + world.setBlockState(pos, Blocks.LAPIS_BLOCK.getDefaultState(), 1 | 2); + PacketHandler.sendToNearby(world, pos, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ENCHANTER_DESTROY, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5)); - worldObj.playSound(null, pos, BotaniaSoundEvents.enchanterFade, SoundCategory.BLOCKS, 0.5F, 10F); + world.playSound(null, pos, BotaniaSoundEvents.enchanterFade, SoundCategory.BLOCKS, 0.5F, 10F); } switch(stage) { case GATHER_ENCHANTS : { // Get books if(stageTicks % 20 == 0) { - List items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX() - 2, pos.getY(), pos.getZ() - 2, pos.getX() + 3, pos.getY() + 1, pos.getZ() + 3)); + List items = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX() - 2, pos.getY(), pos.getZ() - 2, pos.getX() + 3, pos.getY() + 1, pos.getZ() + 3)); int count = items.size(); boolean addedEnch = false; - if(count > 0 && !worldObj.isRemote) { + if(count > 0 && !world.isRemote) { for(EntityItem entity : items) { ItemStack item = entity.getEntityItem(); if(item.getItem() == Items.ENCHANTED_BOOK) { @@ -184,7 +184,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { Enchantment ench = Enchantment.getEnchantmentByID(enchantId); if(!hasEnchantAlready(ench) && isEnchantmentValid(ench)) { this.enchants.add(new EnchantmentData(ench, enchantLvl)); - worldObj.playSound(null, pos, BotaniaSoundEvents.ding, SoundCategory.BLOCKS, 1F, 1F); + world.playSound(null, pos, BotaniaSoundEvents.ding, SoundCategory.BLOCKS, 1F, 1F); addedEnch = true; break; } @@ -215,13 +215,13 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { } else if(mana >= manaRequired) { manaRequired = 0; for(BlockPos pylon : PYLON_LOCATIONS.get(axis)) - ((TilePylon) worldObj.getTileEntity(pos.add(pylon))).activated = false; + ((TilePylon) world.getTileEntity(pos.add(pylon))).activated = false; advanceStage(); } else { ISparkEntity spark = getAttachedSpark(); if(spark != null) { - List sparkEntities = SparkHelper.getSparksAround(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); + List sparkEntities = SparkHelper.getSparksAround(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); for(ISparkEntity otherSpark : sparkEntities) { if(spark == otherSpark) continue; @@ -283,8 +283,8 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { } private void craftingFanciness() { - worldObj.playSound(null, pos, BotaniaSoundEvents.enchanterEnchant, SoundCategory.BLOCKS, 1F, 1F); - PacketHandler.sendToNearby(worldObj, pos, + world.playSound(null, pos, BotaniaSoundEvents.enchanterEnchant, SoundCategory.BLOCKS, 1F, 1F); + PacketHandler.sendToNearby(world, pos, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ENCHANTER_CRAFT, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5)); } @@ -315,7 +315,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { } public void sync() { - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } @Override @@ -408,7 +408,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable { @Override public ISparkEntity getAttachedSpark() { - List sparks = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.getX(), pos.getY() + 1, pos.getZ(), pos.getX() + 1, pos.getY() + 2, pos.getZ() + 1), Predicates.instanceOf(ISparkEntity.class)); + List sparks = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.getX(), pos.getY() + 1, pos.getZ(), pos.getX() + 1, pos.getY() + 2, pos.getZ() + 1), Predicates.instanceOf(ISparkEntity.class)); if(sparks.size() == 1) { Entity e = sparks.get(0); return (ISparkEntity) e; diff --git a/src/main/java/vazkii/botania/common/block/tile/TileEnderEye.java b/src/main/java/vazkii/botania/common/block/tile/TileEnderEye.java index 20b52028b..3f524a055 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileEnderEye.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileEnderEye.java @@ -28,12 +28,12 @@ public class TileEnderEye extends TileMod { @Override public void update() { - if (worldObj.isRemote) + if (world.isRemote) return; - boolean wasLooking = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED); + boolean wasLooking = world.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED); int range = 80; - List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range, range, range))); + List players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range, range, range))); boolean looking = false; for(EntityPlayer player : players) { @@ -41,22 +41,22 @@ public class TileEnderEye extends TileMod { if(helm != null && helm.getItem() == Item.getItemFromBlock(Blocks.PUMPKIN)) continue; - RayTraceResult pos = ToolCommons.raytraceFromEntity(worldObj, player, true, 64); + RayTraceResult pos = ToolCommons.raytraceFromEntity(world, player, true, 64); if(pos != null && pos.getBlockPos() != null && pos.getBlockPos().equals(getPos())) { looking = true; break; } } - if(looking != wasLooking && !worldObj.isRemote) - worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, looking), 1 | 2); + if(looking != wasLooking && !world.isRemote) + world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, looking), 1 | 2); if(looking) { double x = getPos().getX() - 0.1 + Math.random() * 1.2; double y = getPos().getY() - 0.1 + Math.random() * 1.2; double z = getPos().getZ() - 0.1 + Math.random() * 1.2; - ((WorldServer) worldObj).spawnParticle(EnumParticleTypes.REDSTONE, false, x, y, z, 0, 1.0D, 0.0D, 0.0D, 1.0D); + ((WorldServer) world).spawnParticle(EnumParticleTypes.REDSTONE, false, x, y, z, 0, 1.0D, 0.0D, 0.0D, 1.0D); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileFakeAir.java b/src/main/java/vazkii/botania/common/block/tile/TileFakeAir.java index 51116c706..f833afbdd 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileFakeAir.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileFakeAir.java @@ -30,7 +30,7 @@ public class TileFakeAir extends TileMod { } public boolean canStay() { - return SubTileBubbell.isValidBubbell(worldObj, flowerPos); + return SubTileBubbell.isValidBubbell(world, flowerPos); } @Nonnull diff --git a/src/main/java/vazkii/botania/common/block/tile/TileFloatingFlower.java b/src/main/java/vazkii/botania/common/block/tile/TileFloatingFlower.java index eedaa0ce8..cad85ba4a 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileFloatingFlower.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileFloatingFlower.java @@ -30,8 +30,8 @@ public class TileFloatingFlower extends TileMod implements IFloatingFlower { forcedStack = null; return retStack; } - EnumDyeColor color = worldObj.getBlockState(getPos()).getBlock() != ModBlocks.floatingFlower ? EnumDyeColor.WHITE - : worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.COLOR); + EnumDyeColor color = world.getBlockState(getPos()).getBlock() != ModBlocks.floatingFlower ? EnumDyeColor.WHITE + : world.getBlockState(getPos()).getValue(BotaniaStateProps.COLOR); return new ItemStack(ModBlocks.shinyFlower, 1, color.getMetadata()); } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileForestEye.java b/src/main/java/vazkii/botania/common/block/tile/TileForestEye.java index a5bea103e..5f52a3625 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileForestEye.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileForestEye.java @@ -19,13 +19,13 @@ public class TileForestEye extends TileMod { @Override public void update() { - if (worldObj.isRemote) + if (world.isRemote) return; int range = 6; - int entityCount = worldObj.getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range + 1, range + 1, range + 1))).size(); + int entityCount = world.getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range + 1, range + 1, range + 1))).size(); if(entityCount != entities) { entities = entityCount; - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileHourglass.java b/src/main/java/vazkii/botania/common/block/tile/TileHourglass.java index 24d023697..c4d88208f 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileHourglass.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileHourglass.java @@ -62,17 +62,17 @@ public class TileHourglass extends TileSimpleInventory { time = 0; flip = !flip; flipTicks = 4; - if(!worldObj.isRemote) { - worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, true), 1 | 2); + if(!world.isRemote) { + world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, true), 1 | 2); VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this); - worldObj.scheduleUpdate(pos, getBlockType(), getBlockType().tickRate(worldObj)); + world.scheduleUpdate(pos, getBlockType(), getBlockType().tickRate(world)); } for(EnumFacing facing : EnumFacing.VALUES) { BlockPos pos = getPos().offset(facing); - IBlockState state = worldObj.getBlockState(pos); + IBlockState state = world.getBlockState(pos); if(state.getBlock() instanceof IHourglassTrigger) - ((IHourglassTrigger) state.getBlock()).onTriggeredByHourglass(worldObj, pos, this); + ((IHourglassTrigger) state.getBlock()).onTriggeredByHourglass(world, pos, this); } } @@ -89,7 +89,7 @@ public class TileHourglass extends TileSimpleInventory { } public void onManaCollide() { - if(!worldObj.isRemote) { + if(!world.isRemote) { if(dust) time++; else move = !move; diff --git a/src/main/java/vazkii/botania/common/block/tile/TileIncensePlate.java b/src/main/java/vazkii/botania/common/block/tile/TileIncensePlate.java index 74fdc6341..214bdbd8f 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileIncensePlate.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileIncensePlate.java @@ -47,8 +47,8 @@ public class TileIncensePlate extends TileSimpleInventory { PotionEffect effect = brew.getPotionEffects(stack).get(0); if(timeLeft > 0) { timeLeft--; - if(!worldObj.isRemote) { - List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.getX() + 0.5 - RANGE, pos.getY() + 0.5 - RANGE, pos.getZ() + 0.5 - RANGE, pos.getX() + 0.5 + RANGE, pos.getY() + 0.5 + RANGE, pos.getZ() + 0.5 + RANGE)); + if(!world.isRemote) { + List players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos.getX() + 0.5 - RANGE, pos.getY() + 0.5 - RANGE, pos.getZ() + 0.5 - RANGE, pos.getX() + 0.5 + RANGE, pos.getY() + 0.5 + RANGE, pos.getZ() + 0.5 + RANGE)); for(EntityPlayer player : players) { PotionEffect currentEffect = player.getActivePotionEffect(effect.getPotion()); boolean nightVision = effect.getPotion() == MobEffects.NIGHT_VISION; @@ -58,8 +58,8 @@ public class TileIncensePlate extends TileSimpleInventory { } } - if(worldObj.rand.nextInt(20) == 0) - worldObj.playSound(null, pos, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.BLOCKS, 0.1F, 1); + if(world.rand.nextInt(20) == 0) + world.playSound(null, pos, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.BLOCKS, 0.1F, 1); } else { double x = pos.getX() + 0.5; double y = pos.getY() + 0.5; @@ -85,7 +85,7 @@ public class TileIncensePlate extends TileSimpleInventory { newComparator = 2; if(comparatorOutput != newComparator) { comparatorOutput = newComparator; - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); } } @@ -142,7 +142,7 @@ public class TileIncensePlate extends TileSimpleInventory { @Override public void markDirty() { super.markDirty(); - if(!worldObj.isRemote) + if(!world.isRemote) VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this); } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileLightRelay.java b/src/main/java/vazkii/botania/common/block/tile/TileLightRelay.java index 751b886b8..f840a6182 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileLightRelay.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileLightRelay.java @@ -56,11 +56,11 @@ public class TileLightRelay extends TileMod implements IWandBindable { public void mountEntity(Entity e) { BlockPos nextDest = getNextDestination(); - if(e.isRiding() || worldObj.isRemote || nextDest == null || !isValidBinding()) + if(e.isRiding() || world.isRemote || nextDest == null || !isValidBinding()) return; - EntityPlayerMover mover = new EntityPlayerMover(worldObj, pos, nextDest); - worldObj.spawnEntityInWorld(mover); + EntityPlayerMover mover = new EntityPlayerMover(world, pos, nextDest); + world.spawnEntity(mover); e.startRiding(mover); if(!(e instanceof EntityItem)) { mover.playSound(BotaniaSoundEvents.lightRelay, 0.2F, (float) Math.random() * 0.3F + 0.7F); @@ -75,7 +75,7 @@ public class TileLightRelay extends TileMod implements IWandBindable { BlockPos nextDest = getNextDestination(); if(nextDest != null && nextDest.getY() > -1 && isValidBinding()) { - if(worldObj.isRemote) { + if(world.isRemote) { Vector3 vec = getMovementVector(); if(vec != null) { double dist = 0.1; @@ -102,9 +102,9 @@ public class TileLightRelay extends TileMod implements IWandBindable { BlockPos endpoint = getEndpoint(); if(endpoint != null) { - AxisAlignedBB aabb = ModBlocks.lightRelay.getBoundingBox(worldObj.getBlockState(pos), worldObj, pos).offset(pos); + AxisAlignedBB aabb = ModBlocks.lightRelay.getBoundingBox(world.getBlockState(pos), world, pos).offset(pos); float range = 0.5F; - List enderPearls = worldObj.getEntitiesWithinAABB(EntityEnderPearl.class, aabb.expandXyz(range)); + List enderPearls = world.getEntitiesWithinAABB(EntityEnderPearl.class, aabb.expandXyz(range)); for(EntityEnderPearl pearl : enderPearls) { pearl.setPositionAndUpdate( endpoint.getX() + pearl.posX - pos.getX(), @@ -122,7 +122,7 @@ public class TileLightRelay extends TileMod implements IWandBindable { if(nextDest == null) return false; - Block block = worldObj.getBlockState(nextDest).getBlock(); + Block block = world.getBlockState(nextDest).getBlock(); return block == ModBlocks.lightRelay; } @@ -142,7 +142,7 @@ public class TileLightRelay extends TileMod implements IWandBindable { if(coords == null) return lastCoords; - TileEntity tile = worldObj.getTileEntity(coords); + TileEntity tile = world.getTileEntity(coords); if(tile != null && tile instanceof TileLightRelay) relay = (TileLightRelay) tile; else return lastCoords; @@ -167,7 +167,7 @@ public class TileLightRelay extends TileMod implements IWandBindable { } public BlockPos getNextDestination() { - IBlockState state = worldObj.getBlockState(pos); + IBlockState state = world.getBlockState(pos); if(state.getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.TOGGLE && state.getValue(BotaniaStateProps.POWERED)) return null; else if(state.getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.FORK) { @@ -175,7 +175,7 @@ public class TileLightRelay extends TileMod implements IWandBindable { for(int i = -2; i < 3; i++) { BlockPos testPos = pos.add(0, i, 0); - IBlockState testState = worldObj.getBlockState(testPos); + IBlockState testState = world.getBlockState(testPos); if(testState.getBlock() == ModBlocks.animatedTorch) { torchPos = testPos; break; @@ -183,11 +183,11 @@ public class TileLightRelay extends TileMod implements IWandBindable { } if(torchPos != null) { - TileAnimatedTorch torch = (TileAnimatedTorch) worldObj.getTileEntity(torchPos); + TileAnimatedTorch torch = (TileAnimatedTorch) world.getTileEntity(torchPos); EnumFacing side = TileAnimatedTorch.SIDES[torch.side].getOpposite(); for(int i = 1; i < MAX_DIST; i++) { BlockPos testPos = pos.offset(side, i); - IBlockState testState = worldObj.getBlockState(testPos); + IBlockState testState = world.getBlockState(testPos); if(testState.getBlock() == ModBlocks.lightRelay) return testPos; } @@ -204,7 +204,7 @@ public class TileLightRelay extends TileMod implements IWandBindable { @Override public boolean bindTo(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) { - if(player.worldObj.getBlockState(pos).getBlock() != ModBlocks.lightRelay || pos.distanceSq(getPos()) > MAX_DIST * MAX_DIST) + if(player.world.getBlockState(pos).getBlock() != ModBlocks.lightRelay || pos.distanceSq(getPos()) > MAX_DIST * MAX_DIST) return false; bindPos = pos; @@ -256,7 +256,7 @@ public class TileLightRelay extends TileMod implements IWandBindable { public void onUpdate() { super.onUpdate(); - if(getPassengers().isEmpty() && !worldObj.isRemote) { + if(getPassengers().isEmpty() && !world.isRemote) { setDead(); return; } @@ -269,11 +269,11 @@ public class TileLightRelay extends TileMod implements IWandBindable { BlockPos exitPos = getExitPos(); if(pos.equals(exitPos)) { - TileEntity tile = worldObj.getTileEntity(pos); + TileEntity tile = world.getTileEntity(pos); if(tile != null && tile instanceof TileLightRelay) { - if(worldObj.getBlockState(pos).getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.DETECTOR) { - worldObj.setBlockState(pos, worldObj.getBlockState(pos).withProperty(BotaniaStateProps.POWERED, true), 1 | 2); - worldObj.scheduleUpdate(pos, tile.getBlockType(), tile.getBlockType().tickRate(worldObj)); + if(world.getBlockState(pos).getValue(BotaniaStateProps.LUMINIZER_VARIANT) == LuminizerVariant.DETECTOR) { + world.setBlockState(pos, world.getBlockState(pos).withProperty(BotaniaStateProps.POWERED, true), 1 | 2); + world.scheduleUpdate(pos, tile.getBlockType(), tile.getBlockType().tickRate(world)); } TileLightRelay relay = (TileLightRelay) tile; diff --git a/src/main/java/vazkii/botania/common/block/tile/TileManaFlame.java b/src/main/java/vazkii/botania/common/block/tile/TileManaFlame.java index 2bc859ada..ac611d730 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileManaFlame.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileManaFlame.java @@ -32,7 +32,7 @@ public class TileManaFlame extends TileMod { public void update() { float c = 0.3F; - if(worldObj.isRemote && Math.random() < c) { + if(world.isRemote && Math.random() < c) { float v = 0.1F; float r = (float) (color >> 16 & 0xFF) / 0xFF; diff --git a/src/main/java/vazkii/botania/common/block/tile/TileOpenCrate.java b/src/main/java/vazkii/botania/common/block/tile/TileOpenCrate.java index 7bd995f85..653668150 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileOpenCrate.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileOpenCrate.java @@ -42,12 +42,12 @@ public class TileOpenCrate extends TileSimpleInventory { @Override public void update() { - if (worldObj.isRemote) + if (world.isRemote) return; boolean redstone = false; for(EnumFacing dir : EnumFacing.VALUES) { - int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir); + int redstoneSide = world.getRedstonePower(pos.offset(dir), dir); if(redstoneSide > 0) { redstone = true; break; @@ -62,13 +62,13 @@ public class TileOpenCrate extends TileSimpleInventory { } public boolean canEject() { - IBlockState stateBelow = worldObj.getBlockState(pos.down()); + IBlockState stateBelow = world.getBlockState(pos.down()); Block blockBelow = stateBelow.getBlock(); - return blockBelow.isAir(stateBelow, worldObj, pos.down()) || stateBelow.getCollisionBoundingBox(worldObj, pos.down()) == null; + return blockBelow.isAir(stateBelow, world, pos.down()) || stateBelow.getCollisionBoundingBox(world, pos.down()) == null; } public void eject(ItemStack stack, boolean redstone) { - EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() - 0.5, pos.getZ() + 0.5, stack); + EntityItem item = new EntityItem(world, pos.getX() + 0.5, pos.getY() - 0.5, pos.getZ() + 0.5, stack); item.motionX = 0; item.motionY = 0; item.motionZ = 0; @@ -81,7 +81,7 @@ public class TileOpenCrate extends TileSimpleInventory { itemHandler.setStackInSlot(0, null); - worldObj.spawnEntityInWorld(item); + world.spawnEntity(item); } public boolean onWanded(World world, EntityPlayer player, ItemStack stack) { diff --git a/src/main/java/vazkii/botania/common/block/tile/TilePlatform.java b/src/main/java/vazkii/botania/common/block/tile/TilePlatform.java index d93df2794..54d79cbcd 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TilePlatform.java +++ b/src/main/java/vazkii/botania/common/block/tile/TilePlatform.java @@ -36,7 +36,7 @@ public class TilePlatform extends TileCamo { void swapSurroudings(TilePlatform tile, boolean empty) { for(EnumFacing dir : EnumFacing.VALUES) { BlockPos pos = tile.getPos().offset(dir); - TileEntity tileAt = worldObj.getTileEntity(pos); + TileEntity tileAt = world.getTileEntity(pos); if(tileAt != null && tileAt instanceof TilePlatform) { TilePlatform platform = (TilePlatform) tileAt; if(empty ? platform.camoState != null : platform.camoState == null) @@ -47,7 +47,7 @@ public class TilePlatform extends TileCamo { void swap(TilePlatform tile, boolean empty) { tile.camoState = empty ? null : camoState; - worldObj.notifyBlockUpdate(tile.getPos(), worldObj.getBlockState(tile.getPos()), worldObj.getBlockState(tile.getPos()), 8); + world.notifyBlockUpdate(tile.getPos(), world.getBlockState(tile.getPos()), world.getBlockState(tile.getPos()), 8); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TilePylon.java b/src/main/java/vazkii/botania/common/block/tile/TilePylon.java index e31b9ebe9..62d4824e0 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TilePylon.java +++ b/src/main/java/vazkii/botania/common/block/tile/TilePylon.java @@ -34,14 +34,14 @@ public class TilePylon extends TileEntity implements ITickable { public void update() { ++ticks; - if(worldObj.getBlockState(getPos()).getBlock() != ModBlocks.pylon) + if(world.getBlockState(getPos()).getBlock() != ModBlocks.pylon) return; - PylonVariant variant = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.PYLON_VARIANT); + PylonVariant variant = world.getBlockState(getPos()).getValue(BotaniaStateProps.PYLON_VARIANT); - if(activated && worldObj.isRemote) { - if(worldObj.getBlockState(centerPos).getBlock() != getBlockForMeta() - || variant == PylonVariant.NATURA && (portalOff() || worldObj.getBlockState(getPos().down()).getBlock() != ModBlocks.pool)) { + if(activated && world.isRemote) { + if(world.getBlockState(centerPos).getBlock() != getBlockForMeta() + || variant == PylonVariant.NATURA && (portalOff() || world.getBlockState(getPos().down()).getBlock() != ModBlocks.pool)) { activated = false; return; } @@ -63,21 +63,21 @@ public class TilePylon extends TileEntity implements ITickable { Vector3 movementVector = centerBlock.subtract(ourCoords).normalize().multiply(0.2); Botania.proxy.wispFX(x, pos.getY() + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, -0.075F - (float) Math.random() * 0.015F); - if(worldObj.rand.nextInt(3) == 0) + if(world.rand.nextInt(3) == 0) Botania.proxy.wispFX(x, pos.getY() + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z); } } else { Vector3 ourCoords = Vector3.fromTileEntityCenter(this).add(0, 1 + (Math.random() - 0.5 * 0.25), 0); Vector3 movementVector = centerBlock.subtract(ourCoords).normalize().multiply(0.2); - Block block = worldObj.getBlockState(pos.down()).getBlock(); + Block block = world.getBlockState(pos.down()).getBlock(); if(block == ModBlocks.flower || block == ModBlocks.shinyFlower) { - int hex = worldObj.getBlockState(pos.down()).getValue(BotaniaStateProps.COLOR).getMapColor().colorValue; + int hex = world.getBlockState(pos.down()).getValue(BotaniaStateProps.COLOR).getMapColor().colorValue; int r = (hex & 0xFF0000) >> 16; int g = (hex & 0xFF00) >> 8; int b = hex & 0xFF; - if(worldObj.rand.nextInt(4) == 0) + if(world.rand.nextInt(4) == 0) Botania.proxy.sparkleFX(centerBlock.x + (Math.random() - 0.5) * 0.5, centerBlock.y, centerBlock.z + (Math.random() - 0.5) * 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random(), 8); Botania.proxy.wispFX(pos.getX() + 0.5 + (Math.random() - 0.5) * 0.25, pos.getY() - 0.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.25, r / 255F, g / 255F, b / 255F, (float) Math.random() / 3F, -0.04F); @@ -87,17 +87,17 @@ public class TilePylon extends TileEntity implements ITickable { } } - if(worldObj.rand.nextBoolean() && worldObj.isRemote) + if(world.rand.nextBoolean() && world.isRemote) Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random() * 1.5, pos.getZ() + Math.random(), variant == PylonVariant.GAIA ? 1F : 0.5F, variant == PylonVariant.NATURA ? 1F : 0.5F, variant == PylonVariant.NATURA ? 0.5F : 1F, (float) Math.random(), 2); } private Block getBlockForMeta() { - return worldObj.getBlockState(pos).getValue(BotaniaStateProps.PYLON_VARIANT) == PylonVariant.MANA ? ModBlocks.enchanter : ModBlocks.alfPortal; + return world.getBlockState(pos).getValue(BotaniaStateProps.PYLON_VARIANT) == PylonVariant.MANA ? ModBlocks.enchanter : ModBlocks.alfPortal; } private boolean portalOff() { - return worldObj.getBlockState(centerPos).getBlock() != ModBlocks.alfPortal - || worldObj.getBlockState(centerPos).getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.OFF; + return world.getBlockState(centerPos).getBlock() != ModBlocks.alfPortal + || world.getBlockState(centerPos).getValue(BotaniaStateProps.ALFPORTAL_STATE) == AlfPortalState.OFF; } } \ No newline at end of file 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 6337b26b6..e26b01ed1 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java @@ -68,11 +68,11 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver player.setHeldItem(hand, null); } - EntityItem item = new EntityItem(worldObj, getPos().getX() + 0.5, getPos().getY() + 1, getPos().getZ() + 0.5, new ItemStack(ModBlocks.livingrock)); + EntityItem item = new EntityItem(world, getPos().getX() + 0.5, getPos().getY() + 1, getPos().getZ() + 0.5, new ItemStack(ModBlocks.livingrock)); item.setPickupDelay(40); item.motionX = item.motionY = item.motionZ = 0; - if(!worldObj.isRemote) - worldObj.spawnEntityInWorld(item); + if(!world.isRemote) + world.spawnEntity(item); return true; } @@ -99,7 +99,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver } if(did) - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); return true; } @@ -110,8 +110,8 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver // Update every tick. recieveMana(0); - if(!worldObj.isRemote && manaToGet == 0) { - List items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1))); + if(!world.isRemote && manaToGet == 0) { + List items = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1))); for(EntityItem item : items) if(!item.isDead && item.getEntityItem() != null && item.getEntityItem().getItem() != Item.getItemFromBlock(ModBlocks.livingrock)) { ItemStack stack = item.getEntityItem(); @@ -121,8 +121,8 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver } - if(worldObj.isRemote && manaToGet > 0 && mana >= manaToGet) { - if(worldObj.rand.nextInt(20) == 0) { + if(world.isRemote && manaToGet > 0 && mana >= manaToGet) { + if(world.rand.nextInt(20) == 0) { Vector3 vec = Vector3.fromTileEntityCenter(this); Vector3 endVec = vec.add(0, 2.5, 0); Botania.proxy.lightningFX(vec, endVec, 2F, 0x00948B, 0x00E4D7); @@ -143,7 +143,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver if(newSignal != signal) { signal = newSignal; - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); } if(recipeKeepTicks > 0) @@ -170,8 +170,8 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver } if(manaToGet != this.manaToGet) { - worldObj.playSound(null, pos, BotaniaSoundEvents.runeAltarStart, SoundCategory.BLOCKS, 1, 1); - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + world.playSound(null, pos, BotaniaSoundEvents.runeAltarStart, SoundCategory.BLOCKS, 1, 1); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } } @@ -189,7 +189,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver public void trySetLastRecipe(EntityPlayer player) { TileAltar.tryToSetLastRecipe(player, itemHandler, lastRecipe); if(!isEmpty()) - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } public boolean hasValidRecipe() { @@ -213,7 +213,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver } if(manaToGet > 0 && mana >= manaToGet) { - List items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1))); + List items = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1))); EntityItem livingrock = null; for(EntityItem item : items) if(!item.isDead && item.getEntityItem() != null && item.getEntityItem().getItem() == Item.getItemFromBlock(ModBlocks.livingrock)) { @@ -224,22 +224,22 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver if(livingrock != null) { int mana = recipe.getManaUsage(); recieveMana(-mana); - if(!worldObj.isRemote) { + if(!world.isRemote) { ItemStack output = recipe.getOutput().copy(); - EntityItem outputItem = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output); - worldObj.spawnEntityInWorld(outputItem); + EntityItem outputItem = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output); + world.spawnEntity(outputItem); currentRecipe = null; cooldown = 60; } saveLastRecipe(); - if(!worldObj.isRemote) { + if(!world.isRemote) { for(int i = 0; i < getSizeInventory(); i++) { ItemStack stack = itemHandler.getStackInSlot(i); if(stack != null) { if(stack.getItem() == ModItems.rune && (player == null || !player.capabilities.isCreativeMode)) { - EntityItem outputItem = new EntityItem(worldObj, getPos().getX() + 0.5, getPos().getY() + 1.5, getPos().getZ() + 0.5, stack.copy()); - worldObj.spawnEntityInWorld(outputItem); + EntityItem outputItem = new EntityItem(world, getPos().getX() + 0.5, getPos().getY() + 1.5, getPos().getZ() + 0.5, stack.copy()); + world.spawnEntity(outputItem); } itemHandler.setStackInSlot(i, null); @@ -258,7 +258,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver } public void craftingFanciness() { - worldObj.playSound(null, pos, BotaniaSoundEvents.runeAltarCraft, SoundCategory.BLOCKS, 1, 1); + world.playSound(null, pos, BotaniaSoundEvents.runeAltarCraft, SoundCategory.BLOCKS, 1, 1); for(int i = 0; i < 25; i++) { float red = (float) Math.random(); float green = (float) Math.random(); diff --git a/src/main/java/vazkii/botania/common/block/tile/TileSparkChanger.java b/src/main/java/vazkii/botania/common/block/tile/TileSparkChanger.java index 5d62ad505..7720a23ed 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileSparkChanger.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileSparkChanger.java @@ -26,13 +26,13 @@ import vazkii.botania.common.item.ModItems; public class TileSparkChanger extends TileSimpleInventory { public void doSwap() { - if(worldObj.isRemote) + if(world.isRemote) return; ItemStack changeStack = itemHandler.getStackInSlot(0); List attachables = new ArrayList<>(); for(EnumFacing dir : EnumFacing.HORIZONTALS) { - TileEntity tile = worldObj.getTileEntity(pos.offset(dir)); + TileEntity tile = world.getTileEntity(pos.offset(dir)); if(tile != null && tile instanceof ISparkAttachable) { ISparkAttachable attach = (ISparkAttachable) tile; ISparkEntity spark = attach.getAttachedSpark(); @@ -46,7 +46,7 @@ public class TileSparkChanger extends TileSimpleInventory { } if(attachables.size() > 0) { - ISparkAttachable attach = attachables.get(worldObj.rand.nextInt(attachables.size())); + ISparkAttachable attach = attachables.get(world.rand.nextInt(attachables.size())); ISparkEntity spark = attach.getAttachedSpark(); SparkUpgradeType upg = spark.getUpgrade(); ItemStack sparkStack = upg == SparkUpgradeType.NONE ? null : new ItemStack(ModItems.sparkUpgrade, 1, upg.ordinal() - 1); @@ -56,7 +56,7 @@ public class TileSparkChanger extends TileSimpleInventory { if(transfers != null) transfers.clear(); itemHandler.setStackInSlot(0, sparkStack); - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); markDirty(); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileSpawnerClaw.java b/src/main/java/vazkii/botania/common/block/tile/TileSpawnerClaw.java index 5de9611c7..33c6eb2be 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileSpawnerClaw.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileSpawnerClaw.java @@ -37,7 +37,7 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver { @Override public void update() { - TileEntity tileBelow = worldObj.getTileEntity(pos.down()); + TileEntity tileBelow = world.getTileEntity(pos.down()); if(mana >= 5 && tileBelow instanceof TileEntityMobSpawner) { TileEntityMobSpawner spawner = (TileEntityMobSpawner) tileBelow; MobSpawnerBaseLogic logic = spawner.getSpawnerBaseLogic(); @@ -45,7 +45,7 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver { try { // Directly drawn from MobSpawnerBaseLogic, with inverted isActivated check and mana consumption if(!((boolean) MethodHandles.isActivated.invokeExact(logic))) { - if(!worldObj.isRemote) + if(!world.isRemote) mana -= 6; if(logic.getSpawnerWorld().isRemote) { diff --git a/src/main/java/vazkii/botania/common/block/tile/TileSpecialFlower.java b/src/main/java/vazkii/botania/common/block/tile/TileSpecialFlower.java index f2dd5eb49..bd99e2726 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileSpecialFlower.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileSpecialFlower.java @@ -76,7 +76,7 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil @Override public void update() { if(subTile != null) { - TileEntity tileBelow = worldObj.getTileEntity(pos.down()); + TileEntity tileBelow = world.getTileEntity(pos.down()); if(tileBelow instanceof TileRedStringRelay) { BlockPos coords = ((TileRedStringRelay) tileBelow).getBinding(); if(coords != null) { @@ -104,7 +104,7 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil } public boolean isOnSpecialSoil() { - return worldObj.getBlockState(pos.down()).getBlock() == ModBlocks.enchantedSoil; + return world.getBlockState(pos.down()).getBlock() == ModBlocks.enchantedSoil; } @Override @@ -214,12 +214,12 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil @Override public int getSlowdownFactor() { - Block below = worldObj.getBlockState(getPos().down()).getBlock(); + Block below = world.getBlockState(getPos().down()).getBlock(); if(below == Blocks.MYCELIUM) return SLOWDOWN_FACTOR_MYCEL; if(below == Blocks.DIRT) { - BlockDirt.DirtType type = worldObj.getBlockState(getPos().down()).getValue(BlockDirt.VARIANT); + BlockDirt.DirtType type = world.getBlockState(getPos().down()).getValue(BlockDirt.VARIANT); if(type == BlockDirt.DirtType.PODZOL) return SLOWDOWN_FACTOR_PODZOL; } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileSpiritShrine.java b/src/main/java/vazkii/botania/common/block/tile/TileSpiritShrine.java index 650c4762b..c2ef014a1 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileSpiritShrine.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileSpiritShrine.java @@ -18,7 +18,7 @@ public class TileSpiritShrine extends TileMod { @Override public void update() { - if(worldObj.isRemote) { + if(world.isRemote) { if(ticks >= 40) { float[][] colors = new float[][] { { 0F, 0.25F, 1F }, diff --git a/src/main/java/vazkii/botania/common/block/tile/TileStarfield.java b/src/main/java/vazkii/botania/common/block/tile/TileStarfield.java index 14dcc1971..dae6a8b43 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileStarfield.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileStarfield.java @@ -17,11 +17,11 @@ public class TileStarfield extends TileMod { @Override public void update() { - boolean state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED); - if(!worldObj.isRemote) { - boolean newState = !worldObj.isDaytime(); + boolean state = world.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED); + if(!world.isRemote) { + boolean newState = !world.isDaytime(); if(newState != state) { - worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, newState), 1 | 2); + world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, newState), 1 | 2); state = newState; } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileTerraPlate.java b/src/main/java/vazkii/botania/common/block/tile/TileTerraPlate.java index 6a8bbd0fe..7a2c9d0b9 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileTerraPlate.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileTerraPlate.java @@ -79,7 +79,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable { removeMana = false; ISparkEntity spark = getAttachedSpark(); if(spark != null) { - List sparkEntities = SparkHelper.getSparksAround(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); + List sparkEntities = SparkHelper.getSparksAround(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); for(ISparkEntity otherSpark : sparkEntities) { if(spark == otherSpark) continue; @@ -91,16 +91,16 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable { if(mana > 0) doParticles(); - if(mana >= MAX_MANA && !worldObj.isRemote) { + if(mana >= MAX_MANA && !world.isRemote) { EntityItem item = items.get(0); for(EntityItem otherItem : items) if(otherItem != item) otherItem.setDead(); else item.setEntityItemStack(new ItemStack(ModItems.manaResource, 1, 4)); - worldObj.playSound(null, item.posX, item.posY, item.posZ, BotaniaSoundEvents.terrasteelCraft, SoundCategory.BLOCKS, 1, 1); + world.playSound(null, item.posX, item.posY, item.posZ, BotaniaSoundEvents.terrasteelCraft, SoundCategory.BLOCKS, 1, 1); mana = 0; - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } } } @@ -110,7 +110,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable { } void doParticles() { - if(worldObj.isRemote) { + if(world.isRemote) { int ticks = (int) (100.0 * ((double) getCurrentMana() / (double) MAX_MANA)); int totalSpiritCount = 3; @@ -142,7 +142,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable { } List getItems() { - return worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1))); + return world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1))); } boolean areItemsValid(List items) { @@ -184,7 +184,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable { } boolean checkPlatform(int xOff, int zOff, Block block) { - return worldObj.getBlockState(pos.add(xOff, -1, zOff)).getBlock() == block; + return world.getBlockState(pos.add(xOff, -1, zOff)).getBlock() == block; } @Override @@ -210,7 +210,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable { @Override public void recieveMana(int mana) { this.mana = Math.max(0, Math.min(MAX_MANA, this.mana + mana)); - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); } @Override @@ -228,7 +228,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable { @Override public ISparkEntity getAttachedSpark() { - List sparks = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.up(), pos.up().add(1, 1, 1)), Predicates.instanceOf(ISparkEntity.class)); + List sparks = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.up(), pos.up().add(1, 1, 1)), Predicates.instanceOf(ISparkEntity.class)); if(sparks.size() == 1) { Entity e = sparks.get(0); return (ISparkEntity) e; diff --git a/src/main/java/vazkii/botania/common/block/tile/TileTeruTeruBozu.java b/src/main/java/vazkii/botania/common/block/tile/TileTeruTeruBozu.java index e4f0bfc2d..c8fbe428a 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileTeruTeruBozu.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileTeruTeruBozu.java @@ -18,17 +18,17 @@ public class TileTeruTeruBozu extends TileMod { @Override public void update() { - if (worldObj.isRemote) + if (world.isRemote) return; - boolean isRaining = worldObj.isRaining(); - if(isRaining && worldObj.rand.nextInt(9600) == 0) { - worldObj.getWorldInfo().setRaining(false); - resetRainTime(worldObj); + boolean isRaining = world.isRaining(); + if(isRaining && world.rand.nextInt(9600) == 0) { + world.getWorldInfo().setRaining(false); + resetRainTime(world); } if(wasRaining != isRaining) - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); wasRaining = isRaining; } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileTinyPlanet.java b/src/main/java/vazkii/botania/common/block/tile/TileTinyPlanet.java index 23b1731a0..a6e0f23f9 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileTinyPlanet.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileTinyPlanet.java @@ -16,7 +16,7 @@ public class TileTinyPlanet extends TileMod { @Override public void update() { - ItemTinyPlanet.applyEffect(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); + ItemTinyPlanet.applyEffect(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileTinyPotato.java b/src/main/java/vazkii/botania/common/block/tile/TileTinyPotato.java index 58835d541..6d6a2c79a 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileTinyPotato.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileTinyPotato.java @@ -54,16 +54,16 @@ public class TileTinyPotato extends TileSimpleInventory { jump(); - if(!worldObj.isRemote) { + if(!world.isRemote) { if(name.toLowerCase().trim().endsWith("shia labeouf") && nextDoIt == 0) { nextDoIt = 40; - worldObj.playSound(null, pos, BotaniaSoundEvents.doit, SoundCategory.BLOCKS, 1F, 1F); + world.playSound(null, pos, BotaniaSoundEvents.doit, SoundCategory.BLOCKS, 1F, 1F); } for(int i = 0; i < getSizeInventory(); i++) { ItemStack stackAt = getItemHandler().getStackInSlot(i); if(stackAt != null && stackAt.getItem() == Item.getItemFromBlock(ModBlocks.tinyPotato)) { - player.addChatComponentMessage(new TextComponentString("Don't talk to me or my son ever again.")); + player.sendMessage(new TextComponentString("Don't talk to me or my son ever again.")); return; } } @@ -77,7 +77,7 @@ public class TileTinyPotato extends TileSimpleInventory { @Override public void update() { - if(worldObj.rand.nextInt(100) == 0) + if(world.rand.nextInt(100) == 0) jump(); if(jumpTicks > 0) diff --git a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaBase.java b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaBase.java index 303823611..46ed829f7 100644 --- a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaBase.java +++ b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaBase.java @@ -17,7 +17,7 @@ import vazkii.botania.common.block.tile.TileSimpleInventory; public abstract class TileCorporeaBase extends TileSimpleInventory { public ICorporeaSpark getSpark() { - return CorporeaHelper.getSparkForBlock(worldObj, getPos()); + return CorporeaHelper.getSparkForBlock(world, getPos()); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaCrystalCube.java b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaCrystalCube.java index 267f04f80..89f1af68e 100644 --- a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaCrystalCube.java +++ b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaCrystalCube.java @@ -67,7 +67,7 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor copy.stackSize = 1; requestTarget = copy; updateCount(); - if(!worldObj.isRemote) + if(!world.isRemote) VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this); } @@ -82,7 +82,7 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor } public void doRequest(boolean fullStack) { - if(worldObj.isRemote) + if(world.isRemote) return; ICorporeaSpark spark = getSpark(); @@ -93,7 +93,7 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor } private void updateCount() { - if(worldObj.isRemote) + if(world.isRemote) return; int oldCount = itemCount; @@ -113,7 +113,7 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor private void onUpdateCount() { compValue = getComparatorValue(); - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); } @Override @@ -160,8 +160,8 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor boolean did = false; for(ItemStack reqStack : stacks) if(requestTarget != null) { - EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, reqStack); - worldObj.spawnEntityInWorld(item); + EntityItem item = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, reqStack); + world.spawnEntity(item); itemCount -= reqStack.stackSize; did = true; } diff --git a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaFunnel.java b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaFunnel.java index 6abdbb3e7..b6a14917f 100644 --- a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaFunnel.java +++ b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaFunnel.java @@ -33,7 +33,7 @@ public class TileCorporeaFunnel extends TileCorporeaBase implements ICorporeaReq if(spark != null && spark.getMaster() != null) { List filter = getFilter(); if(!filter.isEmpty()) { - ItemStack stack = filter.get(worldObj.rand.nextInt(filter.size())); + ItemStack stack = filter.get(world.rand.nextInt(filter.size())); if(stack != null) doCorporeaRequest(stack, stack.stackSize, spark); @@ -49,7 +49,7 @@ public class TileCorporeaFunnel extends TileCorporeaBase implements ICorporeaReq }; for(EnumFacing dir : EnumFacing.HORIZONTALS) { - List frames = worldObj.getEntitiesWithinAABB(EntityItemFrame.class, new AxisAlignedBB(pos.offset(dir), pos.offset(dir).add(1, 1, 1))); + List frames = world.getEntitiesWithinAABB(EntityItemFrame.class, new AxisAlignedBB(pos.offset(dir), pos.offset(dir).add(1, 1, 1))); for(EntityItemFrame frame : frames) { EnumFacing orientation = frame.facingDirection; if(orientation == dir) { @@ -89,24 +89,24 @@ public class TileCorporeaFunnel extends TileCorporeaBase implements ICorporeaReq if(inv != null && ItemHandlerHelper.insertItemStacked(inv, reqStack, true) == null) ItemHandlerHelper.insertItemStacked(inv, reqStack, false); else { - EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, reqStack); - worldObj.spawnEntityInWorld(item); + EntityItem item = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, reqStack); + world.spawnEntity(item); } } } private IItemHandler getInv() { - TileEntity te = worldObj.getTileEntity(pos.down()); - IItemHandler ret = InventoryHelper.getInventory(worldObj, pos.down(), EnumFacing.UP); + TileEntity te = world.getTileEntity(pos.down()); + IItemHandler ret = InventoryHelper.getInventory(world, pos.down(), EnumFacing.UP); if(ret == null) - ret = InventoryHelper.getInventory(worldObj, pos.down(), null); + ret = InventoryHelper.getInventory(world, pos.down(), null); if(ret != null && !(te instanceof TileCorporeaFunnel)) return ret; - te = worldObj.getTileEntity(pos.down(2)); - ret = InventoryHelper.getInventory(worldObj, pos.down(2), EnumFacing.UP); + te = world.getTileEntity(pos.down(2)); + ret = InventoryHelper.getInventory(world, pos.down(2), EnumFacing.UP); if(ret == null) - ret = InventoryHelper.getInventory(worldObj, pos.down(2), null); + ret = InventoryHelper.getInventory(world, pos.down(2), null); if(ret != null && !(te instanceof TileCorporeaFunnel)) return ret; diff --git a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaIndex.java b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaIndex.java index d8f1d7c5d..5c224af04 100644 --- a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaIndex.java +++ b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaIndex.java @@ -154,7 +154,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ double y = pos.getY() + 0.5; double z = pos.getZ() + 0.5; - List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(x - RADIUS, y - RADIUS, z - RADIUS, x + RADIUS, y + RADIUS, z + RADIUS)); + List players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(x - RADIUS, y - RADIUS, z - RADIUS, x + RADIUS, y + RADIUS, z + RADIUS)); hasCloseby = false; for(EntityPlayer player : players) if(isInRangeOfIndex(player, this)) { @@ -201,13 +201,13 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ spark.onItemsRequested(stacks); for(ItemStack stack : stacks) if(stack != null) { - EntityItem item = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, stack); - worldObj.spawnEntityInWorld(item); + EntityItem item = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, stack); + world.spawnEntity(item); } } public static boolean isInRangeOfIndex(EntityPlayer player, TileCorporeaIndex index) { - return player.worldObj.provider.getDimension() == index.worldObj.provider.getDimension() && MathHelper.pointDistancePlane(index.getPos().getX() + 0.5, index.getPos().getZ() + 0.5, player.posX, player.posZ) < RADIUS && Math.abs(index.getPos().getY() + 0.5 - player.posY + (player.worldObj.isRemote ? 0 : 1.6)) < 5; + return player.world.provider.getDimension() == index.world.provider.getDimension() && MathHelper.pointDistancePlane(index.getPos().getX() + 0.5, index.getPos().getZ() + 0.5, player.posX, player.posZ) < RADIUS && Math.abs(index.getPos().getY() + 0.5 - player.posY + (player.world.isRemote ? 0 : 1.6)) < 5; } public static void addPattern(String pattern, IRegexStacker stacker) { @@ -241,7 +241,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ if(!nearbyIndexes.isEmpty()) { String msg = event.getMessage().toLowerCase().trim(); for(TileCorporeaIndex index : nearbyIndexes) { - if(index.worldObj.isRemote) + if(index.world.isRemote) continue; ICorporeaSpark spark = index.getSpark(); @@ -266,7 +266,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ index.doCorporeaRequest(name, count, spark); - event.getPlayer().addChatMessage(new TextComponentTranslation("botaniamisc.requestMsg", count, WordUtils.capitalizeFully(name), CorporeaHelper.lastRequestMatches, CorporeaHelper.lastRequestExtractions).setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE))); + event.getPlayer().sendMessage(new TextComponentTranslation("botaniamisc.requestMsg", count, WordUtils.capitalizeFully(name), CorporeaHelper.lastRequestMatches, CorporeaHelper.lastRequestExtractions).setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE))); if(CorporeaHelper.lastRequestExtractions >= 50000) event.getPlayer().addStat(ModAchievements.superCorporeaRequest, 1); } @@ -279,7 +279,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ public static List getNearbyIndexes(EntityPlayer player) { List indexList = new ArrayList<>(); for(TileCorporeaIndex index : indexes) - if(isInRangeOfIndex(player, index) && index.worldObj.isRemote == player.worldObj.isRemote) + if(isInRangeOfIndex(player, index) && index.world.isRemote == player.world.isRemote) indexList.add(index); return indexList; } @@ -287,7 +287,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ @Override @SideOnly(Side.CLIENT) public boolean shouldAutoComplete() { - return !getNearbyIndexes(Minecraft.getMinecraft().thePlayer).isEmpty(); + return !getNearbyIndexes(Minecraft.getMinecraft().player).isEmpty(); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaInterceptor.java b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaInterceptor.java index af7972e0e..ab593580c 100644 --- a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaInterceptor.java +++ b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaInterceptor.java @@ -48,13 +48,13 @@ public class TileCorporeaInterceptor extends TileCorporeaBase implements ICorpor for(ItemStack stack_ : stacks) missing -= stack_.stackSize; - if(missing > 0 && !worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED)) { - worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, true), 1 | 2); - worldObj.scheduleUpdate(getPos(), getBlockType(), 2); + if(missing > 0 && !world.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED)) { + world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, true), 1 | 2); + world.scheduleUpdate(getPos(), getBlockType(), 2); TileEntity requestor = source.getSparkInventory().world.getTileEntity(source.getSparkInventory().pos); for(EnumFacing dir : EnumFacing.HORIZONTALS) { - TileEntity tile = worldObj.getTileEntity(pos.offset(dir)); + TileEntity tile = world.getTileEntity(pos.offset(dir)); if(tile != null && tile instanceof TileCorporeaRetainer) ((TileCorporeaRetainer) tile).setPendingRequest(requestor.getPos(), request, count); } @@ -82,7 +82,7 @@ public class TileCorporeaInterceptor extends TileCorporeaBase implements ICorpor List filter = new ArrayList<>(); for(EnumFacing dir : EnumFacing.HORIZONTALS) { - List frames = worldObj.getEntitiesWithinAABB(EntityItemFrame.class, new AxisAlignedBB(pos.offset(dir), pos.offset(dir).add(1, 1, 1))); + List frames = world.getEntitiesWithinAABB(EntityItemFrame.class, new AxisAlignedBB(pos.offset(dir), pos.offset(dir).add(1, 1, 1))); for(EntityItemFrame frame : frames) { EnumFacing orientation = frame.facingDirection; if(orientation == dir) diff --git a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaRetainer.java b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaRetainer.java index 8b5bf8829..b1dafccaa 100644 --- a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaRetainer.java +++ b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaRetainer.java @@ -47,7 +47,7 @@ public class TileCorporeaRetainer extends TileMod { this.request = request; this.requestCount = requestCount; pendingRequest = true; - worldObj.updateComparatorOutputLevel(getPos(), worldObj.getBlockState(getPos()).getBlock()); + world.updateComparatorOutputLevel(getPos(), world.getBlockState(getPos()).getBlock()); } public boolean hasPendingRequest() { @@ -58,14 +58,14 @@ public class TileCorporeaRetainer extends TileMod { if(!hasPendingRequest()) return; - ICorporeaSpark spark = CorporeaHelper.getSparkForBlock(worldObj, requestPos); + ICorporeaSpark spark = CorporeaHelper.getSparkForBlock(world, requestPos); if(spark != null) { InvWithLocation inv = spark.getSparkInventory(); if(inv != null && inv.world.getTileEntity(inv.pos) instanceof ICorporeaRequestor) { ICorporeaRequestor requestor = (ICorporeaRequestor) inv.world.getTileEntity(inv.pos); requestor.doCorporeaRequest(request, requestCount, spark); pendingRequest = false; - worldObj.updateComparatorOutputLevel(getPos(), worldObj.getBlockState(getPos()).getBlock()); + world.updateComparatorOutputLevel(getPos(), world.getBlockState(getPos()).getBlock()); } } } diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileBellows.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileBellows.java index 1c543d2e4..797a4fba5 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileBellows.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileBellows.java @@ -58,7 +58,7 @@ public class TileBellows extends TileMod { if(movePos < max && active && moving >= 0F) { if(moving == 0F) - worldObj.playSound(null, pos, BotaniaSoundEvents.bellows, SoundCategory.BLOCKS, 0.1F, 3F); + world.playSound(null, pos, BotaniaSoundEvents.bellows, SoundCategory.BLOCKS, 0.1F, 3F); if(tile instanceof TileEntityFurnace) { TileEntityFurnace furnace = (TileEntityFurnace) tile; @@ -67,32 +67,32 @@ public class TileBellows extends TileMod { furnace.setField(0, Math.max(0, furnace.getField(0) - 10)); // burnTime } - if(furnace.hasWorldObj() && furnace.getBlockType() == Blocks.LIT_FURNACE) { + if(furnace.hasWorld() && furnace.getBlockType() == Blocks.LIT_FURNACE) { // Copypasta from BlockFurnace - EnumFacing enumfacing = worldObj.getBlockState(furnace.getPos()).getValue(BlockFurnace.FACING); + EnumFacing enumfacing = world.getBlockState(furnace.getPos()).getValue(BlockFurnace.FACING); double d0 = pos.getX() + 0.5D; - double d1 = pos.getY() + worldObj.rand.nextDouble() * 6.0D / 16.0D; + double d1 = pos.getY() + world.rand.nextDouble() * 6.0D / 16.0D; double d2 = pos.getZ() + 0.5D; double d3 = 0.52D; - double d4 = worldObj.rand.nextDouble() * 0.6D - 0.3D; + double d4 = world.rand.nextDouble() * 0.6D - 0.3D; switch (enumfacing) { case WEST: - worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); - worldObj.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); break; case EAST: - worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); - worldObj.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); break; case NORTH: - worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D); - worldObj.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D); break; case SOUTH: - worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D); - worldObj.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D); default: break; } } @@ -118,8 +118,8 @@ public class TileBellows extends TileMod { } public TileEntity getLinkedTile() { - EnumFacing side = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.CARDINALS); - return worldObj.getTileEntity(getPos().offset(side)); + EnumFacing side = world.getBlockState(getPos()).getValue(BotaniaStateProps.CARDINALS); + return world.getTileEntity(getPos().offset(side)); } @Override @@ -133,11 +133,11 @@ public class TileBellows extends TileMod { } public void setActive(boolean active) { - if(!worldObj.isRemote) { + if(!world.isRemote) { boolean diff = this.active != active; this.active = active; if(diff) - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileDistributor.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileDistributor.java index 6f8855365..54f099859 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileDistributor.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileDistributor.java @@ -26,11 +26,11 @@ public class TileDistributor extends TileMod implements IManaReceiver { @Override public void update() { - if (worldObj.isRemote) + if (world.isRemote) return; validPools.clear(); for(EnumFacing dir : EnumFacing.HORIZONTALS) { - TileEntity tileAt = worldObj.getTileEntity(pos.offset(dir)); + TileEntity tileAt = world.getTileEntity(pos.offset(dir)); if(tileAt != null && tileAt instanceof IManaPool && !tileAt.isInvalid()) { IManaReceiver receiver = (IManaReceiver) tileAt; if(!receiver.isFull()) @@ -57,7 +57,7 @@ public class TileDistributor extends TileMod implements IManaReceiver { for(IManaReceiver pool : validPools) { pool.recieveMana(manaForEach); TileEntity tile = (TileEntity) pool; - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, tile.getPos()); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, tile.getPos()); } } } 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 70184a0f1..9f9d65bcf 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 @@ -23,10 +23,10 @@ public class TileManaDetector extends TileMod { @Override public void update() { - boolean state = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED); - boolean expectedState = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)), Predicates.instanceOf(IManaBurst.class)).size() != 0; - if(state != expectedState && !worldObj.isRemote) - worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, expectedState), 1 | 2); + boolean state = world.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED); + boolean expectedState = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos, pos.add(1, 1, 1)), Predicates.instanceOf(IManaBurst.class)).size() != 0; + if(state != expectedState && !world.isRemote) + world.setBlockState(getPos(), world.getBlockState(getPos()).withProperty(BotaniaStateProps.POWERED, expectedState), 1 | 2); if(expectedState) for(int i = 0; i < 4; i++) diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java b/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java index f4c951fcf..ad7c17af6 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java @@ -118,14 +118,14 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt @Override public boolean isFull() { - Block blockBelow = worldObj.getBlockState(pos.down()).getBlock(); + Block blockBelow = world.getBlockState(pos.down()).getBlock(); return blockBelow != ModBlocks.manaVoid && getCurrentMana() >= manaCap; } @Override public void recieveMana(int mana) { this.mana = Math.max(0, Math.min(getCurrentMana() + mana, manaCap)); - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); markDispatchable(); } @@ -161,7 +161,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt } public boolean collideEntityItem(EntityItem item) { - if(worldObj.isRemote || item.isDead) + if(world.isRemote || item.isDead) return false; ItemStack stack = item.getEntityItem(); @@ -180,7 +180,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt if(age > 100 && age < 130) return false; - RecipeManaInfusion recipe = getMatchingRecipe(stack, worldObj.getBlockState(pos.down())); + RecipeManaInfusion recipe = getMatchingRecipe(stack, world.getBlockState(pos.down())); if(recipe != null) { int mana = recipe.getManaToConsume(); @@ -192,11 +192,11 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt item.setDead(); ItemStack output = recipe.getOutput().copy(); - EntityItem outputItem = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output); + EntityItem outputItem = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output); try { MethodHandles.itemAge_setter.invokeExact(outputItem, 105); } catch (Throwable ignored) {} - worldObj.spawnEntityInWorld(outputItem); + world.spawnEntity(outputItem); craftingFanciness(); return true; @@ -208,23 +208,23 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt private void craftingFanciness() { if(soundTicks == 0) { - worldObj.playSound(null, pos, BotaniaSoundEvents.manaPoolCraft, SoundCategory.BLOCKS, 0.4F, 4F); + world.playSound(null, pos, BotaniaSoundEvents.manaPoolCraft, SoundCategory.BLOCKS, 0.4F, 4F); soundTicks = 6; } - PacketHandler.sendToNearby(worldObj, getPos(), + PacketHandler.sendToNearby(world, getPos(), new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.POOL_CRAFT, pos.getX(), pos.getY(), pos.getZ())); } @Override public void update() { if(manaCap == -1) - manaCap = worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POOL_VARIANT) == PoolVariant.DILUTED ? MAX_MANA_DILLUTED : MAX_MANA; + manaCap = world.getBlockState(getPos()).getValue(BotaniaStateProps.POOL_VARIANT) == PoolVariant.DILUTED ? MAX_MANA_DILLUTED : MAX_MANA; if(!ManaNetworkHandler.instance.isPoolIn(this) && !isInvalid()) ManaNetworkEvent.addPool(this); - if(worldObj.isRemote) { + if(world.isRemote) { double particleChance = 1F - (double) getCurrentMana() / (double) manaCap * 0.1; if(Math.random() > particleChance) Botania.proxy.wispFX(pos.getX() + 0.3 + Math.random() * 0.5, pos.getY() + 0.6 + Math.random() * 0.25, pos.getZ() + Math.random(), PARTICLE_COLOR.getRed() / 255F, PARTICLE_COLOR.getGreen() / 255F, PARTICLE_COLOR.getBlue() / 255F, (float) Math.random() / 3F, (float) -Math.random() / 25F, 2F); @@ -243,7 +243,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt sendPacket = false; } - List items = worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1))); + List items = world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos, pos.add(1, 1, 1))); for(EntityItem item : items) { if(item.isDead) continue; @@ -257,7 +257,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt int bellowCount = 0; if(outputting) for(EnumFacing dir : EnumFacing.HORIZONTALS) { - TileEntity tile = worldObj.getTileEntity(pos.offset(dir)); + TileEntity tile = world.getTileEntity(pos.offset(dir)); if(tile != null && tile instanceof TileBellows && ((TileBellows) tile).getLinkedTile() == this) bellowCount++; } @@ -284,8 +284,8 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt } if(didSomething) { - if(ConfigHandler.chargingAnimationEnabled && worldObj.rand.nextInt(20) == 0) { - PacketHandler.sendToNearby(worldObj, getPos(), + if(ConfigHandler.chargingAnimationEnabled && world.rand.nextInt(20) == 0) { + PacketHandler.sendToNearby(world, getPos(), new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.POOL_CHARGE, getPos().getX(), getPos().getY(), getPos().getZ(), outputting ? 1 : 0)); } isDoingTransfer = outputting; @@ -349,10 +349,10 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt if(player.isSneaking()) { outputting = !outputting; - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } - if(!worldObj.isRemote) { + if(!world.isRemote) { NBTTagCompound nbttagcompound = new NBTTagCompound(); writePacketNBT(nbttagcompound); nbttagcompound.setInteger(TAG_KNOWN_MANA, getCurrentMana()); @@ -360,12 +360,12 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt ((EntityPlayerMP) player).connection.sendPacket(new SPacketUpdateTileEntity(pos, -999, nbttagcompound)); } - worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.11F, 1F); + world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.11F, 1F); } @SideOnly(Side.CLIENT) public void renderHUD(Minecraft mc, ScaledResolution res) { - ItemStack pool = new ItemStack(ModBlocks.pool, 1, worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POOL_VARIANT).ordinal()); + ItemStack pool = new ItemStack(ModBlocks.pool, 1, world.getBlockState(getPos()).getValue(BotaniaStateProps.POOL_VARIANT).ordinal()); String name = I18n.format(pool.getUnlocalizedName().replaceAll("tile.", "tile." + LibResources.PREFIX_MOD) + ".name"); int color = 0x4444FF; HUDHandler.drawSimpleManaHUD(color, knownMana, manaCap, name, res); @@ -407,8 +407,8 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt @Override public int getCurrentMana() { - if(worldObj != null) { - IBlockState state = worldObj.getBlockState(getPos()); + if(world != null) { + IBlockState state = world.getBlockState(getPos()); if(state.getProperties().containsKey(BotaniaStateProps.POOL_VARIANT)) return state.getValue(BotaniaStateProps.POOL_VARIANT) == PoolVariant.CREATIVE ? MAX_MANA : mana; } @@ -436,7 +436,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt @Override public ISparkEntity getAttachedSpark() { - List sparks = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.up(), pos.up().add(1, 1, 1)), Predicates.instanceOf(ISparkEntity.class)); + List sparks = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.up(), pos.up().add(1, 1, 1)), Predicates.instanceOf(ISparkEntity.class)); if(sparks.size() == 1) { Entity e = (Entity) sparks.get(0); return (ISparkEntity) e; @@ -463,7 +463,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt @Override public void setColor(EnumDyeColor color) { this.color = color; - worldObj.notifyBlockUpdate(pos, worldObj.getBlockState(pos), worldObj.getBlockState(pos), 0b1011); + world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 0b1011); } @Override diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TilePrism.java b/src/main/java/vazkii/botania/common/block/tile/mana/TilePrism.java index 3f2fe71b7..7f1f0584d 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TilePrism.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TilePrism.java @@ -24,7 +24,7 @@ public class TilePrism extends TileSimpleInventory { public void onBurstCollision(IManaBurst burst) { ItemStack lens = itemHandler.getStackInSlot(0); - boolean active = !worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED); + boolean active = !world.getBlockState(getPos()).getValue(BotaniaStateProps.POWERED); boolean valid = lens != null && lens.getItem() instanceof ILens && (!(lens.getItem() instanceof ITinyPlanetExcempt) || ((ITinyPlanetExcempt) lens.getItem()).shouldPull(lens)); if(active) { diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TilePump.java b/src/main/java/vazkii/botania/common/block/tile/mana/TilePump.java index ea71dbb86..732ae4089 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TilePump.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TilePump.java @@ -73,7 +73,7 @@ public class TilePump extends TileMod { public void update() { hasRedstone = false; for(EnumFacing dir : EnumFacing.VALUES) { - int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir); + int redstoneSide = world.getRedstonePower(pos.offset(dir), dir); if(redstoneSide > 0) { hasRedstone = true; break; @@ -92,7 +92,7 @@ public class TilePump extends TileMod { innerRingPos = Math.min(max, innerRingPos); moving = 0F; for(int x = 0; x < 2; x++) - worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, getPos().getX() + Math.random(), getPos().getY() + Math.random(), getPos().getZ() + Math.random(), 0, 0, 0); + world.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, getPos().getX() + Math.random(), getPos().getY() + Math.random(), getPos().getZ() + Math.random(), 0, 0, 0); } } else if(innerRingPos > min) { innerRingPos -= incr * 2; @@ -103,7 +103,7 @@ public class TilePump extends TileMod { } } - if(worldObj.isRemote) + if(world.isRemote) move.setValue(innerRingPos / 8 * 0.5F); // rescale to 0 - 0.5 for json animation if(!hasCartOnTop) @@ -117,7 +117,7 @@ public class TilePump extends TileMod { hasCartOnTop = false; if(comparator != lastComparator) - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); lastComparator = comparator; } @@ -130,17 +130,17 @@ public class TilePump extends TileMod { public void readPacketNBT(NBTTagCompound cmp) { boolean prevActive = active; active = cmp.getBoolean(TAG_ACTIVE); - if(worldObj != null && worldObj.isRemote) + if(world != null && world.isRemote) if(prevActive != active) asm.transition(active ? "moving" : "default"); } public void setActive(boolean active) { - if(!worldObj.isRemote) { + if(!world.isRemote) { boolean diff = this.active != active; this.active = active; if(diff) - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } } } diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileRFGenerator.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileRFGenerator.java index fa3a580fa..cee53b8a8 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileRFGenerator.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileRFGenerator.java @@ -46,7 +46,7 @@ public class TileRFGenerator extends TileMod implements IManaReceiver, IEnergyCo @Override public void update() { - if(!worldObj.isRemote && Botania.rfApiLoaded) { + if(!world.isRemote && Botania.rfApiLoaded) { if(deadCache) reCache(); @@ -83,7 +83,7 @@ public class TileRFGenerator extends TileMod implements IManaReceiver, IEnergyCo @Optional.Method(modid = "CoFHAPI|energy") public void onNeighborTileChange(BlockPos pos) { - TileEntity tile = worldObj.getTileEntity(pos); + TileEntity tile = world.getTileEntity(pos); BlockPos q = getPos(); EnumFacing side = EnumFacing.getFacingFromVector(pos.getX() - q.getX(), pos.getY() - q.getY(), pos.getZ() - q.getZ()); diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java index b06212a5d..9912623ac 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java @@ -195,8 +195,8 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, boolean redstone = false; for(EnumFacing dir : EnumFacing.VALUES) { - TileEntity tileAt = worldObj.getTileEntity(pos.offset(dir)); - if(worldObj.isBlockLoaded(pos.offset(dir), false) && tileAt instanceof IManaPool) { + TileEntity tileAt = world.getTileEntity(pos.offset(dir)); + if(world.isBlockLoaded(pos.offset(dir), false) && tileAt instanceof IManaPool) { IManaPool pool = (IManaPool) tileAt; if(wasInNetwork && (pool != receiver || isRedstone())) { if(pool instanceof IKeyLocked && !((IKeyLocked) pool).getOutputKey().equals(getInputKey())) @@ -212,7 +212,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, } } - int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir); + int redstoneSide = world.getRedstonePower(pos.offset(dir), dir); if(redstoneSide > 0) redstone = true; } @@ -226,7 +226,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, double y = lastPingbackY; double z = lastPingbackZ; AxisAlignedBB aabb = new AxisAlignedBB(x, y, z, x, y, z).expand(PINGBACK_EXPIRED_SEARCH_DISTANCE, PINGBACK_EXPIRED_SEARCH_DISTANCE, PINGBACK_EXPIRED_SEARCH_DISTANCE); - List bursts = worldObj.getEntitiesWithinAABB(Entity.class, aabb, Predicates.instanceOf(IManaBurst.class)); + List bursts = world.getEntitiesWithinAABB(Entity.class, aabb, Predicates.instanceOf(IManaBurst.class)); IManaBurst found = null; UUID identity = getIdentifier(); for(IManaBurst burst : (List) bursts) @@ -263,9 +263,9 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, if(shouldShoot) tryShootBurst(); - if(receiverLastTick != receiver && !worldObj.isRemote) { + if(receiverLastTick != receiver && !world.isRemote) { requestsClientUpdate = true; - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } redstoneLastTick = redstone; @@ -353,19 +353,19 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, lastPingbackY = cmp.getDouble(TAG_LAST_PINGBACK_Y); lastPingbackZ = cmp.getDouble(TAG_LAST_PINGBACK_Z); - if(requestsClientUpdate && worldObj != null) { + if(requestsClientUpdate && world != null) { int x = cmp.getInteger(TAG_FORCE_CLIENT_BINDING_X); int y = cmp.getInteger(TAG_FORCE_CLIENT_BINDING_Y); int z = cmp.getInteger(TAG_FORCE_CLIENT_BINDING_Z); if(y != -1) { - TileEntity tile = worldObj.getTileEntity(new BlockPos(x, y, z)); + TileEntity tile = world.getTileEntity(new BlockPos(x, y, z)); if(tile instanceof IManaReceiver) receiver = (IManaReceiver) tile; else receiver = null; } else receiver = null; } - if(worldObj != null && worldObj.isRemote) + if(world != null && world.isRemote) hasReceivedInitialPacket = true; } @@ -384,17 +384,17 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, return; if(!player.isSneaking()) { - if(!worldObj.isRemote) { + if(!world.isRemote) { NBTTagCompound nbttagcompound = new NBTTagCompound(); writePacketNBT(nbttagcompound); nbttagcompound.setInteger(TAG_KNOWN_MANA, mana); if(player instanceof EntityPlayerMP) ((EntityPlayerMP) player).connection.sendPacket(new SPacketUpdateTileEntity(pos, -999, nbttagcompound)); } - worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.1F, 1); + world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.1F, 1); } else { - RayTraceResult pos = raytraceFromEntity(worldObj, player, true, 5); - if(pos != null && pos.hitVec != null && !worldObj.isRemote) { + RayTraceResult pos = raytraceFromEntity(world, player, true, 5); + if(pos != null && pos.hitVec != null && !world.isRemote) { double x = pos.hitVec.xCoord - getPos().getX() - 0.5; double y = pos.hitVec.yCoord - getPos().getY() - 0.5; double z = pos.hitVec.zCoord - getPos().getZ() - 0.5; @@ -414,20 +414,20 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, checkForReceiver(); requestsClientUpdate = true; - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, getPos()); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, getPos()); } } } private boolean needsNewBurstSimulation() { - if(worldObj.isRemote && !hasReceivedInitialPacket) + if(world.isRemote && !hasReceivedInitialPacket) return false; if(lastTentativeBurst == null) return true; for(PositionProperties props : lastTentativeBurst) - if(!props.contentsEqual(worldObj)) { + if(!props.contentsEqual(world)) { invalidTentativeBurst = props.invalid; return !invalidTentativeBurst; } @@ -440,13 +440,13 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, if(canShootBurst && (isRedstone() || receiver.canRecieveManaFromBursts() && !receiver.isFull())) { EntityManaBurst burst = getBurst(false); if(burst != null) { - if(!worldObj.isRemote) { + if(!world.isRemote) { mana -= burst.getStartingMana(); burst.setShooterUUID(getIdentifier()); - worldObj.spawnEntityInWorld(burst); + world.spawnEntity(burst); burst.ping(); if(!ConfigHandler.silentSpreaders) - worldObj.playSound(null, pos, BotaniaSoundEvents.spreaderFire, SoundCategory.BLOCKS, 0.05F * (paddingColor != -1 ? 0.2F : 1F), 0.7F + 0.3F * (float) Math.random()); + world.playSound(null, pos, BotaniaSoundEvents.spreaderFire, SoundCategory.BLOCKS, 0.05F * (paddingColor != -1 ? 0.2F : 1F), 0.7F + 0.3F * (float) Math.random()); } } } @@ -455,18 +455,18 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, public boolean isRedstone() { updateContainingBlockInfo(); - return worldObj == null ? staticRedstone : getBlockMetadata() == SpreaderVariant.REDSTONE.ordinal(); + return world == null ? staticRedstone : getBlockMetadata() == SpreaderVariant.REDSTONE.ordinal(); } public boolean isDreamwood() { updateContainingBlockInfo(); int variant = getBlockMetadata(); - return worldObj == null ? staticDreamwood : variant == SpreaderVariant.ELVEN.ordinal() || variant == SpreaderVariant.GAIA.ordinal(); + return world == null ? staticDreamwood : variant == SpreaderVariant.ELVEN.ordinal() || variant == SpreaderVariant.GAIA.ordinal(); } public boolean isULTRA_SPREADER() { updateContainingBlockInfo(); - return worldObj == null ? staticUltra : getBlockMetadata() == SpreaderVariant.GAIA.ordinal(); + return world == null ? staticUltra : getBlockMetadata() == SpreaderVariant.GAIA.ordinal(); } public void checkForReceiver() { @@ -481,7 +481,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, if(receiver != null && receiver instanceof IManaReceiver - && receiver.hasWorldObj() + && receiver.hasWorld() && receiver.getWorld().isBlockLoaded(receiver.getPos(), !receiver.getWorld().isRemote)) this.receiver = (IManaReceiver) receiver; else this.receiver = null; @@ -573,7 +573,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, @SideOnly(Side.CLIENT) public void renderHUD(Minecraft mc, ScaledResolution res) { - String name = I18n.format(new ItemStack(ModBlocks.spreader, 1, worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.SPREADER_VARIANT).ordinal()).getUnlocalizedName().replaceAll("tile.", "tile." + LibResources.PREFIX_MOD) + ".name"); + String name = I18n.format(new ItemStack(ModBlocks.spreader, 1, world.getBlockState(getPos()).getValue(BotaniaStateProps.SPREADER_VARIANT).ordinal()).getUnlocalizedName().replaceAll("tile.", "tile." + LibResources.PREFIX_MOD) + ".name"); int color = isRedstone() ? 0xFF0000 : isDreamwood() ? 0xFF00AE : 0x00FF00; HUDHandler.drawSimpleManaHUD(color, knownMana, getMaxMana(), name, res); @@ -596,7 +596,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, if(receiver != null) { TileEntity receiverTile = (TileEntity) receiver; - ItemStack recieverStack = new ItemStack(worldObj.getBlockState(receiverTile.getPos()).getBlock(), 1, receiverTile.getBlockMetadata()); + ItemStack recieverStack = new ItemStack(world.getBlockState(receiverTile.getPos()).getBlock(), 1, receiverTile.getBlockMetadata()); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); if(recieverStack != null && recieverStack.getItem() != null) { @@ -620,7 +620,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, @Override public void onClientDisplayTick() { - if(worldObj != null) { + if(world != null) { EntityManaBurst burst = getBurst(true); burst.getCollidedTile(false); } @@ -656,7 +656,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, @Override public void markDirty() { checkForReceiver(); - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } @Override @@ -693,7 +693,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, Vector3 thisVec = Vector3.fromTileEntityCenter(this); Vector3 blockVec = new Vector3(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); - AxisAlignedBB axis = player.worldObj.getBlockState(pos).getCollisionBoundingBox(player.worldObj, pos); + AxisAlignedBB axis = player.world.getBlockState(pos).getCollisionBoundingBox(player.world, pos); if(axis != null) axis = axis.offset(pos); else axis = new AxisAlignedBB(pos, pos.add(1, 1, 1)); diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileTurntable.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileTurntable.java index ed540806e..c872d6b37 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileTurntable.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileTurntable.java @@ -37,19 +37,19 @@ public class TileTurntable extends TileMod { boolean redstone = false; for(EnumFacing dir : EnumFacing.VALUES) { - int redstoneSide = worldObj.getRedstonePower(pos.offset(dir), dir); + int redstoneSide = world.getRedstonePower(pos.offset(dir), dir); if(redstoneSide > 0) redstone = true; } if(!redstone) { - TileEntity tile = worldObj.getTileEntity(pos.up()); + TileEntity tile = world.getTileEntity(pos.up()); if(tile instanceof TileSpreader) { TileSpreader spreader = (TileSpreader) tile; spreader.rotationX += speed * (backwards ? -1 : 1); if(spreader.rotationX >= 360F) spreader.rotationX -= 360F; - if(!worldObj.isRemote) + if(!world.isRemote) spreader.checkForReceiver(); } } @@ -74,7 +74,7 @@ public class TileTurntable extends TileMod { if(player.isSneaking()) backwards = !backwards; else speed = speed == 6 ? 1 : speed + 1; - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } public void renderHUD(Minecraft mc, ScaledResolution res) { diff --git a/src/main/java/vazkii/botania/common/block/tile/string/TileRedString.java b/src/main/java/vazkii/botania/common/block/tile/string/TileRedString.java index 93d16b398..e2da73025 100644 --- a/src/main/java/vazkii/botania/common/block/tile/string/TileRedString.java +++ b/src/main/java/vazkii/botania/common/block/tile/string/TileRedString.java @@ -37,10 +37,10 @@ public abstract class TileRedString extends TileMod implements ITileBound { for(int i = 0; i < range; i++) { pos_ = pos_.offset(dir); - if(worldObj.isAirBlock(pos_)) + if(world.isAirBlock(pos_)) continue; - TileEntity tile = worldObj.getTileEntity(pos_); + TileEntity tile = world.getTileEntity(pos_); if(tile instanceof TileRedString) continue; @@ -77,17 +77,17 @@ public abstract class TileRedString extends TileMod implements ITileBound { } public EnumFacing getOrientation() { - return worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.FACING); + return world.getBlockState(getPos()).getValue(BotaniaStateProps.FACING); } public TileEntity getTileAtBinding() { BlockPos binding = getBinding(); - return binding == null ? null : worldObj.getTileEntity(binding); + return binding == null ? null : world.getTileEntity(binding); } public IBlockState getStateAtBinding() { BlockPos binding = getBinding(); - return binding == null ? Blocks.AIR.getDefaultState() : worldObj.getBlockState(binding); + return binding == null ? Blocks.AIR.getDefaultState() : world.getBlockState(binding); } public Block getBlockAtBinding() { diff --git a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringComparator.java b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringComparator.java index 4b046786b..5f8c5e5d6 100644 --- a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringComparator.java +++ b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringComparator.java @@ -25,11 +25,11 @@ public class TileRedStringComparator extends TileRedString { int origVal = comparatorValue; if(state.hasComparatorInputOverride()) { - comparatorValue = state.getComparatorInputOverride(worldObj, binding); + comparatorValue = state.getComparatorInputOverride(world, binding); } else comparatorValue = 0; if(origVal != comparatorValue) - worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock()); + world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); } public int getComparatorValue() { @@ -38,7 +38,7 @@ public class TileRedStringComparator extends TileRedString { @Override public boolean acceptBlock(BlockPos pos) { - return worldObj.getBlockState(pos).hasComparatorInputOverride(); + return world.getBlockState(pos).hasComparatorInputOverride(); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringContainer.java b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringContainer.java index 58c548082..0c3ee7de0 100644 --- a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringContainer.java +++ b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringContainer.java @@ -24,7 +24,7 @@ public class TileRedStringContainer extends TileRedString { @Override public boolean acceptBlock(BlockPos pos) { - TileEntity tile = worldObj.getTileEntity(pos); + TileEntity tile = world.getTileEntity(pos); return tile != null && Arrays.stream(EnumFacing.VALUES) .anyMatch(e -> tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, e)); diff --git a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringDispenser.java b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringDispenser.java index 426da9629..11e7f6964 100644 --- a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringDispenser.java +++ b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringDispenser.java @@ -18,16 +18,16 @@ public class TileRedStringDispenser extends TileRedStringContainer { @Override public boolean acceptBlock(BlockPos pos) { - TileEntity tile = worldObj.getTileEntity(pos); + TileEntity tile = world.getTileEntity(pos); return tile != null && tile instanceof TileEntityDispenser; } public void tickDispenser() { BlockPos bind = getBinding(); if(bind != null) { - TileEntity tile = worldObj.getTileEntity(bind); + TileEntity tile = world.getTileEntity(bind); if(tile instanceof TileEntityDispenser) - worldObj.scheduleUpdate(bind, tile.getBlockType(), tile.getBlockType().tickRate(worldObj)); + world.scheduleUpdate(bind, tile.getBlockType(), tile.getBlockType().tickRate(world)); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringFertilizer.java b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringFertilizer.java index df15d1ace..780718ca3 100644 --- a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringFertilizer.java +++ b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringFertilizer.java @@ -41,7 +41,7 @@ public class TileRedStringFertilizer extends TileRedString { @Override public boolean acceptBlock(BlockPos pos) { - return worldObj.getBlockState(pos).getBlock() instanceof IGrowable; + return world.getBlockState(pos).getBlock() instanceof IGrowable; } } diff --git a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringInterceptor.java b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringInterceptor.java index ee656a1a5..67f990dca 100644 --- a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringInterceptor.java +++ b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringInterceptor.java @@ -31,17 +31,17 @@ public class TileRedStringInterceptor extends TileRedString { @Override public void update() { super.update(); - if(!worldObj.isRemote) + if(!world.isRemote) interceptors.add(this); } @Override public boolean acceptBlock(BlockPos pos) { - return worldObj.getTileEntity(pos) != null; + return world.getTileEntity(pos) != null; } private boolean saneState() { - return !isInvalid() && worldObj.getTileEntity(pos) == this; + return !isInvalid() && world.getTileEntity(pos) == this; } public static void onInteract(EntityPlayer player, World world, BlockPos pos, EnumHand hand) { @@ -58,7 +58,7 @@ public class TileRedStringInterceptor extends TileRedString { continue; } - if(inter.worldObj == world) { + if(inter.world == world) { BlockPos coords = inter.getBinding(); if(coords != null && coords.equals(pos)) { Block block = inter.getBlockType(); diff --git a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringRelay.java b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringRelay.java index 189c4ef37..7a853e08e 100644 --- a/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringRelay.java +++ b/src/main/java/vazkii/botania/common/block/tile/string/TileRedStringRelay.java @@ -25,8 +25,8 @@ public class TileRedStringRelay extends TileRedString { if(pos.equals(getPos().up())) return false; - Block block = worldObj.getBlockState(pos).getBlock(); - TileEntity tile = worldObj.getTileEntity(pos); + Block block = world.getBlockState(pos).getBlock(); + TileEntity tile = world.getTileEntity(pos); return (block instanceof BlockFlower || block instanceof BlockMushroom || block instanceof BlockDoublePlant) && (tile == null || !(tile instanceof ISubTileContainer)); } diff --git a/src/main/java/vazkii/botania/common/core/command/CommandDownloadLatest.java b/src/main/java/vazkii/botania/common/core/command/CommandDownloadLatest.java index df51d0bd7..603def6f1 100644 --- a/src/main/java/vazkii/botania/common/core/command/CommandDownloadLatest.java +++ b/src/main/java/vazkii/botania/common/core/command/CommandDownloadLatest.java @@ -27,13 +27,13 @@ public class CommandDownloadLatest extends CommandBase { @Nonnull @Override - public String getCommandName() { + public String getName() { return "botania-download-latest"; } @Nonnull @Override - public String getCommandUsage(@Nonnull ICommandSender var1) { + public String getUsage(@Nonnull ICommandSender var1) { return "/botania-download-latest "; } @@ -45,13 +45,13 @@ public class CommandDownloadLatest extends CommandBase { @Override public void execute(@Nonnull MinecraftServer server, @Nonnull ICommandSender var1, @Nonnull String[] var2) { if(!ENABLED) - var1.addChatMessage(new TextComponentTranslation("botania.versioning.disabled").setStyle(new Style().setColor(TextFormatting.RED))); + var1.sendMessage(new TextComponentTranslation("botania.versioning.disabled").setStyle(new Style().setColor(TextFormatting.RED))); else if(var2.length == 1) if(VersionChecker.downloadedFile) - var1.addChatMessage(new TextComponentTranslation("botania.versioning.downloadedAlready").setStyle(new Style().setColor(TextFormatting.RED))); + var1.sendMessage(new TextComponentTranslation("botania.versioning.downloadedAlready").setStyle(new Style().setColor(TextFormatting.RED))); else if(VersionChecker.startedDownload) - var1.addChatMessage(new TextComponentTranslation("botania.versioning.downloadingAlready").setStyle(new Style().setColor(TextFormatting.RED))); + var1.sendMessage(new TextComponentTranslation("botania.versioning.downloadingAlready").setStyle(new Style().setColor(TextFormatting.RED))); else new ThreadDownloadMod("Botania " + var2[0] + ".jar"); } diff --git a/src/main/java/vazkii/botania/common/core/command/CommandOpen.java b/src/main/java/vazkii/botania/common/core/command/CommandOpen.java index 415f5f88d..6988853ac 100644 --- a/src/main/java/vazkii/botania/common/core/command/CommandOpen.java +++ b/src/main/java/vazkii/botania/common/core/command/CommandOpen.java @@ -27,13 +27,13 @@ public class CommandOpen extends CommandBase { @Nonnull @Override - public String getCommandName() { + public String getName() { return "botania-open"; } @Nonnull @Override - public String getCommandUsage(@Nonnull ICommandSender sender) { + public String getUsage(@Nonnull ICommandSender sender) { return ""; } @@ -45,7 +45,7 @@ public class CommandOpen extends CommandBase { if(stack != null) { ItemLexicon.setForcedPage(stack, args[0]); ItemLexicon.setQueueTicks(stack, 5); - } else sender.addChatMessage(new TextComponentTranslation("botaniamisc.noLexicon").setStyle(new Style().setColor(TextFormatting.RED))); + } else sender.sendMessage(new TextComponentTranslation("botaniamisc.noLexicon").setStyle(new Style().setColor(TextFormatting.RED))); } } diff --git a/src/main/java/vazkii/botania/common/core/command/CommandShare.java b/src/main/java/vazkii/botania/common/core/command/CommandShare.java index 19abcac5c..a7697737c 100644 --- a/src/main/java/vazkii/botania/common/core/command/CommandShare.java +++ b/src/main/java/vazkii/botania/common/core/command/CommandShare.java @@ -23,13 +23,13 @@ public class CommandShare extends CommandBase { @Nonnull @Override - public String getCommandName() { + public String getName() { return "botania-share"; } @Nonnull @Override - public String getCommandUsage(@Nonnull ICommandSender sender) { + public String getUsage(@Nonnull ICommandSender sender) { return ""; } diff --git a/src/main/java/vazkii/botania/common/core/command/CommandSkyblockSpread.java b/src/main/java/vazkii/botania/common/core/command/CommandSkyblockSpread.java index b3158f6f9..a07555691 100644 --- a/src/main/java/vazkii/botania/common/core/command/CommandSkyblockSpread.java +++ b/src/main/java/vazkii/botania/common/core/command/CommandSkyblockSpread.java @@ -26,13 +26,13 @@ public class CommandSkyblockSpread extends CommandBase { @Nonnull @Override - public String getCommandName() { + public String getName() { return "botania-skyblock-spread"; } @Nonnull @Override - public String getCommandUsage(@Nonnull ICommandSender sender) { + public String getUsage(@Nonnull ICommandSender sender) { return " []"; } @@ -58,12 +58,12 @@ public class CommandSkyblockSpread extends CommandBase { EntityPlayer player = getPlayer(server, sender, args[0]); if(player != null) { - BlockPos spawn = player.worldObj.getSpawnPoint(); + BlockPos spawn = player.world.getSpawnPoint(); int x, z; do { - x = player.worldObj.rand.nextInt(maxrange) - maxrange / 2 + spawn.getX(); - z = player.worldObj.rand.nextInt(maxrange) - maxrange / 2 + spawn.getZ(); + x = player.world.rand.nextInt(maxrange) - maxrange / 2 + spawn.getX(); + z = player.world.rand.nextInt(maxrange) - maxrange / 2 + spawn.getZ(); } while(MathHelper.pointDistancePlane(x, z, spawn.getX(), spawn.getZ()) < minDist); SkyblockWorldEvents.spawnPlayer(player, new BlockPos(x, spawn.getY(), z), true); diff --git a/src/main/java/vazkii/botania/common/core/handler/BiomeDecorationHandler.java b/src/main/java/vazkii/botania/common/core/handler/BiomeDecorationHandler.java index 8b2eaf254..3a995fbbd 100644 --- a/src/main/java/vazkii/botania/common/core/handler/BiomeDecorationHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/BiomeDecorationHandler.java @@ -33,8 +33,8 @@ public final class BiomeDecorationHandler { boolean flowers = true; if(event.getWorld().provider instanceof IFlowerlessWorld) flowers = ((IFlowerlessWorld) event.getWorld().provider).generateFlowers(event.getWorld()); - else if(event.getWorld().getBiomeGenForCoords(event.getPos()) instanceof IFlowerlessBiome) - flowers = ((IFlowerlessBiome) event.getWorld().getBiomeGenForCoords(event.getPos())).canGenerateFlowers(event.getWorld(), event.getPos().getX(), event.getPos().getZ()); + else if(event.getWorld().getBiome(event.getPos()) instanceof IFlowerlessBiome) + flowers = ((IFlowerlessBiome) event.getWorld().getBiome(event.getPos())).canGenerateFlowers(event.getWorld(), event.getPos().getX(), event.getPos().getZ()); if(!flowers) return; @@ -53,7 +53,7 @@ public final class BiomeDecorationHandler { int y1 = y + event.getRand().nextInt(4) - event.getRand().nextInt(4); int z1 = z + event.getRand().nextInt(dist * 2) - dist; BlockPos pos2 = new BlockPos(x1, y1, z1); - if(event.getWorld().isAirBlock(pos2) && (!event.getWorld().provider.getHasNoSky() || y1 < 127) && ModBlocks.flower.canPlaceBlockAt(event.getWorld(), pos2)) { + if(event.getWorld().isAirBlock(pos2) && (!event.getWorld().provider.hasNoSky() || y1 < 127) && ModBlocks.flower.canPlaceBlockAt(event.getWorld(), pos2)) { event.getWorld().setBlockState(pos2, ModBlocks.flower.getDefaultState().withProperty(BotaniaStateProps.COLOR, color), 2); if(event.getRand().nextDouble() < ConfigHandler.flowerTallChance && ((BlockModFlower) ModBlocks.flower).canGrow(event.getWorld(), pos2, event.getWorld().getBlockState(pos2), false)) BlockModFlower.placeDoubleFlower(event.getWorld(), pos2, color, 0); diff --git a/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java b/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java index 34ed05953..693dde733 100644 --- a/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java @@ -384,9 +384,9 @@ public final class ConfigHandler { if(changes.size() == 0) return; - player.addChatComponentMessage(new TextComponentTranslation("botaniamisc.adaptativeConfigChanges").setStyle(new Style().setColor(TextFormatting.GOLD))); + player.sendMessage(new TextComponentTranslation("botaniamisc.adaptativeConfigChanges").setStyle(new Style().setColor(TextFormatting.GOLD))); for(String change : changes) - player.addChatMessage(new TextComponentString(change).setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE))); + player.sendMessage(new TextComponentString(change).setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE))); } public void addMappingInt(int version, String key, int val) { diff --git a/src/main/java/vazkii/botania/common/core/handler/PixieHandler.java b/src/main/java/vazkii/botania/common/core/handler/PixieHandler.java index e7fc9f616..e6559e676 100644 --- a/src/main/java/vazkii/botania/common/core/handler/PixieHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/PixieHandler.java @@ -29,7 +29,7 @@ public final class PixieHandler { @SubscribeEvent public static void onDamageTaken(LivingHurtEvent event) { - if(!event.getEntityLiving().worldObj.isRemote && event.getEntityLiving() instanceof EntityPlayer && event.getSource().getEntity() != null && event.getSource().getEntity() instanceof EntityLivingBase) { + if(!event.getEntityLiving().world.isRemote && event.getEntityLiving() instanceof EntityPlayer && event.getSource().getEntity() != null && event.getSource().getEntity() instanceof EntityLivingBase) { EntityPlayer player = (EntityPlayer) event.getEntityLiving(); ItemStack stack = PlayerHelper.getFirstHeldItemClass(player, IPixieSpawner.class); @@ -42,11 +42,11 @@ public final class PixieHandler { chance += getChance(baubles.getStackInSlot(i)); if(Math.random() < chance) { - EntityPixie pixie = new EntityPixie(player.worldObj); + EntityPixie pixie = new EntityPixie(player.world); pixie.setPosition(player.posX, player.posY + 2, player.posZ); if(((ItemElementiumHelm) ModItems.elementiumHelm).hasArmorSet(player)) { - pixie.setApplyPotionEffect(new PotionEffect(potions[event.getEntityLiving().worldObj.rand.nextInt(potions.length)], 40, 0)); + pixie.setApplyPotionEffect(new PotionEffect(potions[event.getEntityLiving().world.rand.nextInt(potions.length)], 40, 0)); } float dmg = 4; @@ -54,7 +54,7 @@ public final class PixieHandler { dmg += 2; pixie.setProps((EntityLivingBase) event.getSource().getEntity(), player, 0, dmg); - player.worldObj.spawnEntityInWorld(pixie); + player.world.spawnEntity(pixie); } } } diff --git a/src/main/java/vazkii/botania/common/core/handler/SheddingHandler.java b/src/main/java/vazkii/botania/common/core/handler/SheddingHandler.java index 1b1a7d5e1..883995fd2 100644 --- a/src/main/java/vazkii/botania/common/core/handler/SheddingHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/SheddingHandler.java @@ -36,13 +36,13 @@ public final class SheddingHandler { @SubscribeEvent public static void onLivingUpdate(LivingUpdateEvent event) { - if(event.getEntityLiving().worldObj.isRemote) + if(event.getEntityLiving().world.isRemote) return; ShedPattern pattern = getShedPattern(event.getEntityLiving()); if(pattern != null) { - if(event.getEntityLiving().worldObj.rand.nextInt(pattern.getRate()) == 0) + if(event.getEntityLiving().world.rand.nextInt(pattern.getRate()) == 0) event.getEntityLiving().entityDropItem(pattern.getItemStack(), 0.0F); } } 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 fa7c52dfd..f789d26d2 100644 --- a/src/main/java/vazkii/botania/common/core/helper/InventoryHelper.java +++ b/src/main/java/vazkii/botania/common/core/helper/InventoryHelper.java @@ -76,7 +76,7 @@ public class InventoryHelper { ItemStack copy = stackAt.copy(); ItemHandlerHelper.giveItemToPlayer(player, copy); inv.getItemHandler().setStackInSlot(i, null); - player.worldObj.updateComparatorOutputLevel(inv.getPos(), null); + player.world.updateComparatorOutputLevel(inv.getPos(), null); break; } } diff --git a/src/main/java/vazkii/botania/common/core/proxy/ServerProxy.java b/src/main/java/vazkii/botania/common/core/proxy/ServerProxy.java index dfc8f3ed4..10938433a 100644 --- a/src/main/java/vazkii/botania/common/core/proxy/ServerProxy.java +++ b/src/main/java/vazkii/botania/common/core/proxy/ServerProxy.java @@ -90,7 +90,7 @@ public class ServerProxy implements IProxy { @Override public long getWorldElapsedTicks() { - return FMLCommonHandler.instance().getMinecraftServerInstance().worldServers[0].getTotalWorldTime(); + return FMLCommonHandler.instance().getMinecraftServerInstance().worlds[0].getTotalWorldTime(); } @Override diff --git a/src/main/java/vazkii/botania/common/core/version/AdaptorNotifier.java b/src/main/java/vazkii/botania/common/core/version/AdaptorNotifier.java index 1b7bab0ea..3ba96a2de 100644 --- a/src/main/java/vazkii/botania/common/core/version/AdaptorNotifier.java +++ b/src/main/java/vazkii/botania/common/core/version/AdaptorNotifier.java @@ -24,8 +24,8 @@ public final class AdaptorNotifier { @SubscribeEvent public static void onTick(ClientTickEvent event) { - if(!triedToWarnPlayer && Minecraft.getMinecraft().thePlayer != null) { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if(!triedToWarnPlayer && Minecraft.getMinecraft().player != null) { + EntityPlayer player = Minecraft.getMinecraft().player; ConfigHandler.adaptor.tellChanges(player); triedToWarnPlayer = true; diff --git a/src/main/java/vazkii/botania/common/core/version/ThreadDownloadMod.java b/src/main/java/vazkii/botania/common/core/version/ThreadDownloadMod.java index b03374e0e..a7c78fe02 100644 --- a/src/main/java/vazkii/botania/common/core/version/ThreadDownloadMod.java +++ b/src/main/java/vazkii/botania/common/core/version/ThreadDownloadMod.java @@ -46,8 +46,8 @@ public class ThreadDownloadMod extends Thread { public void run() { try { ITextComponent component = ITextComponent.Serializer.jsonToComponent(I18n.format("botania.versioning.startingDownload", fileName)); - if(Minecraft.getMinecraft().thePlayer != null) - Minecraft.getMinecraft().thePlayer.addChatMessage(component); + if(Minecraft.getMinecraft().player != null) + Minecraft.getMinecraft().player.sendMessage(component); VersionChecker.startedDownload = true; @@ -79,8 +79,8 @@ public class ThreadDownloadMod extends Thread { if(!f1.exists()) f.renameTo(f1); - if(Minecraft.getMinecraft().thePlayer != null) - Minecraft.getMinecraft().thePlayer.addChatMessage(new TextComponentTranslation("botania.versioning.doneDownloading", fileName).setStyle(new Style().setColor(TextFormatting.GREEN))); + if(Minecraft.getMinecraft().player != null) + Minecraft.getMinecraft().player.sendMessage(new TextComponentTranslation("botania.versioning.doneDownloading", fileName).setStyle(new Style().setColor(TextFormatting.GREEN))); Desktop.getDesktop().open(dir); VersionChecker.downloadedFile = true; @@ -92,7 +92,7 @@ public class ThreadDownloadMod extends Thread { } private void sendError() { - if(Minecraft.getMinecraft().thePlayer != null) - Minecraft.getMinecraft().thePlayer.addChatComponentMessage(new TextComponentTranslation("botania.versioning.error").setStyle(new Style().setColor(TextFormatting.RED))); + if(Minecraft.getMinecraft().player != null) + Minecraft.getMinecraft().player.sendMessage(new TextComponentTranslation("botania.versioning.error").setStyle(new Style().setColor(TextFormatting.RED))); } } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/common/core/version/VersionChecker.java b/src/main/java/vazkii/botania/common/core/version/VersionChecker.java index ff58015a5..dfdfcd0af 100644 --- a/src/main/java/vazkii/botania/common/core/version/VersionChecker.java +++ b/src/main/java/vazkii/botania/common/core/version/VersionChecker.java @@ -43,17 +43,17 @@ public final class VersionChecker { @SubscribeEvent public static void onTick(ClientTickEvent event) { - if(doneChecking && event.phase == Phase.END && Minecraft.getMinecraft().thePlayer != null && !triedToWarnPlayer) { + if(doneChecking && event.phase == Phase.END && Minecraft.getMinecraft().player != null && !triedToWarnPlayer) { if(!onlineVersion.isEmpty()) { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; + EntityPlayer player = Minecraft.getMinecraft().player; int onlineBuild = Integer.parseInt(onlineVersion.split("-")[1]); int clientBuild = LibMisc.BUILD.contains("GRADLE") ? Integer.MAX_VALUE : Integer.parseInt(LibMisc.BUILD); if(onlineBuild > clientBuild) { - player.addChatComponentMessage(new TextComponentTranslation("botania.versioning.flavour" + player.worldObj.rand.nextInt(FLAVOUR_MESSAGES)).setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE))); - player.addChatComponentMessage(new TextComponentTranslation("botania.versioning.outdated", clientBuild, onlineBuild)); + player.sendMessage(new TextComponentTranslation("botania.versioning.flavour" + player.world.rand.nextInt(FLAVOUR_MESSAGES)).setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE))); + player.sendMessage(new TextComponentTranslation("botania.versioning.outdated", clientBuild, onlineBuild)); ITextComponent component = ITextComponent.Serializer.fromJsonLenient(I18n.translateToLocal("botania.versioning.updateMessage").replaceAll("%version%", onlineVersion)); - player.addChatComponentMessage(component); + player.sendMessage(component); } } diff --git a/src/main/java/vazkii/botania/common/entity/EntityBabylonWeapon.java b/src/main/java/vazkii/botania/common/entity/EntityBabylonWeapon.java index 15c41592a..3f31dffe6 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityBabylonWeapon.java +++ b/src/main/java/vazkii/botania/common/entity/EntityBabylonWeapon.java @@ -79,13 +79,13 @@ public class EntityBabylonWeapon extends EntityThrowableCopy { @Override public void onUpdate() { EntityLivingBase thrower = getThrower(); - if(!worldObj.isRemote && (thrower == null || !(thrower instanceof EntityPlayer) || thrower.isDead)) { + if(!world.isRemote && (thrower == null || !(thrower instanceof EntityPlayer) || thrower.isDead)) { setDead(); return; } EntityPlayer player = (EntityPlayer) thrower; boolean charging = isCharging(); - if(!worldObj.isRemote) { + if(!world.isRemote) { ItemStack stack = player == null ? null : PlayerHelper.getFirstHeldItem(player, ModItems.kingKey); boolean newCharging = stack != null && ItemKingKey.isCharging(stack); if(charging != newCharging) { @@ -110,8 +110,8 @@ public class EntityBabylonWeapon extends EntityThrowableCopy { int chargeTime = getChargeTicks(); setChargeTicks(chargeTime + 1); - if(worldObj.rand.nextInt(20) == 0) - worldObj.playSound(null, posX, posY, posZ, BotaniaSoundEvents.babylonSpawn, SoundCategory.PLAYERS, 0.1F, 1F + worldObj.rand.nextFloat() * 3F); + if(world.rand.nextInt(20) == 0) + world.playSound(null, posX, posY, posZ, BotaniaSoundEvents.babylonSpawn, SoundCategory.PLAYERS, 0.1F, 1F + world.rand.nextFloat() * 3F); } else { if(liveTime < delay) { motionX = 0; @@ -119,7 +119,7 @@ public class EntityBabylonWeapon extends EntityThrowableCopy { motionZ = 0; } else if (liveTime == delay && player != null) { Vector3 playerLook; - RayTraceResult lookat = ToolCommons.raytraceFromEntity(worldObj, player, true, 64); + RayTraceResult lookat = ToolCommons.raytraceFromEntity(world, player, true, 64); if(lookat == null) playerLook = new Vector3(player.getLookVec()).multiply(64).add(Vector3.fromEntity(player)); else playerLook = new Vector3(lookat.getBlockPos().getX() + 0.5, lookat.getBlockPos().getY() + 0.5, lookat.getBlockPos().getZ() + 0.5); @@ -130,13 +130,13 @@ public class EntityBabylonWeapon extends EntityThrowableCopy { x = motionVec.x; y = motionVec.y; z = motionVec.z; - worldObj.playSound(null, posX, posY, posZ, BotaniaSoundEvents.babylonAttack, SoundCategory.PLAYERS, 2F, 0.1F + worldObj.rand.nextFloat() * 3F); + world.playSound(null, posX, posY, posZ, BotaniaSoundEvents.babylonAttack, SoundCategory.PLAYERS, 2F, 0.1F + world.rand.nextFloat() * 3F); } setLiveTicks(liveTime + 1); - if(!worldObj.isRemote) { + if(!world.isRemote) { AxisAlignedBB axis = new AxisAlignedBB(posX, posY, posZ, lastTickPosX, lastTickPosY, lastTickPosZ).expand(2, 2, 2); - List entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis); + List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, axis); for(EntityLivingBase living : entities) { if(living == thrower) continue; @@ -169,7 +169,7 @@ public class EntityBabylonWeapon extends EntityThrowableCopy { protected void onImpact(RayTraceResult pos) { EntityLivingBase thrower = getThrower(); if(pos.entityHit == null || pos.entityHit != thrower) { - worldObj.createExplosion(this, posX, posY, posZ, 3F, false); + world.createExplosion(this, posX, posY, posZ, 3F, false); setDead(); } } diff --git a/src/main/java/vazkii/botania/common/entity/EntityCorporeaSpark.java b/src/main/java/vazkii/botania/common/entity/EntityCorporeaSpark.java index 83643234f..ca468b881 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityCorporeaSpark.java +++ b/src/main/java/vazkii/botania/common/entity/EntityCorporeaSpark.java @@ -87,7 +87,7 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { public void onUpdate() { super.onUpdate(); - if(worldObj.isRemote) + if(world.isRemote) return; InvWithLocation inv = getSparkInventory(); @@ -147,7 +147,7 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { } private List getNearbySparks() { - List ret = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(posX - SCAN_RANGE, posY - SCAN_RANGE, posZ - SCAN_RANGE, posX + SCAN_RANGE, posY + SCAN_RANGE, posZ + SCAN_RANGE), Predicates.instanceOf(ICorporeaSpark.class)); + List ret = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(posX - SCAN_RANGE, posY - SCAN_RANGE, posZ - SCAN_RANGE, posX + SCAN_RANGE, posY + SCAN_RANGE, posZ + SCAN_RANGE), Predicates.instanceOf(ICorporeaSpark.class)); return ret; } @@ -197,10 +197,10 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { @Override public InvWithLocation getSparkInventory() { - int x = MathHelper.floor_double(posX); - int y = MathHelper.floor_double(posY - 1); - int z = MathHelper.floor_double(posZ); - return InventoryHelper.getInventoryWithLocation(worldObj, new BlockPos(x, y, z), EnumFacing.UP); + int x = MathHelper.floor(posX); + int y = MathHelper.floor(posY - 1); + int z = MathHelper.floor(posZ); + return InventoryHelper.getInventoryWithLocation(world, new BlockPos(x, y, z), EnumFacing.UP); } @Override @@ -271,14 +271,14 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { if(stack != null) { if(stack.getItem() == ModItems.twigWand) { if(player.isSneaking()) { - if(!player.worldObj.isRemote) { + if(!player.world.isRemote) { dropAndKill(); if(isMaster()) restartNetwork(); } else player.swingArm(hand); return true; } else { - if(!player.worldObj.isRemote) { + if(!player.world.isRemote) { displayRelatives(player, new ArrayList<>(), master); } return true; @@ -286,7 +286,7 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { } else if(stack.getItem() == ModItems.dye) { int color = stack.getItemDamage(); if(color != getNetwork().getMetadata()) { - if(!worldObj.isRemote) { + if(!world.isRemote) { setNetwork(EnumDyeColor.byMetadata(color)); if(master != null) @@ -303,7 +303,7 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark { } public boolean doPhantomInk(ItemStack stack) { - if(stack != null && stack.getItem() == ModItems.phantomInk && !worldObj.isRemote) { + if(stack != null && stack.getItem() == ModItems.phantomInk && !world.isRemote) { int invis = dataManager.get(INVISIBILITY); dataManager.set(INVISIBILITY, ~invis & 1); return true; diff --git a/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java b/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java index 41ecc6dfb..35f181ff8 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java +++ b/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java @@ -175,7 +175,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { if(world.getTileEntity(pos) instanceof TileEntityBeacon && isTruePlayer(player)) { if(world.getDifficulty() == EnumDifficulty.PEACEFUL) { if(!world.isRemote) - player.addChatMessage(new TextComponentTranslation("botaniamisc.peacefulNoob").setStyle(new Style().setColor(TextFormatting.RED))); + player.sendMessage(new TextComponentTranslation("botaniamisc.peacefulNoob").setStyle(new Style().setColor(TextFormatting.RED))); return false; } @@ -186,7 +186,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { Block blockat = state.getBlock(); if(blockat != ModBlocks.pylon || state.getValue(BotaniaStateProps.PYLON_VARIANT) != PylonVariant.GAIA) { if(!world.isRemote) - player.addChatMessage(new TextComponentTranslation("botaniamisc.needsCatalysts").setStyle(new Style().setColor(TextFormatting.RED))); + player.sendMessage(new TextComponentTranslation("botaniamisc.needsCatalysts").setStyle(new Style().setColor(TextFormatting.RED))); return false; } } @@ -196,7 +196,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { PacketHandler.sendTo((EntityPlayerMP) player, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ARENA_INDICATOR, pos.getX(), pos.getY(), pos.getZ())); - player.addChatMessage(new TextComponentTranslation("botaniamisc.badArena").setStyle(new Style().setColor(TextFormatting.RED))); + player.sendMessage(new TextComponentTranslation("botaniamisc.badArena").setStyle(new Style().setColor(TextFormatting.RED))); } return false; @@ -226,7 +226,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { e.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.ARMOR).setBaseValue(15); e.playSound(SoundEvents.ENTITY_ENDERDRAGON_GROWL, 10F, 0.1F); - world.spawnEntityInWorld(e); + world.spawnEntity(e); return true; } @@ -429,8 +429,8 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { ((EntityPlayer) entitylivingbase).addStat(ModAchievements.gaiaGuardianNoArmor, 1); } - playSound(SoundEvents.ENTITY_GENERIC_EXPLODE, 20F, (1F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.2F) * 0.7F); - worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, posX, posY, posZ, 1D, 0D, 0D); + playSound(SoundEvents.ENTITY_GENERIC_EXPLODE, 20F, (1F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F); + world.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, posX, posY, posZ, 1D, 0D, 0D); } @Override @@ -469,7 +469,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { // Generate loot table for every single attacking player for (UUID u : playersWhoAttacked) { - EntityPlayer player = worldObj.getPlayerEntityByUUID(u); + EntityPlayer player = world.getPlayerEntityByUUID(u); if (player == null) continue; @@ -496,7 +496,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { public void setDead() { Botania.proxy.removeBoss(this); BlockPos source = getSource(); - Botania.proxy.playRecordClientSided(worldObj, source, null); + Botania.proxy.playRecordClientSided(world, source, null); isPlayingMusic = false; super.setDead(); } @@ -504,12 +504,12 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { private List getPlayersAround() { BlockPos source = getSource(); float range = 15F; - return worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(source.getX() + 0.5 - range, source.getY() + 0.5 - range, source.getZ() + 0.5 - range, source.getX() + 0.5 + range, source.getY() + 0.5 + range, source.getZ() + 0.5 + range)); + return world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(source.getX() + 0.5 - range, source.getY() + 0.5 - range, source.getZ() + 0.5 - range, source.getX() + 0.5 + range, source.getY() + 0.5 + range, source.getZ() + 0.5 + range)); } - private static int getGaiaGuardiansAround(World worldObj, BlockPos source) { + private static int getGaiaGuardiansAround(World world, BlockPos source) { float range = 15F; - List l = worldObj.getEntitiesWithinAABB(EntityDoppleganger.class, new AxisAlignedBB(source.getX() + 0.5 - range, source.getY() + 0.5 - range, source.getZ() + 0.5 - range, source.getX() + 0.5 + range, source.getY() + 0.5 + range, source.getZ() + 0.5 + range)); + List l = world.getEntitiesWithinAABB(EntityDoppleganger.class, new AxisAlignedBB(source.getX() + 0.5 - range, source.getY() + 0.5 - range, source.getZ() + 0.5 - range, source.getX() + 0.5 + range, source.getY() + 0.5 + range, source.getZ() + 0.5 + range)); return l.size(); } @@ -521,7 +521,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { float range = ARENA_RANGE; int invul = getInvulTime(); - if (worldObj.isRemote) { + if (world.isRemote) { for(int i = 0; i < 360; i += 8) { float r = 0.6F; float g = 0F; @@ -537,8 +537,8 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { Botania.proxy.wispFX(x, y, z, r, g, b, 0.5F, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * mv, (float) (Math.random() - 0.5F) * m); } - if(worldObj.isRemote && !isPlayingMusic && !isDead && !getPlayersAround().isEmpty()) { - Botania.proxy.playRecordClientSided(worldObj, source, (ItemRecord) (isHardMode() ? ModItems.recordGaia2 : ModItems.recordGaia1)); + if(world.isRemote && !isPlayingMusic && !isDead && !getPlayersAround().isEmpty()) { + Botania.proxy.playRecordClientSided(world, source, (ItemRecord) (isHardMode() ? ModItems.recordGaia2 : ModItems.recordGaia1)); isPlayingMusic = true; } @@ -578,13 +578,13 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { if(!getPassengers().isEmpty()) dismountRidingEntity(); - if(worldObj.getDifficulty() == EnumDifficulty.PEACEFUL) + if(world.getDifficulty() == EnumDifficulty.PEACEFUL) setDead(); int radius = 1; - int posXInt = MathHelper.floor_double(posX); - int posYInt = MathHelper.floor_double(posY); - int posZInt = MathHelper.floor_double(posZ); + int posXInt = MathHelper.floor(posX); + int posYInt = MathHelper.floor(posY); + int posZInt = MathHelper.floor(posZ); for(int i = -radius; i < radius + 1; i++) for(int j = -radius; j < radius + 1; j++) for(int k = -radius; k < radius + 1; k++) { @@ -592,8 +592,8 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { int yp = posYInt + j; int zp = posZInt + k; BlockPos posp = new BlockPos(xp, yp, zp); - if(isCheatyBlock(worldObj, posp)) { - worldObj.destroyBlock(posp, true); + if(isCheatyBlock(world, posp)) { + world.destroyBlock(posp, true); } } @@ -601,7 +601,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { List players = getPlayersAround(); int playerCount = getPlayerCount(); - if(players.isEmpty() && !worldObj.playerEntities.isEmpty()) + if(players.isEmpty() && !world.playerEntities.isEmpty()) setDead(); else { for(EntityPlayer player : players) { @@ -620,7 +620,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { potionsToRemove.forEach(potion -> { player.removePotionEffect(potion); - ((WorldServer) worldObj).getPlayerChunkMap().getEntry(posXInt >> 4, posZInt >> 4).sendPacket(new SPacketRemoveEntityEffect(player.getEntityId(), potion)); + ((WorldServer) world).getPlayerChunkMap().getEntry(posXInt >> 4, posZInt >> 4).sendPacket(new SPacketRemoveEntityEffect(player.getEntityId(), potion)); }); player.capabilities.isFlying = player.capabilities.isFlying && player.capabilities.isCreativeMode; @@ -644,7 +644,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { if(invul > 0 && mobSpawnTicks == MOB_SPAWN_TICKS) { if(invul < SPAWN_TICKS) { - if(invul > SPAWN_TICKS / 2 && worldObj.rand.nextInt(SPAWN_TICKS - invul + 1) == 0) + if(invul > SPAWN_TICKS / 2 && world.rand.nextInt(SPAWN_TICKS - invul + 1) == 0) for(int i = 0; i < 2; i++) spawnExplosionParticle(); } @@ -669,32 +669,32 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { if(reverseTicks > MOB_SPAWN_START_TICKS * 2 && mobSpawnTicks > MOB_SPAWN_END_TICKS && mobSpawnTicks % MOB_SPAWN_WAVE_TIME == 0) { for(int pl = 0; pl < playerCount; pl++) - for(int i = 0; i < 3 + worldObj.rand.nextInt(2); i++) { + for(int i = 0; i < 3 + world.rand.nextInt(2); i++) { EntityLiving entity = null; - switch(worldObj.rand.nextInt(2)) { + switch(world.rand.nextInt(2)) { case 0 : { - entity = new EntityZombie(worldObj); - if(worldObj.rand.nextInt(hard ? 3 : 12) == 0) - entity = new EntityWitch(worldObj); + entity = new EntityZombie(world); + if(world.rand.nextInt(hard ? 3 : 12) == 0) + entity = new EntityWitch(world); break; } case 1 : { - entity = new EntitySkeleton(worldObj); + entity = new EntitySkeleton(world); entity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.BOW)); - if(worldObj.rand.nextInt(8) == 0) { - ((EntitySkeleton) entity).func_189768_a(SkeletonType.WITHER); + if(world.rand.nextInt(8) == 0) { + ((EntitySkeleton) entity).setSkeletonType(SkeletonType.WITHER); entity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(hard ? ModItems.elementiumSword : Items.STONE_SWORD)); } break; } case 3 : { if(!players.isEmpty()) - for(int j = 0; j < 1 + worldObj.rand.nextInt(hard ? 8 : 5); j++) { - EntityPixie pixie = new EntityPixie(worldObj); + for(int j = 0; j < 1 + world.rand.nextInt(hard ? 8 : 5); j++) { + EntityPixie pixie = new EntityPixie(world); pixie.setProps(players.get(rand.nextInt(players.size())), this, 1, 8); pixie.setPosition(posX + width / 2, posY + 2, posZ + width / 2); - worldObj.spawnEntityInWorld(pixie); + world.spawnEntity(pixie); } } } @@ -704,7 +704,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { entity.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 600, 0)); range = 6F; entity.setPosition(posX + 0.5 + Math.random() * range - range / 2, posY - 1, posZ + 0.5 + Math.random() * range - range / 2); - worldObj.spawnEntityInWorld(entity); + world.spawnEntity(entity); } } @@ -734,23 +734,23 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { for(int i = 0; i < count; i++) { int x = source.getX() - 10 + rand.nextInt(20); int z = source.getZ() - 10 + rand.nextInt(20); - int y = worldObj.getTopSolidOrLiquidBlock(new BlockPos(x, -1, z)).getY(); + int y = world.getTopSolidOrLiquidBlock(new BlockPos(x, -1, z)).getY(); - EntityMagicLandmine landmine = new EntityMagicLandmine(worldObj); + EntityMagicLandmine landmine = new EntityMagicLandmine(world); landmine.setPosition(x + 0.5, y, z + 0.5); landmine.summoner = this; - worldObj.spawnEntityInWorld(landmine); + world.spawnEntity(landmine); } } if(!players.isEmpty()) for(int pl = 0; pl < playerCount; pl++) - for(int i = 0; i < (spawnPixies ? worldObj.rand.nextInt(hard ? 6 : 3) : 1); i++) { - EntityPixie pixie = new EntityPixie(worldObj); + for(int i = 0; i < (spawnPixies ? world.rand.nextInt(hard ? 6 : 3) : 1); i++) { + EntityPixie pixie = new EntityPixie(world); pixie.setProps(players.get(rand.nextInt(players.size())), this, 1, 8); pixie.setPosition(posX + width / 2, posY + 2, posZ + width / 2); - worldObj.spawnEntityInWorld(pixie); + world.spawnEntity(pixie); } tpDelay = hard ? dying ? 35 : 45 : dying ? 40 : 60; @@ -763,7 +763,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { spawnMissile(); } else { range = 3F; - players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range)); + players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range)); if(!players.isEmpty()) damageEntity(DamageSource.causePlayerDamage(players.get(0)), 0); } @@ -806,7 +806,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { missile.setPosition(posX + (Math.random() - 0.5 * 0.1), posY + 2.4 + (Math.random() - 0.5 * 0.1), posZ + (Math.random() - 0.5 * 0.1)); if(missile.getTarget()) { playSound(BotaniaSoundEvents.missile, 0.6F, 0.8F + (float) Math.random() * 0.2F); - worldObj.spawnEntityInWorld(missile); + world.spawnEntity(missile); } } @@ -835,11 +835,11 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { boolean flag = false; BlockPos pos = new BlockPos(this); - if(worldObj.isBlockLoaded(pos)) { + if(world.isBlockLoaded(pos)) { boolean flag1 = false; while(!flag1 && pos.getY() > 0) { - IBlockState state = worldObj.getBlockState(pos.down()); + IBlockState state = world.getBlockState(pos.down()); Block block = state.getBlock(); if(block.getMaterial(state).blocksMovement()) @@ -853,7 +853,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { if(flag1) { setPosition(posX, posY, posZ); - if(worldObj.getCollisionBoxes(this, getEntityBoundingBox()).isEmpty() && !worldObj.containsAnyLiquid(getEntityBoundingBox())) + if(world.getCollisionBoxes(this, getEntityBoundingBox()).isEmpty() && !world.containsAnyLiquid(getEntityBoundingBox())) flag = true; // Prevent out of bounds teleporting @@ -877,7 +877,7 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { double d7 = d3 + (posX - d3) * d6 + (rand.nextDouble() - 0.5D) * width * 2.0D; double d8 = d4 + (posY - d4) * d6 + rand.nextDouble() * height; double d9 = d5 + (posZ - d5) * d6 + (rand.nextDouble() - 0.5D) * width * 2.0D; - worldObj.spawnParticle(EnumParticleTypes.PORTAL, d7, d8, d9, f, f1, f2); + world.spawnParticle(EnumParticleTypes.PORTAL, d7, d8, d9, f, f1, f2); } playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F); diff --git a/src/main/java/vazkii/botania/common/entity/EntityEnderAirBottle.java b/src/main/java/vazkii/botania/common/entity/EntityEnderAirBottle.java index 88cffdf11..7bbedf264 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityEnderAirBottle.java +++ b/src/main/java/vazkii/botania/common/entity/EntityEnderAirBottle.java @@ -39,14 +39,14 @@ public class EntityEnderAirBottle extends EntityThrowable { @Override protected void onImpact(@Nonnull RayTraceResult pos) { - if(pos.getBlockPos() != null && !worldObj.isRemote) { + if(pos.getBlockPos() != null && !world.isRemote) { List coordsList = getCoordsToPut(pos.getBlockPos()); - worldObj.playEvent(2002, new BlockPos(this), 8); + world.playEvent(2002, new BlockPos(this), 8); for(BlockPos coords : coordsList) { - worldObj.setBlockState(coords, Blocks.END_STONE.getDefaultState()); + world.setBlockState(coords, Blocks.END_STONE.getDefaultState()); if(Math.random() < 0.1) - worldObj.playEvent(2001, coords, Block.getStateId(Blocks.END_STONE.getDefaultState())); + world.playEvent(2001, coords, Block.getStateId(Blocks.END_STONE.getDefaultState())); } setDead(); } @@ -58,9 +58,9 @@ public class EntityEnderAirBottle extends EntityThrowable { int rangeY = 4; for (BlockPos bPos : BlockPos.getAllInBox(pos.add(-range, -rangeY, -range), pos.add(range, rangeY, range))) { - IBlockState state = worldObj.getBlockState(bPos); + IBlockState state = world.getBlockState(bPos); Block block = state.getBlock(); - if(block.isReplaceableOreGen(state, worldObj, bPos, BlockStateMatcher.forBlock(Blocks.STONE))) + if(block.isReplaceableOreGen(state, world, bPos, BlockStateMatcher.forBlock(Blocks.STONE))) possibleCoords.add(bPos); } diff --git a/src/main/java/vazkii/botania/common/entity/EntityFallingStar.java b/src/main/java/vazkii/botania/common/entity/EntityFallingStar.java index 7fe7b9e0e..890ad6767 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityFallingStar.java +++ b/src/main/java/vazkii/botania/common/entity/EntityFallingStar.java @@ -48,9 +48,9 @@ public class EntityFallingStar extends EntityThrowableCopy { } EntityLivingBase thrower = getThrower(); - if(!worldObj.isRemote && thrower != null) { + if(!world.isRemote && thrower != null) { AxisAlignedBB axis = new AxisAlignedBB(posX, posY, posZ, lastTickPosX, lastTickPosY, lastTickPosZ).expand(2, 2, 2); - List entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis); + List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, axis); for(EntityLivingBase living : entities) { if(living == thrower) continue; @@ -68,7 +68,7 @@ public class EntityFallingStar extends EntityThrowableCopy { @Override protected void onImpact(RayTraceResult pos) { - if (worldObj.isRemote) + if (world.isRemote) return; EntityLivingBase thrower = getThrower(); @@ -79,9 +79,9 @@ public class EntityFallingStar extends EntityThrowableCopy { } if (pos.getBlockPos() != null) { - IBlockState state = worldObj.getBlockState(pos.getBlockPos()); - if(ConfigHandler.blockBreakParticles && !state.getBlock().isAir(state, worldObj, pos.getBlockPos())) - worldObj.playEvent(2001, pos.getBlockPos(), Block.getStateId(state)); + IBlockState state = world.getBlockState(pos.getBlockPos()); + if(ConfigHandler.blockBreakParticles && !state.getBlock().isAir(state, world, pos.getBlockPos())) + world.playEvent(2001, pos.getBlockPos(), Block.getStateId(state)); } setDead(); diff --git a/src/main/java/vazkii/botania/common/entity/EntityFlameRing.java b/src/main/java/vazkii/botania/common/entity/EntityFlameRing.java index 9e1fae442..213d0eb9e 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityFlameRing.java +++ b/src/main/java/vazkii/botania/common/entity/EntityFlameRing.java @@ -50,7 +50,7 @@ public class EntityFlameRing extends Entity { if(a % 2 == 0) a = 45 + a; - if(worldObj.rand.nextInt(ticksExisted < 90 ? 8 : 20) == 0) { + if(world.rand.nextInt(ticksExisted < 90 ? 8 : 20) == 0) { float rad = (float) (a * 4 * Math.PI / 180F); double x = Math.cos(rad) * renderRadius; double z = Math.sin(rad) * renderRadius; @@ -65,10 +65,10 @@ public class EntityFlameRing extends Entity { } } - if(worldObj.rand.nextInt(20) == 0) - worldObj.playSound(posX, posY, posZ, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.BLOCKS, 1F, 1F, false); + if(world.rand.nextInt(20) == 0) + world.playSound(posX, posY, posZ, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.BLOCKS, 1F, 1F, false); - if(worldObj.isRemote) + if(world.isRemote) return; if(ticksExisted >= 300) { @@ -78,7 +78,7 @@ public class EntityFlameRing extends Entity { if(ticksExisted > 45) { AxisAlignedBB boundingBox = new AxisAlignedBB(posX, posY, posZ, posX, posY, posZ).expand(radius, radius, radius); - List entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, boundingBox); + List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, boundingBox); if(entities.isEmpty()) return; diff --git a/src/main/java/vazkii/botania/common/entity/EntityMagicLandmine.java b/src/main/java/vazkii/botania/common/entity/EntityMagicLandmine.java index c197c9135..3cc630602 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityMagicLandmine.java +++ b/src/main/java/vazkii/botania/common/entity/EntityMagicLandmine.java @@ -48,20 +48,20 @@ public class EntityMagicLandmine extends Entity { float g = 0F; float b = 0.2F; - //Botania.proxy.wispFX(worldObj, posX, posY, posZ, r, g, b, 0.6F, -0.2F, 1); + //Botania.proxy.wispFX(world, posX, posY, posZ, r, g, b, 0.6F, -0.2F, 1); for(int i = 0; i < 6; i++) Botania.proxy.wispFX(posX - range + Math.random() * range * 2, posY, posZ - range + Math.random() * range * 2, r, g, b, 0.4F, -0.015F, 1); if(ticksExisted >= 55) { - worldObj.playSound(null, posX, posY, posZ, BotaniaSoundEvents.gaiaTrap, SoundCategory.NEUTRAL, 0.3F, 1F); + world.playSound(null, posX, posY, posZ, BotaniaSoundEvents.gaiaTrap, SoundCategory.NEUTRAL, 0.3F, 1F); float m = 0.35F; g = 0.4F; for(int i = 0; i < 25; i++) Botania.proxy.wispFX(posX, posY + 1, posZ, r, g, b, 0.5F, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * m); - if(!worldObj.isRemote) { - List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range)); + if(!world.isRemote) { + List players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range)); for(EntityPlayer player : players) { player.attackEntityFrom(DamageSource.causeIndirectMagicDamage(this, summoner), 10); player.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, 25, 0)); diff --git a/src/main/java/vazkii/botania/common/entity/EntityMagicMissile.java b/src/main/java/vazkii/botania/common/entity/EntityMagicMissile.java index 179c6536d..9ed0b5b43 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityMagicMissile.java +++ b/src/main/java/vazkii/botania/common/entity/EntityMagicMissile.java @@ -52,7 +52,7 @@ public class EntityMagicMissile extends EntityThrowable { } public EntityMagicMissile(EntityLivingBase thrower, boolean evil) { - this(thrower.worldObj); + this(thrower.world); ReflectionHelper.setPrivateValue(EntityThrowable.class, this, thrower, LibObfuscation.THROWER); setEvil(evil); } @@ -77,7 +77,7 @@ public class EntityMagicMissile extends EntityThrowable { public EntityLivingBase getTargetEntity() { int id = dataManager.get(TARGET); - Entity e = worldObj.getEntityByID(id); + Entity e = world.getEntityByID(id); if(e != null && e instanceof EntityLivingBase) return (EntityLivingBase) e; @@ -92,7 +92,7 @@ public class EntityMagicMissile extends EntityThrowable { super.onUpdate(); - if(!worldObj.isRemote && (!getTarget() || time > 40)) { + if(!world.isRemote && (!getTarget() || time > 40)) { setDead(); return; } @@ -108,7 +108,7 @@ public class EntityMagicMissile extends EntityThrowable { Botania.proxy.setSparkleFXCorrupt(evil); for(int i = 0; i < steps; i++) { Botania.proxy.sparkleFX(particlePos.x, particlePos.y, particlePos.z, 1F, evil ? 0F : 0.4F, 1F, 0.8F, 2); - if(worldObj.rand.nextInt(steps) <= 1) + if(world.rand.nextInt(steps) <= 1) Botania.proxy.sparkleFX(particlePos.x + (Math.random() - 0.5) * 0.4, particlePos.y + (Math.random() - 0.5) * 0.4, particlePos.z + (Math.random() - 0.5) * 0.4, 1F, evil ? 0F : 0.4F, 1F, 0.8F, 2); particlePos = particlePos.add(step); @@ -132,7 +132,7 @@ public class EntityMagicMissile extends EntityThrowable { motionY = Math.abs(motionY); motionZ = motionVec.z; - List targetList = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(posX - 0.5, posY - 0.5, posZ - 0.5, posX + 0.5, posY + 0.5, posZ + 0.5)); + List targetList = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(posX - 0.5, posY - 0.5, posZ - 0.5, posX + 0.5, posY + 0.5, posZ + 0.5)); if(targetList.contains(target) && target != null) { EntityLivingBase thrower = getThrower(); if(thrower != null) { @@ -165,15 +165,15 @@ public class EntityMagicMissile extends EntityThrowable { public boolean getTarget() { EntityLivingBase target = getTargetEntity(); - if(target != null && target.getHealth() > 0 && !target.isDead && worldObj.loadedEntityList.contains(target)) + if(target != null && target.getHealth() > 0 && !target.isDead && world.loadedEntityList.contains(target)) return true; if(target != null) setTarget(null); double range = 12; - List entities = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range), Predicates.instanceOf(isEvil() ? EntityPlayer.class : IMob.class)); + List entities = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range), Predicates.instanceOf(isEvil() ? EntityPlayer.class : IMob.class)); while(entities.size() > 0) { - Entity e = (Entity) entities.get(worldObj.rand.nextInt(entities.size())); + Entity e = (Entity) entities.get(world.rand.nextInt(entities.size())); if(!(e instanceof EntityLivingBase) || e.isDead) { // Just in case... entities.remove(e); continue; @@ -191,7 +191,7 @@ public class EntityMagicMissile extends EntityThrowable { protected void onImpact(@Nonnull RayTraceResult pos) { switch (pos.typeOfHit) { case BLOCK: { - Block block = worldObj.getBlockState(pos.getBlockPos()).getBlock(); + Block block = world.getBlockState(pos.getBlockPos()).getBlock(); if(!(block instanceof BlockBush) && !(block instanceof BlockLeaves)) setDead(); break; diff --git a/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java b/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java index b98227293..5af789495 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java +++ b/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java @@ -139,7 +139,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { } public EntityManaBurst(EntityPlayer player) { - this(player.worldObj); + this(player.world); setBurstSourceCoords(new BlockPos(0, -1, 0)); setLocationAndAngles(player.posX, player.posY + player.getEyeHeight(), player.posZ, player.rotationYaw + 180, -player.rotationPitch); @@ -163,7 +163,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { lastTickPosZ = posZ; // super.onUpdate(); Botania - inline supersuperclass's onUpdate { - if (!worldObj.isRemote) + if (!world.isRemote) { setFlag(6, isGlowing()); } @@ -180,7 +180,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { Vec3d vec3d = new Vec3d(posX, posY, posZ); Vec3d vec3d1 = new Vec3d(posX + motionX, posY + motionY, posZ + motionZ); - RayTraceResult raytraceresult = worldObj.rayTraceBlocks(vec3d, vec3d1); + RayTraceResult raytraceresult = world.rayTraceBlocks(vec3d, vec3d1); vec3d = new Vec3d(posX, posY, posZ); vec3d1 = new Vec3d(posX + motionX, posY + motionY, posZ + motionZ); @@ -189,9 +189,9 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { vec3d1 = new Vec3d(raytraceresult.hitVec.xCoord, raytraceresult.hitVec.yCoord, raytraceresult.hitVec.zCoord); } - if(!worldObj.isRemote) { // Botania - only do entity colliding on server + if(!world.isRemote) { // Botania - only do entity colliding on server Entity entity = null; - List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().addCoord(motionX, motionY, motionZ).expandXyz(1.0D)); + List list = world.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().addCoord(motionX, motionY, motionZ).expandXyz(1.0D)); double d0 = 0.0D; for (int i = 0; i < list.size(); ++i) { @@ -245,7 +245,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { if (raytraceresult != null) { - if (raytraceresult.typeOfHit == RayTraceResult.Type.BLOCK && worldObj.getBlockState(raytraceresult.getBlockPos()).getBlock() == Blocks.PORTAL) + if (raytraceresult.typeOfHit == RayTraceResult.Type.BLOCK && world.getBlockState(raytraceresult.getBlockPos()).getBlock() == Blocks.PORTAL) { setPortal(raytraceresult.getBlockPos()); } @@ -258,7 +258,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { posX += motionX; posY += motionY; posZ += motionZ; - float f = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); + float f = MathHelper.sqrt(motionX * motionX + motionZ * motionZ); rotationYaw = (float)(MathHelper.atan2(motionX, motionZ) * (180D / Math.PI)); for (rotationPitch = (float)(MathHelper.atan2(motionY, f) * (180D / Math.PI)); rotationPitch - prevRotationPitch < -180.0F; prevRotationPitch -= 360.0F) @@ -290,7 +290,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { for (int j = 0; j < 4; ++j) { float f3 = 0.25F; - worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, posX - motionX * f3, posY - motionY * f3, posZ - motionZ * f3, motionX, motionY, motionZ, new int[0]); + world.spawnParticle(EnumParticleTypes.WATER_BUBBLE, posX - motionX * f3, posY - motionY * f3, posZ - motionZ * f3, motionX, motionY, motionZ, new int[0]); } } @@ -445,7 +445,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { } public void particles() { - if(isDead || !worldObj.isRemote) + if(isDead || !world.isRemote) return; ILensEffect lens = getLensInstance(); @@ -532,11 +532,11 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { boolean dead = false; if(rtr.entityHit == null) { - TileEntity tile = worldObj.getTileEntity(rtr.getBlockPos()); - IBlockState state = worldObj.getBlockState(rtr.getBlockPos()); + TileEntity tile = world.getTileEntity(rtr.getBlockPos()); + IBlockState state = world.getBlockState(rtr.getBlockPos()); Block block = state.getBlock(); - if(block instanceof IManaCollisionGhost && ((IManaCollisionGhost) block).isGhost(state, worldObj, rtr.getBlockPos()) && !(block instanceof IManaTrigger) || block instanceof BlockBush || block instanceof BlockLeaves) + if(block instanceof IManaCollisionGhost && ((IManaCollisionGhost) block).isGhost(state, world, rtr.getBlockPos()) && !(block instanceof IManaTrigger) || block instanceof BlockBush || block instanceof BlockLeaves) return; if(BotaniaAPI.internalHandler.isBuildcraftPipe(tile)) @@ -547,11 +547,11 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { collidedTile = tile; if(tile == null || !tile.getPos().equals(coords)) { - if(!fake && !noParticles && (!worldObj.isRemote || tile instanceof IClientManaHandler) && tile != null && tile instanceof IManaReceiver && ((IManaReceiver) tile).canRecieveManaFromBursts()) + if(!fake && !noParticles && (!world.isRemote || tile instanceof IClientManaHandler) && tile != null && tile instanceof IManaReceiver && ((IManaReceiver) tile).canRecieveManaFromBursts()) onRecieverImpact((IManaReceiver) tile, tile.getPos()); if(block instanceof IManaTrigger) - ((IManaTrigger) block).onBurstCollision(this, worldObj, rtr.getBlockPos()); + ((IManaTrigger) block).onBurstCollision(this, world, rtr.getBlockPos()); boolean ghost = block instanceof IManaCollisionGhost; dead = !ghost; @@ -606,7 +606,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { if(tile instanceof IThrottledPacket) ((IThrottledPacket) tile).markDispatchable(); - else VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos); + else VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } @Override @@ -621,7 +621,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { } private TileEntity getShooter() { - return worldObj.getTileEntity(getBurstSourceBlockPos()); + return world.getTileEntity(getBurstSourceBlockPos()); } @Override @@ -801,7 +801,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { private void setDeathTicksForFakeParticle() { BlockPos coords = getBurstSourceBlockPos(); - TileEntity tile = worldObj.getTileEntity(coords); + TileEntity tile = world.getTileEntity(coords); if(tile != null && tile instanceof IManaSpreader) ((IManaSpreader) tile).setLastBurstDeathTick(getTicksExisted()); } @@ -814,11 +814,11 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { public boolean invalid = false; public PositionProperties(Entity entity) { - int x = MathHelper.floor_double(entity.posX); - int y = MathHelper.floor_double(entity.posY); - int z = MathHelper.floor_double(entity.posZ); + int x = MathHelper.floor(entity.posX); + int y = MathHelper.floor(entity.posY); + int z = MathHelper.floor(entity.posZ); coords = new BlockPos(x, y, z); - state = entity.worldObj.getBlockState(coords); + state = entity.world.getBlockState(coords); } public boolean coordsEqual(PositionProperties props) { diff --git a/src/main/java/vazkii/botania/common/entity/EntityManaStorm.java b/src/main/java/vazkii/botania/common/entity/EntityManaStorm.java index a98efc94a..8f5e829ee 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityManaStorm.java +++ b/src/main/java/vazkii/botania/common/entity/EntityManaStorm.java @@ -47,7 +47,7 @@ public class EntityManaStorm extends Entity { int diffTime = Math.max(1, 30 - (int) (liveTime / 45f)); if(burstsFired < TOTAL_BURSTS && liveTime % diffTime == 0) { - if(!worldObj.isRemote) + if(!world.isRemote) spawnBurst(); burstsFired++; } @@ -56,13 +56,13 @@ public class EntityManaStorm extends Entity { deathTime++; if(deathTime >= DEATH_TIME) { setDead(); - worldObj.newExplosion(this, posX, posY, posZ, 8F, true, true); + world.newExplosion(this, posX, posY, posZ, 8F, true, true); } } } private void spawnBurst() { - EntityManaBurst burst = new EntityManaBurst(worldObj); + EntityManaBurst burst = new EntityManaBurst(world); burst.setPosition(posX, posY, posZ); float motionModifier = 0.5F; @@ -78,7 +78,7 @@ public class EntityManaStorm extends Entity { Vector3 motion = new Vector3(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5).normalize().multiply(motionModifier); burst.setMotion(motion.x, motion.y, motion.z); - worldObj.spawnEntityInWorld(burst); + world.spawnEntity(burst); } @Override diff --git a/src/main/java/vazkii/botania/common/entity/EntityPinkWither.java b/src/main/java/vazkii/botania/common/entity/EntityPinkWither.java index 66b1624d6..9f1c0a61e 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityPinkWither.java +++ b/src/main/java/vazkii/botania/common/entity/EntityPinkWither.java @@ -44,7 +44,7 @@ public class EntityPinkWither extends EntityWither { double d10 = func_82214_u(j); double d2 = func_82208_v(j); double d4 = func_82213_w(j); - worldObj.spawnParticle(EnumParticleTypes.HEART, d10 + rand.nextGaussian() * 0.30000001192092896D, d2 + rand.nextGaussian() * 0.30000001192092896D, d4 + rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D); + world.spawnParticle(EnumParticleTypes.HEART, d10 + rand.nextGaussian() * 0.30000001192092896D, d2 + rand.nextGaussian() * 0.30000001192092896D, d4 + rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D); } } diff --git a/src/main/java/vazkii/botania/common/entity/EntityPixie.java b/src/main/java/vazkii/botania/common/entity/EntityPixie.java index 405c201cf..192636eaa 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityPixie.java +++ b/src/main/java/vazkii/botania/common/entity/EntityPixie.java @@ -113,19 +113,19 @@ public class EntityPixie extends EntityFlying { public void onEntityUpdate() { super.onEntityUpdate(); - if(!worldObj.isRemote + if(!world.isRemote && (getAttackTarget() == null || ticksExisted > 200)) setDead(); boolean dark = getType() == 1; - if(worldObj.isRemote) + if(world.isRemote) for(int i = 0; i < 4; i++) Botania.proxy.sparkleFX(posX + (Math.random() - 0.5) * 0.25, posY + 0.5 + (Math.random() - 0.5) * 0.25, posZ + (Math.random() - 0.5) * 0.25, dark ? 0.1F : 1F, dark ? 0.025F : 0.25F, dark ? 0.09F : 0.9F, 0.1F + (float) Math.random() * 0.25F, 12); } @Override public void setDead() { - if(worldObj != null && worldObj.isRemote && getType() == 0) + if(world != null && world.isRemote && getType() == 0) for(int i = 0; i < 12; i++) Botania.proxy.sparkleFX(posX + (Math.random() - 0.5) * 0.25, posY + 0.5 + (Math.random() - 0.5) * 0.25, posZ + (Math.random() - 0.5) * 0.25, 1F, 0.25F, 0.9F, 1F + (float) Math.random() * 0.25F, 5); super.setDead(); diff --git a/src/main/java/vazkii/botania/common/entity/EntityPoolMinecart.java b/src/main/java/vazkii/botania/common/entity/EntityPoolMinecart.java index a6e9026c5..19aa383cf 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityPoolMinecart.java +++ b/src/main/java/vazkii/botania/common/entity/EntityPoolMinecart.java @@ -114,12 +114,12 @@ public class EntityPoolMinecart extends EntityMinecart { public void onUpdate() { super.onUpdate(); - if(worldObj.isRemote) { + if(world.isRemote) { double particleChance = 1F - (double) getMana() / (double) TilePool.MAX_MANA * 0.1; Color color = TilePool.PARTICLE_COLOR; - double x = MathHelper.floor_double(posX); - double y = MathHelper.floor_double(posY); - double z = MathHelper.floor_double(posZ); + double x = MathHelper.floor(posX); + double y = MathHelper.floor(posY); + double z = MathHelper.floor(posZ); if(Math.random() > particleChance) Botania.proxy.wispFX(x + 0.3 + Math.random() * 0.5, y + 0.85 + Math.random() * 0.25, z + Math.random(), color.getRed(), color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random() / 3F, (float) -Math.random() / 25F, 2F); } @@ -131,16 +131,16 @@ public class EntityPoolMinecart extends EntityMinecart { for(EnumFacing dir : EnumFacing.HORIZONTALS) { BlockPos posP = pos.offset(dir); - Block block = worldObj.getBlockState(posP).getBlock(); + Block block = world.getBlockState(posP).getBlock(); if(block == ModBlocks.pump) { BlockPos posP_ = posP.offset(dir); - TileEntity tile = worldObj.getTileEntity(posP_); - TileEntity tile_ = worldObj.getTileEntity(posP); + TileEntity tile = world.getTileEntity(posP_); + TileEntity tile_ = world.getTileEntity(posP); TilePump pump = (TilePump) tile_; if(tile != null && tile instanceof IManaPool) { IManaPool pool = (IManaPool) tile; - EnumFacing pumpDir = worldObj.getBlockState(posP).getValue(BotaniaStateProps.CARDINALS); + EnumFacing pumpDir = world.getBlockState(posP).getValue(BotaniaStateProps.CARDINALS); boolean did = false; boolean can = false; @@ -173,7 +173,7 @@ public class EntityPoolMinecart extends EntityMinecart { } if(did) { - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, posP_); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, posP_); pump.hasCart = true; if(!pump.active) pump.setActive(true); diff --git a/src/main/java/vazkii/botania/common/entity/EntitySpark.java b/src/main/java/vazkii/botania/common/entity/EntitySpark.java index b46a0bf01..28eccc5a5 100644 --- a/src/main/java/vazkii/botania/common/entity/EntitySpark.java +++ b/src/main/java/vazkii/botania/common/entity/EntitySpark.java @@ -84,7 +84,7 @@ public class EntitySpark extends Entity implements ISparkEntity { public void onUpdate() { super.onUpdate(); - if(worldObj.isRemote) + if(world.isRemote) return; ISparkAttachable tile = getAttachedTile(); @@ -96,13 +96,13 @@ public class EntitySpark extends Entity implements ISparkEntity { SparkUpgradeType upgrade = getUpgrade(); List allSparks = null; if(upgrade == SparkUpgradeType.DOMINANT || upgrade == SparkUpgradeType.RECESSIVE) - allSparks = SparkHelper.getSparksAround(worldObj, posX, posY, posZ); + allSparks = SparkHelper.getSparksAround(world, posX, posY, posZ); Collection transfers = getTransfers(); switch(upgrade) { case DISPERSIVE : { - List players = SparkHelper.getEntitiesAround(EntityPlayer.class, worldObj, posX, posY, posZ); + List players = SparkHelper.getEntitiesAround(EntityPlayer.class, world, posX, posY, posZ); Map> receivingPlayers = new HashMap<>(); @@ -168,7 +168,7 @@ public class EntitySpark extends Entity implements ISparkEntity { validSparks.add(spark); } if(validSparks.size() > 0) - validSparks.get(worldObj.rand.nextInt(validSparks.size())).registerTransfer(this); + validSparks.get(world.rand.nextInt(validSparks.size())).registerTransfer(this); break; } @@ -216,13 +216,13 @@ public class EntitySpark extends Entity implements ISparkEntity { } private void particlesTowards(Entity e) { - PacketHandler.sendToNearby(worldObj, this, + PacketHandler.sendToNearby(world, this, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.SPARK_MANA_FLOW, posX, posY, posZ, getEntityId(), e.getEntityId())); } public static void particleBeam(EntityPlayer player, Entity e1, Entity e2) { - if(e1 != null && e2 != null && !e1.worldObj.isRemote) { + if(e1 != null && e2 != null && !e1.world.isRemote) { PacketHandler.sendTo((EntityPlayerMP) player, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.SPARK_NET_INDICATOR, e1.posX, e1.posY, e1.posZ, e1.getEntityId(), e2.getEntityId())); @@ -245,7 +245,7 @@ public class EntitySpark extends Entity implements ISparkEntity { @Override public boolean processInitialInteract(EntityPlayer player, ItemStack stack, EnumHand hand) { if(stack != null) { - if(worldObj.isRemote) + if(world.isRemote) return stack.getItem() == ModItems.twigWand || stack.getItem() == ModItems.sparkUpgrade || stack.getItem() == ModItems.phantomInk; @@ -262,7 +262,7 @@ public class EntitySpark extends Entity implements ISparkEntity { player.swingArm(hand); return true; } else { - List allSparks = SparkHelper.getSparksAround(worldObj, posX, posY, posZ); + List allSparks = SparkHelper.getSparksAround(world, posX, posY, posZ); for(ISparkEntity spark : allSparks) particleBeam(player, this, (Entity) spark); return true; @@ -297,10 +297,10 @@ public class EntitySpark extends Entity implements ISparkEntity { @Override public ISparkAttachable getAttachedTile() { - int x = MathHelper.floor_double(posX); - int y = MathHelper.floor_double(posY) - 1; - int z = MathHelper.floor_double(posZ); - TileEntity tile = worldObj.getTileEntity(new BlockPos(x, y, z)); + int x = MathHelper.floor(posX); + int y = MathHelper.floor(posY) - 1; + int z = MathHelper.floor(posZ); + TileEntity tile = world.getTileEntity(new BlockPos(x, y, z)); if(tile != null && tile instanceof ISparkAttachable) return (ISparkAttachable) tile; diff --git a/src/main/java/vazkii/botania/common/entity/EntityThornChakram.java b/src/main/java/vazkii/botania/common/entity/EntityThornChakram.java index bd1c0fbf0..20976d0e4 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityThornChakram.java +++ b/src/main/java/vazkii/botania/common/entity/EntityThornChakram.java @@ -91,15 +91,15 @@ public class EntityThornChakram extends EntityThrowable { } // Client FX - if(worldObj.isRemote && isFire()) { + if(world.isRemote && isFire()) { double r = 0.1; double m = 0.1; for(int i = 0; i < 3; i++) - worldObj.spawnParticle(EnumParticleTypes.FLAME, posX + r * (Math.random() - 0.5), posY + r * (Math.random() - 0.5), posZ + r * (Math.random() - 0.5), m * (Math.random() - 0.5), m * (Math.random() - 0.5), m * (Math.random() - 0.5)); + world.spawnParticle(EnumParticleTypes.FLAME, posX + r * (Math.random() - 0.5), posY + r * (Math.random() - 0.5), posZ + r * (Math.random() - 0.5), m * (Math.random() - 0.5), m * (Math.random() - 0.5), m * (Math.random() - 0.5)); } // Server state control - if(!worldObj.isRemote && (getTimesBounced() >= MAX_BOUNCES || ticksExisted > 60)) { + if(!world.isRemote && (getTimesBounced() >= MAX_BOUNCES || ticksExisted > 60)) { EntityLivingBase thrower = getThrower(); if(thrower == null) { dropAndKill(); @@ -113,8 +113,8 @@ public class EntityThornChakram extends EntityThrowable { private void dropAndKill() { ItemStack stack = getItemStack(); - EntityItem item = new EntityItem(worldObj, posX, posY, posZ, stack); - worldObj.spawnEntityInWorld(item); + EntityItem item = new EntityItem(world, posX, posY, posZ, stack); + world.spawnEntity(item); setDead(); } @@ -129,7 +129,7 @@ public class EntityThornChakram extends EntityThrowable { switch (pos.typeOfHit) { case BLOCK: { - Block block = worldObj.getBlockState(pos.getBlockPos()).getBlock(); + Block block = world.getBlockState(pos.getBlockPos()).getBlock(); if(block instanceof BlockBush || block instanceof BlockLeaves) return; @@ -145,19 +145,19 @@ public class EntityThornChakram extends EntityThrowable { motionZ = movementVec.z; bounced = true; - if(!worldObj.isRemote) + if(!world.isRemote) setTimesBounced(getTimesBounced() + 1); } break; } case ENTITY: { - if(!worldObj.isRemote && pos.entityHit != null && pos.entityHit instanceof EntityLivingBase && pos.entityHit != getThrower()) { + if(!world.isRemote && pos.entityHit != null && pos.entityHit instanceof EntityLivingBase && pos.entityHit != getThrower()) { EntityLivingBase thrower = getThrower(); pos.entityHit.attackEntityFrom(thrower != null ? thrower instanceof EntityPlayer ? DamageSource.causeThrownDamage(this, thrower) : DamageSource.causeMobDamage(thrower) : DamageSource.generic, 12); if(isFire()) pos.entityHit.setFire(5); - else if(worldObj.rand.nextInt(3) == 0) + else if(world.rand.nextInt(3) == 0) ((EntityLivingBase) pos.entityHit).addPotionEffect(new PotionEffect(MobEffects.POISON, 60, 0)); } diff --git a/src/main/java/vazkii/botania/common/entity/EntityThrowableCopy.java b/src/main/java/vazkii/botania/common/entity/EntityThrowableCopy.java index fc6b9a174..47e07edd0 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityThrowableCopy.java +++ b/src/main/java/vazkii/botania/common/entity/EntityThrowableCopy.java @@ -118,7 +118,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile @Override public void setThrowableHeading(double x, double y, double z, float velocity, float inaccuracy) { - float f = MathHelper.sqrt_double(x * x + y * y + z * z); + float f = MathHelper.sqrt(x * x + y * y + z * z); x = x / f; y = y / f; z = z / f; @@ -131,7 +131,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile motionX = x; motionY = y; motionZ = z; - float f1 = MathHelper.sqrt_double(x * x + z * z); + float f1 = MathHelper.sqrt(x * x + z * z); prevRotationYaw = rotationYaw = (float)(MathHelper.atan2(x, z) * (180D / Math.PI)); prevRotationPitch = rotationPitch = (float)(MathHelper.atan2(y, f1) * (180D / Math.PI)); ticksInGround = 0; @@ -150,7 +150,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F) { - float f = MathHelper.sqrt_double(x * x + z * z); + float f = MathHelper.sqrt(x * x + z * z); prevRotationYaw = rotationYaw = (float)(MathHelper.atan2(x, z) * (180D / Math.PI)); prevRotationPitch = rotationPitch = (float)(MathHelper.atan2(y, f) * (180D / Math.PI)); } @@ -174,7 +174,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile if (inGround) { - if (worldObj.getBlockState(new BlockPos(xTile, yTile, zTile)).getBlock() == inTile) + if (world.getBlockState(new BlockPos(xTile, yTile, zTile)).getBlock() == inTile) { ++ticksInGround; @@ -198,7 +198,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile Vec3d vec3d = new Vec3d(posX, posY, posZ); Vec3d vec3d1 = new Vec3d(posX + motionX, posY + motionY, posZ + motionZ); - RayTraceResult raytraceresult = worldObj.rayTraceBlocks(vec3d, vec3d1); + RayTraceResult raytraceresult = world.rayTraceBlocks(vec3d, vec3d1); vec3d = new Vec3d(posX, posY, posZ); vec3d1 = new Vec3d(posX + motionX, posY + motionY, posZ + motionZ); @@ -208,7 +208,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile } Entity entity = null; - List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().addCoord(motionX, motionY, motionZ).expandXyz(1.0D)); + List list = world.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().addCoord(motionX, motionY, motionZ).expandXyz(1.0D)); double d0 = 0.0D; boolean flag = false; @@ -266,7 +266,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile if (raytraceresult != null) { - if (raytraceresult.typeOfHit == RayTraceResult.Type.BLOCK && worldObj.getBlockState(raytraceresult.getBlockPos()).getBlock() == Blocks.PORTAL) + if (raytraceresult.typeOfHit == RayTraceResult.Type.BLOCK && world.getBlockState(raytraceresult.getBlockPos()).getBlock() == Blocks.PORTAL) { setPortal(raytraceresult.getBlockPos()); } @@ -279,7 +279,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile posX += motionX; posY += motionY; posZ += motionZ; - float f = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); + float f = MathHelper.sqrt(motionX * motionX + motionZ * motionZ); rotationYaw = (float)(MathHelper.atan2(motionX, motionZ) * (180D / Math.PI)); for (rotationPitch = (float)(MathHelper.atan2(motionY, f) * (180D / Math.PI)); rotationPitch - prevRotationPitch < -180.0F; prevRotationPitch -= 360.0F) @@ -312,7 +312,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile for (int j = 0; j < 4; ++j) { float f3 = 0.25F; - worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, posX - motionX * f3, posY - motionY * f3, posZ - motionZ * f3, motionX, motionY, motionZ); + world.spawnParticle(EnumParticleTypes.WATER_BUBBLE, posX - motionX * f3, posY - motionY * f3, posZ - motionZ * f3, motionX, motionY, motionZ); } f1 = 0.8F; @@ -396,13 +396,13 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile { if (thrower == null && throwerName != null && !throwerName.isEmpty()) { - thrower = worldObj.getPlayerEntityByName(throwerName); + thrower = world.getPlayerEntityByName(throwerName); - if (thrower == null && worldObj instanceof WorldServer) + if (thrower == null && world instanceof WorldServer) { try { - Entity entity = ((WorldServer)worldObj).getEntityFromUuid(UUID.fromString(throwerName)); + Entity entity = ((WorldServer)world).getEntityFromUuid(UUID.fromString(throwerName)); if (entity instanceof EntityLivingBase) { diff --git a/src/main/java/vazkii/botania/common/entity/EntityThrownItem.java b/src/main/java/vazkii/botania/common/entity/EntityThrownItem.java index 7247d112e..3e557ec17 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityThrownItem.java +++ b/src/main/java/vazkii/botania/common/entity/EntityThrownItem.java @@ -58,13 +58,13 @@ public class EntityThrownItem extends EntityItem { Vec3d vec3 = new Vec3d(posX, posY, posZ); Vec3d vec31 = new Vec3d(posX + motionX, posY + motionY, posZ + motionZ); - RayTraceResult RayTraceResult = worldObj.rayTraceBlocks(vec3, vec31); + RayTraceResult RayTraceResult = world.rayTraceBlocks(vec3, vec31); - if (!worldObj.isRemote) + if (!world.isRemote) { Entity entity = null; - List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().addCoord(motionX*2, motionY*2, motionZ*2).expand(2.0D, 2.0D, 2.0D)); + List list = world.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().addCoord(motionX*2, motionY*2, motionZ*2).expand(2.0D, 2.0D, 2.0D)); double d0 = 0.0D; for (Entity entity1 : list) { @@ -99,7 +99,7 @@ public class EntityThrownItem extends EntityItem { if (RayTraceResult != null) { - if (RayTraceResult.typeOfHit == net.minecraft.util.math.RayTraceResult.Type.BLOCK && worldObj.getBlockState(RayTraceResult.getBlockPos()).getBlock() == Blocks.PORTAL) + if (RayTraceResult.typeOfHit == net.minecraft.util.math.RayTraceResult.Type.BLOCK && world.getBlockState(RayTraceResult.getBlockPos()).getBlock() == Blocks.PORTAL) { setPortal(RayTraceResult.getBlockPos()); } @@ -107,11 +107,11 @@ public class EntityThrownItem extends EntityItem { { if (RayTraceResult.entityHit != null) { RayTraceResult.entityHit.attackEntityFrom(DamageSource.magic, 2.0F); - if (!worldObj.isRemote) { - Entity item = getEntityItem().getItem().createEntity(worldObj, this, getEntityItem()); + if (!world.isRemote) { + Entity item = getEntityItem().getItem().createEntity(world, this, getEntityItem()); if (item == null) { - item = new EntityItem(worldObj, posX, posY, posZ, getEntityItem()); - worldObj.spawnEntityInWorld(item); + item = new EntityItem(world, posX, posY, posZ, getEntityItem()); + world.spawnEntity(item); item.motionX = motionX*0.25F; item.motionY = motionY*0.25F; item.motionZ = motionZ*0.25F; @@ -132,11 +132,11 @@ public class EntityThrownItem extends EntityItem { Vector3 vec3m = new Vector3(motionX, motionY, motionZ); if (vec3m.mag() < 1.0F) { - if (!worldObj.isRemote) { - Entity item = getEntityItem().getItem().createEntity(worldObj, this, getEntityItem()); + if (!world.isRemote) { + Entity item = getEntityItem().getItem().createEntity(world, this, getEntityItem()); if (item == null) { - item = new EntityItem(worldObj, posX, posY, posZ, getEntityItem()); - worldObj.spawnEntityInWorld(item); + item = new EntityItem(world, posX, posY, posZ, getEntityItem()); + world.spawnEntity(item); item.motionX = motionX; item.motionY = motionY; item.motionZ = motionZ; diff --git a/src/main/java/vazkii/botania/common/entity/EntityVineBall.java b/src/main/java/vazkii/botania/common/entity/EntityVineBall.java index a2360ee14..4ba3a7669 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityVineBall.java +++ b/src/main/java/vazkii/botania/common/entity/EntityVineBall.java @@ -45,7 +45,7 @@ public class EntityVineBall extends EntityThrowable { } public EntityVineBall(EntityLivingBase thrower, boolean gravity) { - super(thrower.worldObj, thrower); + super(thrower.world, thrower); dataManager.set(GRAVITY, gravity ? 0.03F : 0F); } @@ -58,9 +58,9 @@ public class EntityVineBall extends EntityThrowable { @Override protected void onImpact(@Nonnull RayTraceResult var1) { - if(worldObj.isRemote) { + if(world.isRemote) { for(int j = 0; j < 16; j++) { - worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, posX, posY, posZ, Math.random() * 0.2 - 0.1, Math.random() * 0.25, Math.random() * 0.2 - 0.1, Item.getIdFromItem(ModItems.vineBall)); + world.spawnParticle(EnumParticleTypes.ITEM_CRACK, posX, posY, posZ, Math.random() * 0.2 - 0.1, Math.random() * 0.25, Math.random() * 0.2 - 0.1, Item.getIdFromItem(ModItems.vineBall)); } } else { if(var1 != null) { @@ -69,12 +69,12 @@ public class EntityVineBall extends EntityThrowable { if(dir != null && dir.getAxis() != EnumFacing.Axis.Y) { BlockPos pos = var1.getBlockPos().offset(dir); while(pos.getY() > 0) { - IBlockState state = worldObj.getBlockState(pos); + IBlockState state = world.getBlockState(pos); Block block = state.getBlock(); - if(block.isAir(state, worldObj, pos)) { + if(block.isAir(state, world, pos)) { IBlockState stateSet = ModBlocks.solidVines.getDefaultState().withProperty(propMap.get(dir.getOpposite()), true); - worldObj.setBlockState(pos, stateSet, 1 | 2); - worldObj.playEvent(2001, pos, Block.getStateId(stateSet)); + world.setBlockState(pos, stateSet, 1 | 2); + world.playEvent(2001, pos, Block.getStateId(stateSet)); pos = pos.down(); } else break; } diff --git a/src/main/java/vazkii/botania/common/item/ItemAstrolabe.java b/src/main/java/vazkii/botania/common/item/ItemAstrolabe.java index 72cac5d51..25be38322 100644 --- a/src/main/java/vazkii/botania/common/item/ItemAstrolabe.java +++ b/src/main/java/vazkii/botania/common/item/ItemAstrolabe.java @@ -117,8 +117,8 @@ public class ItemAstrolabe extends ItemMod { Block block = Block.getBlockFromItem(blockToPlace.getItem()); int meta = blockToPlace.getItemDamage(); IBlockState state = block.getStateFromMeta(meta); - player.worldObj.setBlockState(coords, state, 1 | 2); - player.worldObj.playEvent(2001, coords, Block.getStateId(state)); + player.world.setBlockState(coords, state, 1 | 2); + player.world.playEvent(2001, coords, Block.getStateId(state)); if(player.capabilities.isCreativeMode) return; @@ -187,15 +187,15 @@ public class ItemAstrolabe extends ItemMod { public static BlockPos[] getBlocksToPlace(ItemStack stack, EntityPlayer player) { List coords = new ArrayList(); - RayTraceResult pos = ToolCommons.raytraceFromEntity(player.worldObj, player, true, 5); + RayTraceResult pos = ToolCommons.raytraceFromEntity(player.world, player, true, 5); if(pos != null) { BlockPos bpos = pos.getBlockPos(); - IBlockState state = player.worldObj.getBlockState(bpos); + IBlockState state = player.world.getBlockState(bpos); Block block = state.getBlock(); - if(block != null && block.isReplaceable(player.worldObj, bpos)) + if(block != null && block.isReplaceable(player.world, bpos)) bpos = bpos.down();; - int rotation = MathHelper.floor_double(player.rotationYaw * 4F / 360F + 0.5D) & 3; + int rotation = MathHelper.floor(player.rotationYaw * 4F / 360F + 0.5D) & 3; int range = (getSize(stack) ^ 1) / 2; EnumFacing dir = pos.sideHit; @@ -220,9 +220,9 @@ public class ItemAstrolabe extends ItemMod { int zp = bpos.getZ() + z + dir.getFrontOffsetZ(); BlockPos newPos = new BlockPos(xp, yp, zp); - IBlockState state1 = player.worldObj.getBlockState(newPos); + IBlockState state1 = player.world.getBlockState(newPos); Block block1 = state1.getBlock(); - if(block1 == null || block1.isAir(state1, player.worldObj, newPos) || block1.isReplaceable(player.worldObj, newPos)) + if(block1 == null || block1.isAir(state1, player.world, newPos) || block1.isReplaceable(player.world, newPos)) coords.add(new BlockPos(xp, yp, zp)); } } @@ -237,7 +237,7 @@ public class ItemAstrolabe extends ItemMod { Block block = getBlock(stack); int meta = getBlockMeta(stack); int count = ItemExchangeRod.getInventoryItemCount(player, stack, block, meta); - if(!player.worldObj.isRemote) + if(!player.world.isRemote) ItemsRemainingRenderHandler.set(new ItemStack(block, 1, meta), count); } diff --git a/src/main/java/vazkii/botania/common/item/ItemBlackHoleTalisman.java b/src/main/java/vazkii/botania/common/item/ItemBlackHoleTalisman.java index 97fa94aa0..0a68d9c81 100644 --- a/src/main/java/vazkii/botania/common/item/ItemBlackHoleTalisman.java +++ b/src/main/java/vazkii/botania/common/item/ItemBlackHoleTalisman.java @@ -120,7 +120,7 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider { @Override public void onUpdate(ItemStack itemstack, World world, Entity entity, int slot, boolean selected) { Block block = getBlock(itemstack); - if(!entity.worldObj.isRemote && itemstack.getItemDamage() == 1 && block != Blocks.AIR && entity instanceof EntityPlayer) { + if(!entity.world.isRemote && itemstack.getItemDamage() == 1 && block != Blocks.AIR && entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entity; int meta = getBlockMeta(itemstack); diff --git a/src/main/java/vazkii/botania/common/item/ItemBlackLotus.java b/src/main/java/vazkii/botania/common/item/ItemBlackLotus.java index 0dd1c5352..a4e5d25c7 100644 --- a/src/main/java/vazkii/botania/common/item/ItemBlackLotus.java +++ b/src/main/java/vazkii/botania/common/item/ItemBlackLotus.java @@ -68,13 +68,13 @@ public class ItemBlackLotus extends ItemMod implements IManaDissolvable { TileEntity tile = (TileEntity) pool; boolean t2 = stack.getItemDamage() > 0; - if(!item.worldObj.isRemote) { + if(!item.world.isRemote) { pool.recieveMana(t2 ? MANA_PER_T2 : MANA_PER); stack.stackSize--; - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(item.worldObj, tile.getPos()); + VanillaPacketDispatcher.dispatchTEToNearbyPlayers(item.world, tile.getPos()); } - PacketHandler.sendToNearby(item.worldObj, item, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.BLACK_LOTUS_DISSOLVE, item.posX, tile.getPos().getY() + 0.5, item.posZ)); + PacketHandler.sendToNearby(item.world, item, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.BLACK_LOTUS_DISSOLVE, item.posX, tile.getPos().getY() + 0.5, item.posZ)); item.playSound(BotaniaSoundEvents.blackLotus, 0.5F, t2 ? 0.1F : 1F); } diff --git a/src/main/java/vazkii/botania/common/item/ItemBottledMana.java b/src/main/java/vazkii/botania/common/item/ItemBottledMana.java index d13bb9bd1..b8a38edc6 100644 --- a/src/main/java/vazkii/botania/common/item/ItemBottledMana.java +++ b/src/main/java/vazkii/botania/common/item/ItemBottledMana.java @@ -63,23 +63,23 @@ public class ItemBottledMana extends ItemMod { break; } case 1 : { // Water - if(!living.worldObj.isRemote && !living.worldObj.provider.doesWaterVaporize()) - living.worldObj.setBlockState(new BlockPos(living), Blocks.FLOWING_WATER.getDefaultState()); + if(!living.world.isRemote && !living.world.provider.doesWaterVaporize()) + living.world.setBlockState(new BlockPos(living), Blocks.FLOWING_WATER.getDefaultState()); break; } case 2 : { // Set on Fire - if(!living.worldObj.isRemote) + if(!living.world.isRemote) living.setFire(4); break; } case 3 : { // Mini Explosion - if(!living.worldObj.isRemote) - living.worldObj.createExplosion(null, living.posX, living.posY, living.posZ, 0.25F, false); + if(!living.world.isRemote) + living.world.createExplosion(null, living.posX, living.posY, living.posZ, 0.25F, false); break; } case 4 : { // Mega Jump - if(!living.worldObj.provider.doesWaterVaporize()) { - if(!living.worldObj.isRemote) + if(!living.world.provider.doesWaterVaporize()) { + if(!living.world.isRemote) living.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 300, 5)); living.motionY = 6; } @@ -87,17 +87,17 @@ public class ItemBottledMana extends ItemMod { break; } case 5 : { // Randomly set HP - if(!living.worldObj.isRemote) - living.setHealth(living.worldObj.rand.nextInt(19) + 1); + if(!living.world.isRemote) + living.setHealth(living.world.rand.nextInt(19) + 1); break; } case 6 : { // Lots O' Hearts - if(!living.worldObj.isRemote) + if(!living.world.isRemote) living.addPotionEffect(new PotionEffect(MobEffects.ABSORPTION, 20 * 60 * 2, 9)); break; } case 7 : { // All your inventory is belong to us - if(!living.worldObj.isRemote && living instanceof EntityPlayer) { + if(!living.world.isRemote && living instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) living; for(int i = 0; i < player.inventory.getSizeInventory(); i++) { ItemStack stackAt = player.inventory.getStackInSlot(i); @@ -118,12 +118,12 @@ public class ItemBottledMana extends ItemMod { break; } case 9 : { // Highest Possible - int x = MathHelper.floor_double(living.posX); - MathHelper.floor_double(living.posY); - int z = MathHelper.floor_double(living.posZ); + int x = MathHelper.floor(living.posX); + MathHelper.floor(living.posY); + int z = MathHelper.floor(living.posZ); for(int i = 256; i > 0; i--) { - Block block = living.worldObj.getBlockState(new BlockPos(x, i, z)).getBlock(); - if(!block.isAir(living.worldObj.getBlockState(new BlockPos(x, i, z)), living.worldObj, new BlockPos(x, i, z))) { + Block block = living.world.getBlockState(new BlockPos(x, i, z)).getBlock(); + if(!block.isAir(living.world.getBlockState(new BlockPos(x, i, z)), living.world, new BlockPos(x, i, z))) { if(living instanceof EntityPlayerMP) { EntityPlayerMP mp = (EntityPlayerMP) living; mp.connection.setPlayerLocation(living.posX, i + 1.6, living.posZ, living.rotationYaw, living.rotationPitch); @@ -135,26 +135,26 @@ public class ItemBottledMana extends ItemMod { break; } case 10 : { // HYPERSPEEEEEED - if(!living.worldObj.isRemote) + if(!living.world.isRemote) living.addPotionEffect(new PotionEffect(MobEffects.SPEED, 60, 200)); break; } case 11 : { // Night Vision - if(!living.worldObj.isRemote) + if(!living.world.isRemote) living.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 6000, 0)); break; } case 12 : { // Flare - if(!living.worldObj.isRemote) { - EntitySignalFlare flare = new EntitySignalFlare(living.worldObj); + if(!living.world.isRemote) { + EntitySignalFlare flare = new EntitySignalFlare(living.world); flare.setPosition(living.posX, living.posY, living.posZ); - flare.setColor(living.worldObj.rand.nextInt(16)); - flare.playSound(SoundEvents.ENTITY_GENERIC_EXPLODE, 40F, (1.0F + (living.worldObj.rand.nextFloat() - living.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + flare.setColor(living.world.rand.nextInt(16)); + flare.playSound(SoundEvents.ENTITY_GENERIC_EXPLODE, 40F, (1.0F + (living.world.rand.nextFloat() - living.world.rand.nextFloat()) * 0.2F) * 0.7F); - living.worldObj.spawnEntityInWorld(flare); + living.world.spawnEntity(flare); int range = 5; - List entities = living.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(living.posX - range, living.posY - range, living.posZ - range, living.posX + range, living.posY + range, living.posZ + range)); + List entities = living.world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(living.posX - range, living.posY - range, living.posZ - range, living.posX + range, living.posY + range, living.posZ + range)); for(EntityLivingBase entity : entities) if(entity != living && (!(entity instanceof EntityPlayer) || FMLCommonHandler.instance().getMinecraftServerInstance() == null || FMLCommonHandler.instance().getMinecraftServerInstance().isPVPEnabled())) entity.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 50, 5)); @@ -163,15 +163,15 @@ public class ItemBottledMana extends ItemMod { break; } case 13 : { // Pixie Friend - if(!living.worldObj.isRemote) { - EntityPixie pixie = new EntityPixie(living.worldObj); + if(!living.world.isRemote) { + EntityPixie pixie = new EntityPixie(living.world); pixie.setPosition(living.posX, living.posY + 1.5, living.posZ); - living.worldObj.spawnEntityInWorld(pixie); + living.world.spawnEntity(pixie); } break; } case 14 : { // Nausea + Blindness :3 - if(!living.worldObj.isRemote) { + if(!living.world.isRemote) { living.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 160, 3)); living.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, 160, 0)); } @@ -179,7 +179,7 @@ public class ItemBottledMana extends ItemMod { break; } case 15 : { // Drop own Head - if(!living.worldObj.isRemote && living instanceof EntityPlayer) { + if(!living.world.isRemote && living instanceof EntityPlayer) { living.attackEntityFrom(DamageSource.magic, living.getHealth() - 1); ItemStack skull = new ItemStack(Items.SKULL, 1, 3); ItemNBTHelper.setString(skull, "SkullOwner", living.getName()); diff --git a/src/main/java/vazkii/botania/common/item/ItemCacophonium.java b/src/main/java/vazkii/botania/common/item/ItemCacophonium.java index 72799dc9e..57399e0ac 100644 --- a/src/main/java/vazkii/botania/common/item/ItemCacophonium.java +++ b/src/main/java/vazkii/botania/common/item/ItemCacophonium.java @@ -89,7 +89,7 @@ public class ItemCacophonium extends ItemMod implements ICraftAchievement { ItemNBTHelper.setString(stack, TAG_SOUND_NAME, "entity." + s + ".name"); player.setHeldItem(hand, stack); - if(player.worldObj.isRemote) + if(player.world.isRemote) player.swingArm(hand); return true; @@ -146,7 +146,7 @@ public class ItemCacophonium extends ItemMod implements ICraftAchievement { @Override public void onUsingTick(ItemStack stack, EntityLivingBase player, int count) { if(count % (isDOIT(stack) ? 20 : 6) == 0) - playSound(player.worldObj, stack, player.posX, player.posY, player.posZ, SoundCategory.PLAYERS, 0.9F); + playSound(player.world, stack, player.posX, player.posY, player.posZ, SoundCategory.PLAYERS, 0.9F); } public static void playSound(World world, ItemStack stack, double x, double y, double z, SoundCategory category, float volume) { diff --git a/src/main/java/vazkii/botania/common/item/ItemCorporeaSpark.java b/src/main/java/vazkii/botania/common/item/ItemCorporeaSpark.java index ddff74014..7999520e4 100644 --- a/src/main/java/vazkii/botania/common/item/ItemCorporeaSpark.java +++ b/src/main/java/vazkii/botania/common/item/ItemCorporeaSpark.java @@ -58,7 +58,7 @@ public class ItemCorporeaSpark extends ItemMod { if(stack.getItemDamage() == 1) spark.setMaster(true); spark.setPosition(pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5); - world.spawnEntityInWorld(spark); + world.spawnEntity(spark); world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 0); } return EnumActionResult.SUCCESS; diff --git a/src/main/java/vazkii/botania/common/item/ItemCraftingHalo.java b/src/main/java/vazkii/botania/common/item/ItemCraftingHalo.java index 8591cd451..93327ce2d 100644 --- a/src/main/java/vazkii/botania/common/item/ItemCraftingHalo.java +++ b/src/main/java/vazkii/botania/common/item/ItemCraftingHalo.java @@ -155,11 +155,11 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement { } private static ItemStack[] validateRecipe(EntityPlayer player, ItemStack stack, ItemStack[] recipe, int slot) { - InventoryCrafting fakeInv = new InventoryCrafting(new ContainerWorkbench(player.inventory, player.worldObj, BlockPos.ORIGIN), 3, 3); + InventoryCrafting fakeInv = new InventoryCrafting(new ContainerWorkbench(player.inventory, player.world, BlockPos.ORIGIN), 3, 3); for(int i = 0; i < 9; i++) fakeInv.setInventorySlotContents(i, recipe[i]); - ItemStack result = CraftingManager.getInstance().findMatchingRecipe(fakeInv, player.worldObj); + ItemStack result = CraftingManager.getInstance().findMatchingRecipe(fakeInv, player.world); if(result == null) { assignRecipe(stack, recipe[9], slot); return null; @@ -327,7 +327,7 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement { NBTTagCompound cmp = new NBTTagCompound(); NBTTagCompound cmp1 = new NBTTagCompound(); - ItemStack result = CraftingManager.getInstance().findMatchingRecipe((InventoryCrafting) event.craftMatrix, event.player.worldObj); + ItemStack result = CraftingManager.getInstance().findMatchingRecipe((InventoryCrafting) event.craftMatrix, event.player.world); if(result != null) { result.writeToNBT(cmp1); cmp.setTag(TAG_ITEM_PREFIX + 9, cmp1); @@ -405,7 +405,7 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement { @SideOnly(Side.CLIENT) @SubscribeEvent public void onRenderWorldLast(RenderWorldLastEvent event) { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; + EntityPlayer player = Minecraft.getMinecraft().player; ItemStack stack = PlayerHelper.getFirstHeldItemClass(player, ItemCraftingHalo.class); if(stack != null) render(stack, player, event.getPartialTicks()); diff --git a/src/main/java/vazkii/botania/common/item/ItemEnderHand.java b/src/main/java/vazkii/botania/common/item/ItemEnderHand.java index 38b7e8572..4297ffa93 100644 --- a/src/main/java/vazkii/botania/common/item/ItemEnderHand.java +++ b/src/main/java/vazkii/botania/common/item/ItemEnderHand.java @@ -43,7 +43,7 @@ public class ItemEnderHand extends ItemMod implements IManaUsingItem, IBlockProv @Override public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { if(ManaItemHandler.requestManaExact(stack, player, COST_SELF, false)) { - if(!player.worldObj.isRemote) + if(!player.world.isRemote) player.displayGUIChest(player.getInventoryEnderChest()); ManaItemHandler.requestManaExact(stack, player, COST_SELF, true); player.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1F, 1F); @@ -55,7 +55,7 @@ public class ItemEnderHand extends ItemMod implements IManaUsingItem, IBlockProv @Override public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity, EnumHand hand) { if(ConfigHandler.enderPickpocketEnabled && entity instanceof EntityPlayer && ManaItemHandler.requestManaExact(stack, player, COST_OTHER, false)) { - if(!player.worldObj.isRemote) + if(!player.world.isRemote) player.displayGUIChest(((EntityPlayer) entity).getInventoryEnderChest()); ManaItemHandler.requestManaExact(stack, player, COST_OTHER, true); player.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1F, 1F); diff --git a/src/main/java/vazkii/botania/common/item/ItemFertilizer.java b/src/main/java/vazkii/botania/common/item/ItemFertilizer.java index cb116fcd6..4016a9336 100644 --- a/src/main/java/vazkii/botania/common/item/ItemFertilizer.java +++ b/src/main/java/vazkii/botania/common/item/ItemFertilizer.java @@ -45,7 +45,7 @@ public class ItemFertilizer extends ItemMod { for(int j = -range - 1; j < range; j++) { for(int k = 2; k >= -2; k--) { BlockPos pos_ = pos.add(i + 1, k + 1, j + 1); - if(world.isAirBlock(pos_) && (!world.provider.getHasNoSky() || pos_.getY() < 255) && ModBlocks.flower.canPlaceBlockAt(world, pos_)) + if(world.isAirBlock(pos_) && (!world.provider.hasNoSky() || pos_.getY() < 255) && ModBlocks.flower.canPlaceBlockAt(world, pos_)) validCoords.add(pos_); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemFlowerBag.java b/src/main/java/vazkii/botania/common/item/ItemFlowerBag.java index 9413fdb9c..8cd161fef 100644 --- a/src/main/java/vazkii/botania/common/item/ItemFlowerBag.java +++ b/src/main/java/vazkii/botania/common/item/ItemFlowerBag.java @@ -143,9 +143,9 @@ public class ItemFlowerBag extends ItemMod { if(result != entityStack) { event.setCanceled(true); if (!event.getItem().isSilent()) { - event.getItem().worldObj.playSound(null, event.getEntityPlayer().posX, event.getEntityPlayer().posY, event.getEntityPlayer().posZ, + event.getItem().world.playSound(null, event.getEntityPlayer().posX, event.getEntityPlayer().posY, event.getEntityPlayer().posZ, SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.PLAYERS, 0.2F, - ((event.getItem().worldObj.rand.nextFloat() - event.getItem().worldObj.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); + ((event.getItem().world.rand.nextFloat() - event.getItem().world.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); } ((EntityPlayerMP) event.getEntityPlayer()).connection.sendPacket(new SPacketCollectItem(event.getItem().getEntityId(), event.getEntityPlayer().getEntityId())); event.getEntityPlayer().openContainer.detectAndSendChanges(); diff --git a/src/main/java/vazkii/botania/common/item/ItemGaiaHead.java b/src/main/java/vazkii/botania/common/item/ItemGaiaHead.java index 895d69fcd..b8d9388b5 100644 --- a/src/main/java/vazkii/botania/common/item/ItemGaiaHead.java +++ b/src/main/java/vazkii/botania/common/item/ItemGaiaHead.java @@ -94,7 +94,7 @@ public class ItemGaiaHead extends ItemMod { int i = 0; if (facing == EnumFacing.UP) { - i = MathHelper.floor_double(playerIn.rotationYaw * 16.0F / 360.0F + 0.5D) & 15; + i = MathHelper.floor(playerIn.rotationYaw * 16.0F / 360.0F + 0.5D) & 15; } TileEntity tileentity = worldIn.getTileEntity(pos); diff --git a/src/main/java/vazkii/botania/common/item/ItemGrassHorn.java b/src/main/java/vazkii/botania/common/item/ItemGrassHorn.java index 0e3868809..93e0cab04 100644 --- a/src/main/java/vazkii/botania/common/item/ItemGrassHorn.java +++ b/src/main/java/vazkii/botania/common/item/ItemGrassHorn.java @@ -98,10 +98,10 @@ public class ItemGrassHorn extends ItemMod { @Override public void onUsingTick(ItemStack stack, EntityLivingBase player, int time) { - if(!player.worldObj.isRemote) { + if(!player.world.isRemote) { if(time != getMaxItemUseDuration(stack) && time % 5 == 0) - breakGrass(player.worldObj, stack, stack.getItemDamage(), new BlockPos(player)); - player.worldObj.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_NOTE_BASS, SoundCategory.BLOCKS, 1F, 0.001F); + breakGrass(player.world, stack, stack.getItemDamage(), new BlockPos(player)); + player.world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_NOTE_BASS, SoundCategory.BLOCKS, 1F, 0.001F); } } @@ -139,7 +139,7 @@ public class ItemGrassHorn extends ItemMod { world.playEvent(2001, currCoords, Block.getStateId(state)); for(ItemStack stack_ : items) - world.spawnEntityInWorld(new EntityItem(world, currCoords.getX() + 0.5, currCoords.getY() + 0.5, currCoords.getZ() + 0.5, stack_)); + world.spawnEntity(new EntityItem(world, currCoords.getX() + 0.5, currCoords.getY() + 0.5, currCoords.getZ() + 0.5, stack_)); } } } diff --git a/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java b/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java index 2ded52e7d..fb8ea3c24 100644 --- a/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java +++ b/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java @@ -164,7 +164,7 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet ItemNBTHelper.setInt(copyLens, TAG_ITERATION_K, k); EntityManaBurst burst = getBurst(world, pos_, copyLens); - world.spawnEntityInWorld(burst); + world.spawnEntity(burst); return; } } @@ -215,13 +215,13 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet double speed = 0.35; int targetDistance = BASE_OFFSET; EntityThrowable entity = (EntityThrowable) burst; - if(!entity.worldObj.isRemote) { + if(!entity.world.isRemote) { entity.motionX = 0; entity.motionY = speed; entity.motionZ = 0; final int spawnTicks = 2; - final int placeTicks = net.minecraft.util.math.MathHelper.floor_double(targetDistance / speed); + final int placeTicks = net.minecraft.util.math.MathHelper.floor(targetDistance / speed); ItemStack lens = burst.getSourceLens(); @@ -231,14 +231,14 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet int z = ItemNBTHelper.getInt(lens, TAG_Z, 0); if(y != -1) - spawnBurst(entity.worldObj, new BlockPos(x, y, z), lens); + spawnBurst(entity.world, new BlockPos(x, y, z), lens); } else if(burst.getTicksExisted() == placeTicks) { - int x = net.minecraft.util.math.MathHelper.floor_double(entity.posX); + int x = net.minecraft.util.math.MathHelper.floor(entity.posX); int y = ItemNBTHelper.getInt(lens, TAG_Y_START, -1) + targetDistance; - int z = net.minecraft.util.math.MathHelper.floor_double(entity.posZ); + int z = net.minecraft.util.math.MathHelper.floor(entity.posZ); BlockPos pos = new BlockPos(x, y, z); - if(entity.worldObj.isAirBlock(pos)) { + if(entity.world.isAirBlock(pos)) { Block block = Blocks.AIR; if (lens.hasTagCompound()) { if (lens.getTagCompound().hasKey(TAG_BLOCK_NAME)) { @@ -253,13 +253,13 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet TileEntity tile = null; NBTTagCompound tilecmp = ItemNBTHelper.getCompound(lens, TAG_TILE, false); if(tilecmp.hasKey("id")) - tile = TileEntity.func_190200_a(entity.worldObj, tilecmp); + tile = TileEntity.create(entity.world, tilecmp); - entity.worldObj.setBlockState(pos, block.getStateFromMeta(meta), 1 | 2); - entity.worldObj.playEvent(2001, pos, Block.getStateId(block.getStateFromMeta(meta))); + entity.world.setBlockState(pos, block.getStateFromMeta(meta), 1 | 2); + entity.world.playEvent(2001, pos, Block.getStateId(block.getStateFromMeta(meta))); if(tile != null) { tile.setPos(pos); - entity.worldObj.setTileEntity(pos, tile); + entity.world.setTileEntity(pos, tile); } } @@ -275,7 +275,7 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet String id = ItemNBTHelper.getString(lens, TAG_BLOCK_NAME, "minecraft:air"); Block b = Block.getBlockFromName(id); int meta = ItemNBTHelper.getInt(lens, TAG_META, 0); - entity.worldObj.spawnParticle(EnumParticleTypes.BLOCK_CRACK, entity.posX, entity.posY, entity.posZ, entity.motionX, entity.motionY, entity.motionZ, Block.getStateId(b.getStateFromMeta(meta))); + entity.world.spawnParticle(EnumParticleTypes.BLOCK_CRACK, entity.posX, entity.posY, entity.posZ, entity.motionX, entity.motionY, entity.motionZ, Block.getStateId(b.getStateFromMeta(meta))); return true; } diff --git a/src/main/java/vazkii/botania/common/item/ItemLexicon.java b/src/main/java/vazkii/botania/common/item/ItemLexicon.java index 4e190cbb7..4c643c8e7 100644 --- a/src/main/java/vazkii/botania/common/item/ItemLexicon.java +++ b/src/main/java/vazkii/botania/common/item/ItemLexicon.java @@ -151,7 +151,7 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem { LexiconEntry entry = getEntryFromForce(par1ItemStack); if(entry != null) Botania.proxy.setEntryToOpen(entry); - else player.addChatMessage(new TextComponentTranslation("botaniamisc.cantOpen").setStyle(new Style().setColor(TextFormatting.RED))); + else player.sendMessage(new TextComponentTranslation("botaniamisc.cantOpen").setStyle(new Style().setColor(TextFormatting.RED))); setForcedPage(par1ItemStack, ""); } diff --git a/src/main/java/vazkii/botania/common/item/ItemManaGun.java b/src/main/java/vazkii/botania/common/item/ItemManaGun.java index 189cc0429..40bce4187 100644 --- a/src/main/java/vazkii/botania/common/item/ItemManaGun.java +++ b/src/main/java/vazkii/botania/common/item/ItemManaGun.java @@ -100,7 +100,7 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem { player.addStat(ModAchievements.manaBlasterShoot, 1); if(isSugoiKawaiiDesuNe(par1ItemStack)) player.addStat(ModAchievements.desuGun, 1); - world.spawnEntityInWorld(burst); + world.spawnEntity(burst); } else { player.swingArm(hand); player.motionX -= burst.motionX * 0.1; diff --git a/src/main/java/vazkii/botania/common/item/ItemManaMirror.java b/src/main/java/vazkii/botania/common/item/ItemManaMirror.java index b85d630b3..f825f40fe 100644 --- a/src/main/java/vazkii/botania/common/item/ItemManaMirror.java +++ b/src/main/java/vazkii/botania/common/item/ItemManaMirror.java @@ -162,7 +162,7 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte int dim = getDimension(stack); World world = null; - for(World w : server.worldServers) + for(World w : server.worlds) if(w.provider.getDimension() == dim) { world = w; break; diff --git a/src/main/java/vazkii/botania/common/item/ItemObedienceStick.java b/src/main/java/vazkii/botania/common/item/ItemObedienceStick.java index 1a3a543aa..a6aff128c 100644 --- a/src/main/java/vazkii/botania/common/item/ItemObedienceStick.java +++ b/src/main/java/vazkii/botania/common/item/ItemObedienceStick.java @@ -60,7 +60,7 @@ public class ItemObedienceStick extends ItemMod { } } - if(player.worldObj.isRemote) + if(player.world.isRemote) player.swingArm(hand); return EnumActionResult.SUCCESS; } diff --git a/src/main/java/vazkii/botania/common/item/ItemPinkinator.java b/src/main/java/vazkii/botania/common/item/ItemPinkinator.java index dc85b0b27..b904a9323 100644 --- a/src/main/java/vazkii/botania/common/item/ItemPinkinator.java +++ b/src/main/java/vazkii/botania/common/item/ItemPinkinator.java @@ -50,7 +50,7 @@ public class ItemPinkinator extends ItemMod { wither.setDead(); EntityPinkWither pink = new EntityPinkWither(world); pink.setLocationAndAngles(wither.posX, wither.posY, wither.posZ, wither.rotationYaw, wither.rotationPitch); - world.spawnEntityInWorld(pink); + world.spawnEntity(pink); pink.playSound(SoundEvents.ENTITY_GENERIC_EXPLODE, 4F, (1F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F); } player.addStat(ModAchievements.pinkinator, 1); diff --git a/src/main/java/vazkii/botania/common/item/ItemPoolMinecart.java b/src/main/java/vazkii/botania/common/item/ItemPoolMinecart.java index e4b27d41d..7e38c4b39 100644 --- a/src/main/java/vazkii/botania/common/item/ItemPoolMinecart.java +++ b/src/main/java/vazkii/botania/common/item/ItemPoolMinecart.java @@ -50,7 +50,7 @@ public class ItemPoolMinecart extends ItemMod implements ICraftAchievement, IMin if(stack.hasDisplayName()) entityminecart.setCustomNameTag(stack.getDisplayName()); - world.spawnEntityInWorld(entityminecart); + world.spawnEntity(entityminecart); } --stack.stackSize; @@ -79,7 +79,7 @@ public class ItemPoolMinecart extends ItemMod implements ICraftAchievement, IMin if(cart.hasDisplayName()) entityminecart.setCustomNameTag(cart.getDisplayName()); - if(world.spawnEntityInWorld(entityminecart)) + if(world.spawnEntity(entityminecart)) return entityminecart; } } diff --git a/src/main/java/vazkii/botania/common/item/ItemSextant.java b/src/main/java/vazkii/botania/common/item/ItemSextant.java index 42af3f78b..a6b1f3580 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSextant.java +++ b/src/main/java/vazkii/botania/common/item/ItemSextant.java @@ -136,9 +136,9 @@ public class ItemSextant extends ItemMod { double mul = diffVec.y / lookVec.y; lookVec = lookVec.multiply(mul).add(centerVec); - lookVec = new Vector3(net.minecraft.util.math.MathHelper.floor_double(lookVec.x), + lookVec = new Vector3(net.minecraft.util.math.MathHelper.floor(lookVec.x), lookVec.y, - net.minecraft.util.math.MathHelper.floor_double(lookVec.z)); + net.minecraft.util.math.MathHelper.floor(lookVec.z)); return MathHelper.pointDistancePlane(source.x, source.z, lookVec.x, lookVec.z); } diff --git a/src/main/java/vazkii/botania/common/item/ItemSlimeBottle.java b/src/main/java/vazkii/botania/common/item/ItemSlimeBottle.java index 8ca0f9411..9ba239b15 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSlimeBottle.java +++ b/src/main/java/vazkii/botania/common/item/ItemSlimeBottle.java @@ -31,8 +31,8 @@ public class ItemSlimeBottle extends ItemMod { @Override public void onUpdate(ItemStack stack, World world, Entity entity, int something, boolean somethingelse) { if(!world.isRemote) { - int x = MathHelper.floor_double(entity.posX); - int z = MathHelper.floor_double(entity.posZ); + int x = MathHelper.floor(entity.posX); + int z = MathHelper.floor(entity.posZ); boolean slime = SubTileNarslimmus.SpawnIntercepter.isSlimeChunk(world, x, z); int meta = stack.getItemDamage(); int newMeta = slime ? 1 : 0; diff --git a/src/main/java/vazkii/botania/common/item/ItemSlingshot.java b/src/main/java/vazkii/botania/common/item/ItemSlingshot.java index 483be2007..61b07dbea 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSlingshot.java +++ b/src/main/java/vazkii/botania/common/item/ItemSlingshot.java @@ -56,7 +56,7 @@ public class ItemSlingshot extends ItemMod { ball.motionX *= 1.6; ball.motionY *= 1.6; ball.motionZ *= 1.6; - world.spawnEntityInWorld(ball); + world.spawnEntity(ball); world.playSound(null, living.posX, living.posY, living.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemSpark.java b/src/main/java/vazkii/botania/common/item/ItemSpark.java index 813d593e5..435ca5bbf 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSpark.java +++ b/src/main/java/vazkii/botania/common/item/ItemSpark.java @@ -47,7 +47,7 @@ public class ItemSpark extends ItemMod implements ICraftAchievement, IManaGiving if(!world.isRemote) { EntitySpark spark = new EntitySpark(world); spark.setPosition(pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5); - world.spawnEntityInWorld(spark); + world.spawnEntity(spark); attach.attachSpark(spark); VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); } diff --git a/src/main/java/vazkii/botania/common/item/ItemSpawnerMover.java b/src/main/java/vazkii/botania/common/item/ItemSpawnerMover.java index 760d9e089..d6a24b3b9 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSpawnerMover.java +++ b/src/main/java/vazkii/botania/common/item/ItemSpawnerMover.java @@ -136,7 +136,7 @@ public class ItemSpawnerMover extends ItemMod { return false; } else if(world.canBlockBePlaced(Blocks.MOB_SPAWNER, pos, false, side, null, itemstack)) { int meta = this.getMetadata(itemstack.getMetadata()); - IBlockState iblockstate1 = Blocks.MOB_SPAWNER.onBlockPlaced(world, pos, side, xOffset, yOffset, zOffset, meta, player); + IBlockState iblockstate1 = Blocks.MOB_SPAWNER.getStateForPlacement(world, pos, side, xOffset, yOffset, zOffset, meta, player); if (placeBlockAt(itemstack, player, world, pos, side, xOffset, yOffset, zOffset, iblockstate1)) { world.playSound(null, pos, Blocks.MOB_SPAWNER.getSoundType().getPlaceSound(), SoundCategory.BLOCKS, (Blocks.MOB_SPAWNER.getSoundType().getVolume() + 1.0F) / 2.0F, Blocks.MOB_SPAWNER.getSoundType().getPitch() * 0.8F); diff --git a/src/main/java/vazkii/botania/common/item/ItemThornChakram.java b/src/main/java/vazkii/botania/common/item/ItemThornChakram.java index f5a4dd9bd..c6d808565 100644 --- a/src/main/java/vazkii/botania/common/item/ItemThornChakram.java +++ b/src/main/java/vazkii/botania/common/item/ItemThornChakram.java @@ -64,7 +64,7 @@ public class ItemThornChakram extends ItemMod implements ICraftAchievement { EntityThornChakram c = new EntityThornChakram(world, player, copy); c.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0.0F, 1.5F, 1.0F); c.setFire(stack.getItemDamage() != 0); - world.spawnEntityInWorld(c); + world.spawnEntity(c); world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); --stack.stackSize; } diff --git a/src/main/java/vazkii/botania/common/item/ItemTwigWand.java b/src/main/java/vazkii/botania/common/item/ItemTwigWand.java index db9863ebb..83fdf3ae2 100644 --- a/src/main/java/vazkii/botania/common/item/ItemTwigWand.java +++ b/src/main/java/vazkii/botania/common/item/ItemTwigWand.java @@ -277,7 +277,7 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem { RayTraceResult pos = Minecraft.getMinecraft().objectMouseOver; if(pos != null && pos.typeOfHit == RayTraceResult.Type.BLOCK) { - TileEntity tile = Minecraft.getMinecraft().theWorld.getTileEntity(pos.getBlockPos()); + TileEntity tile = Minecraft.getMinecraft().world.getTileEntity(pos.getBlockPos()); if(tile != null && tile instanceof ITileBound) { BlockPos coords = ((ITileBound) tile).getBinding(); return coords; diff --git a/src/main/java/vazkii/botania/common/item/ItemVineBall.java b/src/main/java/vazkii/botania/common/item/ItemVineBall.java index 25fe6518a..0c8cd7f71 100644 --- a/src/main/java/vazkii/botania/common/item/ItemVineBall.java +++ b/src/main/java/vazkii/botania/common/item/ItemVineBall.java @@ -40,7 +40,7 @@ public class ItemVineBall extends ItemMod { if(!world.isRemote) { EntityVineBall ball = new EntityVineBall(player, true); ball.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0.0F, 1.5F, 1.0F); - world.spawnEntityInWorld(ball); + world.spawnEntity(ball); } return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); diff --git a/src/main/java/vazkii/botania/common/item/ItemVirus.java b/src/main/java/vazkii/botania/common/item/ItemVirus.java index 2f61f7cc8..54feb9a14 100644 --- a/src/main/java/vazkii/botania/common/item/ItemVirus.java +++ b/src/main/java/vazkii/botania/common/item/ItemVirus.java @@ -56,7 +56,7 @@ public class ItemVirus extends ItemMod { @Override public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer player, EntityLivingBase par3EntityLivingBase, EnumHand hand) { if(par3EntityLivingBase instanceof EntityHorse) { - if(player.worldObj.isRemote) + if(player.world.isRemote) return true; EntityHorse horse = (EntityHorse) par3EntityLivingBase; if(horse.getType() != HorseType.ZOMBIE && horse.getType() != HorseType.SKELETON && horse.isTame()) { @@ -87,7 +87,7 @@ public class ItemVirus extends ItemMod { movementSpeed.applyModifier(new AttributeModifier("Ermergerd Virus D:", movementSpeed.getBaseValue(), 0)); IAttributeInstance jumpHeight = attributes.getAttributeInstance(ReflectionHelper.getPrivateValue(EntityHorse.class, null, LibObfuscation.HORSE_JUMP_STRENGTH)); jumpHeight.applyModifier(new AttributeModifier("Ermergerd Virus D:", jumpHeight.getBaseValue() * 0.5, 0)); - horse.playSound(SoundEvents.ENTITY_ZOMBIE_VILLAGER_CURE, 1.0F + par3EntityLivingBase.worldObj.rand.nextFloat(), par3EntityLivingBase.worldObj.rand.nextFloat() * 0.7F + 1.3F); + horse.playSound(SoundEvents.ENTITY_ZOMBIE_VILLAGER_CURE, 1.0F + par3EntityLivingBase.world.rand.nextFloat(), par3EntityLivingBase.world.rand.nextFloat() * 0.7F + 1.3F); horse.spawnExplosionParticle(); par1ItemStack.stackSize--; diff --git a/src/main/java/vazkii/botania/common/item/block/ItemBlockTinyPotato.java b/src/main/java/vazkii/botania/common/item/block/ItemBlockTinyPotato.java index 49129a268..c56bf9a79 100644 --- a/src/main/java/vazkii/botania/common/item/block/ItemBlockTinyPotato.java +++ b/src/main/java/vazkii/botania/common/item/block/ItemBlockTinyPotato.java @@ -58,7 +58,7 @@ public class ItemBlockTinyPotato extends ItemBlockMod { EntityPlayer player = (EntityPlayer) e; int ticks = ItemNBTHelper.getInt(stack, TAG_TICKS, 0); if(ticks < NOT_MY_NAME.length) { - player.addChatMessage(new TextComponentString(TextFormatting.RED + NOT_MY_NAME[ticks])); + player.sendMessage(new TextComponentString(TextFormatting.RED + NOT_MY_NAME[ticks])); ItemNBTHelper.setInt(stack, TAG_TICKS, ticks + 1); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelArmor.java b/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelArmor.java index 3533c636e..101fadffd 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelArmor.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelArmor.java @@ -62,7 +62,7 @@ public class ItemTerrasteelArmor extends ItemManasteelArmor { Multimap multimap = super.getAttributeModifiers(slot, stack); UUID uuid = new UUID((getUnlocalizedName() + slot.toString()).hashCode(), 0); if (slot == armorType) { - multimap.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getAttributeUnlocalizedName(), new AttributeModifier(uuid, "Terrasteel modifier " + type, (double) getArmorDisplay(null, new ItemStack(this), type.getIndex()) / 20, 0)); + multimap.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getName(), new AttributeModifier(uuid, "Terrasteel modifier " + type, (double) getArmorDisplay(null, new ItemStack(this), type.getIndex()) / 20, 0)); } return multimap; } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBalanceCloak.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBalanceCloak.java index f3fe57271..34977c97e 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBalanceCloak.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBalanceCloak.java @@ -42,7 +42,7 @@ public class ItemBalanceCloak extends ItemHolyCloak { if(event.getAmount() > player.getHealth()) event.setAmount(player.getHealth() - 1); - player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.holyCloak, SoundCategory.PLAYERS, 1F, 1F); + player.world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.holyCloak, SoundCategory.PLAYERS, 1F, 1F); for(int i = 0; i < 30; i++) { double x = player.posX + Math.random() * player.width * 2 - player.width; double y = player.posY + Math.random() * player.height; diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBauble.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBauble.java index ae63c76bf..1bf4f5e5f 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBauble.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBauble.java @@ -137,8 +137,8 @@ public abstract class ItemBauble extends ItemMod implements IBauble, ICosmeticAt @Override public void onEquipped(ItemStack stack, EntityLivingBase player) { if(player != null) { - if(!player.worldObj.isRemote) - player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.equipBauble, SoundCategory.PLAYERS, 0.1F, 1.3F); + if(!player.world.isRemote) + player.world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.equipBauble, SoundCategory.PLAYERS, 0.1F, 1.3F); if(player instanceof EntityPlayer) ((EntityPlayer) player).addStat(ModAchievements.baubleWear, 1); diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBloodPendant.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBloodPendant.java index 0fca2e921..617261cab 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBloodPendant.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBloodPendant.java @@ -94,7 +94,7 @@ public class ItemBloodPendant extends ItemBauble implements IBrewContainer, IBre @Override public void onWornTick(ItemStack stack, EntityLivingBase player) { Brew brew = getBrew(stack); - if(brew != BotaniaAPI.fallbackBrew && player instanceof EntityPlayer && !player.worldObj.isRemote) { + if(brew != BotaniaAPI.fallbackBrew && player instanceof EntityPlayer && !player.world.isRemote) { EntityPlayer eplayer = (EntityPlayer) player; PotionEffect effect = brew.getPotionEffects(stack).get(0); float cost = (float) brew.getManaCost(stack) / effect.getDuration() / (1 + effect.getAmplifier()) * 2.5F; diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemCloudPendant.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemCloudPendant.java index a3f45c31a..b30b966d0 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemCloudPendant.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemCloudPendant.java @@ -63,7 +63,7 @@ public class ItemCloudPendant extends CloudPendantShim implements IBaubleRender @Override @SideOnly(Side.CLIENT) public void clientWornTick(ItemStack stack, EntityLivingBase player) { - if(player instanceof EntityPlayerSP && player == Minecraft.getMinecraft().thePlayer) { + if(player instanceof EntityPlayerSP && player == Minecraft.getMinecraft().player) { EntityPlayerSP playerSp = (EntityPlayerSP) player; UUID uuid = playerSp.getUniqueID(); diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDivaCharm.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDivaCharm.java index c5401aa5a..f1a87ae93 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDivaCharm.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDivaCharm.java @@ -52,7 +52,7 @@ public class ItemDivaCharm extends ItemBauble implements IManaUsingItem, IBauble @SubscribeEvent public void onEntityDamaged(LivingHurtEvent event) { - if(event.getSource().getEntity() instanceof EntityPlayer && event.getEntityLiving() instanceof EntityLiving && !event.getEntityLiving().worldObj.isRemote && Math.random() < 0.6F) { + if(event.getSource().getEntity() instanceof EntityPlayer && event.getEntityLiving() instanceof EntityLiving && !event.getEntityLiving().world.isRemote && Math.random() < 0.6F) { EntityPlayer player = (EntityPlayer) event.getSource().getEntity(); ItemStack amulet = BaublesApi.getBaubles(player).getStackInSlot(6); if(amulet != null && amulet.getItem() == this) { @@ -60,7 +60,7 @@ public class ItemDivaCharm extends ItemBauble implements IManaUsingItem, IBauble if(ManaItemHandler.requestManaExact(amulet, player, cost, false)) { final int range = 20; - List mobs = player.worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(event.getEntityLiving().posX - range, event.getEntityLiving().posY - range, event.getEntityLiving().posZ - range, event.getEntityLiving().posX + range, event.getEntityLiving().posY + range, event.getEntityLiving().posZ + range), Predicates.instanceOf(IMob.class)); + List mobs = player.world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(event.getEntityLiving().posX - range, event.getEntityLiving().posY - range, event.getEntityLiving().posZ - range, event.getEntityLiving().posX + range, event.getEntityLiving().posY + range, event.getEntityLiving().posZ + range), Predicates.instanceOf(IMob.class)); if(mobs.size() > 1) { if(SubTileHeiseiDream.brainwashEntity((EntityLiving) event.getEntityLiving(), (List) mobs)) { if(event.getEntityLiving() instanceof EntityCreeper) @@ -70,7 +70,7 @@ public class ItemDivaCharm extends ItemBauble implements IManaUsingItem, IBauble event.getEntityLiving().isDead = false; ManaItemHandler.requestManaExact(amulet, player, cost, true); - player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.divaCharm, SoundCategory.PLAYERS, 1F, 1F); + player.world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.divaCharm, SoundCategory.PLAYERS, 1F, 1F); double x = event.getEntityLiving().posX; double y = event.getEntityLiving().posY; diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDodgeRing.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDodgeRing.java index c65af8fa3..ef83ac534 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDodgeRing.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDodgeRing.java @@ -53,7 +53,7 @@ public class ItemDodgeRing extends ItemBauble { public void onKeyDown(KeyInputEvent event) { Minecraft mc = Minecraft.getMinecraft(); - IInventory baublesInv = BaublesApi.getBaubles(mc.thePlayer); + IInventory baublesInv = BaublesApi.getBaubles(mc.player); ItemStack ringStack = baublesInv.getStackInSlot(1); if(ringStack == null || !(ringStack.getItem() instanceof ItemDodgeRing)) { ringStack = baublesInv.getStackInSlot(2); @@ -70,13 +70,13 @@ public class ItemDodgeRing extends ItemBauble { leftDown = ClientTickHandler.ticksInGame; if(leftDown - oldLeft < threshold) - dodge(mc.thePlayer, true); + dodge(mc.player, true); } else if(mc.gameSettings.keyBindRight.isKeyDown()) { int oldRight = rightDown; rightDown = ClientTickHandler.ticksInGame; if(rightDown - oldRight < threshold) - dodge(mc.thePlayer, false); + dodge(mc.player, false); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemFlightTiara.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemFlightTiara.java index 1feedab6f..53825cef3 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemFlightTiara.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemFlightTiara.java @@ -147,7 +147,7 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub if(!wasSprting && isSprinting && cooldown == 0) { p.motionX += look.x; p.motionZ += look.z; - p.worldObj.playSound(null, p.posX, p.posY, p.posZ, BotaniaSoundEvents.dash, SoundCategory.PLAYERS, 1F, 1F); + p.world.playSound(null, p.posX, p.posY, p.posZ, BotaniaSoundEvents.dash, SoundCategory.PLAYERS, 1F, 1F); ItemNBTHelper.setInt(stack, TAG_DASH_COOLDOWN, maxCd); } else if(cooldown > 0) { if(maxCd - cooldown < 2) @@ -189,7 +189,7 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub if(shouldPlayerHaveFlight(player)) { player.capabilities.allowFlying = true; if(player.capabilities.isFlying) { - if(!player.worldObj.isRemote) + if(!player.world.isRemote) ManaItemHandler.requestManaExact(tiara, player, getCost(tiara, left), true); else if(Math.abs(player.motionX) > 0.1 || Math.abs(player.motionZ) > 0.1) { double x = event.getEntityLiving().posX - 0.5; @@ -276,7 +276,7 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub } public static String playerStr(EntityPlayer player) { - return player.getGameProfile().getName() + ":" + player.worldObj.isRemote; + return player.getGameProfile().getName() + ":" + player.world.isRemote; } private boolean shouldPlayerHaveFlight(EntityPlayer player) { diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemGoldenLaurel.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemGoldenLaurel.java index d9be43c42..0f1bc48c1 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemGoldenLaurel.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemGoldenLaurel.java @@ -50,8 +50,8 @@ public class ItemGoldenLaurel extends ItemBauble implements IBaubleRender { event.setCanceled(true); player.setHealth(player.getMaxHealth()); player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 300, 6)); - player.addChatMessage(new TextComponentTranslation("botaniamisc.savedByLaurel")); - player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.goldenLaurel, SoundCategory.PLAYERS, 1F, 0.3F); + player.sendMessage(new TextComponentTranslation("botaniamisc.savedByLaurel")); + player.world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.goldenLaurel, SoundCategory.PLAYERS, 1F, 0.3F); BaublesApi.getBaubles(player).setInventorySlotContents(4, null); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemHolyCloak.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemHolyCloak.java index 9b3301891..2379315e6 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemHolyCloak.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemHolyCloak.java @@ -84,7 +84,7 @@ public class ItemHolyCloak extends ItemBauble implements IBaubleRender { public boolean effectOnDamage(LivingHurtEvent event, EntityPlayer player, ItemStack stack) { if(!event.getSource().isMagicDamage()) { event.setCanceled(true); - player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.holyCloak, SoundCategory.PLAYERS, 1F, 1F); + player.world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.holyCloak, SoundCategory.PLAYERS, 1F, 1F); for(int i = 0; i < 30; i++) { double x = player.posX + Math.random() * player.width * 2 - player.width; double y = player.posY + Math.random() * player.height; diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemIcePendant.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemIcePendant.java index dbd99ea7c..3077c2253 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemIcePendant.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemIcePendant.java @@ -43,10 +43,10 @@ public class ItemIcePendant extends ItemBauble implements IBaubleRender { @Override public void onWornTick(ItemStack stack, EntityLivingBase entity) { super.onWornTick(stack, entity); - if(!entity.worldObj.isRemote) { + if(!entity.world.isRemote) { boolean lastOnGround = entity.onGround; entity.onGround = true; - EnchantmentFrostWalker.freezeNearby(entity, entity.worldObj, new BlockPos(entity), 8); + EnchantmentFrostWalker.freezeNearby(entity, entity.world, new BlockPos(entity), 8); entity.onGround = lastOnGround; } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemInvisibilityCloak.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemInvisibilityCloak.java index a5ac69b93..216fc5959 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemInvisibilityCloak.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemInvisibilityCloak.java @@ -42,7 +42,7 @@ public class ItemInvisibilityCloak extends ItemBauble implements IManaUsingItem public void onWornTick(ItemStack stack, EntityLivingBase player) { super.onWornTick(stack, player); - if(player instanceof EntityPlayer && !player.worldObj.isRemote) { + if(player instanceof EntityPlayer && !player.world.isRemote) { int manaCost = 2; boolean hasMana = ManaItemHandler.requestManaExact(stack, (EntityPlayer) player, manaCost, false); if(!hasMana) diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemItemFinder.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemItemFinder.java index 452d3a1fe..e2cdca0ec 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemItemFinder.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemItemFinder.java @@ -67,7 +67,7 @@ public class ItemItemFinder extends ItemBauble implements IBaubleRender { if(!(player instanceof EntityPlayer)) return; - if(player.worldObj.isRemote) + if(player.world.isRemote) tickClient(stack, (EntityPlayer) player); else tickServer(stack, (EntityPlayer) player); } @@ -86,7 +86,7 @@ public class ItemItemFinder extends ItemBauble implements IBaubleRender { int[] entities = ItemNBTHelper.getIntArray(stack, TAG_ENTITY_POSITIONS); for(int i : entities) { - Entity e = player.worldObj.getEntityByID(i); + Entity e = player.world.getEntityByID(i); if(e != null && Math.random() < 0.6) { Botania.proxy.setWispFXDepthTest(Math.random() < 0.6); Botania.proxy.wispFX(e.posX + (float) (Math.random() * 0.5 - 0.25) * 0.45F, e.posY + e.height, e.posZ + (float) (Math.random() * 0.5 - 0.25) * 0.45F, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.15F + 0.05F * (float) Math.random(), -0.05F - 0.03F * (float) Math.random()); @@ -123,7 +123,7 @@ public class ItemItemFinder extends ItemBauble implements IBaubleRender { if(pstack != null || player.isSneaking()) { int range = 24; - List entities = player.worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range)); + List entities = player.world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range)); for(Entity e : entities) { if(e == player) continue; @@ -166,7 +166,7 @@ public class ItemItemFinder extends ItemBauble implements IBaubleRender { range = 12; BlockPos pos = new BlockPos(player); for(BlockPos pos_ : BlockPos.getAllInBoxMutable(pos.add(-range, -range, -range), pos.add(range + 1, range + 1, range + 1))) { - TileEntity tile = player.worldObj.getTileEntity(pos_); + TileEntity tile = player.world.getTileEntity(pos_); if(tile != null) { boolean foundCap = false; for(EnumFacing e : EnumFacing.VALUES) { diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemKnockbackBelt.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemKnockbackBelt.java index 3f7aec44c..a7a3a5f0a 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemKnockbackBelt.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemKnockbackBelt.java @@ -46,7 +46,7 @@ public class ItemKnockbackBelt extends ItemBaubleModifier implements IBaubleRend if(stack == null) // workaround for Azanor/Baubles#156 return; - attributes.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getAttributeUnlocalizedName(), new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 1, 0)); + attributes.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getName(), new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 1, 0)); } @Override diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMagnetRing.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMagnetRing.java index f65600b92..3ddb020a0 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMagnetRing.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMagnetRing.java @@ -87,7 +87,7 @@ public class ItemMagnetRing extends ItemBauble { double y = player.posY + 0.75; double z = player.posZ; - List items = player.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(x - range, y - range, z - range, x + range, y + range, z + range)); + List items = player.world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(x - range, y - range, z - range, x + range, y + range, z + range)); int pulled = 0; for(EntityItem item : items) if(canPullItem(item)) { @@ -95,8 +95,8 @@ public class ItemMagnetRing extends ItemBauble { break; MathHelper.setEntityMotionFromVector(item, new Vector3(x, y, z), 0.45F); - if(player.worldObj.isRemote) { - boolean red = player.worldObj.rand.nextBoolean(); + if(player.world.isRemote) { + boolean red = player.world.rand.nextBoolean(); Botania.proxy.sparkleFX(item.posX, item.posY, item.posZ, red ? 1F : 0F, 0F, red ? 0F : 1F, 1F, 3); } pulled++; @@ -115,10 +115,10 @@ public class ItemMagnetRing extends ItemBauble { BlockPos pos = new BlockPos(item); - if(BotaniaAPI.isBlockBlacklistedFromMagnet(item.worldObj.getBlockState(pos))) + if(BotaniaAPI.isBlockBlacklistedFromMagnet(item.world.getBlockState(pos))) return false; - if(BotaniaAPI.isBlockBlacklistedFromMagnet(item.worldObj.getBlockState(pos.down()))) + if(BotaniaAPI.isBlockBlacklistedFromMagnet(item.world.getBlockState(pos.down()))) return false; return true; diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMiningRing.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMiningRing.java index 58092da8a..f2a07953c 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMiningRing.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMiningRing.java @@ -30,7 +30,7 @@ public class ItemMiningRing extends ItemBauble implements IManaUsingItem { public void onWornTick(ItemStack stack, EntityLivingBase player) { super.onWornTick(stack, player); - if(player instanceof EntityPlayer && !player.worldObj.isRemote) { + if(player instanceof EntityPlayer && !player.world.isRemote) { int manaCost = 5; boolean hasMana = ManaItemHandler.requestManaExact(stack, (EntityPlayer) player, manaCost, false); if(!hasMana) diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMonocle.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMonocle.java index fa54a1478..74fb4f0a9 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMonocle.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMonocle.java @@ -71,9 +71,9 @@ public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, ICosm RayTraceResult pos = mc.objectMouseOver; if(pos == null || pos.getBlockPos() == null) return; - IBlockState state = player.worldObj.getBlockState(pos.getBlockPos()); + IBlockState state = player.world.getBlockState(pos.getBlockPos()); Block block = state.getBlock(); - player.worldObj.getTileEntity(pos.getBlockPos()); + player.world.getTileEntity(pos.getBlockPos()); ItemStack dispStack = null; String text = ""; diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSwapRing.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSwapRing.java index dc3491647..db53be1f8 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSwapRing.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSwapRing.java @@ -41,11 +41,11 @@ public class ItemSwapRing extends ItemBauble { ISortableTool tool = (ISortableTool) currentStack.getItem(); - RayTraceResult pos = ToolCommons.raytraceFromEntity(entity.worldObj, entity, true, 4.5F); + RayTraceResult pos = ToolCommons.raytraceFromEntity(entity.world, entity, true, 4.5F); ToolType typeToFind = null; if(player.isSwingInProgress && pos != null && pos.getBlockPos() != null) { - IBlockState state = entity.worldObj.getBlockState(pos.getBlockPos()); + IBlockState state = entity.world.getBlockState(pos.getBlockPos()); Material mat = state.getMaterial(); if(ToolCommons.isRightMaterial(mat, ToolCommons.materialsPick)) diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemThirdEye.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemThirdEye.java index e8f211caf..a13175967 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemThirdEye.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemThirdEye.java @@ -55,7 +55,7 @@ public class ItemThirdEye extends ItemBauble implements IManaUsingItem, IBaubleR double range = 24; AxisAlignedBB aabb = new AxisAlignedBB(player.posX, player.posY, player.posZ, player.posX, player.posY, player.posZ).expand(range, range, range); - List mobs = player.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, aabb, (Entity e) -> e instanceof IMob); + List mobs = player.world.getEntitiesWithinAABB(EntityLivingBase.class, aabb, (Entity e) -> e instanceof IMob); if(!mobs.isEmpty()) for(EntityLivingBase e : mobs) { diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTinyPlanet.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTinyPlanet.java index 22897f38d..0e545021b 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTinyPlanet.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTinyPlanet.java @@ -54,10 +54,10 @@ public class ItemTinyPlanet extends ItemBauble implements IBaubleRender { double x = player.posX; double y = player.posY + 1.2F; double z = player.posZ; - if(player.worldObj.isRemote) + if(player.world.isRemote) y -= 1.62F; - applyEffect(player.worldObj, x, y, z); + applyEffect(player.world, x, y, z); } public static void applyEffect(World world, double x, double y, double z) { diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTravelBelt.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTravelBelt.java index 554f67fea..9d9d29c71 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTravelBelt.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTravelBelt.java @@ -78,7 +78,7 @@ public class ItemTravelBelt extends ItemBauble implements IBaubleRender, IManaUs if(shouldPlayerHaveStepup(player)) { ItemTravelBelt beltItem = (ItemTravelBelt) belt.getItem(); - if(player.worldObj.isRemote) { + if(player.world.isRemote) { if((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F && !player.isInsideOfMaterial(Material.WATER)) { float speed = beltItem.getSpeed(belt); player.moveRelative(0F, 1F, player.capabilities.isFlying ? speed : speed); @@ -138,7 +138,7 @@ public class ItemTravelBelt extends ItemBauble implements IBaubleRender, IManaUs } public static String playerStr(EntityPlayer player) { - return player.getGameProfile().getName() + ":" + player.worldObj.isRemote; + return player.getGameProfile().getName() + ":" + player.world.isRemote; } @SideOnly(Side.CLIENT) diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemUnholyCloak.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemUnholyCloak.java index bf0214279..516d59f7b 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemUnholyCloak.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemUnholyCloak.java @@ -44,14 +44,14 @@ public class ItemUnholyCloak extends ItemHolyCloak { public boolean effectOnDamage(LivingHurtEvent event, EntityPlayer player, ItemStack stack) { if(!event.getSource().isUnblockable()) { int range = 6; - List mobs = player.worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range), Predicates.instanceOf(IMob.class)); + List mobs = player.world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range), Predicates.instanceOf(IMob.class)); for(IMob mob : (List) mobs) if(mob instanceof EntityLivingBase) { EntityLivingBase entity = (EntityLivingBase) mob; entity.attackEntityFrom(DamageSource.causePlayerDamage(player), event.getAmount()); } - player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.unholyCloak, SoundCategory.PLAYERS, 1F, 1F); + player.world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.unholyCloak, SoundCategory.PLAYERS, 1F, 1F); for(int i = 0; i < 90; i++) { float rad = i * 4F * (float) Math.PI / 180F; float xMotion = (float) Math.cos(rad) * 0.2F; diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemEnderDagger.java b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemEnderDagger.java index c98976255..bed026fff 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemEnderDagger.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemEnderDagger.java @@ -38,7 +38,7 @@ public class ItemEnderDagger extends ItemManasteelSword { @Override public boolean hitEntity(ItemStack stack, EntityLivingBase target, @Nonnull EntityLivingBase attacker) { - if(!target.worldObj.isRemote + if(!target.world.isRemote && target instanceof EntityEnderman && attacker instanceof EntityPlayer && ((EntityPlayer) attacker).getCooledAttackStrength(0) == 1) { @@ -63,7 +63,7 @@ public class ItemEnderDagger extends ItemManasteelSword { Multimap multimap = super.getItemAttributeModifiers(equipmentSlot); if (equipmentSlot == EntityEquipmentSlot.MAINHAND) { - multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -1.25, 0)); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -1.25, 0)); } return multimap; diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemStarSword.java b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemStarSword.java index b05c4d283..a4e446377 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemStarSword.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemStarSword.java @@ -61,7 +61,7 @@ public class ItemStarSword extends ItemManasteelSword implements ICraftAchieveme star.motionX = motVec.x; star.motionY = motVec.y; star.motionZ = motVec.z; - world.spawnEntityInWorld(star); + world.spawnEntity(star); if (!world.isRaining() && Math.abs(world.getWorldTime() - 18000) < 1800 @@ -71,7 +71,7 @@ public class ItemStarSword extends ItemManasteelSword implements ICraftAchieveme bonusStar.motionX = motVec.x + Math.random() - 0.5; bonusStar.motionY = motVec.y + Math.random() - 0.5; bonusStar.motionZ = motVec.z + Math.random() - 0.5; - world.spawnEntityInWorld(bonusStar); + world.spawnEntity(bonusStar); } ToolCommons.damageItem(par1ItemStack, 1, player, MANA_PER_DAMAGE); diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemThunderSword.java b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemThunderSword.java index b77cb2c8d..bb17bbc06 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemThunderSword.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemThunderSword.java @@ -60,9 +60,9 @@ public class ItemThunderSword extends ItemManasteelSword implements ICraftAchiev Random rand = new Random(lightningSeed); EntityLivingBase lightningSource = entity; - int hops = entity.worldObj.isThundering() ? 10 : 4; + int hops = entity.world.isThundering() ? 10 : 4; for(int i = 0; i < hops; i++) { - List entities = entity.worldObj.getEntitiesInAABBexcluding(lightningSource, new AxisAlignedBB(lightningSource.posX - range, lightningSource.posY - range, lightningSource.posZ - range, lightningSource.posX + range, lightningSource.posY + range, lightningSource.posZ + range), selector::test); + List entities = entity.world.getEntitiesInAABBexcluding(lightningSource, new AxisAlignedBB(lightningSource.posX - range, lightningSource.posY - range, lightningSource.posZ - range, lightningSource.posX + range, lightningSource.posY + range, lightningSource.posZ + range), selector::test); if(entities.isEmpty()) break; @@ -78,8 +78,8 @@ public class ItemThunderSword extends ItemManasteelSword implements ICraftAchiev dmg--; } - if(!entity.worldObj.isRemote) - ItemNBTHelper.setLong(stack, TAG_LIGHTNING_SEED, entity.worldObj.rand.nextLong()); + if(!entity.world.isRemote) + ItemNBTHelper.setLong(stack, TAG_LIGHTNING_SEED, entity.world.rand.nextLong()); } @@ -97,8 +97,8 @@ public class ItemThunderSword extends ItemManasteelSword implements ICraftAchiev Multimap multimap = super.getItemAttributeModifiers(equipmentSlot); if (equipmentSlot == EntityEquipmentSlot.MAINHAND) { - multimap.removeAll(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName()); - multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -1.5, 0)); + multimap.removeAll(SharedMonsterAttributes.ATTACK_SPEED.getName()); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -1.5, 0)); } return multimap; diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/ToolCommons.java b/src/main/java/vazkii/botania/common/item/equipment/tool/ToolCommons.java index 28a813d78..322c38d2d 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/ToolCommons.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/ToolCommons.java @@ -86,7 +86,7 @@ public final class ToolCommons { Material mat = world.getBlockState(pos).getMaterial(); if(!world.isRemote && blk != null && !blk.isAir(state, world, pos) && state.getPlayerRelativeBlockHardness(player, world, pos) > 0) { - if(!blk.canHarvestBlock(player.worldObj, pos, player) || !isRightMaterial(mat, materialsListing)) { + if(!blk.canHarvestBlock(player.world, pos, player) || !isRightMaterial(mat, materialsListing)) { return; } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemLivingwoodBow.java b/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemLivingwoodBow.java index e5750af86..b212c9c75 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemLivingwoodBow.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemLivingwoodBow.java @@ -167,7 +167,7 @@ public class ItemLivingwoodBow extends ItemBow implements IManaUsingItem, IModel entityarrow.pickupStatus = EntityArrow.PickupStatus.CREATIVE_ONLY; } - world.spawnEntityInWorld(entityarrow); + world.spawnEntity(entityarrow); onFire(stack, shooter, infinite, entityarrow); } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java index 92ec8d4b1..ce280c5d2 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java @@ -37,11 +37,11 @@ public class ItemElementiumAxe extends ItemManasteelAxe { if(event.isRecentlyHit() && event.getSource().getEntity() != null && event.getSource().getEntity() instanceof EntityPlayer) { ItemStack weapon = ((EntityPlayer) event.getSource().getEntity()).getHeldItemMainhand(); if(weapon != null && weapon.getItem() == this) { - Random rand = event.getEntityLiving().worldObj.rand; + Random rand = event.getEntityLiving().world.rand; int looting = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, weapon); if(event.getEntityLiving() instanceof EntitySkeleton && rand.nextInt(26) <= 3 + looting) - addDrop(event, new ItemStack(Items.SKULL, 1, ((EntitySkeleton) event.getEntityLiving()).func_189771_df().ordinal())); + addDrop(event, new ItemStack(Items.SKULL, 1, ((EntitySkeleton) event.getEntityLiving()).getSkeletonType().ordinal())); else if(event.getEntityLiving() instanceof EntityZombie && !(event.getEntityLiving() instanceof EntityPigZombie) && rand.nextInt(26) <= 2 + 2 * looting) addDrop(event, new ItemStack(Items.SKULL, 1, 2)); else if(event.getEntityLiving() instanceof EntityCreeper && rand.nextInt(26) <= 2 + 2 * looting) @@ -57,7 +57,7 @@ public class ItemElementiumAxe extends ItemManasteelAxe { } private void addDrop(LivingDropsEvent event, ItemStack drop) { - EntityItem entityitem = new EntityItem(event.getEntityLiving().worldObj, event.getEntityLiving().posX, event.getEntityLiving().posY, event.getEntityLiving().posZ, drop); + EntityItem entityitem = new EntityItem(event.getEntityLiving().world, event.getEntityLiving().posX, event.getEntityLiving().posY, event.getEntityLiving().posZ, drop); entityitem.setPickupDelay(10); event.getDrops().add(entityitem); } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShears.java b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShears.java index 8499aa17d..72915881e 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShears.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShears.java @@ -56,17 +56,17 @@ public class ItemElementiumShears extends ItemManasteelShears { @Override public void onUsingTick(ItemStack stack, EntityLivingBase living, int count) { - if(living.worldObj.isRemote) + if(living.world.isRemote) return; if(count != getMaxItemUseDuration(stack) && count % 5 == 0) { int range = 12; - List sheep = living.worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(living.posX - range, living.posY - range, living.posZ - range, living.posX + range, living.posY + range, living.posZ + range), Predicates.instanceOf(IShearable.class)); + List sheep = living.world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(living.posX - range, living.posY - range, living.posZ - range, living.posX + range, living.posY + range, living.posZ + range), Predicates.instanceOf(IShearable.class)); if(sheep.size() > 0) { for(IShearable target : (List) sheep) { Entity entity = (Entity) target; - if(target.isShearable(stack, entity.worldObj, new BlockPos(entity))) { - List drops = target.onSheared(stack, entity.worldObj, new BlockPos(entity), EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, stack)); + if(target.isShearable(stack, entity.world, new BlockPos(entity))) { + List drops = target.onSheared(stack, entity.world, new BlockPos(entity), EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, stack)); Random rand = new Random(); for(ItemStack drop : drops) { diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShovel.java b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShovel.java index 2f41b7764..7647d037b 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShovel.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShovel.java @@ -25,7 +25,7 @@ public class ItemElementiumShovel extends ItemManasteelShovel { @Override public boolean onBlockStartBreak(ItemStack stack, BlockPos pos, EntityPlayer player) { - World world = player.worldObj; + World world = player.world; Material mat = world.getBlockState(pos).getMaterial(); if (!ToolCommons.isRightMaterial(mat, materialsShovel)) return false; diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelShears.java b/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelShears.java index 44ca9b154..9821b34c3 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelShears.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/manasteel/ItemManasteelShears.java @@ -67,13 +67,13 @@ public class ItemManasteelShears extends ItemShears implements IManaUsingItem, I @Override public boolean itemInteractionForEntity(@Nonnull ItemStack itemstack, EntityPlayer player, EntityLivingBase entity, EnumHand hand) { - if(entity.worldObj.isRemote) + if(entity.world.isRemote) return false; if(entity instanceof IShearable) { IShearable target = (IShearable)entity; - if(target.isShearable(itemstack, entity.worldObj, new BlockPos(entity))) { - List drops = target.onSheared(itemstack, entity.worldObj, new BlockPos(entity), EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, itemstack)); + if(target.isShearable(itemstack, entity.world, new BlockPos(entity))) { + List drops = target.onSheared(itemstack, entity.world, new BlockPos(entity), EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, itemstack)); Random rand = new Random(); for(ItemStack stack : drops) { @@ -94,14 +94,14 @@ public class ItemManasteelShears extends ItemShears implements IManaUsingItem, I @Override public boolean onBlockStartBreak(@Nonnull ItemStack itemstack, @Nonnull BlockPos pos, EntityPlayer player) { - if (player.worldObj.isRemote) + if (player.world.isRemote) return false; - Block block = player.worldObj.getBlockState(pos).getBlock(); + Block block = player.world.getBlockState(pos).getBlock(); if(block instanceof IShearable) { IShearable target = (IShearable)block; - if(target.isShearable(itemstack, player.worldObj, pos)) { - List drops = target.onSheared(itemstack, player.worldObj, pos, EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, itemstack)); + if(target.isShearable(itemstack, player.world, pos)) { + List drops = target.onSheared(itemstack, player.world, pos, EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, itemstack)); Random rand = new Random(); for(ItemStack stack : drops) { @@ -110,9 +110,9 @@ public class ItemManasteelShears extends ItemShears implements IManaUsingItem, I double d1 = rand.nextFloat() * f + (1D - f) * 0.5; double d2 = rand.nextFloat() * f + (1D - f) * 0.5; - EntityItem entityitem = new EntityItem(player.worldObj, pos.getX() + d, pos.getY() + d1, pos.getZ() + d2, stack); + EntityItem entityitem = new EntityItem(player.world, pos.getX() + d, pos.getY() + d1, pos.getZ() + d2, stack); entityitem.setPickupDelay(10); - player.worldObj.spawnEntityInWorld(entityitem); + player.world.spawnEntity(entityitem); } ToolCommons.damageItem(itemstack, 1, player, MANA_PER_DAMAGE); diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java index d5e67baac..31bd70562 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraAxe.java @@ -93,7 +93,7 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker @Override public boolean onBlockStartBreak(ItemStack stack, BlockPos pos, EntityPlayer player) { - RayTraceResult raycast = ToolCommons.raytraceFromEntity(player.worldObj, player, true, 10); + RayTraceResult raycast = ToolCommons.raytraceFromEntity(player.world, player, true, 10); if(raycast != null) { breakOtherBlock(player, stack, pos, pos, raycast.sideHit); ItemLokiRing.breakOnAllCursors(player, this, stack, pos, raycast.sideHit); @@ -110,7 +110,7 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker @Override public void breakOtherBlock(EntityPlayer player, ItemStack stack, BlockPos pos, BlockPos originPos, EnumFacing side) { if(shouldBreak(player)) { - addBlockSwapper(player.worldObj, player, stack, pos, 32, true); + addBlockSwapper(player.world, player, stack, pos, 32, true); } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java index eb5a8366a..5ba2652e6 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java @@ -139,8 +139,8 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ @Override public boolean onBlockStartBreak(ItemStack stack, BlockPos pos, EntityPlayer player) { - RayTraceResult raycast = ToolCommons.raytraceFromEntity(player.worldObj, player, true, 10); - if(!player.worldObj.isRemote && raycast != null) { + RayTraceResult raycast = ToolCommons.raytraceFromEntity(player.world, player, true, 10); + if(!player.world.isRemote && raycast != null) { breakOtherBlock(player, stack, pos, pos, raycast.sideHit); ItemLokiRing.breakOnAllCursors(player, this, stack, pos, raycast.sideHit); // ^ Doable with API access through the IInternalMethodHandler. @@ -159,7 +159,7 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ if(!isEnabled(stack)) return; - World world = player.worldObj; + World world = player.world; Material mat = world.getBlockState(pos).getMaterial(); if(!ToolCommons.isRightMaterial(mat, MATERIALS)) return; diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraSword.java b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraSword.java index 4d969be0d..6c50d8ecc 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraSword.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraSword.java @@ -66,7 +66,7 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect, I @SubscribeEvent public void attackEntity(AttackEntityEvent evt) { - if (!evt.getEntityPlayer().worldObj.isRemote) { + if (!evt.getEntityPlayer().world.isRemote) { trySpawnBurst(evt.getEntityPlayer()); } } @@ -76,9 +76,9 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect, I && player.getHeldItemMainhand().getItem() == this && player.getCooledAttackStrength(0) == 1) { EntityManaBurst burst = getBurst(player, player.getHeldItemMainhand()); - player.worldObj.spawnEntityInWorld(burst); + player.world.spawnEntity(burst); ToolCommons.damageItem(player.getHeldItemMainhand(), 1, player, MANA_PER_DAMAGE); - player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.terraBlade, SoundCategory.PLAYERS, 0.4F, 1.4F); + player.world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.terraBlade, SoundCategory.PLAYERS, 0.4F, 1.4F); } } @@ -118,7 +118,7 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect, I public void updateBurst(IManaBurst burst, ItemStack stack) { EntityThrowable entity = (EntityThrowable) burst; AxisAlignedBB axis = new AxisAlignedBB(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(1, 1, 1); - List entities = entity.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis); + List entities = entity.world.getEntitiesWithinAABB(EntityLivingBase.class, axis); String attacker = ItemNBTHelper.getString(burst.getSourceLens(), TAG_ATTACKER_USERNAME, ""); for(EntityLivingBase living : entities) { @@ -131,8 +131,8 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect, I if(mana >= cost) { burst.setMana(mana - cost); float damage = 4F + BotaniaAPI.terrasteelToolMaterial.getDamageVsEntity(); - if(!burst.isFake() && !entity.worldObj.isRemote) { - EntityPlayer player = living.worldObj.getPlayerEntityByName(attacker); + if(!burst.isFake() && !entity.world.isRemote) { + EntityPlayer player = living.world.getPlayerEntityByName(attacker); living.attackEntityFrom(player == null ? DamageSource.magic : DamageSource.causePlayerDamage(player), damage); entity.setDead(); break; diff --git a/src/main/java/vazkii/botania/common/item/lens/ItemLens.java b/src/main/java/vazkii/botania/common/item/lens/ItemLens.java index 0c833471f..0ced7631b 100644 --- a/src/main/java/vazkii/botania/common/item/lens/ItemLens.java +++ b/src/main/java/vazkii/botania/common/item/lens/ItemLens.java @@ -221,7 +221,7 @@ public class ItemLens extends ItemMod implements ILensControl, ICompositableLens EntityThrowable entity = (EntityThrowable) burst; int storedColor = getStoredColor(stack); - if(storedColor == 16 && entity.worldObj.isRemote) + if(storedColor == 16 && entity.world.isRemote) burst.setColor(getLensColor(stack)); getLens(stack.getItemDamage()).updateBurst(burst, entity, stack); diff --git a/src/main/java/vazkii/botania/common/item/lens/LensDamage.java b/src/main/java/vazkii/botania/common/item/lens/LensDamage.java index fae8270d7..c79c1936b 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensDamage.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensDamage.java @@ -24,10 +24,10 @@ public class LensDamage extends Lens { @Override public void updateBurst(IManaBurst burst, EntityThrowable entity, ItemStack stack) { - if (entity.worldObj.isRemote) + if (entity.world.isRemote) return; AxisAlignedBB axis = new AxisAlignedBB(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(1, 1, 1); - List entities = entity.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis); + List entities = entity.world.getEntitiesWithinAABB(EntityLivingBase.class, axis); for(EntityLivingBase living : entities) { if(living instanceof EntityPlayer) continue; diff --git a/src/main/java/vazkii/botania/common/item/lens/LensExplosive.java b/src/main/java/vazkii/botania/common/item/lens/LensExplosive.java index 2da82df1d..73140e58e 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensExplosive.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensExplosive.java @@ -21,10 +21,10 @@ public class LensExplosive extends Lens { @Override public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { - if(!entity.worldObj.isRemote && !burst.isFake()) { + if(!entity.world.isRemote && !burst.isFake()) { BlockPos coords = burst.getBurstSourceBlockPos(); if(pos.entityHit == null && !isManaBlock && (pos.getBlockPos() == null || !coords.equals(pos.getBlockPos()))) - entity.worldObj.createExplosion(entity, entity.posX, entity.posY, entity.posZ, burst.getMana() / 50F, true); + entity.world.createExplosion(entity, entity.posX, entity.posY, entity.posZ, burst.getMana() / 50F, true); } else dead = false; return dead; diff --git a/src/main/java/vazkii/botania/common/item/lens/LensFire.java b/src/main/java/vazkii/botania/common/item/lens/LensFire.java index 74c006369..9b678c2ee 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensFire.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensFire.java @@ -28,24 +28,24 @@ public class LensFire extends Lens { public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult rtr, boolean isManaBlock, boolean dead, ItemStack stack) { BlockPos coords = burst.getBurstSourceBlockPos(); BlockPos pos = rtr.getBlockPos(); - if(!entity.worldObj.isRemote && pos != null && !coords.equals(pos) && !burst.isFake() && !isManaBlock) { + if(!entity.world.isRemote && pos != null && !coords.equals(pos) && !burst.isFake() && !isManaBlock) { EnumFacing dir = rtr.sideHit; BlockPos offPos = pos.offset(dir); - Block blockAt = entity.worldObj.getBlockState(pos).getBlock(); - Block blockAtOffset = entity.worldObj.getBlockState(offPos).getBlock(); + Block blockAt = entity.world.getBlockState(pos).getBlock(); + Block blockAtOffset = entity.world.getBlockState(offPos).getBlock(); if(blockAt == Blocks.PORTAL) - entity.worldObj.setBlockState(pos, Blocks.AIR.getDefaultState()); + entity.world.setBlockState(pos, Blocks.AIR.getDefaultState()); if(blockAtOffset == Blocks.PORTAL) - entity.worldObj.setBlockState(offPos, Blocks.AIR.getDefaultState()); + entity.world.setBlockState(offPos, Blocks.AIR.getDefaultState()); else if(blockAt == ModBlocks.incensePlate) { - TileIncensePlate plate = (TileIncensePlate) entity.worldObj.getTileEntity(pos); + TileIncensePlate plate = (TileIncensePlate) entity.world.getTileEntity(pos); plate.ignite(); VanillaPacketDispatcher.dispatchTEToNearbyPlayers(plate); - } else if(blockAtOffset.isAir(entity.worldObj.getBlockState(offPos), entity.worldObj, offPos)) - entity.worldObj.setBlockState(offPos, Blocks.FIRE.getDefaultState()); + } else if(blockAtOffset.isAir(entity.world.getBlockState(offPos), entity.world, offPos)) + entity.world.setBlockState(offPos, Blocks.FIRE.getDefaultState()); } return dead; diff --git a/src/main/java/vazkii/botania/common/item/lens/LensFirework.java b/src/main/java/vazkii/botania/common/item/lens/LensFirework.java index 17d3c2521..206e0e66f 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensFirework.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensFirework.java @@ -25,13 +25,13 @@ public class LensFirework extends Lens { @Override public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { - if(!entity.worldObj.isRemote && !burst.isFake()) { + if(!entity.world.isRemote && !burst.isFake()) { BlockPos coords = burst.getBurstSourceBlockPos(); if(pos.entityHit == null && !isManaBlock && (pos.getBlockPos() == null || !pos.getBlockPos().equals(coords))) { ItemStack fireworkStack = generateFirework(burst.getColor()); - EntityFireworkRocket rocket = new EntityFireworkRocket(entity.worldObj, entity.posX, entity.posY, entity.posZ, fireworkStack); - entity.worldObj.spawnEntityInWorld(rocket); + EntityFireworkRocket rocket = new EntityFireworkRocket(entity.world, entity.posX, entity.posY, entity.posZ, fireworkStack); + entity.world.spawnEntity(rocket); } } else dead = false; diff --git a/src/main/java/vazkii/botania/common/item/lens/LensInfluence.java b/src/main/java/vazkii/botania/common/item/lens/LensInfluence.java index 2ec4f198b..19ed4199a 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensInfluence.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensInfluence.java @@ -31,11 +31,11 @@ public class LensInfluence extends Lens { public void updateBurst(IManaBurst burst, EntityThrowable entity, ItemStack stack) { if(!burst.isFake()) { double range = 3.5; - List movables = entity.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range)); - movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); - movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityArrow.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); - movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityFallingBlock.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); - movables.addAll(entity.worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range), Predicates.instanceOf(IManaBurst.class))); + List movables = entity.world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range)); + movables.addAll(entity.world.getEntitiesWithinAABB(EntityXPOrb.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); + movables.addAll(entity.world.getEntitiesWithinAABB(EntityArrow.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); + movables.addAll(entity.world.getEntitiesWithinAABB(EntityFallingBlock.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); + movables.addAll(entity.world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range), Predicates.instanceOf(IManaBurst.class))); for(Entity movable : movables) { if(movable == burst) diff --git a/src/main/java/vazkii/botania/common/item/lens/LensLight.java b/src/main/java/vazkii/botania/common/item/lens/LensLight.java index 2fbcf62b2..df2e61f28 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensLight.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensLight.java @@ -26,17 +26,17 @@ public class LensLight extends Lens { @Override public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { BlockPos coords = burst.getBurstSourceBlockPos(); - if(!entity.worldObj.isRemote && pos.getBlockPos() != null && !coords.equals(pos.getBlockPos()) && !burst.isFake() && !isManaBlock) { + if(!entity.world.isRemote && pos.getBlockPos() != null && !coords.equals(pos.getBlockPos()) && !burst.isFake() && !isManaBlock) { BlockPos pos_ = pos.getBlockPos().offset(pos.sideHit); - Block blockAt = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock(); - Block blockAt_ = entity.worldObj.getBlockState(pos_).getBlock(); + Block blockAt = entity.world.getBlockState(pos.getBlockPos()).getBlock(); + Block blockAt_ = entity.world.getBlockState(pos_).getBlock(); if(blockAt == ModBlocks.manaFlame) - entity.worldObj.setBlockState(pos.getBlockPos(), Blocks.AIR.getDefaultState()); - else if(blockAt_.isAir(entity.worldObj.getBlockState(pos_), entity.worldObj, pos_) || blockAt_.isReplaceable(entity.worldObj, pos_)) { - entity.worldObj.setBlockState(pos_, ModBlocks.manaFlame.getDefaultState()); - TileEntity tile = entity.worldObj.getTileEntity(pos_); + entity.world.setBlockState(pos.getBlockPos(), Blocks.AIR.getDefaultState()); + else if(blockAt_.isAir(entity.world.getBlockState(pos_), entity.world, pos_) || blockAt_.isReplaceable(entity.world, pos_)) { + entity.world.setBlockState(pos_, ModBlocks.manaFlame.getDefaultState()); + TileEntity tile = entity.world.getTileEntity(pos_); if(tile instanceof TileManaFlame) ((TileManaFlame) tile).setColor(burst.getColor()); diff --git a/src/main/java/vazkii/botania/common/item/lens/LensMagnet.java b/src/main/java/vazkii/botania/common/item/lens/LensMagnet.java index ee221b819..50d2df626 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensMagnet.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensMagnet.java @@ -33,8 +33,8 @@ public class LensMagnet extends Lens { magnetize : { for (BlockPos pos : BlockPos.getAllInBox(basePos.add(-range, -range, -range), basePos.add(range, range, range))) { - if(entity.worldObj.getTileEntity(pos) instanceof IManaReceiver) { - TileEntity tile = entity.worldObj.getTileEntity(pos); + if(entity.world.getTileEntity(pos) instanceof IManaReceiver) { + TileEntity tile = entity.world.getTileEntity(pos); if(magnetized) { int magX = entity.getEntityData().getInteger(TAG_MAGNETIZED_X); diff --git a/src/main/java/vazkii/botania/common/item/lens/LensMine.java b/src/main/java/vazkii/botania/common/item/lens/LensMine.java index a7a14d970..13fa60a9a 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensMine.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensMine.java @@ -33,7 +33,7 @@ public class LensMine extends Lens { @Override public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { - World world = entity.worldObj; + World world = entity.world; BlockPos pos_ = pos.getBlockPos(); if (world.isRemote || pos_ == null) @@ -63,10 +63,10 @@ public class LensMine extends Lens { items.addAll(block.getDrops(world, pos_, world.getBlockState(pos_), 0)); if(!burst.hasAlreadyCollidedAt(pos_)) { - if(!burst.isFake() && !entity.worldObj.isRemote) { + if(!burst.isFake() && !entity.world.isRemote) { world.setBlockToAir(pos_); if(ConfigHandler.blockBreakParticles) - entity.worldObj.playEvent(2001, pos_, Block.getStateId(state)); + entity.world.playEvent(2001, pos_, Block.getStateId(state)); boolean offBounds = coords.getY() < 0; boolean doWarp = warp && !offBounds; @@ -75,7 +75,7 @@ public class LensMine extends Lens { int dropZ = doWarp ? coords.getZ() : pos_.getZ(); for(ItemStack stack_ : items) - world.spawnEntityInWorld(new EntityItem(world, dropX + 0.5, dropY + 0.5, dropZ + 0.5, stack_)); + world.spawnEntity(new EntityItem(world, dropX + 0.5, dropY + 0.5, dropZ + 0.5, stack_)); burst.setMana(mana - 24); } diff --git a/src/main/java/vazkii/botania/common/item/lens/LensPaint.java b/src/main/java/vazkii/botania/common/item/lens/LensPaint.java index 232460a73..1b8566792 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensPaint.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensPaint.java @@ -33,20 +33,20 @@ public class LensPaint extends Lens { @Override public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { int storedColor = ItemLens.getStoredColor(stack); - if(!entity.worldObj.isRemote && !burst.isFake() && storedColor > -1 && storedColor < 17) { + if(!entity.world.isRemote && !burst.isFake() && storedColor > -1 && storedColor < 17) { if(pos.entityHit != null && pos.entityHit instanceof EntitySheep) { int r = 20; EnumDyeColor sheepColor = ((EntitySheep) pos.entityHit).getFleeceColor(); - List sheepList = entity.worldObj.getEntitiesWithinAABB(EntitySheep.class, new AxisAlignedBB(pos.entityHit.posX - r, pos.entityHit.posY - r, pos.entityHit.posZ - r, pos.entityHit.posX + r, pos.entityHit.posY + r, pos.entityHit.posZ + r)); + List sheepList = entity.world.getEntitiesWithinAABB(EntitySheep.class, new AxisAlignedBB(pos.entityHit.posX - r, pos.entityHit.posY - r, pos.entityHit.posZ - r, pos.entityHit.posX + r, pos.entityHit.posY + r, pos.entityHit.posZ + r)); for(EntitySheep sheep : sheepList) { if(sheep.getFleeceColor() == sheepColor) - sheep.setFleeceColor(EnumDyeColor.byMetadata(storedColor == 16 ? sheep.worldObj.rand.nextInt(16) : storedColor)); + sheep.setFleeceColor(EnumDyeColor.byMetadata(storedColor == 16 ? sheep.world.rand.nextInt(16) : storedColor)); } dead = true; } else if (pos.getBlockPos() != null) { - Block block = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock(); + Block block = entity.world.getBlockState(pos.getBlockPos()).getBlock(); if(BotaniaAPI.paintableBlocks.containsKey(block)) { - IBlockState state = entity.worldObj.getBlockState(pos.getBlockPos()); + IBlockState state = entity.world.getBlockState(pos.getBlockPos()); List coordsToPaint = new ArrayList<>(); List coordsFound = new ArrayList<>(); @@ -60,7 +60,7 @@ public class LensPaint extends Lens { coordsToPaint.add(coords); for(EnumFacing dir : EnumFacing.VALUES) { - IBlockState state_ = entity.worldObj.getBlockState(coords.offset(dir)); + IBlockState state_ = entity.world.getBlockState(coords.offset(dir)); BlockPos coords_ = new BlockPos(coords.offset(dir)); if(state_ == state && !coordsFound.contains(coords_) && !coordsToPaint.contains(coords_)) coordsFound.add(coords_); @@ -69,13 +69,13 @@ public class LensPaint extends Lens { } while(!coordsFound.isEmpty() && coordsToPaint.size() < 1000); for(BlockPos coords : coordsToPaint) { - EnumDyeColor placeColor = EnumDyeColor.byMetadata(storedColor == 16 ? entity.worldObj.rand.nextInt(16) : storedColor); - IBlockState stateThere = entity.worldObj.getBlockState(coords); + EnumDyeColor placeColor = EnumDyeColor.byMetadata(storedColor == 16 ? entity.world.rand.nextInt(16) : storedColor); + IBlockState stateThere = entity.world.getBlockState(coords); if(stateThere.getValue(BotaniaAPI.paintableBlocks.get(block)) != placeColor && BotaniaAPI.paintableBlocks.get(block).getAllowedValues().contains(placeColor)) { - entity.worldObj.setBlockState(coords, stateThere.withProperty(BotaniaAPI.paintableBlocks.get(block), placeColor), 2); - PacketHandler.sendToNearby(entity.worldObj, coords, + entity.world.setBlockState(coords, stateThere.withProperty(BotaniaAPI.paintableBlocks.get(block), placeColor), 2); + PacketHandler.sendToNearby(entity.world, coords, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.PAINT_LENS, coords.getX(), coords.getY(), coords.getZ(), placeColor.getMetadata())); } } diff --git a/src/main/java/vazkii/botania/common/item/lens/LensPiston.java b/src/main/java/vazkii/botania/common/item/lens/LensPiston.java index a4d4b7965..dd5f7f1b7 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensPiston.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensPiston.java @@ -25,16 +25,16 @@ public class LensPiston extends Lens { @Override public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { BlockPos coords = burst.getBurstSourceBlockPos(); - if(!entity.worldObj.isRemote && pos.getBlockPos() != null && !coords.equals(pos.getBlockPos()) && !burst.isFake() && !isManaBlock) { + if(!entity.world.isRemote && pos.getBlockPos() != null && !coords.equals(pos.getBlockPos()) && !burst.isFake() && !isManaBlock) { BlockPos pos_ = pos.getBlockPos().offset(pos.sideHit.getOpposite()); - if(entity.worldObj.isAirBlock(pos_) || entity.worldObj.getBlockState(pos_).getBlock().isReplaceable(entity.worldObj, pos_)) { - IBlockState state = entity.worldObj.getBlockState(pos.getBlockPos()); - TileEntity tile = entity.worldObj.getTileEntity(pos.getBlockPos()); + if(entity.world.isAirBlock(pos_) || entity.world.getBlockState(pos_).getBlock().isReplaceable(entity.world, pos_)) { + IBlockState state = entity.world.getBlockState(pos.getBlockPos()); + TileEntity tile = entity.world.getTileEntity(pos.getBlockPos()); - if(state.getMobilityFlag() == EnumPushReaction.NORMAL && state.getBlock() != Blocks.OBSIDIAN && state.getBlockHardness(entity.worldObj, pos_) >= 0 && tile == null) { - entity.worldObj.destroyBlock(pos.getBlockPos(), false); - entity.worldObj.setBlockState(pos_, state, 1 | 2); + if(state.getMobilityFlag() == EnumPushReaction.NORMAL && state.getBlock() != Blocks.OBSIDIAN && state.getBlockHardness(entity.world, pos_) >= 0 && tile == null) { + entity.world.destroyBlock(pos.getBlockPos(), false); + entity.world.setBlockState(pos_, state, 1 | 2); } } } diff --git a/src/main/java/vazkii/botania/common/item/lens/LensRedirect.java b/src/main/java/vazkii/botania/common/item/lens/LensRedirect.java index 0eb9c91af..6c4bff116 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensRedirect.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensRedirect.java @@ -26,15 +26,15 @@ public class LensRedirect extends Lens { @Override public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { BlockPos coords = burst.getBurstSourceBlockPos(); - if(!entity.worldObj.isRemote && pos.entityHit == null && coords.getY() != -1 && (pos.getBlockPos() == null || !pos.getBlockPos().equals(coords))) { - TileEntity tile = entity.worldObj.getTileEntity(pos.getBlockPos()); + if(!entity.world.isRemote && pos.entityHit == null && coords.getY() != -1 && (pos.getBlockPos() == null || !pos.getBlockPos().equals(coords))) { + TileEntity tile = entity.world.getTileEntity(pos.getBlockPos()); if(tile != null && tile instanceof IDirectioned) { if(!burst.isFake()) { IDirectioned redir = (IDirectioned) tile; Vector3 tileVec = Vector3.fromTileEntityCenter(tile); Vector3 sourceVec = new Vector3(coords.getX() + 0.5, coords.getY() + 0.5, coords.getZ() + 0.5); - AxisAlignedBB axis = entity.worldObj.getBlockState(coords).getCollisionBoundingBox(entity.worldObj, coords).offset(coords); + AxisAlignedBB axis = entity.world.getBlockState(coords).getCollisionBoundingBox(entity.world, coords).offset(coords); if(axis == null) axis = new AxisAlignedBB(coords, coords.add(1, 1, 1)); diff --git a/src/main/java/vazkii/botania/common/item/lens/LensStorm.java b/src/main/java/vazkii/botania/common/item/lens/LensStorm.java index 60502b23a..f7bcb512a 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensStorm.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensStorm.java @@ -20,10 +20,10 @@ public class LensStorm extends Lens { @Override public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { - if(!entity.worldObj.isRemote && !burst.isFake()) { + if(!entity.world.isRemote && !burst.isFake()) { BlockPos coords = burst.getBurstSourceBlockPos(); if(pos.entityHit == null && !isManaBlock && (pos.getBlockPos() == null || !coords.equals(pos.getBlockPos()))) - entity.worldObj.createExplosion(entity, entity.posX, entity.posY, entity.posZ, 5F, true); + entity.world.createExplosion(entity, entity.posX, entity.posY, entity.posZ, 5F, true); } else dead = false; return dead; diff --git a/src/main/java/vazkii/botania/common/item/lens/LensTripwire.java b/src/main/java/vazkii/botania/common/item/lens/LensTripwire.java index 08ccda287..4dd893ced 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensTripwire.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensTripwire.java @@ -34,11 +34,11 @@ public class LensTripwire extends Lens { @Override public void updateBurst(IManaBurst burst, EntityThrowable entity, ItemStack stack) { if(burst.isFake()) { - if(entity.worldObj.isRemote) + if(entity.world.isRemote) return; AxisAlignedBB axis = new AxisAlignedBB(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(0.25, 0.25, 0.25); - List entities = entity.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis); + List entities = entity.world.getEntitiesWithinAABB(EntityLivingBase.class, axis); if(!entities.isEmpty()) { Entity e = (Entity) burst; e.getEntityData().setBoolean(TAG_TRIPPED, true); diff --git a/src/main/java/vazkii/botania/common/item/lens/LensWarp.java b/src/main/java/vazkii/botania/common/item/lens/LensWarp.java index c3b0a9594..9a5e98e46 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensWarp.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensWarp.java @@ -28,11 +28,11 @@ public class LensWarp extends Lens { if(burst.isFake() || pos.getBlockPos() == null) return dead; - Block block = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock(); + Block block = entity.world.getBlockState(pos.getBlockPos()).getBlock(); if(block == ModBlocks.pistonRelay) { - BlockPistonRelay.DimWithPos key = ((BlockPistonRelay) ModBlocks.pistonRelay).mappedPositions.get(new BlockPistonRelay.DimWithPos(entity.worldObj.provider.getDimension(), pos.getBlockPos())); + BlockPistonRelay.DimWithPos key = ((BlockPistonRelay) ModBlocks.pistonRelay).mappedPositions.get(new BlockPistonRelay.DimWithPos(entity.world.provider.getDimension(), pos.getBlockPos())); if(key != null) { - if(key.dim == entity.worldObj.provider.getDimension()) { + if(key.dim == entity.world.provider.getDimension()) { entity.setPosition(key.blockPos.getX() + 0.5, key.blockPos.getY() + 0.5, key.blockPos.getZ() + 0.5); burst.setCollidedAt(key.blockPos); diff --git a/src/main/java/vazkii/botania/common/item/lens/LensWeight.java b/src/main/java/vazkii/botania/common/item/lens/LensWeight.java index eb728040e..889106611 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensWeight.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensWeight.java @@ -33,19 +33,19 @@ public class LensWeight extends Lens { @Override public boolean collideBurst(IManaBurst burst, EntityThrowable entity, RayTraceResult pos, boolean isManaBlock, boolean dead, ItemStack stack) { - if(!entity.worldObj.isRemote && !burst.isFake() && pos.getBlockPos() != null) { + if(!entity.world.isRemote && !burst.isFake() && pos.getBlockPos() != null) { int harvestLevel = ConfigHandler.harvestLevelWeight; - Block block = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock(); - IBlockState state = entity.worldObj.getBlockState(pos.getBlockPos()); + Block block = entity.world.getBlockState(pos.getBlockPos()).getBlock(); + IBlockState state = entity.world.getBlockState(pos.getBlockPos()); int neededHarvestLevel = block.getHarvestLevel(state); - if(entity.worldObj.isAirBlock(pos.getBlockPos().down()) && state.getBlockHardness(entity.worldObj, pos.getBlockPos()) != -1 && neededHarvestLevel <= harvestLevel && entity.worldObj.getTileEntity(pos.getBlockPos()) == null && block.canSilkHarvest(entity.worldObj, pos.getBlockPos(), state, null)) { + if(entity.world.isAirBlock(pos.getBlockPos().down()) && state.getBlockHardness(entity.world, pos.getBlockPos()) != -1 && neededHarvestLevel <= harvestLevel && entity.world.getTileEntity(pos.getBlockPos()) == null && block.canSilkHarvest(entity.world, pos.getBlockPos(), state, null)) { state = TECHNICAL_BLOCK_REMAP.getOrDefault(state, state); - EntityFallingBlock falling = new EntityFallingBlock(entity.worldObj, pos.getBlockPos().getX() + 0.5, pos.getBlockPos().getY() + 0.5, pos.getBlockPos().getZ() + 0.5, state); + EntityFallingBlock falling = new EntityFallingBlock(entity.world, pos.getBlockPos().getX() + 0.5, pos.getBlockPos().getY() + 0.5, pos.getBlockPos().getZ() + 0.5, state); falling.fallTime = 1; - entity.worldObj.setBlockToAir(pos.getBlockPos()); - entity.worldObj.spawnEntityInWorld(falling); + entity.world.setBlockToAir(pos.getBlockPos()); + entity.world.spawnEntity(falling); } } diff --git a/src/main/java/vazkii/botania/common/item/material/ItemManaResource.java b/src/main/java/vazkii/botania/common/item/material/ItemManaResource.java index 54aa9ae42..57dfa229b 100644 --- a/src/main/java/vazkii/botania/common/item/material/ItemManaResource.java +++ b/src/main/java/vazkii/botania/common/item/material/ItemManaResource.java @@ -112,7 +112,7 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve if(!world.isRemote) { EntityEnderAirBottle b = new EntityEnderAirBottle(world, player); b.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0F, 1.5F, 1F); - world.spawnEntityInWorld(b); + world.spawnEntity(b); } else player.swingArm(hand); return ActionResult.newResult(EnumActionResult.SUCCESS, par1ItemStack); diff --git a/src/main/java/vazkii/botania/common/item/material/ItemPetal.java b/src/main/java/vazkii/botania/common/item/material/ItemPetal.java index 1dfb2fab7..77939ef2d 100644 --- a/src/main/java/vazkii/botania/common/item/material/ItemPetal.java +++ b/src/main/java/vazkii/botania/common/item/material/ItemPetal.java @@ -52,7 +52,7 @@ public class ItemPetal extends Item16Colors implements IFlowerComponent { if (stack.stackSize != 0 && player.canPlayerEdit(pos, facing, stack) && world.canBlockBePlaced(ModBlocks.buriedPetals, pos, false, facing, null, stack)) { int i = this.getMetadata(stack.getMetadata()); - IBlockState iblockstate1 = ModBlocks.buriedPetals.onBlockPlaced(world, pos, facing, hitX, hitY, hitZ, i, player); + IBlockState iblockstate1 = ModBlocks.buriedPetals.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, i, player); if (placeBlockAt(stack, player, world, pos, facing, hitX, hitY, hitZ, iblockstate1)) { @@ -85,7 +85,7 @@ public class ItemPetal extends Item16Colors implements IFlowerComponent { @Override public int getMetadata(int stackMeta) { - return MathHelper.clamp_int(stackMeta, 0, 15); + return MathHelper.clamp(stackMeta, 0, 15); } @Override diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemAesirRing.java b/src/main/java/vazkii/botania/common/item/relic/ItemAesirRing.java index 7cd9f8734..21cb6d206 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemAesirRing.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemAesirRing.java @@ -54,7 +54,7 @@ public class ItemAesirRing extends ItemRelicBauble implements IWireframeCoordina @SubscribeEvent public void onDropped(ItemTossEvent event) { - if(event.getEntityItem() != null && event.getEntityItem().getEntityItem() != null && !event.getEntityItem().worldObj.isRemote) { + if(event.getEntityItem() != null && event.getEntityItem().getEntityItem() != null && !event.getEntityItem().world.isRemote) { ItemStack stack = event.getEntityItem().getEntityItem(); if(stack.getItem() != null && stack.getItem() == this) { event.getEntityItem().setDead(); @@ -63,7 +63,7 @@ public class ItemAesirRing extends ItemRelicBauble implements IWireframeCoordina for(Item item : new Item[] { ModItems.thorRing, ModItems.lokiRing, ModItems.odinRing }) { ItemStack stack1 = new ItemStack(item); bindToUUID(user, stack1); - EntityItem entity = new EntityItem(event.getEntityItem().worldObj, event.getEntityItem().posX, event.getEntityItem().posY, event.getEntityItem().posZ, stack1); + EntityItem entity = new EntityItem(event.getEntityItem().world, event.getEntityItem().posX, event.getEntityItem().posY, event.getEntityItem().posZ, stack1); entity.motionX = event.getEntityItem().motionX; entity.motionY = event.getEntityItem().motionY; entity.motionZ = event.getEntityItem().motionZ; @@ -78,7 +78,7 @@ public class ItemAesirRing extends ItemRelicBauble implements IWireframeCoordina } catch (Throwable ignored) {} entity.setPickupDelay(pickupDelay); - entity.worldObj.spawnEntityInWorld(entity); + entity.world.spawnEntity(entity); } } } @@ -123,7 +123,7 @@ public class ItemAesirRing extends ItemRelicBauble implements IWireframeCoordina if(stack == null) // workaround for Azanor/Baubles#156 return; - attributes.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 20, 0)); + attributes.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 20, 0)); } @Override diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemDice.java b/src/main/java/vazkii/botania/common/item/relic/ItemDice.java index a702e2ea1..75519787d 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemDice.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemDice.java @@ -53,7 +53,7 @@ public class ItemDice extends ItemRelic { @Nonnull @Override public ActionResult onItemRightClick(@Nonnull ItemStack stack, World world, EntityPlayer player, EnumHand hand) { - if(isRightPlayer(player, stack) && !player.worldObj.isRemote) { + if(isRightPlayer(player, stack) && !player.world.isRemote) { int moonPhase = world.provider.getMoonPhase(world.getWorldTime()); int relic = SIDES_FOR_MOON_PHASES[moonPhase]; if(hasRelicAlready(player, relic)) { @@ -72,12 +72,12 @@ public class ItemDice extends ItemRelic { world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); if(hasRelicAlready(player, relic)) { - player.addChatMessage(new TextComponentTranslation("botaniamisc.dudDiceRoll", relic + 1).setStyle(new Style().setColor(TextFormatting.DARK_GREEN))); + player.sendMessage(new TextComponentTranslation("botaniamisc.dudDiceRoll", relic + 1).setStyle(new Style().setColor(TextFormatting.DARK_GREEN))); stack.stackSize--; return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } - player.addChatMessage(new TextComponentTranslation("botaniamisc.diceRoll", relic + 1).setStyle(new Style().setColor(TextFormatting.DARK_GREEN))); + player.sendMessage(new TextComponentTranslation("botaniamisc.diceRoll", relic + 1).setStyle(new Style().setColor(TextFormatting.DARK_GREEN))); return ActionResult.newResult(EnumActionResult.SUCCESS, relicStacks[relic].copy()); } diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemFlugelEye.java b/src/main/java/vazkii/botania/common/item/relic/ItemFlugelEye.java index 4a7c67caa..f1bbb1f16 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemFlugelEye.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemFlugelEye.java @@ -114,8 +114,8 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs float z = (float) (entity.posZ + Math.random()); Botania.proxy.wispFX(x, y, z, (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), -0.3F + (float) Math.random() * 0.2F); } - if(!entity.worldObj.isRemote) - entity.worldObj.playSound(null, entity.posX, entity.posY, entity.posZ, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.PLAYERS, 1F, 1F); + if(!entity.world.isRemote) + entity.world.playSound(null, entity.posX, entity.posY, entity.posZ, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.PLAYERS, 1F, 1F); } @Override diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemKingKey.java b/src/main/java/vazkii/botania/common/item/relic/ItemKingKey.java index e9116af58..571c7fd24 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemKingKey.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemKingKey.java @@ -63,7 +63,7 @@ public class ItemKingKey extends ItemRelic implements IManaUsingItem { public void onUsingTick(ItemStack stack, EntityLivingBase living, int count) { int spawned = getWeaponsSpawned(stack); - if(count != getMaxItemUseDuration(stack) && spawned < 20 && !living.worldObj.isRemote && (!(living instanceof EntityPlayer) || ManaItemHandler.requestManaExact(stack, (EntityPlayer) living, 150, true))) { + if(count != getMaxItemUseDuration(stack) && spawned < 20 && !living.world.isRemote && (!(living instanceof EntityPlayer) || ManaItemHandler.requestManaExact(stack, (EntityPlayer) living, 150, true))) { Vector3 look = new Vector3(living.getLookVec()).multiply(1, 0, 1).normalize().multiply(-2);; int div = spawned / 5; @@ -71,7 +71,7 @@ public class ItemKingKey extends ItemRelic implements IManaUsingItem { Vector3 pl = look.add(Vector3.fromEntityCenter(living)).add(0, 1.6, div * 0.1); - Random rand = living.worldObj.rand; + Random rand = living.world.rand; Vector3 axis = look.normalize().crossProduct(new Vector3(-1, 0, -1)).normalize(); double rot = mod * Math.PI / 4 - Math.PI / 2; @@ -82,7 +82,7 @@ public class ItemKingKey extends ItemRelic implements IManaUsingItem { Vector3 end = pl.add(axis1); - EntityBabylonWeapon weapon = new EntityBabylonWeapon(living.worldObj, living); + EntityBabylonWeapon weapon = new EntityBabylonWeapon(living.world, living); weapon.posX = end.x; weapon.posY = end.y; weapon.posZ = end.z; @@ -91,8 +91,8 @@ public class ItemKingKey extends ItemRelic implements IManaUsingItem { weapon.setDelay(spawned); weapon.setRotation(MathHelper.wrapDegrees(-living.rotationYaw + 180)); - living.worldObj.spawnEntityInWorld(weapon); - weapon.playSound(BotaniaSoundEvents.babylonSpawn, 1F, 1F + living.worldObj.rand.nextFloat() * 3F); + living.world.spawnEntity(weapon); + weapon.playSound(BotaniaSoundEvents.babylonSpawn, 1F, 1F + living.world.rand.nextFloat() * 3F); setWeaponsSpawned(stack, spawned + 1); } } diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemLokiRing.java b/src/main/java/vazkii/botania/common/item/relic/ItemLokiRing.java index e155858f5..ed7168595 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemLokiRing.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemLokiRing.java @@ -68,7 +68,7 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat public static void onPlayerInteract(PlayerInteractEvent.RightClickBlock event) { EntityPlayer player = event.getEntityPlayer(); ItemStack lokiRing = getLokiRing(player); - if(lokiRing == null || player.worldObj.isRemote) + if(lokiRing == null || player.world.isRemote) return; int slot = -1; @@ -83,7 +83,7 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat ItemStack heldItemStack = event.getItemStack(); BlockPos originCoords = getOriginPos(lokiRing); - RayTraceResult lookPos = ToolCommons.raytraceFromEntity(player.worldObj, player, true, 10F); + RayTraceResult lookPos = ToolCommons.raytraceFromEntity(player.world, player, true, 10F); List cursors = getCursorList(lokiRing); int cursorCount = cursors.size(); @@ -119,8 +119,8 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat for(BlockPos cursor : cursors) { BlockPos pos = lookPos.getBlockPos().add(cursor); Item item = heldItemStack.getItem(); - if(!player.worldObj.isAirBlock(pos) && ManaItemHandler.requestManaExact(lokiRing, player, cost, true)) { - item.onItemUse(player.capabilities.isCreativeMode ? heldItemStack.copy() : heldItemStack, player, player.worldObj, pos, event.getHand(), lookPos.sideHit, (float) lookPos.hitVec.xCoord - pos.getX(), (float) lookPos.hitVec.yCoord - pos.getY(), (float) lookPos.hitVec.zCoord - pos.getZ()); + if(!player.world.isAirBlock(pos) && ManaItemHandler.requestManaExact(lokiRing, player, cost, true)) { + item.onItemUse(player.capabilities.isCreativeMode ? heldItemStack.copy() : heldItemStack, player, player.world, pos, event.getHand(), lookPos.sideHit, (float) lookPos.hitVec.xCoord - pos.getX(), (float) lookPos.hitVec.yCoord - pos.getY(), (float) lookPos.hitVec.zCoord - pos.getZ()); if(heldItemStack.stackSize == 0) { event.setCanceled(true); return; @@ -132,12 +132,12 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat public static void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, BlockPos pos, EnumFacing side) { ItemStack lokiRing = getLokiRing(player); - if(lokiRing == null || player.worldObj.isRemote || !(item instanceof ISequentialBreaker)) + if(lokiRing == null || player.world.isRemote || !(item instanceof ISequentialBreaker)) return; List cursors = getCursorList(lokiRing); ISequentialBreaker breaker = (ISequentialBreaker) item; - World world = player.worldObj; + World world = player.world; boolean silk = EnchantmentHelper.getEnchantmentLevel(Enchantments.SILK_TOUCH, stack) > 0; int fortune = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, stack); boolean dispose = breaker.disposeOfTrashBlocks(stack); @@ -145,7 +145,7 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat for (BlockPos coords : cursors) { IBlockState state = world.getBlockState(coords); breaker.breakOtherBlock(player, stack, coords, coords, side); - ToolCommons.removeBlockWithDrops(player, stack, player.worldObj, coords, pos, state.getBlock(), new Material[]{state.getMaterial()}, silk, fortune, state.getBlockHardness(world, coords), dispose); + ToolCommons.removeBlockWithDrops(player, stack, player.world, coords, pos, state.getBlock(), new Material[]{state.getMaterial()}, silk, fortune, state.getBlockHardness(world, coords), dispose); } } @@ -167,7 +167,7 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat RayTraceResult lookPos = Minecraft.getMinecraft().objectMouseOver; - if(lookPos != null && lookPos.getBlockPos() != null && !player.worldObj.isAirBlock(lookPos.getBlockPos()) && lookPos.entityHit == null) { + if(lookPos != null && lookPos.getBlockPos() != null && !player.world.isAirBlock(lookPos.getBlockPos()) && lookPos.entityHit == null) { List list = getCursorList(stack); BlockPos origin = getOriginPos(stack); diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemOdinRing.java b/src/main/java/vazkii/botania/common/item/relic/ItemOdinRing.java index 95aef14c4..717c8ccc2 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemOdinRing.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemOdinRing.java @@ -103,7 +103,7 @@ public class ItemOdinRing extends ItemRelicBauble { if(stack == null) // workaround for Azanor/Baubles#156 return; - attributes.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 20, 0)); + attributes.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(getBaubleUUID(stack), "Bauble modifier", 20, 0)); } } diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java index 8e88fe8a9..934127903 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemExchangeRod.java @@ -226,7 +226,7 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra if(!player.capabilities.isCreativeMode) { List drops = blockAt.getDrops(world, pos, stateAt, 0); for(ItemStack drop : drops) - world.spawnEntityInWorld(new EntityItem(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, drop)); + world.spawnEntity(new EntityItem(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, drop)); removeFromInventory(player, stack, state.getBlock(), state.getBlock().getMetaFromState(state), true); } world.playEvent(2001, pos, Block.getStateId(state)); @@ -330,7 +330,7 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra Block block = getBlock(stack); int meta = getBlockMeta(stack); int count = getInventoryItemCount(player, stack, block, meta); - if(!player.worldObj.isRemote) + if(!player.world.isRemote) ItemsRemainingRenderHandler.set(new ItemStack(block, 1, meta), count); } @@ -409,8 +409,8 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra targetMeta = getTargetBlockMeta(stack); } - if(!player.worldObj.isAirBlock(bPos)) { - List coordsList = getBlocksToSwap(player.worldObj, stack, block.getStateFromMeta(meta), bPos, targetBlock == null ? null : targetBlock.getStateFromMeta(targetMeta)); + if(!player.world.isAirBlock(bPos)) { + List coordsList = getBlocksToSwap(player.world, stack, block.getStateFromMeta(meta), bPos, targetBlock == null ? null : targetBlock.getStateFromMeta(targetMeta)); for(BlockPos coords : coordsList) if(coords.equals(bPos)) { coordsList.remove(coords); 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 b92323c01..44c6e5b78 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemFireRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemFireRod.java @@ -50,9 +50,9 @@ public class ItemFireRod extends ItemMod implements IManaUsingItem, IAvatarWield @Override public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10) { if(!world.isRemote && ManaItemHandler.requestManaExactForTool(par1ItemStack, player, COST, false)) { - EntityFlameRing entity = new EntityFlameRing(player.worldObj); + EntityFlameRing entity = new EntityFlameRing(player.world); entity.setPosition(pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5); - player.worldObj.spawnEntityInWorld(entity); + player.world.spawnEntity(entity); player.getCooldownTracker().setCooldown(this, IManaProficiencyArmor.Helper.hasProficiency(player, par1ItemStack) ? COOLDOWN / 2 : COOLDOWN); @@ -83,7 +83,7 @@ public class ItemFireRod extends ItemMod implements IManaUsingItem, IAvatarWield if(!world.isRemote && tile.getCurrentMana() >= COST && tile.getElapsedFunctionalTicks() % 300 == 0 && tile.isEnabled()) { EntityFlameRing entity = new EntityFlameRing(world); entity.setPosition(te.getPos().getX() + 0.5, te.getPos().getY(), te.getPos().getZ() + 0.5); - world.spawnEntityInWorld(entity); + world.spawnEntity(entity); tile.recieveMana(-COST); } } diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemGravityRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemGravityRod.java index 9ab688c56..516d463e0 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemGravityRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemGravityRod.java @@ -96,8 +96,8 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { if(ticksCooldown == 0) { Entity item = null; - if(targetID != -1 && player.worldObj.getEntityByID(targetID) != null) { - Entity taritem = player.worldObj.getEntityByID(targetID); + if(targetID != -1 && player.world.getEntityByID(targetID) != null) { + Entity taritem = player.world.getEntityByID(targetID); boolean found = false; Vector3 target = Vector3.fromEntityCenter(player); @@ -105,14 +105,14 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { int distance = 1; while(entities.size() == 0 && distance < 25) { target = target.add(new Vector3(player.getLookVec()).multiply(distance)).add(0, 0.5, 0); - entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, new AxisAlignedBB(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE)); + entities = player.world.getEntitiesWithinAABBExcludingEntity(player, new AxisAlignedBB(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE)); distance++; if(entities.contains(taritem)) found = true; } if(found) - item = player.worldObj.getEntityByID(targetID); + item = player.world.getEntityByID(targetID); } if(item == null) { @@ -121,7 +121,7 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { int distance = 1; while(entities.size() == 0 && distance < 25) { target = target.add(new Vector3(player.getLookVec()).multiply(distance)).add(0, 0.5, 0); - entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, new AxisAlignedBB(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE)); + entities = player.world.getEntitiesWithinAABBExcludingEntity(player, new AxisAlignedBB(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE)); distance++; } @@ -189,8 +189,8 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { ItemNBTHelper.getDouble(stack, TAG_DIST, -1); Entity item; - if(targetID != -1 && player.worldObj.getEntityByID(targetID) != null) { - Entity taritem = player.worldObj.getEntityByID(targetID); + if(targetID != -1 && player.world.getEntityByID(targetID) != null) { + Entity taritem = player.world.getEntityByID(targetID); boolean found = false; Vector3 target = Vector3.fromEntityCenter(player); @@ -198,14 +198,14 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { int distance = 1; while(entities.size() == 0 && distance < 25) { target = target.add(new Vector3(player.getLookVec()).multiply(distance)).add(0, 0.5, 0); - entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, new AxisAlignedBB(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE)); + entities = player.world.getEntitiesWithinAABBExcludingEntity(player, new AxisAlignedBB(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE)); distance++; if(entities.contains(taritem)) found = true; } if(found) { - item = player.worldObj.getEntityByID(targetID); + item = player.world.getEntityByID(targetID); ItemNBTHelper.setInt(stack, TAG_TARGET, -1); ItemNBTHelper.setDouble(stack, TAG_DIST, -1); Vector3 moveVector = new Vector3(player.getLookVec().normalize()); @@ -215,9 +215,9 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { item.motionX = moveVector.x * mot; item.motionY = moveVector.y; item.motionZ = moveVector.z * mot; - if(!player.worldObj.isRemote) { - EntityThrownItem thrown = new EntityThrownItem(item.worldObj, item.posX, item.posY, item.posZ, (EntityItem) item); - item.worldObj.spawnEntityInWorld(thrown); + if(!player.world.isRemote) { + EntityThrownItem thrown = new EntityThrownItem(item.world, item.posX, item.posY, item.posZ, (EntityItem) item); + item.world.spawnEntity(thrown); } item.setDead(); } else { 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 04b2eef02..94d09f211 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemMissileRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemMissileRod.java @@ -62,8 +62,8 @@ public class ItemMissileRod extends ItemMod implements IManaUsingItem, IAvatarWi if(!(living instanceof EntityPlayer)) return; EntityPlayer player = (EntityPlayer) living; - if(count != getMaxItemUseDuration(stack) && count % (IManaProficiencyArmor.Helper.hasProficiency(player, stack) ? 1 : 2) == 0 && !player.worldObj.isRemote && ManaItemHandler.requestManaExactForTool(stack, player, COST_PER, false)) { - if(spawnMissile(player.worldObj, player, player.posX + (Math.random() - 0.5 * 0.1), player.posY + 2.4 + (Math.random() - 0.5 * 0.1), player.posZ + (Math.random() - 0.5 * 0.1))) + if(count != getMaxItemUseDuration(stack) && count % (IManaProficiencyArmor.Helper.hasProficiency(player, stack) ? 1 : 2) == 0 && !player.world.isRemote && ManaItemHandler.requestManaExactForTool(stack, player, COST_PER, false)) { + if(spawnMissile(player.world, player, player.posX + (Math.random() - 0.5 * 0.1), player.posY + 2.4 + (Math.random() - 0.5 * 0.1), player.posZ + (Math.random() - 0.5 * 0.1))) ManaItemHandler.requestManaExactForTool(stack, player, COST_PER, true); Botania.proxy.sparkleFX(player.posX, player.posY + 2.4, player.posZ, 1F, 0.4F, 1F, 6F, 6); @@ -80,7 +80,7 @@ public class ItemMissileRod extends ItemMod implements IManaUsingItem, IAvatarWi if(missile.getTarget()) { if(!world.isRemote) { missile.playSound(BotaniaSoundEvents.missile, 0.6F, 0.8F + (float) Math.random() * 0.2F); - world.spawnEntityInWorld(missile); + world.spawnEntity(missile); } return true; 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 d94b19bf3..f84a90db5 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemRainbowRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemRainbowRod.java @@ -178,9 +178,9 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem, IAvatarWi List players = world.getEntitiesWithinAABB(EntityPlayer.class, axis); for(EntityPlayer p : players) { - int px = MathHelper.floor_double(p.posX); - int py = MathHelper.floor_double(p.posY) - 1; - int pz = MathHelper.floor_double(p.posZ); + int px = MathHelper.floor(p.posX); + int py = MathHelper.floor(p.posY) - 1; + int pz = MathHelper.floor(p.posZ); int dist = 5; int diff = dist / 2; diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemSkyDirtRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemSkyDirtRod.java index 0aa0a7359..b71c549b5 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemSkyDirtRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemSkyDirtRod.java @@ -43,9 +43,9 @@ public class ItemSkyDirtRod extends ItemDirtRod { Vector3 lookVec = new Vector3(player.getLookVec()).multiply(3); Vector3 placeVec = playerVec.add(lookVec); - int x = MathHelper.floor_double(placeVec.x); - int y = MathHelper.floor_double(placeVec.y) + 1; - int z = MathHelper.floor_double(placeVec.z); + int x = MathHelper.floor(placeVec.x); + int y = MathHelper.floor(placeVec.y) + 1; + int z = MathHelper.floor(placeVec.z); int entities = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(x, y, z, x + 1, y + 1, z + 1)).size(); diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemSmeltRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemSmeltRod.java index 03594bcda..4dd2d7eed 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemSmeltRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemSmeltRod.java @@ -77,10 +77,10 @@ public class ItemSmeltRod extends ItemMod implements IManaUsingItem { if(!ManaItemHandler.requestManaExactForTool(stack, p, COST_PER_TICK, false)) return; - RayTraceResult pos = ToolCommons.raytraceFromEntity(p.worldObj, p, false, 32); + RayTraceResult pos = ToolCommons.raytraceFromEntity(p.world, p, false, 32); if(pos != null && pos.getBlockPos() != null) { - IBlockState state = p.worldObj.getBlockState(pos.getBlockPos()); + IBlockState state = p.world.getBlockState(pos.getBlockPos()); ItemStack blockStack = new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state)); ItemStack result = FurnaceRecipes.instance().getSmeltingResult(blockStack); @@ -95,10 +95,10 @@ public class ItemSmeltRod extends ItemMod implements IManaUsingItem { data.progress--; decremented = true; if(data.progress <= 0) { - if(!p.worldObj.isRemote) { - p.worldObj.setBlockState(pos.getBlockPos(), Block.getBlockFromItem(result.getItem()).getStateFromMeta(result.getItemDamage()), 1 | 2); - p.worldObj.playSound(null, p.posX, p.posY, p.posZ, SoundEvents.ITEM_FLINTANDSTEEL_USE, SoundCategory.PLAYERS, 0.6F, 1F); - p.worldObj.playSound(null, p.posX, p.posY, p.posZ, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.PLAYERS, 1F, 1F); + if(!p.world.isRemote) { + p.world.setBlockState(pos.getBlockPos(), Block.getBlockFromItem(result.getItem()).getStateFromMeta(result.getItemDamage()), 1 | 2); + p.world.playSound(null, p.posX, p.posY, p.posZ, SoundEvents.ITEM_FLINTANDSTEEL_USE, SoundCategory.PLAYERS, 0.6F, 1F); + p.world.playSound(null, p.posX, p.posY, p.posZ, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.PLAYERS, 1F, 1F); ManaItemHandler.requestManaExactForTool(stack, p, COST_PER_TICK, true); playerData.remove(p); @@ -126,7 +126,7 @@ public class ItemSmeltRod extends ItemMod implements IManaUsingItem { Botania.proxy.wispFX(x, y, z, 1F, 0.2F, 0.2F, 0.5F, (float) -Math.random() / 10F); } if(time % 10 == 0) - p.worldObj.playSound(null, p.posX, p.posY, p.posZ, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.PLAYERS, (float) Math.random() / 2F + 0.5F, 1F); + p.world.playSound(null, p.posX, p.posY, p.posZ, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.PLAYERS, (float) Math.random() / 2F + 0.5F, 1F); } } } diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemTerraformRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemTerraformRod.java index f77f3a9f5..8e4d69b3c 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemTerraformRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemTerraformRod.java @@ -96,7 +96,7 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP @Override public void onUsingTick(ItemStack stack, EntityLivingBase living, int count) { if(count != getMaxItemUseDuration(stack) && count % 10 == 0 && living instanceof EntityPlayer) - terraform(stack, living.worldObj, (EntityPlayer) living); + terraform(stack, living.world, (EntityPlayer) living); } @Nonnull 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 eb305e52f..c7d3b0e10 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemTornadoRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemTornadoRod.java @@ -76,7 +76,7 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi player.fallDistance = 0F; player.motionY = IManaProficiencyArmor.Helper.hasProficiency(player, par1ItemStack) ? 1.6 : 1.25; - player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.airRod, SoundCategory.PLAYERS, 0.1F, 0.25F); + player.world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.airRod, SoundCategory.PLAYERS, 0.1F, 0.25F); for(int i = 0; i < 5; i++) Botania.proxy.wispFX(player.posX, player.posY, player.posZ, 0.25F, 0.25F, 0.25F, 0.35F + (float) Math.random() * 0.1F, 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5)); } @@ -148,7 +148,7 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi Botania.proxy.wispFX(p.posX, p.posY + i, p.posZ, 0.25F, 0.25F, 0.25F, 0.35F + (float) Math.random() * 0.1F, 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5)); if(!world.isRemote) { - p.worldObj.playSound(null, p.posX, p.posY, p.posZ, BotaniaSoundEvents.dash, SoundCategory.PLAYERS, 1F, 1F); + p.world.playSound(null, p.posX, p.posY, p.posZ, BotaniaSoundEvents.dash, SoundCategory.PLAYERS, 1F, 1F); p.addPotionEffect(new PotionEffect(ModPotions.featherfeet, 100, 0)); tile.recieveMana(-COST); } diff --git a/src/main/java/vazkii/botania/common/lexicon/RelicLexiconEntry.java b/src/main/java/vazkii/botania/common/lexicon/RelicLexiconEntry.java index ce9154af5..d16dd6b4a 100644 --- a/src/main/java/vazkii/botania/common/lexicon/RelicLexiconEntry.java +++ b/src/main/java/vazkii/botania/common/lexicon/RelicLexiconEntry.java @@ -33,7 +33,7 @@ public class RelicLexiconEntry extends BasicLexiconEntry { @Override @SideOnly(Side.CLIENT) public boolean isVisible() { - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + EntityPlayerSP player = Minecraft.getMinecraft().player; return a == null || player.capabilities.isCreativeMode || player.getStatFileWriter().hasAchievementUnlocked(a); } diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageBrew.java b/src/main/java/vazkii/botania/common/lexicon/page/PageBrew.java index 9ec80ff32..2ac2b48a1 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageBrew.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageBrew.java @@ -58,7 +58,7 @@ public class PageBrew extends PageRecipe implements ITwoNamedPage { renderer.setUnicodeFlag(unicode); PageText.renderText(x, y + 22, width, height, text); - ItemStack book = PlayerHelper.getFirstHeldItemClass(Minecraft.getMinecraft().thePlayer, ILexicon.class); + ItemStack book = PlayerHelper.getFirstHeldItemClass(Minecraft.getMinecraft().player, ILexicon.class); if(book != null && ((ILexicon) book.getItem()).isKnowledgeUnlocked(book, BotaniaAPI.elvenKnowledge)) { renderItemAtLinePos(gui, 20, 2, y + 12, recipe.getOutput(new ItemStack(ModItems.vial))); renderItemAtLinePos(gui, 20, 3, y + 12, recipe.getOutput(new ItemStack(ModItems.vial, 1, 1))); diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageEntity.java b/src/main/java/vazkii/botania/common/lexicon/page/PageEntity.java index acca12a8e..1c853b3ec 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageEntity.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageEntity.java @@ -52,7 +52,7 @@ public class PageEntity extends LexiconPage{ int text_y = gui.getTop() + gui.getHeight() - 40; int entity_scale = getEntityScale(size); int entity_x = gui.getLeft() + gui.getWidth() / 2; - int entity_y = gui.getTop() + gui.getHeight() / 2 + MathHelper.floor_float(dummyEntity.height * entity_scale / 2); + int entity_y = gui.getTop() + gui.getHeight() / 2 + MathHelper.floor(dummyEntity.height * entity_scale / 2); renderEntity(gui, dummyEntity, entity_x, entity_y, entity_scale, dummyEntity.ticksExisted * 2); @@ -66,7 +66,7 @@ public class PageEntity extends LexiconPage{ if(dummyEntity.width < dummyEntity.height) entity_size = dummyEntity.height; - return MathHelper.floor_float(size / entity_size); + return MathHelper.floor(size / entity_size); } @@ -78,7 +78,7 @@ public class PageEntity extends LexiconPage{ @SideOnly(Side.CLIENT) public void renderEntity(IGuiLexiconEntry gui, Entity entity, int x, int y, int scale, float rotation) { - dummyEntity.worldObj = Minecraft.getMinecraft() != null ? Minecraft.getMinecraft().theWorld : null; + dummyEntity.world = Minecraft.getMinecraft() != null ? Minecraft.getMinecraft().world : null; GlStateManager.enableColorMaterial(); GlStateManager.pushMatrix(); @@ -103,7 +103,7 @@ public class PageEntity extends LexiconPage{ public void prepDummy() { if(dummyEntity == null || dummyEntity.isDead) { try { - dummyEntity = (Entity) entityConstructor.newInstance(Minecraft.getMinecraft().theWorld); + dummyEntity = (Entity) entityConstructor.newInstance(Minecraft.getMinecraft().world); } catch (Exception e) { e.printStackTrace(); } diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageRecipe.java b/src/main/java/vazkii/botania/common/lexicon/page/PageRecipe.java index b985abac4..9ebb7223d 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageRecipe.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageRecipe.java @@ -63,7 +63,7 @@ public class PageRecipe extends LexiconPage { PageText.renderText(x, y, width, height, getUnlocalizedName()); if(tooltipStack != null) { - List tooltipData = tooltipStack.getTooltip(Minecraft.getMinecraft().thePlayer, false); + List tooltipData = tooltipStack.getTooltip(Minecraft.getMinecraft().player, false); List parsedTooltip = new ArrayList<>(); boolean first = true; @@ -158,7 +158,7 @@ public class PageRecipe extends LexiconPage { tooltipStack = stack; EntryData data = LexiconRecipeMappings.getDataForStack(tooltipStack); - ItemStack book = PlayerHelper.getFirstHeldItemClass(Minecraft.getMinecraft().thePlayer, ILexicon.class); + ItemStack book = PlayerHelper.getFirstHeldItemClass(Minecraft.getMinecraft().player, ILexicon.class); if(data != null && (data.entry != gui.getEntry() || data.page != gui.getPageOn()) && book != null && ((ILexicon) book.getItem()).isKnowledgeUnlocked(book, data.entry.getKnowledgeType())) { tooltipEntry = true; diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageShedding.java b/src/main/java/vazkii/botania/common/lexicon/page/PageShedding.java index 2e1c7e609..0b700adba 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageShedding.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageShedding.java @@ -62,7 +62,7 @@ public class PageShedding extends PageEntity { int stack_y = gui.getTop() + gui.getHeight() - 40 - 18 - 5; int entity_scale = getEntityScale(size); int entity_x = gui.getLeft() + gui.getWidth() / 2; - int entity_y = gui.getTop() + gui.getHeight() / 2 + MathHelper.floor_float(dummyEntity.height * entity_scale / 2) - 29; + int entity_y = gui.getTop() + gui.getHeight() / 2 + MathHelper.floor(dummyEntity.height * entity_scale / 2) - 29; renderEntity(gui, dummyEntity, entity_x, entity_y, entity_scale, dummyEntity.ticksExisted * 2); @@ -77,7 +77,7 @@ public class PageShedding extends PageEntity { ((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight()); if(tooltipStack != null) { - List tooltipData = tooltipStack.getTooltip(Minecraft.getMinecraft().thePlayer, false); + List tooltipData = tooltipStack.getTooltip(Minecraft.getMinecraft().player, false); List parsedTooltip = new ArrayList<>(); boolean first = true; diff --git a/src/main/java/vazkii/botania/common/lexicon/page/PageTutorial.java b/src/main/java/vazkii/botania/common/lexicon/page/PageTutorial.java index d8e4f2642..f6e3b1acd 100644 --- a/src/main/java/vazkii/botania/common/lexicon/page/PageTutorial.java +++ b/src/main/java/vazkii/botania/common/lexicon/page/PageTutorial.java @@ -67,7 +67,7 @@ public class PageTutorial extends PageText { if(button == buttonText) { GuiLexicon.startTutorial(); Minecraft.getMinecraft().displayGuiScreen(new GuiLexicon()); - Minecraft.getMinecraft().thePlayer.addChatMessage(new TextComponentTranslation("botaniamisc.tutorialStarted").setStyle(new Style().setColor(TextFormatting.GREEN))); + Minecraft.getMinecraft().player.sendMessage(new TextComponentTranslation("botaniamisc.tutorialStarted").setStyle(new Style().setColor(TextFormatting.GREEN))); } else if(button == buttonVideo && Desktop.isDesktopSupported()) { try { Desktop.getDesktop().browse(new URI("https://www.youtube.com/watch?v=rx0xyejC6fI")); diff --git a/src/main/java/vazkii/botania/common/network/PacketBotaniaEffect.java b/src/main/java/vazkii/botania/common/network/PacketBotaniaEffect.java index 76417cd37..9367c0811 100644 --- a/src/main/java/vazkii/botania/common/network/PacketBotaniaEffect.java +++ b/src/main/java/vazkii/botania/common/network/PacketBotaniaEffect.java @@ -76,7 +76,7 @@ public class PacketBotaniaEffect implements IMessage { @Override public void run() { Minecraft mc = Minecraft.getMinecraft(); - World world = mc.theWorld; + World world = mc.world; switch (message.type) { case POOL_CRAFT: { for(int i = 0; i < 25; i++) { @@ -133,13 +133,13 @@ public class PacketBotaniaEffect implements IMessage { for(int i = 0; i < p; i++) { double m = 0.01; - double d0 = item.worldObj.rand.nextGaussian() * m; - double d1 = item.worldObj.rand.nextGaussian() * m; - double d2 = item.worldObj.rand.nextGaussian() * m; + double d0 = item.world.rand.nextGaussian() * m; + double d1 = item.world.rand.nextGaussian() * m; + double d2 = item.world.rand.nextGaussian() * m; double d3 = 10.0D; - item.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, - message.x + item.worldObj.rand.nextFloat() * item.width * 2.0F - item.width - d0 * d3, message.y + item.worldObj.rand.nextFloat() * item.height - d1 * d3, - message.z + item.worldObj.rand.nextFloat() * item.width * 2.0F - item.width - d2 * d3, d0, d1, d2); + item.world.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, + message.x + item.world.rand.nextFloat() * item.width * 2.0F - item.width - d0 * d3, message.y + item.world.rand.nextFloat() * item.height - d1 * d3, + message.z + item.world.rand.nextFloat() * item.width * 2.0F - item.width - d2 * d3, d0, d1, d2); } break; } diff --git a/src/main/java/vazkii/botania/common/network/PacketDodge.java b/src/main/java/vazkii/botania/common/network/PacketDodge.java index d20bc30e2..e13ad249d 100644 --- a/src/main/java/vazkii/botania/common/network/PacketDodge.java +++ b/src/main/java/vazkii/botania/common/network/PacketDodge.java @@ -37,14 +37,14 @@ public class PacketDodge implements IMessage { public IMessage onMessage(PacketDodge message, MessageContext ctx) { EntityPlayerMP player = ctx.getServerHandler().playerEntity; player.mcServer.addScheduledTask(() -> { - player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.dash, SoundCategory.PLAYERS, 1F, 1F); + player.world.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.dash, SoundCategory.PLAYERS, 1F, 1F); IInventory baublesInv = BaublesApi.getBaubles(player); ItemStack ringStack = baublesInv.getStackInSlot(1); if(ringStack == null || !(ringStack.getItem() instanceof ItemDodgeRing)) { ringStack = baublesInv.getStackInSlot(2); if(ringStack == null || !(ringStack.getItem() instanceof ItemDodgeRing)) - ctx.getServerHandler().kickPlayerFromServer("Invalid Dodge Packet"); + ctx.getServerHandler().disconnect("Invalid Dodge Packet"); } player.addExhaustion(0.3F); diff --git a/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java b/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java index 7264619ce..91b546ff5 100644 --- a/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java +++ b/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java @@ -47,7 +47,7 @@ public final class SkyblockWorldEvents { @SubscribeEvent public static void onPlayerUpdate(LivingUpdateEvent event) { - if(event.getEntityLiving() instanceof EntityPlayer && !event.getEntityLiving().worldObj.isRemote) { + if(event.getEntityLiving() instanceof EntityPlayer && !event.getEntityLiving().world.isRemote) { EntityPlayer player = (EntityPlayer) event.getEntityLiving(); NBTTagCompound data = player.getEntityData(); if(!data.hasKey(EntityPlayer.PERSISTED_NBT_TAG)) @@ -55,7 +55,7 @@ public final class SkyblockWorldEvents { NBTTagCompound persist = data.getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG); if(player.ticksExisted > 3 && !persist.getBoolean(TAG_MADE_ISLAND)) { - World world = player.worldObj; + World world = player.world; if(WorldTypeSkyblock.isWorldSkyblock(world)) { BlockPos coords = world.getSpawnPoint(); if(world.getBlockState(coords.down(4)).getBlock() != Blocks.BEDROCK && world.provider.getDimension() == 0) @@ -127,12 +127,12 @@ public final class SkyblockWorldEvents { final boolean test = false; if(test || !persist.getBoolean(TAG_HAS_OWN_ISLAND)) { - createSkyblock(player.worldObj, pos); + createSkyblock(player.world, pos); if(player instanceof EntityPlayerMP) { EntityPlayerMP pmp = (EntityPlayerMP) player; pmp.setPositionAndUpdate(pos.getX() + 0.5, pos.getY() + 1.6, pos.getZ() + 0.5); - pmp.setSpawnChunk(pos, true, player.worldObj.provider.getDimension()); + pmp.setSpawnChunk(pos, true, player.world.provider.getDimension()); player.inventory.addItemStackToInventory(new ItemStack(ModItems.lexicon)); }