diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectAttractor.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectAttractor.java index 2196231a..b80a5119 100644 --- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectAttractor.java +++ b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectAttractor.java @@ -189,7 +189,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect { if (ent instanceof EntitySlime) { - ent.faceEntity(getTarget(ent.worldObj, pos), 10.0F, 20.0F); + ent.faceEntity(getTarget(ent.getEntityWorld(), pos), 10.0F, 20.0F); } else if (ent instanceof EntitySilverfish) { if (counter < 10) @@ -197,7 +197,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect return; } EntitySilverfish sf = (EntitySilverfish) ent; - Path pathentity = getPathEntityToEntity(ent, getTarget(ent.worldObj, pos), getRange()); + Path pathentity = getPathEntityToEntity(ent, getTarget(ent.getEntityWorld(), pos), getRange()); sf.getNavigator().setPath(pathentity, sf.getAIMoveSpeed()); } else if (ent instanceof EntityBlaze) { @@ -221,7 +221,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect // ent.setAttackTarget(target); } else if (ent instanceof EntityEnderman) { - ((EntityEnderman) ent).setAttackTarget(getTarget(ent.worldObj, pos)); + ((EntityEnderman) ent).setAttackTarget(getTarget(ent.getEntityWorld(), pos)); } } @@ -234,7 +234,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect if (distance > 2) { EntityMob mod = (EntityMob) ent; - mod.faceEntity(getTarget(ent.worldObj, pos), 180, 0); + mod.faceEntity(getTarget(ent.getEntityWorld(), pos), 180, 0); mod.moveEntityWithHeading(0, 0.3f); if (mod.posY < pos.getY()) { @@ -248,12 +248,12 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect public Path getPathEntityToEntity(Entity entity, Entity targetEntity, float range) { - int targX = MathHelper.floor_double(targetEntity.posX); - int targY = MathHelper.floor_double(targetEntity.posY + 1.0D); - int targZ = MathHelper.floor_double(targetEntity.posZ); + int targX = MathHelper.floor(targetEntity.posX); + int targY = MathHelper.floor(targetEntity.posY + 1.0D); + int targZ = MathHelper.floor(targetEntity.posZ); PathFinder pf = new PathFinder(new WalkNodeProcessor()); - return pf.findPath(targetEntity.worldObj, (EntityLiving) entity, new BlockPos(targX, targY, targZ), range); + return pf.findPath(targetEntity.getEntityWorld(), (EntityLiving) entity, new BlockPos(targX, targY, targZ), range); } private boolean trackMob(BlockPos pos, EntityLiving ent) @@ -261,7 +261,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect //TODO: Figure out if this crud is needed if (useSetTarget(ent)) { - ((EntityMob) ent).setAttackTarget(getTarget(ent.worldObj, pos)); + ((EntityMob) ent).setAttackTarget(getTarget(ent.getEntityWorld(), pos)); return true; } else if (useSpecialCase(ent)) { @@ -328,7 +328,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect } cancelCurrentTasks(ent); - ent.tasks.addTask(0, new AttractTask(ent, getTarget(ent.worldObj, pos), pos)); + ent.tasks.addTask(0, new AttractTask(ent, getTarget(ent.getEntityWorld(), pos), pos)); return true; } @@ -364,13 +364,13 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect { if (ent instanceof EntitySlime) { - ent.faceEntity(getTarget(ent.worldObj, pos), 10.0F, 20.0F); -// ent.setAttackTarget(getTarget(ent.worldObj, pos)); + ent.faceEntity(getTarget(ent.getEntityWorld(), pos), 10.0F, 20.0F); +// ent.setAttackTarget(getTarget(ent.getEntityWorld(), pos)); return true; } else if (ent instanceof EntitySilverfish) { EntitySilverfish es = (EntitySilverfish) ent; - Path pathentity = getPathEntityToEntity(ent, getTarget(ent.worldObj, pos), getRange()); + Path pathentity = getPathEntityToEntity(ent, getTarget(ent.getEntityWorld(), pos), getRange()); es.getNavigator().setPath(pathentity, es.getAIMoveSpeed()); return true; } else if (ent instanceof EntityBlaze) @@ -439,7 +439,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect { boolean res = false; //TODO: - TileEntity te = mob.worldObj.getTileEntity(coord); + TileEntity te = mob.getEntityWorld().getTileEntity(coord); if (te instanceof TileAlchemyArray) { res = true; diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectBinding.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectBinding.java index 8ba2057a..0f25ede0 100644 --- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectBinding.java +++ b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectBinding.java @@ -40,7 +40,7 @@ public class AlchemyArrayEffectBinding extends AlchemyArrayEffectCrafting ItemStack output = outputStack.copy(); EntityItem outputEntity = new EntityItem(tile.getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output); - tile.getWorld().spawnEntityInWorld(outputEntity); + tile.getWorld().spawnEntity(outputEntity); return true; } @@ -60,7 +60,7 @@ public class AlchemyArrayEffectBinding extends AlchemyArrayEffectCrafting double dispZ = -distance * Math.cos(angle); EntityLightningBolt lightning = new EntityLightningBolt(world, pos.getX() + dispX, pos.getY(), pos.getZ() + dispZ, true); - world.spawnEntityInWorld(lightning); + world.spawnEntity(lightning); } } diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSkeletonTurret.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSkeletonTurret.java index 00b695df..3577178b 100644 --- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSkeletonTurret.java +++ b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSkeletonTurret.java @@ -170,7 +170,7 @@ public class AlchemyArrayEffectSkeletonTurret extends AlchemyArrayEffect { boolean res = false; //TODO: - TileEntity te = mob.worldObj.getTileEntity(coord); + TileEntity te = mob.getEntityWorld().getTileEntity(coord); if (te instanceof TileAlchemyArray) { res = true; diff --git a/src/main/java/WayofTime/bloodmagic/api/alchemyCrafting/AlchemyArrayEffectCrafting.java b/src/main/java/WayofTime/bloodmagic/api/alchemyCrafting/AlchemyArrayEffectCrafting.java index 41935408..56badd4f 100644 --- a/src/main/java/WayofTime/bloodmagic/api/alchemyCrafting/AlchemyArrayEffectCrafting.java +++ b/src/main/java/WayofTime/bloodmagic/api/alchemyCrafting/AlchemyArrayEffectCrafting.java @@ -47,7 +47,7 @@ public class AlchemyArrayEffectCrafting extends AlchemyArrayEffect EntityItem outputEntity = new EntityItem(tile.getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output); - tile.getWorld().spawnEntityInWorld(outputEntity); + tile.getWorld().spawnEntity(outputEntity); return true; } diff --git a/src/main/java/WayofTime/bloodmagic/api/network/SoulNetwork.java b/src/main/java/WayofTime/bloodmagic/api/network/SoulNetwork.java index a1a97ebf..f50500ce 100644 --- a/src/main/java/WayofTime/bloodmagic/api/network/SoulNetwork.java +++ b/src/main/java/WayofTime/bloodmagic/api/network/SoulNetwork.java @@ -70,13 +70,13 @@ public class SoulNetwork extends WorldSavedData if (FMLCommonHandler.instance().getMinecraftServerInstance() == null) return 0; - World world = FMLCommonHandler.instance().getMinecraftServerInstance().worldServers[0]; - SoulNetwork data = (SoulNetwork) world.loadItemData(SoulNetwork.class, event.ownerNetwork); + World world = FMLCommonHandler.instance().getMinecraftServerInstance().worlds[0]; + SoulNetwork data = (SoulNetwork) world.loadData(SoulNetwork.class, event.ownerNetwork); if (data == null) { data = new SoulNetwork(event.ownerNetwork); - world.setItemData(event.ownerNetwork, data); + world.setData(event.ownerNetwork, data); } int currEss = data.getCurrentEssence(); @@ -129,7 +129,7 @@ public class SoulNetwork extends WorldSavedData { if (user != null) { - if (user.worldObj.isRemote) + if (user.getEntityWorld().isRemote) return false; if (!Strings.isNullOrEmpty(mapName)) diff --git a/src/main/java/WayofTime/bloodmagic/api/saving/SoulNetwork.java b/src/main/java/WayofTime/bloodmagic/api/saving/SoulNetwork.java index 20433b88..53324cf0 100644 --- a/src/main/java/WayofTime/bloodmagic/api/saving/SoulNetwork.java +++ b/src/main/java/WayofTime/bloodmagic/api/saving/SoulNetwork.java @@ -78,7 +78,7 @@ public class SoulNetwork implements INBTSerializable { if (user != null) { - if (user.worldObj.isRemote) + if (user.getEntityWorld().isRemote) return false; if (!Strings.isNullOrEmpty(playerId.toString())) diff --git a/src/main/java/WayofTime/bloodmagic/api/teleport/TeleporterBloodMagic.java b/src/main/java/WayofTime/bloodmagic/api/teleport/TeleporterBloodMagic.java index 2c164ee8..e24c0da2 100644 --- a/src/main/java/WayofTime/bloodmagic/api/teleport/TeleporterBloodMagic.java +++ b/src/main/java/WayofTime/bloodmagic/api/teleport/TeleporterBloodMagic.java @@ -33,6 +33,6 @@ public class TeleporterBloodMagic extends Teleporter @Override public void placeInPortal(Entity entity, float rotationYaw) { - entity.setLocationAndAngles(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY) + 2, MathHelper.floor_double(entity.posZ), entity.rotationYaw, entity.rotationPitch); + entity.setLocationAndAngles(MathHelper.floor(entity.posX), MathHelper.floor(entity.posY) + 2, MathHelper.floor(entity.posZ), entity.rotationYaw, entity.rotationPitch); } } diff --git a/src/main/java/WayofTime/bloodmagic/api/util/helper/PlayerHelper.java b/src/main/java/WayofTime/bloodmagic/api/util/helper/PlayerHelper.java index 0b4a1163..634f33f0 100644 --- a/src/main/java/WayofTime/bloodmagic/api/util/helper/PlayerHelper.java +++ b/src/main/java/WayofTime/bloodmagic/api/util/helper/PlayerHelper.java @@ -26,7 +26,7 @@ public class PlayerHelper public static String getUsernameFromPlayer(EntityPlayer player) { - return player.worldObj.isRemote ? "" : UsernameCache.getLastKnownUsername(getUUIDFromPlayer(player)); + return player.getEntityWorld().isRemote ? "" : UsernameCache.getLastKnownUsername(getUUIDFromPlayer(player)); } public static EntityPlayer getPlayerFromUsername(String username) diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyArray.java b/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyArray.java index 29a03a07..87478f40 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyArray.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyArray.java @@ -81,7 +81,7 @@ public class BlockAlchemyArray extends BlockContainer } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyTable.java b/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyTable.java index 2674b21b..f8ba45ff 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyTable.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyTable.java @@ -60,7 +60,7 @@ public class BlockAlchemyTable extends BlockContainer } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } @@ -107,7 +107,7 @@ public class BlockAlchemyTable extends BlockContainer @Override protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, new IProperty[] { DIRECTION, INVISIBLE }); + return new BlockStateContainer(this, DIRECTION, INVISIBLE); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockAltar.java b/src/main/java/WayofTime/bloodmagic/block/BlockAltar.java index 2e01b83c..72b64187 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockAltar.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockAltar.java @@ -119,7 +119,7 @@ public class BlockAltar extends BlockContainer implements IVariantProvider, IDoc } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockBloodLight.java b/src/main/java/WayofTime/bloodmagic/block/BlockBloodLight.java index cbca3d2e..4852e384 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockBloodLight.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockBloodLight.java @@ -70,7 +70,7 @@ public class BlockBloodLight extends Block } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } @@ -97,7 +97,7 @@ public class BlockBloodLight extends Block @SideOnly(Side.CLIENT) public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { - EntityPlayerSP playerSP = Minecraft.getMinecraft().thePlayer; + EntityPlayerSP playerSP = Minecraft.getMinecraft().player; if (rand.nextInt(3) != 0) { diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrucible.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrucible.java index ef3faa04..ac41661c 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrucible.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrucible.java @@ -55,7 +55,7 @@ public class BlockDemonCrucible extends BlockContainer implements IVariantProvid } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystal.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystal.java index 44e5b325..eb5914b9 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystal.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystal.java @@ -112,7 +112,7 @@ public class BlockDemonCrystal extends BlockContainer } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystallizer.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystallizer.java index f10a2fde..0130a66c 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystallizer.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystallizer.java @@ -61,7 +61,7 @@ public class BlockDemonCrystallizer extends BlockContainer implements IVariantPr } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonPylon.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonPylon.java index c0ff3c2e..4849087a 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonPylon.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockDemonPylon.java @@ -54,7 +54,7 @@ public class BlockDemonPylon extends BlockContainer implements IVariantProvider } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDimensionalPortal.java b/src/main/java/WayofTime/bloodmagic/block/BlockDimensionalPortal.java index ccf6dcbb..2e304975 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockDimensionalPortal.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockDimensionalPortal.java @@ -58,7 +58,7 @@ public class BlockDimensionalPortal extends BlockIntegerContainer } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockIncenseAltar.java b/src/main/java/WayofTime/bloodmagic/block/BlockIncenseAltar.java index 9e9b5772..5f2aa776 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockIncenseAltar.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockIncenseAltar.java @@ -61,7 +61,7 @@ public class BlockIncenseAltar extends BlockContainer implements IVariantProvide } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillar.java b/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillar.java index 0e430ba3..8bd914fc 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillar.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillar.java @@ -77,7 +77,7 @@ public class BlockInversionPillar extends BlockEnumContainer im } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillarEnd.java b/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillarEnd.java index 5df6bfc9..66bef798 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillarEnd.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillarEnd.java @@ -52,7 +52,7 @@ public class BlockInversionPillarEnd extends BlockEnum impleme } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockMimic.java b/src/main/java/WayofTime/bloodmagic/block/BlockMimic.java index 18121f5c..1b85cb3c 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockMimic.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockMimic.java @@ -196,7 +196,7 @@ public class BlockMimic extends BlockEnumContainer implements IVarian } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockPhantom.java b/src/main/java/WayofTime/bloodmagic/block/BlockPhantom.java index 3dde1786..8f5c3819 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockPhantom.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockPhantom.java @@ -54,7 +54,7 @@ public class BlockPhantom extends BlockContainer implements IVariantProvider } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockRoutingNode.java b/src/main/java/WayofTime/bloodmagic/block/BlockRoutingNode.java index ef4ac201..0f85c1c8 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockRoutingNode.java @@ -72,7 +72,7 @@ public abstract class BlockRoutingNode extends BlockContainer } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockSoulForge.java b/src/main/java/WayofTime/bloodmagic/block/BlockSoulForge.java index 0750c130..554c1f02 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockSoulForge.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockSoulForge.java @@ -67,7 +67,7 @@ public class BlockSoulForge extends BlockContainer implements IVariantProvider } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockSpectral.java b/src/main/java/WayofTime/bloodmagic/block/BlockSpectral.java index 357c1a99..5b3e97cb 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockSpectral.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockSpectral.java @@ -63,7 +63,7 @@ public class BlockSpectral extends BlockContainer implements IVariantProvider } @Override - public boolean isVisuallyOpaque() + public boolean causesSuffocation() { return false; } diff --git a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumPillar.java b/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumPillar.java index 70772f8a..a99ba545 100644 --- a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumPillar.java +++ b/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumPillar.java @@ -122,15 +122,15 @@ public class BlockEnumPillar & IStringSerializable> extends Bl } @Override - protected ItemStack createStackedBlock(IBlockState state) + protected ItemStack getSilkTouchDrop(IBlockState state) { return new ItemStack(this, 1, damageDropped(state)); } @Override - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, ItemStack stack) { - return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(BlockRotatedPillar.AXIS, facing.getAxis()); + return super.getStateForPlacement(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer, stack).withProperty(BlockRotatedPillar.AXIS, facing.getAxis()); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumPillarCap.java b/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumPillarCap.java index e4f3df8d..f38ef5bb 100644 --- a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumPillarCap.java +++ b/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumPillarCap.java @@ -70,15 +70,15 @@ public class BlockEnumPillarCap & IStringSerializable> extends } @Override - protected ItemStack createStackedBlock(IBlockState state) + protected ItemStack getSilkTouchDrop(IBlockState state) { return new ItemStack(this, 1, damageDropped(state)); } @Override - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, ItemStack stack) { - return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(FACING, facing); + return super.getStateForPlacement(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer, stack).withProperty(FACING, facing); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumStairs.java b/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumStairs.java index 77a857e2..4d013d69 100644 --- a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumStairs.java +++ b/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumStairs.java @@ -172,9 +172,9 @@ public class BlockEnumStairs & IStringSerializable> extends Bl } @Override - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, ItemStack stack) { - IBlockState state = super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer); + IBlockState state = super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, stack); state = state.withProperty(FACING, placer.getHorizontalFacing()).withProperty(BlockStairs.SHAPE, BlockStairs.EnumShape.STRAIGHT); return facing != EnumFacing.DOWN && (facing == EnumFacing.UP || (double) hitY <= 0.5D) ? state.withProperty(BlockStairs.HALF, BlockStairs.EnumHalf.BOTTOM) : state.withProperty(BlockStairs.HALF, BlockStairs.EnumHalf.TOP); } @@ -349,7 +349,7 @@ public class BlockEnumStairs & IStringSerializable> extends Bl } @Override - protected ItemStack createStackedBlock(IBlockState state) + protected ItemStack getSilkTouchDrop(IBlockState state) { return new ItemStack(this, 1, damageDropped(state)); } diff --git a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumWall.java b/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumWall.java index a4a06261..6ec14701 100644 --- a/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumWall.java +++ b/src/main/java/WayofTime/bloodmagic/block/base/BlockEnumWall.java @@ -129,7 +129,7 @@ public class BlockEnumWall & IStringSerializable> extends Bloc } @Override - protected ItemStack createStackedBlock(IBlockState state) + protected ItemStack getSilkTouchDrop(IBlockState state) { return new ItemStack(this, 1, damageDropped(state)); } diff --git a/src/main/java/WayofTime/bloodmagic/client/gui/GuiAlchemyTable.java b/src/main/java/WayofTime/bloodmagic/client/gui/GuiAlchemyTable.java index 9e85c77f..a35248e2 100644 --- a/src/main/java/WayofTime/bloodmagic/client/gui/GuiAlchemyTable.java +++ b/src/main/java/WayofTime/bloodmagic/client/gui/GuiAlchemyTable.java @@ -52,7 +52,7 @@ public class GuiAlchemyTable extends GuiContainer { Slot slot = this.inventorySlots.getSlot(slotId); - this.drawTexturedModalRect(i + slot.xDisplayPosition, j + slot.yDisplayPosition, 195, 1, 16, 16); + this.drawTexturedModalRect(i + slot.xPos, j + slot.yPos, 195, 1, 16, 16); } } } diff --git a/src/main/java/WayofTime/bloodmagic/client/hud/HUDElementDemonWillAura.java b/src/main/java/WayofTime/bloodmagic/client/hud/HUDElementDemonWillAura.java index f8fba873..4226c787 100644 --- a/src/main/java/WayofTime/bloodmagic/client/hud/HUDElementDemonWillAura.java +++ b/src/main/java/WayofTime/bloodmagic/client/hud/HUDElementDemonWillAura.java @@ -34,7 +34,7 @@ public class HUDElementDemonWillAura extends HUDElement @Override public void render(Minecraft minecraft, ScaledResolution resolution, float partialTicks) { - EntityPlayer player = minecraft.thePlayer; + EntityPlayer player = minecraft.player; if (!Utils.canPlayerSeeDemonWill(player)) { diff --git a/src/main/java/WayofTime/bloodmagic/client/hud/HUDElementHolding.java b/src/main/java/WayofTime/bloodmagic/client/hud/HUDElementHolding.java index 113a7a60..5cd0b9c1 100644 --- a/src/main/java/WayofTime/bloodmagic/client/hud/HUDElementHolding.java +++ b/src/main/java/WayofTime/bloodmagic/client/hud/HUDElementHolding.java @@ -26,13 +26,13 @@ public class HUDElementHolding extends HUDElement @Override public void render(Minecraft minecraft, ScaledResolution resolution, float partialTicks) { - ItemStack sigilHolding = minecraft.thePlayer.getHeldItemMainhand(); + ItemStack sigilHolding = minecraft.player.getHeldItemMainhand(); // TODO - Clean this mess // Check mainhand for Sigil of Holding if (sigilHolding == null) return; if (!(sigilHolding.getItem() == ModItems.SIGIL_HOLDING)) - sigilHolding = minecraft.thePlayer.getHeldItemOffhand(); + sigilHolding = minecraft.player.getHeldItemOffhand(); // Check offhand for Sigil of Holding if (sigilHolding == null) return; @@ -54,7 +54,7 @@ public class HUDElementHolding extends HUDElement { for (ItemStack sigil : holdingInv) { - renderHotbarItem(resolution.getScaledWidth() / 2 + 103 + xOffset + getXOffset(), resolution.getScaledHeight() - 18 + getYOffset(), partialTicks, minecraft.thePlayer, sigil); + renderHotbarItem(resolution.getScaledWidth() / 2 + 103 + xOffset + getXOffset(), resolution.getScaledHeight() - 18 + getYOffset(), partialTicks, minecraft.player, sigil); xOffset += 20; } } diff --git a/src/main/java/WayofTime/bloodmagic/client/key/KeyBindings.java b/src/main/java/WayofTime/bloodmagic/client/key/KeyBindings.java index 3b4d12d2..d7a5c160 100644 --- a/src/main/java/WayofTime/bloodmagic/client/key/KeyBindings.java +++ b/src/main/java/WayofTime/bloodmagic/client/key/KeyBindings.java @@ -27,7 +27,7 @@ public enum KeyBindings @Override public void handleKeybind() { - ItemStack itemStack = ClientHandler.minecraft.thePlayer.getHeldItemMainhand(); + ItemStack itemStack = ClientHandler.minecraft.player.getHeldItemMainhand(); if (itemStack != null && itemStack.getItem() instanceof IKeybindable) BloodMagicPacketHandler.INSTANCE.sendToServer(new KeyProcessor(this, false)); } @@ -38,7 +38,7 @@ public enum KeyBindings @Override public void handleKeybind() { - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + EntityPlayerSP player = Minecraft.getMinecraft().player; if (player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof ItemSigilHolding) ClientHandler.cycleSigil(player.getHeldItemMainhand(), player, -1); } @@ -49,7 +49,7 @@ public enum KeyBindings @Override public void handleKeybind() { - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + EntityPlayerSP player = Minecraft.getMinecraft().player; if (player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof ItemSigilHolding) ClientHandler.cycleSigil(player.getHeldItemMainhand(), player, 1); } diff --git a/src/main/java/WayofTime/bloodmagic/client/render/block/RenderAltar.java b/src/main/java/WayofTime/bloodmagic/client/render/block/RenderAltar.java index 4fdf0161..6de70192 100644 --- a/src/main/java/WayofTime/bloodmagic/client/render/block/RenderAltar.java +++ b/src/main/java/WayofTime/bloodmagic/client/render/block/RenderAltar.java @@ -124,8 +124,8 @@ public class RenderAltar extends TileEntitySpecialRenderer private void renderHologram(TileAltar altar, EnumAltarTier tier, float partialTicks) { - EntityPlayerSP player = mc.thePlayer; - World world = player.worldObj; + EntityPlayerSP player = mc.player; + World world = player.world; if (tier == EnumAltarTier.ONE) return; diff --git a/src/main/java/WayofTime/bloodmagic/client/render/block/RenderItemRoutingNode.java b/src/main/java/WayofTime/bloodmagic/client/render/block/RenderItemRoutingNode.java index 2aab5c5c..da8b193a 100644 --- a/src/main/java/WayofTime/bloodmagic/client/render/block/RenderItemRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/client/render/block/RenderItemRoutingNode.java @@ -28,7 +28,7 @@ public class RenderItemRoutingNode extends TileEntitySpecialRenderer connectionList = tileNode.getConnected(); for (BlockPos wantedPos : connectionList) @@ -41,7 +41,7 @@ public class RenderItemRoutingNode extends TileEntitySpecialRenderer return ZOMBIE_TEXTURES; } - protected void rotateCorpse(EntityCorruptedZombie entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks) + protected void applyRotations(EntityCorruptedZombie entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks) { - super.rotateCorpse(entityLiving, p_77043_2_, p_77043_3_, partialTicks); + super.applyRotations(entityLiving, p_77043_2_, p_77043_3_, partialTicks); } } \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/command/CommandBloodMagic.java b/src/main/java/WayofTime/bloodmagic/command/CommandBloodMagic.java index a8e5b6a5..625166fa 100644 --- a/src/main/java/WayofTime/bloodmagic/command/CommandBloodMagic.java +++ b/src/main/java/WayofTime/bloodmagic/command/CommandBloodMagic.java @@ -1,77 +1,46 @@ package WayofTime.bloodmagic.command; import WayofTime.bloodmagic.command.sub.SubCommandBind; -import WayofTime.bloodmagic.command.sub.SubCommandHelp; import WayofTime.bloodmagic.command.sub.SubCommandNetwork; import WayofTime.bloodmagic.command.sub.SubCommandOrb; import WayofTime.bloodmagic.util.helper.TextHelper; -import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; -import net.minecraft.server.MinecraftServer; import net.minecraft.util.text.TextComponentString; +import net.minecraftforge.server.command.CommandTreeBase; -import java.util.*; - -public class CommandBloodMagic extends CommandBase +public class CommandBloodMagic extends CommandTreeBase { - // TODO - Move this and sub commands to CommandTreeBase in 1.11. Much cleaner impl - private final List aliases = new ArrayList(); - private final Map subCommands = new HashMap(); - public CommandBloodMagic() { - aliases.add("BloodMagic"); - aliases.add("bloodmagic"); - aliases.add("bloodMagic"); - aliases.add("bm"); - - subCommands.put("help", new SubCommandHelp(this)); - subCommands.put("network", new SubCommandNetwork(this)); - subCommands.put("bind", new SubCommandBind(this)); - subCommands.put("orb", new SubCommandOrb(this)); + addSubcommand(new SubCommandBind()); + addSubcommand(new SubCommandNetwork()); + addSubcommand(new SubCommandOrb()); } @Override - public String getCommandName() + public String getName() { - return "/bloodmagic"; + return "bloodmagic"; } @Override - public int getRequiredPermissionLevel() + public String getUsage(ICommandSender sender) { - return 2; + return "/bloodmagic help"; } - @Override - public String getCommandUsage(ICommandSender commandSender) + public static void displayHelpString(ICommandSender commandSender, String display, Object... info) { - return getCommandName() + " help"; + commandSender.sendMessage(new TextComponentString(TextHelper.localizeEffect(display, info))); } - @Override - public List getCommandAliases() + public static void displayErrorString(ICommandSender commandSender, String display, Object... info) { - return aliases; + commandSender.sendMessage(new TextComponentString(TextHelper.localizeEffect(display, info))); } - @Override - public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) + public static void displaySuccessString(ICommandSender commandSender, String display, Object... info) { - if (args.length > 0 && subCommands.containsKey(args[0])) - { - - ISubCommand subCommand = subCommands.get(args[0]); - String[] subArgs = Arrays.copyOfRange(args, 1, args.length); - subCommand.processSubCommand(server, commandSender, subArgs); - } else - { - commandSender.addChatMessage(new TextComponentString(TextHelper.localizeEffect("commands.error.unknown"))); - } - } - - public Map getSubCommands() - { - return subCommands; + commandSender.sendMessage(new TextComponentString(TextHelper.localizeEffect(display, info))); } } diff --git a/src/main/java/WayofTime/bloodmagic/command/ISubCommand.java b/src/main/java/WayofTime/bloodmagic/command/ISubCommand.java deleted file mode 100644 index e8d95798..00000000 --- a/src/main/java/WayofTime/bloodmagic/command/ISubCommand.java +++ /dev/null @@ -1,19 +0,0 @@ -package WayofTime.bloodmagic.command; - -import net.minecraft.command.ICommand; -import net.minecraft.command.ICommandSender; -import net.minecraft.server.MinecraftServer; - -public interface ISubCommand -{ - - String getSubCommandName(); - - ICommand getParentCommand(); - - String getArgUsage(ICommandSender commandSender); - - String getHelpText(); - - void processSubCommand(MinecraftServer server, ICommandSender commandSender, String[] args); -} \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/command/SubCommandBase.java b/src/main/java/WayofTime/bloodmagic/command/SubCommandBase.java deleted file mode 100644 index 0130f955..00000000 --- a/src/main/java/WayofTime/bloodmagic/command/SubCommandBase.java +++ /dev/null @@ -1,70 +0,0 @@ -package WayofTime.bloodmagic.command; - -import WayofTime.bloodmagic.util.helper.TextHelper; -import net.minecraft.command.ICommand; -import net.minecraft.command.ICommandSender; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.text.TextComponentString; - -import java.util.Locale; - -public abstract class SubCommandBase implements ISubCommand -{ - - private ICommand parent; - private String name; - - public SubCommandBase(ICommand parent, String name) - { - this.parent = parent; - this.name = name; - } - - @Override - public String getSubCommandName() - { - return name; - } - - @Override - public ICommand getParentCommand() - { - return parent; - } - - @Override - public void processSubCommand(MinecraftServer server, ICommandSender commandSender, String[] args) - { - - if (args.length == 0 && !getSubCommandName().equals("help")) - displayErrorString(commandSender, String.format(TextHelper.localizeEffect("commands.format.error"), capitalizeFirstLetter(getSubCommandName()), getArgUsage(commandSender))); - - if (isBounded(0, 2, args.length) && args[0].equals("help")) - displayHelpString(commandSender, String.format(TextHelper.localizeEffect("commands.format.help"), capitalizeFirstLetter(getSubCommandName()), getHelpText())); - } - - protected String capitalizeFirstLetter(String toCapital) - { - return String.valueOf(toCapital.charAt(0)).toUpperCase(Locale.ENGLISH) + toCapital.substring(1); - } - - protected boolean isBounded(int low, int high, int given) - { - return given > low && given < high; - } - - public static void displayHelpString(ICommandSender commandSender, String display, Object... info) - { - commandSender.addChatMessage(new TextComponentString(TextHelper.localizeEffect(display, info))); - } - - public static void displayErrorString(ICommandSender commandSender, String display, Object... info) - { - commandSender.addChatMessage(new TextComponentString(TextHelper.localizeEffect(display, info))); - } - - public static void displaySuccessString(ICommandSender commandSender, String display, Object... info) - { - commandSender.addChatMessage(new TextComponentString(TextHelper.localizeEffect(display, info))); - } -} diff --git a/src/main/java/WayofTime/bloodmagic/command/package-info.java b/src/main/java/WayofTime/bloodmagic/command/package-info.java deleted file mode 100644 index bdfb59bd..00000000 --- a/src/main/java/WayofTime/bloodmagic/command/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault -package WayofTime.bloodmagic.command; - -import mcp.MethodsReturnNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandBind.java b/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandBind.java index 755bea76..ae6489d9 100644 --- a/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandBind.java +++ b/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandBind.java @@ -4,43 +4,31 @@ import WayofTime.bloodmagic.api.Constants; import WayofTime.bloodmagic.api.iface.IBindable; import WayofTime.bloodmagic.api.util.helper.BindableHelper; import WayofTime.bloodmagic.api.util.helper.PlayerHelper; -import WayofTime.bloodmagic.command.SubCommandBase; import WayofTime.bloodmagic.util.helper.TextHelper; import com.google.common.base.Strings; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommand; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; import net.minecraft.util.text.TextComponentTranslation; -public class SubCommandBind extends SubCommandBase +public class SubCommandBind extends CommandBase { - - public SubCommandBind(ICommand parent) + @Override + public String getName() { - super(parent, "bind"); + return "bind"; } @Override - public String getArgUsage(ICommandSender commandSender) + public String getUsage(ICommandSender commandSender) { return TextHelper.localizeEffect("commands.bind.usage"); } @Override - public String getHelpText() + public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) throws CommandException { - return TextHelper.localizeEffect("commands.bind.help"); - } - - @Override - public void processSubCommand(MinecraftServer server, ICommandSender commandSender, String[] args) - { - super.processSubCommand(server, commandSender, args); - if (commandSender.getEntityWorld().isRemote) return; @@ -52,7 +40,7 @@ public class SubCommandBind extends SubCommandBase ItemStack held = player.getHeldItemMainhand(); boolean bind = true; - if (held != null && held.getItem() instanceof IBindable) + if (held.getItem() instanceof IBindable) { if (args.length > 0) { @@ -77,20 +65,20 @@ public class SubCommandBind extends SubCommandBase { BindableHelper.setItemOwnerName(held, playerName); BindableHelper.setItemOwnerUUID(held, uuid); - commandSender.addChatMessage(new TextComponentTranslation("commands.bind.success")); + commandSender.sendMessage(new TextComponentTranslation("commands.bind.success")); } else { if (!Strings.isNullOrEmpty(((IBindable) held.getItem()).getOwnerUUID(held))) { held.getTagCompound().removeTag(Constants.NBT.OWNER_UUID); held.getTagCompound().removeTag(Constants.NBT.OWNER_NAME); - commandSender.addChatMessage(new TextComponentTranslation("commands.bind.remove.success")); + commandSender.sendMessage(new TextComponentTranslation("commands.bind.remove.success")); } } } } catch (PlayerNotFoundException e) { - commandSender.addChatMessage(new TextComponentTranslation(TextHelper.localizeEffect("commands.error.404"))); + commandSender.sendMessage(new TextComponentTranslation(TextHelper.localizeEffect("commands.error.404"))); } } diff --git a/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandHelp.java b/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandHelp.java deleted file mode 100644 index 22dfd1d6..00000000 --- a/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandHelp.java +++ /dev/null @@ -1,43 +0,0 @@ -package WayofTime.bloodmagic.command.sub; - -import WayofTime.bloodmagic.command.CommandBloodMagic; -import WayofTime.bloodmagic.command.ISubCommand; -import WayofTime.bloodmagic.command.SubCommandBase; -import WayofTime.bloodmagic.util.helper.TextHelper; -import net.minecraft.command.ICommand; -import net.minecraft.command.ICommandSender; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.text.TextComponentString; - -public class SubCommandHelp extends SubCommandBase -{ - - public SubCommandHelp(ICommand parent) - { - super(parent, "help"); - } - - @Override - public String getArgUsage(ICommandSender commandSender) - { - return TextHelper.localize("commands.help.usage"); - } - - @Override - public String getHelpText() - { - return TextHelper.localizeEffect("commands.help.help"); - } - - @Override - public void processSubCommand(MinecraftServer server, ICommandSender commandSender, String[] args) - { - super.processSubCommand(server, commandSender, args); - - if (args.length > 0) - return; - - for (ISubCommand subCommand : ((CommandBloodMagic) getParentCommand()).getSubCommands().values()) - commandSender.addChatMessage(new TextComponentString(TextHelper.localizeEffect("commands.format.help", capitalizeFirstLetter(subCommand.getSubCommandName()), subCommand.getArgUsage(commandSender)))); - } -} diff --git a/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandNetwork.java b/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandNetwork.java index 579309b9..f54f501d 100644 --- a/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandNetwork.java +++ b/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandNetwork.java @@ -2,45 +2,32 @@ package WayofTime.bloodmagic.command.sub; import WayofTime.bloodmagic.api.saving.SoulNetwork; import WayofTime.bloodmagic.api.util.helper.NetworkHelper; -import WayofTime.bloodmagic.command.SubCommandBase; +import WayofTime.bloodmagic.command.CommandBloodMagic; import WayofTime.bloodmagic.util.Utils; import WayofTime.bloodmagic.util.helper.TextHelper; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommand; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.server.MinecraftServer; import net.minecraft.util.text.TextComponentString; import java.util.Locale; -public class SubCommandNetwork extends SubCommandBase +public class SubCommandNetwork extends CommandBase { - - public SubCommandNetwork(ICommand parent) - { - super(parent, "network"); + @Override + public String getName() { + return "network"; } @Override - public String getArgUsage(ICommandSender commandSender) + public String getUsage(ICommandSender commandSender) { return TextHelper.localizeEffect("commands.network.usage"); } @Override - public String getHelpText() + public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) throws CommandException { - return TextHelper.localizeEffect("commands.network.help"); - } - - @Override - public void processSubCommand(MinecraftServer server, ICommandSender commandSender, String[] args) - { - super.processSubCommand(server, commandSender, args); - if (args.length > 1) { if (args[0].equalsIgnoreCase("help")) @@ -53,18 +40,18 @@ public class SubCommandNetwork extends SubCommandBase try { ValidCommands command = ValidCommands.valueOf(args[0].toUpperCase(Locale.ENGLISH)); - command.run(player, commandSender, isBounded(0, 2, args.length), args); + command.run(player, commandSender, args.length > 0 && args.length < 2, args); } catch (IllegalArgumentException e) { } } catch (PlayerNotFoundException e) { - displayErrorString(commandSender, e.getLocalizedMessage()); + CommandBloodMagic.displayErrorString(commandSender, e.getLocalizedMessage()); } } else { - displayErrorString(commandSender, "commands.error.arg.missing"); + CommandBloodMagic.displayErrorString(commandSender, "commands.error.arg.missing"); } } @@ -77,7 +64,7 @@ public class SubCommandNetwork extends SubCommandBase { if (displayHelp) { - displayHelpString(sender, this.help); + CommandBloodMagic.displayHelpString(sender, this.help); return; } @@ -87,14 +74,14 @@ public class SubCommandNetwork extends SubCommandBase { int amount = Integer.parseInt(args[2]); NetworkHelper.getSoulNetwork(player).syphonAndDamage(player, amount); - displaySuccessString(sender, "commands.network.syphon.success", amount, player.getDisplayName().getFormattedText()); + CommandBloodMagic.displaySuccessString(sender, "commands.network.syphon.success", amount, player.getDisplayName().getFormattedText()); } else { - displayErrorString(sender, "commands.error.arg.invalid"); + CommandBloodMagic.displayErrorString(sender, "commands.error.arg.invalid"); } } else { - displayErrorString(sender, "commands.error.arg.missing"); + CommandBloodMagic.displayErrorString(sender, "commands.error.arg.missing"); } } }, @@ -105,7 +92,7 @@ public class SubCommandNetwork extends SubCommandBase { if (displayHelp) { - displayHelpString(sender, this.help); + CommandBloodMagic.displayHelpString(sender, this.help); return; } @@ -117,14 +104,14 @@ public class SubCommandNetwork extends SubCommandBase { int amount = Integer.parseInt(args[2]); int maxOrb = NetworkHelper.getMaximumForTier(network.getOrbTier()); - displaySuccessString(sender, "commands.network.add.success", network.add(amount, maxOrb), player.getDisplayName().getFormattedText()); + CommandBloodMagic.displaySuccessString(sender, "commands.network.add.success", network.add(amount, maxOrb), player.getDisplayName().getFormattedText()); } else { - displayErrorString(sender, "commands.error.arg.invalid"); + CommandBloodMagic.displayErrorString(sender, "commands.error.arg.invalid"); } } else { - displayErrorString(sender, "commands.error.arg.missing"); + CommandBloodMagic.displayErrorString(sender, "commands.error.arg.missing"); } } }, @@ -135,7 +122,7 @@ public class SubCommandNetwork extends SubCommandBase { if (displayHelp) { - displayHelpString(sender, this.help); + CommandBloodMagic.displayHelpString(sender, this.help); return; } @@ -147,14 +134,14 @@ public class SubCommandNetwork extends SubCommandBase { int amount = Integer.parseInt(args[2]); network.setCurrentEssence(amount); - displaySuccessString(sender, "commands.network.set.success", player.getDisplayName().getFormattedText(), amount); + CommandBloodMagic.displaySuccessString(sender, "commands.network.set.success", player.getDisplayName().getFormattedText(), amount); } else { - displayErrorString(sender, "commands.error.arg.invalid"); + CommandBloodMagic.displayErrorString(sender, "commands.error.arg.invalid"); } } else { - displayErrorString(sender, "commands.error.arg.missing"); + CommandBloodMagic.displayErrorString(sender, "commands.error.arg.missing"); } } }, @@ -165,14 +152,14 @@ public class SubCommandNetwork extends SubCommandBase { if (displayHelp) { - displayHelpString(sender, this.help); + CommandBloodMagic.displayHelpString(sender, this.help); return; } SoulNetwork network = NetworkHelper.getSoulNetwork(player); if (args.length > 1) - sender.addChatMessage(new TextComponentString(TextHelper.localizeEffect("tooltip.BloodMagic.sigil.divination.currentEssence", network.getCurrentEssence()))); + sender.sendMessage(new TextComponentString(TextHelper.localizeEffect("tooltip.bloodmagic.sigil.divination.currentEssence", network.getCurrentEssence()))); } }, @@ -183,7 +170,7 @@ public class SubCommandNetwork extends SubCommandBase { if (displayHelp) { - displayHelpString(sender, this.help, Integer.MAX_VALUE); + CommandBloodMagic.displayHelpString(sender, this.help, Integer.MAX_VALUE); return; } @@ -192,7 +179,7 @@ public class SubCommandNetwork extends SubCommandBase if (args.length > 1) { network.setCurrentEssence(Integer.MAX_VALUE); - displaySuccessString(sender, "commands.network.fill.success", player.getDisplayName().getFormattedText()); + CommandBloodMagic.displaySuccessString(sender, "commands.network.fill.success", player.getDisplayName().getFormattedText()); } } }, @@ -203,7 +190,7 @@ public class SubCommandNetwork extends SubCommandBase { if (displayHelp) { - displayHelpString(sender, this.help); + CommandBloodMagic.displayHelpString(sender, this.help); return; } @@ -213,7 +200,7 @@ public class SubCommandNetwork extends SubCommandBase { int maxOrb = NetworkHelper.getMaximumForTier(network.getOrbTier()); network.setCurrentEssence(maxOrb); - displaySuccessString(sender, "commands.network.cap.success", player.getDisplayName().getFormattedText()); + CommandBloodMagic.displaySuccessString(sender, "commands.network.cap.success", player.getDisplayName().getFormattedText()); } } }, diff --git a/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandOrb.java b/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandOrb.java index e66fbdb7..d982059b 100644 --- a/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandOrb.java +++ b/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandOrb.java @@ -3,44 +3,32 @@ package WayofTime.bloodmagic.command.sub; import WayofTime.bloodmagic.api.saving.SoulNetwork; import WayofTime.bloodmagic.api.util.helper.NetworkHelper; import WayofTime.bloodmagic.api.util.helper.PlayerHelper; -import WayofTime.bloodmagic.command.SubCommandBase; +import WayofTime.bloodmagic.command.CommandBloodMagic; import WayofTime.bloodmagic.util.Utils; import WayofTime.bloodmagic.util.helper.TextHelper; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommand; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.command.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.server.MinecraftServer; import net.minecraft.util.text.TextComponentString; import java.util.Locale; -public class SubCommandOrb extends SubCommandBase +public class SubCommandOrb extends CommandBase { - - public SubCommandOrb(ICommand parent) - { - super(parent, "orb"); + @Override + public String getName() { + return "orb"; } @Override - public String getArgUsage(ICommandSender commandSender) + public String getUsage(ICommandSender commandSender) { return TextHelper.localizeEffect("commands.orb.usage"); } @Override - public String getHelpText() + public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) throws CommandException { - return TextHelper.localizeEffect("commands.orb.help"); - } - - @Override - public void processSubCommand(MinecraftServer server, ICommandSender commandSender, String[] args) - { - super.processSubCommand(server, commandSender, args); - if (args.length > 0) { @@ -58,7 +46,7 @@ public class SubCommandOrb extends SubCommandBase String uuid = PlayerHelper.getUUIDFromPlayer(player).toString(); SoulNetwork network = NetworkHelper.getSoulNetwork(uuid); - boolean displayHelp = isBounded(0, 2, args.length); + boolean displayHelp = args.length > 0 && args.length < 2; try { @@ -68,7 +56,7 @@ public class SubCommandOrb extends SubCommandBase { if (displayHelp) { - displayHelpString(commandSender, ValidCommands.SET.help); + CommandBloodMagic.displayHelpString(commandSender, ValidCommands.SET.help); break; } @@ -78,14 +66,14 @@ public class SubCommandOrb extends SubCommandBase { int amount = Integer.parseInt(args[2]); network.setOrbTier(amount); - displaySuccessString(commandSender, "commands.success"); + CommandBloodMagic.displaySuccessString(commandSender, "commands.success"); } else { - displayErrorString(commandSender, "commands.error.arg.invalid"); + CommandBloodMagic.displayErrorString(commandSender, "commands.error.arg.invalid"); } } else { - displayErrorString(commandSender, "commands.error.arg.missing"); + CommandBloodMagic.displayErrorString(commandSender, "commands.error.arg.missing"); } break; @@ -94,23 +82,23 @@ public class SubCommandOrb extends SubCommandBase { if (displayHelp) { - displayHelpString(commandSender, ValidCommands.GET.help); + CommandBloodMagic.displayHelpString(commandSender, ValidCommands.GET.help); break; } if (args.length > 1) - commandSender.addChatMessage(new TextComponentString(TextHelper.localizeEffect("message.orb.currenttier", network.getOrbTier()))); + commandSender.sendMessage(new TextComponentString(TextHelper.localizeEffect("message.orb.currenttier", network.getOrbTier()))); break; } } } catch (IllegalArgumentException e) { - displayErrorString(commandSender, "commands.error.404"); + CommandBloodMagic.displayErrorString(commandSender, "commands.error.404"); } } catch (PlayerNotFoundException e) { - displayErrorString(commandSender, "commands.error.404"); + CommandBloodMagic.displayErrorString(commandSender, "commands.error.404"); } } } diff --git a/src/main/java/WayofTime/bloodmagic/command/sub/package-info.java b/src/main/java/WayofTime/bloodmagic/command/sub/package-info.java deleted file mode 100644 index 04788ab8..00000000 --- a/src/main/java/WayofTime/bloodmagic/command/sub/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault -package WayofTime.bloodmagic.command.sub; - -import mcp.MethodsReturnNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/compat/guideapi/CompatibilityGuideAPI.java b/src/main/java/WayofTime/bloodmagic/compat/guideapi/CompatibilityGuideAPI.java index 138544cf..877d967a 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/guideapi/CompatibilityGuideAPI.java +++ b/src/main/java/WayofTime/bloodmagic/compat/guideapi/CompatibilityGuideAPI.java @@ -14,7 +14,7 @@ import net.minecraftforge.oredict.ShapelessOreRecipe; public class CompatibilityGuideAPI implements ICompatibility { - private static IRecipe guideRecipe = null; + static IRecipe guideRecipe = null; private static boolean worldFlag; @Override @@ -46,9 +46,11 @@ public class CompatibilityGuideAPI implements ICompatibility { if (!worldFlag) { GameRegistry.addRecipe(guideRecipe); + GuideBloodMagic.handleBookRecipe(true); worldFlag = true; } else { CraftingManager.getInstance().getRecipeList().remove(guideRecipe); + GuideBloodMagic.handleBookRecipe(false); worldFlag = false; } break; diff --git a/src/main/java/WayofTime/bloodmagic/compat/guideapi/GuideBloodMagic.java b/src/main/java/WayofTime/bloodmagic/compat/guideapi/GuideBloodMagic.java index dc06383b..a0f65082 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/guideapi/GuideBloodMagic.java +++ b/src/main/java/WayofTime/bloodmagic/compat/guideapi/GuideBloodMagic.java @@ -6,7 +6,6 @@ import WayofTime.bloodmagic.registry.ModBlocks; import WayofTime.bloodmagic.registry.ModItems; import amerifrance.guideapi.api.GuideAPI; import amerifrance.guideapi.api.impl.Book; -import amerifrance.guideapi.api.util.NBTBookTags; import amerifrance.guideapi.category.CategoryItemStack; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.FMLCommonHandler; @@ -42,9 +41,13 @@ public class GuideBloodMagic // guideBook.addCategory(new CategoryItemStack(CategorySpell.buildCategory(), "guide.BloodMagic.category.spell", new ItemStack(ModItems.ritualDiviner))); } - public static void initJEIBlacklist() + public static void handleBookRecipe(boolean add) { - if (Loader.isModLoaded("JEI")) - BloodMagicPlugin.jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(GuideAPI.guideBook, NBTBookTags.BOOK_TAG, NBTBookTags.CATEGORY_PAGE_TAG, NBTBookTags.CATEGORY_TAG, NBTBookTags.ENTRY_PAGE_TAG, NBTBookTags.ENTRY_TAG, NBTBookTags.KEY_TAG, NBTBookTags.PAGE_TAG); + if (Loader.isModLoaded("JEI")) { + if (add) + BloodMagicPlugin.jeiRuntime.getRecipeRegistry().addRecipe(CompatibilityGuideAPI.guideRecipe); + else + BloodMagicPlugin.jeiRuntime.getRecipeRegistry().removeRecipe(CompatibilityGuideAPI.guideRecipe); + } } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/BloodMagicPlugin.java b/src/main/java/WayofTime/bloodmagic/compat/jei/BloodMagicPlugin.java index 9399aee5..21cfd340 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/BloodMagicPlugin.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/BloodMagicPlugin.java @@ -39,6 +39,7 @@ import WayofTime.bloodmagic.registry.ModItems; public class BloodMagicPlugin extends BlankModPlugin { public static IJeiHelpers jeiHelper; + public static IJeiRuntime jeiRuntime; @Override public void register(@Nonnull IModRegistry registry) @@ -56,8 +57,8 @@ public class BloodMagicPlugin extends BlankModPlugin registry.addRecipes(AlchemyTableRecipeMaker.getRecipes()); registry.addRecipes(ArmourDowngradeRecipeMaker.getRecipes()); - registry.addDescription(new ItemStack(ModItems.ALTAR_MAKER), "jei.BloodMagic.desc.altarBuilder"); - registry.addDescription(new ItemStack(ModItems.MONSTER_SOUL), "jei.BloodMagic.desc.demonicWill"); + registry.addDescription(new ItemStack(ModItems.ALTAR_MAKER), "jei.bloodmagic.desc.altarBuilder"); + registry.addDescription(new ItemStack(ModItems.MONSTER_SOUL), "jei.bloodmagic.desc.demonicWill"); jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(ModBlocks.BLOOD_LIGHT)); jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(ModBlocks.SPECTRAL_BLOCK)); @@ -78,8 +79,6 @@ public class BloodMagicPlugin extends BlankModPlugin } } - jeiHelper.getSubtypeRegistry().useNbtForSubtypes(Item.getItemFromBlock(ModBlocks.BLOOD_TANK)); - registry.addRecipeClickArea(GuiSoulForge.class, 115, 15, 16, 88, Constants.Compat.JEI_CATEGORY_SOULFORGE); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.ALTAR), Constants.Compat.JEI_CATEGORY_ALTAR); @@ -88,15 +87,15 @@ public class BloodMagicPlugin extends BlankModPlugin registry.addRecipeCategoryCraftingItem(new ItemStack(ModItems.ARCANE_ASHES), Constants.Compat.JEI_CATEGORY_BINDING); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.ALCHEMY_TABLE), Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.RITUAL_CONTROLLER), Constants.Compat.JEI_CATEGORY_ARMOURDOWNGRADE); + } - jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.OWNER_UUID); - jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.OWNER_NAME); - jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.USES); - jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.SOULS); - jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.X_COORD); - jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.Y_COORD); - jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.Z_COORD); - jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.DIMENSION_ID); - jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.ITEM_INVENTORY); + @Override + public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) { + subtypeRegistry.useNbtForSubtypes(Item.getItemFromBlock(ModBlocks.BLOOD_TANK)); + } + + @Override + public void onRuntimeAvailable(IJeiRuntime runtime) { + jeiRuntime = runtime; } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/CompatibilityJustEnoughItems.java b/src/main/java/WayofTime/bloodmagic/compat/jei/CompatibilityJustEnoughItems.java deleted file mode 100644 index dc95a10d..00000000 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/CompatibilityJustEnoughItems.java +++ /dev/null @@ -1,24 +0,0 @@ -package WayofTime.bloodmagic.compat.jei; - -import WayofTime.bloodmagic.compat.ICompatibility; - -public class CompatibilityJustEnoughItems implements ICompatibility -{ - @Override - public void loadCompatibility(InitializationPhase phase) - { - - } - - @Override - public String getModId() - { - return "JEI"; - } - - @Override - public boolean enableCompat() - { - return true; - } -} diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingCategory.java b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingCategory.java index 72653f5f..c2ffb1b1 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingCategory.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingCategory.java @@ -1,12 +1,15 @@ package WayofTime.bloodmagic.compat.jei.alchemyArray; import javax.annotation.Nonnull; +import javax.annotation.Nullable; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.IRecipeCategory; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import WayofTime.bloodmagic.api.Constants; import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin; @@ -21,7 +24,7 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory @Nonnull private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/binding.png"), 0, 0, 100, 30); @Nonnull - private final String localizedName = TextHelper.localize("jei.BloodMagic.recipe.alchemyArrayCrafting"); + private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.alchemyArrayCrafting"); @Nonnull @Override @@ -50,14 +53,15 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory } + @Nullable @Override - public void drawAnimations(Minecraft minecraft) + public IDrawable getIcon() { - + return null; } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) { recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5); recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 29, 3); @@ -65,10 +69,19 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory if (recipeWrapper instanceof AlchemyArrayCraftingRecipeJEI) { - AlchemyArrayCraftingRecipeJEI alchemyArrayWrapper = (AlchemyArrayCraftingRecipeJEI) recipeWrapper; - recipeLayout.getItemStacks().set(INPUT_SLOT, alchemyArrayWrapper.getInputs()); - recipeLayout.getItemStacks().set(CATALYST_SLOT, alchemyArrayWrapper.getCatalyst()); - recipeLayout.getItemStacks().set(OUTPUT_SLOT, alchemyArrayWrapper.getOutputs()); + recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0)); + recipeLayout.getItemStacks().set(CATALYST_SLOT, ingredients.getInputs(ItemStack.class).get(ingredients.getInputs(ItemStack.class).size() - 1)); + recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0)); } } + + @Override + public void drawAnimations(Minecraft minecraft) { + + } + + @Override + public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper) { + + } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingRecipeHandler.java b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingRecipeHandler.java index 0d6f2acb..efcd0344 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingRecipeHandler.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingRecipeHandler.java @@ -15,14 +15,6 @@ public class AlchemyArrayCraftingRecipeHandler implements IRecipeHandler 0 && recipe.getOutputs().size() > 0; + return true; + } + + @Override + public String getRecipeCategoryUid() { + return null; } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingRecipeJEI.java b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingRecipeJEI.java index fa74d805..1dbb5f98 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingRecipeJEI.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/AlchemyArrayCraftingRecipeJEI.java @@ -1,11 +1,12 @@ package WayofTime.bloodmagic.compat.jei.alchemyArray; -import java.util.Collections; import java.util.List; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import com.google.common.collect.Lists; +import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.BlankRecipeWrapper; import net.minecraft.item.ItemStack; @@ -13,10 +14,8 @@ public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper { @Nonnull private final List inputs; - @Nullable private final ItemStack catalyst; - @Nonnull private final ItemStack output; @@ -27,22 +26,14 @@ public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper this.output = output; } - @Override - @Nonnull - public List getInputs() - { - return inputs; - } - public ItemStack getCatalyst() { return catalyst; } @Override - @Nonnull - public List getOutputs() - { - return Collections.singletonList(output); + public void getIngredients(IIngredients ingredients) { + ingredients.setInputLists(ItemStack.class, Lists.newArrayList(inputs, Lists.newArrayList(catalyst))); + ingredients.setOutput(ItemStack.class, output); } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/package-info.java b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/package-info.java deleted file mode 100644 index b9a88570..00000000 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyArray/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault -package WayofTime.bloodmagic.compat.jei.alchemyArray; - -import mcp.MethodsReturnNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/AlchemyTableRecipeCategory.java b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/AlchemyTableRecipeCategory.java index 7f4c84d7..5cbaaf8a 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/AlchemyTableRecipeCategory.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/AlchemyTableRecipeCategory.java @@ -1,14 +1,14 @@ package WayofTime.bloodmagic.compat.jei.alchemyTable; -import java.util.ArrayList; -import java.util.List; - import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import com.google.common.collect.Lists; import mezz.jei.api.gui.ICraftingGridHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiItemStackGroup; import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.IRecipeCategory; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; @@ -27,7 +27,7 @@ public class AlchemyTableRecipeCategory implements IRecipeCategory @Nonnull private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/alchemyTable.png"), 0, 0, 118, 40); @Nonnull - private final String localizedName = TextHelper.localize("jei.BloodMagic.recipe.alchemyTable"); + private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.alchemyTable"); @Nonnull private final ICraftingGridHelper craftingGridHelper; @@ -63,15 +63,16 @@ public class AlchemyTableRecipeCategory implements IRecipeCategory } + @Nullable @Override - public void drawAnimations(Minecraft minecraft) + public IDrawable getIcon() { - + return null; } - @Override @SuppressWarnings("unchecked") - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + @Override + public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); @@ -89,10 +90,19 @@ public class AlchemyTableRecipeCategory implements IRecipeCategory if (recipeWrapper instanceof AlchemyTableRecipeJEI) { - AlchemyTableRecipeJEI recipe = (AlchemyTableRecipeJEI) recipeWrapper; - guiItemStacks.set(ORB_SLOT, (ArrayList) recipe.getInputs().get(1)); - craftingGridHelper.setOutput(guiItemStacks, recipe.getOutputs()); - craftingGridHelper.setInput(guiItemStacks, (List) recipe.getInputs().get(0), 3, 2); + guiItemStacks.set(ORB_SLOT, ingredients.getInputs(ItemStack.class).get(1)); + craftingGridHelper.setOutput(guiItemStacks, Lists.newArrayList(ingredients.getOutputs(ItemStack.class).get(0))); + craftingGridHelper.setInputStacks(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2); } } + + @Override + public void drawAnimations(Minecraft minecraft) { + + } + + @Override + public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper) { + + } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/AlchemyTableRecipeHandler.java b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/AlchemyTableRecipeHandler.java index 91755902..a6886aa0 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/AlchemyTableRecipeHandler.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/AlchemyTableRecipeHandler.java @@ -15,14 +15,6 @@ public class AlchemyTableRecipeHandler implements IRecipeHandler 0 && recipe.getOutputs().size() > 0; + return true; + } + + @Override + public String getRecipeCategoryUid() { + return null; } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/AlchemyTableRecipeJEI.java b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/AlchemyTableRecipeJEI.java index e0a00fc9..9c258297 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/AlchemyTableRecipeJEI.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/AlchemyTableRecipeJEI.java @@ -1,18 +1,14 @@ package WayofTime.bloodmagic.compat.jei.alchemyTable; import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin; import lombok.Getter; +import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.BlankRecipeWrapper; import net.minecraft.item.ItemStack; import WayofTime.bloodmagic.api.recipe.AlchemyTableRecipe; -import WayofTime.bloodmagic.api.registry.OrbRegistry; import WayofTime.bloodmagic.util.helper.TextHelper; public class AlchemyTableRecipeJEI extends BlankRecipeWrapper @@ -20,42 +16,27 @@ public class AlchemyTableRecipeJEI extends BlankRecipeWrapper @Getter private AlchemyTableRecipe recipe; -// @Getter -// private ArrayList validGems = new ArrayList(); - public AlchemyTableRecipeJEI(AlchemyTableRecipe recipe) { this.recipe = recipe; } @Override - @Nonnull - public List getInputs() - { - ArrayList ret = new ArrayList(); - ret.add(recipe.getInput()); - ret.add(OrbRegistry.getOrbsDownToTier(recipe.getTierRequired())); - return ret; + public void getIngredients(IIngredients ingredients) { + List> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput()); + ingredients.setInputLists(ItemStack.class, expanded); + ingredients.setOutput(ItemStack.class, recipe.getRecipeOutput(new ArrayList())); } - @Override - @Nonnull - public List getOutputs() - { - return Collections.singletonList(recipe.getRecipeOutput(new ArrayList())); - } - - @Nullable @Override public List getTooltipStrings(int mouseX, int mouseY) { ArrayList ret = new ArrayList(); if (mouseX >= 58 && mouseX <= 78 && mouseY >= 21 && mouseY <= 34) { - ret.add(TextHelper.localize("jei.BloodMagic.recipe.lpDrained", recipe.getLpDrained())); - ret.add(TextHelper.localize("jei.BloodMagic.recipe.ticksRequired", recipe.getTicksRequired())); - return ret; + ret.add(TextHelper.localize("jei.bloodmagic.recipe.lpDrained", recipe.getLpDrained())); + ret.add(TextHelper.localize("jei.bloodmagic.recipe.ticksRequired", recipe.getTicksRequired())); } - return null; + return ret; } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/package-info.java b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/package-info.java deleted file mode 100644 index c7a5c86b..00000000 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault -package WayofTime.bloodmagic.compat.jei.alchemyTable; - -import mcp.MethodsReturnNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeCategory.java b/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeCategory.java index a4a7fc70..7bf9597b 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeCategory.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeCategory.java @@ -1,11 +1,13 @@ package WayofTime.bloodmagic.compat.jei.altar; import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.util.List; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.IRecipeCategory; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; @@ -23,7 +25,7 @@ public class AltarRecipeCategory implements IRecipeCategory @Nonnull private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/altar.png"), 3, 4, 155, 65); @Nonnull - private final String localizedName = TextHelper.localize("jei.BloodMagic.recipe.altar"); + private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.altar"); @Nonnull @Override @@ -52,24 +54,32 @@ public class AltarRecipeCategory implements IRecipeCategory } + @Nullable @Override - public void drawAnimations(Minecraft minecraft) - { - + public IDrawable getIcon() { + return null; } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) { recipeLayout.getItemStacks().init(INPUT_SLOT, true, 31, 0); recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 125, 30); if (recipeWrapper instanceof AltarRecipeJEI) { - AltarRecipeJEI altarRecipeWrapper = (AltarRecipeJEI) recipeWrapper; - List> inputs = altarRecipeWrapper.getInputs(); - recipeLayout.getItemStacks().set(INPUT_SLOT, inputs.get(0)); - recipeLayout.getItemStacks().set(OUTPUT_SLOT, altarRecipeWrapper.getOutputs()); + recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0)); + recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0)); } } + + @Override + public void drawAnimations(Minecraft minecraft) { + + } + + @Override + public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper) { + + } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeHandler.java b/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeHandler.java index dc414295..3a9be064 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeHandler.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeHandler.java @@ -15,14 +15,6 @@ public class AltarRecipeHandler implements IRecipeHandler return AltarRecipeJEI.class; } - @Deprecated - @Nonnull - @Override - public String getRecipeCategoryUid() - { - return Constants.Compat.JEI_CATEGORY_ALTAR; - } - @Override public String getRecipeCategoryUid(@Nonnull AltarRecipeJEI recipe) { @@ -39,6 +31,11 @@ public class AltarRecipeHandler implements IRecipeHandler @Override public boolean isRecipeValid(@Nonnull AltarRecipeJEI recipe) { - return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0; + return true; + } + + @Override + public String getRecipeCategoryUid() { + return null; } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeJEI.java b/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeJEI.java index 7b9e00cc..22558ba6 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeJEI.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/altar/AltarRecipeJEI.java @@ -2,13 +2,12 @@ package WayofTime.bloodmagic.compat.jei.altar; import java.awt.Color; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import javax.annotation.Nonnull; -import javax.annotation.Nullable; import WayofTime.bloodmagic.util.helper.NumeralHelper; +import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.BlankRecipeWrapper; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; @@ -18,7 +17,6 @@ public class AltarRecipeJEI extends BlankRecipeWrapper { @Nonnull private final List input; - @Nonnull private final ItemStack output; @@ -31,35 +29,27 @@ public class AltarRecipeJEI extends BlankRecipeWrapper this.input = input; this.output = output; - this.infoString = new String[] { TextHelper.localize("jei.BloodMagic.recipe.requiredTier", NumeralHelper.toRoman(tier)), TextHelper.localize("jei.BloodMagic.recipe.requiredLP", requiredLP) }; + this.infoString = new String[] { TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(tier)), TextHelper.localize("jei.bloodmagic.recipe.requiredLP", requiredLP) }; this.consumptionRate = consumptionRate; this.drainRate = drainRate; } @Override - public List> getInputs() - { - return Collections.singletonList(input); + public void getIngredients(IIngredients ingredients) { + ingredients.setInputs(ItemStack.class, input); + ingredients.setOutput(ItemStack.class, output); } - @Override - public List getOutputs() - { - return Collections.singletonList(output); - } - - @Nullable @Override public List getTooltipStrings(int mouseX, int mouseY) { ArrayList ret = new ArrayList(); if (mouseX >= 13 && mouseX <= 64 && mouseY >= 27 && mouseY <= 58) { - ret.add(TextHelper.localize("jei.BloodMagic.recipe.consumptionRate", consumptionRate)); - ret.add(TextHelper.localize("jei.BloodMagic.recipe.drainRate", drainRate)); - return ret; + ret.add(TextHelper.localize("jei.bloodmagic.recipe.consumptionRate", consumptionRate)); + ret.add(TextHelper.localize("jei.bloodmagic.recipe.drainRate", drainRate)); } - return null; + return ret; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/altar/package-info.java b/src/main/java/WayofTime/bloodmagic/compat/jei/altar/package-info.java deleted file mode 100644 index 4fb6eef6..00000000 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/altar/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault -package WayofTime.bloodmagic.compat.jei.altar; - -import mcp.MethodsReturnNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeCategory.java b/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeCategory.java index 83e8efd5..b264427c 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeCategory.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeCategory.java @@ -1,14 +1,13 @@ package WayofTime.bloodmagic.compat.jei.armourDowngrade; -import java.util.ArrayList; -import java.util.List; - import javax.annotation.Nonnull; +import javax.annotation.Nullable; import mezz.jei.api.gui.ICraftingGridHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiItemStackGroup; import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.IRecipeCategory; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; @@ -27,7 +26,7 @@ public class ArmourDowngradeRecipeCategory implements IRecipeCategory @Nonnull private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/alchemyTable.png"), 0, 0, 118, 40); @Nonnull - private final String localizedName = TextHelper.localize("jei.BloodMagic.recipe.armourDowngrade"); + private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.armourDowngrade"); @Nonnull private final ICraftingGridHelper craftingGridHelper; @@ -63,15 +62,15 @@ public class ArmourDowngradeRecipeCategory implements IRecipeCategory } + @Nullable @Override - public void drawAnimations(Minecraft minecraft) - { - + public IDrawable getIcon() { + return null; } @Override @SuppressWarnings("unchecked") - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper, IIngredients ingredients) { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); @@ -89,10 +88,20 @@ public class ArmourDowngradeRecipeCategory implements IRecipeCategory if (recipeWrapper instanceof ArmourDowngradeRecipeJEI) { - ArmourDowngradeRecipeJEI recipe = (ArmourDowngradeRecipeJEI) recipeWrapper; - guiItemStacks.set(KEY_SLOT, (ArrayList) recipe.getInputs().get(1)); - craftingGridHelper.setOutput(guiItemStacks, recipe.getOutputs()); - craftingGridHelper.setInput(guiItemStacks, (List) recipe.getInputs().get(0), 3, 2); + guiItemStacks.set(KEY_SLOT, ingredients.getInputs(ItemStack.class).get(ingredients.getInputs(ItemStack.class).size() - 1)); + ingredients.getInputs(ItemStack.class).remove(ingredients.getInputs(ItemStack.class).size() - 1); + guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0)); + craftingGridHelper.setInputStacks(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2); } } + + @Override + public void drawAnimations(Minecraft minecraft) { + + } + + @Override + public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper) { + + } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeHandler.java b/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeHandler.java index 757f1c32..06360885 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeHandler.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeHandler.java @@ -15,14 +15,6 @@ public class ArmourDowngradeRecipeHandler implements IRecipeHandler 0 && recipe.getOutputs().size() > 0; + return true; + } + + @Override + public String getRecipeCategoryUid() { + return null; } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeJEI.java b/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeJEI.java index a66d53f6..e412380a 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeJEI.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeJEI.java @@ -1,65 +1,34 @@ package WayofTime.bloodmagic.compat.jei.armourDowngrade; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin; +import com.google.common.collect.Lists; import lombok.Getter; +import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.BlankRecipeWrapper; import net.minecraft.item.ItemStack; import WayofTime.bloodmagic.api.recipe.LivingArmourDowngradeRecipe; import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades; import WayofTime.bloodmagic.registry.ModItems; -import com.google.common.collect.Lists; +import java.util.List; public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper { @Getter private LivingArmourDowngradeRecipe recipe; -// @Getter -// private ArrayList validGems = new ArrayList(); - public ArmourDowngradeRecipeJEI(LivingArmourDowngradeRecipe recipe) { this.recipe = recipe; } @Override - @Nonnull - public List getInputs() - { - ArrayList ret = new ArrayList(); - ret.add(recipe.getInput()); - ret.add(Lists.newArrayList(recipe.getKey())); - return ret; - } - - @Override - @Nonnull - public List getOutputs() - { + public void getIngredients(IIngredients ingredients) { + List> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput()); + expanded.add(Lists.newArrayList(recipe.getKey())); + ingredients.setInputLists(ItemStack.class, expanded); ItemStack upgradeStack = new ItemStack(ModItems.UPGRADE_TOME); LivingUpgrades.setUpgrade(upgradeStack, recipe.getRecipeOutput()); - return Collections.singletonList(upgradeStack); - } - - @Nullable - @Override - public List getTooltipStrings(int mouseX, int mouseY) - { -// ArrayList ret = new ArrayList(); -// if (mouseX >= 58 && mouseX <= 78 && mouseY >= 21 && mouseY <= 34) -// { -// ret.add(TextHelper.localize("jei.BloodMagic.recipe.lpDrained", recipe.getLpDrained())); -// ret.add(TextHelper.localize("jei.BloodMagic.recipe.ticksRequired", recipe.getTicksRequired())); -// return ret; -// } - return null; + ingredients.setOutput(ItemStack.class, upgradeStack); } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/package-info.java b/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/package-info.java deleted file mode 100644 index cd9bdf10..00000000 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault -package WayofTime.bloodmagic.compat.jei.armourDowngrade; - -import mcp.MethodsReturnNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeCategory.java b/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeCategory.java index cc341cd1..1479d45d 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeCategory.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeCategory.java @@ -1,9 +1,11 @@ package WayofTime.bloodmagic.compat.jei.binding; import javax.annotation.Nonnull; +import javax.annotation.Nullable; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.IRecipeCategory; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; @@ -22,7 +24,7 @@ public class BindingRecipeCategory implements IRecipeCategory @Nonnull private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/binding.png"), 0, 0, 100, 30); @Nonnull - private final String localizedName = TextHelper.localize("jei.BloodMagic.recipe.binding"); + private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.binding"); @Nonnull @Override @@ -51,26 +53,33 @@ public class BindingRecipeCategory implements IRecipeCategory } + @Nullable @Override - public void drawAnimations(Minecraft minecraft) - { - + public IDrawable getIcon() { + return null; } @Override - @SuppressWarnings("unchecked") - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) - { + public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) { recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5); recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 29, 3); recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 73, 5); if (recipeWrapper instanceof BindingRecipeJEI) { - BindingRecipeJEI bindingRecipe = (BindingRecipeJEI) recipeWrapper; - recipeLayout.getItemStacks().set(INPUT_SLOT, bindingRecipe.getInputs()); - recipeLayout.getItemStacks().set(CATALYST_SLOT, bindingRecipe.getCatalyst()); - recipeLayout.getItemStacks().set(OUTPUT_SLOT, bindingRecipe.getOutputs()); + recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0)); + recipeLayout.getItemStacks().set(CATALYST_SLOT, ingredients.getInputs(ItemStack.class).get(1)); + recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0)); } } + + @Override + public void drawAnimations(Minecraft minecraft) { + + } + + @Override + public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper) { + + } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeHandler.java b/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeHandler.java index 34981bf9..7439034b 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeHandler.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeHandler.java @@ -15,14 +15,6 @@ public class BindingRecipeHandler implements IRecipeHandler return BindingRecipeJEI.class; } - @Deprecated - @Nonnull - @Override - public String getRecipeCategoryUid() - { - return Constants.Compat.JEI_CATEGORY_BINDING; - } - @Override public String getRecipeCategoryUid(@Nonnull BindingRecipeJEI recipe) { @@ -39,6 +31,11 @@ public class BindingRecipeHandler implements IRecipeHandler @Override public boolean isRecipeValid(@Nonnull BindingRecipeJEI recipe) { - return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0; + return true; + } + + @Override + public String getRecipeCategoryUid() { + return null; } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeJEI.java b/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeJEI.java index 7081c921..b73dce1b 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeJEI.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeJEI.java @@ -1,10 +1,11 @@ package WayofTime.bloodmagic.compat.jei.binding; -import java.util.Collections; import java.util.List; import javax.annotation.Nonnull; +import com.google.common.collect.Lists; +import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.BlankRecipeWrapper; import net.minecraft.item.ItemStack; @@ -28,21 +29,9 @@ public class BindingRecipeJEI extends BlankRecipeWrapper } @Override - @Nonnull - public List getInputs() - { - return inputs; - } + public void getIngredients(IIngredients ingredients) { - public ItemStack getCatalyst() - { - return catalyst; - } - - @Override - @Nonnull - public List getOutputs() - { - return Collections.singletonList(output); + ingredients.setInputLists(ItemStack.class, Lists.newArrayList(inputs, Lists.newArrayList(catalyst))); + ingredients.setOutput(ItemStack.class, output); } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/binding/package-info.java b/src/main/java/WayofTime/bloodmagic/compat/jei/binding/package-info.java deleted file mode 100644 index b63096ff..00000000 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/binding/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault -package WayofTime.bloodmagic.compat.jei.binding; - -import mcp.MethodsReturnNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/forge/TartaricForgeRecipeCategory.java b/src/main/java/WayofTime/bloodmagic/compat/jei/forge/TartaricForgeRecipeCategory.java index 999d6e8f..2b85ba1f 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/forge/TartaricForgeRecipeCategory.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/forge/TartaricForgeRecipeCategory.java @@ -1,14 +1,15 @@ package WayofTime.bloodmagic.compat.jei.forge; -import java.util.ArrayList; import java.util.List; import javax.annotation.Nonnull; +import javax.annotation.Nullable; import mezz.jei.api.gui.ICraftingGridHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiItemStackGroup; import mezz.jei.api.gui.IRecipeLayout; +import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.IRecipeCategory; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; @@ -27,7 +28,7 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory @Nonnull private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/soulForge.png"), 0, 0, 100, 40); @Nonnull - private final String localizedName = TextHelper.localize("jei.BloodMagic.recipe.soulForge"); + private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.soulForge"); @Nonnull private final ICraftingGridHelper craftingGridHelper; @@ -63,15 +64,15 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory } + @Nullable @Override - public void drawAnimations(Minecraft minecraft) + public IDrawable getIcon() { - + return null; } @Override - @SuppressWarnings("unchecked") - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); @@ -87,12 +88,25 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory } } + List> inputs = ingredients.getInputs(ItemStack.class); + if (recipeWrapper instanceof TartaricForgeRecipeJEI) { - TartaricForgeRecipeJEI recipe = (TartaricForgeRecipeJEI) recipeWrapper; - guiItemStacks.set(GEM_SLOT, (ArrayList) recipe.getInputs().get(1)); - craftingGridHelper.setOutput(guiItemStacks, recipe.getOutputs()); - craftingGridHelper.setInput(guiItemStacks, (List) recipe.getInputs().get(0), 2, 3); + guiItemStacks.set(GEM_SLOT, ingredients.getInputs(ItemStack.class).get(ingredients.getInputs(ItemStack.class).size() - 1)); + inputs.remove(ingredients.getInputs(ItemStack.class).size() - 1); + guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0)); + guiItemStacks.set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0)); + craftingGridHelper.setInputStacks(guiItemStacks, inputs); } } + + @Override + public void drawAnimations(Minecraft minecraft) { + + } + + @Override + public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper) { + + } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/forge/TartaricForgeRecipeHandler.java b/src/main/java/WayofTime/bloodmagic/compat/jei/forge/TartaricForgeRecipeHandler.java index e5c0ac05..98fae5a0 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/forge/TartaricForgeRecipeHandler.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/forge/TartaricForgeRecipeHandler.java @@ -15,14 +15,6 @@ public class TartaricForgeRecipeHandler implements IRecipeHandler 0 && recipe.getOutputs().size() > 0; + return true; + } + + @Override + public String getRecipeCategoryUid() { + return null; } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/forge/TartaricForgeRecipeJEI.java b/src/main/java/WayofTime/bloodmagic/compat/jei/forge/TartaricForgeRecipeJEI.java index e51511bd..82133b75 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/forge/TartaricForgeRecipeJEI.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/forge/TartaricForgeRecipeJEI.java @@ -8,7 +8,10 @@ import java.util.List; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin; +import com.google.common.collect.Lists; import lombok.Getter; +import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.BlankRecipeWrapper; import net.minecraft.item.ItemStack; import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe; @@ -20,7 +23,7 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper @Getter private TartaricForgeRecipe recipe; @Getter - private ArrayList validGems = new ArrayList(); + private List validGems = new ArrayList(); public TartaricForgeRecipeJEI(TartaricForgeRecipe recipe) { @@ -32,20 +35,11 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper } @Override - @Nonnull - public List getInputs() - { - ArrayList ret = new ArrayList(); - ret.add(recipe.getInput()); - ret.add(validGems); - return ret; - } - - @Override - @Nonnull - public List getOutputs() - { - return Collections.singletonList(recipe.getRecipeOutput()); + public void getIngredients(IIngredients ingredients) { + List> expandedInputs = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput()); + expandedInputs.add(validGems); + ingredients.setInputLists(ItemStack.class, expandedInputs); + ingredients.setOutput(ItemStack.class, recipe.getRecipeOutput()); } @Nullable @@ -55,8 +49,8 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper ArrayList ret = new ArrayList(); if (mouseX >= 40 && mouseX <= 60 && mouseY >= 21 && mouseY <= 34) { - ret.add(TextHelper.localize("jei.BloodMagic.recipe.minimumSouls", recipe.getMinimumSouls())); - ret.add(TextHelper.localize("jei.BloodMagic.recipe.soulsDrained", recipe.getSoulsDrained())); + ret.add(TextHelper.localize("jei.bloodmagic.recipe.minimumSouls", recipe.getMinimumSouls())); + ret.add(TextHelper.localize("jei.bloodmagic.recipe.soulsDrained", recipe.getSoulsDrained())); return ret; } return null; diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/forge/package-info.java b/src/main/java/WayofTime/bloodmagic/compat/jei/forge/package-info.java deleted file mode 100644 index cc0c044a..00000000 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/forge/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault -package WayofTime.bloodmagic.compat.jei.forge; - -import mcp.MethodsReturnNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapedOrbRecipeHandler.java b/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapedOrbRecipeHandler.java index 4e746059..65e8d4fb 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapedOrbRecipeHandler.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapedOrbRecipeHandler.java @@ -19,14 +19,6 @@ public class ShapedOrbRecipeHandler implements IRecipeHandler 0; } + + @Override + public String getRecipeCategoryUid() { + return null; + } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapedOrbRecipeJEI.java b/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapedOrbRecipeJEI.java index 840e59ff..acb6d5fe 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapedOrbRecipeJEI.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapedOrbRecipeJEI.java @@ -2,21 +2,21 @@ package WayofTime.bloodmagic.compat.jei.orb; import java.awt.Color; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin; import WayofTime.bloodmagic.util.helper.NumeralHelper; +import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.recipe.BlankRecipeWrapper; import mezz.jei.api.recipe.wrapper.IShapedCraftingRecipeWrapper; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; import WayofTime.bloodmagic.api.registry.OrbRegistry; import WayofTime.bloodmagic.util.helper.TextHelper; -public class ShapedOrbRecipeJEI implements IShapedCraftingRecipeWrapper +public class ShapedOrbRecipeJEI extends BlankRecipeWrapper implements IShapedCraftingRecipeWrapper { @Nonnull @@ -54,52 +54,15 @@ public class ShapedOrbRecipeJEI implements IShapedCraftingRecipeWrapper } @Override - public List getInputs() - { - return inputs; + public void getIngredients(IIngredients ingredients) { + List> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(inputs); + ingredients.setInputLists(ItemStack.class, expanded); + ingredients.setOutput(ItemStack.class, output); } @Override - public List getOutputs() - { - return Collections.singletonList(output); - } - - @Override - public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) - { - String draw = TextHelper.localize("jei.BloodMagic.recipe.requiredTier", NumeralHelper.toRoman(tier)); + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { + String draw = TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(tier)); minecraft.fontRendererObj.drawString(draw, 72 - minecraft.fontRendererObj.getStringWidth(draw) / 2, 10, Color.gray.getRGB()); } - - @Override - public List getFluidInputs() - { - return null; - } - - @Override - public List getFluidOutputs() - { - return null; - } - - @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) - { - - } - - @Nullable - @Override - public List getTooltipStrings(int mouseX, int mouseY) - { - return null; - } - - @Override - public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton) - { - return false; - } -} +} \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapelessOrbRecipeHandler.java b/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapelessOrbRecipeHandler.java index 5bca16e6..380d91a3 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapelessOrbRecipeHandler.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapelessOrbRecipeHandler.java @@ -17,14 +17,6 @@ public class ShapelessOrbRecipeHandler implements IRecipeHandler 0; } + + @Override + public String getRecipeCategoryUid() { + return null; + } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapelessOrbRecipeJEI.java b/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapelessOrbRecipeJEI.java index dc16002d..dd9eccc5 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapelessOrbRecipeJEI.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/orb/ShapelessOrbRecipeJEI.java @@ -8,7 +8,10 @@ import java.util.List; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin; import WayofTime.bloodmagic.util.helper.NumeralHelper; +import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.recipe.BlankRecipeWrapper; import mezz.jei.api.recipe.wrapper.ICraftingRecipeWrapper; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; @@ -16,14 +19,12 @@ import net.minecraftforge.fluids.FluidStack; import WayofTime.bloodmagic.api.registry.OrbRegistry; import WayofTime.bloodmagic.util.helper.TextHelper; -public class ShapelessOrbRecipeJEI implements ICraftingRecipeWrapper +public class ShapelessOrbRecipeJEI extends BlankRecipeWrapper implements ICraftingRecipeWrapper { @Nonnull private final List inputs; - private final int tier; - @Nonnull private final ItemStack output; @@ -42,52 +43,16 @@ public class ShapelessOrbRecipeJEI implements ICraftingRecipeWrapper } @Override - public List getInputs() - { - return inputs; - } - - @Override - public List getOutputs() - { - return Collections.singletonList(output); + public void getIngredients(IIngredients ingredients) { + List> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(inputs); + ingredients.setInputLists(ItemStack.class, expanded); + ingredients.setOutput(ItemStack.class, output); } @Override public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { - String draw = TextHelper.localize("jei.BloodMagic.recipe.requiredTier", NumeralHelper.toRoman(tier)); + String draw = TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(tier)); minecraft.fontRendererObj.drawString(draw, 72 - minecraft.fontRendererObj.getStringWidth(draw) / 2, 10, Color.gray.getRGB()); } - - @Override - public List getFluidInputs() - { - return null; - } - - @Override - public List getFluidOutputs() - { - return null; - } - - @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) - { - - } - - @Nullable - @Override - public List getTooltipStrings(int mouseX, int mouseY) - { - return null; - } - - @Override - public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton) - { - return false; - } } diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/orb/package-info.java b/src/main/java/WayofTime/bloodmagic/compat/jei/orb/package-info.java deleted file mode 100644 index a9b8d95a..00000000 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/orb/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault -package WayofTime.bloodmagic.compat.jei.orb; - -import mcp.MethodsReturnNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/package-info.java b/src/main/java/WayofTime/bloodmagic/compat/jei/package-info.java deleted file mode 100644 index 7ce52522..00000000 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault -package WayofTime.bloodmagic.compat.jei; - -import mcp.MethodsReturnNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIAttackStealthMelee.java b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIAttackStealthMelee.java index e54d3c1e..6a5ca700 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIAttackStealthMelee.java +++ b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIAttackStealthMelee.java @@ -37,7 +37,7 @@ public class EntityAIAttackStealthMelee extends EntityAIBase public EntityAIAttackStealthMelee(EntityCorruptedChicken creature, double speedIn, boolean useLongMemory) { this.chicken = creature; - this.worldObj = creature.worldObj; + this.worldObj = creature.getEntityWorld(); this.speedTowardsTarget = speedIn; this.longMemory = useLongMemory; this.setMutexBits(3); diff --git a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIEatAndCorruptBlock.java b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIEatAndCorruptBlock.java index 6c95a68a..288fc685 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIEatAndCorruptBlock.java +++ b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIEatAndCorruptBlock.java @@ -20,7 +20,7 @@ public class EntityAIEatAndCorruptBlock extends EntityAIBase public EntityAIEatAndCorruptBlock(EntityAspectedDemonBase entity) { this.grassEaterEntity = entity; - this.world = entity.worldObj; + this.world = entity.getEntityWorld(); this.setMutexBits(7); } diff --git a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIFollowOwner.java b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIFollowOwner.java index 7227f8cf..27b450b1 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIFollowOwner.java +++ b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIFollowOwner.java @@ -29,7 +29,7 @@ public class EntityAIFollowOwner extends EntityAIBase public EntityAIFollowOwner(EntityDemonBase thePetIn, double followSpeedIn, float minDistIn, float maxDistIn) { this.thePet = thePetIn; - this.theWorld = thePetIn.worldObj; + this.theWorld = thePetIn.getEntityWorld(); this.followSpeed = followSpeedIn; this.petPathfinder = thePetIn.getNavigator(); this.minDist = minDistIn; @@ -122,9 +122,9 @@ public class EntityAIFollowOwner extends EntityAIBase { if (this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D) { - int i = MathHelper.floor_double(this.theOwner.posX) - 2; - int j = MathHelper.floor_double(this.theOwner.posZ) - 2; - int k = MathHelper.floor_double(this.theOwner.getEntityBoundingBox().minY); + int i = MathHelper.floor(this.theOwner.posX) - 2; + int j = MathHelper.floor(this.theOwner.posZ) - 2; + int k = MathHelper.floor(this.theOwner.getEntityBoundingBox().minY); for (int l = 0; l <= 4; ++l) { diff --git a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIGrabEffectsFromOwner.java b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIGrabEffectsFromOwner.java index 04e5fc62..28a81764 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIGrabEffectsFromOwner.java +++ b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIGrabEffectsFromOwner.java @@ -32,7 +32,7 @@ public class EntityAIGrabEffectsFromOwner extends EntityAIBase public EntityAIGrabEffectsFromOwner(EntitySentientSpecter thePetIn, double followSpeedIn, float minDistIn) { this.thePet = thePetIn; - this.theWorld = thePetIn.worldObj; + this.theWorld = thePetIn.getEntityWorld(); this.followSpeed = followSpeedIn; this.petPathfinder = thePetIn.getNavigator(); this.minDist = minDistIn; @@ -135,9 +135,9 @@ public class EntityAIGrabEffectsFromOwner extends EntityAIBase { if (this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D) { - int i = MathHelper.floor_double(this.theOwner.posX) - 2; - int j = MathHelper.floor_double(this.theOwner.posZ) - 2; - int k = MathHelper.floor_double(this.theOwner.getEntityBoundingBox().minY); + int i = MathHelper.floor(this.theOwner.posX) - 2; + int j = MathHelper.floor(this.theOwner.posZ) - 2; + int k = MathHelper.floor(this.theOwner.getEntityBoundingBox().minY); for (int l = 0; l <= 4; ++l) { diff --git a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIPickUpAlly.java b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIPickUpAlly.java index c1ac0d59..62477326 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIPickUpAlly.java +++ b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIPickUpAlly.java @@ -40,7 +40,7 @@ public class EntityAIPickUpAlly extends EntityAIBase public EntityAIPickUpAlly(EntityAspectedDemonBase creature, double speedIn, boolean useLongMemory) { this.entity = creature; - this.worldObj = creature.worldObj; + this.worldObj = creature.getEntityWorld(); this.speedTowardsTarget = speedIn; this.longMemory = useLongMemory; this.setMutexBits(3); @@ -57,7 +57,7 @@ public class EntityAIPickUpAlly extends EntityAIBase } AxisAlignedBB bb = new AxisAlignedBB(entity.posX - 0.5, entity.posY - 0.5, entity.posZ - 0.5, entity.posX + 0.5, entity.posY + 0.5, entity.posZ + 0.5).expandXyz(5); - List list = this.entity.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, bb, new EntityAspectedDemonBase.WillTypePredicate(entity.getType())); + List list = this.entity.getEntityWorld().getEntitiesWithinAABB(EntityLivingBase.class, bb, new EntityAspectedDemonBase.WillTypePredicate(entity.getType())); for (EntityLivingBase testEntity : list) { if (testEntity != this.entity) diff --git a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIProtectAlly.java b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIProtectAlly.java index ad46d8ca..23b345ca 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIProtectAlly.java +++ b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIProtectAlly.java @@ -21,7 +21,7 @@ public class EntityAIProtectAlly extends EntityAIBase public EntityAIProtectAlly(EntityCorruptedSheep entity) { this.entity = entity; - this.world = entity.worldObj; + this.world = entity.getEntityWorld(); this.setMutexBits(7); } diff --git a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIRetreatToHeal.java b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIRetreatToHeal.java index c4b08304..57561229 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIRetreatToHeal.java +++ b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIRetreatToHeal.java @@ -69,7 +69,7 @@ public class EntityAIRetreatToHeal extends EntityAIBase } //This part almost doesn't matter - List list = this.theEntity.worldObj.getEntitiesWithinAABB(this.classToAvoid, this.theEntity.getEntityBoundingBox().expand((double) this.avoidDistance, 3.0D, (double) this.avoidDistance), Predicates.and(new Predicate[] { EntitySelectors.CAN_AI_TARGET, this.canBeSeenSelector, this.avoidTargetSelector })); + List list = this.theEntity.getEntityWorld().getEntitiesWithinAABB(this.classToAvoid, this.theEntity.getEntityBoundingBox().expand((double) this.avoidDistance, 3.0D, (double) this.avoidDistance), Predicates.and(new Predicate[] { EntitySelectors.CAN_AI_TARGET, this.canBeSeenSelector, this.avoidTargetSelector })); if (list.isEmpty()) { diff --git a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIStealthRetreat.java b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIStealthRetreat.java index 68d84d7b..533af52b 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIStealthRetreat.java +++ b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIStealthRetreat.java @@ -82,7 +82,7 @@ public class EntityAIStealthRetreat extends EntityAIBase @Override public void startExecuting() { - ticksLeft = this.entity.worldObj.rand.nextInt(100) + 100; + ticksLeft = this.entity.getEntityWorld().rand.nextInt(100) + 100; this.entityPathNavigate.setPath(this.entityPathEntity, this.farSpeed); } diff --git a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIStealthTowardsTarget.java b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIStealthTowardsTarget.java index fa9a52fe..6e4a6a78 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIStealthTowardsTarget.java +++ b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIStealthTowardsTarget.java @@ -47,7 +47,7 @@ public class EntityAIStealthTowardsTarget extends EntityAIBase return false; } else { - ticksLeft = this.entity.worldObj.rand.nextInt(200) + 100; + ticksLeft = this.entity.getEntityWorld().rand.nextInt(200) + 100; this.xPosition = vec3d.xCoord; this.yPosition = vec3d.yCoord; this.zPosition = vec3d.zCoord; diff --git a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityAspectedDemonBase.java b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityAspectedDemonBase.java index a3ba864b..caeedfd3 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityAspectedDemonBase.java +++ b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityAspectedDemonBase.java @@ -180,15 +180,15 @@ public abstract class EntityAspectedDemonBase extends EntityDemonBase float newAmount = amount; if (source.isProjectile()) { - newAmount *= MathHelper.clamp_double(1 - getProjectileResist(), 0, 1); + newAmount *= MathHelper.clamp(1 - getProjectileResist(), 0, 1); } else { - newAmount *= MathHelper.clamp_double(1 - getMeleeResist(), 0, 1); + newAmount *= MathHelper.clamp(1 - getMeleeResist(), 0, 1); } if (source.isMagicDamage()) { - newAmount *= MathHelper.clamp_double(1 - getMagicResist(), 0, 1); + newAmount *= MathHelper.clamp(1 - getMagicResist(), 0, 1); } return super.attackEntityFrom(source, newAmount); diff --git a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedChicken.java b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedChicken.java index 474343cf..77058576 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedChicken.java +++ b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedChicken.java @@ -139,7 +139,7 @@ public class EntityCorruptedChicken extends EntityAspectedDemonBase this.oFlap = this.wingRotation; this.oFlapSpeed = this.destPos; this.destPos = (float) ((double) this.destPos + (double) (this.onGround ? -1 : 4) * 0.3D); - this.destPos = MathHelper.clamp_float(this.destPos, 0.0F, 1.0F); + this.destPos = MathHelper.clamp(this.destPos, 0.0F, 1.0F); if (!this.onGround && this.wingRotDelta < 1.0F) { @@ -155,7 +155,7 @@ public class EntityCorruptedChicken extends EntityAspectedDemonBase this.wingRotation += this.wingRotDelta * 2.0F; - if (!this.worldObj.isRemote && !this.isChild() && --this.timeUntilNextEgg <= 0) + if (!this.getEntityWorld().isRemote && !this.isChild() && --this.timeUntilNextEgg <= 0) { this.playSound(SoundEvents.ENTITY_CHICKEN_EGG, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); this.dropItem(Items.EGG, 1); diff --git a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedSheep.java b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedSheep.java index 516ff8d2..4a71af52 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedSheep.java +++ b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedSheep.java @@ -66,7 +66,7 @@ public class EntityCorruptedSheep extends EntityAspectedDemonBase implements ISh public static float[] getDyeRgb(EnumDyeColor dyeColor) { - return (float[]) DYE_TO_RGB.get(dyeColor); + return DYE_TO_RGB.get(dyeColor); } public EntityCorruptedSheep(World world) @@ -121,7 +121,7 @@ public class EntityCorruptedSheep extends EntityAspectedDemonBase implements ISh @Override public void onLivingUpdate() { - if (this.worldObj.isRemote) + if (this.getEntityWorld().isRemote) { this.sheepTimer = Math.max(0, this.sheepTimer - 1); this.castTimer = Math.max(0, castTimer - 1); @@ -359,7 +359,7 @@ public class EntityCorruptedSheep extends EntityAspectedDemonBase implements ISh public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingdata) { livingdata = super.onInitialSpawn(difficulty, livingdata); - this.setFleeceColor(getRandomSheepColor(this.worldObj.rand)); + this.setFleeceColor(getRandomSheepColor(this.getEntityWorld().rand)); return livingdata; } diff --git a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedSpider.java b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedSpider.java index ee512510..eba027a6 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedSpider.java +++ b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedSpider.java @@ -52,7 +52,7 @@ public class EntityCorruptedSpider extends EntityAspectedDemonBase this.tasks.addTask(5, new EntityAIWander(this, 0.8D)); this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(6, new EntityAILookIdle(this)); - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLivingBase.class, 10, true, false, new EntityAspectedDemonBase.TeamAttackPredicate(this))); @@ -95,7 +95,7 @@ public class EntityCorruptedSpider extends EntityAspectedDemonBase } @Override - protected PathNavigate getNewNavigator(World worldIn) + protected PathNavigate createNavigator(World worldIn) { return new PathNavigateClimber(this, worldIn); } @@ -112,7 +112,7 @@ public class EntityCorruptedSpider extends EntityAspectedDemonBase { super.onUpdate(); - if (!this.worldObj.isRemote) + if (!this.getEntityWorld().isRemote) { this.setBesideClimbableBlock(this.isCollidedHorizontally); } diff --git a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedZombie.java b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedZombie.java index 34b0825e..ec0cd6cc 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedZombie.java +++ b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedZombie.java @@ -73,7 +73,7 @@ public class EntityCorruptedZombie extends EntityAspectedDemonBase @Override public void setCombatTask() { - if (this.worldObj != null && !this.worldObj.isRemote) + if (this.getEntityWorld() != null && !this.getEntityWorld().isRemote) { this.tasks.removeTask(this.aiAttackOnCollide); this.tasks.removeTask(this.aiArrowAttack); @@ -83,7 +83,7 @@ public class EntityCorruptedZombie extends EntityAspectedDemonBase { int i = 20; - if (this.worldObj.getDifficulty() != EnumDifficulty.HARD) + if (this.getEntityWorld().getDifficulty() != EnumDifficulty.HARD) { i = 40; } @@ -128,7 +128,7 @@ public class EntityCorruptedZombie extends EntityAspectedDemonBase */ public double absorbWillFromAuraToHeal(double toHeal) { - if (worldObj.isRemote) + if (getEntityWorld().isRemote) { return 0; } @@ -139,13 +139,13 @@ public class EntityCorruptedZombie extends EntityAspectedDemonBase return 0; } - double will = WorldDemonWillHandler.getCurrentWill(worldObj, getPosition(), getType()); + double will = WorldDemonWillHandler.getCurrentWill(getEntityWorld(), getPosition(), getType()); toHeal = Math.min(healthMissing, Math.min(toHeal, will / getWillToHealth())); if (toHeal > 0) { this.heal((float) toHeal); - return WorldDemonWillHandler.drainWill(worldObj, getPosition(), getType(), toHeal * getWillToHealth(), true); + return WorldDemonWillHandler.drainWill(getEntityWorld(), getPosition(), getType(), toHeal * getWillToHealth(), true); } return 0; @@ -164,7 +164,7 @@ public class EntityCorruptedZombie extends EntityAspectedDemonBase public void onUpdate() { - if (!this.worldObj.isRemote && this.ticksExisted % 20 == 0) + if (!this.getEntityWorld().isRemote && this.ticksExisted % 20 == 0) { absorbWillFromAuraToHeal(2); } diff --git a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityDemonBase.java b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityDemonBase.java index 70d99fa1..653f2b89 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityDemonBase.java +++ b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityDemonBase.java @@ -51,7 +51,7 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable protected void entityInit() { super.entityInit(); - this.dataManager.register(TAMED, Byte.valueOf((byte) 0)); + this.dataManager.register(TAMED, (byte) 0); this.dataManager.register(OWNER_UNIQUE_ID, Optional.absent()); } @@ -84,7 +84,7 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable @Override public boolean attackEntityFrom(DamageSource source, float amount) { - return this.isEntityInvulnerable(source) ? false : super.attackEntityFrom(source, amount); + return !this.isEntityInvulnerable(source) && super.attackEntityFrom(source, amount); } /** @@ -133,7 +133,7 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable if (this.rand.nextFloat() < f1) { entityplayer.getCooldownTracker().setCooldown(Items.SHIELD, 100); - this.worldObj.setEntityState(entityplayer, (byte) 30); + this.getEntityWorld().setEntityState(entityplayer, (byte) 30); } } } @@ -149,7 +149,7 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable { super.setItemStackToSlot(slotIn, stack); - if (!this.worldObj.isRemote && slotIn == EntityEquipmentSlot.MAINHAND) + if (!this.getEntityWorld().isRemote && slotIn == EntityEquipmentSlot.MAINHAND) { this.setCombatTask(); } @@ -169,9 +169,9 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable { this.heal((float) toHeal); - if (worldObj instanceof WorldServer) + if (getEntityWorld() instanceof WorldServer) { - WorldServer server = (WorldServer) worldObj; + WorldServer server = (WorldServer) getEntityWorld(); server.spawnParticle(EnumParticleTypes.HEART, this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, this.posY + 0.5D + (double) (this.rand.nextFloat() * this.height), this.posZ + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, 7, 0.2, 0.2, 0.2, 0, new int[0]); } } @@ -248,7 +248,7 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable } } - return attacker instanceof EntityPlayer && owner instanceof EntityPlayer && !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) attacker) ? false : !(attacker instanceof EntityHorse) || !((EntityHorse) attacker).isTame(); + return !(attacker instanceof EntityPlayer && owner instanceof EntityPlayer && !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) attacker)) && (!(attacker instanceof EntityHorse) || !((EntityHorse) attacker).isTame()); } else { return false; @@ -262,19 +262,19 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable public boolean isTamed() { - return (((Byte) this.dataManager.get(TAMED)).byteValue() & 4) != 0; + return (this.dataManager.get(TAMED) & 4) != 0; } public void setTamed(boolean tamed) { - byte b0 = ((Byte) this.dataManager.get(TAMED)).byteValue(); + byte b0 = this.dataManager.get(TAMED); if (tamed) { - this.dataManager.set(TAMED, Byte.valueOf((byte) (b0 | 4))); + this.dataManager.set(TAMED, (byte) (b0 | 4)); } else { - this.dataManager.set(TAMED, Byte.valueOf((byte) (b0 & -5))); + this.dataManager.set(TAMED, (byte) (b0 & -5)); } // this.setupTamedAI(); @@ -316,7 +316,7 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable @Override public UUID getOwnerId() { - return (UUID) (this.dataManager.get(OWNER_UNIQUE_ID)).orNull(); + return this.dataManager.get(OWNER_UNIQUE_ID).orNull(); } public void setOwnerId(UUID uuid) @@ -330,7 +330,7 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable try { UUID uuid = this.getOwnerId(); - return uuid == null ? null : this.worldObj.getPlayerEntityByUUID(uuid); + return uuid == null ? null : this.getEntityWorld().getPlayerEntityByUUID(uuid); } catch (IllegalArgumentException var2) { return null; diff --git a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityMimic.java b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityMimic.java index 37c32741..cfe63b1a 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityMimic.java +++ b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityMimic.java @@ -43,7 +43,7 @@ public class EntityMimic extends EntityDemonBase /** * Copy of EntitySpider's AI (should be pretty evident...) */ - private static final DataParameter CLIMBING = EntityDataManager.createKey(EntityMimic.class, DataSerializers.BYTE); + private static final DataParameter CLIMBING = EntityDataManager.createKey(EntityMimic.class, DataSerializers.BYTE); public boolean dropItemsOnBreak = true; public NBTTagCompound tileTag = new NBTTagCompound(); @@ -64,7 +64,7 @@ public class EntityMimic extends EntityDemonBase this.tasks.addTask(8, new EntityAILookIdle(this)); this.tasks.addTask(7, new EntityAIMimicReform(this)); - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); this.targetTasks.addTask(2, new EntityMimic.AISpiderTarget(this, EntityPlayer.class)); this.targetTasks.addTask(3, new EntityMimic.AISpiderTarget(this, EntityIronGolem.class)); } @@ -160,7 +160,7 @@ public class EntityMimic extends EntityDemonBase } BlockPos newPos = centerPos.add(i, j, k); - if (spawnMimicBlockAtPosition(worldObj, newPos)) + if (spawnMimicBlockAtPosition(getEntityWorld(), newPos)) { return true; } @@ -178,7 +178,7 @@ public class EntityMimic extends EntityDemonBase { super.onDeath(cause); - if (!worldObj.isRemote) + if (!getEntityWorld().isRemote) { BlockPos centerPos = this.getPosition(); @@ -201,7 +201,7 @@ public class EntityMimic extends EntityDemonBase } BlockPos newPos = centerPos.add(i, j, k); - if (spawnHeldBlockOnDeath(worldObj, newPos)) + if (spawnHeldBlockOnDeath(getEntityWorld(), newPos)) { return; } @@ -227,7 +227,7 @@ public class EntityMimic extends EntityDemonBase * Returns new PathNavigateGround instance */ @Override - protected PathNavigate getNewNavigator(World worldIn) + protected PathNavigate createNavigator(World worldIn) { return new PathNavigateClimber(this, worldIn); } @@ -236,7 +236,7 @@ public class EntityMimic extends EntityDemonBase protected void entityInit() { super.entityInit(); - this.dataManager.register(CLIMBING, Byte.valueOf((byte) 0)); + this.dataManager.register(CLIMBING, (byte) 0); // this.dataManager.register(ITEMSTACK, null); } @@ -246,7 +246,7 @@ public class EntityMimic extends EntityDemonBase @Override public void onUpdate() { - if (!this.worldObj.isRemote && this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL) + if (!this.getEntityWorld().isRemote && this.getEntityWorld().getDifficulty() == EnumDifficulty.PEACEFUL) { if (reformIntoMimicBlock(this.getPosition())) { @@ -256,7 +256,7 @@ public class EntityMimic extends EntityDemonBase super.onUpdate(); - if (!this.worldObj.isRemote) + if (!this.getEntityWorld().isRemote) { this.setBesideClimbableBlock(this.isCollidedHorizontally); } @@ -324,7 +324,7 @@ public class EntityMimic extends EntityDemonBase @Override public boolean isPotionApplicable(PotionEffect potioneffectIn) { - return potioneffectIn.getPotion() == MobEffects.POISON ? false : super.isPotionApplicable(potioneffectIn); + return potioneffectIn.getPotion() != MobEffects.POISON && super.isPotionApplicable(potioneffectIn); } /** @@ -333,7 +333,7 @@ public class EntityMimic extends EntityDemonBase */ public boolean isBesideClimbableBlock() { - return (((Byte) this.dataManager.get(CLIMBING)).byteValue() & 1) != 0; + return (this.dataManager.get(CLIMBING) & 1) != 0; } /** @@ -342,7 +342,7 @@ public class EntityMimic extends EntityDemonBase */ public void setBesideClimbableBlock(boolean climbing) { - byte b0 = ((Byte) this.dataManager.get(CLIMBING)).byteValue(); + byte b0 = this.dataManager.get(CLIMBING); if (climbing) { @@ -352,7 +352,7 @@ public class EntityMimic extends EntityDemonBase b0 = (byte) (b0 & -2); } - this.dataManager.set(CLIMBING, Byte.valueOf(b0)); + this.dataManager.set(CLIMBING, b0); } public float getEyeHeight() diff --git a/src/main/java/WayofTime/bloodmagic/entity/mob/EntitySentientSpecter.java b/src/main/java/WayofTime/bloodmagic/entity/mob/EntitySentientSpecter.java index 6e6c15a9..880b3f4b 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/mob/EntitySentientSpecter.java +++ b/src/main/java/WayofTime/bloodmagic/entity/mob/EntitySentientSpecter.java @@ -107,7 +107,7 @@ public class EntitySentientSpecter extends EntityDemonBase @Override public void setCombatTask() { - if (this.worldObj != null && !this.worldObj.isRemote) + if (this.getEntityWorld() != null && !this.getEntityWorld().isRemote) { this.tasks.removeTask(this.aiAttackOnCollide); this.tasks.removeTask(this.aiArrowAttack); @@ -117,7 +117,7 @@ public class EntitySentientSpecter extends EntityDemonBase { int i = 20; - if (this.worldObj.getDifficulty() != EnumDifficulty.HARD) + if (this.getEntityWorld().getDifficulty() != EnumDifficulty.HARD) { i = 40; } @@ -311,7 +311,7 @@ public class EntitySentientSpecter extends EntityDemonBase { super.onDeath(cause); - if (!worldObj.isRemote && getHeldItemMainhand() != null) + if (!getEntityWorld().isRemote && getHeldItemMainhand() != null) { this.entityDropItem(getHeldItemMainhand(), 0); } @@ -345,7 +345,7 @@ public class EntitySentientSpecter extends EntityDemonBase { if (stack == null && player.isSneaking()) //Should return to the entity { - if (!worldObj.isRemote) + if (!getEntityWorld().isRemote) { if (getHeldItemMainhand() != null) { @@ -380,9 +380,9 @@ public class EntitySentientSpecter extends EntityDemonBase { this.heal((float) toHeal); - if (worldObj instanceof WorldServer) + if (getEntityWorld() instanceof WorldServer) { - WorldServer server = (WorldServer) worldObj; + WorldServer server = (WorldServer) getEntityWorld(); server.spawnParticle(EnumParticleTypes.HEART, this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, this.posY + 0.5D + (double) (this.rand.nextFloat() * this.height), this.posZ + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, 7, 0.2, 0.2, 0.2, 0, new int[0]); } } @@ -394,7 +394,7 @@ public class EntitySentientSpecter extends EntityDemonBase */ public double absorbWillFromAuraToHeal(double toHeal) { - if (worldObj.isRemote) + if (getEntityWorld().isRemote) { return 0; } @@ -405,13 +405,13 @@ public class EntitySentientSpecter extends EntityDemonBase return 0; } - double will = WorldDemonWillHandler.getCurrentWill(worldObj, getPosition(), getType()); + double will = WorldDemonWillHandler.getCurrentWill(getEntityWorld(), getPosition(), getType()); toHeal = Math.min(healthMissing, Math.min(toHeal, will / getWillToHealth())); if (toHeal > 0) { this.heal((float) toHeal); - return WorldDemonWillHandler.drainWill(worldObj, getPosition(), getType(), toHeal * getWillToHealth(), true); + return WorldDemonWillHandler.drainWill(getEntityWorld(), getPosition(), getType(), toHeal * getWillToHealth(), true); } return 0; @@ -430,7 +430,7 @@ public class EntitySentientSpecter extends EntityDemonBase public void onUpdate() { - if (!this.worldObj.isRemote && this.ticksExisted % 20 == 0) + if (!this.getEntityWorld().isRemote && this.ticksExisted % 20 == 0) { absorbWillFromAuraToHeal(2); } @@ -485,7 +485,7 @@ public class EntitySentientSpecter extends EntityDemonBase ItemStack heldStack = this.getItemStackFromSlot(EntityEquipmentSlot.MAINHAND); if (heldStack != null && heldStack.getItem() == ModItems.SENTIENT_BOW) { - EntityTippedArrow arrowEntity = ((ItemSentientBow) heldStack.getItem()).getArrowEntity(worldObj, heldStack, target, this, velocity); + EntityTippedArrow arrowEntity = ((ItemSentientBow) heldStack.getItem()).getArrowEntity(getEntityWorld(), heldStack, target, this, velocity); if (arrowEntity != null) { List effects = getPotionEffectsForArrowRemovingDuration(0.2f); @@ -495,19 +495,19 @@ public class EntitySentientSpecter extends EntityDemonBase } this.playSound(SoundEvents.ENTITY_SKELETON_SHOOT, 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); - this.worldObj.spawnEntityInWorld(arrowEntity); + this.getEntityWorld().spawnEntity(arrowEntity); } } else { - EntityTippedArrow entitytippedarrow = new EntityTippedArrow(this.worldObj, this); //TODO: Change to an arrow created by the Sentient Bow + EntityTippedArrow entitytippedarrow = new EntityTippedArrow(this.getEntityWorld(), this); //TODO: Change to an arrow created by the Sentient Bow double d0 = target.posX - this.posX; double d1 = target.getEntityBoundingBox().minY + (double) (target.height / 3.0F) - entitytippedarrow.posY; double d2 = target.posZ - this.posZ; - double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2); + double d3 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2); entitytippedarrow.setThrowableHeading(d0, d1 + d3 * 0.2, d2, 1.6F, 0); //TODO: Yes, it is an accurate arrow. Don't be hatin' int i = EnchantmentHelper.getMaxEnchantmentLevel(Enchantments.POWER, this); int j = EnchantmentHelper.getMaxEnchantmentLevel(Enchantments.PUNCH, this); - entitytippedarrow.setDamage((double) (velocity * 2.0F) + this.rand.nextGaussian() * 0.25D + (double) ((float) this.worldObj.getDifficulty().getDifficultyId() * 0.11F)); + entitytippedarrow.setDamage((double) (velocity * 2.0F) + this.rand.nextGaussian() * 0.25D + (double) ((float) this.getEntityWorld().getDifficulty().getDifficultyId() * 0.11F)); if (i > 0) { @@ -533,7 +533,7 @@ public class EntitySentientSpecter extends EntityDemonBase } this.playSound(SoundEvents.ENTITY_SKELETON_SHOOT, 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); - this.worldObj.spawnEntityInWorld(entitytippedarrow); + this.getEntityWorld().spawnEntity(entitytippedarrow); } } diff --git a/src/main/java/WayofTime/bloodmagic/entity/projectile/EntityBloodLight.java b/src/main/java/WayofTime/bloodmagic/entity/projectile/EntityBloodLight.java index d2bb8bd4..6d8f86ef 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/projectile/EntityBloodLight.java +++ b/src/main/java/WayofTime/bloodmagic/entity/projectile/EntityBloodLight.java @@ -61,7 +61,7 @@ public class EntityBloodLight extends EntityThrowable implements IThrowableEntit @Override public void setThrowableHeading(double var1, double var3, double var5, float var7, float var8) { - float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5); + float var9 = MathHelper.sqrt(var1 * var1 + var3 * var3 + var5 * var5); var1 /= var9; var3 /= var9; var5 /= var9; @@ -74,7 +74,7 @@ public class EntityBloodLight extends EntityThrowable implements IThrowableEntit motionX = var1; motionY = var3; motionZ = var5; - float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); + float var10 = MathHelper.sqrt(var1 * var1 + var5 * var5); prevRotationYaw = rotationYaw = (float) (Math.atan2(var1, var5) * 180.0D / Math.PI); prevRotationPitch = rotationPitch = (float) (Math.atan2(var3, var10) * 180.0D / Math.PI); } @@ -105,9 +105,9 @@ public class EntityBloodLight extends EntityThrowable implements IThrowableEntit EnumFacing sideHit = mop.sideHit; BlockPos blockPos = mop.getBlockPos().offset(sideHit); - if (worldObj.isAirBlock(blockPos)) + if (getEntityWorld().isAirBlock(blockPos)) { - worldObj.setBlockState(blockPos, ModBlocks.BLOOD_LIGHT.getDefaultState()); + getEntityWorld().setBlockState(blockPos, ModBlocks.BLOOD_LIGHT.getDefaultState()); } } @@ -129,9 +129,9 @@ public class EntityBloodLight extends EntityThrowable implements IThrowableEntit } } - if (worldObj.isAirBlock(new BlockPos((int) this.posX, (int) this.posY, (int) this.posZ))) + if (getEntityWorld().isAirBlock(new BlockPos((int) this.posX, (int) this.posY, (int) this.posZ))) { - worldObj.setBlockState(new BlockPos((int) this.posX, (int) this.posY, (int) this.posZ), Blocks.FIRE.getDefaultState()); + getEntityWorld().setBlockState(new BlockPos((int) this.posX, (int) this.posY, (int) this.posZ), Blocks.FIRE.getDefaultState()); } // spawnHitParticles("magicCrit", 8); diff --git a/src/main/java/WayofTime/bloodmagic/entity/projectile/EntityMeteor.java b/src/main/java/WayofTime/bloodmagic/entity/projectile/EntityMeteor.java index 6735b95b..70e158b2 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/projectile/EntityMeteor.java +++ b/src/main/java/WayofTime/bloodmagic/entity/projectile/EntityMeteor.java @@ -95,7 +95,7 @@ public class EntityMeteor extends EntityThrowable implements IThrowableEntity public void generateMeteor(BlockPos pos) { - MeteorRegistry.generateMeteorForItem(meteorStack, worldObj, pos, Blocks.STONE.getDefaultState(), radiusModifier, explosionModifier, fillerChance); + MeteorRegistry.generateMeteorForItem(meteorStack, getEntityWorld(), pos, Blocks.STONE.getDefaultState(), radiusModifier, explosionModifier, fillerChance); } public DamageSource getDamageSource() diff --git a/src/main/java/WayofTime/bloodmagic/entity/projectile/EntitySentientArrow.java b/src/main/java/WayofTime/bloodmagic/entity/projectile/EntitySentientArrow.java index c9dc343e..c6cf622f 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/projectile/EntitySentientArrow.java +++ b/src/main/java/WayofTime/bloodmagic/entity/projectile/EntitySentientArrow.java @@ -41,7 +41,7 @@ public class EntitySentientArrow extends EntityTippedArrow { if (this.shootingEntity instanceof EntityPlayer) { - if (hitEntity.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && !(hitEntity instanceof IMob)) + if (hitEntity.getEntityWorld().getDifficulty() != EnumDifficulty.PEACEFUL && !(hitEntity instanceof IMob)) { return; } diff --git a/src/main/java/WayofTime/bloodmagic/entity/projectile/EntitySoulSnare.java b/src/main/java/WayofTime/bloodmagic/entity/projectile/EntitySoulSnare.java index aa26da03..ee30ed6d 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/projectile/EntitySoulSnare.java +++ b/src/main/java/WayofTime/bloodmagic/entity/projectile/EntitySoulSnare.java @@ -39,7 +39,7 @@ public class EntitySoulSnare extends EntityThrowable if (result.entityHit != null && result.entityHit != this.getThrower()) { - if (result.entityHit instanceof EntityLivingBase && result.entityHit.worldObj.rand.nextDouble() < 0.25) + if (result.entityHit instanceof EntityLivingBase && result.entityHit.getEntityWorld().rand.nextDouble() < 0.25) { ((EntityLivingBase) result.entityHit).addPotionEffect(new PotionEffect(ModPotions.soulSnare, 300, 0)); } @@ -49,10 +49,10 @@ public class EntitySoulSnare extends EntityThrowable for (int j = 0; j < 8; ++j) { - this.worldObj.spawnParticle(EnumParticleTypes.SNOWBALL, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]); + this.getEntityWorld().spawnParticle(EnumParticleTypes.SNOWBALL, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); } - if (!this.worldObj.isRemote) + if (!this.getEntityWorld().isRemote) { this.setDead(); } diff --git a/src/main/java/WayofTime/bloodmagic/fakePlayer/FakeNetHandlerPlayServer.java b/src/main/java/WayofTime/bloodmagic/fakePlayer/FakeNetHandlerPlayServer.java index 7486c89b..dc64f53b 100644 --- a/src/main/java/WayofTime/bloodmagic/fakePlayer/FakeNetHandlerPlayServer.java +++ b/src/main/java/WayofTime/bloodmagic/fakePlayer/FakeNetHandlerPlayServer.java @@ -47,7 +47,7 @@ public class FakeNetHandlerPlayServer extends NetHandlerPlayServer } @Override - public void kickPlayerFromServer(String p_147360_1_) + public void disconnect(String reason) { } @@ -72,7 +72,7 @@ public class FakeNetHandlerPlayServer extends NetHandlerPlayServer } @Override - public void processPlayerBlockPlacement(CPacketPlayerTryUseItem packetIn) + public void processTryUseItem(CPacketPlayerTryUseItem packetIn) { } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemAltarMaker.java b/src/main/java/WayofTime/bloodmagic/item/ItemAltarMaker.java index 74ad1c20..35240151 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemAltarMaker.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemAltarMaker.java @@ -132,7 +132,7 @@ public class ItemAltarMaker extends Item implements IAltarManipulator, IVariantP public String destroyAltar(EntityPlayer player) { - World world = player.worldObj; + World world = player.getEntityWorld(); if (world.isRemote) return ""; diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemBoundAxe.java b/src/main/java/WayofTime/bloodmagic/item/ItemBoundAxe.java index 0521def7..83bdb390 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemBoundAxe.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemBoundAxe.java @@ -67,7 +67,7 @@ public class ItemBoundAxe extends ItemBoundTool implements IMeshProvider boolean silkTouch = EnchantmentHelper.getEnchantmentLevel(Enchantments.SILK_TOUCH, stack) > 0; int fortuneLvl = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, stack); - int range = (int) (charge / 6); //Charge is a max of 30 - want 5 to be the max + int range = (charge / 6); //Charge is a max of 30 - want 5 to be the max HashMultiset drops = HashMultiset.create(); @@ -127,8 +127,8 @@ public class ItemBoundAxe extends ItemBoundTool implements IMeshProvider Multimap multimap = super.getItemAttributeModifiers(equipmentSlot); if (equipmentSlot == EntityEquipmentSlot.MAINHAND) { - multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getActivated(stack) ? 11 : 2, 0)); - multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", -3.0, 0)); + multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getActivated(stack) ? 11 : 2, 0)); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", -3.0, 0)); } return multimap; } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemBoundPickaxe.java b/src/main/java/WayofTime/bloodmagic/item/ItemBoundPickaxe.java index 429e905b..138f0605 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemBoundPickaxe.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemBoundPickaxe.java @@ -143,8 +143,8 @@ public class ItemBoundPickaxe extends ItemBoundTool implements IMeshProvider Multimap multimap = super.getItemAttributeModifiers(equipmentSlot); if (equipmentSlot == EntityEquipmentSlot.MAINHAND) { - multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getActivated(stack) ? 5 : 2, 0)); - multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", -2.5, 0)); + multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getActivated(stack) ? 5 : 2, 0)); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", -2.5, 0)); } return multimap; } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemBoundShovel.java b/src/main/java/WayofTime/bloodmagic/item/ItemBoundShovel.java index f95b163b..5eec0a4c 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemBoundShovel.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemBoundShovel.java @@ -127,8 +127,8 @@ public class ItemBoundShovel extends ItemBoundTool implements IMeshProvider Multimap multimap = super.getItemAttributeModifiers(equipmentSlot); if (equipmentSlot == EntityEquipmentSlot.MAINHAND) { - multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", 5, 0)); - multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", -2.5, 0)); + multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", 5, 0)); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", -2.5, 0)); } return multimap; } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemBoundSword.java b/src/main/java/WayofTime/bloodmagic/item/ItemBoundSword.java index db1f9223..7e264f3f 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemBoundSword.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemBoundSword.java @@ -115,8 +115,8 @@ public class ItemBoundSword extends ItemSword implements IBindable, IActivatable Multimap multimap = HashMultimap.create(); if (equipmentSlot == EntityEquipmentSlot.MAINHAND) { - multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getActivated(stack) ? 8 : 2, 0)); - multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -2.4, 0)); + multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getActivated(stack) ? 8 : 2, 0)); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -2.4, 0)); } return multimap; } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemBoundTool.java b/src/main/java/WayofTime/bloodmagic/item/ItemBoundTool.java index 480543a8..17a03491 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemBoundTool.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemBoundTool.java @@ -244,12 +244,12 @@ public class ItemBoundTool extends ItemTool implements IBindable, IActivatable while (count >= maxStackSize) { - world.spawnEntityInWorld(new EntityItem(world, posToDrop.getX(), posToDrop.getY(), posToDrop.getZ(), stack.toStack(maxStackSize))); + world.spawnEntity(new EntityItem(world, posToDrop.getX(), posToDrop.getY(), posToDrop.getZ(), stack.toStack(maxStackSize))); count -= maxStackSize; } if (count > 0) - world.spawnEntityInWorld(new EntityItem(world, posToDrop.getX(), posToDrop.getY(), posToDrop.getZ(), stack.toStack(count))); + world.spawnEntity(new EntityItem(world, posToDrop.getX(), posToDrop.getY(), posToDrop.getZ(), stack.toStack(count))); } } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemDaggerOfSacrifice.java b/src/main/java/WayofTime/bloodmagic/item/ItemDaggerOfSacrifice.java index abdbb755..06ad4c91 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemDaggerOfSacrifice.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemDaggerOfSacrifice.java @@ -37,7 +37,7 @@ public class ItemDaggerOfSacrifice extends Item implements IVariantProvider @Override public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) { - if (target == null || attacker == null || attacker.worldObj.isRemote || (attacker instanceof EntityPlayer && !(attacker instanceof EntityPlayerMP))) + if (target == null || attacker == null || attacker.getEntityWorld().isRemote || (attacker instanceof EntityPlayer && !(attacker instanceof EntityPlayerMP))) return false; if (!target.isNonBoss()) @@ -67,9 +67,9 @@ public class ItemDaggerOfSacrifice extends Item implements IVariantProvider lifeEssence = (int) (lifeEssence * (1 + PurificationHelper.getCurrentPurity((EntityAnimal) target))); } - if (PlayerSacrificeHelper.findAndFillAltar(attacker.worldObj, target, lifeEssence, true)) + if (PlayerSacrificeHelper.findAndFillAltar(attacker.getEntityWorld(), target, lifeEssence, true)) { - target.worldObj.playSound(null, target.posX, target.posY, target.posZ, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (target.worldObj.rand.nextFloat() - target.worldObj.rand.nextFloat()) * 0.8F); + target.getEntityWorld().playSound(null, target.posX, target.posY, target.posZ, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (target.getEntityWorld().rand.nextFloat() - target.getEntityWorld().rand.nextFloat()) * 0.8F); target.setHealth(-1); target.onDeath(BloodMagicAPI.getDamageSource()); } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemDemonCrystal.java b/src/main/java/WayofTime/bloodmagic/item/ItemDemonCrystal.java index 649bf361..ccf99211 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemDemonCrystal.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemDemonCrystal.java @@ -101,7 +101,7 @@ public class ItemDemonCrystal extends Item implements IDiscreteDemonWill, IVaria @Override public EnumDemonWillType getType(ItemStack willStack) { - return EnumDemonWillType.values()[MathHelper.clamp_int(willStack.getMetadata(), 0, EnumDemonWillType.values().length - 1)]; + return EnumDemonWillType.values()[MathHelper.clamp(willStack.getMetadata(), 0, EnumDemonWillType.values().length - 1)]; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemExperienceBook.java b/src/main/java/WayofTime/bloodmagic/item/ItemExperienceBook.java index 8d0063f9..880b2d39 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemExperienceBook.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemExperienceBook.java @@ -95,7 +95,7 @@ public class ItemExperienceBook extends Item implements IVariantProvider if (player.experienceLevel % 5 == 0) { float f = player.experienceLevel > 30 ? 1.0F : (float) player.experienceLevel / 30.0F; - player.worldObj.playSound((EntityPlayer) null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_PLAYER_LEVELUP, player.getSoundCategory(), f * 0.75F, 1.0F); + player.getEntityWorld().playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_PLAYER_LEVELUP, player.getSoundCategory(), f * 0.75F, 1.0F); } } else { diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemRitualDiviner.java b/src/main/java/WayofTime/bloodmagic/item/ItemRitualDiviner.java index 3a4154a6..37da318a 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemRitualDiviner.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemRitualDiviner.java @@ -372,7 +372,7 @@ public class ItemRitualDiviner extends Item implements IVariantProvider { EntityPlayer player = (EntityPlayer) entityLiving; - RayTraceResult ray = this.rayTrace(player.worldObj, player, false); + RayTraceResult ray = this.rayTrace(player.getEntityWorld(), player, false); if (ray != null && ray.typeOfHit == RayTraceResult.Type.BLOCK) { return false; diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemSacrificialDagger.java b/src/main/java/WayofTime/bloodmagic/item/ItemSacrificialDagger.java index 29ebda58..95035644 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemSacrificialDagger.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemSacrificialDagger.java @@ -81,7 +81,7 @@ public class ItemSacrificialDagger extends Item implements IMeshProvider @Override public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityLivingBase entityLiving, int timeLeft) { - if (entityLiving instanceof EntityPlayer && !entityLiving.worldObj.isRemote) + if (entityLiving instanceof EntityPlayer && !entityLiving.getEntityWorld().isRemote) PlayerSacrificeHelper.sacrificePlayerHealth((EntityPlayer) entityLiving); } diff --git a/src/main/java/WayofTime/bloodmagic/item/armour/ItemLivingArmour.java b/src/main/java/WayofTime/bloodmagic/item/armour/ItemLivingArmour.java index d94bdcca..37da1d12 100644 --- a/src/main/java/WayofTime/bloodmagic/item/armour/ItemLivingArmour.java +++ b/src/main/java/WayofTime/bloodmagic/item/armour/ItemLivingArmour.java @@ -243,7 +243,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP if (damage > this.getMaxDamage(stack) - this.getDamage(stack)) { //TODO: Syphon a load of LP. - if (entity.worldObj.isRemote && entity instanceof EntityPlayer) + if (entity.getEntityWorld().isRemote && entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entity; SoulNetwork network = NetworkHelper.getSoulNetwork(player); @@ -307,7 +307,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP if (tracker != null) { double progress = tracker.getProgress(armour, upgrade.getUpgradeLevel()); - tooltip.add(TextHelper.localize("tooltip.BloodMagic.livingArmour.upgrade.progress", TextHelper.localize(upgrade.getUnlocalizedName()), MathHelper.clamp_int((int) (progress * 100D), 0, 100))); + tooltip.add(TextHelper.localize("tooltip.BloodMagic.livingArmour.upgrade.progress", TextHelper.localize(upgrade.getUnlocalizedName()), MathHelper.clamp((int) (progress * 100D), 0, 100))); } } else { diff --git a/src/main/java/WayofTime/bloodmagic/item/armour/ItemSentientArmour.java b/src/main/java/WayofTime/bloodmagic/item/armour/ItemSentientArmour.java index f5dc8800..3ea9a5eb 100644 --- a/src/main/java/WayofTime/bloodmagic/item/armour/ItemSentientArmour.java +++ b/src/main/java/WayofTime/bloodmagic/item/armour/ItemSentientArmour.java @@ -371,11 +371,11 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes Multimap multimap = HashMultimap.create(); if (slot == EntityEquipmentSlot.CHEST) { - multimap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 318145), "Armor modifier", this.getHealthBonus(stack), 0)); - multimap.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 8145), "Armor modifier", this.getKnockbackResistance(stack), 0)); - multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 94021), "Armor modifier", this.getSpeedBoost(stack), 2)); - multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 96721), "Armor modifier", this.getDamageBoost(stack), 2)); - multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 73245), "Armor modifier", this.getAttackSpeedBoost(stack), 2)); + multimap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(new UUID(0, 318145), "Armor modifier", this.getHealthBonus(stack), 0)); + multimap.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getName(), new AttributeModifier(new UUID(0, 8145), "Armor modifier", this.getKnockbackResistance(stack), 0)); + multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(new UUID(0, 94021), "Armor modifier", this.getSpeedBoost(stack), 2)); + multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(new UUID(0, 96721), "Armor modifier", this.getDamageBoost(stack), 2)); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(new UUID(0, 73245), "Armor modifier", this.getAttackSpeedBoost(stack), 2)); } return multimap; } diff --git a/src/main/java/WayofTime/bloodmagic/item/block/base/ItemBlockEnum.java b/src/main/java/WayofTime/bloodmagic/item/block/base/ItemBlockEnum.java index 9b9f825e..9efd5ff4 100644 --- a/src/main/java/WayofTime/bloodmagic/item/block/base/ItemBlockEnum.java +++ b/src/main/java/WayofTime/bloodmagic/item/block/base/ItemBlockEnum.java @@ -27,7 +27,7 @@ public class ItemBlockEnum & IStringSerializable> extends Item @Override public String getUnlocalizedName(ItemStack stack) { - return getBlock().getUnlocalizedName() + getBlock().getTypes()[MathHelper.clamp_int(stack.getItemDamage(), 0, 15)].getName(); + return getBlock().getUnlocalizedName() + getBlock().getTypes()[MathHelper.clamp(stack.getItemDamage(), 0, 15)].getName(); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/item/block/base/ItemBlockString.java b/src/main/java/WayofTime/bloodmagic/item/block/base/ItemBlockString.java index 3fdea986..37e51279 100644 --- a/src/main/java/WayofTime/bloodmagic/item/block/base/ItemBlockString.java +++ b/src/main/java/WayofTime/bloodmagic/item/block/base/ItemBlockString.java @@ -22,7 +22,7 @@ public class ItemBlockString extends ItemBlock { @Override public String getUnlocalizedName(ItemStack stack) { - return getBlock().getUnlocalizedName() + "." + getBlock().getTypes()[MathHelper.clamp_int(stack.getItemDamage(), 0, 15)]; + return getBlock().getUnlocalizedName() + "." + getBlock().getTypes()[MathHelper.clamp(stack.getItemDamage(), 0, 15)]; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/item/inventory/ContainerHolding.java b/src/main/java/WayofTime/bloodmagic/item/inventory/ContainerHolding.java index c95f2497..c64c678d 100644 --- a/src/main/java/WayofTime/bloodmagic/item/inventory/ContainerHolding.java +++ b/src/main/java/WayofTime/bloodmagic/item/inventory/ContainerHolding.java @@ -59,7 +59,7 @@ public class ContainerHolding extends Container { super.onContainerClosed(entityPlayer); - if (!entityPlayer.worldObj.isRemote) + if (!entityPlayer.getEntityWorld().isRemote) { saveInventory(entityPlayer); } @@ -70,7 +70,7 @@ public class ContainerHolding extends Container { super.detectAndSendChanges(); - if (!player.worldObj.isRemote) + if (!player.getEntityWorld().isRemote) { saveInventory(player); } diff --git a/src/main/java/WayofTime/bloodmagic/item/inventory/ItemInventory.java b/src/main/java/WayofTime/bloodmagic/item/inventory/ItemInventory.java index dcea591a..4c8bb267 100644 --- a/src/main/java/WayofTime/bloodmagic/item/inventory/ItemInventory.java +++ b/src/main/java/WayofTime/bloodmagic/item/inventory/ItemInventory.java @@ -177,7 +177,7 @@ public class ItemInventory implements IInventory } @Override - public boolean isUseableByPlayer(EntityPlayer player) + public boolean isUsableByPlayer(EntityPlayer player) { return true; } diff --git a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilBloodLight.java b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilBloodLight.java index bd271c71..47dc9976 100644 --- a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilBloodLight.java +++ b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilBloodLight.java @@ -58,7 +58,7 @@ public class ItemSigilBloodLight extends ItemSigilBase { if (!world.isRemote) { - world.spawnEntityInWorld(new EntityBloodLight(world, player)); + world.spawnEntity(new EntityBloodLight(world, player)); NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).syphonAndDamage(player, getLpUsed()); } resetCooldown(stack); diff --git a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilCompression.java b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilCompression.java index 8da86084..d37faaf2 100644 --- a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilCompression.java +++ b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilCompression.java @@ -28,7 +28,7 @@ public class ItemSigilCompression extends ItemSigilToggleableBase if (compressedStack != null) { EntityItem entityItem = new EntityItem(world, player.posX, player.posY, player.posZ, compressedStack); - world.spawnEntityInWorld(entityItem); + world.spawnEntity(entityItem); } } } diff --git a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilHolding.java b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilHolding.java index 5214d64a..b5d421af 100644 --- a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilHolding.java +++ b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilHolding.java @@ -48,7 +48,7 @@ public class ItemSigilHolding extends ItemSigilBase implements IKeybindable, IAl if (stack == player.getHeldItemMainhand() && stack.getItem() instanceof ItemSigilHolding && key.equals(KeyBindings.OPEN_HOLDING)) { Utils.setUUID(stack); - player.openGui(BloodMagic.instance, Constants.Gui.SIGIL_HOLDING_GUI, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ); + player.openGui(BloodMagic.instance, Constants.Gui.SIGIL_HOLDING_GUI, player.getEntityWorld(), (int) player.posX, (int) player.posY, (int) player.posZ); } } @@ -251,7 +251,7 @@ public class ItemSigilHolding extends ItemSigilBase implements IKeybindable, IAl { initModeTag(itemStack); int currentSigil = itemStack.getTagCompound().getInteger(Constants.NBT.CURRENT_SIGIL); - currentSigil = MathHelper.clamp_int(currentSigil, 0, inventorySize - 1); + currentSigil = MathHelper.clamp(currentSigil, 0, inventorySize - 1); return currentSigil; } diff --git a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilMagnetism.java b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilMagnetism.java index 5ab19bc1..3c5aec7a 100644 --- a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilMagnetism.java +++ b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilMagnetism.java @@ -28,8 +28,8 @@ public class ItemSigilMagnetism extends ItemSigilToggleableBase float posX = Math.round(player.posX); float posY = (float) (player.posY - player.getEyeHeight()); float posZ = Math.round(player.posZ); - List entities = player.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range)); - List xpOrbs = player.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range)); + List entities = player.getEntityWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range)); + List xpOrbs = player.getEntityWorld().getEntitiesWithinAABB(EntityXPOrb.class, new AxisAlignedBB(posX - 0.5f, posY - 0.5f, posZ - 0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(range, verticalRange, range)); for (EntityItem entity : entities) { diff --git a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientAxe.java b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientAxe.java index 255ac5d9..a32873df 100644 --- a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientAxe.java +++ b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientAxe.java @@ -224,7 +224,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP if (attacker instanceof EntityPlayer) { EntityPlayer attackerPlayer = (EntityPlayer) attacker; - this.recalculatePowers(stack, attackerPlayer.worldObj, attackerPlayer); + this.recalculatePowers(stack, attackerPlayer.getEntityWorld(), attackerPlayer); EnumDemonWillType type = this.getCurrentType(stack); double will = PlayerDemonWillHandler.getTotalDemonWill(type, attackerPlayer); int willBracket = this.getLevel(stack, will); @@ -314,7 +314,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP @Override public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { - recalculatePowers(stack, player.worldObj, player); + recalculatePowers(stack, player.getEntityWorld(), player); double drain = this.getDrainOfActivatedSword(stack); if (drain > 0) @@ -365,7 +365,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP { List soulList = new ArrayList(); - if (killedEntity.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && !(killedEntity instanceof IMob)) + if (killedEntity.getEntityWorld().getDifficulty() != EnumDifficulty.PEACEFUL && !(killedEntity instanceof IMob)) { return soulList; } @@ -378,9 +378,9 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP for (int i = 0; i <= looting; i++) { - if (i == 0 || attackingEntity.worldObj.rand.nextDouble() < 0.4) + if (i == 0 || attackingEntity.getEntityWorld().rand.nextDouble() < 0.4) { - ItemStack soulStack = soul.createWill(type.ordinal(), willModifier * (this.getDropOfActivatedSword(stack) * attackingEntity.worldObj.rand.nextDouble() + this.getStaticDropOfActivatedSword(stack)) * killedEntity.getMaxHealth() / 20d); + ItemStack soulStack = soul.createWill(type.ordinal(), willModifier * (this.getDropOfActivatedSword(stack) * attackingEntity.getEntityWorld().rand.nextDouble() + this.getStaticDropOfActivatedSword(stack)) * killedEntity.getMaxHealth() / 20d); soulList.add(soulStack); } } @@ -395,10 +395,10 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP Multimap multimap = HashMultimap.create(); if (slot == EntityEquipmentSlot.MAINHAND) { - multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getDamageOfActivatedSword(stack), 0)); - multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.getAttackSpeedOfSword(stack), 0)); - multimap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 31818145), "Weapon modifier", this.getHealthBonusOfSword(stack), 0)); - multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 4218052), "Weapon modifier", this.getSpeedOfSword(stack), 2)); + multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getDamageOfActivatedSword(stack), 0)); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.getAttackSpeedOfSword(stack), 0)); + multimap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(new UUID(0, 31818145), "Weapon modifier", this.getHealthBonusOfSword(stack), 0)); + multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(new UUID(0, 4218052), "Weapon modifier", this.getSpeedOfSword(stack), 2)); } return multimap; @@ -543,7 +543,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP @Override public boolean spawnSentientEntityOnDrop(ItemStack droppedStack, EntityPlayer player) { - World world = player.worldObj; + World world = player.getEntityWorld(); if (!world.isRemote) { this.recalculatePowers(droppedStack, world, player); @@ -559,7 +559,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP EntitySentientSpecter specterEntity = new EntitySentientSpecter(world); specterEntity.setPosition(player.posX, player.posY, player.posZ); - world.spawnEntityInWorld(specterEntity); + world.spawnEntity(specterEntity); specterEntity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, droppedStack.copy()); diff --git a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientBow.java b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientBow.java index 29505a45..ca4b82e3 100644 --- a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientBow.java +++ b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientBow.java @@ -85,7 +85,7 @@ public class ItemSentientBow extends ItemBow implements IMultiWillTool, ISentien @Override public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) { - return ModItems.ITEM_DEMON_CRYSTAL == repair.getItem() ? true : super.getIsRepairable(toRepair, repair); + return ModItems.ITEM_DEMON_CRYSTAL == repair.getItem() || super.getIsRepairable(toRepair, repair); } public void recalculatePowers(ItemStack stack, World world, EntityPlayer player) @@ -294,7 +294,7 @@ public class ItemSentientBow extends ItemBow implements IMultiWillTool, ISentien double d0 = target.posX - user.posX; double d1 = target.getEntityBoundingBox().minY + (double) (target.height / 3.0F) - entityArrow.posY; double d2 = target.posZ - user.posZ; - double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2); + double d3 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2); entityArrow.setThrowableHeading(d0, d1 + d3 * 0.05, d2, newArrowVelocity, 0); if (newArrowVelocity == 0) @@ -405,7 +405,7 @@ public class ItemSentientBow extends ItemBow implements IMultiWillTool, ISentien entityArrow.pickupStatus = EntityArrow.PickupStatus.CREATIVE_ONLY; } - world.spawnEntityInWorld(entityArrow); + world.spawnEntity(entityArrow); } world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + arrowVelocity * 0.5F); @@ -453,7 +453,7 @@ public class ItemSentientBow extends ItemBow implements IMultiWillTool, ISentien @Override public boolean spawnSentientEntityOnDrop(ItemStack droppedStack, EntityPlayer player) { - World world = player.worldObj; + World world = player.getEntityWorld(); if (!world.isRemote) { this.recalculatePowers(droppedStack, world, player); @@ -469,7 +469,7 @@ public class ItemSentientBow extends ItemBow implements IMultiWillTool, ISentien EntitySentientSpecter specterEntity = new EntitySentientSpecter(world); specterEntity.setPosition(player.posX, player.posY, player.posZ); - world.spawnEntityInWorld(specterEntity); + world.spawnEntity(specterEntity); specterEntity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, droppedStack.copy()); diff --git a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientPickaxe.java b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientPickaxe.java index 9ccef5ad..a6d3bd90 100644 --- a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientPickaxe.java +++ b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientPickaxe.java @@ -224,7 +224,7 @@ public class ItemSentientPickaxe extends ItemPickaxe implements IDemonWillWeapon if (attacker instanceof EntityPlayer) { EntityPlayer attackerPlayer = (EntityPlayer) attacker; - this.recalculatePowers(stack, attackerPlayer.worldObj, attackerPlayer); + this.recalculatePowers(stack, attackerPlayer.getEntityWorld(), attackerPlayer); EnumDemonWillType type = this.getCurrentType(stack); double will = PlayerDemonWillHandler.getTotalDemonWill(type, attackerPlayer); int willBracket = this.getLevel(stack, will); @@ -314,7 +314,7 @@ public class ItemSentientPickaxe extends ItemPickaxe implements IDemonWillWeapon @Override public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { - recalculatePowers(stack, player.worldObj, player); + recalculatePowers(stack, player.getEntityWorld(), player); double drain = this.getDrainOfActivatedSword(stack); if (drain > 0) @@ -365,7 +365,7 @@ public class ItemSentientPickaxe extends ItemPickaxe implements IDemonWillWeapon { List soulList = new ArrayList(); - if (killedEntity.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && !(killedEntity instanceof IMob)) + if (killedEntity.getEntityWorld().getDifficulty() != EnumDifficulty.PEACEFUL && !(killedEntity instanceof IMob)) { return soulList; } @@ -378,9 +378,9 @@ public class ItemSentientPickaxe extends ItemPickaxe implements IDemonWillWeapon for (int i = 0; i <= looting; i++) { - if (i == 0 || attackingEntity.worldObj.rand.nextDouble() < 0.4) + if (i == 0 || attackingEntity.getEntityWorld().rand.nextDouble() < 0.4) { - ItemStack soulStack = soul.createWill(type.ordinal(), willModifier * (this.getDropOfActivatedSword(stack) * attackingEntity.worldObj.rand.nextDouble() + this.getStaticDropOfActivatedSword(stack)) * killedEntity.getMaxHealth() / 20d); + ItemStack soulStack = soul.createWill(type.ordinal(), willModifier * (this.getDropOfActivatedSword(stack) * attackingEntity.getEntityWorld().rand.nextDouble() + this.getStaticDropOfActivatedSword(stack)) * killedEntity.getMaxHealth() / 20d); soulList.add(soulStack); } } @@ -395,10 +395,10 @@ public class ItemSentientPickaxe extends ItemPickaxe implements IDemonWillWeapon Multimap multimap = HashMultimap.create(); if (slot == EntityEquipmentSlot.MAINHAND) { - multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getDamageOfActivatedSword(stack), 0)); - multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.getAttackSpeedOfSword(stack), 0)); - multimap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 31818145), "Weapon modifier", this.getHealthBonusOfSword(stack), 0)); - multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 4218052), "Weapon modifier", this.getSpeedOfSword(stack), 2)); + multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getDamageOfActivatedSword(stack), 0)); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED. getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.getAttackSpeedOfSword(stack), 0)); + multimap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(new UUID(0, 31818145), "Weapon modifier", this.getHealthBonusOfSword(stack), 0)); + multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(new UUID(0, 4218052), "Weapon modifier", this.getSpeedOfSword(stack), 2)); } return multimap; @@ -543,7 +543,7 @@ public class ItemSentientPickaxe extends ItemPickaxe implements IDemonWillWeapon @Override public boolean spawnSentientEntityOnDrop(ItemStack droppedStack, EntityPlayer player) { - World world = player.worldObj; + World world = player.getEntityWorld(); if (!world.isRemote) { this.recalculatePowers(droppedStack, world, player); @@ -559,7 +559,7 @@ public class ItemSentientPickaxe extends ItemPickaxe implements IDemonWillWeapon EntitySentientSpecter specterEntity = new EntitySentientSpecter(world); specterEntity.setPosition(player.posX, player.posY, player.posZ); - world.spawnEntityInWorld(specterEntity); + world.spawnEntity(specterEntity); specterEntity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, droppedStack.copy()); diff --git a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientShovel.java b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientShovel.java index 664afb3e..0e1deb4c 100644 --- a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientShovel.java +++ b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientShovel.java @@ -224,7 +224,7 @@ public class ItemSentientShovel extends ItemSpade implements IDemonWillWeapon, I if (attacker instanceof EntityPlayer) { EntityPlayer attackerPlayer = (EntityPlayer) attacker; - this.recalculatePowers(stack, attackerPlayer.worldObj, attackerPlayer); + this.recalculatePowers(stack, attackerPlayer.getEntityWorld(), attackerPlayer); EnumDemonWillType type = this.getCurrentType(stack); double will = PlayerDemonWillHandler.getTotalDemonWill(type, attackerPlayer); int willBracket = this.getLevel(stack, will); @@ -314,7 +314,7 @@ public class ItemSentientShovel extends ItemSpade implements IDemonWillWeapon, I @Override public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { - recalculatePowers(stack, player.worldObj, player); + recalculatePowers(stack, player.getEntityWorld(), player); double drain = this.getDrainOfActivatedSword(stack); if (drain > 0) @@ -365,7 +365,7 @@ public class ItemSentientShovel extends ItemSpade implements IDemonWillWeapon, I { List soulList = new ArrayList(); - if (killedEntity.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && !(killedEntity instanceof IMob)) + if (killedEntity.getEntityWorld().getDifficulty() != EnumDifficulty.PEACEFUL && !(killedEntity instanceof IMob)) { return soulList; } @@ -378,9 +378,9 @@ public class ItemSentientShovel extends ItemSpade implements IDemonWillWeapon, I for (int i = 0; i <= looting; i++) { - if (i == 0 || attackingEntity.worldObj.rand.nextDouble() < 0.4) + if (i == 0 || attackingEntity.getEntityWorld().rand.nextDouble() < 0.4) { - ItemStack soulStack = soul.createWill(type.ordinal(), willModifier * (this.getDropOfActivatedSword(stack) * attackingEntity.worldObj.rand.nextDouble() + this.getStaticDropOfActivatedSword(stack)) * killedEntity.getMaxHealth() / 20d); + ItemStack soulStack = soul.createWill(type.ordinal(), willModifier * (this.getDropOfActivatedSword(stack) * attackingEntity.getEntityWorld().rand.nextDouble() + this.getStaticDropOfActivatedSword(stack)) * killedEntity.getMaxHealth() / 20d); soulList.add(soulStack); } } @@ -395,10 +395,10 @@ public class ItemSentientShovel extends ItemSpade implements IDemonWillWeapon, I Multimap multimap = HashMultimap.create(); if (slot == EntityEquipmentSlot.MAINHAND) { - multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getDamageOfActivatedSword(stack), 0)); - multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.getAttackSpeedOfSword(stack), 0)); - multimap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 31818145), "Weapon modifier", this.getHealthBonusOfSword(stack), 0)); - multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 4218052), "Weapon modifier", this.getSpeedOfSword(stack), 2)); + multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getDamageOfActivatedSword(stack), 0)); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.getAttackSpeedOfSword(stack), 0)); + multimap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(new UUID(0, 31818145), "Weapon modifier", this.getHealthBonusOfSword(stack), 0)); + multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(new UUID(0, 4218052), "Weapon modifier", this.getSpeedOfSword(stack), 2)); } return multimap; @@ -543,7 +543,7 @@ public class ItemSentientShovel extends ItemSpade implements IDemonWillWeapon, I @Override public boolean spawnSentientEntityOnDrop(ItemStack droppedStack, EntityPlayer player) { - World world = player.worldObj; + World world = player.getEntityWorld(); if (!world.isRemote) { this.recalculatePowers(droppedStack, world, player); @@ -559,7 +559,7 @@ public class ItemSentientShovel extends ItemSpade implements IDemonWillWeapon, I EntitySentientSpecter specterEntity = new EntitySentientSpecter(world); specterEntity.setPosition(player.posX, player.posY, player.posZ); - world.spawnEntityInWorld(specterEntity); + world.spawnEntity(specterEntity); specterEntity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, droppedStack.copy()); diff --git a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java index bbc5cc5d..cd3cd61a 100644 --- a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java +++ b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java @@ -79,7 +79,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon, IM @Override public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) { - return ModItems.ITEM_DEMON_CRYSTAL == repair.getItem() ? true : super.getIsRepairable(toRepair, repair); + return ModItems.ITEM_DEMON_CRYSTAL == repair.getItem() || super.getIsRepairable(toRepair, repair); } public void recalculatePowers(ItemStack stack, World world, EntityPlayer player) @@ -196,7 +196,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon, IM if (attacker instanceof EntityPlayer) { EntityPlayer attackerPlayer = (EntityPlayer) attacker; - this.recalculatePowers(stack, attackerPlayer.worldObj, attackerPlayer); + this.recalculatePowers(stack, attackerPlayer.getEntityWorld(), attackerPlayer); EnumDemonWillType type = this.getCurrentType(stack); double will = PlayerDemonWillHandler.getTotalDemonWill(type, attackerPlayer); int willBracket = this.getLevel(stack, will); @@ -286,7 +286,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon, IM @Override public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { - recalculatePowers(stack, player.worldObj, player); + recalculatePowers(stack, player.getEntityWorld(), player); double drain = this.getDrainOfActivatedSword(stack); if (drain > 0) @@ -337,7 +337,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon, IM { List soulList = new ArrayList(); - if (killedEntity.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && !(killedEntity instanceof IMob)) + if (killedEntity.getEntityWorld().getDifficulty() != EnumDifficulty.PEACEFUL && !(killedEntity instanceof IMob)) { return soulList; } @@ -350,9 +350,9 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon, IM for (int i = 0; i <= looting; i++) { - if (i == 0 || attackingEntity.worldObj.rand.nextDouble() < 0.4) + if (i == 0 || attackingEntity.getEntityWorld().rand.nextDouble() < 0.4) { - ItemStack soulStack = soul.createWill(type.ordinal(), willModifier * (this.getDropOfActivatedSword(stack) * attackingEntity.worldObj.rand.nextDouble() + this.getStaticDropOfActivatedSword(stack)) * killedEntity.getMaxHealth() / 20d); + ItemStack soulStack = soul.createWill(type.ordinal(), willModifier * (this.getDropOfActivatedSword(stack) * attackingEntity.getEntityWorld().rand.nextDouble() + this.getStaticDropOfActivatedSword(stack)) * killedEntity.getMaxHealth() / 20d); soulList.add(soulStack); } } @@ -367,10 +367,10 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon, IM Multimap multimap = HashMultimap.create(); if (slot == EntityEquipmentSlot.MAINHAND) { - multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getDamageOfActivatedSword(stack), 0)); - multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.getAttackSpeedOfSword(stack), 0)); - multimap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 31818145), "Weapon modifier", this.getHealthBonusOfSword(stack), 0)); - multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 4218052), "Weapon modifier", this.getSpeedOfSword(stack), 2)); + multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getDamageOfActivatedSword(stack), 0)); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.getAttackSpeedOfSword(stack), 0)); + multimap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(new UUID(0, 31818145), "Weapon modifier", this.getHealthBonusOfSword(stack), 0)); + multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(new UUID(0, 4218052), "Weapon modifier", this.getSpeedOfSword(stack), 2)); } return multimap; @@ -498,7 +498,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon, IM @Override public boolean spawnSentientEntityOnDrop(ItemStack droppedStack, EntityPlayer player) { - World world = player.worldObj; + World world = player.getEntityWorld(); if (!world.isRemote) { this.recalculatePowers(droppedStack, world, player); @@ -514,7 +514,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon, IM EntitySentientSpecter specterEntity = new EntitySentientSpecter(world); specterEntity.setPosition(player.posX, player.posY, player.posZ); - world.spawnEntityInWorld(specterEntity); + world.spawnEntity(specterEntity); specterEntity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, droppedStack.copy()); diff --git a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSoulSnare.java b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSoulSnare.java index b1107f31..3ddf3169 100644 --- a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSoulSnare.java +++ b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSoulSnare.java @@ -53,7 +53,7 @@ public class ItemSoulSnare extends Item implements IVariantProvider { EntitySoulSnare snare = new EntitySoulSnare(worldIn, playerIn); snare.setHeadingFromThrower(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F); - worldIn.spawnEntityInWorld(snare); + worldIn.spawnEntity(snare); } return new ActionResult(EnumActionResult.SUCCESS, itemStackIn); diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeMeleeDecrease.java b/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeMeleeDecrease.java index 96dc33fa..b8c2568e 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeMeleeDecrease.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeMeleeDecrease.java @@ -36,7 +36,7 @@ public class LivingArmourUpgradeMeleeDecrease extends LivingArmourUpgrade { Multimap modifierMap = HashMultimap.create(); - modifierMap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0271023, 5321), "damage modifier" + 2, meleeDamage[this.level], 1)); + modifierMap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(new UUID(0271023, 5321), "damage modifier" + 2, meleeDamage[this.level], 1)); return modifierMap; } diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeSlowness.java b/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeSlowness.java index ad67cfe4..b516db11 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeSlowness.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeSlowness.java @@ -29,7 +29,7 @@ public class LivingArmourUpgradeSlowness extends LivingArmourUpgrade { Multimap modifierMap = HashMultimap.create(); - modifierMap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85472, 8502), "speed modifier" + 2, speedModifier[this.level], 1)); + modifierMap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(new UUID(85472, 8502), "speed modifier" + 2, speedModifier[this.level], 1)); return modifierMap; } diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeHealthboost.java b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeHealthboost.java index b593da5a..4dc51e55 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeHealthboost.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeHealthboost.java @@ -34,7 +34,7 @@ public class LivingArmourUpgradeHealthboost extends LivingArmourUpgrade { Multimap modifierMap = HashMultimap.create(); - modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(9423688, 1), "Health modifier" + 1, healthModifier[this.level], 0)); + modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(new UUID(9423688, 1), "Health modifier" + 1, healthModifier[this.level], 0)); return modifierMap; } diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeKnockbackResist.java b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeKnockbackResist.java index 078aa21f..c59f4e48 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeKnockbackResist.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeKnockbackResist.java @@ -26,11 +26,11 @@ public class LivingArmourUpgradeKnockbackResist extends LivingArmourUpgrade { Multimap modifierMap = HashMultimap.create(); - modifierMap.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(895132, 1), "Knockback modifier" + 1, kbModifier[this.level], 0)); + modifierMap.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getName(), new AttributeModifier(new UUID(895132, 1), "Knockback modifier" + 1, kbModifier[this.level], 0)); if (healthModifier[this.level] > 0) { - modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(952142, 1), "Health modifier" + 1, healthModifier[this.level], 0)); + modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(new UUID(952142, 1), "Health modifier" + 1, healthModifier[this.level], 0)); } return modifierMap; diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeMeleeDamage.java b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeMeleeDamage.java index 228404de..4bbe2fc7 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeMeleeDamage.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeMeleeDamage.java @@ -34,7 +34,7 @@ public class LivingArmourUpgradeMeleeDamage extends LivingArmourUpgrade { Multimap modifierMap = HashMultimap.create(); - modifierMap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(9423688, 1), "damage modifier" + 1, meleeDamage[this.level], 0)); + modifierMap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(new UUID(9423688, 1), "damage modifier" + 1, meleeDamage[this.level], 0)); return modifierMap; } diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSolarPowered.java b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSolarPowered.java index b86b39cc..5196c902 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSolarPowered.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSolarPowered.java @@ -29,7 +29,7 @@ public class LivingArmourUpgradeSolarPowered extends LivingArmourUpgrade @Override public double getArmourProtection(EntityLivingBase wearer, DamageSource source) { - if (wearer.worldObj.canSeeSky(wearer.getPosition()) || wearer.worldObj.provider.isDaytime()) + if (wearer.getEntityWorld().canSeeSky(wearer.getPosition()) || wearer.getEntityWorld().provider.isDaytime()) { return protectionLevel[this.level]; } diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSpeed.java b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSpeed.java index eca1937e..6e591e7a 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSpeed.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSpeed.java @@ -61,7 +61,7 @@ public class LivingArmourUpgradeSpeed extends LivingArmourUpgrade if (healthModifier[this.level] > 0) { - modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(952142, 1), "Health modifier" + 1, healthModifier[this.level], 0)); + modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(new UUID(952142, 1), "Health modifier" + 1, healthModifier[this.level], 0)); } return modifierMap; diff --git a/src/main/java/WayofTime/bloodmagic/network/PlayerVelocityPacketProcessor.java b/src/main/java/WayofTime/bloodmagic/network/PlayerVelocityPacketProcessor.java index d2a1c13f..e9a6f608 100644 --- a/src/main/java/WayofTime/bloodmagic/network/PlayerVelocityPacketProcessor.java +++ b/src/main/java/WayofTime/bloodmagic/network/PlayerVelocityPacketProcessor.java @@ -59,7 +59,7 @@ public class PlayerVelocityPacketProcessor implements IMessage, IMessageHandler< @SideOnly(Side.CLIENT) public void onMessageFromServer() { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; + EntityPlayer player = Minecraft.getMinecraft().player; player.motionX = motionX; player.motionY = motionY; player.motionZ = motionZ; diff --git a/src/main/java/WayofTime/bloodmagic/potion/BMPotionUtils.java b/src/main/java/WayofTime/bloodmagic/potion/BMPotionUtils.java index 1296ed4b..4306fdfa 100644 --- a/src/main/java/WayofTime/bloodmagic/potion/BMPotionUtils.java +++ b/src/main/java/WayofTime/bloodmagic/potion/BMPotionUtils.java @@ -30,7 +30,7 @@ public class BMPotionUtils public static double damageMobAndGrowSurroundingPlants(EntityLivingBase entity, int horizontalRadius, int verticalRadius, double damageRatio, int maxPlantsGrown) { - World world = entity.worldObj; + World world = entity.getEntityWorld(); if (world.isRemote) { return 0; diff --git a/src/main/java/WayofTime/bloodmagic/potion/PotionEventHandlers.java b/src/main/java/WayofTime/bloodmagic/potion/PotionEventHandlers.java index 58813ea4..4bfb118f 100644 --- a/src/main/java/WayofTime/bloodmagic/potion/PotionEventHandlers.java +++ b/src/main/java/WayofTime/bloodmagic/potion/PotionEventHandlers.java @@ -59,7 +59,7 @@ public class PotionEventHandlers { int d0 = 3; AxisAlignedBB axisAlignedBB = new AxisAlignedBB(event.getEntityLiving().posX - 0.5, event.getEntityLiving().posY - 0.5, event.getEntityLiving().posZ - 0.5, event.getEntityLiving().posX + 0.5, event.getEntityLiving().posY + 0.5, event.getEntityLiving().posZ + 0.5).expand(d0, d0, d0); - List entityList = event.getEntityLiving().worldObj.getEntitiesWithinAABB(Entity.class, axisAlignedBB); + List entityList = event.getEntityLiving().getEntityWorld().getEntitiesWithinAABB(Entity.class, axisAlignedBB); for (Object thing : entityList) { diff --git a/src/main/java/WayofTime/bloodmagic/registry/ModBlocks.java b/src/main/java/WayofTime/bloodmagic/registry/ModBlocks.java index b76b8028..f9378dfe 100644 --- a/src/main/java/WayofTime/bloodmagic/registry/ModBlocks.java +++ b/src/main/java/WayofTime/bloodmagic/registry/ModBlocks.java @@ -80,7 +80,6 @@ import WayofTime.bloodmagic.tile.TileInversionPillar; import WayofTime.bloodmagic.tile.TileMasterRitualStone; import WayofTime.bloodmagic.tile.TileMimic; import WayofTime.bloodmagic.tile.TilePhantomBlock; -import WayofTime.bloodmagic.tile.TilePlinth; import WayofTime.bloodmagic.tile.TileSoulForge; import WayofTime.bloodmagic.tile.TileSpectralBlock; import WayofTime.bloodmagic.tile.TileTeleposer; @@ -213,7 +212,6 @@ public class ModBlocks GameRegistry.registerTileEntity(TileAltar.class, Constants.Mod.MODID + ":" + TileAltar.class.getSimpleName()); GameRegistry.registerTileEntity(TileImperfectRitualStone.class, Constants.Mod.MODID + ":" + TileImperfectRitualStone.class.getSimpleName()); GameRegistry.registerTileEntity(TileMasterRitualStone.class, Constants.Mod.MODID + ":" + TileMasterRitualStone.class.getSimpleName()); - GameRegistry.registerTileEntity(TilePlinth.class, Constants.Mod.MODID + ":" + TilePlinth.class.getSimpleName()); GameRegistry.registerTileEntity(TileAlchemyArray.class, Constants.Mod.MODID + ":" + TileAlchemyArray.class.getSimpleName()); GameRegistry.registerTileEntity(TileSpectralBlock.class, Constants.Mod.MODID + ":" + TileSpectralBlock.class.getSimpleName()); GameRegistry.registerTileEntity(TilePhantomBlock.class, Constants.Mod.MODID + ":" + TilePhantomBlock.class.getSimpleName()); diff --git a/src/main/java/WayofTime/bloodmagic/registry/ModCompatibility.java b/src/main/java/WayofTime/bloodmagic/registry/ModCompatibility.java index fdf91ba5..28dbcaa4 100644 --- a/src/main/java/WayofTime/bloodmagic/registry/ModCompatibility.java +++ b/src/main/java/WayofTime/bloodmagic/registry/ModCompatibility.java @@ -2,7 +2,6 @@ package WayofTime.bloodmagic.registry; import WayofTime.bloodmagic.compat.ICompatibility; import WayofTime.bloodmagic.compat.guideapi.CompatibilityGuideAPI; -import WayofTime.bloodmagic.compat.jei.CompatibilityJustEnoughItems; import WayofTime.bloodmagic.compat.waila.CompatibilityWaila; import net.minecraftforge.fml.common.Loader; @@ -14,7 +13,6 @@ public class ModCompatibility public static void registerModCompat() { - compatibilities.add(new CompatibilityJustEnoughItems()); compatibilities.add(new CompatibilityWaila()); compatibilities.add(new CompatibilityGuideAPI()); // compatibilities.add(new CompatibilityThaumcraft()); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualArmourEvolve.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualArmourEvolve.java index 2fb686f9..caff98f0 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualArmourEvolve.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualArmourEvolve.java @@ -55,7 +55,7 @@ public class RitualArmourEvolve extends Ritual masterRitualStone.setActive(false); - world.spawnEntityInWorld(new EntityLightningBolt(world, pos.getX(), pos.getY() - 1, pos.getZ(), true)); + world.spawnEntity(new EntityLightningBolt(world, pos.getX(), pos.getY() - 1, pos.getZ(), true)); } } } diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualExpulsion.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualExpulsion.java index 4cfdece0..2c833ac9 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualExpulsion.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualExpulsion.java @@ -136,18 +136,18 @@ public class RitualExpulsion extends Ritual moveEntityViaTeleport(entityLiving, event.getTargetX(), event.getTargetY(), event.getTargetZ()); boolean flag = false; - int i = MathHelper.floor_double(entityLiving.posX); - int j = MathHelper.floor_double(entityLiving.posY); - int k = MathHelper.floor_double(entityLiving.posZ); + int i = MathHelper.floor(entityLiving.posX); + int j = MathHelper.floor(entityLiving.posY); + int k = MathHelper.floor(entityLiving.posZ); int l; - if (!entityLiving.worldObj.isAirBlock(new BlockPos(i, j, k))) + if (!entityLiving.getEntityWorld().isAirBlock(new BlockPos(i, j, k))) { boolean flag1 = false; while (!flag1 && j > 0) { - IBlockState state = entityLiving.worldObj.getBlockState(new BlockPos(i, j - 1, k)); + IBlockState state = entityLiving.getEntityWorld().getBlockState(new BlockPos(i, j - 1, k)); if (state != null && state.getMaterial().blocksMovement()) { @@ -163,7 +163,7 @@ public class RitualExpulsion extends Ritual { moveEntityViaTeleport(entityLiving, entityLiving.posX, entityLiving.posY, entityLiving.posZ); - if (!entityLiving.isCollided && !entityLiving.worldObj.containsAnyLiquid(entityLiving.getEntityBoundingBox())) + if (!entityLiving.isCollided && !entityLiving.getEntityWorld().containsAnyLiquid(entityLiving.getEntityBoundingBox())) { flag = true; } @@ -179,13 +179,13 @@ public class RitualExpulsion extends Ritual for (l = 0; l < 128; ++l) { double lengthVal = (double) l / ((double) 128 - 1.0D); - float randF1 = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F; - float randF2 = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F; - float randF3 = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F; - double lengthValX = lastX + (entityLiving.posX - lastX) * lengthVal + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; - double lengthValY = lastY + (entityLiving.posY - lastY) * lengthVal + entityLiving.worldObj.rand.nextDouble() * (double) entityLiving.height; - double lengthValZ = lastZ + (entityLiving.posZ - lastZ) * lengthVal + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; - entityLiving.worldObj.spawnParticle(EnumParticleTypes.PORTAL, lengthValX, lengthValY, lengthValZ, (double) randF1, (double) randF2, (double) randF3); + float randF1 = (entityLiving.getEntityWorld().rand.nextFloat() - 0.5F) * 0.2F; + float randF2 = (entityLiving.getEntityWorld().rand.nextFloat() - 0.5F) * 0.2F; + float randF3 = (entityLiving.getEntityWorld().rand.nextFloat() - 0.5F) * 0.2F; + double lengthValX = lastX + (entityLiving.posX - lastX) * lengthVal + (entityLiving.getEntityWorld().rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; + double lengthValY = lastY + (entityLiving.posY - lastY) * lengthVal + entityLiving.getEntityWorld().rand.nextDouble() * (double) entityLiving.height; + double lengthValZ = lastZ + (entityLiving.posZ - lastZ) * lengthVal + (entityLiving.getEntityWorld().rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; + entityLiving.getEntityWorld().spawnParticle(EnumParticleTypes.PORTAL, lengthValX, lengthValY, lengthValZ, (double) randF1, (double) randF2, (double) randF3); } return true; @@ -200,7 +200,7 @@ public class RitualExpulsion extends Ritual { EntityPlayerMP entityplayermp = (EntityPlayerMP) entityLiving; - if (entityplayermp.worldObj == entityLiving.worldObj) + if (entityplayermp.getEntityWorld() == entityLiving.getEntityWorld()) { EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, x, y, z, 5.0F); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualFelling.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualFelling.java index e235c7ba..072f17c2 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualFelling.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualFelling.java @@ -124,7 +124,7 @@ public class RitualFelling extends Ritual Utils.insertStackIntoInventory(copyStack, (IInventory) tile, EnumFacing.DOWN); if (copyStack.stackSize > 0) { - world.spawnEntityInWorld(new EntityItem(world, blockPos.getX() + 0.4, blockPos.getY() + 2, blockPos.getZ() + 0.4, copyStack)); + world.spawnEntity(new EntityItem(world, blockPos.getX() + 0.4, blockPos.getY() + 2, blockPos.getZ() + 0.4, copyStack)); } } } diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualLivingArmourDowngrade.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualLivingArmourDowngrade.java index f4d3244d..1895d037 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualLivingArmourDowngrade.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualLivingArmourDowngrade.java @@ -126,7 +126,7 @@ public class RitualLivingArmourDowngrade extends Ritual recipe.consumeInventory(inv); EntityLightningBolt lightning = new EntityLightningBolt(world, chestPos.getX(), chestPos.getY(), chestPos.getZ(), true); - world.spawnEntityInWorld(lightning); + world.spawnEntity(lightning); masterRitualStone.setActive(false); } diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualMeteor.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualMeteor.java index 1ef24b08..cc690201 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualMeteor.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualMeteor.java @@ -65,7 +65,7 @@ public class RitualMeteor extends Ritual { EntityMeteor meteor = new EntityMeteor(world, pos.getX(), 260, pos.getZ(), 0, -0.1, 0, radiusModifier, explosionModifier, fillerChance); meteor.setMeteorStack(stack.copy()); - world.spawnEntityInWorld(meteor); + world.spawnEntity(meteor); entityItem.setDead(); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualUpgradeRemove.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualUpgradeRemove.java index c859c7f2..79dacbe7 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualUpgradeRemove.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualUpgradeRemove.java @@ -79,7 +79,7 @@ public class RitualUpgradeRemove extends Ritual if (successful) { removedUpgrade = true; - world.spawnEntityInWorld(new EntityItem(world, player.posX, player.posY, player.posZ, upgradeStack)); + world.spawnEntity(new EntityItem(world, player.posX, player.posY, player.posZ, upgradeStack)); for (Entry trackerEntry : armour.trackerMap.entrySet()) { StatTracker tracker = trackerEntry.getValue(); @@ -102,7 +102,7 @@ public class RitualUpgradeRemove extends Ritual masterRitualStone.setActive(false); - world.spawnEntityInWorld(new EntityLightningBolt(world, pos.getX(), pos.getY() - 1, pos.getZ(), true)); + world.spawnEntity(new EntityLightningBolt(world, pos.getX(), pos.getY() - 1, pos.getZ(), true)); } } diff --git a/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerPlantable.java b/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerPlantable.java index 74b5b1cd..a1e98351 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerPlantable.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerPlantable.java @@ -70,7 +70,7 @@ public class HarvestHandlerPlantable implements IHarvestHandler if (!world.isRemote) { EntityItem toDrop = new EntityItem(world, pos.getX(), pos.getY() + 0.5, pos.getZ(), stack); - world.spawnEntityInWorld(toDrop); + world.spawnEntity(toDrop); } } diff --git a/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerStem.java b/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerStem.java index 16984fd4..1d98a5f1 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerStem.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerStem.java @@ -61,7 +61,7 @@ public class HarvestHandlerStem implements IHarvestHandler for (ItemStack drop : drops) { EntityItem item = new EntityItem(world, cropPos.getX(), cropPos.getY() + 0.5, cropPos.getZ(), drop); - world.spawnEntityInWorld(item); + world.spawnEntity(item); } } diff --git a/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerTall.java b/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerTall.java index 8bcdecf8..4325a79b 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerTall.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerTall.java @@ -47,7 +47,7 @@ public class HarvestHandlerTall implements IHarvestHandler for (ItemStack drop : drops) { EntityItem item = new EntityItem(world, pos.getX(), pos.getY() + 0.5, pos.getZ(), drop); - world.spawnEntityInWorld(item); + world.spawnEntity(item); } } diff --git a/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualZombie.java b/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualZombie.java index 362fe1b8..75dfaf5d 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualZombie.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualZombie.java @@ -28,7 +28,7 @@ public class ImperfectRitualZombie extends ImperfectRitual zombie.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 20000, 3)); if (!imperfectRitualStone.getRitualWorld().isRemote) - imperfectRitualStone.getRitualWorld().spawnEntityInWorld(zombie); + imperfectRitualStone.getRitualWorld().spawnEntity(zombie); return true; } diff --git a/src/main/java/WayofTime/bloodmagic/ritual/portal/Teleports.java b/src/main/java/WayofTime/bloodmagic/ritual/portal/Teleports.java index e3c035d1..f15568ad 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/portal/Teleports.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/portal/Teleports.java @@ -54,7 +54,7 @@ public class Teleports return; if (teleposer) - if (MinecraftForge.EVENT_BUS.post(new TeleposeEvent.Ent(entity, entity.worldObj, entity.getPosition(), entity.worldObj, new BlockPos(x, y, z)))) + if (MinecraftForge.EVENT_BUS.post(new TeleposeEvent.Ent(entity, entity.getEntityWorld(), entity.getPosition(), entity.getEntityWorld(), new BlockPos(x, y, z)))) return; network.syphon(getTeleportCost()); @@ -62,13 +62,13 @@ public class Teleports EntityPlayerMP player = (EntityPlayerMP) entity; player.setPositionAndUpdate(x + 0.5, y + 0.5, z + 0.5); - player.worldObj.updateEntityWithOptionalForce(player, false); + player.getEntityWorld().updateEntityWithOptionalForce(player, false); player.connection.sendPacket(new SPacketUpdateHealth(player.getHealth(), player.getFoodStats().getFoodLevel(), player.getFoodStats().getSaturationLevel())); player.timeUntilPortal = 150; - player.worldObj.playSound(x, y, z, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.AMBIENT, 1.0F, 1.0F, false); + player.getEntityWorld().playSound(x, y, z, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.AMBIENT, 1.0F, 1.0F, false); if (teleposer) - MinecraftForge.EVENT_BUS.post(new TeleposeEvent.Ent.Post(entity, entity.worldObj, entity.getPosition(), entity.worldObj, new BlockPos(x, y, z))); + MinecraftForge.EVENT_BUS.post(new TeleposeEvent.Ent.Post(entity, entity.getEntityWorld(), entity.getPosition(), entity.getEntityWorld(), new BlockPos(x, y, z))); } else { SoulNetwork network = NetworkHelper.getSoulNetwork(networkToDrain); @@ -76,20 +76,20 @@ public class Teleports return; if (teleposer) - if (MinecraftForge.EVENT_BUS.post(new TeleposeEvent.Ent(entity, entity.worldObj, entity.getPosition(), entity.worldObj, new BlockPos(x, y, z)))) + if (MinecraftForge.EVENT_BUS.post(new TeleposeEvent.Ent(entity, entity.getEntityWorld(), entity.getPosition(), entity.getEntityWorld(), new BlockPos(x, y, z)))) return; network.syphon(getTeleportCost() / 10); - WorldServer world = (WorldServer) entity.worldObj; + WorldServer world = (WorldServer) entity.getEntityWorld(); entity.setPosition(x + 0.5, y + 0.5, z + 0.5); entity.timeUntilPortal = 150; world.resetUpdateEntityTick(); - entity.worldObj.playSound(x, y, z, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.AMBIENT, 1.0F, 1.0F, false); + entity.getEntityWorld().playSound(x, y, z, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.AMBIENT, 1.0F, 1.0F, false); if (teleposer) - MinecraftForge.EVENT_BUS.post(new TeleposeEvent.Ent.Post(entity, entity.worldObj, entity.getPosition(), entity.worldObj, new BlockPos(x, y, z))); + MinecraftForge.EVENT_BUS.post(new TeleposeEvent.Ent.Post(entity, entity.getEntityWorld(), entity.getPosition(), entity.getEntityWorld(), new BlockPos(x, y, z))); } } } @@ -137,14 +137,14 @@ public class Teleports { EntityPlayerMP player = (EntityPlayerMP) entity; - if (!player.worldObj.isRemote) + if (!player.getEntityWorld().isRemote) { SoulNetwork network = NetworkHelper.getSoulNetwork(networkToDrain); if (network.getCurrentEssence() < getTeleportCost()) return; if (teleposer) - if (MinecraftForge.EVENT_BUS.post(new TeleposeEvent.Ent(entity, entity.worldObj, entity.getPosition(), newWorldServer, new BlockPos(x, y, z)))) + if (MinecraftForge.EVENT_BUS.post(new TeleposeEvent.Ent(entity, entity.getEntityWorld(), entity.getPosition(), newWorldServer, new BlockPos(x, y, z)))) return; network.syphon(getTeleportCost()); @@ -152,20 +152,20 @@ public class Teleports player.changeDimension(newWorldID); //TODO: UNTESTED // server.getConfigurationManager().transferPlayerToDimension(player, newWorldID, new TeleporterBloodMagic(newWorldServer)); player.setPositionAndUpdate(x + 0.5, y + 0.5, z + 0.5); - player.worldObj.updateEntityWithOptionalForce(player, false); + player.getEntityWorld().updateEntityWithOptionalForce(player, false); player.connection.sendPacket(new SPacketUpdateHealth(player.getHealth(), player.getFoodStats().getFoodLevel(), player.getFoodStats().getSaturationLevel())); if (teleposer) - MinecraftForge.EVENT_BUS.post(new TeleposeEvent.Ent.Post(entity, entity.worldObj, entity.getPosition(), newWorldServer, new BlockPos(x, y, z))); + MinecraftForge.EVENT_BUS.post(new TeleposeEvent.Ent.Post(entity, entity.getEntityWorld(), entity.getPosition(), newWorldServer, new BlockPos(x, y, z))); } - } else if (!entity.worldObj.isRemote) + } else if (!entity.getEntityWorld().isRemote) { SoulNetwork network = NetworkHelper.getSoulNetwork(networkToDrain); if (network.getCurrentEssence() < (getTeleportCost() / 10)) return; if (teleposer) - if (MinecraftForge.EVENT_BUS.post(new TeleposeEvent.Ent(entity, entity.worldObj, entity.getPosition(), newWorldServer, new BlockPos(x, y, z)))) + if (MinecraftForge.EVENT_BUS.post(new TeleposeEvent.Ent(entity, entity.getEntityWorld(), entity.getPosition(), newWorldServer, new BlockPos(x, y, z)))) return; network.syphon(getTeleportCost() / 10); @@ -181,7 +181,7 @@ public class Teleports { teleportedEntity.setLocationAndAngles(x + 0.5, y + 0.5, z + 0.5, entity.rotationYaw, entity.rotationPitch); teleportedEntity.forceSpawn = true; - newWorldServer.spawnEntityInWorld(teleportedEntity); + newWorldServer.spawnEntity(teleportedEntity); teleportedEntity.setWorld(newWorldServer); teleportedEntity.timeUntilPortal = teleportedEntity instanceof EntityPlayer ? 150 : 20; } @@ -189,7 +189,7 @@ public class Teleports oldWorldServer.resetUpdateEntityTick(); newWorldServer.resetUpdateEntityTick(); if (teleposer) - MinecraftForge.EVENT_BUS.post(new TeleposeEvent.Ent.Post(entity, entity.worldObj, entity.getPosition(), newWorldServer, new BlockPos(x, y, z))); + MinecraftForge.EVENT_BUS.post(new TeleposeEvent.Ent.Post(entity, entity.getEntityWorld(), entity.getPosition(), newWorldServer, new BlockPos(x, y, z))); } entity.timeUntilPortal = entity instanceof EntityLiving ? 150 : 20; newWorldServer.playSound(x, y, z, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.AMBIENT, 1.0F, 1.0F, false); diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileAlchemyArray.java b/src/main/java/WayofTime/bloodmagic/tile/TileAlchemyArray.java index b9aade81..a1ebd2cf 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileAlchemyArray.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileAlchemyArray.java @@ -35,7 +35,7 @@ public class TileAlchemyArray extends TileInventory implements ITickable, IAlche { if (arrayEffect != null) { - arrayEffect.onEntityCollidedWithBlock(this, worldObj, pos, state, entity); + arrayEffect.onEntityCollidedWithBlock(this, getWorld(), pos, state, entity); } } @@ -145,7 +145,7 @@ public class TileAlchemyArray extends TileInventory implements ITickable, IAlche { this.decrStackSize(0, 1); this.decrStackSize(1, 1); - this.worldObj.setBlockToAir(getPos()); + this.getWorld().setBlockToAir(getPos()); } return true; diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileAlchemyTable.java b/src/main/java/WayofTime/bloodmagic/tile/TileAlchemyTable.java index 2e1c3d1a..99e2c628 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileAlchemyTable.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileAlchemyTable.java @@ -136,7 +136,7 @@ public class TileAlchemyTable extends TileInventory implements ISidedInventory, { if (this.isSlave()) { - TileEntity tile = worldObj.getTileEntity(connectedPos); + TileEntity tile = getWorld().getTileEntity(connectedPos); if (tile instanceof TileAlchemyTable) { return (T) new SidedInvWrapper((TileAlchemyTable) tile, facing); @@ -246,12 +246,12 @@ public class TileAlchemyTable extends TileInventory implements ISidedInventory, int tier = getTierOfOrb(); AlchemyTableRecipe recipe = AlchemyTableRecipeRegistry.getMatchingRecipe(inputList, getWorld(), getPos()); - if (recipe != null && (burnTime > 0 || (!worldObj.isRemote && tier >= recipe.getTierRequired() && this.getContainedLp() >= recipe.getLpDrained()))) + if (recipe != null && (burnTime > 0 || (!getWorld().isRemote && tier >= recipe.getTierRequired() && this.getContainedLp() >= recipe.getLpDrained()))) { if (burnTime == 1) { - IBlockState state = worldObj.getBlockState(pos); - worldObj.notifyBlockUpdate(getPos(), state, state, 3); + IBlockState state = getWorld().getBlockState(pos); + getWorld().notifyBlockUpdate(getPos(), state, state, 3); } if (canCraft(inputList, recipe)) @@ -261,18 +261,18 @@ public class TileAlchemyTable extends TileInventory implements ISidedInventory, if (burnTime == ticksRequired) { - if (!worldObj.isRemote) + if (!getWorld().isRemote) { int requiredLp = recipe.getLpDrained(); if (requiredLp > 0) { - if (!worldObj.isRemote) + if (!getWorld().isRemote) { consumeLp(requiredLp); } } - if (!worldObj.isRemote) + if (!getWorld().isRemote) { craftItem(inputList, recipe); } @@ -280,8 +280,8 @@ public class TileAlchemyTable extends TileInventory implements ISidedInventory, burnTime = 0; - IBlockState state = worldObj.getBlockState(pos); - worldObj.notifyBlockUpdate(getPos(), state, state, 3); + IBlockState state = getWorld().getBlockState(pos); + getWorld().notifyBlockUpdate(getPos(), state, state, 3); } else if (burnTime > ticksRequired + 10) { burnTime = 0; diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrucible.java b/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrucible.java index e34b3c0f..8f4a75c7 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrucible.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrucible.java @@ -30,14 +30,14 @@ public class TileDemonCrucible extends TileInventory implements ITickable, IDemo @Override public void update() { - if (worldObj.isRemote) + if (getWorld().isRemote) { return; } internalCounter++; - if (worldObj.isBlockPowered(getPos())) + if (getWorld().isBlockPowered(getPos())) { //TODO: Fill the contained gem if it is there. ItemStack stack = this.getStackInSlot(0); @@ -77,21 +77,21 @@ public class TileDemonCrucible extends TileInventory implements ITickable, IDemo IDemonWillGem gemItem = (IDemonWillGem) stack.getItem(); for (EnumDemonWillType type : EnumDemonWillType.values()) { - double currentAmount = WorldDemonWillHandler.getCurrentWill(worldObj, pos, type); + double currentAmount = WorldDemonWillHandler.getCurrentWill(getWorld(), pos, type); double drainAmount = Math.min(maxWill - currentAmount, gemDrainRate); - double filled = WorldDemonWillHandler.fillWillToMaximum(worldObj, pos, type, drainAmount, maxWill, false); + double filled = WorldDemonWillHandler.fillWillToMaximum(getWorld(), pos, type, drainAmount, maxWill, false); filled = gemItem.drainWill(type, stack, filled, false); if (filled > 0) { filled = gemItem.drainWill(type, stack, filled, true); - WorldDemonWillHandler.fillWillToMaximum(worldObj, pos, type, filled, maxWill, true); + WorldDemonWillHandler.fillWillToMaximum(getWorld(), pos, type, filled, maxWill, true); } } } else if (stack.getItem() instanceof IDiscreteDemonWill) //TODO: Limit the speed of this process { IDiscreteDemonWill willItem = (IDiscreteDemonWill) stack.getItem(); EnumDemonWillType type = willItem.getType(stack); - double currentAmount = WorldDemonWillHandler.getCurrentWill(worldObj, pos, type); + double currentAmount = WorldDemonWillHandler.getCurrentWill(getWorld(), pos, type); double needed = maxWill - currentAmount; double discreteAmount = willItem.getDiscretization(stack); if (needed >= discreteAmount) @@ -99,7 +99,7 @@ public class TileDemonCrucible extends TileInventory implements ITickable, IDemo double filled = willItem.drainWill(stack, discreteAmount); if (filled > 0) { - WorldDemonWillHandler.fillWillToMaximum(worldObj, pos, type, filled, maxWill, true); + WorldDemonWillHandler.fillWillToMaximum(getWorld(), pos, type, filled, maxWill, true); if (stack.stackSize <= 0) { this.setInventorySlotContents(0, null); diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystal.java b/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystal.java index 44fbc634..b1083df8 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystal.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystal.java @@ -41,7 +41,7 @@ public class TileDemonCrystal extends TileTicking @Override public void onUpdate() { - if (worldObj.isRemote) + if (getWorld().isRemote) { return; } @@ -52,20 +52,20 @@ public class TileDemonCrystal extends TileTicking { EnumDemonWillType type = EnumDemonWillType.values()[this.getBlockMetadata()]; - double value = WorldDemonWillHandler.getCurrentWill(worldObj, pos, type); + double value = WorldDemonWillHandler.getCurrentWill(getWorld(), pos, type); if (type != EnumDemonWillType.DEFAULT) { if (value >= 100) { double nextProgress = getCrystalGrowthPerSecond(value); - progressToNextCrystal += WorldDemonWillHandler.drainWill(worldObj, getPos(), type, nextProgress * sameWillConversionRate, true) / sameWillConversionRate; + progressToNextCrystal += WorldDemonWillHandler.drainWill(getWorld(), getPos(), type, nextProgress * sameWillConversionRate, true) / sameWillConversionRate; } else { - value = WorldDemonWillHandler.getCurrentWill(worldObj, pos, EnumDemonWillType.DEFAULT); + value = WorldDemonWillHandler.getCurrentWill(getWorld(), pos, EnumDemonWillType.DEFAULT); if (value > 0.5) { double nextProgress = getCrystalGrowthPerSecond(value) * timeDelayForWrongWill; - progressToNextCrystal += WorldDemonWillHandler.drainWill(worldObj, getPos(), EnumDemonWillType.DEFAULT, nextProgress * defaultWillConversionRate, true) / defaultWillConversionRate; + progressToNextCrystal += WorldDemonWillHandler.drainWill(getWorld(), getPos(), EnumDemonWillType.DEFAULT, nextProgress * defaultWillConversionRate, true) / defaultWillConversionRate; } } } else @@ -73,17 +73,17 @@ public class TileDemonCrystal extends TileTicking if (value > 0.5) { double nextProgress = getCrystalGrowthPerSecond(value); - progressToNextCrystal += WorldDemonWillHandler.drainWill(worldObj, getPos(), type, nextProgress * sameWillConversionRate, true) / sameWillConversionRate; + progressToNextCrystal += WorldDemonWillHandler.drainWill(getWorld(), getPos(), type, nextProgress * sameWillConversionRate, true) / sameWillConversionRate; } } checkAndGrowCrystal(); } -// if (worldObj.getWorldTime() % 200 == 0) +// if (getWorld().getWorldTime() % 200 == 0) // { // crystalCount = Math.min(crystalCount + 1, 7); -// worldObj.markBlockForUpdate(pos); +// getWorld().markBlockForUpdate(pos); // } } @@ -105,11 +105,11 @@ public class TileDemonCrystal extends TileTicking return 0; } - IBlockState state = worldObj.getBlockState(pos); + IBlockState state = getWorld().getBlockState(pos); int meta = this.getBlockType().getMetaFromState(state); EnumDemonWillType type = EnumDemonWillType.values()[meta]; - double value = WorldDemonWillHandler.getCurrentWill(worldObj, pos, type); + double value = WorldDemonWillHandler.getCurrentWill(getWorld(), pos, type); double percentDrain = willDrain <= 0 ? 1 : Math.min(1, value / willDrain); if (percentDrain <= 0) { @@ -117,7 +117,7 @@ public class TileDemonCrystal extends TileTicking } // Verification that you can actually drain the will from this chunk, for future proofing. - WorldDemonWillHandler.drainWill(worldObj, pos, type, percentDrain * willDrain, true); + WorldDemonWillHandler.drainWill(getWorld(), pos, type, percentDrain * willDrain, true); progressToNextCrystal += percentDrain * progressPercentage; checkAndGrowCrystal(); @@ -131,8 +131,8 @@ public class TileDemonCrystal extends TileTicking { progressToNextCrystal--; crystalCount++; - IBlockState thisState = worldObj.getBlockState(pos); - worldObj.notifyBlockUpdate(pos, thisState, thisState, 3); + IBlockState thisState = getWorld().getBlockState(pos); + getWorld().notifyBlockUpdate(pos, thisState, thisState, 3); markDirty(); } } @@ -144,15 +144,15 @@ public class TileDemonCrystal extends TileTicking public boolean dropSingleCrystal() { - if (!worldObj.isRemote && crystalCount > 1) + if (!getWorld().isRemote && crystalCount > 1) { - IBlockState state = worldObj.getBlockState(pos); + IBlockState state = getWorld().getBlockState(pos); EnumDemonWillType type = state.getValue(BlockDemonCrystal.TYPE); ItemStack stack = BlockDemonCrystal.getItemStackDropped(type, 1); if (stack != null) { crystalCount--; - worldObj.spawnEntityInWorld(new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, stack)); + getWorld().spawnEntity(new EntityItem(getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, stack)); return true; } } @@ -167,7 +167,7 @@ public class TileDemonCrystal extends TileTicking public int getCrystalCountForRender() { - return MathHelper.clamp_int(crystalCount - 1, 0, 6); + return MathHelper.clamp(crystalCount - 1, 0, 6); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystallizer.java b/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystallizer.java index cb088dd9..a0acb3ee 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystallizer.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrystallizer.java @@ -30,26 +30,26 @@ public class TileDemonCrystallizer extends TileTicking implements IDemonWillCond @Override public void onUpdate() { - if (worldObj.isRemote) + if (getWorld().isRemote) { return; } BlockPos offsetPos = pos.offset(EnumFacing.UP); - if (worldObj.isAirBlock(offsetPos)) //Room for a crystal to grow + if (getWorld().isAirBlock(offsetPos)) //Room for a crystal to grow { - EnumDemonWillType highestType = WorldDemonWillHandler.getHighestDemonWillType(worldObj, pos); - double amount = WorldDemonWillHandler.getCurrentWill(worldObj, pos, highestType); + EnumDemonWillType highestType = WorldDemonWillHandler.getHighestDemonWillType(getWorld(), pos); + double amount = WorldDemonWillHandler.getCurrentWill(getWorld(), pos, highestType); if (amount >= willToFormCrystal) { internalCounter += getCrystalFormationRate(amount); if (internalCounter >= totalFormationTime) { - if (WorldDemonWillHandler.drainWill(worldObj, getPos(), highestType, willToFormCrystal, false) >= willToFormCrystal) + if (WorldDemonWillHandler.drainWill(getWorld(), getPos(), highestType, willToFormCrystal, false) >= willToFormCrystal) { if (highestType == EnumDemonWillType.DEFAULT && formRandomSpecialCrystal(offsetPos) || formCrystal(highestType, offsetPos)) { - WorldDemonWillHandler.drainWill(worldObj, getPos(), highestType, willToFormCrystal, true); + WorldDemonWillHandler.drainWill(getWorld(), getPos(), highestType, willToFormCrystal, true); internalCounter = 0; } } @@ -60,8 +60,8 @@ public class TileDemonCrystallizer extends TileTicking implements IDemonWillCond public boolean formCrystal(EnumDemonWillType type, BlockPos position) { - worldObj.setBlockState(position, ModBlocks.DEMON_CRYSTAL.getStateFromMeta(type.ordinal())); - TileEntity tile = worldObj.getTileEntity(position); + getWorld().setBlockState(position, ModBlocks.DEMON_CRYSTAL.getStateFromMeta(type.ordinal())); + TileEntity tile = getWorld().getTileEntity(position); if (tile instanceof TileDemonCrystal) { ((TileDemonCrystal) tile).setPlacement(EnumFacing.UP); @@ -73,11 +73,11 @@ public class TileDemonCrystallizer extends TileTicking implements IDemonWillCond public boolean formRandomSpecialCrystal(BlockPos position) { - if (worldObj.rand.nextDouble() > 0.1) + if (getWorld().rand.nextDouble() > 0.1) { return formCrystal(EnumDemonWillType.DEFAULT, position); } - EnumDemonWillType crystalType = EnumDemonWillType.values()[worldObj.rand.nextInt(EnumDemonWillType.values().length - 1) + 1]; + EnumDemonWillType crystalType = EnumDemonWillType.values()[getWorld().rand.nextInt(EnumDemonWillType.values().length - 1) + 1]; return formCrystal(crystalType, position); } diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileDemonPylon.java b/src/main/java/WayofTime/bloodmagic/tile/TileDemonPylon.java index ca95170d..475f73c8 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileDemonPylon.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileDemonPylon.java @@ -23,24 +23,24 @@ public class TileDemonPylon extends TileTicking implements IDemonWillConduit @Override public void onUpdate() { - if (worldObj.isRemote) + if (getWorld().isRemote) { return; } for (EnumDemonWillType type : EnumDemonWillType.values()) { - double currentAmount = WorldDemonWillHandler.getCurrentWill(worldObj, pos, type); + double currentAmount = WorldDemonWillHandler.getCurrentWill(getWorld(), pos, type); for (EnumFacing side : EnumFacing.HORIZONTALS) { BlockPos offsetPos = pos.offset(side, 16); - double sideAmount = WorldDemonWillHandler.getCurrentWill(worldObj, offsetPos, type); + double sideAmount = WorldDemonWillHandler.getCurrentWill(getWorld(), offsetPos, type); if (sideAmount > currentAmount) { double drainAmount = Math.min((sideAmount - currentAmount) / 2, drainRate); - double drain = WorldDemonWillHandler.drainWill(worldObj, offsetPos, type, drainAmount, true); - WorldDemonWillHandler.fillWill(worldObj, pos, type, drain, true); + double drain = WorldDemonWillHandler.drainWill(getWorld(), offsetPos, type, drainAmount, true); + WorldDemonWillHandler.fillWill(getWorld(), pos, type, drain, true); } } } diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileIncenseAltar.java b/src/main/java/WayofTime/bloodmagic/tile/TileIncenseAltar.java index f08dcf94..6ebf9778 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileIncenseAltar.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileIncenseAltar.java @@ -42,13 +42,13 @@ public class TileIncenseAltar extends TileInventory implements ITickable public void update() { AxisAlignedBB aabb = incenseArea.getAABB(getPos()); - List playerList = worldObj.getEntitiesWithinAABB(EntityPlayer.class, aabb); + List playerList = getWorld().getEntitiesWithinAABB(EntityPlayer.class, aabb); if (playerList.isEmpty()) { return; } - if (worldObj.getTotalWorldTime() % 100 == 0) + if (getWorld().getTotalWorldTime() % 100 == 0) { recheckConstruction(); } @@ -65,9 +65,9 @@ public class TileIncenseAltar extends TileInventory implements ITickable if (hasPerformed) { - if (worldObj.rand.nextInt(4) == 0 && worldObj instanceof WorldServer) + if (getWorld().rand.nextInt(4) == 0 && getWorld() instanceof WorldServer) { - WorldServer server = (WorldServer) worldObj; + WorldServer server = (WorldServer) getWorld(); server.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5, 1, 0.02, 0.03, 0.02, 0, new int[0]); } } @@ -113,9 +113,9 @@ public class TileIncenseAltar extends TileInventory implements ITickable for (int j = -1; j <= 1; j++) { BlockPos offsetPos = facingOffsetPos.offset(horizontalFacing.rotateY(), j); - IBlockState state = worldObj.getBlockState(offsetPos); + IBlockState state = getWorld().getBlockState(offsetPos); Block block = state.getBlock(); - if (!(block instanceof IIncensePath && ((IIncensePath) block).getLevelOfPath(worldObj, offsetPos, state) >= currentDistance - 2)) + if (!(block instanceof IIncensePath && ((IIncensePath) block).getLevelOfPath(getWorld(), offsetPos, state) >= currentDistance - 2)) { canFormRoad = false; break level; @@ -144,9 +144,9 @@ public class TileIncenseAltar extends TileInventory implements ITickable for (int y = 0 + yOffset; y <= 2 + yOffset; y++) { BlockPos offsetPos = pos.add(i, y, j); - IBlockState state = worldObj.getBlockState(offsetPos); + IBlockState state = getWorld().getBlockState(offsetPos); Block block = state.getBlock(); - TranquilityStack stack = IncenseTranquilityRegistry.getTranquilityOfBlock(worldObj, offsetPos, block, state); + TranquilityStack stack = IncenseTranquilityRegistry.getTranquilityOfBlock(getWorld(), offsetPos, block, state); if (stack != null) { if (!tranquilityMap.containsKey(stack.type)) @@ -186,7 +186,7 @@ public class TileIncenseAltar extends TileInventory implements ITickable appliedTranquility += Math.sqrt(entry.getValue()); } - double bonus = IncenseAltarHandler.getIncenseBonusFromComponents(worldObj, pos, appliedTranquility, roadDistance); + double bonus = IncenseAltarHandler.getIncenseBonusFromComponents(getWorld(), pos, appliedTranquility, roadDistance); incenseAddition = bonus; this.tranquility = appliedTranquility; } diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileInventory.java b/src/main/java/WayofTime/bloodmagic/tile/TileInventory.java index 3e34ccdd..367661ff 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileInventory.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileInventory.java @@ -164,7 +164,7 @@ public class TileInventory extends TileBase implements IInventory } @Override - public boolean isUseableByPlayer(EntityPlayer player) + public boolean isUsableByPlayer(EntityPlayer player) { return true; } diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileInversionPillar.java b/src/main/java/WayofTime/bloodmagic/tile/TileInversionPillar.java index 62bad390..a2a5f56a 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileInversionPillar.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileInversionPillar.java @@ -82,23 +82,23 @@ public class TileInversionPillar extends TileTicking { if (animationOffsetValue < 0) { - animationOffsetValue = worldObj.getTotalWorldTime() * worldObj.rand.nextFloat(); + animationOffsetValue = getWorld().getTotalWorldTime() * getWorld().rand.nextFloat(); animationOffset.setValue(animationOffsetValue); } - if (worldObj.isRemote) + if (getWorld().isRemote) { return; } if (!isRegistered) { - isRegistered = InversionPillarHandler.addPillarToMap(worldObj, getType(), getPos()); + isRegistered = InversionPillarHandler.addPillarToMap(getWorld(), getType(), getPos()); } counter++; - double currentWill = WorldDemonWillHandler.getCurrentWill(worldObj, pos, type); + double currentWill = WorldDemonWillHandler.getCurrentWill(getWorld(), pos, type); if (counter % 1 == 0) { List pillarList = getNearbyPillarsExcludingThis(); @@ -151,17 +151,17 @@ public class TileInversionPillar extends TileTicking if (currentInfectionRadius >= 8 && currentInversion >= inversionToAddPillar) { //TODO: Improve algorithm - List allConnectedPos = InversionPillarHandler.getAllConnectedPillars(worldObj, type, pos); - BlockPos candidatePos = findCandidatePositionForPillar(worldObj, type, pos, allConnectedPos, 5, 10); + List allConnectedPos = InversionPillarHandler.getAllConnectedPillars(getWorld(), type, pos); + BlockPos candidatePos = findCandidatePositionForPillar(getWorld(), type, pos, allConnectedPos, 5, 10); if (!candidatePos.equals(BlockPos.ORIGIN)) { currentInversion = 0; IBlockState pillarState = ModBlocks.INVERSION_PILLAR.getStateFromMeta(type.ordinal()); IBlockState bottomState = ModBlocks.INVERSION_PILLAR_END.getStateFromMeta(type.ordinal() * 2); IBlockState topState = ModBlocks.INVERSION_PILLAR_END.getStateFromMeta(type.ordinal() * 2 + 1); - worldObj.setBlockState(candidatePos, pillarState); - worldObj.setBlockState(candidatePos.down(), bottomState); - worldObj.setBlockState(candidatePos.up(), topState); + getWorld().setBlockState(candidatePos, pillarState); + getWorld().setBlockState(candidatePos.down(), bottomState); + getWorld().setBlockState(candidatePos.up(), topState); } } } @@ -176,11 +176,11 @@ public class TileInversionPillar extends TileTicking { if (currentInversion > 1000) { - Vec3d vec = new Vec3d(worldObj.rand.nextDouble() * 2 - 1, worldObj.rand.nextDouble() * 2 - 1, worldObj.rand.nextDouble() * 2 - 1).normalize().scale(2 * currentInfectionRadius); + Vec3d vec = new Vec3d(getWorld().rand.nextDouble() * 2 - 1, getWorld().rand.nextDouble() * 2 - 1, getWorld().rand.nextDouble() * 2 - 1).normalize().scale(2 * currentInfectionRadius); BlockPos centralPos = pos.add(vec.xCoord, vec.yCoord, vec.zCoord); - worldObj.setBlockState(centralPos, ModBlocks.DEMON_EXTRAS.getStateFromMeta(0)); + getWorld().setBlockState(centralPos, ModBlocks.DEMON_EXTRAS.getStateFromMeta(0)); currentInversion -= 1000; } } @@ -236,7 +236,7 @@ public class TileInversionPillar extends TileTicking public void spreadWillToSurroundingChunks() { - double currentAmount = WorldDemonWillHandler.getCurrentWill(worldObj, pos, type); + double currentAmount = WorldDemonWillHandler.getCurrentWill(getWorld(), pos, type); if (currentAmount <= minimumWillForChunkWhenSpreading) { return; @@ -245,7 +245,7 @@ public class TileInversionPillar extends TileTicking for (EnumFacing side : EnumFacing.HORIZONTALS) { BlockPos offsetPos = pos.offset(side, 16); - double sideAmount = WorldDemonWillHandler.getCurrentWill(worldObj, offsetPos, type); + double sideAmount = WorldDemonWillHandler.getCurrentWill(getWorld(), offsetPos, type); if (currentAmount > sideAmount) { double drainAmount = Math.min((currentAmount - sideAmount) / 2, willPushRate); @@ -254,8 +254,8 @@ public class TileInversionPillar extends TileTicking continue; } - double drain = WorldDemonWillHandler.drainWill(worldObj, pos, type, drainAmount, true); - drain = WorldDemonWillHandler.fillWillToMaximum(worldObj, offsetPos, type, drain, maxWillForChunk, true); + double drain = WorldDemonWillHandler.drainWill(getWorld(), pos, type, drainAmount, true); + drain = WorldDemonWillHandler.fillWillToMaximum(getWorld(), offsetPos, type, drain, maxWillForChunk, true); currentInversion -= drain * inversionCostPerWillSpread; } @@ -264,15 +264,15 @@ public class TileInversionPillar extends TileTicking public void removePillarFromMap() { - if (!worldObj.isRemote) + if (!getWorld().isRemote) { - InversionPillarHandler.removePillarFromMap(worldObj, type, pos); + InversionPillarHandler.removePillarFromMap(getWorld(), type, pos); } } public List getNearbyPillarsExcludingThis() { - return InversionPillarHandler.getNearbyPillars(worldObj, type, pos); + return InversionPillarHandler.getNearbyPillars(getWorld(), type, pos); } @Override @@ -322,7 +322,7 @@ public class TileInversionPillar extends TileTicking if (totalGeneratedWill > 0) { - WorldDemonWillHandler.fillWillToMaximum(worldObj, pos, type, totalGeneratedWill, maxWillForChunk, true); + WorldDemonWillHandler.fillWillToMaximum(getWorld(), pos, type, totalGeneratedWill, maxWillForChunk, true); } } @@ -359,9 +359,9 @@ public class TileInversionPillar extends TileTicking for (int i = 0; i < currentInfectionRadius; i++) { - double xOff = (worldObj.rand.nextBoolean() ? 1 : -1) * (worldObj.rand.nextGaussian() + 1) * (currentInfectionRadius); - double yOff = (worldObj.rand.nextBoolean() ? 1 : -1) * (worldObj.rand.nextGaussian() + 1) * (currentInfectionRadius); - double zOff = (worldObj.rand.nextBoolean() ? 1 : -1) * (worldObj.rand.nextGaussian() + 1) * (currentInfectionRadius); + double xOff = (getWorld().rand.nextBoolean() ? 1 : -1) * (getWorld().rand.nextGaussian() + 1) * (currentInfectionRadius); + double yOff = (getWorld().rand.nextBoolean() ? 1 : -1) * (getWorld().rand.nextGaussian() + 1) * (currentInfectionRadius); + double zOff = (getWorld().rand.nextBoolean() ? 1 : -1) * (getWorld().rand.nextGaussian() + 1) * (currentInfectionRadius); double r2 = xOff * xOff + yOff * yOff + zOff * zOff; int maxInfectionRadius2 = (9 * currentInfectionRadius * currentInfectionRadius); if (r2 > maxInfectionRadius2) @@ -378,16 +378,16 @@ public class TileInversionPillar extends TileTicking return 1; //Invalid block (itself!) } - IBlockState state = worldObj.getBlockState(offsetPos); - if (!state.getBlock().isAir(state, worldObj, offsetPos)) + IBlockState state = getWorld().getBlockState(offsetPos); + if (!state.getBlock().isAir(state, getWorld(), offsetPos)) { //Consume Will and set this block Block block = state.getBlock(); if (block == Blocks.DIRT || block == Blocks.STONE || block == Blocks.GRASS) { - if (worldObj.setBlockState(offsetPos, ModBlocks.DEMON_EXTRAS.getStateFromMeta(0))) + if (getWorld().setBlockState(offsetPos, ModBlocks.DEMON_EXTRAS.getStateFromMeta(0))) { - WorldDemonWillHandler.drainWill(worldObj, pos, type, willPerOperation, true); + WorldDemonWillHandler.drainWill(getWorld(), pos, type, willPerOperation, true); currentInversion -= inversionPerOperation; return 0; //Successfully placed diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileMasterRitualStone.java b/src/main/java/WayofTime/bloodmagic/tile/TileMasterRitualStone.java index 58f0b59b..f5167081 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileMasterRitualStone.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileMasterRitualStone.java @@ -51,7 +51,7 @@ public class TileMasterRitualStone extends TileTicking implements IMasterRitualS @Override public void onUpdate() { - if (worldObj.isRemote) + if (getWorld().isRemote) return; if (getWorld().isBlockPowered(getPos()) && isActive()) diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileMimic.java b/src/main/java/WayofTime/bloodmagic/tile/TileMimic.java index 122f3cff..65df2412 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileMimic.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileMimic.java @@ -55,7 +55,7 @@ public class TileMimic extends TileInventory implements ITickable @Override public void update() { - if (worldObj.isRemote) + if (getWorld().isRemote) { return; } @@ -67,36 +67,36 @@ public class TileMimic extends TileInventory implements ITickable if (potionStack != null) { AxisAlignedBB bb = new AxisAlignedBB(this.getPos()).expand(playerCheckRadius, playerCheckRadius, playerCheckRadius); - List playerList = worldObj.getEntitiesWithinAABB(EntityPlayer.class, bb); + List playerList = getWorld().getEntitiesWithinAABB(EntityPlayer.class, bb); for (EntityPlayer player : playerList) { if (!player.capabilities.isCreativeMode) { - double posX = this.pos.getX() + 0.5 + (2 * worldObj.rand.nextDouble() - 1) * potionSpawnRadius; - double posY = this.pos.getY() + 0.5 + (2 * worldObj.rand.nextDouble() - 1) * potionSpawnRadius; - double posZ = this.pos.getZ() + 0.5 + (2 * worldObj.rand.nextDouble() - 1) * potionSpawnRadius; + double posX = this.pos.getX() + 0.5 + (2 * getWorld().rand.nextDouble() - 1) * potionSpawnRadius; + double posY = this.pos.getY() + 0.5 + (2 * getWorld().rand.nextDouble() - 1) * potionSpawnRadius; + double posZ = this.pos.getZ() + 0.5 + (2 * getWorld().rand.nextDouble() - 1) * potionSpawnRadius; ItemStack newStack = new ItemStack(potionStack.getItem() == ModItems.POTION_FLASK ? Items.SPLASH_POTION : potionStack.getItem()); newStack.setTagCompound(potionStack.getTagCompound()); - EntityPotion potionEntity = new EntityPotion(worldObj, posX, posY, posZ, newStack); + EntityPotion potionEntity = new EntityPotion(getWorld(), posX, posY, posZ, newStack); - worldObj.spawnEntityInWorld(potionEntity); + getWorld().spawnEntity(potionEntity); break; } } } } - if (this.getBlockMetadata() == BlockMimic.sentientMimicMeta && worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && !(mimicedTile instanceof IInventory)) + if (this.getBlockMetadata() == BlockMimic.sentientMimicMeta && getWorld().getDifficulty() != EnumDifficulty.PEACEFUL && !(mimicedTile instanceof IInventory)) { AxisAlignedBB bb = new AxisAlignedBB(this.getPos()).expand(playerCheckRadius, playerCheckRadius, playerCheckRadius); - List playerList = worldObj.getEntitiesWithinAABB(EntityPlayer.class, bb); + List playerList = getWorld().getEntitiesWithinAABB(EntityPlayer.class, bb); for (EntityPlayer player : playerList) { - if (!player.capabilities.isCreativeMode && Utils.canEntitySeeBlock(worldObj, player, getPos())) + if (!player.capabilities.isCreativeMode && Utils.canEntitySeeBlock(getWorld(), player, getPos())) { spawnMimicEntity(player); break; @@ -242,17 +242,17 @@ public class TileMimic extends TileInventory implements ITickable public boolean spawnMimicEntity(EntityPlayer target) { - if (this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL) + if (this.getWorld().getDifficulty() == EnumDifficulty.PEACEFUL) { return false; } - if (this.getStackInSlot(0) == null || worldObj.isRemote) + if (this.getStackInSlot(0) == null || getWorld().isRemote) { return false; } - EntityMimic mimicEntity = new EntityMimic(worldObj); + EntityMimic mimicEntity = new EntityMimic(getWorld()); mimicEntity.setPosition(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5); mimicEntity.initializeMimic(getStackInSlot(0), tileTag, dropItemsOnBreak, metaOfReplacedBlock, playerCheckRadius, pos); @@ -260,13 +260,13 @@ public class TileMimic extends TileInventory implements ITickable mimicedTile = null; this.setInventorySlotContents(0, null); - worldObj.spawnEntityInWorld(mimicEntity); + getWorld().spawnEntity(mimicEntity); if (target != null) { mimicEntity.setAttackTarget(target); } - worldObj.setBlockToAir(pos); + getWorld().setBlockToAir(pos); return true; } @@ -277,7 +277,7 @@ public class TileMimic extends TileInventory implements ITickable { dropMimicedTileInventory(); } - mimicedTile = getTileFromStackWithTag(worldObj, pos, getStackInSlot(0), tileTag, metaOfReplacedBlock); + mimicedTile = getTileFromStackWithTag(getWorld(), pos, getStackInSlot(0), tileTag, metaOfReplacedBlock); } @Override @@ -288,7 +288,7 @@ public class TileMimic extends TileInventory implements ITickable dropItemsOnBreak = tag.getBoolean("dropItemsOnBreak"); tileTag = tag.getCompoundTag("tileTag"); metaOfReplacedBlock = tag.getInteger("metaOfReplacedBlock"); - mimicedTile = getTileFromStackWithTag(worldObj, pos, getStackInSlot(0), tileTag, metaOfReplacedBlock); + mimicedTile = getTileFromStackWithTag(getWorld(), pos, getStackInSlot(0), tileTag, metaOfReplacedBlock); playerCheckRadius = tag.getInteger("playerCheckRadius"); potionSpawnRadius = tag.getInteger("potionSpawnRadius"); potionSpawnInterval = Math.max(1, tag.getInteger("potionSpawnInterval")); @@ -356,14 +356,14 @@ public class TileMimic extends TileInventory implements ITickable if (tag != null) { - NBTTagCompound copyTag = (NBTTagCompound) (tag.copy()); + NBTTagCompound copyTag = tag.copy(); copyTag.setInteger("x", pos.getX()); copyTag.setInteger("y", pos.getY()); copyTag.setInteger("z", pos.getZ()); tile.readFromNBT(copyTag); } - tile.setWorldObj(world); + tile.setWorld(world); try { @@ -396,7 +396,7 @@ public class TileMimic extends TileInventory implements ITickable public void dropMimicedTileInventory() { - if (!worldObj.isRemote && mimicedTile instanceof IInventory) + if (!getWorld().isRemote && mimicedTile instanceof IInventory) { InventoryHelper.dropInventoryItems(getWorld(), getPos(), (IInventory) mimicedTile); } diff --git a/src/main/java/WayofTime/bloodmagic/tile/TilePhantomBlock.java b/src/main/java/WayofTime/bloodmagic/tile/TilePhantomBlock.java index 4c5b8f76..d495095b 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TilePhantomBlock.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TilePhantomBlock.java @@ -35,8 +35,8 @@ public class TilePhantomBlock extends TileTicking if (ticksRemaining <= 0) { - worldObj.setBlockToAir(getPos()); - worldObj.removeTileEntity(getPos()); + getWorld().setBlockToAir(getPos()); + getWorld().removeTileEntity(getPos()); } } } diff --git a/src/main/java/WayofTime/bloodmagic/tile/TilePlinth.java b/src/main/java/WayofTime/bloodmagic/tile/TilePlinth.java deleted file mode 100644 index bb824969..00000000 --- a/src/main/java/WayofTime/bloodmagic/tile/TilePlinth.java +++ /dev/null @@ -1,9 +0,0 @@ -package WayofTime.bloodmagic.tile; - -public class TilePlinth extends TileInventory -{ - public TilePlinth() - { - super(1, "plinth"); - } -} diff --git a/src/main/java/WayofTime/bloodmagic/tile/TilePurificationAltar.java b/src/main/java/WayofTime/bloodmagic/tile/TilePurificationAltar.java index 387f5562..7e6d3e1f 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TilePurificationAltar.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TilePurificationAltar.java @@ -45,7 +45,7 @@ public class TilePurificationAltar extends TileInventory implements ITickable } AxisAlignedBB aabb = purityArea.getAABB(getPos()); - List animalList = worldObj.getEntitiesWithinAABB(EntityAnimal.class, aabb); + List animalList = getWorld().getEntitiesWithinAABB(EntityAnimal.class, aabb); if (animalList.isEmpty()) { return; @@ -65,9 +65,9 @@ public class TilePurificationAltar extends TileInventory implements ITickable if (hasPerformed) { - if (worldObj.rand.nextInt(4) == 0 && worldObj instanceof WorldServer) + if (getWorld().rand.nextInt(4) == 0 && getWorld() instanceof WorldServer) { - WorldServer server = (WorldServer) worldObj; + WorldServer server = (WorldServer) getWorld(); server.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5, 1, 0.02, 0.03, 0.02, 0, new int[0]); } } diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileSoulForge.java b/src/main/java/WayofTime/bloodmagic/tile/TileSoulForge.java index 183f8516..a3e240b6 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileSoulForge.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileSoulForge.java @@ -52,22 +52,22 @@ public class TileSoulForge extends TileInventory implements ITickable, IDemonWil @Override public void update() { - if (!worldObj.isRemote) + if (!getWorld().isRemote) { for (EnumDemonWillType type : EnumDemonWillType.values()) { - double willInWorld = WorldDemonWillHandler.getCurrentWill(worldObj, pos, type); + double willInWorld = WorldDemonWillHandler.getCurrentWill(getWorld(), pos, type); double filled = Math.min(willInWorld, worldWillTransferRate); if (filled > 0) { filled = this.fillDemonWill(type, filled, false); - filled = WorldDemonWillHandler.drainWill(worldObj, pos, type, filled, false); + filled = WorldDemonWillHandler.drainWill(getWorld(), pos, type, filled, false); if (filled > 0) { this.fillDemonWill(type, filled, true); - WorldDemonWillHandler.drainWill(worldObj, pos, type, filled, true); + WorldDemonWillHandler.drainWill(getWorld(), pos, type, filled, true); } } } @@ -100,18 +100,18 @@ public class TileSoulForge extends TileInventory implements ITickable, IDemonWil if (burnTime == ticksRequired) { - if (!worldObj.isRemote) + if (!getWorld().isRemote) { double requiredSouls = recipe.getSoulsDrained(); if (requiredSouls > 0) { - if (!worldObj.isRemote && soulsInGem >= recipe.getMinimumSouls()) + if (!getWorld().isRemote && soulsInGem >= recipe.getMinimumSouls()) { consumeSouls(EnumDemonWillType.DEFAULT, requiredSouls); } } - if (!worldObj.isRemote && soulsInGem >= recipe.getMinimumSouls()) + if (!getWorld().isRemote && soulsInGem >= recipe.getMinimumSouls()) craftItem(recipe); } diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileSpectralBlock.java b/src/main/java/WayofTime/bloodmagic/tile/TileSpectralBlock.java index c8eafe62..22c48fef 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileSpectralBlock.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileSpectralBlock.java @@ -42,7 +42,7 @@ public class TileSpectralBlock extends TileTicking @Override public void onUpdate() { - if (worldObj.isRemote) + if (getWorld().isRemote) { return; } @@ -79,7 +79,7 @@ public class TileSpectralBlock extends TileTicking if (!Strings.isNullOrEmpty(containedBlockName)) block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(containedBlockName)); - if (block != null && worldObj.setBlockState(pos, block.getStateFromMeta(containedBlockMeta))) + if (block != null && getWorld().setBlockState(pos, block.getStateFromMeta(containedBlockMeta))) getWorld().notifyBlockUpdate(getPos(), getWorld().getBlockState(getPos()), getWorld().getBlockState(getPos()), 3); } diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileTeleposer.java b/src/main/java/WayofTime/bloodmagic/tile/TileTeleposer.java index fc016bb3..39cf8f28 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileTeleposer.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileTeleposer.java @@ -52,9 +52,9 @@ public class TileTeleposer extends TileInventory implements ITickable @Override public void update() { - if (!worldObj.isRemote) + if (!getWorld().isRemote) { - int currentInput = worldObj.getStrongPower(pos); + int currentInput = getWorld().getStrongPower(pos); if (previousInput == 0 && currentInput != 0) { @@ -67,9 +67,9 @@ public class TileTeleposer extends TileInventory implements ITickable public void initiateTeleport() { - if (!worldObj.isRemote && worldObj.getTileEntity(pos) != null && worldObj.getTileEntity(pos) instanceof TileTeleposer && canInitiateTeleport((TileTeleposer) worldObj.getTileEntity(pos)) && worldObj.getBlockState(pos).getBlock() instanceof BlockTeleposer) + if (!getWorld().isRemote && getWorld().getTileEntity(pos) != null && getWorld().getTileEntity(pos) instanceof TileTeleposer && canInitiateTeleport((TileTeleposer) getWorld().getTileEntity(pos)) && getWorld().getBlockState(pos).getBlock() instanceof BlockTeleposer) { - TileTeleposer teleposer = (TileTeleposer) worldObj.getTileEntity(pos); + TileTeleposer teleposer = (TileTeleposer) getWorld().getTileEntity(pos); ItemStack focusStack = NBTHelper.checkNBT(teleposer.getStackInSlot(0)); ItemTelepositionFocus focus = (ItemTelepositionFocus) focusStack.getItem(); BlockPos focusPos = focus.getBlockPos(teleposer.getStackInSlot(0)); @@ -90,7 +90,7 @@ public class TileTeleposer extends TileInventory implements ITickable { for (int k = -(focusLevel - 1); k <= (focusLevel - 1); k++) { - TeleposeEvent event = new TeleposeEvent(worldObj, pos.add(i, 1 + j, k), focusWorld, focusPos.add(i, 1 + j, k)); + TeleposeEvent event = new TeleposeEvent(getWorld(), pos.add(i, 1 + j, k), focusWorld, focusPos.add(i, 1 + j, k)); if (Utils.swapLocations(event.initalWorld, event.initialBlockPos, event.finalWorld, event.finalBlockPos) && !MinecraftForge.EVENT_BUS.post(event)) { blocksTransported++; @@ -104,11 +104,11 @@ public class TileTeleposer extends TileInventory implements ITickable List originalWorldEntities; List focusWorldEntities; AxisAlignedBB originalArea = new AxisAlignedBB(pos.getX(), pos.getY() + 1, pos.getZ(), pos.getX() + 1, Math.min(focusWorld.getHeight(), pos.getY() + 2 * focusLevel), pos.getZ() + 1).expand(focusLevel - 1, 0, focusLevel - 1); - originalWorldEntities = worldObj.getEntitiesWithinAABB(Entity.class, originalArea); + originalWorldEntities = getWorld().getEntitiesWithinAABB(Entity.class, originalArea); AxisAlignedBB focusArea = new AxisAlignedBB(focusPos.getX(), focusPos.getY() + 1, focusPos.getZ(), focusPos.getX() + 1, Math.min(focusWorld.getHeight(), focusPos.getY() + 2 * focusLevel), focusPos.getZ() + 1).expand(focusLevel - 1, 0, focusLevel - 1); focusWorldEntities = focusWorld.getEntitiesWithinAABB(Entity.class, focusArea); - if (focusWorld.equals(worldObj)) + if (focusWorld.equals(getWorld())) { if (!originalWorldEntities.isEmpty()) { @@ -131,7 +131,7 @@ public class TileTeleposer extends TileInventory implements ITickable { for (Entity entity : originalWorldEntities) { - TeleportQueue.getInstance().addITeleport(new Teleports.TeleportToDim(new BlockPos(entity.posX - pos.getX() + focusPos.getX(), entity.posY - pos.getY() + focusPos.getY(), entity.posZ - pos.getZ() + focusPos.getZ()), entity, focusStack.getTagCompound().getString(Constants.NBT.OWNER_UUID), worldObj, focusWorld.provider.getDimension(), true)); + TeleportQueue.getInstance().addITeleport(new Teleports.TeleportToDim(new BlockPos(entity.posX - pos.getX() + focusPos.getX(), entity.posY - pos.getY() + focusPos.getY(), entity.posZ - pos.getZ() + focusPos.getZ()), entity, focusStack.getTagCompound().getString(Constants.NBT.OWNER_UUID), getWorld(), focusWorld.provider.getDimension(), true)); } } @@ -139,7 +139,7 @@ public class TileTeleposer extends TileInventory implements ITickable { for (Entity entity : focusWorldEntities) { - TeleportQueue.getInstance().addITeleport(new Teleports.TeleportToDim(new BlockPos(entity.posX - pos.getX() + focusPos.getX(), entity.posY - pos.getY() + focusPos.getY(), entity.posZ - pos.getZ() + focusPos.getZ()), entity, focusStack.getTagCompound().getString(Constants.NBT.OWNER_UUID), focusWorld, worldObj.provider.getDimension(), true)); + TeleportQueue.getInstance().addITeleport(new Teleports.TeleportToDim(new BlockPos(entity.posX - pos.getX() + focusPos.getX(), entity.posY - pos.getY() + focusPos.getY(), entity.posZ - pos.getZ() + focusPos.getZ()), entity, focusStack.getTagCompound().getString(Constants.NBT.OWNER_UUID), focusWorld, getWorld().provider.getDimension(), true)); } } } diff --git a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerAlchemyTable.java b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerAlchemyTable.java index 79e2923d..de59b054 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerAlchemyTable.java +++ b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerAlchemyTable.java @@ -116,7 +116,7 @@ public class ContainerAlchemyTable extends Container @Override public boolean canInteractWith(EntityPlayer playerIn) { - return this.tileTable.isUseableByPlayer(playerIn); + return this.tileTable.isUsableByPlayer(playerIn); } private class SlotOrb extends Slot diff --git a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerItemRoutingNode.java b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerItemRoutingNode.java index 84135207..4fc75f5c 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerItemRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerItemRoutingNode.java @@ -178,7 +178,7 @@ public class ContainerItemRoutingNode extends Container @Override public boolean canInteractWith(EntityPlayer playerIn) { - return this.tileItemRoutingNode.isUseableByPlayer(playerIn); + return this.tileItemRoutingNode.isUsableByPlayer(playerIn); } private class SlotItemFilter extends Slot diff --git a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerMasterRoutingNode.java b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerMasterRoutingNode.java index 77121ecf..64cd4de9 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerMasterRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerMasterRoutingNode.java @@ -18,6 +18,6 @@ public class ContainerMasterRoutingNode extends Container @Override public boolean canInteractWith(EntityPlayer playerIn) { - return this.tileMasterRoutingNode.isUseableByPlayer(playerIn); + return this.tileMasterRoutingNode.isUsableByPlayer(playerIn); } } diff --git a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerSoulForge.java b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerSoulForge.java index 85497373..1e9e0553 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerSoulForge.java +++ b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerSoulForge.java @@ -96,7 +96,7 @@ public class ContainerSoulForge extends Container @Override public boolean canInteractWith(EntityPlayer playerIn) { - return this.tileForge.isUseableByPlayer(playerIn); + return this.tileForge.isUsableByPlayer(playerIn); } private class SlotSoul extends Slot diff --git a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerTeleposer.java b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerTeleposer.java index 2b3e93eb..2093d7f4 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerTeleposer.java +++ b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerTeleposer.java @@ -79,7 +79,7 @@ public class ContainerTeleposer extends Container @Override public boolean canInteractWith(EntityPlayer playerIn) { - return this.tileTeleposer.isUseableByPlayer(playerIn); + return this.tileTeleposer.isUsableByPlayer(playerIn); } private class SlotTeleposer extends Slot diff --git a/src/main/java/WayofTime/bloodmagic/tile/routing/TileFilteredRoutingNode.java b/src/main/java/WayofTime/bloodmagic/tile/routing/TileFilteredRoutingNode.java index a6ae7453..e67690ba 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/routing/TileFilteredRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/tile/routing/TileFilteredRoutingNode.java @@ -126,14 +126,14 @@ public class TileFilteredRoutingNode extends TileRoutingNode implements ISidedIn public void incrementCurrentPriotiryToMaximum(int max) { priorities[currentActiveSlot] = Math.min(priorities[currentActiveSlot] + 1, max); - IBlockState state = worldObj.getBlockState(pos); - worldObj.notifyBlockUpdate(pos, state, state, 3); + IBlockState state = getWorld().getBlockState(pos); + getWorld().notifyBlockUpdate(pos, state, state, 3); } public void decrementCurrentPriority() { priorities[currentActiveSlot] = Math.max(priorities[currentActiveSlot] - 1, 0); - IBlockState state = worldObj.getBlockState(pos); - worldObj.notifyBlockUpdate(pos, state, state, 3); + IBlockState state = getWorld().getBlockState(pos); + getWorld().notifyBlockUpdate(pos, state, state, 3); } } diff --git a/src/main/java/WayofTime/bloodmagic/tile/routing/TileInputRoutingNode.java b/src/main/java/WayofTime/bloodmagic/tile/routing/TileInputRoutingNode.java index 69897264..009709e2 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/routing/TileInputRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/tile/routing/TileInputRoutingNode.java @@ -31,7 +31,7 @@ public class TileInputRoutingNode extends TileFilteredRoutingNode implements IIn @Override public IItemFilter getInputFilterForSide(EnumFacing side) { - TileEntity tile = worldObj.getTileEntity(pos.offset(side)); + TileEntity tile = getWorld().getTileEntity(pos.offset(side)); if (tile != null) { IItemHandler handler = Utils.getInventory(tile, side.getOpposite()); @@ -66,7 +66,7 @@ public class TileInputRoutingNode extends TileFilteredRoutingNode implements IIn @Override public IFluidFilter getInputFluidFilterForSide(EnumFacing side) { - TileEntity tile = worldObj.getTileEntity(pos.offset(side)); + TileEntity tile = getWorld().getTileEntity(pos.offset(side)); if (tile != null && tile.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, side)) { IFluidHandler handler = tile.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, side); diff --git a/src/main/java/WayofTime/bloodmagic/tile/routing/TileMasterRoutingNode.java b/src/main/java/WayofTime/bloodmagic/tile/routing/TileMasterRoutingNode.java index 944987c4..2344057c 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/routing/TileMasterRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/tile/routing/TileMasterRoutingNode.java @@ -48,15 +48,15 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti @Override public void update() { - if (!worldObj.isRemote) + if (!getWorld().isRemote) { -// currentInput = worldObj.isBlockIndirectlyGettingPowered(pos); - currentInput = worldObj.getStrongPower(pos); +// currentInput = getWorld().isBlockIndirectlyGettingPowered(pos); + currentInput = getWorld().getStrongPower(pos); // System.out.println(currentInput); } - if (worldObj.isRemote || worldObj.getTotalWorldTime() % tickRate != 0) //Temporary tick rate solver + if (getWorld().isRemote || getWorld().getTotalWorldTime() % tickRate != 0) //Temporary tick rate solver { return; } @@ -66,7 +66,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti for (BlockPos outputPos : outputNodeList) { - TileEntity outputTile = worldObj.getTileEntity(outputPos); + TileEntity outputTile = getWorld().getTileEntity(outputPos); if (this.isConnected(new LinkedList(), outputPos)) { if (outputTile instanceof IOutputItemRoutingNode) @@ -132,7 +132,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti for (BlockPos inputPos : inputNodeList) { - TileEntity inputTile = worldObj.getTileEntity(inputPos); + TileEntity inputTile = getWorld().getTileEntity(inputPos); if (this.isConnected(new LinkedList(), inputPos)) { if (inputTile instanceof IInputItemRoutingNode) @@ -193,7 +193,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti } } - int maxTransfer = this.getMaxTransferForDemonWill(WorldDemonWillHandler.getCurrentWill(worldObj, pos, EnumDemonWillType.DEFAULT)); + int maxTransfer = this.getMaxTransferForDemonWill(WorldDemonWillHandler.getCurrentWill(getWorld(), pos, EnumDemonWillType.DEFAULT)); int maxFluidTransfer = 1000; for (Entry> outputEntry : outputMap.entrySet()) @@ -319,7 +319,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti // { // return false; // } - TileEntity tile = worldObj.getTileEntity(nodePos); + TileEntity tile = getWorld().getTileEntity(nodePos); if (!(tile instanceof IRoutingNode)) { // connectionMap.remove(nodePos); @@ -342,7 +342,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti // path.clear(); // path.addAll(testPath); return true; - } else if (NodeHelper.isNodeConnectionEnabled(worldObj, node, testPos)) + } else if (NodeHelper.isNodeConnectionEnabled(getWorld(), node, testPos)) { if (isConnected(path, testPos)) { @@ -489,7 +489,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti while (itr.hasNext()) { BlockPos testPos = itr.next(); - TileEntity tile = worldObj.getTileEntity(testPos); + TileEntity tile = getWorld().getTileEntity(testPos); if (tile instanceof IRoutingNode) { ((IRoutingNode) tile).removeConnection(pos); diff --git a/src/main/java/WayofTime/bloodmagic/tile/routing/TileOutputRoutingNode.java b/src/main/java/WayofTime/bloodmagic/tile/routing/TileOutputRoutingNode.java index 051041ff..bdbc8bcf 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/routing/TileOutputRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/tile/routing/TileOutputRoutingNode.java @@ -31,7 +31,7 @@ public class TileOutputRoutingNode extends TileFilteredRoutingNode implements IO @Override public IItemFilter getOutputFilterForSide(EnumFacing side) { - TileEntity tile = worldObj.getTileEntity(pos.offset(side)); + TileEntity tile = getWorld().getTileEntity(pos.offset(side)); if (tile != null) { IItemHandler handler = Utils.getInventory(tile, side.getOpposite()); @@ -66,7 +66,7 @@ public class TileOutputRoutingNode extends TileFilteredRoutingNode implements IO @Override public IFluidFilter getOutputFluidFilterForSide(EnumFacing side) { - TileEntity tile = worldObj.getTileEntity(pos.offset(side)); + TileEntity tile = getWorld().getTileEntity(pos.offset(side)); if (tile != null && tile.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, side)) { IFluidHandler handler = tile.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, side); diff --git a/src/main/java/WayofTime/bloodmagic/tile/routing/TileRoutingNode.java b/src/main/java/WayofTime/bloodmagic/tile/routing/TileRoutingNode.java index 2dfadd98..ac00e276 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/routing/TileRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/tile/routing/TileRoutingNode.java @@ -30,10 +30,10 @@ public class TileRoutingNode extends TileInventory implements IRoutingNode, IIte @Override public void update() { - if (!worldObj.isRemote) + if (!getWorld().isRemote) { - currentInput = worldObj.isBlockIndirectlyGettingPowered(pos); -// currentInput = worldObj.getStrongPower(pos); + currentInput = getWorld().isBlockIndirectlyGettingPowered(pos); +// currentInput = getWorld().getStrongPower(pos); } } @@ -83,14 +83,14 @@ public class TileRoutingNode extends TileInventory implements IRoutingNode, IIte @Override public void removeAllConnections() { - TileEntity testTile = worldObj.getTileEntity(getMasterPos()); + TileEntity testTile = getWorld().getTileEntity(getMasterPos()); if (testTile instanceof IMasterRoutingNode) { ((IMasterRoutingNode) testTile).removeConnection(pos); // Remove this node from the master } for (BlockPos testPos : connectionList) { - TileEntity tile = worldObj.getTileEntity(testPos); + TileEntity tile = getWorld().getTileEntity(testPos); if (tile instanceof IRoutingNode) { ((IRoutingNode) tile).removeConnection(pos); diff --git a/src/main/java/WayofTime/bloodmagic/util/ChatUtil.java b/src/main/java/WayofTime/bloodmagic/util/ChatUtil.java index d3b022e4..100d5b30 100644 --- a/src/main/java/WayofTime/bloodmagic/util/ChatUtil.java +++ b/src/main/java/WayofTime/bloodmagic/util/ChatUtil.java @@ -110,7 +110,7 @@ public class ChatUtil { for (ITextComponent c : lines) { - player.addChatComponentMessage(c); + player.sendMessage(c); } } diff --git a/src/main/java/WayofTime/bloodmagic/util/Utils.java b/src/main/java/WayofTime/bloodmagic/util/Utils.java index 57154001..4dece72e 100644 --- a/src/main/java/WayofTime/bloodmagic/util/Utils.java +++ b/src/main/java/WayofTime/bloodmagic/util/Utils.java @@ -25,7 +25,6 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; -import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; @@ -33,7 +32,6 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; @@ -86,32 +84,6 @@ public class Utils return added; } - public static Item getItem(ResourceLocation resource) - { - return Item.REGISTRY.getObject(resource); - } - - public static Block getBlock(ResourceLocation resource) - { - return Block.REGISTRY.getObject(resource); - } - - public static ResourceLocation getResourceForItem(ItemStack stack) - { - if (stack != null) - { - if (stack.getItem() instanceof ItemBlock) - { - return Block.REGISTRY.getNameForObject(((ItemBlock) stack.getItem()).getBlock()); - } else - { - return Item.REGISTRY.getNameForObject(stack.getItem()); - } - } - - return null; - } - public static boolean isImmuneToFireDamage(EntityLivingBase entity) { return entity.isImmuneToFire() || entity.isPotionActive(MobEffects.FIRE_RESISTANCE); @@ -119,7 +91,7 @@ public class Utils public static boolean isPlayerBesideSolidBlockFace(EntityPlayer player) { - World world = player.worldObj; + World world = player.getEntityWorld(); double minimumDistanceFromAxis = 0.7; BlockPos centralPos = player.getPosition(); for (EnumFacing facing : EnumFacing.HORIZONTALS) @@ -151,7 +123,7 @@ public class Utils continue; } - if (stack.getItem() instanceof IDemonWillViewer && ((IDemonWillViewer) stack.getItem()).canSeeDemonWillAura(player.worldObj, stack, player)) + if (stack.getItem() instanceof IDemonWillViewer && ((IDemonWillViewer) stack.getItem()).canSeeDemonWillAura(player.getEntityWorld(), stack, player)) { return true; } @@ -250,7 +222,7 @@ public class Utils return 0; } - World world = itemEntity.worldObj; + World world = itemEntity.getEntityWorld(); BlockPos pos = itemEntity.getPosition(); ItemStack stack = itemEntity.getEntityItem(); @@ -275,9 +247,9 @@ public class Utils continue; } - if (stack.getItem() instanceof IDemonWillViewer && ((IDemonWillViewer) stack.getItem()).canSeeDemonWillAura(player.worldObj, stack, player)) + if (stack.getItem() instanceof IDemonWillViewer && ((IDemonWillViewer) stack.getItem()).canSeeDemonWillAura(player.getEntityWorld(), stack, player)) { - return ((IDemonWillViewer) stack.getItem()).getDemonWillAuraResolution(player.worldObj, stack, player); + return ((IDemonWillViewer) stack.getItem()).getDemonWillAuraResolution(player.getEntityWorld(), stack, player); } } @@ -300,7 +272,7 @@ public class Utils public static void setPlayerSpeedFromServer(EntityPlayer player, double motionX, double motionY, double motionZ) { - if (!player.worldObj.isRemote && player instanceof EntityPlayerMP) + if (!player.getEntityWorld().isRemote && player instanceof EntityPlayerMP) { BloodMagicPacketHandler.sendTo(new PlayerVelocityPacketProcessor(motionX, motionY, motionZ), (EntityPlayerMP) player); } @@ -375,7 +347,7 @@ public class Utils if (!tile.getWorld().isRemote) { EntityItem invItem = new EntityItem(tile.getWorld(), player.posX, player.posY + 0.25, player.posZ, tile.getStackInSlot(slot)); - tile.getWorld().spawnEntityInWorld(invItem); + tile.getWorld().spawnEntity(invItem); } tile.clear(); return false; @@ -1050,7 +1022,7 @@ public class Utils } entityItem.setEntityItemStack(stack); - return world.spawnEntityInWorld(entityItem); + return world.spawnEntity(entityItem); } public static boolean swapLocations(World initialWorld, BlockPos initialPos, World finalWorld, BlockPos finalPos) @@ -1098,7 +1070,7 @@ public class Utils finalWorld.setTileEntity(finalPos, newTileInitial); newTileInitial.setPos(finalPos); - newTileInitial.setWorldObj(finalWorld); + newTileInitial.setWorld(finalWorld); } initialWorld.setBlockState(initialPos, finalBlockState, 3); @@ -1109,7 +1081,7 @@ public class Utils initialWorld.setTileEntity(initialPos, newTileFinal); newTileFinal.setPos(initialPos); - newTileFinal.setWorldObj(initialWorld); + newTileFinal.setWorld(initialWorld); } initialWorld.notifyNeighborsOfStateChange(initialPos, finalStack.getBlock()); diff --git a/src/main/java/WayofTime/bloodmagic/util/handler/event/ClientHandler.java b/src/main/java/WayofTime/bloodmagic/util/handler/event/ClientHandler.java index eeead4a8..822a6753 100644 --- a/src/main/java/WayofTime/bloodmagic/util/handler/event/ClientHandler.java +++ b/src/main/java/WayofTime/bloodmagic/util/handler/event/ClientHandler.java @@ -121,7 +121,7 @@ public class ClientHandler @SubscribeEvent public void onSoundEvent(PlaySoundEvent event) { - EntityPlayer player = Minecraft.getMinecraft().thePlayer; + EntityPlayer player = Minecraft.getMinecraft().player; if (player != null && player.isPotionActive(ModPotions.deafness)) { event.setResultSound(null); @@ -152,8 +152,8 @@ public class ClientHandler @SubscribeEvent public void render(RenderWorldLastEvent event) { - EntityPlayerSP player = minecraft.thePlayer; - World world = player.worldObj; + EntityPlayerSP player = minecraft.player; + World world = player.getEntityWorld(); if (mrsHoloTile != null) { @@ -181,7 +181,7 @@ public class ClientHandler @SubscribeEvent public void onMouseEvent(MouseEvent event) { - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + EntityPlayerSP player = Minecraft.getMinecraft().player; if (event.getDwheel() != 0 && player != null && player.isSneaking()) { @@ -311,7 +311,7 @@ public class ClientHandler BloodMagicPacketHandler.INSTANCE.sendToServer(new SigilHoldingPacketProcessor(player.inventory.currentItem, mode)); ItemStack newStack = ItemSigilHolding.getItemStackInSlot(stack, ItemSigilHolding.getCurrentItemOrdinal(stack)); if (newStack != null) - Minecraft.getMinecraft().ingameGUI.setRecordPlaying(newStack.getDisplayName(), false); + Minecraft.getMinecraft().ingameGUI.setOverlayMessage(newStack.getDisplayName(), false); } private static TextureAtlasSprite forName(TextureMap textureMap, String name, String dir) @@ -321,7 +321,7 @@ public class ClientHandler private void renderRitualStones(EntityPlayerSP player, float partialTicks) { - World world = player.worldObj; + World world = player.getEntityWorld(); ItemRitualDiviner ritualDiviner = (ItemRitualDiviner) player.inventory.getCurrentItem().getItem(); EnumFacing direction = ritualDiviner.getDirection(player.inventory.getCurrentItem()); Ritual ritual = RitualRegistry.getRitualForId(ritualDiviner.getCurrentRitual(player.inventory.getCurrentItem())); @@ -385,8 +385,8 @@ public class ClientHandler public static void renderRitualStones(TileMasterRitualStone masterRitualStone, float partialTicks) { - EntityPlayerSP player = minecraft.thePlayer; - World world = player.worldObj; + EntityPlayerSP player = minecraft.player; + World world = player.getEntityWorld(); EnumFacing direction = mrsHoloDirection; Ritual ritual = mrsHoloRitual; diff --git a/src/main/java/WayofTime/bloodmagic/util/handler/event/GenericHandler.java b/src/main/java/WayofTime/bloodmagic/util/handler/event/GenericHandler.java index 2d269a0b..a6dc5a00 100644 --- a/src/main/java/WayofTime/bloodmagic/util/handler/event/GenericHandler.java +++ b/src/main/java/WayofTime/bloodmagic/util/handler/event/GenericHandler.java @@ -101,7 +101,7 @@ public class GenericHandler { event.setDamageMultiplier(0); - if (player.worldObj.isRemote) + if (player.getEntityWorld().isRemote) { player.motionY *= -0.9; player.fallDistance = 0; @@ -197,7 +197,7 @@ public class GenericHandler @SubscribeEvent public void onEntityHurt(LivingHurtEvent event) { - if (event.getEntity().worldObj.isRemote) + if (event.getEntity().getEntityWorld().isRemote) return; if (event.getSource().getEntity() instanceof EntityPlayer && !PlayerHelper.isFakePlayer((EntityPlayer) event.getSource().getEntity())) @@ -240,7 +240,7 @@ public class GenericHandler @SubscribeEvent public void onLivingUpdate(LivingUpdateEvent event) { - if (!event.getEntityLiving().worldObj.isRemote) + if (!event.getEntityLiving().getEntityWorld().isRemote) { EntityLivingBase entity = event.getEntityLiving(); if (entity instanceof EntityPlayer && entity.ticksExisted % 50 == 0) //TODO: Change to an incremental counter @@ -265,7 +265,7 @@ public class GenericHandler if (animal.getAttackTarget() != null && animal.getDistanceSqToEntity(animal.getAttackTarget()) < 4) { - animal.worldObj.createExplosion(null, animal.posX, animal.posY + (double) (animal.height / 16.0F), animal.posZ, 2 + animal.getActivePotionEffect(ModPotions.sacrificialLamb).getAmplifier() * 1.5f, false); + animal.getEntityWorld().createExplosion(null, animal.posX, animal.posY + (double) (animal.height / 16.0F), animal.posZ, 2 + animal.getActivePotionEffect(ModPotions.sacrificialLamb).getAmplifier() * 1.5f, false); targetTaskMap.remove(animal); attackTaskMap.remove(animal); } @@ -284,7 +284,7 @@ public class GenericHandler EntityPlayer player = (EntityPlayer) entity; if (player.isSneaking() && player.isPotionActive(ModPotions.cling) && Utils.isPlayerBesideSolidBlockFace(player) && !player.onGround) { - if (player.worldObj.isRemote) + if (player.getEntityWorld().isRemote) { player.motionY = 0; player.motionX *= 0.8; @@ -307,14 +307,14 @@ public class GenericHandler if (entity.isPotionActive(ModPotions.fireFuse)) { - entity.worldObj.spawnParticle(EnumParticleTypes.FLAME, entity.posX + entity.worldObj.rand.nextDouble() * 0.3, entity.posY + entity.worldObj.rand.nextDouble() * 0.3, entity.posZ + entity.worldObj.rand.nextDouble() * 0.3, 0, 0.06d, 0); + entity.getEntityWorld().spawnParticle(EnumParticleTypes.FLAME, entity.posX + entity.getEntityWorld().rand.nextDouble() * 0.3, entity.posY + entity.getEntityWorld().rand.nextDouble() * 0.3, entity.posZ + entity.getEntityWorld().rand.nextDouble() * 0.3, 0, 0.06d, 0); int r = entity.getActivePotionEffect(ModPotions.fireFuse).getAmplifier(); int radius = 1 * r + 1; if (entity.getActivePotionEffect(ModPotions.fireFuse).getDuration() <= 3) { - entity.worldObj.createExplosion(null, entity.posX, entity.posY, entity.posZ, radius, false); + entity.getEntityWorld().createExplosion(null, entity.posX, entity.posY, entity.posZ, radius, false); } } @@ -335,7 +335,7 @@ public class GenericHandler if (player instanceof EntityPlayerMP) { BlockPos pos = player.getPosition(); - DemonWillHolder holder = WorldDemonWillHandler.getWillHolder(player.worldObj.provider.getDimension(), pos.getX() >> 4, pos.getZ() >> 4); + DemonWillHolder holder = WorldDemonWillHandler.getWillHolder(player.getEntityWorld().provider.getDimension(), pos.getX() >> 4, pos.getZ() >> 4); if (holder != null) { BloodMagicPacketHandler.sendTo(new DemonAuraPacketProcessor(holder), (EntityPlayerMP) player); @@ -469,7 +469,7 @@ public class GenericHandler if (heldStack != null && heldStack.getItem() == ModItems.BOUND_SWORD && !(attackedEntity instanceof EntityAnimal)) for (int i = 0; i <= EnchantmentHelper.getLootingModifier(player); i++) if (attackedEntity.getEntityWorld().rand.nextDouble() < 0.2) - event.getDrops().add(new EntityItem(attackedEntity.worldObj, attackedEntity.posX, attackedEntity.posY, attackedEntity.posZ, new ItemStack(ModItems.BLOOD_SHARD, 1, 0))); + event.getDrops().add(new EntityItem(attackedEntity.getEntityWorld(), attackedEntity.posX, attackedEntity.posY, attackedEntity.posZ, new ItemStack(ModItems.BLOOD_SHARD, 1, 0))); } } @@ -487,7 +487,7 @@ public class GenericHandler itemstack.setItemDamage(itemstack.getItemDamage() - i); } - if (!player.worldObj.isRemote) + if (!player.getEntityWorld().isRemote) { for (ItemStack stack : player.inventory.mainInventory) { diff --git a/src/main/java/WayofTime/bloodmagic/util/handler/event/LivingArmourHandler.java b/src/main/java/WayofTime/bloodmagic/util/handler/event/LivingArmourHandler.java index 727e3f75..a4ef11d1 100644 --- a/src/main/java/WayofTime/bloodmagic/util/handler/event/LivingArmourHandler.java +++ b/src/main/java/WayofTime/bloodmagic/util/handler/event/LivingArmourHandler.java @@ -308,7 +308,7 @@ public class LivingArmourHandler @SubscribeEvent public void onArrowFire(ArrowLooseEvent event) { - World world = event.getEntityPlayer().worldObj; + World world = event.getEntityPlayer().getEntityWorld(); ItemStack stack = event.getBow(); EntityPlayer player = event.getEntityPlayer(); @@ -368,7 +368,7 @@ public class LivingArmourHandler entityarrow.pickupStatus = EntityArrow.PickupStatus.CREATIVE_ONLY; - world.spawnEntityInWorld(entityarrow); + world.spawnEntity(entityarrow); } } } diff --git a/src/main/java/WayofTime/bloodmagic/util/handler/event/StatTrackerHandler.java b/src/main/java/WayofTime/bloodmagic/util/handler/event/StatTrackerHandler.java index 7089d682..c8909436 100644 --- a/src/main/java/WayofTime/bloodmagic/util/handler/event/StatTrackerHandler.java +++ b/src/main/java/WayofTime/bloodmagic/util/handler/event/StatTrackerHandler.java @@ -87,7 +87,7 @@ public class StatTrackerHandler if (armour != null) { StatTrackerHealthboost.incrementCounter(armour, event.getAmount()); - if (player.worldObj.canSeeSky(player.getPosition()) && player.worldObj.provider.isDaytime()) + if (player.getEntityWorld().canSeeSky(player.getPosition()) && player.getEntityWorld().provider.isDaytime()) { StatTrackerSolarPowered.incrementCounter(armour, event.getAmount()); } @@ -162,7 +162,7 @@ public class StatTrackerHandler { StatTrackerMeleeDamage.incrementCounter(armour, amount); - if (player.worldObj.getLight(player.getPosition()) <= 9) + if (player.getEntityWorld().getLight(player.getPosition()) <= 9) StatTrackerNightSight.incrementCounter(armour, amount); if (mainWeapon != null && mainWeapon.getItem() instanceof ItemSpade) diff --git a/src/main/java/WayofTime/bloodmagic/util/handler/event/WillHandler.java b/src/main/java/WayofTime/bloodmagic/util/handler/event/WillHandler.java index 0192e3a6..93dbaa99 100644 --- a/src/main/java/WayofTime/bloodmagic/util/handler/event/WillHandler.java +++ b/src/main/java/WayofTime/bloodmagic/util/handler/event/WillHandler.java @@ -84,21 +84,21 @@ public class WillHandler DamageSource source = event.getSource(); Entity entity = source.getEntity(); - if (attackedEntity.isPotionActive(ModPotions.soulSnare) && (attackedEntity instanceof EntityMob || attackedEntity.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL)) + if (attackedEntity.isPotionActive(ModPotions.soulSnare) && (attackedEntity instanceof EntityMob || attackedEntity.getEntityWorld().getDifficulty() == EnumDifficulty.PEACEFUL)) { PotionEffect eff = attackedEntity.getActivePotionEffect(ModPotions.soulSnare); int lvl = eff.getAmplifier(); double amountOfSouls = attackedEntity.getEntityWorld().rand.nextDouble() * (lvl + 1) * (lvl + 1) * 5; ItemStack soulStack = ((IDemonWill) ModItems.MONSTER_SOUL).createWill(0, amountOfSouls); - event.getDrops().add(new EntityItem(attackedEntity.worldObj, attackedEntity.posX, attackedEntity.posY, attackedEntity.posZ, soulStack)); + event.getDrops().add(new EntityItem(attackedEntity.getEntityWorld(), attackedEntity.posX, attackedEntity.posY, attackedEntity.posZ, soulStack)); } if (entity != null && entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entity; ItemStack heldStack = player.getHeldItemMainhand(); - if (heldStack != null && heldStack.getItem() instanceof IDemonWillWeapon && !player.worldObj.isRemote) + if (heldStack != null && heldStack.getItem() instanceof IDemonWillWeapon && !player.getEntityWorld().isRemote) { IDemonWillWeapon demonWillWeapon = (IDemonWillWeapon) heldStack.getItem(); List droppedSouls = demonWillWeapon.getRandomDemonWillDrop(attackedEntity, player, heldStack, event.getLootingLevel()); @@ -114,7 +114,7 @@ public class WillHandler EnumDemonWillType pickupType = ((IDemonWill) remainder.getItem()).getType(remainder); if (((IDemonWill) remainder.getItem()).getWill(pickupType, remainder) >= 0.0001) { - event.getDrops().add(new EntityItem(attackedEntity.worldObj, attackedEntity.posX, attackedEntity.posY, attackedEntity.posZ, remainder)); + event.getDrops().add(new EntityItem(attackedEntity.getEntityWorld(), attackedEntity.posX, attackedEntity.posY, attackedEntity.posZ, remainder)); } } }