From befbb4552268e5916e8ea422d9d1e6460ed8893e Mon Sep 17 00:00:00 2001 From: RainWarrior Date: Tue, 8 Mar 2016 23:33:28 +0300 Subject: [PATCH] Most of ItemInWorldManager reject, various small error fixes. --- .../network/NetHandlerPlayClient.java.patch | 10 +- .../entity/EntityLivingBase.java.patch | 2 +- .../entity/player/EntityPlayerMP.java.patch | 2 +- .../net/minecraft/item/Item.java.patch | 6 +- .../PlayerInteractionManager.java.patch | 213 ++++++++++++++++++ .../ItemInWorldManager.java.patch.rej | 205 ----------------- .../net/minecraftforge/common/ForgeHooks.java | 10 +- .../common/WorldSpecificSaveHandler.java | 2 +- .../common/chunkio/QueuedChunk.java | 2 +- .../common/util/BlockSnapshot.java | 4 +- src/main/resources/forge_at.cfg | 2 +- 11 files changed, 233 insertions(+), 225 deletions(-) create mode 100644 patches.mcp/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch diff --git a/patches.mcp/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch b/patches.mcp/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch index 211b26c4ca..fcb57fff8a 100644 --- a/patches.mcp/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch @@ -13,7 +13,7 @@ public void handleChat(SPacketChat packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); -+ net.minecraft.util.IChatComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(packetIn.getType(), packetIn.getChatComponent()); ++ net.minecraft.util.text.ITextComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(packetIn.getType(), packetIn.getChatComponent()); + if (message == null) return; if (packetIn.getType() == 2) @@ -40,17 +40,17 @@ EntityTracker.func_187254_a(entitylivingbase, d0, d1, d2); entitylivingbase.renderYawOffset = entitylivingbase.rotationYawHead = (float)(packetIn.getHeadPitch() * 360) / 256.0F; Entity[] aentity = entitylivingbase.getParts(); -@@ -1082,6 +1089,10 @@ +@@ -1179,6 +1186,10 @@ { - entityplayer.openContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e()); + tileentity.readFromNBT(packetIn.getNbtCompound()); } + else + { + tileentity.onDataPacket(netManager, packetIn); + } - } - } + if (flag && this.gameController.currentScreen instanceof GuiCommandBlock) + { @@ -1378,7 +1389,7 @@ if (entity instanceof EntityLivingBase) diff --git a/patches.mcp/minecraft/net/minecraft/entity/EntityLivingBase.java.patch b/patches.mcp/minecraft/net/minecraft/entity/EntityLivingBase.java.patch index 6db21f1932..2bb4e0964a 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/EntityLivingBase.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/EntityLivingBase.java.patch @@ -132,7 +132,7 @@ public void func_184609_a(EnumHand p_184609_1_) { -+ ItemStack stack = this.getHeldItem(); ++ ItemStack stack = this.func_184586_b(p_184609_1_); + if (stack != null && stack.getItem() != null) + { + if (stack.getItem().onEntitySwing(this, stack)) return; diff --git a/patches.mcp/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch b/patches.mcp/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch index 4e12cfdae6..08230f74aa 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch @@ -60,7 +60,7 @@ public Entity func_184204_a(int p_184204_1_) { -+ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_184204_1_)) return; ++ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_184204_1_)) return this; this.field_184851_cj = true; if (this.dimension == 1 && p_184204_1_ == 1) diff --git a/patches.mcp/minecraft/net/minecraft/item/Item.java.patch b/patches.mcp/minecraft/net/minecraft/item/Item.java.patch index 4b6c4ddc57..8077e84545 100644 --- a/patches.mcp/minecraft/net/minecraft/item/Item.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/Item.java.patch @@ -360,7 +360,7 @@ + * @param type The subtype, can be null or "overlay" + * @return Path of texture to bind, or null to use default + */ -+ public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) ++ public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) + { + return null; + } @@ -383,12 +383,12 @@ + * + * @param entityLiving The entity wearing the armor + * @param itemStack The itemStack to render the model of -+ * @param armorSlot 0=head, 1=torso, 2=legs, 3=feet ++ * @param armorSlot The slot the armor is in + * @param _default Original armor model. Will have attributes set. + * @return A ModelBiped to render instead of the default + */ + @SideOnly(Side.CLIENT) -+ public net.minecraft.client.model.ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot, net.minecraft.client.model.ModelBiped _default) ++ public net.minecraft.client.model.ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, net.minecraft.client.model.ModelBiped _default) + { + return null; + } diff --git a/patches.mcp/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch b/patches.mcp/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch new file mode 100644 index 0000000000..3111f6a970 --- /dev/null +++ b/patches.mcp/minecraft/net/minecraft/server/management/PlayerInteractionManager.java.patch @@ -0,0 +1,213 @@ +--- ../src-base/minecraft/net/minecraft/server/management/PlayerInteractionManager.java ++++ ../src-work/minecraft/net/minecraft/server/management/PlayerInteractionManager.java +@@ -27,6 +27,8 @@ + + public class PlayerInteractionManager + { ++ /** Forge reach distance */ ++ private double blockReachDistance = 5.0d; + public World theWorld; + public EntityPlayerMP thisPlayerMP; + private WorldSettings.GameType gameType = WorldSettings.GameType.NOT_SET; +@@ -88,7 +90,7 @@ + IBlockState iblockstate = this.theWorld.getBlockState(this.field_180241_i); + Block block = iblockstate.getBlock(); + +- if (iblockstate.func_185904_a() == Material.air) ++ if (block.isAir(iblockstate, theWorld, field_180241_i)) + { + this.receivedFinishDiggingPacket = false; + } +@@ -115,7 +117,7 @@ + IBlockState iblockstate1 = this.theWorld.getBlockState(this.field_180240_f); + Block block1 = iblockstate1.getBlock(); + +- if (iblockstate1.func_185904_a() == Material.air) ++ if (block1.isAir(iblockstate1, theWorld, field_180240_f)) + { + this.theWorld.sendBlockBreakProgress(this.thisPlayerMP.getEntityId(), this.field_180240_f, -1); + this.durabilityRemainingOnBlock = -1; +@@ -124,7 +126,7 @@ + else + { + int k = this.curblockDamage - this.initialDamage; +- float f1 = iblockstate1.func_185903_a(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.field_180241_i) * (float)(k + 1); ++ float f1 = iblockstate1.func_185903_a(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.field_180240_f) * (float)(k + 1); // Forge: Fix network break progress using wrong position + int l = (int)(f1 * 10.0F); + + if (l != this.durabilityRemainingOnBlock) +@@ -138,6 +140,14 @@ + + public void onBlockClicked(BlockPos pos, EnumFacing side) + { ++ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thisPlayerMP, ++ net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.LEFT_CLICK_BLOCK, theWorld, pos, side, net.minecraftforge.common.ForgeHooks.rayTraceEyeHitVec(thisPlayerMP, getBlockReachDistance() + 1)); ++ if (event.isCanceled()) ++ { ++ thisPlayerMP.playerNetServerHandler.sendPacket(new SPacketBlockChange(theWorld, pos)); ++ return; ++ } ++ + if (this.isCreative()) + { + if (!this.theWorld.extinguishFire((EntityPlayer)null, pos, side)) +@@ -173,17 +183,32 @@ + } + } + +- this.theWorld.extinguishFire((EntityPlayer)null, pos, side); + this.initialDamage = this.curblockDamage; + float f = 1.0F; + +- if (iblockstate.func_185904_a() != Material.air) ++ if (!iblockstate.getBlock().isAir(iblockstate, theWorld, pos)) + { +- block.onBlockClicked(this.theWorld, pos, this.thisPlayerMP); ++ if (event.useBlock != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) ++ { ++ block.onBlockClicked(this.theWorld, pos, this.thisPlayerMP); ++ this.theWorld.extinguishFire((EntityPlayer)null, pos, side); ++ } ++ else ++ { ++ thisPlayerMP.playerNetServerHandler.sendPacket(new SPacketBlockChange(theWorld, pos)); ++ } + f = iblockstate.func_185903_a(this.thisPlayerMP, this.thisPlayerMP.worldObj, pos); + } ++ if (event.useItem == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) ++ { ++ if (f >= 1.0F) ++ { ++ thisPlayerMP.playerNetServerHandler.sendPacket(new SPacketBlockChange(theWorld, pos)); ++ } ++ return; ++ } + +- if (iblockstate.func_185904_a() != Material.air && f >= 1.0F) ++ if (iblockstate.getBlock().isAir(iblockstate, theWorld, pos) && f >= 1.0F) + { + this.tryHarvestBlock(pos); + } +@@ -205,7 +230,7 @@ + int i = this.curblockDamage - this.initialDamage; + IBlockState iblockstate = this.theWorld.getBlockState(pos); + +- if (iblockstate.func_185904_a() != Material.air) ++ if (iblockstate.getBlock().isAir(iblockstate, theWorld, pos)) + { + float f = iblockstate.func_185903_a(this.thisPlayerMP, this.thisPlayerMP.worldObj, pos) * (float)(i + 1); + +@@ -234,9 +259,14 @@ + + private boolean removeBlock(BlockPos pos) + { ++ return removeBlock(pos, false); ++ } ++ ++ private boolean removeBlock(BlockPos pos, boolean canHarvest) ++ { + IBlockState iblockstate = this.theWorld.getBlockState(pos); + iblockstate.getBlock().onBlockHarvested(this.theWorld, pos, iblockstate, this.thisPlayerMP); +- boolean flag = this.theWorld.setBlockToAir(pos); ++ boolean flag = iblockstate.getBlock().removedByPlayer(iblockstate, theWorld, pos, thisPlayerMP, canHarvest); + + if (flag) + { +@@ -248,7 +278,8 @@ + + public boolean tryHarvestBlock(BlockPos pos) + { +- if (this.gameType.isCreative() && this.thisPlayerMP.func_184614_ca() != null && this.thisPlayerMP.func_184614_ca().getItem() instanceof ItemSword) ++ int exp = net.minecraftforge.common.ForgeHooks.onBlockBreakEvent(theWorld, gameType, thisPlayerMP, pos); ++ if (exp == -1) + { + return false; + } +@@ -264,41 +295,22 @@ + } + else + { +- if (this.gameType.isAdventure()) +- { +- if (this.gameType == WorldSettings.GameType.SPECTATOR) +- { +- return false; +- } ++ ItemStack stack = thisPlayerMP.func_184614_ca(); ++ if (stack != null && stack.getItem().onBlockStartBreak(stack, pos, thisPlayerMP)) return false; + +- if (!this.thisPlayerMP.isAllowEdit()) +- { +- ItemStack itemstack = this.thisPlayerMP.func_184614_ca(); +- +- if (itemstack == null) +- { +- return false; +- } +- +- if (!itemstack.canDestroy(iblockstate.getBlock())) +- { +- return false; +- } +- } +- } +- + this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, pos, Block.getStateId(iblockstate)); +- boolean flag1 = this.removeBlock(pos); ++ boolean flag1 = false; + + if (this.isCreative()) + { ++ flag1 = this.removeBlock(pos); + this.thisPlayerMP.playerNetServerHandler.sendPacket(new SPacketBlockChange(this.theWorld, pos)); + } + else + { + ItemStack itemstack1 = this.thisPlayerMP.func_184614_ca(); + ItemStack itemstack2 = itemstack1 == null ? null : itemstack1.copy(); +- boolean flag = this.thisPlayerMP.func_184823_b(iblockstate); ++ boolean flag = iblockstate.getBlock().canHarvestBlock(theWorld, pos, thisPlayerMP); + + if (itemstack1 != null) + { +@@ -310,12 +322,18 @@ + } + } + ++ flag1 = this.removeBlock(pos, flag); + if (flag1 && flag) + { + iblockstate.getBlock().harvestBlock(this.theWorld, this.thisPlayerMP, pos, iblockstate, tileentity, itemstack2); + } + } + ++ // Drop experience ++ if (!this.isCreative() && flag1 && exp > 0) ++ { ++ iblockstate.getBlock().dropXpOnBlockBreak(theWorld, pos, exp); ++ } + return flag1; + } + } +@@ -359,6 +377,7 @@ + if (itemstack.stackSize == 0) + { + p_187250_1_.func_184611_a(p_187250_4_, (ItemStack)null); ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_187250_1_, itemstack, p_187250_4_); + } + + if (!p_187250_1_.func_184587_cr()) +@@ -445,4 +464,13 @@ + { + this.theWorld = serverWorld; + } ++ ++ public double getBlockReachDistance() ++ { ++ return blockReachDistance; ++ } ++ public void setBlockReachDistance(double distance) ++ { ++ blockReachDistance = distance; ++ } + } diff --git a/rejects/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch.rej b/rejects/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch.rej index 58d956d21c..a9f9605b4b 100644 --- a/rejects/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch.rej +++ b/rejects/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch.rej @@ -1,193 +1,3 @@ -++++ REJECTED PATCH 1 - - public class ItemInWorldManager - { -+ /** Forge reach distance */ -+ private double blockReachDistance = 5.0d; - public World theWorld; - public EntityPlayerMP thisPlayerMP; - private WorldSettings.GameType gameType = WorldSettings.GameType.NOT_SET; -++++ END PATCH -++++ REJECTED PATCH 2 - else - { - int k = this.curblockDamage - this.initialDamage; -- float f1 = block1.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.field_180241_i) * (float)(k + 1); -+ float f1 = block1.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.field_180240_f) * (float)(k + 1); //Forge: Fix network break progress using wrong position - int l = (int)(f1 * 10.0F); - - if (l != this.durabilityRemainingOnBlock) -++++ END PATCH -++++ REJECTED PATCH 3 - - public void onBlockClicked(BlockPos pos, EnumFacing side) - { -+ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thisPlayerMP, -+ net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.LEFT_CLICK_BLOCK, theWorld, pos, side, net.minecraftforge.common.ForgeHooks.rayTraceEyeHitVec(thisPlayerMP, getBlockReachDistance() + 1)); -+ if (event.isCanceled()) -+ { -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); -+ return; -+ } -+ - if (this.isCreative()) - { - if (!this.theWorld.extinguishFire((EntityPlayer)null, pos, side)) -++++ END PATCH -++++ REJECTED PATCH 4 - } - } - -- this.theWorld.extinguishFire((EntityPlayer)null, pos, side); -+ // - this.initialDamage = this.curblockDamage; - float f = 1.0F; - -- if (block.getMaterial() != Material.air) -+ if (!block.isAir(theWorld, pos)) - { -- block.onBlockClicked(this.theWorld, pos, this.thisPlayerMP); -+ if (event.useBlock != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) -+ { -+ block.onBlockClicked(this.theWorld, pos, this.thisPlayerMP); -+ this.theWorld.extinguishFire((EntityPlayer)null, pos, side); -+ } -+ else -+ { -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); -+ } - f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, pos); - } - -- if (block.getMaterial() != Material.air && f >= 1.0F) -+ if (event.useItem == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) - { -+ if (f >= 1.0F) -+ { -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); -+ } -+ return; -+ } -+ -+ if (!block.isAir(theWorld, pos) && f >= 1.0F) -+ { - this.tryHarvestBlock(pos); - } - else -++++ END PATCH -++++ REJECTED PATCH 5 - int i = this.curblockDamage - this.initialDamage; - Block block = this.theWorld.getBlockState(pos).getBlock(); - -- if (block.getMaterial() != Material.air) -+ if (!block.isAir(theWorld, pos)) - { - float f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, pos) * (float)(i + 1); - -++++ END PATCH -++++ REJECTED PATCH 6 - - private boolean removeBlock(BlockPos pos) - { -+ return removeBlock(pos, false); -+ } -+ private boolean removeBlock(BlockPos pos, boolean canHarvest) -+ { - IBlockState iblockstate = this.theWorld.getBlockState(pos); - iblockstate.getBlock().onBlockHarvested(this.theWorld, pos, iblockstate, this.thisPlayerMP); -- boolean flag = this.theWorld.setBlockToAir(pos); -+ boolean flag = iblockstate.getBlock().removedByPlayer(theWorld, pos, thisPlayerMP, canHarvest); - - if (flag) - { -++++ END PATCH -++++ REJECTED PATCH 7 - - public boolean tryHarvestBlock(BlockPos pos) - { -- if (this.gameType.isCreative() && this.thisPlayerMP.getHeldItem() != null && this.thisPlayerMP.getHeldItem().getItem() instanceof ItemSword) -+ int exp = net.minecraftforge.common.ForgeHooks.onBlockBreakEvent(theWorld, gameType, thisPlayerMP, pos); -+ if (exp == -1) - { - return false; - } -++++ END PATCH -++++ REJECTED PATCH 8 - IBlockState iblockstate = this.theWorld.getBlockState(pos); - TileEntity tileentity = this.theWorld.getTileEntity(pos); - -- if (this.gameType.isAdventure()) -- { -- if (this.gameType == WorldSettings.GameType.SPECTATOR) -- { -- return false; -- } -+ ItemStack stack = thisPlayerMP.getCurrentEquippedItem(); -+ if (stack != null && stack.getItem().onBlockStartBreak(stack, pos, thisPlayerMP)) return false; - -- if (!this.thisPlayerMP.isAllowEdit()) -- { -- ItemStack itemstack = this.thisPlayerMP.getCurrentEquippedItem(); -- -- if (itemstack == null) -- { -- return false; -- } -- -- if (!itemstack.canDestroy(iblockstate.getBlock())) -- { -- return false; -- } -- } -- } -- - this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, pos, Block.getStateId(iblockstate)); -- boolean flag1 = this.removeBlock(pos); -+ boolean flag1 = false; - - if (this.isCreative()) - { -+ flag1 = this.removeBlock(pos); - this.thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(this.theWorld, pos)); - } - else - { - ItemStack itemstack1 = this.thisPlayerMP.getCurrentEquippedItem(); -- boolean flag = this.thisPlayerMP.canHarvestBlock(iblockstate.getBlock()); -+ boolean flag = iblockstate.getBlock().canHarvestBlock(theWorld, pos, thisPlayerMP); - - if (itemstack1 != null) - { -++++ END PATCH -++++ REJECTED PATCH 9 - } - } - -+ flag1 = this.removeBlock(pos, flag); - if (flag1 && flag) - { - iblockstate.getBlock().harvestBlock(this.theWorld, this.thisPlayerMP, pos, iblockstate, tileentity); - } - } - -+ // Drop experiance -+ if (!this.isCreative() && flag1 && exp > 0) -+ { -+ iblockstate.getBlock().dropXpOnBlockBreak(theWorld, pos, exp); -+ } - return flag1; - } - } -++++ END PATCH -++++ REJECTED PATCH 10 - if (itemstack.stackSize == 0) - { - player.inventory.mainInventory[player.inventory.currentItem] = null; -+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(player, itemstack); - } - - if (!player.isUsingItem()) -++++ END PATCH ++++ REJECTED PATCH 11 } else @@ -259,18 +69,3 @@ } ++++ END PATCH -++++ REJECTED PATCH 12 - { - this.theWorld = serverWorld; - } -+ -+ public double getBlockReachDistance() -+ { -+ return blockReachDistance; -+ } -+ public void setBlockReachDistance(double distance) -+ { -+ blockReachDistance = distance; -+ } - } -++++ END PATCH diff --git a/src/main/java/net/minecraftforge/common/ForgeHooks.java b/src/main/java/net/minecraftforge/common/ForgeHooks.java index 052d76944d..96b81ce95f 100644 --- a/src/main/java/net/minecraftforge/common/ForgeHooks.java +++ b/src/main/java/net/minecraftforge/common/ForgeHooks.java @@ -137,24 +137,24 @@ public class ForgeHooks public static boolean canHarvestBlock(Block block, EntityPlayer player, IBlockAccess world, BlockPos pos) { - if (block.getMaterial().isToolNotRequired()) + IBlockState state = world.getBlockState(pos); + state = state.getBlock().getActualState(state, world, pos); + if (state.func_185904_a().isToolNotRequired()) { return true; } ItemStack stack = player.inventory.getCurrentItem(); - IBlockState state = world.getBlockState(pos); - state = state.getBlock().getActualState(state, world, pos); String tool = block.getHarvestTool(state); if (stack == null || tool == null) { - return player.canHarvestBlock(block); + return player.func_184823_b(state); } int toolLevel = stack.getItem().getHarvestLevel(stack, tool); if (toolLevel < 0) { - return player.canHarvestBlock(block); + return player.func_184823_b(state); } return toolLevel >= block.getHarvestLevel(state); diff --git a/src/main/java/net/minecraftforge/common/WorldSpecificSaveHandler.java b/src/main/java/net/minecraftforge/common/WorldSpecificSaveHandler.java index 50064f3627..1e6044d0a0 100644 --- a/src/main/java/net/minecraftforge/common/WorldSpecificSaveHandler.java +++ b/src/main/java/net/minecraftforge/common/WorldSpecificSaveHandler.java @@ -50,7 +50,7 @@ public class WorldSpecificSaveHandler implements ISaveHandler dataDir.mkdirs(); } File file = new File(dataDir, name + ".dat"); - if (!file.exists() && name.equalsIgnoreCase("FORTRESS") && world.provider.getDimensionId() == -1) //Only copy over the fortress.dat for the vanilla nether. + if (!file.exists() && name.equalsIgnoreCase("FORTRESS") && world.provider.getDimension() == -1) //Only copy over the fortress.dat for the vanilla nether. { File parentFile = parent.getMapFileFromName(name); if (parentFile.exists()) diff --git a/src/main/java/net/minecraftforge/common/chunkio/QueuedChunk.java b/src/main/java/net/minecraftforge/common/chunkio/QueuedChunk.java index f093b996bc..039d75c636 100644 --- a/src/main/java/net/minecraftforge/common/chunkio/QueuedChunk.java +++ b/src/main/java/net/minecraftforge/common/chunkio/QueuedChunk.java @@ -43,7 +43,7 @@ class QueuedChunk { result.append(" z: " + z + NEW_LINE); result.append(" loader: " + loader + NEW_LINE ); result.append(" world: " + world.getWorldInfo().getWorldName() + NEW_LINE); - result.append(" dimension: " + world.provider.getDimensionId() + NEW_LINE); + result.append(" dimension: " + world.provider.getDimension() + NEW_LINE); result.append(" provider: " + world.provider.getClass().getName() + NEW_LINE); result.append("}"); diff --git a/src/main/java/net/minecraftforge/common/util/BlockSnapshot.java b/src/main/java/net/minecraftforge/common/util/BlockSnapshot.java index 60104a0f7e..a3566afab7 100644 --- a/src/main/java/net/minecraftforge/common/util/BlockSnapshot.java +++ b/src/main/java/net/minecraftforge/common/util/BlockSnapshot.java @@ -35,7 +35,7 @@ public class BlockSnapshot implements Serializable public BlockSnapshot(World world, BlockPos pos, IBlockState state) { this.world = world; - this.dimId = world.provider.getDimensionId(); + this.dimId = world.provider.getDimension(); this.pos = pos; this.replacedBlock = state; this.blockIdentifier = GameRegistry.findUniqueIdentifierFor(state.getBlock()); @@ -57,7 +57,7 @@ public class BlockSnapshot implements Serializable public BlockSnapshot(World world, BlockPos pos, IBlockState state, NBTTagCompound nbt) { this.world = world; - this.dimId = world.provider.getDimensionId(); + this.dimId = world.provider.getDimension(); this.pos = pos.getImmutable(); this.replacedBlock = state; this.blockIdentifier = GameRegistry.findUniqueIdentifierFor(state.getBlock()); diff --git a/src/main/resources/forge_at.cfg b/src/main/resources/forge_at.cfg index 3eaa618f68..db03009167 100644 --- a/src/main/resources/forge_at.cfg +++ b/src/main/resources/forge_at.cfg @@ -17,7 +17,7 @@ public net.minecraft.block.Block func_149715_a(F)Lnet.minecraft.block.Block; #se public net.minecraft.block.Block func_149722_s()Lnet.minecraft.block.Block; #setBlockUnbreakable public net.minecraft.block.Block func_149675_a(Z)Lnet.minecraft.block.Block; #setTickRandomly #public net.minecraft.block.Block func_149676_a(FFFFFF)V #setBlockBounds -#public net.minecraft.block.Block func_180637_b(Lnet/minecraft/world/World;Lnet/minecraft/util/BlockPos;I)V # dropXpOnBlockBreak +public net.minecraft.block.Block func_180637_b(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;I)V # dropXpOnBlockBreak # BlockFire public net.minecraft.block.BlockFire func_176532_c(Lnet/minecraft/block/Block;)I # getFireSpreadSpeed public net.minecraft.block.BlockFire func_176534_d(Lnet/minecraft/block/Block;)I # getFireSpreadSpeed