From e68577ffd37e91dc276fdb2933281437e594bbe3 Mon Sep 17 00:00:00 2001 From: Lex Manos Date: Wed, 5 Feb 2014 00:05:37 -0800 Subject: [PATCH] Updated FML: MinecraftForge/FML@03fb1879d72fbd347badc140fed6c2c3191d2990 Fix obf error when right clicking a Empty Map. MinecraftForge/FML@6bb9b8b9532b276450d03a3419e0da016aecead8 Clean up FMLEventChannel. Closes #367. MinecraftForge/FML@b7b3450dcd123ab5df6b3693c9c2123bc3846b88 Update MCP mapping snapshot to latest crowdsourced names. MinecraftForge/FML@8c9e8b52708bd0630303f8b5dc184ab60e2553a1 Fix isRemote, this is integral to so many parts of the code, everyone knows it by this name, People should not change it. --- fml | 2 +- .../net/minecraft/block/Block.java.patch | 171 ++++++------ .../net/minecraft/block/BlockBush.java.patch | 26 +- .../minecraft/block/BlockButton.java.patch | 41 +-- .../minecraft/block/BlockCactus.java.patch | 10 +- .../net/minecraft/block/BlockChest.java.patch | 22 +- .../net/minecraft/block/BlockCocoa.java.patch | 18 +- .../net/minecraft/block/BlockCrops.java.patch | 20 +- .../net/minecraft/block/BlockDoor.java.patch | 4 +- .../block/BlockDoublePlant.java.patch | 10 +- .../minecraft/block/BlockFalling.java.patch | 12 +- .../minecraft/block/BlockFarmland.java.patch | 4 +- .../net/minecraft/block/BlockFire.java.patch | 116 ++++---- .../net/minecraft/block/BlockGrass.java.patch | 24 +- .../net/minecraft/block/BlockIce.java.patch | 8 +- .../minecraft/block/BlockLadder.java.patch | 31 +-- .../minecraft/block/BlockLeaves.java.patch | 26 +- .../net/minecraft/block/BlockLever.java.patch | 47 ++-- .../minecraft/block/BlockLiquid.java.patch | 2 +- .../net/minecraft/block/BlockLog.java.patch | 8 +- .../block/BlockMobSpawner.java.patch | 12 +- .../minecraft/block/BlockMushroom.java.patch | 6 +- .../minecraft/block/BlockMycelium.java.patch | 16 +- .../block/BlockNetherWart.java.patch | 30 +-- .../net/minecraft/block/BlockOre.java.patch | 14 +- .../net/minecraft/block/BlockPane.java.patch | 30 +-- .../block/BlockPistonBase.java.patch | 28 +- .../minecraft/block/BlockPumpkin.java.patch | 12 +- .../minecraft/block/BlockRailBase.java.patch | 30 +-- .../block/BlockRedstoneComparator.java.patch | 4 +- .../block/BlockRedstoneOre.java.patch | 14 +- .../block/BlockRedstoneWire.java.patch | 4 +- .../net/minecraft/block/BlockReed.java.patch | 14 +- .../minecraft/block/BlockSapling.java.patch | 2 +- .../net/minecraft/block/BlockSkull.java.patch | 29 +- .../net/minecraft/block/BlockSnow.java.patch | 55 ++-- .../net/minecraft/block/BlockStem.java.patch | 24 +- .../minecraft/block/BlockTallGrass.java.patch | 20 +- .../net/minecraft/block/BlockTorch.java.patch | 41 +-- .../minecraft/block/BlockTrapDoor.java.patch | 26 +- .../block/BlockTripWireHook.java.patch | 38 +-- .../net/minecraft/block/BlockVine.java.patch | 12 +- .../net/minecraft/client/Minecraft.java.patch | 52 ++-- .../client/audio/SoundManager.java.patch | 10 +- .../client/entity/EntityPlayerSP.java.patch | 4 +- .../minecraft/client/gui/GuiChat.java.patch | 20 +- .../client/gui/GuiCreateWorld.java.patch | 20 +- .../client/gui/GuiMainMenu.java.patch | 6 +- .../minecraft/client/gui/GuiScreen.java.patch | 18 +- .../minecraft/client/gui/GuiSlot.java.patch | 30 +-- .../achievement/GuiAchievements.java.patch | 16 +- .../gui/inventory/GuiContainer.java.patch | 24 +- .../inventory/GuiContainerCreative.java.patch | 132 +++++----- .../mco/GuiScreenCreateOnlineWorld.java.patch | 6 +- .../multiplayer/PlayerControllerMP.java.patch | 18 +- .../client/multiplayer/WorldClient.java.patch | 2 +- .../network/NetHandlerPlayClient.java.patch | 18 +- .../client/particle/EffectRenderer.java.patch | 6 +- .../particle/EntityDiggingFX.java.patch | 6 +- .../client/renderer/EntityRenderer.java.patch | 8 +- .../client/renderer/ItemRenderer.java.patch | 14 +- .../client/renderer/OpenGlHelper.java.patch | 4 +- .../client/renderer/RenderBlocks.java.patch | 88 +++---- .../client/renderer/RenderGlobal.java.patch | 46 ++-- .../client/renderer/Tessellator.java.patch | 71 ++--- .../client/renderer/WorldRenderer.java.patch | 34 +-- .../renderer/entity/RenderBiped.java.patch | 8 +- .../renderer/entity/RenderItem.java.patch | 12 +- .../renderer/entity/RenderManager.java.patch | 4 +- .../renderer/entity/RenderPlayer.java.patch | 8 +- .../renderer/entity/RenderSnowMan.java.patch | 4 +- .../renderer/texture/TextureMap.java.patch | 8 +- .../TileEntityChestRenderer.java.patch | 6 +- .../command/CommandHandler.java.patch | 2 +- .../minecraft/crash/CrashReport.java.patch | 2 +- .../crash/CrashReportCategory.java.patch | 2 +- .../creativetab/CreativeTabs.java.patch | 4 +- .../net/minecraft/entity/Entity.java.patch | 16 +- .../entity/EntityLivingBase.java.patch | 2 +- .../entity/boss/EntityDragon.java.patch | 6 +- .../entity/boss/EntityWither.java.patch | 4 +- .../entity/item/EntityEnderPearl.java.patch | 2 +- .../entity/item/EntityItem.java.patch | 8 +- .../entity/item/EntityMinecart.java.patch | 8 +- .../item/EntityMinecartContainer.java.patch | 2 +- .../entity/monster/EntityZombie.java.patch | 10 +- .../entity/passive/EntityOcelot.java.patch | 4 +- .../entity/passive/EntitySheep.java.patch | 2 +- .../entity/player/EntityPlayer.java.patch | 92 +++---- .../entity/player/EntityPlayerMP.java.patch | 6 +- .../entity/player/InventoryPlayer.java.patch | 4 +- .../inventory/ContainerEnchantment.java.patch | 14 +- .../inventory/ContainerPlayer.java.patch | 2 +- .../net/minecraft/item/Item.java.patch | 24 +- .../net/minecraft/item/ItemBlock.java.patch | 22 +- .../net/minecraft/item/ItemBow.java.patch | 4 +- .../net/minecraft/item/ItemDye.java.patch | 4 +- .../item/ItemFlintAndSteel.java.patch | 6 +- .../net/minecraft/item/ItemHoe.java.patch | 8 +- .../net/minecraft/item/ItemRecord.java.patch | 6 +- .../minecraft/item/ItemSeedFood.java.patch | 6 +- .../net/minecraft/item/ItemSeeds.java.patch | 6 +- .../net/minecraft/item/ItemShears.java.patch | 16 +- .../net/minecraft/item/ItemStack.java.patch | 2 +- .../item/crafting/FurnaceRecipes.java.patch | 2 +- .../network/NetHandlerPlayServer.java.patch | 120 ++++----- .../play/server/S21PacketChunkData.java.patch | 8 +- .../server/S26PacketMapChunkBulk.java.patch | 6 +- .../server/MinecraftServer.java.patch | 8 +- .../management/ItemInWorldManager.java.patch | 54 ++-- .../management/PlayerManager.java.patch | 36 +-- .../ServerConfigurationManager.java.patch | 22 +- .../net/minecraft/stats/StatList.java.patch | 20 +- .../tileentity/TileEntity.java.patch | 16 +- .../tileentity/TileEntityBeacon.java.patch | 6 +- .../TileEntityBrewingStand.java.patch | 34 +-- .../tileentity/TileEntityFurnace.java.patch | 34 +-- .../tileentity/TileEntityHopper.java.patch | 2 +- .../net/minecraft/util/Session.java.patch | 4 +- .../net/minecraft/world/ChunkCache.java.patch | 16 +- .../net/minecraft/world/Explosion.java.patch | 10 +- .../minecraft/world/IBlockAccess.java.patch | 8 +- .../minecraft/world/SpawnerAnimals.java.patch | 6 +- .../net/minecraft/world/World.java.patch | 248 +++++++++--------- .../minecraft/world/WorldServer.java.patch | 36 +-- .../net/minecraft/world/WorldType.java.patch | 6 +- .../world/biome/BiomeDecorator.java.patch | 2 +- .../world/biome/BiomeGenBase.java.patch | 20 +- .../minecraft/world/chunk/Chunk.java.patch | 140 +++++----- .../world/gen/ChunkProviderEnd.java.patch | 4 +- .../gen/ChunkProviderGenerate.java.patch | 6 +- .../world/gen/ChunkProviderHell.java.patch | 4 +- .../world/gen/ChunkProviderServer.java.patch | 2 +- .../feature/WorldGenAbstractTree.java.patch | 2 +- .../feature/WorldGenBigMushroom.java.patch | 14 +- .../gen/feature/WorldGenBigTree.java.patch | 8 +- .../gen/feature/WorldGenCanopyTree.java.patch | 20 +- .../gen/feature/WorldGenDeadBush.java.patch | 4 +- .../gen/feature/WorldGenDungeons.java.patch | 4 +- .../gen/feature/WorldGenForest.java.patch | 16 +- .../gen/feature/WorldGenHugeTrees.java.patch | 26 +- .../gen/feature/WorldGenMegaJungle.java.patch | 24 +- .../feature/WorldGenMegaPineTree.java.patch | 30 +-- .../gen/feature/WorldGenMinable.java.patch | 8 +- .../feature/WorldGenSavannaTree.java.patch | 22 +- .../gen/feature/WorldGenShrub.java.patch | 12 +- .../gen/feature/WorldGenSwamp.java.patch | 38 +-- .../gen/feature/WorldGenTaiga1.java.patch | 16 +- .../gen/feature/WorldGenTaiga2.java.patch | 18 +- .../gen/feature/WorldGenTallGrass.java.patch | 4 +- .../gen/feature/WorldGenTrees.java.patch | 40 +-- .../WorldGeneratorBonusChest.java.patch | 4 +- .../world/gen/layer/GenLayer.java.patch | 4 +- ...ComponentScatteredFeaturePieces.java.patch | 10 +- .../gen/structure/MapGenStronghold.java.patch | 4 +- .../StructureStrongholdPieces.java.patch | 10 +- .../StructureVillagePieces.java.patch | 6 +- src/main/java/ibxm/Channel.java | 1 - src/main/java/ibxm/Envelope.java | 1 - src/main/java/ibxm/FastTracker2.java | 1 - src/main/java/ibxm/IBXM.java | 1 - src/main/java/ibxm/ScreamTracker3.java | 1 - .../client/ClientCommandHandler.java | 10 +- .../client/ForgeHooksClient.java | 28 +- .../minecraftforge/client/GuiIngameForge.java | 38 +-- .../client/model/techne/TechneModel.java | 1 - .../common/BiomeDictionary.java | 16 +- .../minecraftforge/common/ChestGenHooks.java | 1 - .../common/DimensionManager.java | 4 +- .../common/ForgeChunkManager.java | 10 +- .../net/minecraftforge/common/ForgeHooks.java | 30 +-- .../common/WorldSpecificSaveHandler.java | 1 - .../common/config/Configuration.java | 1 - .../common/util/FakePlayer.java | 2 +- .../minecraftforge/event/ServerChatEvent.java | 2 +- .../terraingen/DeferredBiomeDecorator.java | 4 +- .../event/world/BlockEvent.java | 2 +- .../minecraftforge/fluids/BlockFluidBase.java | 95 ++++--- .../fluids/BlockFluidClassic.java | 48 ++-- .../fluids/BlockFluidFinite.java | 78 +++--- .../fluids/FluidContainerRegistry.java | 1 - .../minecraftforge/fluids/FluidRegistry.java | 4 +- .../net/minecraftforge/fluids/FluidTank.java | 6 +- .../fluids/RenderBlockFluid.java | 46 ++-- .../fluids/TileFluidHandler.java | 8 +- .../server/ForgeTimeTracker.java | 2 - .../server/command/ForgeCommand.java | 8 +- .../paulscode/sound/codecs/CodecIBXM.java | 2 - 188 files changed, 1869 insertions(+), 1870 deletions(-) diff --git a/fml b/fml index cee0f0b811..8c9e8b5270 160000 --- a/fml +++ b/fml @@ -1 +1 @@ -Subproject commit cee0f0b81179d307059843f08401f8700fb3ddb2 +Subproject commit 8c9e8b52708bd0630303f8b5dc184ab60e2553a1 diff --git a/patches/minecraft/net/minecraft/block/Block.java.patch b/patches/minecraft/net/minecraft/block/Block.java.patch index 5498b07264..a836418b81 100644 --- a/patches/minecraft/net/minecraft/block/Block.java.patch +++ b/patches/minecraft/net/minecraft/block/Block.java.patch @@ -53,74 +53,74 @@ public class Block { -@@ -110,7 +131,8 @@ +@@ -132,7 +153,8 @@ - public static Block func_149729_e(int p_149729_0_) + public static Block getBlockById(int p_149729_0_) { -- return (Block)field_149771_c.func_148754_a(p_149729_0_); -+ Block ret = (Block)field_149771_c.func_148754_a(p_149729_0_); +- return (Block)blockRegistry.getObjectById(p_149729_0_); ++ Block ret = (Block)blockRegistry.getObjectById(p_149729_0_); + return ret == null ? Blocks.air : ret; } - public static Block func_149634_a(Item p_149634_0_) -@@ -481,9 +503,10 @@ - return this.field_149789_z; + public static Block getBlockFromItem(Item p_149634_0_) +@@ -517,9 +539,10 @@ + return this.needsRandomTick; } + @Deprecated //Forge: New Metadata sensitive version. - public boolean func_149716_u() + public boolean hasTileEntity() { -- return this.field_149758_A; +- return this.isBlockContainer; + return hasTileEntity(0); } - public final void func_149676_a(float p_149676_1_, float p_149676_2_, float p_149676_3_, float p_149676_4_, float p_149676_5_, float p_149676_6_) -@@ -500,13 +523,13 @@ - public int func_149677_c(IBlockAccess p_149677_1_, int p_149677_2_, int p_149677_3_, int p_149677_4_) + // JAVADOC METHOD $$ func_149676_a +@@ -538,13 +561,13 @@ + public int getMixedBrightnessForBlock(IBlockAccess p_149677_1_, int p_149677_2_, int p_149677_3_, int p_149677_4_) { - Block block = p_149677_1_.func_147439_a(p_149677_2_, p_149677_3_, p_149677_4_); -- int l = p_149677_1_.getLightBrightnessForSkyBlocks(p_149677_2_, p_149677_3_, p_149677_4_, block.func_149750_m()); + Block block = p_149677_1_.getBlock(p_149677_2_, p_149677_3_, p_149677_4_); +- int l = p_149677_1_.getLightBrightnessForSkyBlocks(p_149677_2_, p_149677_3_, p_149677_4_, block.getLightValue()); + int l = p_149677_1_.getLightBrightnessForSkyBlocks(p_149677_2_, p_149677_3_, p_149677_4_, block.getLightValue(p_149677_1_, p_149677_2_, p_149677_3_, p_149677_4_)); if (l == 0 && block instanceof BlockSlab) { --p_149677_3_; - block = p_149677_1_.func_147439_a(p_149677_2_, p_149677_3_, p_149677_4_); -- return p_149677_1_.getLightBrightnessForSkyBlocks(p_149677_2_, p_149677_3_, p_149677_4_, block.func_149750_m()); + block = p_149677_1_.getBlock(p_149677_2_, p_149677_3_, p_149677_4_); +- return p_149677_1_.getLightBrightnessForSkyBlocks(p_149677_2_, p_149677_3_, p_149677_4_, block.getLightValue()); + return p_149677_1_.getLightBrightnessForSkyBlocks(p_149677_2_, p_149677_3_, p_149677_4_, block.getLightValue(p_149677_1_, p_149677_2_, p_149677_3_, p_149677_4_)); } else { -@@ -595,7 +618,13 @@ +@@ -649,7 +672,13 @@ + // JAVADOC METHOD $$ func_149726_b + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) {} - public void func_149726_b(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) {} - -- public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {} -+ public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) +- public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {} ++ public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) + { + if (hasTileEntity(p_149749_6_) && !(this instanceof BlockContainer)) + { -+ p_149749_1_.func_147475_p(p_149749_2_, p_149749_3_, p_149749_4_); ++ p_149749_1_.removeTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + } + } - public int func_149745_a(Random p_149745_1_) + // JAVADOC METHOD $$ func_149745_a + public int quantityDropped(Random p_149745_1_) +@@ -665,8 +694,7 @@ + // JAVADOC METHOD $$ func_149737_a + public float getPlayerRelativeBlockHardness(EntityPlayer p_149737_1_, World p_149737_2_, int p_149737_3_, int p_149737_4_, int p_149737_5_) { -@@ -609,8 +638,7 @@ - - public float func_149737_a(EntityPlayer p_149737_1_, World p_149737_2_, int p_149737_3_, int p_149737_4_, int p_149737_5_) - { -- float f = this.func_149712_f(p_149737_2_, p_149737_3_, p_149737_4_, p_149737_5_); -- return f < 0.0F ? 0.0F : (!p_149737_1_.func_146099_a(this) ? p_149737_1_.func_146096_a(this, false) / f / 100.0F : p_149737_1_.func_146096_a(this, true) / f / 30.0F); +- float f = this.getBlockHardness(p_149737_2_, p_149737_3_, p_149737_4_, p_149737_5_); +- return f < 0.0F ? 0.0F : (!p_149737_1_.canHarvestBlock(this) ? p_149737_1_.getCurrentPlayerStrVsBlock(this, false) / f / 100.0F : p_149737_1_.getCurrentPlayerStrVsBlock(this, true) / f / 30.0F); + return ForgeHooks.blockStrength(this, p_149737_1_, p_149737_2_, p_149737_3_, p_149737_4_, p_149737_5_); } - public final void func_149697_b(World p_149697_1_, int p_149697_2_, int p_149697_3_, int p_149697_4_, int p_149697_5_, int p_149697_6_) -@@ -622,18 +650,14 @@ + // JAVADOC METHOD $$ func_149697_b +@@ -680,18 +708,14 @@ { if (!p_149690_1_.isRemote) { -- int j1 = this.func_149679_a(p_149690_7_, p_149690_1_.rand); +- int j1 = this.quantityDroppedWithBonus(p_149690_7_, p_149690_1_.rand); + ArrayList items = getDrops(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_7_); + p_149690_6_ = ForgeEventFactory.fireBlockHarvesting(items, p_149690_1_, this, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_7_, p_149690_6_, false, harvesters.get()); @@ -129,65 +129,66 @@ { if (p_149690_1_.rand.nextFloat() <= p_149690_6_) { -- Item item = this.func_149650_a(p_149690_5_, p_149690_1_.rand, p_149690_7_); +- Item item = this.getItemDropped(p_149690_5_, p_149690_1_.rand, p_149690_7_); - - if (item != null) - { -- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(item, 1, this.func_149692_a(p_149690_5_))); +- this.dropBlockAsItem(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(item, 1, this.damageDropped(p_149690_5_))); - } -+ this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, item); ++ this.dropBlockAsItem(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, item); } } } -@@ -827,7 +851,7 @@ - - public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) +@@ -897,7 +921,7 @@ + // JAVADOC METHOD $$ func_149742_c + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).field_149764_J.isReplaceable(); -+ return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).isReplaceable(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); +- return p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_).blockMaterial.isReplaceable(); ++ return p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_).isReplaceable(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); } - public boolean func_149727_a(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) -@@ -920,25 +944,35 @@ - p_149636_2_.addStat(StatList.mineBlockStatArray[func_149682_b(this)], 1); + // JAVADOC METHOD $$ func_149727_a +@@ -1008,26 +1032,36 @@ + p_149636_2_.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1); p_149636_2_.addExhaustion(0.025F); -- if (this.func_149700_E() && EnchantmentHelper.getSilkTouchModifier(p_149636_2_)) +- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(p_149636_2_)) + if (this.canSilkHarvest(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_) && EnchantmentHelper.getSilkTouchModifier(p_149636_2_)) { + ArrayList items = new ArrayList(); - ItemStack itemstack = this.func_149644_j(p_149636_6_); + ItemStack itemstack = this.createStackedBlock(p_149636_6_); if (itemstack != null) { -- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, itemstack); +- this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, itemstack); + items.add(itemstack); } + + ForgeEventFactory.fireBlockHarvesting(items, p_149636_1_, this, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, 0, 1.0f, true, p_149636_2_); + for (ItemStack is : items) + { -+ this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, is); ++ this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, is); + } } else { + harvesters.set(p_149636_2_); int i1 = EnchantmentHelper.getFortuneModifier(p_149636_2_); - this.func_149697_b(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, i1); + this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, i1); + harvesters.set(null); } } - protected boolean func_149700_E() + // JAVADOC METHOD $$ func_149700_E + protected boolean canSilkHarvest() { -- return this.func_149686_d() && !this.field_149758_A; +- return this.renderAsNormalBlock() && !this.isBlockContainer; + Integer meta = silk_check_meta.get(); -+ return this.func_149686_d() && !this.hasTileEntity(meta == null ? 0 : meta); ++ return this.renderAsNormalBlock() && !this.hasTileEntity(meta == null ? 0 : meta); } - protected ItemStack func_149644_j(int p_149644_1_) -@@ -1114,6 +1148,1065 @@ + // JAVADOC METHOD $$ func_149644_j +@@ -1228,6 +1262,1065 @@ return null; } @@ -205,12 +206,12 @@ + */ + public int getLightValue(IBlockAccess world, int x, int y, int z) + { -+ Block block = world.func_147439_a(x, y, z); ++ Block block = world.getBlock(x, y, z); + if (block != this) + { + return block.getLightValue(world, x, y, z); + } -+ return func_149750_m(); ++ return getLightValue(); + } + + /** @@ -241,7 +242,7 @@ + */ + public boolean isNormalCube(IBlockAccess world, int x, int y, int z) + { -+ return func_149688_o().isOpaque() && func_149686_d() && !func_149744_f(); ++ return getMaterial().isOpaque() && renderAsNormalBlock() && !canProvidePower(); + } + + /** @@ -298,7 +299,7 @@ + */ + public boolean isReplaceable(IBlockAccess world, int x, int y, int z) + { -+ return field_149764_J.isReplaceable(); ++ return blockMaterial.isReplaceable(); + } + + /** @@ -330,7 +331,7 @@ + */ + public boolean isAir(IBlockAccess world, int x, int y, int z) + { -+ return func_149688_o() == Material.field_151579_a; ++ return getMaterial() == Material.air; + } + + /** @@ -365,7 +366,7 @@ + */ + public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) + { -+ return world.func_147468_f(x, y, z); ++ return world.setBlockToAir(x, y, z); + } + + /** @@ -470,7 +471,7 @@ + { + if (isTileProvider) + { -+ return ((ITileEntityProvider)this).func_149915_a(world, metadata); ++ return ((ITileEntityProvider)this).createNewTileEntity(world, metadata); + } + return null; + } @@ -486,7 +487,7 @@ + */ + public int quantityDropped(int meta, int fortune, Random random) + { -+ return func_149679_a(fortune, random); ++ return quantityDroppedWithBonus(fortune, random); + } + + /** @@ -507,10 +508,10 @@ + int count = quantityDropped(metadata, fortune, world.rand); + for(int i = 0; i < count; i++) + { -+ Item item = func_149650_a(metadata, world.rand, fortune); ++ Item item = getItemDropped(metadata, world.rand, fortune); + if (item != null) + { -+ ret.add(new ItemStack(item, 1, func_149692_a(metadata))); ++ ret.add(new ItemStack(item, 1, damageDropped(metadata))); + } + } + return ret; @@ -530,7 +531,7 @@ + public boolean canSilkHarvest(World world, EntityPlayer player, int x, int y, int z, int metadata) + { + silk_check_meta.set(metadata);; -+ boolean ret = this.func_149700_E(); ++ boolean ret = this.canSilkHarvest(); + silk_check_meta.set(null); + return ret; + } @@ -623,7 +624,7 @@ + */ + public int getBedDirection(IBlockAccess world, int x, int y, int z) + { -+ return BlockBed.func_149895_l(world.getBlockMetadata(x, y, z)); ++ return BlockBed.getDirection(world.getBlockMetadata(x, y, z)); + } + + /** @@ -637,7 +638,7 @@ + */ + public boolean isBedFoot(IBlockAccess world, int x, int y, int z) + { -+ return BlockBed.func_149975_b(world.getBlockMetadata(x, y, z)); ++ return BlockBed.isBlockHeadOfBed(world.getBlockMetadata(x, y, z)); + } + + /** @@ -675,7 +676,7 @@ + */ + public boolean isLeaves(IBlockAccess world, int x, int y, int z) + { -+ return func_149688_o() == Material.field_151584_j; ++ return getMaterial() == Material.leaves; + } + + /** @@ -736,7 +737,7 @@ + */ + public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) + { -+ return func_149638_a(par1Entity); ++ return getExplosionResistance(par1Entity); + } + + /** @@ -752,8 +753,8 @@ + */ + public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) + { -+ world.func_147468_f(x, y, z); -+ func_149723_a(world, x, y, z, explosion); ++ world.setBlockToAir(x, y, z); ++ onBlockDestroyedByExplosion(world, x, y, z, explosion); + } + + /** @@ -776,7 +777,7 @@ + */ + public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) + { -+ return func_149744_f() && side != -1; ++ return canProvidePower() && side != -1; + } + + /** @@ -809,7 +810,7 @@ + */ + public boolean canRenderInPass(int pass) + { -+ return pass == func_149701_w(); ++ return pass == getRenderBlockPass(); + } + + /** @@ -820,15 +821,15 @@ + */ + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) + { -+ Item item = func_149694_d(world, x, y, z); ++ Item item = getItem(world, x, y, z); + + if (item == null) + { + return null; + } + -+ Block block = item instanceof ItemBlock && !func_149648_K() ? Block.func_149634_a(item) : this; -+ return new ItemStack(item, 1, block.func_149643_k(world, x, y, z)); ++ Block block = item instanceof ItemBlock && !isFlowerPot() ? Block.getBlockFromItem(item) : this; ++ return new ItemStack(item, 1, block.getDamageValue(world, x, y, z)); + } + + /** @@ -913,7 +914,7 @@ + return true; + } + -+ if (plantable instanceof BlockBush && ((BlockBush)plantable).func_149854_a(this)) ++ if (plantable instanceof BlockBush && ((BlockBush)plantable).canPlaceBlockOn(this)) + { + return true; + } @@ -925,13 +926,13 @@ + case Crop: return this == Blocks.farmland; + case Cave: return isSideSolid(world, x, y, z, UP); + case Plains: return this == Blocks.grass || this == Blocks.dirt; -+ case Water: return world.func_147439_a(x, y, z).func_149688_o() == Material.field_151586_h && world.getBlockMetadata(x, y, z) == 0; ++ case Water: return world.getBlock(x, y, z).getMaterial() == Material.water && world.getBlockMetadata(x, y, z) == 0; + case Beach: + boolean isBeach = this == Blocks.grass || this == Blocks.dirt || this == Blocks.sand; -+ boolean hasWater = (world.func_147439_a(x - 1, y, z ).func_149688_o() == Material.field_151586_h || -+ world.func_147439_a(x + 1, y, z ).func_149688_o() == Material.field_151586_h || -+ world.func_147439_a(x, y, z - 1).func_149688_o() == Material.field_151586_h || -+ world.func_147439_a(x, y, z + 1).func_149688_o() == Material.field_151586_h); ++ boolean hasWater = (world.getBlock(x - 1, y, z ).getMaterial() == Material.water || ++ world.getBlock(x + 1, y, z ).getMaterial() == Material.water || ++ world.getBlock(x, y, z - 1).getMaterial() == Material.water || ++ world.getBlock(x, y, z + 1).getMaterial() == Material.water); + return isBeach && hasWater; + } + @@ -959,7 +960,7 @@ + { + if (this == Blocks.grass || this == Blocks.farmland) + { -+ world.func_147465_d(x, y, z, Blocks.dirt, 0, 2); ++ world.setBlock(x, y, z, Blocks.dirt, 0, 2); + } + } + @@ -1000,7 +1001,7 @@ + */ + public int getLightOpacity(IBlockAccess world, int x, int y, int z) + { -+ return func_149717_k(); ++ return getLightOpacity(); + } + + /** @@ -1150,7 +1151,7 @@ + */ + public boolean shouldCheckWeakPower(IBlockAccess world, int x, int y, int z, int side) + { -+ return func_149721_r(); ++ return isNormalCube(); + } + + /** @@ -1252,4 +1253,4 @@ + public static class SoundType { - public final String field_150501_a; + public final String soundName; diff --git a/patches/minecraft/net/minecraft/block/BlockBush.java.patch b/patches/minecraft/net/minecraft/block/BlockBush.java.patch index 44c76036b5..77c6902b97 100644 --- a/patches/minecraft/net/minecraft/block/BlockBush.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockBush.java.patch @@ -15,25 +15,25 @@ { private static final String __OBFID = "CL_00000208"; -@@ -27,7 +32,7 @@ - - public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) +@@ -28,7 +33,7 @@ + // JAVADOC METHOD $$ func_149742_c + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.func_149854_a(p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_)); -+ return super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.func_149718_j(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); +- return super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.canPlaceBlockOn(p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_)); ++ return super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.canBlockStay(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); } - protected boolean func_149854_a(Block p_149854_1_) -@@ -57,7 +62,7 @@ - - public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) + // JAVADOC METHOD $$ func_149854_a +@@ -63,7 +68,7 @@ + // JAVADOC METHOD $$ func_149718_j + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { -- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_)); -+ return p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_).canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this); +- return this.canPlaceBlockOn(p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_)); ++ return p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_).canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this); } - public AxisAlignedBB func_149668_a(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) -@@ -79,4 +84,37 @@ + // JAVADOC METHOD $$ func_149668_a +@@ -89,4 +94,37 @@ { return 1; } diff --git a/patches/minecraft/net/minecraft/block/BlockButton.java.patch b/patches/minecraft/net/minecraft/block/BlockButton.java.patch index 0d0518b52c..2968826c47 100644 --- a/patches/minecraft/net/minecraft/block/BlockButton.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockButton.java.patch @@ -10,11 +10,11 @@ public abstract class BlockButton extends Block { private final boolean field_150047_a; -@@ -49,12 +52,19 @@ - - public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) +@@ -54,13 +57,20 @@ + // JAVADOC METHOD $$ func_149707_d + public boolean canPlaceBlockOnSide(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) { -- return p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r())); +- return p_149707_5_ == 2 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ + 1).isNormalCube() ? true : (p_149707_5_ == 3 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ - 1).isNormalCube() ? true : (p_149707_5_ == 4 && p_149707_1_.getBlock(p_149707_2_ + 1, p_149707_3_, p_149707_4_).isNormalCube() ? true : p_149707_5_ == 5 && p_149707_1_.getBlock(p_149707_2_ - 1, p_149707_3_, p_149707_4_).isNormalCube())); + ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_); + return (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) || + (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) || @@ -22,47 +22,48 @@ + (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST)); } - public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + // JAVADOC METHOD $$ func_149742_c + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r())); +- return p_149742_1_.getBlock(p_149742_2_ - 1, p_149742_3_, p_149742_4_).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_ + 1, p_149742_3_, p_149742_4_).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ - 1).isNormalCube() ? true : p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ + 1).isNormalCube())); + return (p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST)) || + (p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST)) || + (p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH)) || + (p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH)); } - public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) -@@ -63,19 +73,21 @@ + // JAVADOC METHOD $$ func_149660_a +@@ -70,19 +80,21 @@ int k1 = j1 & 8; j1 &= 7; -- if (p_149660_5_ == 2 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r()) +- if (p_149660_5_ == 2 && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ + 1).isNormalCube()) + ForgeDirection dir = ForgeDirection.getOrientation(p_149660_5_); + + if (dir == NORTH && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH)) { j1 = 4; } -- else if (p_149660_5_ == 3 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r()) +- else if (p_149660_5_ == 3 && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ - 1).isNormalCube()) + else if (dir == SOUTH && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH)) { j1 = 3; } -- else if (p_149660_5_ == 4 && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r()) +- else if (p_149660_5_ == 4 && p_149660_1_.getBlock(p_149660_2_ + 1, p_149660_3_, p_149660_4_).isNormalCube()) + else if (dir == WEST && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST)) { j1 = 2; } -- else if (p_149660_5_ == 5 && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r()) +- else if (p_149660_5_ == 5 && p_149660_1_.getBlock(p_149660_2_ - 1, p_149660_3_, p_149660_4_).isNormalCube()) + else if (dir == EAST && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST)) { j1 = 1; } -@@ -89,7 +101,11 @@ +@@ -96,7 +108,11 @@ private int func_150045_e(World p_150045_1_, int p_150045_2_, int p_150045_3_, int p_150045_4_) { -- return p_150045_1_.func_147439_a(p_150045_2_ - 1, p_150045_3_, p_150045_4_).func_149721_r() ? 1 : (p_150045_1_.func_147439_a(p_150045_2_ + 1, p_150045_3_, p_150045_4_).func_149721_r() ? 2 : (p_150045_1_.func_147439_a(p_150045_2_, p_150045_3_, p_150045_4_ - 1).func_149721_r() ? 3 : (p_150045_1_.func_147439_a(p_150045_2_, p_150045_3_, p_150045_4_ + 1).func_149721_r() ? 4 : 1))); +- return p_150045_1_.getBlock(p_150045_2_ - 1, p_150045_3_, p_150045_4_).isNormalCube() ? 1 : (p_150045_1_.getBlock(p_150045_2_ + 1, p_150045_3_, p_150045_4_).isNormalCube() ? 2 : (p_150045_1_.getBlock(p_150045_2_, p_150045_3_, p_150045_4_ - 1).isNormalCube() ? 3 : (p_150045_1_.getBlock(p_150045_2_, p_150045_3_, p_150045_4_ + 1).isNormalCube() ? 4 : 1))); + if (p_150045_1_.isSideSolid(p_150045_2_ - 1, p_150045_3_, p_150045_4_, EAST)) return 1; + if (p_150045_1_.isSideSolid(p_150045_2_ + 1, p_150045_3_, p_150045_4_, WEST)) return 2; + if (p_150045_1_.isSideSolid(p_150045_2_, p_150045_3_, p_150045_4_ - 1, SOUTH)) return 3; @@ -70,30 +71,30 @@ + return 1; } - public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) -@@ -99,22 +115,22 @@ + // JAVADOC METHOD $$ func_149695_a +@@ -107,22 +123,22 @@ int l = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_) & 7; boolean flag = false; -- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 1) +- if (!p_149695_1_.getBlock(p_149695_2_ - 1, p_149695_3_, p_149695_4_).isNormalCube() && l == 1) + if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && l == 1) { flag = true; } -- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 2) +- if (!p_149695_1_.getBlock(p_149695_2_ + 1, p_149695_3_, p_149695_4_).isNormalCube() && l == 2) + if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && l == 2) { flag = true; } -- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && l == 3) +- if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ - 1).isNormalCube() && l == 3) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && l == 3) { flag = true; } -- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && l == 4) +- if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ + 1).isNormalCube() && l == 4) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && l == 4) { flag = true; diff --git a/patches/minecraft/net/minecraft/block/BlockCactus.java.patch b/patches/minecraft/net/minecraft/block/BlockCactus.java.patch index f18d66ae8b..56c37bfef3 100644 --- a/patches/minecraft/net/minecraft/block/BlockCactus.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCactus.java.patch @@ -15,18 +15,18 @@ { @SideOnly(Side.CLIENT) private IIcon field_150041_a; -@@ -125,7 +129,7 @@ +@@ -135,7 +139,7 @@ else { - Block block = p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_); + Block block = p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_); - return block == Blocks.cactus || block == Blocks.sand; + return block.canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this); } } -@@ -141,4 +145,22 @@ - this.field_150041_a = p_149651_1_.registerIcon(this.func_149641_N() + "_top"); - this.field_150040_b = p_149651_1_.registerIcon(this.func_149641_N() + "_bottom"); +@@ -152,4 +156,22 @@ + this.field_150041_a = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + this.field_150040_b = p_149651_1_.registerIcon(this.getTextureName() + "_bottom"); } + + @Override diff --git a/patches/minecraft/net/minecraft/block/BlockChest.java.patch b/patches/minecraft/net/minecraft/block/BlockChest.java.patch index baac7a2db4..1bdf355848 100644 --- a/patches/minecraft/net/minecraft/block/BlockChest.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockChest.java.patch @@ -9,36 +9,36 @@ public class BlockChest extends BlockContainer { private final Random field_149955_b = new Random(); -@@ -407,7 +409,7 @@ +@@ -416,7 +418,7 @@ { return null; } -- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_).func_149721_r()) +- else if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_ + 1, p_149951_4_).isNormalCube()) + else if (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_, DOWN)) { return null; } -@@ -415,19 +417,19 @@ +@@ -424,19 +426,19 @@ { return null; } -- else if (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_))) -+ else if (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_))) +- else if (p_149951_1_.getBlock(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.getBlock(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_).isNormalCube() || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_))) ++ else if (p_149951_1_.getBlock(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_))) { return null; } -- else if (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_))) -+ else if (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_))) +- else if (p_149951_1_.getBlock(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.getBlock(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_).isNormalCube() || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_))) ++ else if (p_149951_1_.getBlock(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_))) { return null; } -- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1))) -+ else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1))) +- else if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.getBlock(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1).isNormalCube() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1))) ++ else if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1))) { return null; } -- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1))) -+ else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1))) +- else if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.getBlock(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1).isNormalCube() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1))) ++ else if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1))) { return null; } diff --git a/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch b/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch index f86562fba1..487b57ba63 100644 --- a/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch @@ -8,11 +8,11 @@ import java.util.Random; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; -@@ -160,6 +161,13 @@ - - public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) +@@ -173,6 +174,13 @@ + // JAVADOC METHOD $$ func_149690_a + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { -+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); ++ super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + } + + @Override @@ -22,24 +22,24 @@ int j1 = func_149987_c(p_149690_5_); byte b0 = 1; -@@ -170,8 +178,9 @@ +@@ -183,8 +191,9 @@ for (int k1 = 0; k1 < b0; ++k1) { -- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.dye, 1, 3)); +- this.dropBlockAsItem(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.dye, 1, 3)); + dropped.add(new ItemStack(Items.dye, 1, 3)); } + return dropped; } - @SideOnly(Side.CLIENT) -@@ -216,4 +225,10 @@ + // JAVADOC METHOD $$ func_149694_d +@@ -231,4 +240,10 @@ ++j1; p_149853_1_.setBlockMetadataWithNotify(p_149853_3_, p_149853_4_, p_149853_5_, j1 << 2 | i1, 2); } + + @Override -+ public Item func_149650_a(int par1, Random par2Random, int par3) ++ public Item getItemDropped(int par1, Random par2Random, int par3) + { + return null; + } diff --git a/patches/minecraft/net/minecraft/block/BlockCrops.java.patch b/patches/minecraft/net/minecraft/block/BlockCrops.java.patch index 2fb89a50db..5500c7f0c0 100644 --- a/patches/minecraft/net/minecraft/block/BlockCrops.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCrops.java.patch @@ -16,24 +16,24 @@ public class BlockCrops extends BlockBush implements IGrowable { -@@ -89,11 +91,11 @@ +@@ -91,11 +93,11 @@ { float f1 = 0.0F; -- if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1) == Blocks.farmland) -+ if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1).canSustainPlant(p_149864_1_, l, p_149864_3_ - 1, i1, ForgeDirection.UP, this)) +- if (p_149864_1_.getBlock(l, p_149864_3_ - 1, i1) == Blocks.farmland) ++ if (p_149864_1_.getBlock(l, p_149864_3_ - 1, i1).canSustainPlant(p_149864_1_, l, p_149864_3_ - 1, i1, ForgeDirection.UP, this)) { f1 = 1.0F; - if (p_149864_1_.getBlockMetadata(l, p_149864_3_ - 1, i1) > 0) -+ if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1).isFertile(p_149864_1_, l, p_149864_3_ - 1, i1)) ++ if (p_149864_1_.getBlock(l, p_149864_3_ - 1, i1).isFertile(p_149864_1_, l, p_149864_3_ - 1, i1)) { f1 = 3.0F; } -@@ -145,22 +147,6 @@ - public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) +@@ -150,22 +152,6 @@ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { - super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, 0); + super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, 0); - - if (!p_149690_1_.isRemote) - { @@ -45,15 +45,15 @@ - { - if (p_149690_1_.rand.nextInt(15) <= p_149690_5_) - { -- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(this.func_149866_i(), 1, 0)); +- this.dropBlockAsItem(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(this.func_149866_i(), 1, 0)); - } - } - } - } } - public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) -@@ -204,4 +190,23 @@ + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) +@@ -211,4 +197,23 @@ { this.func_149863_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_); } diff --git a/patches/minecraft/net/minecraft/block/BlockDoor.java.patch b/patches/minecraft/net/minecraft/block/BlockDoor.java.patch index c3c475130f..a3f9629e9e 100644 --- a/patches/minecraft/net/minecraft/block/BlockDoor.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockDoor.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/block/BlockDoor.java +++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java -@@ -249,7 +249,7 @@ +@@ -258,7 +258,7 @@ { - if (this.field_149764_J == Material.field_151573_f) + if (this.blockMaterial == Material.iron) { - return true; + return false; //Allow items to interact with the door diff --git a/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch b/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch index 1cf7cc63a9..66be5939f6 100644 --- a/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/block/BlockDoublePlant.java +++ ../src-work/minecraft/net/minecraft/block/BlockDoublePlant.java -@@ -81,6 +81,7 @@ - - public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) +@@ -86,6 +86,7 @@ + // JAVADOC METHOD $$ func_149718_j + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { -+ if (p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_, p_149718_4_) != this) return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check. ++ if (p_149718_1_.getBlock(p_149718_2_, p_149718_3_, p_149718_4_) != this) return super.canBlockStay(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check. int l = p_149718_1_.getBlockMetadata(p_149718_2_, p_149718_3_, p_149718_4_); - return func_149887_c(l) ? p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == this : p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ + 1, p_149718_4_) == this && super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); + return func_149887_c(l) ? p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == this : p_149718_1_.getBlock(p_149718_2_, p_149718_3_ + 1, p_149718_4_) == this && super.canBlockStay(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); } diff --git a/patches/minecraft/net/minecraft/block/BlockFalling.java.patch b/patches/minecraft/net/minecraft/block/BlockFalling.java.patch index c38ada9c6a..200b96e8e3 100644 --- a/patches/minecraft/net/minecraft/block/BlockFalling.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFalling.java.patch @@ -1,19 +1,19 @@ --- ../src-base/minecraft/net/minecraft/block/BlockFalling.java +++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java -@@ -84,7 +84,7 @@ +@@ -88,7 +88,7 @@ { - Block block = p_149831_0_.func_147439_a(p_149831_1_, p_149831_2_, p_149831_3_); + Block block = p_149831_0_.getBlock(p_149831_1_, p_149831_2_, p_149831_3_); -- if (block.field_149764_J == Material.field_151579_a) +- if (block.blockMaterial == Material.air) + if (block.isAir(p_149831_0_, p_149831_1_, p_149831_2_, p_149831_3_)) { return true; } -@@ -94,6 +94,7 @@ +@@ -98,6 +98,7 @@ } else { + //TODO: King, take a look here when doing liquids! - Material material = block.field_149764_J; - return material == Material.field_151586_h ? true : material == Material.field_151587_i; + Material material = block.blockMaterial; + return material == Material.water ? true : material == Material.lava; } diff --git a/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch b/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch index ace4d430fc..7f2c532db5 100644 --- a/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch @@ -9,9 +9,9 @@ public class BlockFarmland extends Block { -@@ -94,7 +96,7 @@ +@@ -100,7 +102,7 @@ { - Block block = p_149822_1_.func_147439_a(l, p_149822_3_ + 1, i1); + Block block = p_149822_1_.getBlock(l, p_149822_3_ + 1, i1); - if (block == Blocks.wheat || block == Blocks.melon_stem || block == Blocks.pumpkin_stem || block == Blocks.potatoes || block == Blocks.carrots) + if (block instanceof IPlantable && canSustainPlant(p_149822_1_, p_149822_2_, p_149822_3_, p_149822_4_, ForgeDirection.UP, (IPlantable)block)) diff --git a/patches/minecraft/net/minecraft/block/BlockFire.java.patch b/patches/minecraft/net/minecraft/block/BlockFire.java.patch index 40280dc86a..c5f51d9b5e 100644 --- a/patches/minecraft/net/minecraft/block/BlockFire.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFire.java.patch @@ -30,7 +30,7 @@ private IIcon[] field_149850_M; private static final String __OBFID = "CL_00000245"; @@ -54,10 +61,10 @@ - Blocks.fire.func_149842_a(func_149682_b(Blocks.carpet), 60, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.carpet), 60, 20); } + @Deprecated // Use setFireInfo @@ -38,44 +38,44 @@ { - this.field_149849_a[p_149842_1_] = p_149842_2_; - this.field_149848_b[p_149842_1_] = p_149842_3_; -+ this.setFireInfo((Block)Block.field_149771_c.func_148754_a(p_149842_1_), p_149842_2_, p_149842_3_); ++ this.setFireInfo((Block)Block.blockRegistry.getObjectById(p_149842_1_), p_149842_2_, p_149842_3_); } - public AxisAlignedBB func_149668_a(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) -@@ -94,13 +101,8 @@ + // JAVADOC METHOD $$ func_149668_a +@@ -101,13 +108,8 @@ { if (p_149674_1_.getGameRules().getGameRuleBooleanValue("doFireTick")) { -- boolean flag = p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.netherrack; -+ boolean flag = p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_).isFireSource(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP); +- boolean flag = p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.netherrack; ++ boolean flag = p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_).isFireSource(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP); -- if (p_149674_1_.provider instanceof WorldProviderEnd && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.bedrock) +- if (p_149674_1_.provider instanceof WorldProviderEnd && p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.bedrock) - { - flag = true; - } - - if (!this.func_149742_c(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_)) + if (!this.canPlaceBlockAt(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_)) { - p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_); -@@ -128,7 +130,7 @@ - p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_); + p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); +@@ -135,7 +137,7 @@ + p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); } } -- else if (!flag && !this.func_149844_e(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_) && l == 15 && p_149674_5_.nextInt(4) == 0) +- else if (!flag && !this.canBlockCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_) && l == 15 && p_149674_5_.nextInt(4) == 0) + else if (!flag && !this.canCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP) && l == 15 && p_149674_5_.nextInt(4) == 0) { - p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_); + p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); } -@@ -142,12 +144,12 @@ +@@ -149,12 +151,12 @@ b0 = -50; } -- this.func_149841_a(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l); -- this.func_149841_a(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l); -- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l); -- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, 250 + b0, p_149674_5_, l); -- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, 300 + b0, p_149674_5_, l); -- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, 300 + b0, p_149674_5_, l); +- this.tryCatchFire(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l); +- this.tryCatchFire(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l); +- this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l); +- this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, 250 + b0, p_149674_5_, l); +- this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, 300 + b0, p_149674_5_, l); +- this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, 300 + b0, p_149674_5_, l); + this.tryCatchFire(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l, WEST ); + this.tryCatchFire(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l, EAST ); + this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l, UP ); @@ -85,29 +85,29 @@ for (int i1 = p_149674_2_ - 1; i1 <= p_149674_2_ + 1; ++i1) { -@@ -201,10 +203,16 @@ - return false; +@@ -209,10 +211,16 @@ } + // JAVADOC METHOD $$ func_149841_a + @Deprecated - private void func_149841_a(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_) + private void tryCatchFire(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_) { -- int j1 = this.field_149848_b[Block.func_149682_b(p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_))]; +- int j1 = this.field_149848_b[Block.getIdFromBlock(p_149841_1_.getBlock(p_149841_2_, p_149841_3_, p_149841_4_))]; + this.tryCatchFire(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, p_149841_5_, p_149841_6_, p_149841_7_, UP); + } + private void tryCatchFire(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_, ForgeDirection face) + { -+ int j1 = p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_).getFlammability(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, face); ++ int j1 = p_149841_1_.getBlock(p_149841_2_, p_149841_3_, p_149841_4_).getFlammability(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, face); + if (p_149841_6_.nextInt(p_149841_5_) < j1) { - boolean flag = p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.tnt; -@@ -234,7 +242,12 @@ - - private boolean func_149847_e(World p_149847_1_, int p_149847_2_, int p_149847_3_, int p_149847_4_) + boolean flag = p_149841_1_.getBlock(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.tnt; +@@ -243,7 +251,12 @@ + // JAVADOC METHOD $$ func_149847_e + private boolean canNeighborBurn(World p_149847_1_, int p_149847_2_, int p_149847_3_, int p_149847_4_) { -- return this.func_149844_e(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1) ? true : this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1))))); +- return this.canBlockCatchFire(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_) ? true : (this.canBlockCatchFire(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_) ? true : (this.canBlockCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_) ? true : (this.canBlockCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_) ? true : (this.canBlockCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1) ? true : this.canBlockCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1))))); + return this.canCatchFire(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_, WEST ) || + this.canCatchFire(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_, EAST ) || + this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_, UP ) || @@ -116,8 +116,8 @@ + this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1, NORTH); } - private int func_149845_m(World p_149845_1_, int p_149845_2_, int p_149845_3_, int p_149845_4_) -@@ -247,12 +260,13 @@ + // JAVADOC METHOD $$ func_149845_m +@@ -257,12 +270,13 @@ } else { @@ -137,77 +137,77 @@ return l; } } -@@ -262,15 +276,16 @@ - return false; +@@ -274,15 +288,16 @@ } + // JAVADOC METHOD $$ func_149844_e + @Deprecated - public boolean func_149844_e(IBlockAccess p_149844_1_, int p_149844_2_, int p_149844_3_, int p_149844_4_) + public boolean canBlockCatchFire(IBlockAccess p_149844_1_, int p_149844_2_, int p_149844_3_, int p_149844_4_) { -- return this.field_149849_a[Block.func_149682_b(p_149844_1_.func_147439_a(p_149844_2_, p_149844_3_, p_149844_4_))] > 0; +- return this.field_149849_a[Block.getIdFromBlock(p_149844_1_.getBlock(p_149844_2_, p_149844_3_, p_149844_4_))] > 0; + return canCatchFire(p_149844_1_, p_149844_2_, p_149844_3_, p_149844_4_, UP); } + @Deprecated public int func_149846_a(World p_149846_1_, int p_149846_2_, int p_149846_3_, int p_149846_4_, int p_149846_5_) { -- int i1 = this.field_149849_a[Block.func_149682_b(p_149846_1_.func_147439_a(p_149846_2_, p_149846_3_, p_149846_4_))]; +- int i1 = this.field_149849_a[Block.getIdFromBlock(p_149846_1_.getBlock(p_149846_2_, p_149846_3_, p_149846_4_))]; - return i1 > p_149846_5_ ? i1 : p_149846_5_; + return getChanceToEncourageFire(p_149846_1_, p_149846_2_, p_149846_3_, p_149846_4_, p_149846_5_, UP); } - public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) -@@ -314,9 +329,9 @@ + // JAVADOC METHOD $$ func_149742_c +@@ -330,9 +345,9 @@ float f1; float f2; -- if (!World.func_147466_a(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.fire.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_)) -+ if (!World.func_147466_a(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP)) +- if (!World.doesBlockHaveSolidTopSurface(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.fire.canBlockCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_)) ++ if (!World.doesBlockHaveSolidTopSurface(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP)) { -- if (Blocks.fire.func_149844_e(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_)) +- if (Blocks.fire.canBlockCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_)) + if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_, EAST)) { for (l = 0; l < 2; ++l) { -@@ -327,7 +342,7 @@ +@@ -343,7 +358,7 @@ } } -- if (Blocks.fire.func_149844_e(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_)) +- if (Blocks.fire.canBlockCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_)) + if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_, WEST)) { for (l = 0; l < 2; ++l) { -@@ -338,7 +353,7 @@ +@@ -354,7 +369,7 @@ } } -- if (Blocks.fire.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1)) +- if (Blocks.fire.canBlockCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1)) + if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1, SOUTH)) { for (l = 0; l < 2; ++l) { -@@ -349,7 +364,7 @@ +@@ -365,7 +380,7 @@ } } -- if (Blocks.fire.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1)) +- if (Blocks.fire.canBlockCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1)) + if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1, NORTH)) { for (l = 0; l < 2; ++l) { -@@ -360,7 +375,7 @@ +@@ -376,7 +391,7 @@ } } -- if (Blocks.fire.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_)) +- if (Blocks.fire.canBlockCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_)) + if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_, DOWN)) { for (l = 0; l < 2; ++l) { -@@ -405,4 +420,101 @@ +@@ -422,4 +437,101 @@ { - return MapColor.field_151656_f; + return MapColor.tntColor; } + + /*================================= Forge Start ======================================*/ @@ -221,7 +221,7 @@ + public void setFireInfo(Block block, int encouragement, int flammibility) + { + if (block == Blocks.air) throw new IllegalArgumentException("Tried to set air on fire... This is bad."); -+ int id = Block.func_149682_b(block); ++ int id = Block.getIdFromBlock(block); + this.field_149849_a[id] = encouragement; + this.field_149848_b[id] = flammibility; + @@ -253,7 +253,7 @@ + + for (Entry e : blockInfo.entrySet()) + { -+ int id = Block.func_149682_b(e.getKey()); ++ int id = Block.getIdFromBlock(e.getKey()); + if (id >= 0 && id < 4096) + { + field_149849_a[id] = e.getValue().encouragement; @@ -264,13 +264,13 @@ + + public int getFlammability(Block block) + { -+ int id = Block.func_149682_b(block); ++ int id = Block.getIdFromBlock(block); + return id >= 0 && id < 4096 ? field_149848_b[id] : 0; + } + + public int getEncouragement(Block block) + { -+ int id = Block.func_149682_b(block); ++ int id = Block.getIdFromBlock(block); + return id >= 0 && id < 4096 ? field_149849_a[id] : 0; + } + @@ -286,7 +286,7 @@ + */ + public boolean canCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) + { -+ return world.func_147439_a(x, y, z).isFlammable(world, x, y, z, face); ++ return world.getBlock(x, y, z).isFlammable(world, x, y, z, face); + } + + /** @@ -302,7 +302,7 @@ + */ + public int getChanceToEncourageFire(IBlockAccess world, int x, int y, int z, int oldChance, ForgeDirection face) + { -+ int newChance = world.func_147439_a(x, y, z).getFireSpreadSpeed(world, x, y, z, face); ++ int newChance = world.getBlock(x, y, z).getFireSpreadSpeed(world, x, y, z, face); + return (newChance > oldChance ? newChance : oldChance); + } + /*================================= Forge Start ======================================*/ diff --git a/patches/minecraft/net/minecraft/block/BlockGrass.java.patch b/patches/minecraft/net/minecraft/block/BlockGrass.java.patch index d0883a8eac..d29a955866 100644 --- a/patches/minecraft/net/minecraft/block/BlockGrass.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockGrass.java.patch @@ -1,35 +1,35 @@ --- ../src-base/minecraft/net/minecraft/block/BlockGrass.java +++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java -@@ -43,7 +43,7 @@ +@@ -45,7 +45,7 @@ { if (!p_149674_1_.isRemote) { -- if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ + 1, p_149674_4_).func_149717_k() > 2) +- if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlock(p_149674_2_, p_149674_3_ + 1, p_149674_4_).getLightOpacity() > 2) + if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 2) { - p_149674_1_.func_147449_b(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.dirt); + p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.dirt); } -@@ -56,7 +56,7 @@ +@@ -58,7 +58,7 @@ int k1 = p_149674_4_ + p_149674_5_.nextInt(3) - 1; - Block block = p_149674_1_.func_147439_a(i1, j1 + 1, k1); + Block block = p_149674_1_.getBlock(i1, j1 + 1, k1); -- if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.dirt && p_149674_1_.getBlockMetadata(i1, j1, k1) == 0 && p_149674_1_.getBlockLightValue(i1, j1 + 1, k1) >= 4 && block.func_149717_k() <= 2) -+ if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.dirt && p_149674_1_.getBlockMetadata(i1, j1, k1) == 0 && p_149674_1_.getBlockLightValue(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) +- if (p_149674_1_.getBlock(i1, j1, k1) == Blocks.dirt && p_149674_1_.getBlockMetadata(i1, j1, k1) == 0 && p_149674_1_.getBlockLightValue(i1, j1 + 1, k1) >= 4 && block.getLightOpacity() <= 2) ++ if (p_149674_1_.getBlock(i1, j1, k1) == Blocks.dirt && p_149674_1_.getBlockMetadata(i1, j1, k1) == 0 && p_149674_1_.getBlockLightValue(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) { - p_149674_1_.func_147449_b(i1, j1, k1, Blocks.grass); + p_149674_1_.setBlock(i1, j1, k1, Blocks.grass); } -@@ -184,15 +184,7 @@ +@@ -188,15 +188,7 @@ } else { - String s = p_149853_1_.getBiomeGenForCoords(i1, k1).func_150572_a(p_149853_2_, i1, j1, k1); -- field_149992_a.debug("Flower in " + p_149853_1_.getBiomeGenForCoords(i1, k1).biomeName + ": " + s); +- logger.debug("Flower in " + p_149853_1_.getBiomeGenForCoords(i1, k1).biomeName + ": " + s); - BlockFlower blockflower = BlockFlower.func_149857_e(s); - -- if (blockflower != null && blockflower.func_149718_j(p_149853_1_, i1, j1, k1)) +- if (blockflower != null && blockflower.canBlockStay(p_149853_1_, i1, j1, k1)) - { - int i2 = BlockFlower.func_149856_f(s); -- p_149853_1_.func_147465_d(i1, j1, k1, blockflower, i2, 3); +- p_149853_1_.setBlock(i1, j1, k1, blockflower, i2, 3); - } + p_149853_1_.getBiomeGenForCoords(i1, k1).plantFlower(p_149853_1_, p_149853_2_, i1, j1, k1); } diff --git a/patches/minecraft/net/minecraft/block/BlockIce.java.patch b/patches/minecraft/net/minecraft/block/BlockIce.java.patch index 3d2641e629..39b2a7fa33 100644 --- a/patches/minecraft/net/minecraft/block/BlockIce.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockIce.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/block/BlockIce.java +++ ../src-work/minecraft/net/minecraft/block/BlockIce.java -@@ -43,7 +43,7 @@ - p_149636_2_.addStat(StatList.mineBlockStatArray[Block.func_149682_b(this)], 1); +@@ -46,7 +46,7 @@ + p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); p_149636_2_.addExhaustion(0.025F); -- if (this.func_149700_E() && EnchantmentHelper.getSilkTouchModifier(p_149636_2_)) +- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(p_149636_2_)) + if (this.canSilkHarvest(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_) && EnchantmentHelper.getSilkTouchModifier(p_149636_2_)) { - ItemStack itemstack = this.func_149644_j(p_149636_6_); + ItemStack itemstack = this.createStackedBlock(p_149636_6_); diff --git a/patches/minecraft/net/minecraft/block/BlockLadder.java.patch b/patches/minecraft/net/minecraft/block/BlockLadder.java.patch index c7a8929032..25e6e6dc9f 100644 --- a/patches/minecraft/net/minecraft/block/BlockLadder.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLadder.java.patch @@ -15,72 +15,73 @@ public class BlockLadder extends Block { private static final String __OBFID = "CL_00000262"; -@@ -79,29 +83,32 @@ - - public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) +@@ -86,7 +90,10 @@ + // JAVADOC METHOD $$ func_149742_c + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r())); +- return p_149742_1_.getBlock(p_149742_2_ - 1, p_149742_3_, p_149742_4_).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_ + 1, p_149742_3_, p_149742_4_).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ - 1).isNormalCube() ? true : p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ + 1).isNormalCube())); + return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) || + p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) || + p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) || + p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH); } - public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) + // JAVADOC METHOD $$ func_149660_a +@@ -94,22 +101,22 @@ { int j1 = p_149660_9_; -- if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r()) +- if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ + 1).isNormalCube()) + if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH)) { j1 = 2; } -- if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r()) +- if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ - 1).isNormalCube()) + if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH)) { j1 = 3; } -- if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r()) +- if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.getBlock(p_149660_2_ + 1, p_149660_3_, p_149660_4_).isNormalCube()) + if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST)) { j1 = 4; } -- if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r()) +- if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.getBlock(p_149660_2_ - 1, p_149660_3_, p_149660_4_).isNormalCube()) + if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST)) { j1 = 5; } -@@ -114,22 +121,22 @@ +@@ -123,22 +130,22 @@ int l = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_); boolean flag = false; -- if (l == 2 && p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r()) +- if (l == 2 && p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ + 1).isNormalCube()) + if (l == 2 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH)) { flag = true; } -- if (l == 3 && p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r()) +- if (l == 3 && p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ - 1).isNormalCube()) + if (l == 3 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH)) { flag = true; } -- if (l == 4 && p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r()) +- if (l == 4 && p_149695_1_.getBlock(p_149695_2_ + 1, p_149695_3_, p_149695_4_).isNormalCube()) + if (l == 4 && p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST)) { flag = true; } -- if (l == 5 && p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r()) +- if (l == 5 && p_149695_1_.getBlock(p_149695_2_ - 1, p_149695_3_, p_149695_4_).isNormalCube()) + if (l == 5 && p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST)) { flag = true; } -@@ -147,4 +154,10 @@ +@@ -157,4 +164,10 @@ { return 1; } diff --git a/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch b/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch index cfdc443d83..ae87315ff9 100644 --- a/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch @@ -19,12 +19,12 @@ { int[] field_150128_a; @SideOnly(Side.CLIENT) -@@ -82,10 +84,10 @@ +@@ -84,10 +86,10 @@ { for (int l1 = -b0; l1 <= b0; ++l1) { -- if (p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).func_149688_o() == Material.field_151584_j) -+ Block block = p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); +- if (p_149749_1_.getBlock(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).getMaterial() == Material.leaves) ++ Block block = p_149749_1_.getBlock(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); + if (block.isLeaves(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1)) { - int i2 = p_149749_1_.getBlockMetadata(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); @@ -33,33 +33,33 @@ } } } -@@ -127,9 +129,9 @@ +@@ -130,9 +132,9 @@ { - Block block = p_149674_1_.func_147439_a(p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2); + Block block = p_149674_1_.getBlock(p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2); - if (block != Blocks.log && block != Blocks.log2) + if (!block.canSustainLeaves(p_149674_1_, p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2)) { -- if (block.func_149688_o() == Material.field_151584_j) +- if (block.getMaterial() == Material.leaves) + if (block.isLeaves(p_149674_1_, p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2)) { this.field_150128_a[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2; } -@@ -281,13 +283,7 @@ - - public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) +@@ -288,13 +290,7 @@ + // JAVADOC METHOD $$ func_149636_a + public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { - if (!p_149636_1_.isRemote && p_149636_2_.getCurrentEquippedItem() != null && p_149636_2_.getCurrentEquippedItem().getItem() == Items.shears) { -- p_149636_2_.addStat(StatList.mineBlockStatArray[Block.func_149682_b(this)], 1); -- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Item.func_150898_a(this), 1, p_149636_6_ & 3)); +- p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); +- this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Item.getItemFromBlock(this), 1, p_149636_6_ & 3)); - } - else - { - super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); } } -@@ -318,4 +314,38 @@ +@@ -330,4 +326,38 @@ } public abstract String[] func_150125_e(); diff --git a/patches/minecraft/net/minecraft/block/BlockLever.java.patch b/patches/minecraft/net/minecraft/block/BlockLever.java.patch index 66da5652bb..a2929b115f 100644 --- a/patches/minecraft/net/minecraft/block/BlockLever.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLever.java.patch @@ -10,11 +10,11 @@ public class BlockLever extends Block { private static final String __OBFID = "CL_00000264"; -@@ -42,12 +45,23 @@ - - public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) +@@ -47,13 +50,24 @@ + // JAVADOC METHOD $$ func_149707_d + public boolean canPlaceBlockOnSide(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) { -- return p_149707_5_ == 0 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_ + 1, p_149707_4_).func_149721_r() ? true : (p_149707_5_ == 1 && World.func_147466_a(p_149707_1_, p_149707_2_, p_149707_3_ - 1, p_149707_4_) ? true : (p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r())))); +- return p_149707_5_ == 0 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_ + 1, p_149707_4_).isNormalCube() ? true : (p_149707_5_ == 1 && World.doesBlockHaveSolidTopSurface(p_149707_1_, p_149707_2_, p_149707_3_ - 1, p_149707_4_) ? true : (p_149707_5_ == 2 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ + 1).isNormalCube() ? true : (p_149707_5_ == 3 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ - 1).isNormalCube() ? true : (p_149707_5_ == 4 && p_149707_1_.getBlock(p_149707_2_ + 1, p_149707_3_, p_149707_4_).isNormalCube() ? true : p_149707_5_ == 5 && p_149707_1_.getBlock(p_149707_2_ - 1, p_149707_3_, p_149707_4_).isNormalCube())))); + ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_); + return (dir == DOWN && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_ + 1, p_149707_4_, DOWN )) || + (dir == UP && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_ - 1, p_149707_4_, UP )) || @@ -24,9 +24,10 @@ + (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST )); } - public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + // JAVADOC METHOD $$ func_149742_c + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r() ? true : (World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ + 1, p_149742_4_).func_149721_r())))); +- return p_149742_1_.getBlock(p_149742_2_ - 1, p_149742_3_, p_149742_4_).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_ + 1, p_149742_3_, p_149742_4_).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ - 1).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ + 1).isNormalCube() ? true : (World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : p_149742_1_.getBlock(p_149742_2_, p_149742_3_ + 1, p_149742_4_).isNormalCube())))); + return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) || + p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) || + p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) || @@ -35,93 +36,93 @@ + p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_ + 1, p_149742_4_, DOWN ); } - public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) -@@ -56,32 +70,32 @@ + // JAVADOC METHOD $$ func_149660_a +@@ -63,32 +77,32 @@ int j1 = p_149660_9_ & 7; byte b0 = -1; -- if (p_149660_5_ == 0 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_ + 1, p_149660_4_).func_149721_r()) +- if (p_149660_5_ == 0 && p_149660_1_.getBlock(p_149660_2_, p_149660_3_ + 1, p_149660_4_).isNormalCube()) + if (p_149660_5_ == 0 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_ + 1, p_149660_4_, DOWN)) { b0 = 0; } -- if (p_149660_5_ == 1 && World.func_147466_a(p_149660_1_, p_149660_2_, p_149660_3_ - 1, p_149660_4_)) +- if (p_149660_5_ == 1 && World.doesBlockHaveSolidTopSurface(p_149660_1_, p_149660_2_, p_149660_3_ - 1, p_149660_4_)) + if (p_149660_5_ == 1 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_ - 1, p_149660_4_, UP)) { b0 = 5; } -- if (p_149660_5_ == 2 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r()) +- if (p_149660_5_ == 2 && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ + 1).isNormalCube()) + if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH)) { b0 = 4; } -- if (p_149660_5_ == 3 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r()) +- if (p_149660_5_ == 3 && p_149660_1_.getBlock(p_149660_2_, p_149660_3_, p_149660_4_ - 1).isNormalCube()) + if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH)) { b0 = 3; } -- if (p_149660_5_ == 4 && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r()) +- if (p_149660_5_ == 4 && p_149660_1_.getBlock(p_149660_2_ + 1, p_149660_3_, p_149660_4_).isNormalCube()) + if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST)) { b0 = 2; } -- if (p_149660_5_ == 5 && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r()) +- if (p_149660_5_ == 5 && p_149660_1_.getBlock(p_149660_2_ - 1, p_149660_3_, p_149660_4_).isNormalCube()) + if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST)) { b0 = 1; } -@@ -147,42 +161,42 @@ +@@ -156,42 +170,42 @@ int l = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_) & 7; boolean flag = false; -- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 1) +- if (!p_149695_1_.getBlock(p_149695_2_ - 1, p_149695_3_, p_149695_4_).isNormalCube() && l == 1) + if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && l == 1) { flag = true; } -- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 2) +- if (!p_149695_1_.getBlock(p_149695_2_ + 1, p_149695_3_, p_149695_4_).isNormalCube() && l == 2) + if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && l == 2) { flag = true; } -- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && l == 3) +- if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ - 1).isNormalCube() && l == 3) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && l == 3) { flag = true; } -- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && l == 4) +- if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ + 1).isNormalCube() && l == 4) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && l == 4) { flag = true; } -- if (!World.func_147466_a(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 5) +- if (!World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 5) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ - 1, p_149695_4_, UP) && l == 5) { flag = true; } -- if (!World.func_147466_a(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 6) +- if (!World.doesBlockHaveSolidTopSurface(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 6) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ - 1, p_149695_4_, UP) && l == 6) { flag = true; } -- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_ + 1, p_149695_4_).func_149721_r() && l == 0) +- if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_ + 1, p_149695_4_).isNormalCube() && l == 0) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ + 1, p_149695_4_, DOWN) && l == 0) { flag = true; } -- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_ + 1, p_149695_4_).func_149721_r() && l == 7) +- if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_ + 1, p_149695_4_).isNormalCube() && l == 7) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ + 1, p_149695_4_, DOWN) && l == 7) { flag = true; diff --git a/patches/minecraft/net/minecraft/block/BlockLiquid.java.patch b/patches/minecraft/net/minecraft/block/BlockLiquid.java.patch index 617a5b12ab..22690b5227 100644 --- a/patches/minecraft/net/minecraft/block/BlockLiquid.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLiquid.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockLiquid.java +++ ../src-work/minecraft/net/minecraft/block/BlockLiquid.java -@@ -67,7 +67,7 @@ +@@ -69,7 +69,7 @@ { for (int l1 = -1; l1 <= 1; ++l1) { diff --git a/patches/minecraft/net/minecraft/block/BlockLog.java.patch b/patches/minecraft/net/minecraft/block/BlockLog.java.patch index 4fcb9497a7..457680239f 100644 --- a/patches/minecraft/net/minecraft/block/BlockLog.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLog.java.patch @@ -8,12 +8,12 @@ import net.minecraft.world.World; public abstract class BlockLog extends BlockRotatedPillar -@@ -53,14 +54,10 @@ +@@ -54,14 +55,10 @@ { for (int l1 = -b0; l1 <= b0; ++l1) { -- if (p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).func_149688_o() == Material.field_151584_j) -+ Block block = p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); +- if (p_149749_1_.getBlock(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).getMaterial() == Material.leaves) ++ Block block = p_149749_1_.getBlock(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); + if (block.isLeaves(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1)) { - int i2 = p_149749_1_.getBlockMetadata(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); @@ -26,7 +26,7 @@ } } } -@@ -79,4 +76,16 @@ +@@ -80,4 +77,16 @@ { return this.field_150166_b[p_150161_1_ % this.field_150166_b.length]; } diff --git a/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch b/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch index aaed558abb..6d3a0b61a4 100644 --- a/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch @@ -8,12 +8,12 @@ import net.minecraft.world.World; public class BlockMobSpawner extends BlockContainer -@@ -36,10 +37,15 @@ - public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) +@@ -39,10 +40,15 @@ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { - super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); - int j1 = 15 + p_149690_1_.rand.nextInt(15) + p_149690_1_.rand.nextInt(15); -- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1); +- this.dropXpOnBlockBreak(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1); } + private Random rand = new Random(); @@ -23,6 +23,6 @@ + return 15 + rand.nextInt(15) + rand.nextInt(15); + } + - public boolean func_149662_c() + // JAVADOC METHOD $$ func_149662_c + public boolean isOpaqueCube() { - return false; diff --git a/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch b/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch index a2f893272f..e53a3d34b7 100644 --- a/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch @@ -8,11 +8,11 @@ public class BlockMushroom extends BlockBush implements IGrowable { -@@ -85,7 +86,7 @@ +@@ -89,7 +90,7 @@ if (p_149718_3_ >= 0 && p_149718_3_ < 256) { - Block block = p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_); -- return block == Blocks.mycelium || block == Blocks.dirt && p_149718_1_.getBlockMetadata(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.getFullBlockLightValue(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && this.func_149854_a(block); + Block block = p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_); +- return block == Blocks.mycelium || block == Blocks.dirt && p_149718_1_.getBlockMetadata(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.getFullBlockLightValue(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && this.canPlaceBlockOn(block); + return block == Blocks.mycelium || block == Blocks.dirt && p_149718_1_.getBlockMetadata(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.getFullBlockLightValue(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && block.canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this); } else diff --git a/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch b/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch index 5f1559f17d..4b8ec6e7b2 100644 --- a/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch @@ -1,20 +1,20 @@ --- ../src-base/minecraft/net/minecraft/block/BlockMycelium.java +++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java -@@ -37,7 +37,7 @@ +@@ -39,7 +39,7 @@ { if (!p_149674_1_.isRemote) { -- if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ + 1, p_149674_4_).func_149717_k() > 2) +- if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlock(p_149674_2_, p_149674_3_ + 1, p_149674_4_).getLightOpacity() > 2) + if (p_149674_1_.getBlockLightValue(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 2) { - p_149674_1_.func_147449_b(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.dirt); + p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.dirt); } -@@ -50,7 +50,7 @@ +@@ -52,7 +52,7 @@ int k1 = p_149674_4_ + p_149674_5_.nextInt(3) - 1; - Block block = p_149674_1_.func_147439_a(i1, j1 + 1, k1); + Block block = p_149674_1_.getBlock(i1, j1 + 1, k1); -- if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.dirt && p_149674_1_.getBlockMetadata(i1, j1, k1) == 0 && p_149674_1_.getBlockLightValue(i1, j1 + 1, k1) >= 4 && block.func_149717_k() <= 2) -+ if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.dirt && p_149674_1_.getBlockMetadata(i1, j1, k1) == 0 && p_149674_1_.getBlockLightValue(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) +- if (p_149674_1_.getBlock(i1, j1, k1) == Blocks.dirt && p_149674_1_.getBlockMetadata(i1, j1, k1) == 0 && p_149674_1_.getBlockLightValue(i1, j1 + 1, k1) >= 4 && block.getLightOpacity() <= 2) ++ if (p_149674_1_.getBlock(i1, j1, k1) == Blocks.dirt && p_149674_1_.getBlockMetadata(i1, j1, k1) == 0 && p_149674_1_.getBlockLightValue(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) { - p_149674_1_.func_147449_b(i1, j1, k1, this); + p_149674_1_.setBlock(i1, j1, k1, this); } diff --git a/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch b/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch index 6fe1cb8f36..552fd39787 100644 --- a/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch @@ -16,34 +16,34 @@ public class BlockNetherWart extends BlockBush { -@@ -33,7 +35,7 @@ - - public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) +@@ -35,7 +37,7 @@ + // JAVADOC METHOD $$ func_149718_j + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) { -- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_)); -+ return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); +- return this.canPlaceBlockOn(p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_)); ++ return super.canBlockStay(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); } - public void func_149674_a(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) -@@ -62,6 +64,8 @@ - - public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) + // JAVADOC METHOD $$ func_149674_a +@@ -68,6 +70,8 @@ + // JAVADOC METHOD $$ func_149690_a + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { -+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); ++ super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + /* if (!p_149690_1_.isRemote) { int j1 = 1; -@@ -81,6 +85,7 @@ - this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.nether_wart)); +@@ -87,6 +91,7 @@ + this.dropBlockAsItem(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.nether_wart)); } } + */ } - public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) -@@ -109,4 +114,23 @@ - this.field_149883_a[i] = p_149651_1_.registerIcon(this.func_149641_N() + "_stage_" + i); + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) +@@ -117,4 +122,23 @@ + this.field_149883_a[i] = p_149651_1_.registerIcon(this.getTextureName() + "_stage_" + i); } } + diff --git a/patches/minecraft/net/minecraft/block/BlockOre.java.patch b/patches/minecraft/net/minecraft/block/BlockOre.java.patch index c61ae24c3d..cd7bf11388 100644 --- a/patches/minecraft/net/minecraft/block/BlockOre.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockOre.java.patch @@ -8,18 +8,18 @@ import net.minecraft.world.World; public class BlockOre extends Block -@@ -51,34 +52,40 @@ - public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) +@@ -54,34 +55,40 @@ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { - super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + } -- if (this.func_149650_a(p_149690_5_, p_149690_1_.rand, p_149690_7_) != Item.func_150898_a(this)) +- if (this.getItemDropped(p_149690_5_, p_149690_1_.rand, p_149690_7_) != Item.getItemFromBlock(this)) + private Random rand = new Random(); + @Override + public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_) + { -+ if (this.func_149650_a(p_149690_5_, rand, p_149690_7_) != Item.func_150898_a(this)) ++ if (this.getItemDropped(p_149690_5_, rand, p_149690_7_) != Item.getItemFromBlock(this)) { int j1 = 0; @@ -49,10 +49,10 @@ + j1 = MathHelper.getRandomIntegerInRange(rand, 2, 5); } -- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1); +- this.dropXpOnBlockBreak(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1); + return j1; } + return 0; } - public int func_149692_a(int p_149692_1_) + // JAVADOC METHOD $$ func_149692_a diff --git a/patches/minecraft/net/minecraft/block/BlockPane.java.patch b/patches/minecraft/net/minecraft/block/BlockPane.java.patch index 09c6e01528..dd717f87c8 100644 --- a/patches/minecraft/net/minecraft/block/BlockPane.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPane.java.patch @@ -9,14 +9,14 @@ public class BlockPane extends Block { -@@ -62,10 +64,10 @@ - - public void func_149743_a(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) +@@ -67,10 +69,10 @@ + // JAVADOC METHOD $$ func_149743_a + public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) { -- boolean flag = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_, p_149743_3_, p_149743_4_ - 1)); -- boolean flag1 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_, p_149743_3_, p_149743_4_ + 1)); -- boolean flag2 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_ - 1, p_149743_3_, p_149743_4_)); -- boolean flag3 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_ + 1, p_149743_3_, p_149743_4_)); +- boolean flag = this.canPaneConnectToBlock(p_149743_1_.getBlock(p_149743_2_, p_149743_3_, p_149743_4_ - 1)); +- boolean flag1 = this.canPaneConnectToBlock(p_149743_1_.getBlock(p_149743_2_, p_149743_3_, p_149743_4_ + 1)); +- boolean flag2 = this.canPaneConnectToBlock(p_149743_1_.getBlock(p_149743_2_ - 1, p_149743_3_, p_149743_4_)); +- boolean flag3 = this.canPaneConnectToBlock(p_149743_1_.getBlock(p_149743_2_ + 1, p_149743_3_, p_149743_4_)); + boolean flag = this.canPaneConnectTo(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_ - 1, NORTH); + boolean flag1 = this.canPaneConnectTo(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_ + 1, SOUTH); + boolean flag2 = this.canPaneConnectTo(p_149743_1_, p_149743_2_ - 1, p_149743_3_, p_149743_4_, WEST ); @@ -24,14 +24,14 @@ if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) { -@@ -117,10 +119,10 @@ +@@ -124,10 +126,10 @@ float f1 = 0.5625F; float f2 = 0.4375F; float f3 = 0.5625F; -- boolean flag = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_, p_149719_3_, p_149719_4_ - 1)); -- boolean flag1 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_, p_149719_3_, p_149719_4_ + 1)); -- boolean flag2 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_ - 1, p_149719_3_, p_149719_4_)); -- boolean flag3 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_ + 1, p_149719_3_, p_149719_4_)); +- boolean flag = this.canPaneConnectToBlock(p_149719_1_.getBlock(p_149719_2_, p_149719_3_, p_149719_4_ - 1)); +- boolean flag1 = this.canPaneConnectToBlock(p_149719_1_.getBlock(p_149719_2_, p_149719_3_, p_149719_4_ + 1)); +- boolean flag2 = this.canPaneConnectToBlock(p_149719_1_.getBlock(p_149719_2_ - 1, p_149719_3_, p_149719_4_)); +- boolean flag3 = this.canPaneConnectToBlock(p_149719_1_.getBlock(p_149719_2_ + 1, p_149719_3_, p_149719_4_)); + boolean flag = this.canPaneConnectTo(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ - 1, NORTH); + boolean flag1 = this.canPaneConnectTo(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ + 1, SOUTH); + boolean flag2 = this.canPaneConnectTo(p_149719_1_, p_149719_2_ - 1, p_149719_3_, p_149719_4_, WEST ); @@ -39,14 +39,14 @@ if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) { -@@ -186,4 +188,10 @@ - this.field_149761_L = p_149651_1_.registerIcon(this.field_150101_M); +@@ -195,4 +197,10 @@ + this.blockIcon = p_149651_1_.registerIcon(this.field_150101_M); this.field_150102_N = p_149651_1_.registerIcon(this.field_150100_a); } + + public boolean canPaneConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir) + { -+ return func_150098_a(world.func_147439_a(x, y, z)) || ++ return canPaneConnectToBlock(world.getBlock(x, y, z)) || + world.isSideSolid(x, y, z, dir.getOpposite(), false); + } } diff --git a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch index 81c2d58418..afdddbb6af 100644 --- a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch @@ -8,17 +8,17 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityPiston; import net.minecraft.util.AxisAlignedBB; -@@ -360,7 +361,8 @@ +@@ -380,7 +381,8 @@ return false; } - return !(p_150080_0_ instanceof ITileEntityProvider); -+ return !(p_150080_1_.func_147439_a(p_150080_2_, p_150080_3_, p_150080_4_).hasTileEntity(p_150080_1_.getBlockMetadata(p_150080_2_, p_150080_3_, p_150080_4_))); ++ return !(p_150080_1_.getBlock(p_150080_2_, p_150080_3_, p_150080_4_).hasTileEntity(p_150080_1_.getBlockMetadata(p_150080_2_, p_150080_3_, p_150080_4_))); + } } -@@ -375,14 +377,14 @@ +@@ -396,14 +398,14 @@ { if (l1 < 13) { @@ -28,14 +28,14 @@ return false; } - Block block = p_150077_0_.func_147439_a(i1, j1, k1); + Block block = p_150077_0_.getBlock(i1, j1, k1); -- if (block.func_149688_o() != Material.field_151579_a) +- if (block.getMaterial() != Material.air) + if (!block.isAir(p_150077_0_, i1, j1, k1)) { - if (!func_150080_a(block, p_150077_0_, i1, j1, k1, true)) + if (!canPushBlock(block, p_150077_0_, i1, j1, k1, true)) { -@@ -420,14 +422,14 @@ +@@ -442,14 +444,14 @@ { if (l1 < 13) { @@ -45,21 +45,21 @@ return false; } - Block block = p_150079_1_.func_147439_a(i1, j1, k1); + Block block = p_150079_1_.getBlock(i1, j1, k1); -- if (block.func_149688_o() != Material.field_151579_a) +- if (block.getMaterial() != Material.air) + if (!block.isAir(p_150079_1_, i1, j1, k1)) { - if (!func_150080_a(block, p_150079_1_, i1, j1, k1, true)) + if (!canPushBlock(block, p_150079_1_, i1, j1, k1, true)) { -@@ -448,7 +450,9 @@ +@@ -470,7 +472,9 @@ continue; } -- block.func_149697_b(p_150079_1_, i1, j1, k1, p_150079_1_.getBlockMetadata(i1, j1, k1), 0); +- block.dropBlockAsItem(p_150079_1_, i1, j1, k1, p_150079_1_.getBlockMetadata(i1, j1, k1), 0); + //With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior. + float chance = block instanceof BlockSnow ? -1.0f : 1.0f; -+ block.func_149690_a(p_150079_1_, i1, j1, k1, p_150079_1_.getBlockMetadata(i1, j1, k1), chance, 0); - p_150079_1_.func_147468_f(i1, j1, k1); ++ block.dropBlockAsItemWithChance(p_150079_1_, i1, j1, k1, p_150079_1_.getBlockMetadata(i1, j1, k1), chance, 0); + p_150079_1_.setBlockToAir(i1, j1, k1); } } diff --git a/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch b/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch index 8d652a060e..20889869f1 100644 --- a/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/block/BlockPumpkin.java +++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java -@@ -113,7 +113,7 @@ - - public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) +@@ -116,7 +116,7 @@ + // JAVADOC METHOD $$ func_149742_c + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).field_149764_J.isReplaceable() && World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_); -+ return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).isReplaceable(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_); +- return p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_).blockMaterial.isReplaceable() && World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_); ++ return p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_).isReplaceable(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && World.doesBlockHaveSolidTopSurface(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_); } - public void func_149689_a(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) + // JAVADOC METHOD $$ func_149689_a diff --git a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch b/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch index 06fd3ca764..2243b91949 100644 --- a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch @@ -17,16 +17,16 @@ } protected BlockRailBase(boolean p_i45389_1_) -@@ -78,7 +79,7 @@ - - public int func_149645_b() +@@ -85,7 +86,7 @@ + // JAVADOC METHOD $$ func_149645_b + public int getRenderType() { - return 9; + return renderType; } - public int func_149745_a(Random p_149745_1_) -@@ -193,6 +194,111 @@ + // JAVADOC METHOD $$ func_149745_a +@@ -205,6 +206,111 @@ } } @@ -42,7 +42,7 @@ + */ + public boolean isFlexibleRail(IBlockAccess world, int y, int x, int z) + { -+ return func_150050_e(); ++ return isPowered(); + } + + /** @@ -87,7 +87,7 @@ + public int getBasicRailMetadata(IBlockAccess world, EntityMinecart cart, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); -+ if(func_150050_e()) ++ if(isPowered()) + { + meta = meta & 7; + } @@ -138,7 +138,7 @@ public class Rail { private World field_150660_b; -@@ -202,6 +308,7 @@ +@@ -214,6 +320,7 @@ private final boolean field_150656_f; private List field_150657_g = new ArrayList(); private static final String __OBFID = "CL_00000196"; @@ -146,11 +146,11 @@ public Rail(World p_i45388_2_, int p_i45388_3_, int p_i45388_4_, int p_i45388_5_) { -@@ -209,19 +316,10 @@ +@@ -221,19 +328,10 @@ this.field_150661_c = p_i45388_3_; this.field_150658_d = p_i45388_4_; this.field_150659_e = p_i45388_5_; -- Block block = p_i45388_2_.func_147439_a(p_i45388_3_, p_i45388_4_, p_i45388_5_); +- Block block = p_i45388_2_.getBlock(p_i45388_3_, p_i45388_4_, p_i45388_5_); - int l = p_i45388_2_.getBlockMetadata(p_i45388_3_, p_i45388_4_, p_i45388_5_); - - if (((BlockRailBase)block).field_150053_a) @@ -163,14 +163,14 @@ - this.field_150656_f = false; - } - -+ BlockRailBase block = (BlockRailBase)p_i45388_2_.func_147439_a(p_i45388_3_, p_i45388_4_, p_i45388_5_); ++ BlockRailBase block = (BlockRailBase)p_i45388_2_.getBlock(p_i45388_3_, p_i45388_4_, p_i45388_5_); + int l = block.getBasicRailMetadata(p_i45388_2_, null, p_i45388_3_, p_i45388_4_, p_i45388_5_); + this.field_150656_f = block.isFlexibleRail(p_i45388_2_, p_i45388_3_, p_i45388_4_, p_i45388_5_); + canMakeSlopes = block.canMakeSlopes(p_i45388_2_, p_i45388_3_, p_i45388_4_, p_i45388_5_); this.func_150648_a(l); } -@@ -412,7 +510,7 @@ +@@ -424,7 +522,7 @@ } } @@ -179,7 +179,7 @@ { if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1)) { -@@ -425,7 +523,7 @@ +@@ -437,7 +535,7 @@ } } @@ -188,7 +188,7 @@ { if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e)) { -@@ -570,7 +668,7 @@ +@@ -582,7 +680,7 @@ } } @@ -197,7 +197,7 @@ { if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1)) { -@@ -583,7 +681,7 @@ +@@ -595,7 +693,7 @@ } } diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch index 706b86c329..24ae97a262 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRedstoneComparator.java +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneComparator.java -@@ -228,4 +228,19 @@ +@@ -237,4 +237,19 @@ { return new TileEntityComparator(); } @@ -10,7 +10,7 @@ + { + if (y == tileY && world instanceof World) + { -+ func_149695_a((World)world, x, y, z, world.func_147439_a(tileX, tileY, tileZ)); ++ onNeighborBlockChange((World)world, x, y, z, world.getBlock(tileX, tileY, tileZ)); + } + } + diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch index 115d778cec..f2a50c2bdd 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch @@ -8,24 +8,24 @@ import net.minecraft.world.World; public class BlockRedstoneOre extends Block -@@ -88,12 +89,17 @@ - public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) +@@ -96,12 +97,17 @@ + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) { - super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + } -- if (this.func_149650_a(p_149690_5_, p_149690_1_.rand, p_149690_7_) != Item.func_150898_a(this)) +- if (this.getItemDropped(p_149690_5_, p_149690_1_.rand, p_149690_7_) != Item.getItemFromBlock(this)) + private Random rand = new Random(); + @Override // World, meta, fortune + public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_) + { -+ if (this.func_149650_a(p_149690_5_, rand, p_149690_7_) != Item.func_150898_a(this)) ++ if (this.getItemDropped(p_149690_5_, rand, p_149690_7_) != Item.getItemFromBlock(this)) { - int j1 = 1 + p_149690_1_.rand.nextInt(5); -- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1); +- this.dropXpOnBlockBreak(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1); + return 1 + rand.nextInt(5); } + return 0; } - @SideOnly(Side.CLIENT) + // JAVADOC METHOD $$ func_149734_b diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch index fbee8cc978..fc84df494d 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java -@@ -405,7 +405,7 @@ +@@ -415,7 +415,7 @@ } else if (!Blocks.unpowered_repeater.func_149907_e(block)) { -- return block.func_149744_f() && p_150174_4_ != -1; +- return block.canProvidePower() && p_150174_4_ != -1; + return block.canConnectRedstone(p_150174_0_, p_150174_1_, p_150174_2_, p_150174_3_, p_150174_4_); } else diff --git a/patches/minecraft/net/minecraft/block/BlockReed.java.patch b/patches/minecraft/net/minecraft/block/BlockReed.java.patch index 6719a85c32..7db32e8651 100644 --- a/patches/minecraft/net/minecraft/block/BlockReed.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockReed.java.patch @@ -13,18 +13,18 @@ { private static final String __OBFID = "CL_00000300"; -@@ -57,7 +61,7 @@ - public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) +@@ -59,7 +63,7 @@ + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { - Block block = p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_); -- return block == this ? true : (block != Blocks.grass && block != Blocks.dirt && block != Blocks.sand ? false : (p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_ - 1, p_149742_4_).func_149688_o() == Material.field_151586_h ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_ - 1, p_149742_4_).func_149688_o() == Material.field_151586_h ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_ - 1).func_149688_o() == Material.field_151586_h ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_ + 1).func_149688_o() == Material.field_151586_h)))); + Block block = p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_); +- return block == this ? true : (block != Blocks.grass && block != Blocks.dirt && block != Blocks.sand ? false : (p_149742_1_.getBlock(p_149742_2_ - 1, p_149742_3_ - 1, p_149742_4_).getMaterial() == Material.water ? true : (p_149742_1_.getBlock(p_149742_2_ + 1, p_149742_3_ - 1, p_149742_4_).getMaterial() == Material.water ? true : (p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_ - 1).getMaterial() == Material.water ? true : p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_ + 1).getMaterial() == Material.water)))); + return block.canSustainPlant(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_, ForgeDirection.UP, this); } - public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) -@@ -120,4 +124,22 @@ + // JAVADOC METHOD $$ func_149695_a +@@ -130,4 +134,22 @@ { - return p_149720_1_.getBiomeGenForCoords(p_149720_2_, p_149720_4_).func_150558_b(p_149720_2_, p_149720_3_, p_149720_4_); + return p_149720_1_.getBiomeGenForCoords(p_149720_2_, p_149720_4_).getBiomeGrassColor(p_149720_2_, p_149720_3_, p_149720_4_); } + + @Override diff --git a/patches/minecraft/net/minecraft/block/BlockSapling.java.patch b/patches/minecraft/net/minecraft/block/BlockSapling.java.patch index 37d9701c81..ce9966ca66 100644 --- a/patches/minecraft/net/minecraft/block/BlockSapling.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSapling.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/BlockSapling.java +++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java -@@ -71,6 +71,7 @@ +@@ -73,6 +73,7 @@ public void func_149878_d(World p_149878_1_, int p_149878_2_, int p_149878_3_, int p_149878_4_, Random p_149878_5_) { diff --git a/patches/minecraft/net/minecraft/block/BlockSkull.java.patch b/patches/minecraft/net/minecraft/block/BlockSkull.java.patch index f35f577cce..d11274fe39 100644 --- a/patches/minecraft/net/minecraft/block/BlockSkull.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSkull.java.patch @@ -8,28 +8,29 @@ import java.util.Iterator; import java.util.Random; import net.minecraft.block.material.Material; -@@ -108,8 +109,6 @@ +@@ -118,9 +119,6 @@ return p_149692_1_; } -- public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) {} +- // JAVADOC METHOD $$ func_149690_a +- public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) {} - - public void func_149681_a(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_) + // JAVADOC METHOD $$ func_149681_a + public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_) { - if (p_149681_6_.capabilities.isCreativeMode) -@@ -118,29 +117,38 @@ +@@ -130,29 +128,38 @@ p_149681_1_.setBlockMetadataWithNotify(p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 4); } -+ this.func_149697_b(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 0); ++ this.dropBlockAsItem(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 0); + - super.func_149681_a(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_); + super.onBlockHarvested(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_); } - public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) { - if (!p_149749_1_.isRemote) -+ super.func_149749_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); ++ super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + + @Override @@ -39,8 +40,8 @@ { if ((p_149749_6_ & 8) == 0) { - ItemStack itemstack = new ItemStack(Items.skull, 1, this.func_149643_k(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_)); - TileEntitySkull tileentityskull = (TileEntitySkull)p_149749_1_.func_147438_o(p_149749_2_, p_149749_3_, p_149749_4_); + ItemStack itemstack = new ItemStack(Items.skull, 1, this.getDamageValue(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_)); + TileEntitySkull tileentityskull = (TileEntitySkull)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + if (tileentityskull == null) return ret; + @@ -50,13 +51,13 @@ itemstack.getTagCompound().setString("SkullOwner", tileentityskull.func_145907_c()); } -- this.func_149642_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, itemstack); +- this.dropBlockAsItem(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, itemstack); + ret.add(itemstack); } - -- super.func_149749_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); +- super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); } + return ret; } - public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) diff --git a/patches/minecraft/net/minecraft/block/BlockSnow.java.patch b/patches/minecraft/net/minecraft/block/BlockSnow.java.patch index 8cd05fd1c0..83c8795c4a 100644 --- a/patches/minecraft/net/minecraft/block/BlockSnow.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSnow.java.patch @@ -1,53 +1,54 @@ --- ../src-base/minecraft/net/minecraft/block/BlockSnow.java +++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java -@@ -73,7 +73,7 @@ - public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) +@@ -79,7 +79,7 @@ + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { - Block block = p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_); -- return block != Blocks.ice && block != Blocks.packed_ice ? (block.func_149688_o() == Material.field_151584_j ? true : (block == this && (p_149742_1_.getBlockMetadata(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.func_149662_c() && block.field_149764_J.blocksMovement())) : false; -+ return block != Blocks.ice && block != Blocks.packed_ice ? (block.isLeaves(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : (block == this && (p_149742_1_.getBlockMetadata(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.func_149662_c() && block.field_149764_J.blocksMovement())) : false; + Block block = p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_); +- return block != Blocks.ice && block != Blocks.packed_ice ? (block.getMaterial() == Material.leaves ? true : (block == this && (p_149742_1_.getBlockMetadata(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false; ++ return block != Blocks.ice && block != Blocks.packed_ice ? (block.isLeaves(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : (block == this && (p_149742_1_.getBlockMetadata(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false; } - public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) -@@ -85,7 +85,6 @@ + // JAVADOC METHOD $$ func_149695_a +@@ -92,7 +92,6 @@ { - if (!this.func_149742_c(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_)) + if (!this.canPlaceBlockAt(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_)) { -- this.func_149697_b(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_, p_150155_1_.getBlockMetadata(p_150155_2_, p_150155_3_, p_150155_4_), 0); - p_150155_1_.func_147468_f(p_150155_2_, p_150155_3_, p_150155_4_); +- this.dropBlockAsItem(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_, p_150155_1_.getBlockMetadata(p_150155_2_, p_150155_3_, p_150155_4_), 0); + p_150155_1_.setBlockToAir(p_150155_2_, p_150155_3_, p_150155_4_); return false; } -@@ -97,10 +96,8 @@ - - public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) +@@ -105,10 +104,8 @@ + // JAVADOC METHOD $$ func_149636_a + public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { - int i1 = p_149636_6_ & 7; -- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Items.snowball, i1 + 1, 0)); -+ super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); - p_149636_1_.func_147468_f(p_149636_3_, p_149636_4_, p_149636_5_); -- p_149636_2_.addStat(StatList.mineBlockStatArray[Block.func_149682_b(this)], 1); +- this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Items.snowball, i1 + 1, 0)); ++ super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + p_149636_1_.setBlockToAir(p_149636_3_, p_149636_4_, p_149636_5_); +- p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); } - public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) -@@ -110,14 +107,13 @@ - - public int func_149745_a(Random p_149745_1_) + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) +@@ -119,7 +116,7 @@ + // JAVADOC METHOD $$ func_149745_a + public int quantityDropped(Random p_149745_1_) { - return 0; + return 1; } - public void func_149674_a(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) + // JAVADOC METHOD $$ func_149674_a +@@ -127,7 +124,6 @@ { if (p_149674_1_.getSavedLightValue(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11) { -- this.func_149697_b(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_), 0); - p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_); +- this.dropBlockAsItem(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_), 0); + p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); } } -@@ -127,4 +123,34 @@ +@@ -138,4 +134,34 @@ { - return p_149646_5_ == 1 ? true : super.func_149646_a(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); + return p_149646_5_ == 1 ? true : super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); } + + /** @@ -77,6 +78,6 @@ + public boolean isReplaceable(IBlockAccess world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); -+ return meta >= 7 ? false : field_149764_J.isReplaceable(); ++ return meta >= 7 ? false : blockMaterial.isReplaceable(); + } } diff --git a/patches/minecraft/net/minecraft/block/BlockStem.java.patch b/patches/minecraft/net/minecraft/block/BlockStem.java.patch index 3211562155..041984ed9b 100644 --- a/patches/minecraft/net/minecraft/block/BlockStem.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockStem.java.patch @@ -16,17 +16,17 @@ public class BlockStem extends BlockBush implements IGrowable { -@@ -101,7 +103,7 @@ +@@ -103,7 +105,7 @@ - Block block = p_149674_1_.func_147439_a(j1, p_149674_3_ - 1, k1); + Block block = p_149674_1_.getBlock(j1, p_149674_3_ - 1, k1); -- if (p_149674_1_.func_147439_a(j1, p_149674_3_, k1).field_149764_J == Material.field_151579_a && (block == Blocks.farmland || block == Blocks.dirt || block == Blocks.grass)) -+ if (p_149674_1_.func_147437_c(j1, p_149674_3_, k1) && (block.canSustainPlant(p_149674_1_, j1, p_149674_3_ - 1, k1, UP, this) || block == Blocks.dirt || block == Blocks.grass)) +- if (p_149674_1_.getBlock(j1, p_149674_3_, k1).blockMaterial == Material.air && (block == Blocks.farmland || block == Blocks.dirt || block == Blocks.grass)) ++ if (p_149674_1_.isAirBlock(j1, p_149674_3_, k1) && (block.canSustainPlant(p_149674_1_, j1, p_149674_3_ - 1, k1, UP, this) || block == Blocks.dirt || block == Blocks.grass)) { - p_149674_1_.func_147449_b(j1, p_149674_3_, k1, this.field_149877_a); + p_149674_1_.setBlock(j1, p_149674_3_, k1, this.field_149877_a); } -@@ -144,11 +146,11 @@ - Block block8 = p_149875_1_.func_147439_a(l, p_149875_3_ - 1, i1); +@@ -146,11 +148,11 @@ + Block block8 = p_149875_1_.getBlock(l, p_149875_3_ - 1, i1); float f1 = 0.0F; - if (block8 == Blocks.farmland) @@ -39,23 +39,23 @@ { f1 = 3.0F; } -@@ -215,6 +217,7 @@ +@@ -224,6 +226,7 @@ { - super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + /* if (!p_149690_1_.isRemote) { Item item = null; -@@ -237,6 +240,7 @@ +@@ -246,6 +249,7 @@ } } } + */ } - public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) -@@ -282,4 +286,22 @@ + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) +@@ -293,4 +297,22 @@ { this.func_149874_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_); } diff --git a/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch b/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch index b3680e9dec..51fa903f9c 100644 --- a/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch @@ -20,30 +20,30 @@ { private static final String[] field_149871_a = new String[] {"deadbush", "tallgrass", "fern"}; @SideOnly(Side.CLIENT) -@@ -71,7 +74,7 @@ +@@ -75,7 +78,7 @@ - public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { - return p_149650_2_.nextInt(8) == 0 ? Items.wheat_seeds : null; + return null; } - public int func_149679_a(int p_149679_1_, Random p_149679_2_) -@@ -81,13 +84,7 @@ - - public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) + // JAVADOC METHOD $$ func_149679_a +@@ -87,13 +90,7 @@ + // JAVADOC METHOD $$ func_149636_a + public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { - if (!p_149636_1_.isRemote && p_149636_2_.getCurrentEquippedItem() != null && p_149636_2_.getCurrentEquippedItem().getItem() == Items.shears) { -- p_149636_2_.addStat(StatList.mineBlockStatArray[Block.func_149682_b(this)], 1); -- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.tallgrass, 1, p_149636_6_)); +- p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); +- this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.tallgrass, 1, p_149636_6_)); - } - else - { - super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); } } -@@ -143,4 +140,28 @@ +@@ -151,4 +148,28 @@ Blocks.double_plant.func_149889_c(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, b0, 2); } } diff --git a/patches/minecraft/net/minecraft/block/BlockTorch.java.patch b/patches/minecraft/net/minecraft/block/BlockTorch.java.patch index f4663e01ee..939491edd1 100644 --- a/patches/minecraft/net/minecraft/block/BlockTorch.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTorch.java.patch @@ -8,18 +8,19 @@ public class BlockTorch extends Block { -@@ -51,13 +52,17 @@ +@@ -55,14 +56,18 @@ else { - Block block = p_150107_1_.func_147439_a(p_150107_2_, p_150107_3_, p_150107_4_); + Block block = p_150107_1_.getBlock(p_150107_2_, p_150107_3_, p_150107_4_); - return block == Blocks.fence || block == Blocks.nether_brick_fence || block == Blocks.glass || block == Blocks.cobblestone_wall; + return block.canPlaceTorchOnTop(p_150107_1_, p_150107_2_, p_150107_3_, p_150107_4_); } } - public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + // JAVADOC METHOD $$ func_149742_c + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return p_149742_1_.func_147445_c(p_149742_2_ - 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_ + 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_, p_149742_3_, p_149742_4_ - 1, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_, p_149742_3_, p_149742_4_ + 1, true) ? true : this.func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_)))); +- return p_149742_1_.isBlockNormalCubeDefault(p_149742_2_ - 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.isBlockNormalCubeDefault(p_149742_2_ + 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.isBlockNormalCubeDefault(p_149742_2_, p_149742_3_, p_149742_4_ - 1, true) ? true : (p_149742_1_.isBlockNormalCubeDefault(p_149742_2_, p_149742_3_, p_149742_4_ + 1, true) ? true : this.func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_)))); + return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST, true) || + p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST, true) || + p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH, true) || @@ -27,81 +28,81 @@ + func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_); } - public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) -@@ -69,22 +74,22 @@ + // JAVADOC METHOD $$ func_149660_a +@@ -75,22 +80,22 @@ j1 = 5; } -- if (p_149660_5_ == 2 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true)) +- if (p_149660_5_ == 2 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true)) + if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH, true)) { j1 = 4; } -- if (p_149660_5_ == 3 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true)) +- if (p_149660_5_ == 3 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true)) + if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH, true)) { j1 = 3; } -- if (p_149660_5_ == 4 && p_149660_1_.func_147445_c(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true)) +- if (p_149660_5_ == 4 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true)) + if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST, true)) { j1 = 2; } -- if (p_149660_5_ == 5 && p_149660_1_.func_147445_c(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true)) +- if (p_149660_5_ == 5 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true)) + if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST, true)) { j1 = 1; } -@@ -106,19 +111,19 @@ +@@ -114,19 +119,19 @@ { if (p_149726_1_.getBlockMetadata(p_149726_2_, p_149726_3_, p_149726_4_) == 0) { -- if (p_149726_1_.func_147445_c(p_149726_2_ - 1, p_149726_3_, p_149726_4_, true)) +- if (p_149726_1_.isBlockNormalCubeDefault(p_149726_2_ - 1, p_149726_3_, p_149726_4_, true)) + if (p_149726_1_.isSideSolid(p_149726_2_ - 1, p_149726_3_, p_149726_4_, EAST, true)) { p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 1, 2); } -- else if (p_149726_1_.func_147445_c(p_149726_2_ + 1, p_149726_3_, p_149726_4_, true)) +- else if (p_149726_1_.isBlockNormalCubeDefault(p_149726_2_ + 1, p_149726_3_, p_149726_4_, true)) + else if (p_149726_1_.isSideSolid(p_149726_2_ + 1, p_149726_3_, p_149726_4_, WEST, true)) { p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 2, 2); } -- else if (p_149726_1_.func_147445_c(p_149726_2_, p_149726_3_, p_149726_4_ - 1, true)) +- else if (p_149726_1_.isBlockNormalCubeDefault(p_149726_2_, p_149726_3_, p_149726_4_ - 1, true)) + else if (p_149726_1_.isSideSolid(p_149726_2_, p_149726_3_, p_149726_4_ - 1, SOUTH, true)) { p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 3, 2); } -- else if (p_149726_1_.func_147445_c(p_149726_2_, p_149726_3_, p_149726_4_ + 1, true)) +- else if (p_149726_1_.isBlockNormalCubeDefault(p_149726_2_, p_149726_3_, p_149726_4_ + 1, true)) + else if (p_149726_1_.isSideSolid(p_149726_2_, p_149726_3_, p_149726_4_ + 1, NORTH, true)) { p_149726_1_.setBlockMetadataWithNotify(p_149726_2_, p_149726_3_, p_149726_4_, 4, 2); } -@@ -143,22 +148,22 @@ +@@ -152,22 +157,22 @@ int l = p_150108_1_.getBlockMetadata(p_150108_2_, p_150108_3_, p_150108_4_); boolean flag = false; -- if (!p_150108_1_.func_147445_c(p_150108_2_ - 1, p_150108_3_, p_150108_4_, true) && l == 1) +- if (!p_150108_1_.isBlockNormalCubeDefault(p_150108_2_ - 1, p_150108_3_, p_150108_4_, true) && l == 1) + if (!p_150108_1_.isSideSolid(p_150108_2_ - 1, p_150108_3_, p_150108_4_, EAST, true) && l == 1) { flag = true; } -- if (!p_150108_1_.func_147445_c(p_150108_2_ + 1, p_150108_3_, p_150108_4_, true) && l == 2) +- if (!p_150108_1_.isBlockNormalCubeDefault(p_150108_2_ + 1, p_150108_3_, p_150108_4_, true) && l == 2) + if (!p_150108_1_.isSideSolid(p_150108_2_ + 1, p_150108_3_, p_150108_4_, WEST, true) && l == 2) { flag = true; } -- if (!p_150108_1_.func_147445_c(p_150108_2_, p_150108_3_, p_150108_4_ - 1, true) && l == 3) +- if (!p_150108_1_.isBlockNormalCubeDefault(p_150108_2_, p_150108_3_, p_150108_4_ - 1, true) && l == 3) + if (!p_150108_1_.isSideSolid(p_150108_2_, p_150108_3_, p_150108_4_ - 1, SOUTH, true) && l == 3) { flag = true; } -- if (!p_150108_1_.func_147445_c(p_150108_2_, p_150108_3_, p_150108_4_ + 1, true) && l == 4) +- if (!p_150108_1_.isBlockNormalCubeDefault(p_150108_2_, p_150108_3_, p_150108_4_ + 1, true) && l == 4) + if (!p_150108_1_.isSideSolid(p_150108_2_, p_150108_3_, p_150108_4_ + 1, NORTH, true) && l == 4) { flag = true; diff --git a/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch b/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch index c24abf8041..8583073fe6 100644 --- a/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch @@ -13,37 +13,37 @@ private static final String __OBFID = "CL_00000327"; protected BlockTrapDoor(Material p_i45434_1_) -@@ -163,7 +166,7 @@ +@@ -173,7 +176,7 @@ --i1; } -- if (!func_150119_a(p_149695_1_.func_147439_a(i1, p_149695_3_, j1))) -+ if (!(func_150119_a(p_149695_1_.func_147439_a(i1, p_149695_3_, j1)) || p_149695_1_.isSideSolid(i1, p_149695_3_, j1, ForgeDirection.getOrientation((l & 3) + 2)))) +- if (!func_150119_a(p_149695_1_.getBlock(i1, p_149695_3_, j1))) ++ if (!(func_150119_a(p_149695_1_.getBlock(i1, p_149695_3_, j1)) || p_149695_1_.isSideSolid(i1, p_149695_3_, j1, ForgeDirection.getOrientation((l & 3) + 2)))) { - p_149695_1_.func_147468_f(p_149695_2_, p_149695_3_, p_149695_4_); - this.func_149697_b(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, l, 0); -@@ -218,6 +221,7 @@ - - public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, l, 0); +@@ -231,6 +234,7 @@ + // JAVADOC METHOD $$ func_149707_d + public boolean canPlaceBlockOnSide(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) { + if (disableValidation) return true; if (p_149707_5_ == 0) { return false; -@@ -248,7 +252,7 @@ +@@ -261,7 +265,7 @@ --p_149707_2_; } -- return func_150119_a(p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_)); -+ return func_150119_a(p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_)) || p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_, ForgeDirection.UP); +- return func_150119_a(p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_)); ++ return func_150119_a(p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_)) || p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_, ForgeDirection.UP); } } -@@ -259,6 +263,7 @@ +@@ -272,6 +276,7 @@ private static boolean func_150119_a(Block p_150119_0_) { + if (disableValidation) return true; - return p_150119_0_.field_149764_J.isOpaque() && p_150119_0_.func_149686_d() || p_150119_0_ == Blocks.glowstone || p_150119_0_ instanceof BlockSlab || p_150119_0_ instanceof BlockStairs; + return p_150119_0_.blockMaterial.isOpaque() && p_150119_0_.renderAsNormalBlock() || p_150119_0_ == Blocks.glowstone || p_150119_0_ instanceof BlockSlab || p_150119_0_ instanceof BlockStairs; } } diff --git a/patches/minecraft/net/minecraft/block/BlockTripWireHook.java.patch b/patches/minecraft/net/minecraft/block/BlockTripWireHook.java.patch index 08b97c0d34..de38069940 100644 --- a/patches/minecraft/net/minecraft/block/BlockTripWireHook.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTripWireHook.java.patch @@ -10,11 +10,11 @@ public class BlockTripWireHook extends Block { private static final String __OBFID = "CL_00000329"; -@@ -47,34 +50,41 @@ - - public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) +@@ -53,13 +56,20 @@ + // JAVADOC METHOD $$ func_149707_d + public boolean canPlaceBlockOnSide(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) { -- return p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r())); +- return p_149707_5_ == 2 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ + 1).isNormalCube() ? true : (p_149707_5_ == 3 && p_149707_1_.getBlock(p_149707_2_, p_149707_3_, p_149707_4_ - 1).isNormalCube() ? true : (p_149707_5_ == 4 && p_149707_1_.getBlock(p_149707_2_ + 1, p_149707_3_, p_149707_4_).isNormalCube() ? true : p_149707_5_ == 5 && p_149707_1_.getBlock(p_149707_2_ - 1, p_149707_3_, p_149707_4_).isNormalCube())); + ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_); + return (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) || + (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) || @@ -22,74 +22,76 @@ + (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST )); } - public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + // JAVADOC METHOD $$ func_149742_c + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) { -- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r())); +- return p_149742_1_.getBlock(p_149742_2_ - 1, p_149742_3_, p_149742_4_).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_ + 1, p_149742_3_, p_149742_4_).isNormalCube() ? true : (p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ - 1).isNormalCube() ? true : p_149742_1_.getBlock(p_149742_2_, p_149742_3_, p_149742_4_ + 1).isNormalCube())); + return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) || + p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) || + p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) || + p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH); } - public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) + // JAVADOC METHOD $$ func_149660_a +@@ -67,22 +77,22 @@ { byte b0 = 0; -- if (p_149660_5_ == 2 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true)) +- if (p_149660_5_ == 2 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true)) + if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH, true)) { b0 = 2; } -- if (p_149660_5_ == 3 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true)) +- if (p_149660_5_ == 3 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true)) + if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH, true)) { b0 = 0; } -- if (p_149660_5_ == 4 && p_149660_1_.func_147445_c(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true)) +- if (p_149660_5_ == 4 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true)) + if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST, true)) { b0 = 1; } -- if (p_149660_5_ == 5 && p_149660_1_.func_147445_c(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true)) +- if (p_149660_5_ == 5 && p_149660_1_.isBlockNormalCubeDefault(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true)) + if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST, true)) { b0 = 3; } -@@ -97,22 +107,22 @@ +@@ -107,22 +117,22 @@ int i1 = l & 3; boolean flag = false; -- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && i1 == 3) +- if (!p_149695_1_.getBlock(p_149695_2_ - 1, p_149695_3_, p_149695_4_).isNormalCube() && i1 == 3) + if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && i1 == 3) { flag = true; } -- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && i1 == 1) +- if (!p_149695_1_.getBlock(p_149695_2_ + 1, p_149695_3_, p_149695_4_).isNormalCube() && i1 == 1) + if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && i1 == 1) { flag = true; } -- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && i1 == 0) +- if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ - 1).isNormalCube() && i1 == 0) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && i1 == 0) { flag = true; } -- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && i1 == 2) +- if (!p_149695_1_.getBlock(p_149695_2_, p_149695_3_, p_149695_4_ + 1).isNormalCube() && i1 == 2) + if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && i1 == 2) { flag = true; } -@@ -133,7 +143,7 @@ +@@ -143,7 +153,7 @@ boolean flag3 = (p_150136_6_ & 8) == 8; boolean flag4 = !p_150136_5_; boolean flag5 = false; -- boolean flag6 = !World.func_147466_a(p_150136_1_, p_150136_2_, p_150136_3_ - 1, p_150136_4_); +- boolean flag6 = !World.doesBlockHaveSolidTopSurface(p_150136_1_, p_150136_2_, p_150136_3_ - 1, p_150136_4_); + boolean flag6 = !p_150136_1_.isSideSolid(p_150136_2_, p_150136_3_ - 1, p_150136_4_, UP); int l1 = Direction.offsetX[k1]; int i2 = Direction.offsetZ[k1]; diff --git a/patches/minecraft/net/minecraft/block/BlockVine.java.patch b/patches/minecraft/net/minecraft/block/BlockVine.java.patch index 26c4bdd5a2..93d2548370 100644 --- a/patches/minecraft/net/minecraft/block/BlockVine.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockVine.java.patch @@ -24,18 +24,18 @@ { private static final String __OBFID = "CL_00000330"; -@@ -375,14 +379,28 @@ - - public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) +@@ -389,14 +393,28 @@ + // JAVADOC METHOD $$ func_149636_a + public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) { - if (!p_149636_1_.isRemote && p_149636_2_.getCurrentEquippedItem() != null && p_149636_2_.getCurrentEquippedItem().getItem() == Items.shears) { -- p_149636_2_.addStat(StatList.mineBlockStatArray[Block.func_149682_b(this)], 1); -- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.vine, 1, 0)); +- p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); +- this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.vine, 1, 0)); - } - else - { - super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); } } + diff --git a/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/patches/minecraft/net/minecraft/client/Minecraft.java.patch index b131501bf6..9e2a377a96 100644 --- a/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/patches/minecraft/net/minecraft/client/Minecraft.java.patch @@ -18,9 +18,9 @@ @@ -274,7 +282,7 @@ this.startTimerHackThread(); this.session = par1Session; - field_147123_G.info("Setting user: " + par1Session.getUsername()); -- field_147123_G.info("(Session ID is " + par1Session.getSessionID() + ")"); -+ //field_147123_G.info("(Session ID is " + par1Session.getSessionID() + ")"); //don't print the session to the console.. that's stupid... + logger.info("Setting user: " + par1Session.getUsername()); +- logger.info("(Session ID is " + par1Session.getSessionID() + ")"); ++ //logger.info("(Session ID is " + par1Session.getSessionID() + ")"); //don't print the session to the console.. that's stupid... this.isDemo = par5; this.displayWidth = par2; this.displayHeight = par3; @@ -42,19 +42,19 @@ if (this.serverName != null) { -@@ -733,11 +741,6 @@ - - public void func_147108_a(GuiScreen p_147108_1_) +@@ -734,11 +742,6 @@ + // JAVADOC METHOD $$ func_147108_a + public void displayGuiScreen(GuiScreen p_147108_1_) { - if (this.currentScreen != null) - { -- this.currentScreen.func_146281_b(); +- this.currentScreen.onGuiClosed(); - } - if (p_147108_1_ == null && this.theWorld == null) { p_147108_1_ = new GuiMainMenu(); -@@ -747,6 +750,17 @@ +@@ -748,6 +751,17 @@ p_147108_1_ = new GuiGameOver(); } @@ -66,13 +66,13 @@ + p_147108_1_ = event.gui; + if (old != null && p_147108_1_ != old) + { -+ old.func_146281_b(); ++ old.onGuiClosed(); + } + if (p_147108_1_ instanceof GuiMainMenu) { this.gameSettings.showDebugInfo = false; -@@ -1337,7 +1351,7 @@ +@@ -1339,7 +1353,7 @@ if (this.thePlayer.isCurrentToolAdventureModeExempt(i, j, k)) { @@ -81,12 +81,12 @@ this.thePlayer.swingItem(); } } -@@ -1418,11 +1432,12 @@ +@@ -1420,11 +1434,12 @@ int j = this.objectMouseOver.blockY; int k = this.objectMouseOver.blockZ; -- if (this.theWorld.func_147439_a(i, j, k).func_149688_o() != Material.field_151579_a) -+ if (!this.theWorld.func_147439_a(i, j, k).isAir(theWorld, i, j, k)) +- if (this.theWorld.getBlock(i, j, k).getMaterial() != Material.air) ++ if (!this.theWorld.getBlock(i, j, k).isAir(theWorld, i, j, k)) { int l = itemstack != null ? itemstack.stackSize : 0; @@ -96,7 +96,7 @@ { flag = false; this.thePlayer.swingItem(); -@@ -1449,7 +1464,8 @@ +@@ -1451,7 +1466,8 @@ { ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem(); @@ -106,7 +106,7 @@ { this.entityRenderer.itemRenderer.resetEquippedProgress2(); } -@@ -1651,6 +1667,8 @@ +@@ -1653,6 +1669,8 @@ while (Mouse.next()) { @@ -115,7 +115,7 @@ i = Mouse.getEventButton(); if (isRunningOnMac && i == 0 && (Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157))) -@@ -2121,6 +2139,11 @@ +@@ -2123,6 +2141,11 @@ // JAVADOC METHOD $$ func_71353_a public void loadWorld(WorldClient par1WorldClient, String par2Str) { @@ -126,8 +126,8 @@ + if (par1WorldClient == null) { - NetHandlerPlayClient nethandlerplayclient = this.func_147114_u(); -@@ -2133,6 +2156,18 @@ + NetHandlerPlayClient nethandlerplayclient = this.getNetHandler(); +@@ -2135,6 +2158,18 @@ if (this.theIntegratedServer != null) { this.theIntegratedServer.initiateShutdown(); @@ -146,7 +146,7 @@ } this.theIntegratedServer = null; -@@ -2288,113 +2323,10 @@ +@@ -2290,113 +2325,10 @@ if (this.objectMouseOver != null) { boolean flag = this.thePlayer.capabilities.isCreativeMode; @@ -160,14 +160,14 @@ - j = this.objectMouseOver.blockX; - int k = this.objectMouseOver.blockY; - int l = this.objectMouseOver.blockZ; -- Block block = this.theWorld.func_147439_a(j, k, l); +- Block block = this.theWorld.getBlock(j, k, l); - -- if (block.func_149688_o() == Material.field_151579_a) +- if (block.getMaterial() == Material.air) - { - return; - } - -- item = block.func_149694_d(this.theWorld, j, k, l); +- item = block.getItem(this.theWorld, j, k, l); - - if (item == null) - { @@ -175,8 +175,8 @@ - } - - flag1 = item.getHasSubtypes(); -- Block block1 = item instanceof ItemBlock && !block.func_149648_K() ? Block.func_149634_a(item) : block; -- i = block1.func_149643_k(this.theWorld, j, k, l); +- Block block1 = item instanceof ItemBlock && !block.isFlowerPot() ? Block.getBlockFromItem(item) : block; +- i = block1.getDamageValue(this.theWorld, j, k, l); - } - else - { @@ -262,7 +262,7 @@ if (flag) { j = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + this.thePlayer.inventory.currentItem; -@@ -2564,9 +2496,16 @@ +@@ -2566,9 +2498,16 @@ par1PlayerUsageSnooper.addData("gl_max_texture_size", Integer.valueOf(getGLMaximumTextureSize())); } @@ -279,7 +279,7 @@ for (int i = 16384; i > 0; i >>= 1) { GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, i, i, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)null); -@@ -2574,6 +2513,7 @@ +@@ -2576,6 +2515,7 @@ if (j != 0) { diff --git a/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch b/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch index 9c60d31aae..26f95ffd8c 100644 --- a/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch +++ b/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch @@ -12,7 +12,7 @@ @SideOnly(Side.CLIENT) public class SoundManager { -@@ -69,6 +74,7 @@ +@@ -81,6 +86,7 @@ { SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class); SoundSystemConfig.setCodec("ogg", CodecJOrbis.class); @@ -20,11 +20,11 @@ } catch (SoundSystemException soundsystemexception) { -@@ -80,6 +86,7 @@ +@@ -92,6 +98,7 @@ { - this.func_148613_b(); - this.func_148608_i(); + this.unloadSoundSystem(); + this.loadSoundSystem(); + MinecraftForge.EVENT_BUS.post(new SoundLoadEvent(this)); } - private synchronized void func_148608_i() + // JAVADOC METHOD $$ func_148608_i diff --git a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch index 80b87a3f50..cb2d4da3f0 100644 --- a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch +++ b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch @@ -20,7 +20,7 @@ // JAVADOC METHOD $$ func_71053_j @@ -494,20 +497,45 @@ - return this.worldObj.func_147439_a(par1, par2, par3).func_149721_r(); + return this.worldObj.getBlock(par1, par2, par3).isNormalCube(); } + private boolean isHeadspaceFree(int x, int y, int z, int height) @@ -70,7 +70,7 @@ byte b0 = -1; double d5 = 9999.0D; -@@ -595,6 +623,12 @@ +@@ -596,6 +624,12 @@ public void playSound(String par1Str, float par2, float par3) { diff --git a/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch index ca485e7aec..9ed0f3cd13 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch @@ -16,20 +16,20 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.lwjgl.input.Keyboard; -@@ -134,6 +136,7 @@ +@@ -139,6 +141,7 @@ public void func_146403_a(String p_146403_1_) { - this.field_146297_k.ingameGUI.func_146158_b().func_146239_a(p_146403_1_); -+ if (ClientCommandHandler.instance.executeCommand(field_146297_k.thePlayer, p_146403_1_) == 1) return; - this.field_146297_k.thePlayer.sendChatMessage(p_146403_1_); + this.mc.ingameGUI.getChatGUI().addToSentMessages(p_146403_1_); ++ if (ClientCommandHandler.instance.executeCommand(mc.thePlayer, p_146403_1_) == 1) return; + this.mc.thePlayer.sendChatMessage(p_146403_1_); } -@@ -309,13 +312,14 @@ - this.field_146297_k.ingameGUI.func_146158_b().func_146234_a(new ChatComponentText(stringbuilder.toString()), 1); +@@ -315,13 +318,14 @@ + this.mc.ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new ChatComponentText(stringbuilder.toString()), 1); } -- this.field_146415_a.func_146191_b((String)this.field_146412_t.get(this.field_146413_s++)); -+ this.field_146415_a.func_146191_b(EnumChatFormatting.func_110646_a((String)this.field_146412_t.get(this.field_146413_s++))); +- this.inputField.writeText((String)this.field_146412_t.get(this.field_146413_s++)); ++ this.inputField.writeText(EnumChatFormatting.getTextWithoutFormattingCodes((String)this.field_146412_t.get(this.field_146413_s++))); } private void func_146405_a(String p_146405_1_, String p_146405_2_) @@ -37,10 +37,10 @@ if (p_146405_1_.length() >= 1) { + ClientCommandHandler.instance.autoComplete(p_146405_1_, p_146405_2_); - this.field_146297_k.thePlayer.sendQueue.func_147297_a(new C14PacketTabComplete(p_146405_1_)); + this.mc.thePlayer.sendQueue.addToSendQueue(new C14PacketTabComplete(p_146405_1_)); this.field_146414_r = true; } -@@ -438,6 +442,13 @@ +@@ -445,6 +449,13 @@ String[] astring1 = p_146406_1_; int i = p_146406_1_.length; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch index 368e709b7e..e7a3a6e414 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch @@ -1,20 +1,20 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java -@@ -322,7 +322,7 @@ +@@ -323,7 +323,7 @@ } - else if (p_146284_1_.field_146127_k == 8) + else if (p_146284_1_.id == 8) { -- this.field_146297_k.func_147108_a(new GuiCreateFlatWorld(this, this.field_146334_a)); -+ WorldType.worldTypes[field_146331_K].onCustomizeButton(field_146297_k, this); +- this.mc.displayGuiScreen(new GuiCreateFlatWorld(this, this.field_146334_a)); ++ WorldType.worldTypes[field_146331_K].onCustomizeButton(mc, this); } } } -@@ -340,7 +340,7 @@ - this.field_146326_C.field_146125_m = this.field_146344_y; - this.field_146320_D.field_146125_m = this.field_146344_y; - this.field_146321_E.field_146125_m = this.field_146344_y; -- this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.worldTypes[this.field_146331_K] == WorldType.FLAT; -+ this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.worldTypes[this.field_146331_K].isCustomizable(); +@@ -341,7 +341,7 @@ + this.field_146326_C.visible = this.field_146344_y; + this.field_146320_D.visible = this.field_146344_y; + this.field_146321_E.visible = this.field_146344_y; +- this.field_146322_F.visible = this.field_146344_y && WorldType.worldTypes[this.field_146331_K] == WorldType.FLAT; ++ this.field_146322_F.visible = this.field_146344_y && WorldType.worldTypes[this.field_146331_K].isCustomizable(); if (this.field_146344_y) { diff --git a/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch index 5cd478c243..1d121f7ced 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch @@ -9,10 +9,10 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -630,6 +631,7 @@ - this.drawString(this.field_146289_q, brd, 2, this.field_146295_m - ( 10 + i * (this.field_146289_q.FONT_HEIGHT + 1)), 16777215); + this.drawString(this.fontRendererObj, brd, 2, this.height - ( 10 + i * (this.fontRendererObj.FONT_HEIGHT + 1)), 16777215); } } -+ ForgeHooksClient.renderMainMenu(this, field_146289_q, field_146294_l, field_146295_m); ++ ForgeHooksClient.renderMainMenu(this, fontRendererObj, width, height); String s1 = "Copyright Mojang AB. Do not distribute!"; - this.drawString(this.field_146289_q, s1, this.field_146294_l - this.field_146289_q.getStringWidth(s1) - 2, this.field_146295_m - 10, -1); + this.drawString(this.fontRendererObj, s1, this.width - this.fontRendererObj.getStringWidth(s1) - 2, this.height - 10, -1); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch index bbc6785065..a25263176e 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch @@ -1,20 +1,20 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiScreen.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreen.java -@@ -113,7 +113,9 @@ +@@ -123,7 +123,9 @@ } } + FontRenderer font = p_146285_1_.getItem().getFontRenderer(p_146285_1_); this.func_146283_a(list, p_146285_2_, p_146285_3_); -+ drawHoveringText(list, p_146285_2_, p_146285_3_, (font == null ? field_146289_q : font)); ++ drawHoveringText(list, p_146285_2_, p_146285_3_, (font == null ? fontRendererObj : font)); } - protected void func_146279_a(String p_146279_1_, int p_146279_2_, int p_146279_3_) -@@ -123,6 +125,11 @@ + // JAVADOC METHOD $$ func_146279_a +@@ -134,6 +136,11 @@ protected void func_146283_a(List p_146283_1_, int p_146283_2_, int p_146283_3_) { -+ drawHoveringText(p_146283_1_, p_146283_2_, p_146283_3_, field_146289_q); ++ drawHoveringText(p_146283_1_, p_146283_2_, p_146283_3_, fontRendererObj); + } + + protected void drawHoveringText(List p_146283_1_, int p_146283_2_, int p_146283_3_, FontRenderer font) @@ -22,20 +22,20 @@ if (!p_146283_1_.isEmpty()) { GL11.glDisable(GL12.GL_RESCALE_NORMAL); -@@ -135,7 +142,7 @@ +@@ -146,7 +153,7 @@ while (iterator.hasNext()) { String s = (String)iterator.next(); -- int l = this.field_146289_q.getStringWidth(s); +- int l = this.fontRendererObj.getStringWidth(s); + int l = font.getStringWidth(s); if (l > k) { -@@ -180,7 +187,7 @@ +@@ -191,7 +198,7 @@ for (int i2 = 0; i2 < p_146283_1_.size(); ++i2) { String s1 = (String)p_146283_1_.get(i2); -- this.field_146289_q.drawStringWithShadow(s1, j2, k2, -1); +- this.fontRendererObj.drawStringWithShadow(s1, j2, k2, -1); + font.drawStringWithShadow(s1, j2, k2, -1); if (i2 == 0) diff --git a/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch index 3ec68ae06b..8aeda2329c 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch @@ -1,39 +1,39 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiSlot.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiSlot.java -@@ -294,16 +294,7 @@ +@@ -314,16 +314,7 @@ GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_FOG); Tessellator tessellator = Tessellator.instance; -- this.field_148161_k.getTextureManager().bindTexture(Gui.optionsBackground); +- this.mc.getTextureManager().bindTexture(Gui.optionsBackground); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float f1 = 32.0F; - tessellator.startDrawingQuads(); - tessellator.setColorOpaque_I(2105376); -- tessellator.addVertexWithUV((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1)); -- tessellator.addVertexWithUV((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1)); -- tessellator.addVertexWithUV((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1)); -- tessellator.addVertexWithUV((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1)); +- tessellator.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1)); +- tessellator.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1)); +- tessellator.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1)); +- tessellator.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1)); - tessellator.draw(); + drawContainerBackground(tessellator); - l1 = this.field_148152_e + this.field_148155_a / 2 - this.func_148139_c() / 2 + 2; - i2 = this.field_148153_b + 4 - (int)this.field_148169_q; + l1 = this.left + this.width / 2 - this.getListWidth() / 2 + 2; + i2 = this.top + 4 - (int)this.amountScrolled; -@@ -475,4 +466,18 @@ +@@ -499,4 +490,18 @@ { - return this.field_148149_f; + return this.slotHeight; } + + protected void drawContainerBackground(Tessellator tessellator) + { -+ this.field_148161_k.getTextureManager().bindTexture(Gui.optionsBackground); ++ this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + float f1 = 32.0F; + tessellator.startDrawingQuads(); + tessellator.setColorOpaque_I(2105376); -+ tessellator.addVertexWithUV((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1)); -+ tessellator.addVertexWithUV((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1)); -+ tessellator.addVertexWithUV((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1)); -+ tessellator.addVertexWithUV((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1)); ++ tessellator.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1)); ++ tessellator.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1)); ++ tessellator.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1)); ++ tessellator.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1)); + tessellator.draw(); + } } diff --git a/patches/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch b/patches/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch index 3bcc5de8b6..48069d6d69 100644 --- a/patches/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch @@ -37,26 +37,26 @@ // JAVADOC METHOD $$ func_73866_w_ @@ -66,6 +81,7 @@ - this.field_146297_k.func_147114_u().func_147297_a(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS)); - this.field_146292_n.clear(); - this.field_146292_n.add(new GuiOptionButton(1, this.field_146294_l / 2 + 24, this.field_146295_m / 2 + 74, 80, 20, I18n.getStringParams("gui.done", new Object[0]))); -+ this.field_146292_n.add(button = new GuiButton(2, (field_146294_l - field_146555_f) / 2 + 24, field_146295_m / 2 + 74, 125, 20, AchievementPage.getTitle(currentPage))); + this.mc.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS)); + this.buttonList.clear(); + this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.format("gui.done", new Object[0]))); ++ this.buttonList.add(button = new GuiButton(2, (width - field_146555_f) / 2 + 24, height / 2 + 74, 125, 20, AchievementPage.getTitle(currentPage))); } - protected void func_146284_a(GuiButton p_146284_1_) + protected void actionPerformed(GuiButton p_146284_1_) @@ -76,6 +92,16 @@ { - this.field_146297_k.func_147108_a(this.field_146562_a); + this.mc.displayGuiScreen(this.field_146562_a); } + -+ if (p_146284_1_.field_146127_k == 2) ++ if (p_146284_1_.id == 2) + { + currentPage++; + if (currentPage >= AchievementPage.getAchievementPages().size()) + { + currentPage = -1; + } -+ button.field_146126_j = AchievementPage.getTitle(currentPage); ++ button.displayString = AchievementPage.getTitle(currentPage); + } } } diff --git a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch index df5434a8b8..eeb56f9f17 100644 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch @@ -8,29 +8,29 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.RenderHelper; -@@ -114,7 +115,11 @@ +@@ -123,7 +124,11 @@ } } + //Forge: Force lighting to be disabled as there are some issue where lighting would + //incorrectly be applied based on items that are in the inventory. + GL11.glDisable(GL11.GL_LIGHTING); - this.func_146979_b(par1, par2); + this.drawGuiContainerForegroundLayer(par1, par2); + GL11.glEnable(GL11.GL_LIGHTING); - InventoryPlayer inventoryplayer = this.field_146297_k.thePlayer.inventory; - ItemStack itemstack = this.field_147012_x == null ? inventoryplayer.getItemStack() : this.field_147012_x; + InventoryPlayer inventoryplayer = this.mc.thePlayer.inventory; + ItemStack itemstack = this.draggedStack == null ? inventoryplayer.getItemStack() : this.draggedStack; -@@ -178,8 +183,11 @@ +@@ -187,8 +192,11 @@ GL11.glTranslatef(0.0F, 0.0F, 32.0F); this.zLevel = 200.0F; - field_146296_j.zLevel = 200.0F; -- field_146296_j.renderItemAndEffectIntoGUI(this.field_146289_q, this.field_146297_k.getTextureManager(), p_146982_1_, p_146982_2_, p_146982_3_); -- field_146296_j.renderItemOverlayIntoGUI(this.field_146289_q, this.field_146297_k.getTextureManager(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_); + itemRender.zLevel = 200.0F; +- itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), p_146982_1_, p_146982_2_, p_146982_3_); +- itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.draggedStack == null ? 0 : 8), p_146982_4_); + FontRenderer font = null; + if (p_146982_1_ != null) font = p_146982_1_.getItem().getFontRenderer(p_146982_1_); -+ if (font == null) font = field_146289_q; -+ field_146296_j.renderItemAndEffectIntoGUI(font, this.field_146297_k.getTextureManager(), p_146982_1_, p_146982_2_, p_146982_3_); -+ field_146296_j.renderItemOverlayIntoGUI(font, this.field_146297_k.getTextureManager(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_); ++ if (font == null) font = fontRendererObj; ++ itemRender.renderItemAndEffectIntoGUI(font, this.mc.getTextureManager(), p_146982_1_, p_146982_2_, p_146982_3_); ++ itemRender.renderItemOverlayIntoGUI(font, this.mc.getTextureManager(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.draggedStack == null ? 0 : 8), p_146982_4_); this.zLevel = 0.0F; - field_146296_j.zLevel = 0.0F; + itemRender.zLevel = 0.0F; } diff --git a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch index 1200314f8d..43e1dd78b8 100644 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java +++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java -@@ -49,6 +49,8 @@ +@@ -53,6 +53,8 @@ private boolean field_147057_D; private CreativeCrafting field_147059_E; private static final String __OBFID = "CL_00000752"; @@ -9,7 +9,7 @@ public GuiContainerCreative(EntityPlayer par1EntityPlayer) { -@@ -186,7 +188,7 @@ +@@ -190,7 +192,7 @@ return; } @@ -18,47 +18,47 @@ { if (p_146984_3_ == 0) { -@@ -262,6 +264,13 @@ - this.func_147050_b(CreativeTabs.creativeTabArray[i]); - this.field_147059_E = new CreativeCrafting(this.field_146297_k); - this.field_146297_k.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_147059_E); +@@ -266,6 +268,13 @@ + this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[i]); + this.field_147059_E = new CreativeCrafting(this.mc); + this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_147059_E); + int tabCount = CreativeTabs.creativeTabArray.length; + if (tabCount > 12) + { -+ field_146292_n.add(new GuiButton(101, field_147003_i, field_147009_r - 50, 20, 20, "<")); -+ field_146292_n.add(new GuiButton(102, field_147003_i + field_146999_f - 20, field_147009_r - 50, 20, 20, ">")); ++ buttonList.add(new GuiButton(101, guiLeft, guiTop - 50, 20, 20, "<")); ++ buttonList.add(new GuiButton(102, guiLeft + xSize - 20, guiTop - 50, 20, 20, ">")); + maxPages = ((tabCount - 12) / 10) + 1; + } } else { -@@ -284,7 +293,7 @@ +@@ -289,7 +298,7 @@ // JAVADOC METHOD $$ func_73869_a protected void keyTyped(char par1, int par2) { -- if (field_147058_w != CreativeTabs.tabAllSearch.getTabIndex()) -+ if (!CreativeTabs.creativeTabArray[field_147058_w].hasSearchBar()) +- if (selectedTabIndex != CreativeTabs.tabAllSearch.getTabIndex()) ++ if (!CreativeTabs.creativeTabArray[selectedTabIndex].hasSearchBar()) { - if (GameSettings.isKeyDown(this.field_146297_k.gameSettings.keyBindChat)) + if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat)) { -@@ -321,6 +330,15 @@ +@@ -326,6 +335,15 @@ { - GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h; - containercreative.field_148330_a.clear(); + GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots; + containercreative.itemList.clear(); + -+ CreativeTabs tab = CreativeTabs.creativeTabArray[field_147058_w]; ++ CreativeTabs tab = CreativeTabs.creativeTabArray[selectedTabIndex]; + if (tab.hasSearchBar() && tab != CreativeTabs.tabAllSearch) + { -+ tab.displayAllReleventItems(containercreative.field_148330_a); ++ tab.displayAllReleventItems(containercreative.itemList); + updateFilteredItems(containercreative); + return; + } + - Iterator iterator = Item.field_150901_e.iterator(); + Iterator iterator = Item.itemRegistry.iterator(); while (iterator.hasNext()) -@@ -332,7 +350,13 @@ - item.func_150895_a(item, (CreativeTabs)null, containercreative.field_148330_a); +@@ -337,7 +355,13 @@ + item.getSubItems(item, (CreativeTabs)null, containercreative.itemList); } } + updateFilteredItems(containercreative); @@ -71,16 +71,16 @@ Enchantment[] aenchantment = Enchantment.enchantmentsList; int j = aenchantment.length; -@@ -386,7 +410,7 @@ +@@ -392,7 +416,7 @@ { - CreativeTabs creativetabs = CreativeTabs.creativeTabArray[field_147058_w]; + CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex]; - if (creativetabs.drawInForegroundOfTab()) + if (creativetabs != null && creativetabs.drawInForegroundOfTab()) { GL11.glDisable(GL11.GL_BLEND); - this.field_146289_q.drawString(I18n.getStringParams(creativetabs.getTranslatedTabLabel(), new Object[0]), 8, 6, 4210752); -@@ -407,7 +431,7 @@ + this.fontRendererObj.drawString(I18n.format(creativetabs.getTranslatedTabLabel(), new Object[0]), 8, 6, 4210752); +@@ -413,7 +437,7 @@ { CreativeTabs creativetabs = acreativetabs[k1]; @@ -89,39 +89,39 @@ { return; } -@@ -430,7 +454,7 @@ +@@ -437,7 +461,7 @@ { CreativeTabs creativetabs = acreativetabs[k1]; - if (this.func_147049_a(creativetabs, l, i1)) + if (creativetabs != null && this.func_147049_a(creativetabs, l, i1)) { - this.func_147050_b(creativetabs); + this.setCurrentCreativeTab(creativetabs); return; -@@ -443,11 +467,13 @@ - - private boolean func_147055_p() +@@ -451,11 +475,13 @@ + // JAVADOC METHOD $$ func_147055_p + private boolean needsScrollBars() { -+ if (CreativeTabs.creativeTabArray[field_147058_w] == null) return false; - return field_147058_w != CreativeTabs.tabInventory.getTabIndex() && CreativeTabs.creativeTabArray[field_147058_w].shouldHidePlayerInventory() && ((GuiContainerCreative.ContainerCreative)this.field_147002_h).func_148328_e(); ++ if (CreativeTabs.creativeTabArray[selectedTabIndex] == null) return false; + return selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && CreativeTabs.creativeTabArray[selectedTabIndex].shouldHidePlayerInventory() && ((GuiContainerCreative.ContainerCreative)this.inventorySlots).func_148328_e(); } - private void func_147050_b(CreativeTabs p_147050_1_) + private void setCurrentCreativeTab(CreativeTabs p_147050_1_) { + if (p_147050_1_ == null) return; - int i = field_147058_w; - field_147058_w = p_147050_1_.getTabIndex(); - GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h; -@@ -516,7 +542,7 @@ + int i = selectedTabIndex; + selectedTabIndex = p_147050_1_.getTabIndex(); + GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots; +@@ -524,7 +550,7 @@ - if (this.field_147062_A != null) + if (this.searchField != null) { - if (p_147050_1_ == CreativeTabs.tabAllSearch) + if (p_147050_1_.hasSearchBar()) { - this.field_147062_A.func_146189_e(true); - this.field_147062_A.func_146205_d(false); -@@ -613,23 +639,45 @@ + this.searchField.setVisible(true); + this.searchField.setCanLoseFocus(false); +@@ -622,23 +648,45 @@ super.drawScreen(par1, par2, par3); CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray; @@ -137,39 +137,39 @@ CreativeTabs creativetabs = acreativetabs[j2]; + if (creativetabs == null) continue; - if (this.func_147052_b(creativetabs, par1, par2)) + if (this.renderCreativeInventoryHoveringText(creativetabs, par1, par2)) { + rendered = true; break; } } -+ if (!rendered && func_147052_b(CreativeTabs.tabAllSearch, par1, par2)) ++ if (!rendered && renderCreativeInventoryHoveringText(CreativeTabs.tabAllSearch, par1, par2)) + { -+ func_147052_b(CreativeTabs.tabInventory, par1, par2); ++ renderCreativeInventoryHoveringText(CreativeTabs.tabInventory, par1, par2); + } + - if (this.field_147064_C != null && field_147058_w == CreativeTabs.tabInventory.getTabIndex() && this.func_146978_c(this.field_147064_C.xDisplayPosition, this.field_147064_C.yDisplayPosition, 16, 16, par1, par2)) + if (this.field_147064_C != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.func_146978_c(this.field_147064_C.xDisplayPosition, this.field_147064_C.yDisplayPosition, 16, 16, par1, par2)) { - this.func_146279_a(I18n.getStringParams("inventory.binSlot", new Object[0]), par1, par2); + this.drawCreativeTabHoveringText(I18n.format("inventory.binSlot", new Object[0]), par1, par2); } + if (maxPages != 0) + { + String page = String.format("%d / %d", tabPage + 1, maxPages + 1); -+ int width = field_146289_q.getStringWidth(page); ++ int width = fontRendererObj.getStringWidth(page); + GL11.glDisable(GL11.GL_LIGHTING); + this.zLevel = 300.0F; -+ field_146296_j.zLevel = 300.0F; -+ field_146289_q.drawString(page, field_147003_i + (field_146999_f / 2) - (width / 2), field_147009_r - 44, -1); ++ itemRender.zLevel = 300.0F; ++ fontRendererObj.drawString(page, guiLeft + (xSize / 2) - (width / 2), guiTop - 44, -1); + this.zLevel = 0.0F; -+ field_146296_j.zLevel = 0.0F; ++ itemRender.zLevel = 0.0F; + } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_LIGHTING); } -@@ -698,17 +746,37 @@ +@@ -707,17 +755,37 @@ int k = acreativetabs.length; int l; @@ -181,11 +181,11 @@ + for (l = start; l < k; ++l) { CreativeTabs creativetabs1 = acreativetabs[l]; - this.field_146297_k.getTextureManager().bindTexture(field_147061_u); + this.mc.getTextureManager().bindTexture(field_147061_u); + if (creativetabs1 == null) continue; + - if (creativetabs1.getTabIndex() != field_147058_w) + if (creativetabs1.getTabIndex() != selectedTabIndex) { this.func_147051_a(creativetabs1); } @@ -195,21 +195,21 @@ + { + if (creativetabs != CreativeTabs.tabAllSearch) + { -+ this.field_146297_k.getTextureManager().bindTexture(field_147061_u); ++ this.mc.getTextureManager().bindTexture(field_147061_u); + func_147051_a(CreativeTabs.tabAllSearch); + } + if (creativetabs != CreativeTabs.tabInventory) + { -+ this.field_146297_k.getTextureManager().bindTexture(field_147061_u); ++ this.mc.getTextureManager().bindTexture(field_147061_u); + func_147051_a(CreativeTabs.tabInventory); + } + } + - this.field_146297_k.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.getBackgroundImageName())); - this.drawTexturedModalRect(this.field_147003_i, this.field_147009_r, 0, 0, this.field_146999_f, this.field_147000_g); - this.field_147062_A.func_146194_f(); -@@ -723,6 +791,14 @@ - this.drawTexturedModalRect(i1, k + (int)((float)(l - k - 17) * this.field_147067_x), 232 + (this.func_147055_p() ? 0 : 12), 0, 12, 15); + this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.getBackgroundImageName())); + this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); + this.searchField.drawTextBox(); +@@ -732,6 +800,14 @@ + this.drawTexturedModalRect(i1, k + (int)((float)(l - k - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15); } + if (creativetabs == null || creativetabs.getTabPage() != tabPage) @@ -223,7 +223,7 @@ this.func_147051_a(creativetabs); if (creativetabs == CreativeTabs.tabInventory) -@@ -733,6 +809,15 @@ +@@ -742,6 +818,15 @@ protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_) { @@ -239,24 +239,24 @@ int k = p_147049_1_.getTabColumn(); int l = 28 * k; byte b0 = 0; -@@ -833,6 +918,7 @@ +@@ -843,6 +928,7 @@ } GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor3f(1F, 1F, 1F); //Forge: Reset color in case Items change it. this.drawTexturedModalRect(l, i1, j, k, 28, b0); this.zLevel = 100.0F; - field_146296_j.zLevel = 100.0F; -@@ -859,6 +945,15 @@ + itemRender.zLevel = 100.0F; +@@ -869,6 +955,15 @@ { - this.field_146297_k.func_147108_a(new GuiStats(this, this.field_146297_k.thePlayer.func_146107_m())); + this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter())); } + -+ if (p_146284_1_.field_146127_k == 101) ++ if (p_146284_1_.id == 101) + { + tabPage = Math.max(tabPage - 1, 0); + } -+ else if (p_146284_1_.field_146127_k == 102) ++ else if (p_146284_1_.id == 102) + { + tabPage = Math.min(tabPage + 1, maxPages); + } diff --git a/patches/minecraft/net/minecraft/client/gui/mco/GuiScreenCreateOnlineWorld.java.patch b/patches/minecraft/net/minecraft/client/gui/mco/GuiScreenCreateOnlineWorld.java.patch index adfb095cbc..e02350c181 100644 --- a/patches/minecraft/net/minecraft/client/gui/mco/GuiScreenCreateOnlineWorld.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/mco/GuiScreenCreateOnlineWorld.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/client/gui/mco/GuiScreenCreateOnlineWorld.java +++ ../src-work/minecraft/net/minecraft/client/gui/mco/GuiScreenCreateOnlineWorld.java -@@ -207,7 +207,7 @@ - GuiScreenCreateOnlineWorld.field_146765_a.error("Couldn\'t create world"); +@@ -208,7 +208,7 @@ + GuiScreenCreateOnlineWorld.logger.error("Couldn\'t create world"); this.func_148416_a(unsupportedencodingexception.getLocalizedMessage()); } - catch (IOException ioexception) + catch (@SuppressWarnings("hiding") IOException ioexception) { - GuiScreenCreateOnlineWorld.field_146765_a.error("Could not parse response creating world"); + GuiScreenCreateOnlineWorld.logger.error("Could not parse response creating world"); this.func_148416_a(ioexception.getLocalizedMessage()); diff --git a/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch index d09963d294..22e71c9200 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch @@ -11,7 +11,7 @@ @SideOnly(Side.CLIENT) public class PlayerControllerMP { -@@ -104,6 +108,12 @@ +@@ -105,6 +109,12 @@ // JAVADOC METHOD $$ func_78751_a public boolean onPlayerDestroyBlock(int par1, int par2, int par3, int par4) { @@ -24,20 +24,20 @@ if (this.currentGameType.isAdventure() && !this.mc.thePlayer.isCurrentToolAdventureModeExempt(par1, par2, par3)) { return false; -@@ -125,7 +135,7 @@ +@@ -126,7 +136,7 @@ { - worldclient.playAuxSFX(2001, par1, par2, par3, Block.func_149682_b(block) + (worldclient.getBlockMetadata(par1, par2, par3) << 12)); + worldclient.playAuxSFX(2001, par1, par2, par3, Block.getIdFromBlock(block) + (worldclient.getBlockMetadata(par1, par2, par3) << 12)); int i1 = worldclient.getBlockMetadata(par1, par2, par3); -- boolean flag = worldclient.func_147468_f(par1, par2, par3); +- boolean flag = worldclient.setBlockToAir(par1, par2, par3); + boolean flag = block.removedByPlayer(worldclient, mc.thePlayer, par1, par2, par3); if (flag) { -@@ -326,11 +336,18 @@ +@@ -327,11 +337,18 @@ float f2 = (float)par8Vec3.zCoord - (float)par6; boolean flag = false; -- if ((!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null) && par2World.func_147439_a(par4, par5, par6).func_149727_a(par2World, par4, par5, par6, par1EntityPlayer, par7, f, f1, f2)) +- if ((!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null) && par2World.getBlock(par4, par5, par6).onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, f, f1, f2)) + if (par3ItemStack != null && + par3ItemStack.getItem() != null && + par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7, f, f1, f2)) @@ -48,13 +48,13 @@ + if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null || par1EntityPlayer.getHeldItem().getItem().doesSneakBypassUse(par2World, par4, par5, par6, par1EntityPlayer)) + { -+ flag = par2World.func_147439_a(par4, par5, par6).func_149727_a(par2World, par4, par5, par6, par1EntityPlayer, par7, f, f1, f2); ++ flag = par2World.getBlock(par4, par5, par6).onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, f, f1, f2); + } + if (!flag && par3ItemStack != null && par3ItemStack.getItem() instanceof ItemBlock) { ItemBlock itemblock = (ItemBlock)par3ItemStack.getItem(); -@@ -362,7 +379,15 @@ +@@ -363,7 +380,15 @@ } else { @@ -71,7 +71,7 @@ } } -@@ -382,9 +407,10 @@ +@@ -383,9 +408,10 @@ { par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = itemstack1; diff --git a/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch index 308156244a..50eddb0e2d 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch @@ -15,7 +15,7 @@ this.sendQueue = p_i45063_1_; this.difficultySetting = p_i45063_4_; - this.setSpawnLocation(8, 64, 8); - this.mapStorage = p_i45063_1_.field_147305_a; + this.mapStorage = p_i45063_1_.mapStorageOrigin; + this.isRemote = true; + this.finishSetup(); + this.setSpawnLocation(8, 64, 8); diff --git a/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch b/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch index 898ad38783..464b2edf07 100644 --- a/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch +++ b/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch @@ -9,26 +9,26 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -675,7 +677,11 @@ - - public void func_147251_a(S02PacketChat p_147251_1_) +@@ -706,7 +708,11 @@ + // JAVADOC METHOD $$ func_147251_a + public void handleChat(S02PacketChat p_147251_1_) { -- this.field_147299_f.ingameGUI.func_146158_b().func_146227_a(p_147251_1_.func_148915_c()); +- this.gameController.ingameGUI.getChatGUI().printChatMessage(p_147251_1_.func_148915_c()); + ClientChatReceivedEvent event = new ClientChatReceivedEvent(p_147251_1_.func_148915_c()); + if (!MinecraftForge.EVENT_BUS.post(event) && event.message != null) + { -+ this.field_147299_f.ingameGUI.func_146158_b().func_146227_a(event.message); ++ this.gameController.ingameGUI.getChatGUI().printChatMessage(event.message); + } } - public void func_147279_a(S0BPacketAnimation p_147279_1_) -@@ -1115,6 +1121,10 @@ + // JAVADOC METHOD $$ func_147279_a +@@ -1160,6 +1166,10 @@ { - tileentity.func_145839_a(p_147273_1_.func_148857_g()); + tileentity.readFromNBT(p_147273_1_.func_148857_g()); } + else + { -+ tileentity.onDataPacket(field_147302_e, p_147273_1_); ++ tileentity.onDataPacket(netManager, p_147273_1_); + } } } diff --git a/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch b/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch index a02a7a1d6e..b7984404c9 100644 --- a/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch @@ -51,9 +51,9 @@ } @@ -221,7 +228,7 @@ - public void func_147215_a(int p_147215_1_, int p_147215_2_, int p_147215_3_, Block p_147215_4_, int p_147215_5_) + public void addBlockDestroyEffects(int p_147215_1_, int p_147215_2_, int p_147215_3_, Block p_147215_4_, int p_147215_5_) { -- if (p_147215_4_.func_149688_o() != Material.field_151579_a) +- if (p_147215_4_.getMaterial() != Material.air) + if (!p_147215_4_.isAir(worldObj, p_147215_1_, p_147215_2_, p_147215_3_) && !p_147215_4_.addDestroyEffects(worldObj, p_147215_1_, p_147215_2_, p_147215_3_, p_147215_5_, this)) { byte b0 = 4; @@ -65,7 +65,7 @@ + + public void addBlockHitEffects(int x, int y, int z, MovingObjectPosition target) + { -+ Block block = worldObj.func_147439_a(x, y, z); ++ Block block = worldObj.getBlock(x, y, z); + if (block != null && !block.addHitEffects(worldObj, target, this)) + { + addBlockHitEffects(x, y, z, target.sideHit); diff --git a/patches/minecraft/net/minecraft/client/particle/EntityDiggingFX.java.patch b/patches/minecraft/net/minecraft/client/particle/EntityDiggingFX.java.patch index fef78c6158..6c691a33cb 100644 --- a/patches/minecraft/net/minecraft/client/particle/EntityDiggingFX.java.patch +++ b/patches/minecraft/net/minecraft/client/particle/EntityDiggingFX.java.patch @@ -15,9 +15,9 @@ + { super(par1World, par2, par4, par6, par8, par10, par12); this.field_145784_a = par14Block; -- this.setParticleIcon(par14Block.func_149691_a(0, par15)); -+ this.setParticleIcon(par14Block.func_149691_a(side, par15)); - this.particleGravity = par14Block.field_149763_I; +- this.setParticleIcon(par14Block.getIcon(0, par15)); ++ this.setParticleIcon(par14Block.getIcon(side, par15)); + this.particleGravity = par14Block.blockParticleGravity; this.particleRed = this.particleGreen = this.particleBlue = 0.6F; this.particleScale /= 2.0F; + this.side = side; diff --git a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch index d37299fa91..a50787dd26 100644 --- a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch @@ -52,7 +52,7 @@ if (!this.mc.gameSettings.debugCamEnable) { -- Block block = this.mc.theWorld.func_147439_a(MathHelper.floor_double(entitylivingbase.posX), MathHelper.floor_double(entitylivingbase.posY), MathHelper.floor_double(entitylivingbase.posZ)); +- Block block = this.mc.theWorld.getBlock(MathHelper.floor_double(entitylivingbase.posX), MathHelper.floor_double(entitylivingbase.posY), MathHelper.floor_double(entitylivingbase.posZ)); - - if (block == Blocks.bed) - { @@ -70,7 +70,7 @@ RenderHelper.enableStandardItemLighting(); this.mc.mcProfiler.endStartSection("entities"); + ForgeHooksClient.setRenderPass(0); - renderglobal.func_147589_a(entitylivingbase, frustrum, par1); + renderglobal.renderEntities(entitylivingbase, frustrum, par1); + ForgeHooksClient.setRenderPass(0); + // ToDo: Try and figure out how to make particles render sorted correctly.. {They render behind water} this.enableLightmap((double)par1); @@ -102,7 +102,7 @@ this.mc.mcProfiler.endStartSection("destroyProgress"); GL11.glEnable(GL11.GL_BLEND); - OpenGlHelper.func_148821_a(770, 1, 1, 0); + OpenGlHelper.glBlendFunc(770, 1, 1, 0); - renderglobal.drawBlockDamageTexture(Tessellator.instance, (EntityPlayer)entitylivingbase, par1); + renderglobal.drawBlockDamageTexture(Tessellator.instance, entitylivingbase, par1); GL11.glDisable(GL11.GL_BLEND); @@ -117,7 +117,7 @@ + RenderHelper.enableStandardItemLighting(); + this.mc.mcProfiler.endStartSection("entities"); + ForgeHooksClient.setRenderPass(1); -+ renderglobal.func_147589_a(entitylivingbase, frustrum, par1); ++ renderglobal.renderEntities(entitylivingbase, frustrum, par1); + ForgeHooksClient.setRenderPass(-1); + RenderHelper.disableStandardItemLighting(); + } diff --git a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch index e583927097..a91fb43165 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch @@ -29,22 +29,22 @@ + this.renderItem(par1EntityLivingBase, par2ItemStack, par3, EQUIPPED); + } + -+ // JAVADOC METHOD $$ func_78443_a ++ // JAVADOC METHOD $$ renderItem + public void renderItem(EntityLivingBase par1EntityLivingBase, ItemStack par2ItemStack, int par3, ItemRenderType type) + { GL11.glPushMatrix(); TextureManager texturemanager = this.mc.getTextureManager(); Item item = par2ItemStack.getItem(); - Block block = Block.func_149634_a(item); + Block block = Block.getBlockFromItem(item); -- if (par2ItemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.func_147739_a(block.func_149645_b())) +- if (par2ItemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())) + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(par2ItemStack, type); + if (customRenderer != null) { + texturemanager.bindTexture(texturemanager.getResourceLocation(par2ItemStack.getItemSpriteNumber())); -+ ForgeHooksClient.renderEquippedItem(type, customRenderer, field_147720_h, par1EntityLivingBase, par2ItemStack); ++ ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, par1EntityLivingBase, par2ItemStack); + } -+ else if (par2ItemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.func_147739_a(block.func_149645_b())) ++ else if (par2ItemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())) + { texturemanager.bindTexture(texturemanager.getResourceLocation(0)); @@ -79,10 +79,10 @@ + + if (custom == null) { -- this.mc.entityRenderer.func_147701_i().func_148250_a(mapdata, false); +- this.mc.entityRenderer.getMapItemRenderer().func_148250_a(mapdata, false); + if (mapdata != null) + { -+ this.mc.entityRenderer.func_147701_i().func_148250_a(mapdata, false); ++ this.mc.entityRenderer.getMapItemRenderer().func_148250_a(mapdata, false); + } } + else diff --git a/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch b/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch index b6cdb1c1d8..284d48eac3 100644 --- a/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java +++ ../src-work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java @@ -27,6 +27,10 @@ - public static boolean field_148824_g; + public static boolean shadersSupported; private static final String __OBFID = "CL_00001179"; + /* Stores the last values sent into setLightmapTextureCoords */ @@ -23,4 +23,4 @@ + } } - public static void func_148821_a(int p_148821_0_, int p_148821_1_, int p_148821_2_, int p_148821_3_) + public static void glBlendFunc(int p_148821_0_, int p_148821_1_, int p_148821_2_, int p_148821_3_) diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderBlocks.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderBlocks.java.patch index 208e963054..862b45d87b 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderBlocks.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/RenderBlocks.java.patch @@ -9,101 +9,101 @@ @SideOnly(Side.CLIENT) public class RenderBlocks { -@@ -336,9 +338,9 @@ - public boolean func_147773_v(Block p_147773_1_, int p_147773_2_, int p_147773_3_, int p_147773_4_) +@@ -414,9 +416,9 @@ + public boolean renderBlockBed(Block p_147773_1_, int p_147773_2_, int p_147773_3_, int p_147773_4_) { Tessellator tessellator = Tessellator.instance; -- int l = this.field_147845_a.getBlockMetadata(p_147773_2_, p_147773_3_, p_147773_4_); -- int i1 = BlockBed.func_149895_l(l); -- boolean flag = BlockBed.func_149975_b(l); -+ Block bed = this.field_147845_a.func_147439_a(p_147773_2_, p_147773_3_, p_147773_4_); -+ int i1 = bed.getBedDirection(field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_); -+ boolean flag = bed.isBedFoot(field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_); +- int l = this.blockAccess.getBlockMetadata(p_147773_2_, p_147773_3_, p_147773_4_); +- int i1 = BlockBed.getDirection(l); +- boolean flag = BlockBed.isBlockHeadOfBed(l); ++ Block bed = this.blockAccess.getBlock(p_147773_2_, p_147773_3_, p_147773_4_); ++ int i1 = bed.getBedDirection(blockAccess, p_147773_2_, p_147773_3_, p_147773_4_); ++ boolean flag = bed.isBedFoot(blockAccess, p_147773_2_, p_147773_3_, p_147773_4_); float f = 0.5F; float f1 = 1.0F; float f2 = 0.8F; -@@ -347,6 +349,7 @@ +@@ -425,6 +427,7 @@ tessellator.setBrightness(j1); tessellator.setColorOpaque_F(f, f, f); - IIcon iicon = this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 0); -+ if (func_147744_b()) iicon = field_147840_d; //BugFix Proper breaking texture on underside + IIcon iicon = this.getBlockIcon(p_147773_1_, this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_, 0); ++ if (hasOverrideBlockTexture()) iicon = overrideBlockTexture; //BugFix Proper breaking texture on underside double d0 = (double)iicon.getMinU(); double d1 = (double)iicon.getMaxU(); double d2 = (double)iicon.getMinV(); -@@ -363,6 +366,7 @@ - tessellator.setBrightness(p_147773_1_.func_149677_c(this.field_147845_a, p_147773_2_, p_147773_3_ + 1, p_147773_4_)); +@@ -441,6 +444,7 @@ + tessellator.setBrightness(p_147773_1_.getMixedBrightnessForBlock(this.blockAccess, p_147773_2_, p_147773_3_ + 1, p_147773_4_)); tessellator.setColorOpaque_F(f1, f1, f1); - iicon = this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 1); -+ if (func_147744_b()) iicon = field_147840_d; //BugFix Proper breaking texture on underside + iicon = this.getBlockIcon(p_147773_1_, this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_, 1); ++ if (hasOverrideBlockTexture()) iicon = overrideBlockTexture; //BugFix Proper breaking texture on underside d0 = (double)iicon.getMinU(); d1 = (double)iicon.getMaxU(); d2 = (double)iicon.getMinV(); -@@ -2037,7 +2041,7 @@ +@@ -2135,7 +2139,7 @@ double d9; double d10; -- if (!World.func_147466_a(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.fire.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_)) -+ if (!World.func_147466_a(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.fire.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_, UP)) +- if (!World.doesBlockHaveSolidTopSurface(this.blockAccess, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.fire.canBlockCatchFire(this.blockAccess, p_147801_2_, p_147801_3_ - 1, p_147801_4_)) ++ if (!World.doesBlockHaveSolidTopSurface(this.blockAccess, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_, p_147801_3_ - 1, p_147801_4_, UP)) { float f2 = 0.2F; float f1 = 0.0625F; -@@ -2057,7 +2061,7 @@ +@@ -2155,7 +2159,7 @@ d0 = d5; } -- if (Blocks.fire.func_149844_e(this.field_147845_a, p_147801_2_ - 1, p_147801_3_, p_147801_4_)) -+ if (Blocks.fire.canCatchFire(this.field_147845_a, p_147801_2_ - 1, p_147801_3_, p_147801_4_, EAST)) +- if (Blocks.fire.canBlockCatchFire(this.blockAccess, p_147801_2_ - 1, p_147801_3_, p_147801_4_)) ++ if (Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_ - 1, p_147801_3_, p_147801_4_, EAST)) { tessellator.addVertexWithUV((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1); tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1), d2, d3); -@@ -2069,7 +2073,7 @@ +@@ -2167,7 +2171,7 @@ tessellator.addVertexWithUV((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1); } -- if (Blocks.fire.func_149844_e(this.field_147845_a, p_147801_2_ + 1, p_147801_3_, p_147801_4_)) -+ if (Blocks.fire.canCatchFire(this.field_147845_a, p_147801_2_ + 1, p_147801_3_, p_147801_4_, WEST)) +- if (Blocks.fire.canBlockCatchFire(this.blockAccess, p_147801_2_ + 1, p_147801_3_, p_147801_4_)) ++ if (Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_ + 1, p_147801_3_, p_147801_4_, WEST)) { tessellator.addVertexWithUV((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1); tessellator.addVertexWithUV((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d0, d3); -@@ -2081,7 +2085,7 @@ +@@ -2179,7 +2183,7 @@ tessellator.addVertexWithUV((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1); } -- if (Blocks.fire.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ - 1)) -+ if (Blocks.fire.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ - 1, SOUTH)) +- if (Blocks.fire.canBlockCatchFire(this.blockAccess, p_147801_2_, p_147801_3_, p_147801_4_ - 1)) ++ if (Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_, p_147801_3_, p_147801_4_ - 1, SOUTH)) { tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d2, d1); tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d2, d3); -@@ -2093,7 +2097,7 @@ +@@ -2191,7 +2195,7 @@ tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d2, d1); } -- if (Blocks.fire.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ + 1)) -+ if (Blocks.fire.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ + 1, NORTH)) +- if (Blocks.fire.canBlockCatchFire(this.blockAccess, p_147801_2_, p_147801_3_, p_147801_4_ + 1)) ++ if (Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_, p_147801_3_, p_147801_4_ + 1, NORTH)) { tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d0, d1); tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1 - 0), d0, d3); -@@ -2105,7 +2109,7 @@ +@@ -2203,7 +2207,7 @@ tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d0, d1); } -- if (Blocks.fire.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_ + 1, p_147801_4_)) -+ if (Blocks.fire.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_ + 1, p_147801_4_, DOWN)) +- if (Blocks.fire.canBlockCatchFire(this.blockAccess, p_147801_2_, p_147801_3_ + 1, p_147801_4_)) ++ if (Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_, p_147801_3_ + 1, p_147801_4_, DOWN)) { d5 = (double)p_147801_2_ + 0.5D + 0.5D; d6 = (double)p_147801_2_ + 0.5D - 0.5D; -@@ -3118,10 +3122,10 @@ +@@ -3217,10 +3221,10 @@ double d16 = (double)p_147767_2_ + 0.5D + 0.0625D; double d17 = (double)p_147767_4_ + 0.5D - 0.0625D; double d18 = (double)p_147767_4_ + 0.5D + 0.0625D; -- boolean flag = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_, p_147767_3_, p_147767_4_ - 1)); -- boolean flag1 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_, p_147767_3_, p_147767_4_ + 1)); -- boolean flag2 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_ - 1, p_147767_3_, p_147767_4_)); -- boolean flag3 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_ + 1, p_147767_3_, p_147767_4_)); -+ boolean flag = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_, p_147767_3_, p_147767_4_ - 1, NORTH); -+ boolean flag1 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_, p_147767_3_, p_147767_4_ + 1, SOUTH); -+ boolean flag2 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_ - 1, p_147767_3_, p_147767_4_, WEST ); -+ boolean flag3 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_ + 1, p_147767_3_, p_147767_4_, EAST ); - boolean flag4 = p_147767_1_.func_149646_a(this.field_147845_a, p_147767_2_, p_147767_3_ + 1, p_147767_4_, 1); - boolean flag5 = p_147767_1_.func_149646_a(this.field_147845_a, p_147767_2_, p_147767_3_ - 1, p_147767_4_, 0); +- boolean flag = p_147767_1_.canPaneConnectToBlock(this.blockAccess.getBlock(p_147767_2_, p_147767_3_, p_147767_4_ - 1)); +- boolean flag1 = p_147767_1_.canPaneConnectToBlock(this.blockAccess.getBlock(p_147767_2_, p_147767_3_, p_147767_4_ + 1)); +- boolean flag2 = p_147767_1_.canPaneConnectToBlock(this.blockAccess.getBlock(p_147767_2_ - 1, p_147767_3_, p_147767_4_)); +- boolean flag3 = p_147767_1_.canPaneConnectToBlock(this.blockAccess.getBlock(p_147767_2_ + 1, p_147767_3_, p_147767_4_)); ++ boolean flag = p_147767_1_.canPaneConnectTo(this.blockAccess, p_147767_2_, p_147767_3_, p_147767_4_ - 1, NORTH); ++ boolean flag1 = p_147767_1_.canPaneConnectTo(this.blockAccess, p_147767_2_, p_147767_3_, p_147767_4_ + 1, SOUTH); ++ boolean flag2 = p_147767_1_.canPaneConnectTo(this.blockAccess, p_147767_2_ - 1, p_147767_3_, p_147767_4_, WEST ); ++ boolean flag3 = p_147767_1_.canPaneConnectTo(this.blockAccess, p_147767_2_ + 1, p_147767_3_, p_147767_4_, EAST ); + boolean flag4 = p_147767_1_.shouldSideBeRendered(this.blockAccess, p_147767_2_, p_147767_3_ + 1, p_147767_4_, 1); + boolean flag5 = p_147767_1_.shouldSideBeRendered(this.blockAccess, p_147767_2_, p_147767_3_ - 1, p_147767_4_, 0); double d19 = 0.01D; diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch index 44ea3ce0db..8b386f9e58 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch @@ -10,9 +10,9 @@ @SideOnly(Side.CLIENT) public class RenderGlobal implements IWorldAccess { -@@ -411,8 +414,10 @@ - - public void func_147589_a(EntityLivingBase p_147589_1_, ICamera p_147589_2_, float p_147589_3_) +@@ -413,8 +416,10 @@ + // JAVADOC METHOD $$ func_147589_a + public void renderEntities(EntityLivingBase p_147589_1_, ICamera p_147589_2_, float p_147589_3_) { + int pass = MinecraftForgeClient.getRenderPass(); if (this.renderEntitiesStartupCounter > 0) @@ -21,10 +21,10 @@ --this.renderEntitiesStartupCounter; } else -@@ -423,9 +428,12 @@ +@@ -425,9 +430,12 @@ this.theWorld.theProfiler.startSection("prepare"); - TileEntityRendererDispatcher.field_147556_a.func_147542_a(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, p_147589_3_); - RenderManager.instance.func_147938_a(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.field_147125_j, this.mc.gameSettings, p_147589_3_); + TileEntityRendererDispatcher.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, p_147589_3_); + RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.pointedEntity, this.mc.gameSettings, p_147589_3_); + if (pass == 0) // no indentation to shrink patch + { this.countEntitiesTotal = 0; @@ -34,7 +34,7 @@ EntityLivingBase entitylivingbase1 = this.mc.renderViewEntity; double d3 = entitylivingbase1.lastTickPosX + (entitylivingbase1.posX - entitylivingbase1.lastTickPosX) * (double)p_147589_3_; double d4 = entitylivingbase1.lastTickPosY + (entitylivingbase1.posY - entitylivingbase1.lastTickPosY) * (double)p_147589_3_; -@@ -454,13 +462,17 @@ +@@ -456,13 +464,17 @@ this.mc.entityRenderer.enableLightmap((double)p_147589_3_); this.theWorld.theProfiler.endStartSection("global"); List list = this.theWorld.getLoadedEntityList(); @@ -51,29 +51,29 @@ + if (!entity.shouldRenderInPass(pass)) continue; ++this.countEntitiesRendered; - if (entity.func_145770_h(d0, d1, d2)) -@@ -474,6 +486,7 @@ + if (entity.isInRangeToRender3d(d0, d1, d2)) +@@ -476,6 +488,7 @@ for (i = 0; i < list.size(); ++i) { entity = (Entity)list.get(i); + if (!entity.shouldRenderInPass(pass)) continue; - boolean flag = entity.func_145770_h(d0, d1, d2) && (entity.ignoreFrustumCheck || p_147589_2_.isBoundingBoxInFrustum(entity.boundingBox) || entity.riddenByEntity == this.mc.thePlayer); + boolean flag = entity.isInRangeToRender3d(d0, d1, d2) && (entity.ignoreFrustumCheck || p_147589_2_.isBoundingBoxInFrustum(entity.boundingBox) || entity.riddenByEntity == this.mc.thePlayer); if (!flag && entity instanceof EntityLiving) -@@ -499,7 +512,11 @@ +@@ -501,7 +514,11 @@ - for (i = 0; i < this.field_147598_a.size(); ++i) + for (i = 0; i < this.tileEntities.size(); ++i) { -- TileEntityRendererDispatcher.field_147556_a.func_147544_a((TileEntity)this.field_147598_a.get(i), p_147589_3_); -+ TileEntity tile = (TileEntity)this.field_147598_a.get(i); +- TileEntityRendererDispatcher.instance.renderTileEntity((TileEntity)this.tileEntities.get(i), p_147589_3_); ++ TileEntity tile = (TileEntity)this.tileEntities.get(i); + if (tile.shouldRenderInPass(pass) && p_147589_2_.isBoundingBoxInFrustum(tile.getRenderBoundingBox())) + { -+ TileEntityRendererDispatcher.field_147556_a.func_147544_a(tile, p_147589_3_); ++ TileEntityRendererDispatcher.instance.renderTileEntity(tile, p_147589_3_); + } } this.mc.entityRenderer.disableLightmap((double)p_147589_3_); -@@ -976,6 +993,12 @@ +@@ -978,6 +995,12 @@ // JAVADOC METHOD $$ func_72714_a public void renderSky(float par1) { @@ -86,7 +86,7 @@ if (this.mc.theWorld.provider.dimensionId == 1) { GL11.glDisable(GL11.GL_FOG); -@@ -1214,6 +1237,12 @@ +@@ -1216,6 +1239,12 @@ public void renderClouds(float par1) { @@ -99,7 +99,7 @@ if (this.mc.theWorld.provider.isSurfaceWorld()) { if (this.mc.gameSettings.fancyGraphics) -@@ -1617,6 +1646,11 @@ +@@ -1619,6 +1648,11 @@ public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityPlayer par2EntityPlayer, float par3) { @@ -111,20 +111,20 @@ double d0 = par2EntityPlayer.lastTickPosX + (par2EntityPlayer.posX - par2EntityPlayer.lastTickPosX) * (double)par3; double d1 = par2EntityPlayer.lastTickPosY + (par2EntityPlayer.posY - par2EntityPlayer.lastTickPosY) * (double)par3; double d2 = par2EntityPlayer.lastTickPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.lastTickPosZ) * (double)par3; -@@ -1839,12 +1873,15 @@ +@@ -1845,12 +1879,15 @@ { - ItemRecord itemrecord = ItemRecord.func_150926_b(par1Str); + ItemRecord itemrecord = ItemRecord.getRecord(par1Str); + ResourceLocation resource = null; if (itemrecord != null) { - this.mc.ingameGUI.setRecordPlayingMessage(itemrecord.func_150927_i()); + this.mc.ingameGUI.setRecordPlayingMessage(itemrecord.getRecordNameLocal()); + resource = itemrecord.getRecordResource(par1Str); } - PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(new ResourceLocation(par1Str), (float)par2, (float)par3, (float)par4); + if (resource == null) resource = new ResourceLocation(par1Str); + PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(resource, (float)par2, (float)par3, (float)par4); - this.field_147593_P.put(chunkcoordinates, positionedsoundrecord); - this.mc.func_147118_V().func_147682_a(positionedsoundrecord); + this.mapSoundPositions.put(chunkcoordinates, positionedsoundrecord); + this.mc.getSoundHandler().playSound(positionedsoundrecord); } diff --git a/patches/minecraft/net/minecraft/client/renderer/Tessellator.java.patch b/patches/minecraft/net/minecraft/client/renderer/Tessellator.java.patch index 131e142dba..99aea99f80 100644 --- a/patches/minecraft/net/minecraft/client/renderer/Tessellator.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/Tessellator.java.patch @@ -8,7 +8,7 @@ import java.util.PriorityQueue; import net.minecraft.client.shader.TesselatorVertexState; import net.minecraft.client.util.QuadComparator; -@@ -15,11 +16,18 @@ +@@ -15,14 +16,21 @@ @SideOnly(Side.CLIENT) public class Tessellator { @@ -21,25 +21,28 @@ + // JAVADOC FIELD $$ field_78394_d - private ByteBuffer byteBuffer; -- private IntBuffer field_147568_c; -- private FloatBuffer field_147566_d; -- private ShortBuffer field_147567_e; + private static ByteBuffer byteBuffer = GLAllocation.createDirectByteBuffer(nativeBufferSize * 4); -+ private static IntBuffer field_147568_c = byteBuffer.asIntBuffer(); -+ private static FloatBuffer field_147566_d = byteBuffer.asFloatBuffer(); -+ private static ShortBuffer field_147567_e = byteBuffer.asShortBuffer(); + // JAVADOC FIELD $$ field_147568_c +- private IntBuffer intBuffer; ++ private static IntBuffer intBuffer = byteBuffer.asIntBuffer(); + // JAVADOC FIELD $$ field_147566_d +- private FloatBuffer floatBuffer; ++ private static FloatBuffer floatBuffer = byteBuffer.asFloatBuffer(); + // JAVADOC FIELD $$ field_147567_e +- private ShortBuffer shortBuffer; ++ private static ShortBuffer shortBuffer = byteBuffer.asShortBuffer(); // JAVADOC FIELD $$ field_78405_h private int[] rawBuffer; // JAVADOC FIELD $$ field_78406_i -@@ -63,14 +71,17 @@ +@@ -67,14 +75,17 @@ private Tessellator(int par1) { - this.bufferSize = par1; - this.byteBuffer = GLAllocation.createDirectByteBuffer(par1 * 4); -- this.field_147568_c = this.byteBuffer.asIntBuffer(); -- this.field_147566_d = this.byteBuffer.asFloatBuffer(); -- this.field_147567_e = this.byteBuffer.asShortBuffer(); +- this.intBuffer = this.byteBuffer.asIntBuffer(); +- this.floatBuffer = this.byteBuffer.asFloatBuffer(); +- this.shortBuffer = this.byteBuffer.asShortBuffer(); - this.rawBuffer = new int[par1]; } @@ -55,7 +58,7 @@ // JAVADOC METHOD $$ func_78381_a public int draw() { -@@ -82,12 +93,15 @@ +@@ -86,12 +97,15 @@ { this.isDrawing = false; @@ -64,43 +67,43 @@ + while (offs < vertexCount) { + int vtc = Math.min(vertexCount - offs, nativeBufferSize >> 5); - this.field_147568_c.clear(); -- this.field_147568_c.put(this.rawBuffer, 0, this.field_147569_p); -+ this.field_147568_c.put(this.rawBuffer, offs * 8, vtc * 8); + this.intBuffer.clear(); +- this.intBuffer.put(this.rawBuffer, 0, this.rawBufferIndex); ++ this.intBuffer.put(this.rawBuffer, offs * 8, vtc * 8); this.byteBuffer.position(0); -- this.byteBuffer.limit(this.field_147569_p * 4); +- this.byteBuffer.limit(this.rawBufferIndex * 4); + this.byteBuffer.limit(vtc * 32); + offs += vtc; if (this.hasTexture) { -@@ -122,7 +136,7 @@ - this.field_147566_d.position(0); - GL11.glVertexPointer(3, 32, this.field_147566_d); +@@ -126,7 +140,7 @@ + this.floatBuffer.position(0); + GL11.glVertexPointer(3, 32, this.floatBuffer); GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); - GL11.glDrawArrays(this.drawMode, 0, this.vertexCount); + GL11.glDrawArrays(this.drawMode, 0, vtc); GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); if (this.hasTexture) -@@ -148,6 +162,12 @@ +@@ -152,6 +166,12 @@ } } -+ if (rawBufferSize > 0x20000 && field_147569_p < (rawBufferSize << 3)) ++ if (rawBufferSize > 0x20000 && rawBufferIndex < (rawBufferSize << 3)) + { + rawBufferSize = 0x10000; + rawBuffer = new int[rawBufferSize]; + } + - int i = this.field_147569_p * 4; + int i = this.rawBufferIndex * 4; this.reset(); return i; -@@ -182,6 +202,14 @@ +@@ -186,6 +206,14 @@ - public void func_147565_a(TesselatorVertexState p_147565_1_) + public void setVertexState(TesselatorVertexState p_147565_1_) { -+ while (p_147565_1_.func_147572_a().length > rawBufferSize && rawBufferSize > 0) ++ while (p_147565_1_.getRawBuffer().length > rawBufferSize && rawBufferSize > 0) + { + rawBufferSize <<= 1; + } @@ -108,14 +111,14 @@ + { + rawBuffer = new int[rawBufferSize]; + } - System.arraycopy(p_147565_1_.func_147572_a(), 0, this.rawBuffer, 0, p_147565_1_.func_147572_a().length); - this.field_147569_p = p_147565_1_.func_147576_b(); - this.vertexCount = p_147565_1_.func_147575_c(); -@@ -326,6 +354,19 @@ + System.arraycopy(p_147565_1_.getRawBuffer(), 0, this.rawBuffer, 0, p_147565_1_.getRawBuffer().length); + this.rawBufferIndex = p_147565_1_.getRawBufferIndex(); + this.vertexCount = p_147565_1_.getVertexCount(); +@@ -330,6 +358,19 @@ // JAVADOC METHOD $$ func_78377_a public void addVertex(double par1, double par3, double par5) { -+ if (field_147569_p >= rawBufferSize - 32) ++ if (rawBufferIndex >= rawBufferSize - 32) + { + if (rawBufferSize == 0) + { @@ -131,12 +134,12 @@ ++this.addedVertices; if (this.hasTexture) -@@ -354,12 +395,6 @@ - this.rawBuffer[this.field_147569_p + 2] = Float.floatToRawIntBits((float)(par5 + this.zOffset)); - this.field_147569_p += 8; +@@ -358,12 +399,6 @@ + this.rawBuffer[this.rawBufferIndex + 2] = Float.floatToRawIntBits((float)(par5 + this.zOffset)); + this.rawBufferIndex += 8; ++this.vertexCount; - -- if (this.vertexCount % 4 == 0 && this.field_147569_p >= this.bufferSize - 32) +- if (this.vertexCount % 4 == 0 && this.rawBufferIndex >= this.bufferSize - 32) - { - this.draw(); - this.isDrawing = true; diff --git a/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch index a16f15928d..87dc0c4e89 100644 --- a/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch @@ -9,16 +9,16 @@ public static int chunksUpdated; public int posX; public int posY; -@@ -177,7 +177,7 @@ - this.func_147890_b(k2); +@@ -179,7 +179,7 @@ + this.preRenderBlocks(k2); } -- if (k2 == 0 && block.func_149716_u()) +- if (k2 == 0 && block.hasTileEntity()) + if (k2 == 0 && block.hasTileEntity(chunkcache.getBlockMetadata(j3, l2, i3))) { - TileEntity tileentity = chunkcache.func_147438_o(j3, l2, i3); + TileEntity tileentity = chunkcache.getTileEntity(j3, l2, i3); -@@ -193,7 +193,9 @@ +@@ -195,7 +195,9 @@ { flag = true; } @@ -27,9 +27,9 @@ + if (!block.canRenderInPass(k2)) continue; + { - flag1 |= renderblocks.func_147805_b(block, j3, l2, i3); + flag1 |= renderblocks.renderBlockByRenderType(block, j3, l2, i3); -@@ -252,21 +254,22 @@ +@@ -254,21 +256,22 @@ GL11.glTranslatef(-8.0F, -8.0F, -8.0F); GL11.glScalef(f, f, f); GL11.glTranslatef(8.0F, 8.0F, 8.0F); @@ -39,12 +39,12 @@ + Tessellator.instance.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ)); } - private void func_147891_a(int p_147891_1_, EntityLivingBase p_147891_2_) + private void postRenderBlocks(int p_147891_1_, EntityLivingBase p_147891_2_) { if (p_147891_1_ == 1 && !this.skipRenderPass[p_147891_1_]) { -- this.field_147894_y = tessellator.func_147564_a((float)p_147891_2_.posX, (float)p_147891_2_.posY, (float)p_147891_2_.posZ); -+ this.field_147894_y = Tessellator.instance.func_147564_a((float)p_147891_2_.posX, (float)p_147891_2_.posY, (float)p_147891_2_.posZ); +- this.vertexState = tessellator.getVertexState((float)p_147891_2_.posX, (float)p_147891_2_.posY, (float)p_147891_2_.posZ); ++ this.vertexState = Tessellator.instance.getVertexState((float)p_147891_2_.posX, (float)p_147891_2_.posY, (float)p_147891_2_.posZ); } - this.bytesDrawn += tessellator.draw(); @@ -56,13 +56,13 @@ + Tessellator.instance.setTranslation(0.0D, 0.0D, 0.0D); } - public void func_147889_b(EntityLivingBase p_147889_1_) -@@ -274,7 +277,7 @@ - if (this.field_147894_y != null && !this.skipRenderPass[1]) + public void updateRendererSort(EntityLivingBase p_147889_1_) +@@ -276,7 +279,7 @@ + if (this.vertexState != null && !this.skipRenderPass[1]) { - this.func_147890_b(1); -- tessellator.func_147565_a(this.field_147894_y); -+ Tessellator.instance.func_147565_a(this.field_147894_y); - this.func_147891_a(1, p_147889_1_); + this.preRenderBlocks(1); +- tessellator.setVertexState(this.vertexState); ++ Tessellator.instance.setVertexState(this.vertexState); + this.postRenderBlocks(1, p_147889_1_); } } diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java.patch index 09fc1ff96d..4c26c425ca 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java.patch @@ -76,8 +76,8 @@ + if (item instanceof ItemBlock) { -- if (RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b())) -+ if (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b())) +- if (RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item).getRenderType())) ++ if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item).getRenderType())) { f1 = 0.625F; GL11.glTranslatef(0.0F, -0.25F, 0.0F); @@ -85,11 +85,11 @@ this.modelBipedMain.bipedRightArm.postRender(0.0625F); GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); -- if (item instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b())) +- if (item instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item).getRenderType())) + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED); + boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D)); + -+ if (item instanceof ItemBlock && (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b()))) ++ if (item instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item).getRenderType()))) { f1 = 0.5F; GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch index ae9fe888ab..74313c3c53 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch @@ -43,9 +43,9 @@ + ; + } + else // Code Style break here to prevent the patch from editing this line - if (itemstack.getItemSpriteNumber() == 0 && itemstack.getItem() instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.getItem()).func_149645_b())) + if (itemstack.getItemSpriteNumber() == 0 && itemstack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType())) { - Block block = Block.func_149634_a(itemstack.getItem()); + Block block = Block.getBlockFromItem(itemstack.getItem()); @@ -140,7 +150,7 @@ { float f5; @@ -89,7 +89,7 @@ + this.renderDroppedItem(par1EntityItem, par2Icon, par3, par4, par5, par6, par7, 0); + } + -+ // JAVADOC METHOD $$ func_77020_a ++ // JAVADOC METHOD $$ renderDroppedItem + private void renderDroppedItem(EntityItem par1EntityItem, IIcon par2Icon, int par3, float par4, float par5, float par6, float par7, int pass) + { Tessellator tessellator = Tessellator.instance; @@ -137,7 +137,7 @@ + this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, false); + } + -+ // JAVADOC METHOD $$ func_77015_a ++ // JAVADOC METHOD $$ renderItemIntoGUI + public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, boolean renderEffect) + { int k = par3ItemStack.getItemDamage(); @@ -147,14 +147,14 @@ GL11.glColorMask(true, true, true, true); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_ALPHA_TEST); -- OpenGlHelper.func_148821_a(770, 771, 1, 0); +- OpenGlHelper.glBlendFunc(770, 771, 1, 0); - for (l = 0; l <= 1; ++l) + Item item = par3ItemStack.getItem(); + for (l = 0; l < item.getRenderPasses(k); ++l) { - IIcon iicon = par3ItemStack.getItem().getIconFromDamageForRenderPass(k, l); -+ OpenGlHelper.func_148821_a(770, 771, 1, 0); ++ OpenGlHelper.glBlendFunc(770, 771, 1, 0); + par2TextureManager.bindTexture(item.getSpriteNumber() == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture); + IIcon iicon = item.getIcon(par3ItemStack, l); int i1 = par3ItemStack.getItem().getColorFromItemStack(par3ItemStack, l); diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch index 9648432a7b..ebaee25195 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch @@ -1,9 +1,9 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderManager.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderManager.java -@@ -218,11 +218,13 @@ +@@ -219,11 +219,13 @@ if (p_147938_4_.isPlayerSleeping()) { - Block block = p_147938_1_.func_147439_a(MathHelper.floor_double(p_147938_4_.posX), MathHelper.floor_double(p_147938_4_.posY), MathHelper.floor_double(p_147938_4_.posZ)); + Block block = p_147938_1_.getBlock(MathHelper.floor_double(p_147938_4_.posX), MathHelper.floor_double(p_147938_4_.posY), MathHelper.floor_double(p_147938_4_.posZ)); + int x = MathHelper.floor_double(p_147938_4_.posX); + int y = MathHelper.floor_double(p_147938_4_.posY); + int z = MathHelper.floor_double(p_147938_4_.posZ); diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch index 96574b206b..32757a9a4f 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch @@ -114,11 +114,11 @@ if (itemstack.getItem() instanceof ItemBlock) { -- if (RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.getItem()).func_149645_b())) +- if (RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType())) + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED); + boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D)); + -+ if (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.getItem()).func_149645_b())) ++ if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType())) { f1 = 0.625F; GL11.glTranslatef(0.0F, -0.25F, 0.0F); @@ -143,11 +143,11 @@ enumaction = itemstack1.getItemUseAction(); } -- if (itemstack1.getItem() instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(itemstack1.getItem()).func_149645_b())) +- if (itemstack1.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack1.getItem()).getRenderType())) + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack1, EQUIPPED); + boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack1, BLOCK_3D)); + -+ if (is3D || itemstack1.getItem() instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(itemstack1.getItem()).func_149645_b())) ++ if (is3D || itemstack1.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack1.getItem()).getRenderType())) { f3 = 0.5F; GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java.patch index 3a5f5b4940..8e2a6c1786 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java.patch @@ -15,11 +15,11 @@ GL11.glPushMatrix(); this.snowmanModel.head.postRender(0.0625F); -- if (RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.getItem()).func_149645_b())) +- if (RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType())) + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED); + boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D)); + -+ if (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.getItem()).func_149645_b())) ++ if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType())) { float f1 = 0.625F; GL11.glTranslatef(0.0F, -0.34375F, 0.0F); diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch index 58d0e75530..164e240941 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch @@ -15,7 +15,7 @@ + registerIcons(); //Re-gather list of Icons, allows for addition/removal of blocks/items after this map was initially constructed. + int i = Minecraft.getGLMaximumTextureSize(); - Stitcher stitcher = new Stitcher(i, i, true, 0, this.field_147636_j); + Stitcher stitcher = new Stitcher(i, i, true, 0, this.mipmapLevels); this.mapUploadedSprites.clear(); this.listAnimatedSprites.clear(); int j = Integer.MAX_VALUE; @@ -25,7 +25,7 @@ @@ -107,6 +111,16 @@ textureatlassprite = (TextureAtlasSprite)entry.getValue(); - ResourceLocation resourcelocation1 = this.func_147634_a(resourcelocation, 0); + ResourceLocation resourcelocation1 = this.completeResourceLocation(resourcelocation, 0); + if (textureatlassprite.hasCustomLoader(par1ResourceManager, resourcelocation)) + { @@ -47,7 +47,7 @@ + ForgeHooksClient.onTextureStitchedPost(this); } - private ResourceLocation func_147634_a(ResourceLocation p_147634_1_, int p_147634_2_) + private ResourceLocation completeResourceLocation(ResourceLocation p_147634_1_, int p_147634_2_) @@ -348,7 +363,7 @@ { throw new IllegalArgumentException("Name cannot be null!"); @@ -59,7 +59,7 @@ @@ -404,4 +419,37 @@ { - this.field_147637_k = p_147632_1_; + this.anisotropicFiltering = p_147632_1_; } + + //=================================================================================================== diff --git a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch index 4f04836f0d..7524588a80 100644 --- a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch @@ -13,12 +13,12 @@ { + try + { - ((BlockChest)block).func_149954_e(p_147502_1_.func_145831_w(), p_147502_1_.field_145851_c, p_147502_1_.field_145848_d, p_147502_1_.field_145849_e); + ((BlockChest)block).func_149954_e(p_147502_1_.getWorldObj(), p_147502_1_.xCoord, p_147502_1_.yCoord, p_147502_1_.zCoord); + } + catch (ClassCastException e) + { -+ FMLLog.severe("Attempted to render a chest at %d, %d, %d that was not a chest", p_147502_1_.field_145851_c, p_147502_1_.field_145848_d, p_147502_1_.field_145849_e); ++ FMLLog.severe("Attempted to render a chest at %d, %d, %d that was not a chest", p_147502_1_.xCoord, p_147502_1_.yCoord, p_147502_1_.zCoord); + } - i = p_147502_1_.func_145832_p(); + i = p_147502_1_.getBlockMetadata(); } diff --git a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch index dd598fd1b7..ac7ccd7e92 100644 --- a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch +++ b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch @@ -9,7 +9,7 @@ + public class CommandHandler implements ICommandManager { - private static final Logger field_147175_a = LogManager.getLogger(); + private static final Logger logger = LogManager.getLogger(); @@ -49,6 +52,16 @@ if (icommand.canCommandSenderUseCommand(par1ICommandSender)) diff --git a/patches/minecraft/net/minecraft/crash/CrashReport.java.patch b/patches/minecraft/net/minecraft/crash/CrashReport.java.patch index de371a5f76..9fd48f3b01 100644 --- a/patches/minecraft/net/minecraft/crash/CrashReport.java.patch +++ b/patches/minecraft/net/minecraft/crash/CrashReport.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/crash/CrashReport.java +++ ../src-work/minecraft/net/minecraft/crash/CrashReport.java -@@ -328,7 +328,8 @@ +@@ -330,7 +330,8 @@ StackTraceElement stacktraceelement = null; StackTraceElement stacktraceelement1 = null; diff --git a/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch b/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch index 225f18ed31..60b2224d3a 100644 --- a/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch +++ b/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/crash/CrashReportCategory.java +++ ../src-work/minecraft/net/minecraft/crash/CrashReportCategory.java -@@ -131,8 +131,11 @@ +@@ -132,8 +132,11 @@ } else { diff --git a/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch b/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch index 17baea1b34..2d2f2e451c 100644 --- a/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch +++ b/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch @@ -52,7 +52,7 @@ - if (item != null && item.getCreativeTab() == this) + if (item == null) { -- item.func_150895_a(item, this, par1List); +- item.getSubItems(item, this, par1List); + continue; } + @@ -60,7 +60,7 @@ + { + if (tab == this) + { -+ item.func_150895_a(item, this, par1List); ++ item.getSubItems(item, this, par1List); + } + } } diff --git a/patches/minecraft/net/minecraft/entity/Entity.java.patch b/patches/minecraft/net/minecraft/entity/Entity.java.patch index 28c8b89ad3..36b2243d73 100644 --- a/patches/minecraft/net/minecraft/entity/Entity.java.patch +++ b/patches/minecraft/net/minecraft/entity/Entity.java.patch @@ -56,9 +56,9 @@ + private HashMap extendedProperties; + - public int func_145782_y() + public int getEntityId() { - return this.field_145783_c; + return this.entityId; @@ -189,6 +209,15 @@ this.dataWatcher.addObject(0, Byte.valueOf((byte)0)); this.dataWatcher.addObject(1, Short.valueOf((short)300)); @@ -77,9 +77,9 @@ protected abstract void entityInit(); @@ -1051,9 +1080,22 @@ - if (block.func_149688_o() == par1Material) + if (block.getMaterial() == par1Material) { -- float f = BlockLiquid.func_149801_b(this.worldObj.getBlockMetadata(i, j, k)) - 0.11111111F; +- float f = BlockLiquid.getLiquidHeightPercent(this.worldObj.getBlockMetadata(i, j, k)) - 0.11111111F; - float f1 = (float)(j + 1) - f; - return d0 < (double)f1; + double filled = 1.0f; //If it's not a liquid assume it's a solid block @@ -164,7 +164,7 @@ @@ -1512,7 +1597,14 @@ { EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double)par2, this.posZ, par1ItemStack); - entityitem.field_145804_b = 10; + entityitem.delayBeforeCanPickup = 10; - this.worldObj.spawnEntityInWorld(entityitem); + if (captureDrops) + { @@ -190,12 +190,12 @@ public float func_145772_a(Explosion p_145772_1_, World p_145772_2_, int p_145772_3_, int p_145772_4_, int p_145772_5_, Block p_145772_6_) { -- return p_145772_6_.func_149638_a(this); +- return p_145772_6_.getExplosionResistance(this); + return p_145772_6_.getExplosionResistance(this, p_145772_2_, p_145772_3_, p_145772_3_, p_145772_4_, posX, posY + getEyeHeight(), posZ); } public boolean func_145774_a(Explosion p_145774_1_, World p_145774_2_, int p_145774_3_, int p_145774_4_, int p_145774_5_, Block p_145774_6_, float p_145774_7_) -@@ -2175,6 +2267,174 @@ +@@ -2176,6 +2268,174 @@ public void func_145781_i(int p_145781_1_) {} @@ -280,7 +280,7 @@ + */ + public final void resetEntityId() + { -+ this.field_145783_c = nextEntityID++; ++ this.entityId = nextEntityID++; + } + + public boolean shouldRenderInPass(int pass) diff --git a/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch b/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch index 1a37d5175a..0ff7691661 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch @@ -97,7 +97,7 @@ @@ -1021,7 +1039,7 @@ int j = MathHelper.floor_double(this.boundingBox.minY); int k = MathHelper.floor_double(this.posZ); - Block block = this.worldObj.func_147439_a(i, j, k); + Block block = this.worldObj.getBlock(i, j, k); - return block == Blocks.ladder || block == Blocks.vine; + return ForgeHooks.isLivingOnLadder(block, worldObj, i, j, k, this); } diff --git a/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch b/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch index fb74207e49..13f02e3341 100644 --- a/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch +++ b/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch @@ -2,13 +2,13 @@ +++ ../src-work/minecraft/net/minecraft/entity/boss/EntityDragon.java @@ -495,9 +495,9 @@ { - Block block = this.worldObj.func_147439_a(k1, l1, i2); + Block block = this.worldObj.getBlock(k1, l1, i2); -- if (block.func_149688_o() != Material.field_151579_a) +- if (block.getMaterial() != Material.air) + if (!block.isAir(worldObj, k1, l1, i2)) { - if (block != Blocks.obsidian && block != Blocks.end_stone && block != Blocks.bedrock && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) + if (block.canEntityDestroy(worldObj, k1, l1, i2, this) && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { - flag1 = this.worldObj.func_147468_f(k1, l1, i2) || flag1; + flag1 = this.worldObj.setBlockToAir(k1, l1, i2) || flag1; } diff --git a/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch b/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch index f5d9e0743e..745954464f 100644 --- a/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch +++ b/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/entity/boss/EntityWither.java @@ -355,7 +355,7 @@ int l = j1 + i2; - Block block = this.worldObj.func_147439_a(j2, k, l); + Block block = this.worldObj.getBlock(j2, k, l); -- if (block.func_149688_o() != Material.field_151579_a && block != Blocks.bedrock && block != Blocks.end_portal && block != Blocks.end_portal_frame && block != Blocks.command_block) +- if (block.getMaterial() != Material.air && block != Blocks.bedrock && block != Blocks.end_portal && block != Blocks.end_portal_frame && block != Blocks.command_block) + if (!block.isAir(worldObj, j2, k, l) && block.canEntityDestroy(worldObj, j2, k, l, this)) { flag = this.worldObj.func_147480_a(j2, k, l, true) || flag; diff --git a/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch index dfeacc2ecd..e235a7cbd3 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch @@ -11,7 +11,7 @@ { @@ -51,6 +53,9 @@ - if (entityplayermp.playerNetServerHandler.func_147362_b().func_150724_d() && entityplayermp.worldObj == this.worldObj) + if (entityplayermp.playerNetServerHandler.func_147362_b().isChannelOpen() && entityplayermp.worldObj == this.worldObj) { + EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, this.posX, this.posY, this.posZ, 5.0F); + if (!MinecraftForge.EVENT_BUS.post(event)) diff --git a/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch index 6308f906e2..0d6665c522 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch @@ -117,7 +117,7 @@ { if (!this.worldObj.isRemote) { -+ if (this.field_145804_b > 0) ++ if (this.delayBeforeCanPickup > 0) + { + return; + } @@ -132,8 +132,8 @@ ItemStack itemstack = this.getEntityItem(); int i = itemstack.stackSize; -- if (this.field_145804_b == 0 && (this.field_145802_g == null || 6000 - this.age <= 200 || this.field_145802_g.equals(par1EntityPlayer.getCommandSenderName())) && par1EntityPlayer.inventory.addItemStackToInventory(itemstack)) -+ if (this.field_145804_b <= 0 && (this.field_145802_g == null || lifespan - this.age <= 200 || this.field_145802_g.equals(par1EntityPlayer.getCommandSenderName())) && (event.getResult() == Result.ALLOW || i <= 0 || par1EntityPlayer.inventory.addItemStackToInventory(itemstack))) +- if (this.delayBeforeCanPickup == 0 && (this.field_145802_g == null || 6000 - this.age <= 200 || this.field_145802_g.equals(par1EntityPlayer.getCommandSenderName())) && par1EntityPlayer.inventory.addItemStackToInventory(itemstack)) ++ if (this.delayBeforeCanPickup <= 0 && (this.field_145802_g == null || lifespan - this.age <= 200 || this.field_145802_g.equals(par1EntityPlayer.getCommandSenderName())) && (event.getResult() == Result.ALLOW || i <= 0 || par1EntityPlayer.inventory.addItemStackToInventory(itemstack))) { - if (itemstack.getItem() == Item.func_150898_a(Blocks.log)) + if (itemstack.getItem() == Item.getItemFromBlock(Blocks.log)) { diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch index 299a594bbd..4a273bc132 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch @@ -63,7 +63,7 @@ public EntityMinecart(World par1World, double par2, double par4, double par6) @@ -315,19 +341,20 @@ double d2 = 0.0078125D; - Block block = this.worldObj.func_147439_a(l, i, i1); + Block block = this.worldObj.getBlock(l, i, i1); - if (BlockRailBase.func_150051_a(block)) + if (canUseRail() && BlockRailBase.func_150051_a(block)) @@ -232,7 +232,7 @@ - int l = this.worldObj.getBlockMetadata(i, j, k); + int l = ((BlockRailBase)block).getBasicRailMetadata(worldObj, this, i, j, k); -- if (((BlockRailBase)block).func_150050_e()) +- if (((BlockRailBase)block).isPowered()) - { - l &= 7; - } @@ -248,7 +248,7 @@ + int l = ((BlockRailBase)block).getBasicRailMetadata(worldObj, this, i, j, k); par3 = (double)j; -- if (((BlockRailBase)block).func_150050_e()) +- if (((BlockRailBase)block).isPowered()) - { - l &= 7; - } @@ -293,7 +293,7 @@ { par1Entity.motionX *= 0.20000000298023224D; par1Entity.motionZ *= 0.20000000298023224D; -@@ -1092,4 +1116,216 @@ +@@ -1093,4 +1117,216 @@ { return this.entityName; } diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch index 69050f9ad8..14cfcc9550 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java -@@ -248,6 +248,7 @@ +@@ -249,6 +249,7 @@ // JAVADOC METHOD $$ func_130002_c public boolean interactFirst(EntityPlayer par1EntityPlayer) { diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch index 6fc13ccf3f..87ca01d7d7 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch @@ -12,11 +12,11 @@ public class EntityZombie extends EntityMob { @@ -75,7 +79,7 @@ - this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(40.0D); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.23000000417232513D); - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(3.0D); -- this.getAttributeMap().func_111150_b(field_110186_bp).setAttribute(this.rand.nextDouble() * 0.10000000149011612D); -+ this.getAttributeMap().func_111150_b(field_110186_bp).setAttribute(this.rand.nextDouble() * ForgeModContainer.zombieSummonBaseChance); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D); +- this.getAttributeMap().registerAttribute(field_110186_bp).setBaseValue(this.rand.nextDouble() * 0.10000000149011612D); ++ this.getAttributeMap().registerAttribute(field_110186_bp).setBaseValue(this.rand.nextDouble() * ForgeModContainer.zombieSummonBaseChance); } protected void entityInit() diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch index 700a2678cc..aa93b62b6f 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/entity/passive/EntityOcelot.java @@ -298,7 +298,7 @@ - Block block = this.worldObj.func_147439_a(i, j - 1, k); + Block block = this.worldObj.getBlock(i, j - 1, k); -- if (block == Blocks.grass || block.func_149688_o() == Material.field_151584_j) +- if (block == Blocks.grass || block.getMaterial() == Material.leaves) + if (block == Blocks.grass || block.isLeaves(worldObj, i, j - 1, k)) { return true; diff --git a/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch index e58f4be943..e96ae71165 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch @@ -36,7 +36,7 @@ - - for (int j = 0; j < i; ++j) - { -- EntityItem entityitem = this.entityDropItem(new ItemStack(Item.func_150898_a(Blocks.wool), 1, this.getFleeceColor()), 1.0F); +- EntityItem entityitem = this.entityDropItem(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, this.getFleeceColor()), 1.0F); - entityitem.motionY += (double)(this.rand.nextFloat() * 0.05F); - entityitem.motionX += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); - entityitem.motionZ += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); diff --git a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch index 8fbd5f096a..36eb5dd935 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch @@ -189,7 +189,7 @@ } public EntityItem func_146097_a(ItemStack p_146097_1_, boolean p_146097_2_, boolean p_146097_3_) -@@ -765,13 +828,25 @@ +@@ -765,14 +828,26 @@ // JAVADOC METHOD $$ func_71012_a public void joinEntityItemWithWorld(EntityItem par1EntityItem) { @@ -201,8 +201,9 @@ this.worldObj.spawnEntityInWorld(par1EntityItem); } -+ @Deprecated //Metadata sensitive version - public float func_146096_a(Block p_146096_1_, boolean p_146096_2_) + // JAVADOC METHOD $$ func_146096_a ++ @Deprecated //Metadata sensitive version, named getBreakSpeed + public float getCurrentPlayerStrVsBlock(Block p_146096_1_, boolean p_146096_2_) { - float f = this.inventory.func_146023_a(p_146096_1_); + return getBreakSpeed(p_146096_1_, p_146096_2_, 0); @@ -216,7 +217,7 @@ if (f > 1.0F) { int i = EnchantmentHelper.getEfficiencyModifier(this); -@@ -781,7 +856,9 @@ +@@ -782,7 +857,9 @@ { float f1 = (float)(i * i + 1); @@ -227,7 +228,7 @@ { f += f1 * 0.08F; } -@@ -812,12 +889,13 @@ +@@ -813,13 +890,14 @@ f /= 5.0F; } @@ -236,22 +237,23 @@ + return (f < 0 ? 0 : f); } - public boolean func_146099_a(Block p_146099_1_) + // JAVADOC METHOD $$ func_146099_a + public boolean canHarvestBlock(Block p_146099_1_) { - return this.inventory.func_146025_b(p_146099_1_); + return ForgeEventFactory.doPlayerHarvestCheck(this, p_146099_1_, this.inventory.func_146025_b(p_146099_1_)); } // JAVADOC METHOD $$ func_70037_a -@@ -847,6 +925,16 @@ +@@ -849,6 +927,16 @@ this.spawnForced = par1NBTTagCompound.getBoolean("SpawnForced"); } + NBTTagList spawnlist = null; -+ spawnlist = par1NBTTagCompound.func_150295_c("Spawns", 10); ++ spawnlist = par1NBTTagCompound.getTagList("Spawns", 10); + for (int i = 0; i < spawnlist.tagCount(); i++) + { -+ NBTTagCompound spawndata = (NBTTagCompound)spawnlist.func_150305_b(i); ++ NBTTagCompound spawndata = (NBTTagCompound)spawnlist.getCompoundTagAt(i); + int spawndim = spawndata.getInteger("Dim"); + this.spawnChunkMap.put(spawndim, new ChunkCoordinates(spawndata.getInteger("SpawnX"), spawndata.getInteger("SpawnY"), spawndata.getInteger("SpawnZ"))); + this.spawnForcedMap.put(spawndim, spawndata.getBoolean("SpawnForced")); @@ -260,7 +262,7 @@ this.foodStats.readNBT(par1NBTTagCompound); this.capabilities.readCapabilitiesFromNBT(par1NBTTagCompound); -@@ -878,6 +966,23 @@ +@@ -880,6 +968,23 @@ par1NBTTagCompound.setBoolean("SpawnForced", this.spawnForced); } @@ -284,7 +286,7 @@ this.foodStats.writeNBT(par1NBTTagCompound); this.capabilities.writeCapabilitiesToNBT(par1NBTTagCompound); par1NBTTagCompound.setTag("EnderItems", this.theInventoryEnderChest.saveInventoryToNBT()); -@@ -902,7 +1007,7 @@ +@@ -904,7 +1009,7 @@ public float getEyeHeight() { @@ -293,7 +295,7 @@ } // JAVADOC METHOD $$ func_71061_d_ -@@ -914,6 +1019,7 @@ +@@ -916,6 +1021,7 @@ // JAVADOC METHOD $$ func_70097_a public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { @@ -301,7 +303,7 @@ if (this.isEntityInvulnerable()) { return false; -@@ -1018,12 +1124,15 @@ +@@ -1020,12 +1126,15 @@ { if (!this.isEntityInvulnerable()) { @@ -318,7 +320,7 @@ par2 = this.applyPotionDamageCalculations(par1DamageSource, par2); float f1 = par2; par2 = Math.max(par2 - this.getAbsorptionAmount(), 0.0F); -@@ -1058,6 +1167,7 @@ +@@ -1060,6 +1169,7 @@ public boolean interactWith(Entity par1Entity) { @@ -326,7 +328,7 @@ ItemStack itemstack = this.getCurrentEquippedItem(); ItemStack itemstack1 = itemstack != null ? itemstack.copy() : null; -@@ -1110,7 +1220,9 @@ +@@ -1112,7 +1222,9 @@ // JAVADOC METHOD $$ func_71028_bD public void destroyCurrentEquippedItem() { @@ -336,7 +338,7 @@ } // JAVADOC METHOD $$ func_70033_W -@@ -1122,6 +1234,15 @@ +@@ -1124,6 +1236,15 @@ // JAVADOC METHOD $$ func_71059_n public void attackTargetEntityWithCurrentItem(Entity par1Entity) { @@ -352,7 +354,7 @@ if (par1Entity.canAttackWithItem()) { if (!par1Entity.hitByEntity(this)) -@@ -1273,6 +1394,12 @@ +@@ -1276,6 +1397,12 @@ // JAVADOC METHOD $$ func_71018_a public EntityPlayer.EnumStatus sleepInBedAt(int par1, int par2, int par3) { @@ -365,23 +367,23 @@ if (!this.worldObj.isRemote) { if (this.isPlayerSleeping() || !this.isEntityAlive()) -@@ -1315,8 +1442,7 @@ +@@ -1318,8 +1445,7 @@ if (this.worldObj.blockExists(par1, par2, par3)) { - int i1 = this.worldObj.getBlockMetadata(par1, par2, par3); -- int l = BlockBed.func_149895_l(i1); -+ int l = worldObj.func_147439_a(par1, par2, par3).getBedDirection(worldObj, par1, par2, par3); +- int l = BlockBed.getDirection(i1); ++ int l = worldObj.getBlock(par1, par2, par3).getBedDirection(worldObj, par1, par2, par3); float f1 = 0.5F; float f = 0.5F; -@@ -1384,11 +1510,12 @@ +@@ -1387,11 +1513,12 @@ this.resetHeight(); ChunkCoordinates chunkcoordinates = this.playerLocation; ChunkCoordinates chunkcoordinates1 = this.playerLocation; -+ Block block = (chunkcoordinates == null ? null : worldObj.func_147439_a(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ)); ++ Block block = (chunkcoordinates == null ? null : worldObj.getBlock(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ)); -- if (chunkcoordinates != null && this.worldObj.func_147439_a(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ) == Blocks.bed) +- if (chunkcoordinates != null && this.worldObj.getBlock(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ) == Blocks.bed) + if (chunkcoordinates != null && block.isBed(worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this)) { - BlockBed.func_149979_a(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, false); @@ -391,42 +393,42 @@ if (chunkcoordinates1 == null) { -@@ -1423,7 +1550,7 @@ +@@ -1426,7 +1553,7 @@ // JAVADOC METHOD $$ func_71065_l private boolean isInBed() { -- return this.worldObj.func_147439_a(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ) == Blocks.bed; -+ return this.worldObj.func_147439_a(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ).isBed(worldObj, playerLocation.posX, playerLocation.posY, playerLocation.posZ, this); +- return this.worldObj.getBlock(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ) == Blocks.bed; ++ return this.worldObj.getBlock(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ).isBed(worldObj, playerLocation.posX, playerLocation.posY, playerLocation.posZ, this); } // JAVADOC METHOD $$ func_71056_a -@@ -1435,9 +1562,9 @@ +@@ -1438,9 +1565,9 @@ ichunkprovider.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); ichunkprovider.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); -- if (par0World.func_147439_a(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ) == Blocks.bed) -+ if (par0World.func_147439_a(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ).isBed(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, null)) +- if (par0World.getBlock(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ) == Blocks.bed) ++ if (par0World.getBlock(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ).isBed(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, null)) { - ChunkCoordinates chunkcoordinates1 = BlockBed.func_149977_a(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, 0); -+ ChunkCoordinates chunkcoordinates1 = par0World.func_147439_a(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ).getBedSpawnPosition(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, null); ++ ChunkCoordinates chunkcoordinates1 = par0World.getBlock(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ).getBedSpawnPosition(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, null); return chunkcoordinates1; } else -@@ -1456,8 +1583,10 @@ +@@ -1459,8 +1586,10 @@ { if (this.playerLocation != null) { - int i = this.worldObj.getBlockMetadata(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ); -- int j = BlockBed.func_149895_l(i); +- int j = BlockBed.getDirection(i); + int x = playerLocation.posX; + int y = playerLocation.posY; + int z = playerLocation.posZ; -+ int j = worldObj.func_147439_a(x, y, z).getBedDirection(worldObj, x, y, z); ++ int j = worldObj.getBlock(x, y, z).getBedDirection(worldObj, x, y, z); switch (j) { -@@ -1516,19 +1645,26 @@ - public void func_146105_b(IChatComponent p_146105_1_) {} +@@ -1519,19 +1648,26 @@ + public void addChatComponentMessage(IChatComponent p_146105_1_) {} // JAVADOC METHOD $$ func_70997_bJ + @Deprecated @@ -454,7 +456,7 @@ if (par1ChunkCoordinates != null) { this.spawnChunk = new ChunkCoordinates(par1ChunkCoordinates); -@@ -1710,6 +1846,10 @@ +@@ -1713,6 +1849,10 @@ super.fall(par1); } @@ -465,7 +467,7 @@ } protected String func_146067_o(int p_146067_1_) -@@ -1755,11 +1895,6 @@ +@@ -1758,11 +1898,6 @@ } else { @@ -477,7 +479,7 @@ if (this.itemInUse != null && par1ItemStack.getItem() == Items.bow) { int j = par1ItemStack.getMaxItemUseDuration() - this.itemInUseCount; -@@ -1779,6 +1914,7 @@ +@@ -1782,6 +1917,7 @@ return Items.bow.getItemIconForUseDuration(0); } } @@ -485,7 +487,7 @@ } return iicon; -@@ -1869,6 +2005,8 @@ +@@ -1872,6 +2008,8 @@ { if (par1ItemStack != this.itemInUse) { @@ -494,7 +496,7 @@ this.itemInUse = par1ItemStack; this.itemInUseCount = par2; -@@ -1967,6 +2105,17 @@ +@@ -1970,6 +2108,17 @@ } this.theInventoryEnderChest = par1EntityPlayer.theInventoryEnderChest; @@ -512,7 +514,7 @@ } // JAVADOC METHOD $$ func_70041_e_ -@@ -2013,7 +2162,14 @@ +@@ -2016,7 +2165,14 @@ // JAVADOC METHOD $$ func_70062_b public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) { @@ -528,21 +530,21 @@ } // JAVADOC METHOD $$ func_98034_c -@@ -2059,7 +2215,7 @@ +@@ -2062,7 +2218,7 @@ public IChatComponent func_145748_c_() { - ChatComponentText chatcomponenttext = new ChatComponentText(ScorePlayerTeam.formatPlayerName(this.getTeam(), this.getCommandSenderName())); + ChatComponentText chatcomponenttext = new ChatComponentText(ScorePlayerTeam.formatPlayerName(this.getTeam(), this.getDisplayName())); - chatcomponenttext.func_150256_b().func_150241_a(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.getCommandSenderName() + " ")); + chatcomponenttext.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.getCommandSenderName() + " ")); return chatcomponenttext; } -@@ -2096,6 +2252,119 @@ +@@ -2099,6 +2255,119 @@ FMLNetworkHandler.openGui(this, mod, modGuiId, world, x, y, z); } + /* ======================================== FORGE START =====================================*/ -+ // JAVADOC METHOD $$ func_70666_h ++ // JAVADOC METHOD $$ getPosition + @SideOnly(Side.CLIENT) + @Override + public Vec3 getPosition(float par1) diff --git a/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch b/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch index 678745ff7e..7531956cb8 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch @@ -12,7 +12,7 @@ + public class EntityPlayerMP extends EntityPlayer implements ICrafting { - private static final Logger field_147102_bM = LogManager.getLogger(); + private static final Logger logger = LogManager.getLogger(); @@ -148,19 +154,11 @@ p_i45285_4_.thisPlayerMP = this; this.theItemInWorldManager = p_i45285_4_; @@ -77,7 +77,7 @@ public void onDeath(DamageSource par1DamageSource) { + if (ForgeHooks.onLivingDeath(this, par1DamageSource)) return; - this.mcServer.getConfigurationManager().func_148539_a(this.func_110142_aN().func_151521_b()); + this.mcServer.getConfigurationManager().sendChatMsg(this.func_110142_aN().func_151521_b()); if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { @@ -98,7 +98,7 @@ } Collection collection = this.worldObj.getScoreboard().func_96520_a(IScoreObjectiveCriteria.deathCount); -@@ -1034,4 +1048,15 @@ +@@ -1037,4 +1051,15 @@ { return this.field_147103_bO; } diff --git a/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch index 46d613b9ef..0046432e68 100644 --- a/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/entity/player/InventoryPlayer.java +++ ../src-work/minecraft/net/minecraft/entity/player/InventoryPlayer.java -@@ -324,6 +324,14 @@ +@@ -325,6 +325,14 @@ this.mainInventory[i].updateAnimation(this.player.worldObj, this.player, i, this.currentItem == i); } } @@ -14,4 +14,4 @@ + } } - public boolean func_146026_a(Item p_146026_1_) + // JAVADOC METHOD $$ func_146026_a diff --git a/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch index 4276a50fce..2a2388136e 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch @@ -18,38 +18,38 @@ { @@ -132,37 +134,15 @@ { - if ((j != 0 || k != 0) && this.worldPointer.func_147437_c(this.posX + k, this.posY, this.posZ + j) && this.worldPointer.func_147437_c(this.posX + k, this.posY + 1, this.posZ + j)) + if ((j != 0 || k != 0) && this.worldPointer.isAirBlock(this.posX + k, this.posY, this.posZ + j) && this.worldPointer.isAirBlock(this.posX + k, this.posY + 1, this.posZ + j)) { -- if (this.worldPointer.func_147439_a(this.posX + k * 2, this.posY, this.posZ + j * 2) == Blocks.bookshelf) +- if (this.worldPointer.getBlock(this.posX + k * 2, this.posY, this.posZ + j * 2) == Blocks.bookshelf) - { - ++i; - } + power += ForgeHooks.getEnchantPower(worldPointer, posX + k * 2, posY, posZ + j * 2); + power += ForgeHooks.getEnchantPower(worldPointer, posX + k * 2, posY + 1, posZ + j * 2); -- if (this.worldPointer.func_147439_a(this.posX + k * 2, this.posY + 1, this.posZ + j * 2) == Blocks.bookshelf) +- if (this.worldPointer.getBlock(this.posX + k * 2, this.posY + 1, this.posZ + j * 2) == Blocks.bookshelf) - { - ++i; - } - if (k != 0 && j != 0) { -- if (this.worldPointer.func_147439_a(this.posX + k * 2, this.posY, this.posZ + j) == Blocks.bookshelf) +- if (this.worldPointer.getBlock(this.posX + k * 2, this.posY, this.posZ + j) == Blocks.bookshelf) - { - ++i; - } - -- if (this.worldPointer.func_147439_a(this.posX + k * 2, this.posY + 1, this.posZ + j) == Blocks.bookshelf) +- if (this.worldPointer.getBlock(this.posX + k * 2, this.posY + 1, this.posZ + j) == Blocks.bookshelf) - { - ++i; - } - -- if (this.worldPointer.func_147439_a(this.posX + k, this.posY, this.posZ + j * 2) == Blocks.bookshelf) +- if (this.worldPointer.getBlock(this.posX + k, this.posY, this.posZ + j * 2) == Blocks.bookshelf) - { - ++i; - } - -- if (this.worldPointer.func_147439_a(this.posX + k, this.posY + 1, this.posZ + j * 2) == Blocks.bookshelf) +- if (this.worldPointer.getBlock(this.posX + k, this.posY + 1, this.posZ + j * 2) == Blocks.bookshelf) - { - ++i; - } diff --git a/patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch index 8b31610a84..87504b5148 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch @@ -4,7 +4,7 @@ // JAVADOC METHOD $$ func_75214_a public boolean isItemValid(ItemStack par1ItemStack) { -- return par1ItemStack == null ? false : (par1ItemStack.getItem() instanceof ItemArmor ? ((ItemArmor)par1ItemStack.getItem()).armorType == k : (par1ItemStack.getItem() != Item.func_150898_a(Blocks.pumpkin) && par1ItemStack.getItem() != Items.skull ? false : k == 0)); +- return par1ItemStack == null ? false : (par1ItemStack.getItem() instanceof ItemArmor ? ((ItemArmor)par1ItemStack.getItem()).armorType == k : (par1ItemStack.getItem() != Item.getItemFromBlock(Blocks.pumpkin) && par1ItemStack.getItem() != Items.skull ? false : k == 0)); + if (par1ItemStack == null) return false; + return par1ItemStack.getItem().isValidArmor(par1ItemStack, k, thePlayer); } diff --git a/patches/minecraft/net/minecraft/item/Item.java.patch b/patches/minecraft/net/minecraft/item/Item.java.patch index e1552d4624..2507837b85 100644 --- a/patches/minecraft/net/minecraft/item/Item.java.patch +++ b/patches/minecraft/net/minecraft/item/Item.java.patch @@ -59,7 +59,7 @@ public boolean hasContainerItem() { return this.containerItem != null; -@@ -660,6 +672,7 @@ +@@ -662,6 +674,7 @@ } @SideOnly(Side.CLIENT) @@ -67,7 +67,7 @@ public boolean hasEffect(ItemStack par1ItemStack) { return par1ItemStack.isItemEnchanted(); -@@ -674,7 +687,7 @@ +@@ -676,7 +689,7 @@ // JAVADOC METHOD $$ func_77616_k public boolean isItemTool(ItemStack par1ItemStack) { @@ -76,7 +76,7 @@ } protected MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, boolean par3) -@@ -683,7 +696,7 @@ +@@ -685,7 +698,7 @@ float f1 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * f; float f2 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * f; double d0 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double)f; @@ -85,7 +85,7 @@ double d2 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double)f; Vec3 vec3 = par1World.getWorldVec3Pool().getVecFromPool(d0, d1, d2); float f3 = MathHelper.cos(-f2 * 0.017453292F - (float)Math.PI); -@@ -693,6 +706,10 @@ +@@ -695,6 +708,10 @@ float f7 = f4 * f5; float f8 = f3 * f5; double d3 = 5.0D; @@ -96,8 +96,8 @@ Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3); return par1World.func_147447_a(vec3, vec31, par3, !par3, false); } -@@ -773,6 +790,542 @@ - return this.iconString == null ? "MISSING_ICON_ITEM_" + field_150901_e.func_148757_b(this) + "_" + this.unlocalizedName : this.iconString; +@@ -776,6 +793,542 @@ + return this.iconString == null ? "MISSING_ICON_ITEM_" + itemRegistry.getIDForObject(this) + "_" + this.unlocalizedName : this.iconString; } + /* ======================================== FORGE START =====================================*/ @@ -415,7 +415,7 @@ + + if (armorType == 0) + { -+ return this == Item.func_150898_a(Blocks.pumpkin) || this == Items.skull; ++ return this == Item.getItemFromBlock(Blocks.pumpkin) || this == Items.skull; + } + + return false; @@ -639,7 +639,7 @@ public static enum ToolMaterial { WOOD(0, 59, 2.0F, 0.0F, 15), -@@ -793,6 +1346,9 @@ +@@ -796,6 +1349,9 @@ private static final String __OBFID = "CL_00000042"; @@ -649,15 +649,15 @@ private ToolMaterial(int par3, int par4, float par5, float par6, int par7) { this.harvestLevel = par3; -@@ -834,7 +1390,15 @@ +@@ -837,7 +1393,15 @@ public Item func_150995_f() { -- return this == WOOD ? Item.func_150898_a(Blocks.planks) : (this == STONE ? Item.func_150898_a(Blocks.cobblestone) : (this == GOLD ? Items.gold_ingot : (this == IRON ? Items.iron_ingot : (this == EMERALD ? Items.diamond : null)))); +- return this == WOOD ? Item.getItemFromBlock(Blocks.planks) : (this == STONE ? Item.getItemFromBlock(Blocks.cobblestone) : (this == GOLD ? Items.gold_ingot : (this == IRON ? Items.iron_ingot : (this == EMERALD ? Items.diamond : null)))); + switch (this) + { -+ case WOOD: return Item.func_150898_a(Blocks.planks); -+ case STONE: return Item.func_150898_a(Blocks.cobblestone); ++ case WOOD: return Item.getItemFromBlock(Blocks.planks); ++ case STONE: return Item.getItemFromBlock(Blocks.cobblestone); + case GOLD: return Items.gold_ingot; + case IRON: return Items.iron_ingot; + case EMERALD: return Items.diamond; diff --git a/patches/minecraft/net/minecraft/item/ItemBlock.java.patch b/patches/minecraft/net/minecraft/item/ItemBlock.java.patch index 2a41779aa7..d3cbd0c8cd 100644 --- a/patches/minecraft/net/minecraft/item/ItemBlock.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBlock.java.patch @@ -11,18 +11,18 @@ { @@ -104,14 +104,8 @@ int i1 = this.getMetadata(par1ItemStack.getItemDamage()); - int j1 = this.field_150939_a.func_149660_a(par3World, par4, par5, par6, par7, par8, par9, par10, i1); + int j1 = this.field_150939_a.onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, i1); -- if (par3World.func_147465_d(par4, par5, par6, this.field_150939_a, j1, 3)) +- if (par3World.setBlock(par4, par5, par6, this.field_150939_a, j1, 3)) + if (placeBlockAt(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10, j1)) { -- if (par3World.func_147439_a(par4, par5, par6) == this.field_150939_a) +- if (par3World.getBlock(par4, par5, par6) == this.field_150939_a) - { -- this.field_150939_a.func_149689_a(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack); -- this.field_150939_a.func_149714_e(par3World, par4, par5, par6, j1); +- this.field_150939_a.onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack); +- this.field_150939_a.onPostBlockPlaced(par3World, par4, par5, par6, j1); - } - - par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.field_150939_a.field_149762_H.func_150496_b(), (this.field_150939_a.field_149762_H.func_150497_c() + 1.0F) / 2.0F, this.field_150939_a.field_149762_H.func_150494_d() * 0.8F); + par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.field_150939_a.stepSound.func_150496_b(), (this.field_150939_a.stepSound.getVolume() + 1.0F) / 2.0F, this.field_150939_a.stepSound.getPitch() * 0.8F); --par1ItemStack.stackSize; } @@ -133,7 +127,7 @@ @@ -34,7 +34,7 @@ { if (p_150936_5_ == 0) { -@@ -204,4 +198,29 @@ +@@ -205,4 +199,29 @@ this.field_150938_b = par1IconRegister.registerIcon(s); } } @@ -50,15 +50,15 @@ + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) + { + -+ if (!world.func_147465_d(x, y, z, field_150939_a, metadata, 3)) ++ if (!world.setBlock(x, y, z, field_150939_a, metadata, 3)) + { + return false; + } + -+ if (world.func_147439_a(x, y, z) == field_150939_a) ++ if (world.getBlock(x, y, z) == field_150939_a) + { -+ field_150939_a.func_149689_a(world, x, y, z, player, stack); -+ field_150939_a.func_149714_e(world, x, y, z, metadata); ++ field_150939_a.onBlockPlacedBy(world, x, y, z, player, stack); ++ field_150939_a.onPostBlockPlaced(world, x, y, z, metadata); + } + + return true; diff --git a/patches/minecraft/net/minecraft/item/ItemBow.java.patch b/patches/minecraft/net/minecraft/item/ItemBow.java.patch index d903398342..9035cb5c13 100644 --- a/patches/minecraft/net/minecraft/item/ItemBow.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBow.java.patch @@ -26,7 +26,7 @@ + boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0; - if (flag || par3EntityPlayer.inventory.func_146028_b(Items.arrow)) + if (flag || par3EntityPlayer.inventory.hasItem(Items.arrow)) { - int j = this.getMaxItemUseDuration(par1ItemStack) - par4; float f = (float)j / 20.0F; @@ -43,6 +43,6 @@ + return event.result; + } + - if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.func_146028_b(Items.arrow)) + if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Items.arrow)) { par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); diff --git a/patches/minecraft/net/minecraft/item/ItemDye.java.patch b/patches/minecraft/net/minecraft/item/ItemDye.java.patch index 567d4e18ed..098ab6e442 100644 --- a/patches/minecraft/net/minecraft/item/ItemDye.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemDye.java.patch @@ -38,7 +38,7 @@ + + public static boolean applyBonemeal(ItemStack p_150919_0_, World p_150919_1_, int p_150919_2_, int p_150919_3_, int p_150919_4_, EntityPlayer player) + { - Block block = p_150919_1_.func_147439_a(p_150919_2_, p_150919_3_, p_150919_4_); + Block block = p_150919_1_.getBlock(p_150919_2_, p_150919_3_, p_150919_4_); + BonemealEvent event = new BonemealEvent(player, p_150919_1_, block, p_150919_2_, p_150919_3_, p_150919_4_); + if (MinecraftForge.EVENT_BUS.post(event)) @@ -59,7 +59,7 @@ { IGrowable igrowable = (IGrowable)block; @@ -175,6 +202,16 @@ - p_150918_0_.spawnParticle("happyVillager", (double)((float)p_150918_1_ + itemRand.nextFloat()), (double)p_150918_2_ + (double)itemRand.nextFloat() * block.func_149669_A(), (double)((float)p_150918_3_ + itemRand.nextFloat()), d0, d1, d2); + p_150918_0_.spawnParticle("happyVillager", (double)((float)p_150918_1_ + itemRand.nextFloat()), (double)p_150918_2_ + (double)itemRand.nextFloat() * block.getBlockBoundsMaxY(), (double)((float)p_150918_3_ + itemRand.nextFloat()), d0, d1, d2); } } + else diff --git a/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch b/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch index 1f9b743fac..62bda6e1c8 100644 --- a/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch @@ -4,8 +4,8 @@ } else { -- if (par3World.func_147439_a(par4, par5, par6).func_149688_o() == Material.field_151579_a) -+ if (par3World.func_147437_c(par4, par5, par6)) +- if (par3World.getBlock(par4, par5, par6).getMaterial() == Material.air) ++ if (par3World.isAirBlock(par4, par5, par6)) { par3World.playSoundEffect((double)par4 + 0.5D, (double)par5 + 0.5D, (double)par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); - par3World.func_147449_b(par4, par5, par6, Blocks.fire); + par3World.setBlock(par4, par5, par6, Blocks.fire); diff --git a/patches/minecraft/net/minecraft/item/ItemHoe.java.patch b/patches/minecraft/net/minecraft/item/ItemHoe.java.patch index c68247fe7d..d012875c16 100644 --- a/patches/minecraft/net/minecraft/item/ItemHoe.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemHoe.java.patch @@ -32,10 +32,10 @@ + return true; + } + - Block block = par3World.func_147439_a(par4, par5, par6); + Block block = par3World.getBlock(par4, par5, par6); -- if (par7 != 0 && par3World.func_147439_a(par4, par5 + 1, par6).func_149688_o() == Material.field_151579_a && (block == Blocks.grass || block == Blocks.dirt)) -+ if (par7 != 0 && par3World.func_147439_a(par4, par5 + 1, par6).isAir(par3World, par4, par5 + 1, par6) && (block == Blocks.grass || block == Blocks.dirt)) +- if (par7 != 0 && par3World.getBlock(par4, par5 + 1, par6).getMaterial() == Material.air && (block == Blocks.grass || block == Blocks.dirt)) ++ if (par7 != 0 && par3World.getBlock(par4, par5 + 1, par6).isAir(par3World, par4, par5 + 1, par6) && (block == Blocks.grass || block == Blocks.dirt)) { Block block1 = Blocks.farmland; - par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), block1.field_149762_H.func_150498_e(), (block1.field_149762_H.func_150497_c() + 1.0F) / 2.0F, block1.field_149762_H.func_150494_d() * 0.8F); + par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F); diff --git a/patches/minecraft/net/minecraft/item/ItemRecord.java.patch b/patches/minecraft/net/minecraft/item/ItemRecord.java.patch index 3eefbbb5c2..dfda47ab57 100644 --- a/patches/minecraft/net/minecraft/item/ItemRecord.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemRecord.java.patch @@ -8,8 +8,8 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; -@@ -24,7 +25,7 @@ - this.field_150929_a = p_i45350_1_; +@@ -25,7 +26,7 @@ + this.recordName = p_i45350_1_; this.maxStackSize = 1; this.setCreativeTab(CreativeTabs.tabMisc); - field_150928_b.put(p_i45350_1_, this); @@ -17,7 +17,7 @@ } // JAVADOC METHOD $$ func_77617_a -@@ -81,4 +82,15 @@ +@@ -83,4 +84,15 @@ { return (ItemRecord)field_150928_b.get(p_150926_0_); } diff --git a/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch b/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch index 43a232987b..12b50d0232 100644 --- a/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch @@ -19,10 +19,10 @@ } else if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) { -- if (par3World.func_147439_a(par4, par5, par6) == this.soilId && par3World.func_147437_c(par4, par5 + 1, par6)) -+ if (par3World.func_147439_a(par4, par5, par6).canSustainPlant(par3World, par4, par5, par6, ForgeDirection.UP, this) && par3World.func_147437_c(par4, par5 + 1, par6)) +- if (par3World.getBlock(par4, par5, par6) == this.soilId && par3World.isAirBlock(par4, par5 + 1, par6)) ++ if (par3World.getBlock(par4, par5, par6).canSustainPlant(par3World, par4, par5, par6, ForgeDirection.UP, this) && par3World.isAirBlock(par4, par5 + 1, par6)) { - par3World.func_147449_b(par4, par5 + 1, par6, this.field_150908_b); + par3World.setBlock(par4, par5 + 1, par6, this.field_150908_b); --par1ItemStack.stackSize; @@ -43,4 +47,22 @@ return false; diff --git a/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch b/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch index 858f3c439d..be480601d9 100644 --- a/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch @@ -20,10 +20,10 @@ } else if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) { -- if (par3World.func_147439_a(par4, par5, par6) == this.soilBlockID && par3World.func_147437_c(par4, par5 + 1, par6)) -+ if (par3World.func_147439_a(par4, par5, par6).canSustainPlant(par3World, par4, par5, par6, ForgeDirection.UP, this) && par3World.func_147437_c(par4, par5 + 1, par6)) +- if (par3World.getBlock(par4, par5, par6) == this.soilBlockID && par3World.isAirBlock(par4, par5 + 1, par6)) ++ if (par3World.getBlock(par4, par5, par6).canSustainPlant(par3World, par4, par5, par6, ForgeDirection.UP, this) && par3World.isAirBlock(par4, par5 + 1, par6)) { - par3World.func_147449_b(par4, par5 + 1, par6, this.field_150925_a); + par3World.setBlock(par4, par5 + 1, par6, this.field_150925_a); --par1ItemStack.stackSize; @@ -44,4 +49,22 @@ return false; diff --git a/patches/minecraft/net/minecraft/item/ItemShears.java.patch b/patches/minecraft/net/minecraft/item/ItemShears.java.patch index d65ee9df68..bfc1429ee3 100644 --- a/patches/minecraft/net/minecraft/item/ItemShears.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemShears.java.patch @@ -23,12 +23,12 @@ { @@ -20,13 +29,12 @@ - public boolean func_150894_a(ItemStack p_150894_1_, World p_150894_2_, Block p_150894_3_, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_) + public boolean onBlockDestroyed(ItemStack p_150894_1_, World p_150894_2_, Block p_150894_3_, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_) { -- if (p_150894_3_.func_149688_o() != Material.field_151584_j && p_150894_3_ != Blocks.web && p_150894_3_ != Blocks.tallgrass && p_150894_3_ != Blocks.vine && p_150894_3_ != Blocks.tripwire) -+ if (p_150894_3_.func_149688_o() != Material.field_151584_j && p_150894_3_ != Blocks.web && p_150894_3_ != Blocks.tallgrass && p_150894_3_ != Blocks.vine && p_150894_3_ != Blocks.tripwire && !(p_150894_3_ instanceof IShearable)) +- if (p_150894_3_.getMaterial() != Material.leaves && p_150894_3_ != Blocks.web && p_150894_3_ != Blocks.tallgrass && p_150894_3_ != Blocks.vine && p_150894_3_ != Blocks.tripwire) ++ if (p_150894_3_.getMaterial() != Material.leaves && p_150894_3_ != Blocks.web && p_150894_3_ != Blocks.tallgrass && p_150894_3_ != Blocks.vine && p_150894_3_ != Blocks.tripwire && !(p_150894_3_ instanceof IShearable)) { - return super.func_150894_a(p_150894_1_, p_150894_2_, p_150894_3_, p_150894_4_, p_150894_5_, p_150894_6_, p_150894_7_); + return super.onBlockDestroyed(p_150894_1_, p_150894_2_, p_150894_3_, p_150894_4_, p_150894_5_, p_150894_6_, p_150894_7_); } else { @@ -38,7 +38,7 @@ } @@ -40,4 +48,69 @@ { - return p_150893_2_ != Blocks.web && p_150893_2_.func_149688_o() != Material.field_151584_j ? (p_150893_2_ == Blocks.wool ? 5.0F : super.func_150893_a(p_150893_1_, p_150893_2_)) : 15.0F; + return p_150893_2_ != Blocks.web && p_150893_2_.getMaterial() != Material.leaves ? (p_150893_2_ == Blocks.wool ? 5.0F : super.func_150893_a(p_150893_1_, p_150893_2_)) : 15.0F; } + + @Override @@ -78,7 +78,7 @@ + { + return false; + } -+ Block block = player.worldObj.func_147439_a(x, y, z); ++ Block block = player.worldObj.getBlock(x, y, z); + if (block instanceof IShearable) + { + IShearable target = (IShearable)block; @@ -95,12 +95,12 @@ + double d1 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d2 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + EntityItem entityitem = new EntityItem(player.worldObj, (double)x + d, (double)y + d1, (double)z + d2, stack); -+ entityitem.field_145804_b = 10; ++ entityitem.delayBeforeCanPickup = 10; + player.worldObj.spawnEntityInWorld(entityitem); + } + + itemstack.damageItem(1, player); -+ player.addStat(StatList.mineBlockStatArray[Block.func_149682_b(block)], 1); ++ player.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(block)], 1); + } + } + return false; diff --git a/patches/minecraft/net/minecraft/item/ItemStack.java.patch b/patches/minecraft/net/minecraft/item/ItemStack.java.patch index 042d3f21e3..908b44711e 100644 --- a/patches/minecraft/net/minecraft/item/ItemStack.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemStack.java.patch @@ -87,7 +87,7 @@ + return getItem().canHarvestBlock(p_150998_1_, this); } - public boolean func_111282_a(EntityPlayer par1EntityPlayer, EntityLivingBase par2EntityLivingBase) + public boolean interactWithEntity(EntityPlayer par1EntityPlayer, EntityLivingBase par2EntityLivingBase) @@ -653,16 +649,24 @@ { arraylist.add("Durability: " + (this.getMaxDamage() - this.getItemDamageForDisplay()) + " / " + this.getMaxDamage()); diff --git a/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch b/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch index 370176d50d..aacbd2ad86 100644 --- a/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java +++ ../src-work/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java -@@ -109,6 +109,9 @@ +@@ -110,6 +110,9 @@ public float func_151398_b(ItemStack p_151398_1_) { diff --git a/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch b/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch index ac8244c324..5bc4f47d11 100644 --- a/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch +++ b/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch @@ -14,134 +14,134 @@ + public class NetHandlerPlayServer implements INetHandlerPlayServer { - private static final Logger field_147370_c = LogManager.getLogger(); -@@ -219,6 +227,11 @@ - this.field_147369_b.ridingEntity.updateRiderPosition(); + private static final Logger logger = LogManager.getLogger(); +@@ -229,6 +237,11 @@ + this.playerEntity.ridingEntity.updateRiderPosition(); } -+ if (!this.field_147380_r) //Fixes teleportation kick while riding entities ++ if (!this.hasMoved) //Fixes teleportation kick while riding entities + { + return; + } + - this.field_147367_d.getConfigurationManager().serverUpdateMountedMovingPlayer(this.field_147369_b); + this.serverController.getConfigurationManager().updatePlayerPertinentChunks(this.playerEntity); - if (this.field_147380_r) -@@ -296,9 +309,10 @@ - d4 = d1 - this.field_147369_b.posX; - double d5 = d2 - this.field_147369_b.posY; - double d6 = d3 - this.field_147369_b.posZ; -- double d7 = Math.min(Math.abs(d4), Math.abs(this.field_147369_b.motionX)); -- double d8 = Math.min(Math.abs(d5), Math.abs(this.field_147369_b.motionY)); -- double d9 = Math.min(Math.abs(d6), Math.abs(this.field_147369_b.motionZ)); + if (this.hasMoved) +@@ -306,9 +319,10 @@ + d4 = d1 - this.playerEntity.posX; + double d5 = d2 - this.playerEntity.posY; + double d6 = d3 - this.playerEntity.posZ; +- double d7 = Math.min(Math.abs(d4), Math.abs(this.playerEntity.motionX)); +- double d8 = Math.min(Math.abs(d5), Math.abs(this.playerEntity.motionY)); +- double d9 = Math.min(Math.abs(d6), Math.abs(this.playerEntity.motionZ)); + //BUGFIX: min -> max, grabs the highest distance -+ double d7 = Math.max(Math.abs(d4), Math.abs(this.field_147369_b.motionX)); -+ double d8 = Math.max(Math.abs(d5), Math.abs(this.field_147369_b.motionY)); -+ double d9 = Math.max(Math.abs(d6), Math.abs(this.field_147369_b.motionZ)); ++ double d7 = Math.max(Math.abs(d4), Math.abs(this.playerEntity.motionX)); ++ double d8 = Math.max(Math.abs(d5), Math.abs(this.playerEntity.motionY)); ++ double d9 = Math.max(Math.abs(d6), Math.abs(this.playerEntity.motionZ)); double d10 = d7 * d7 + d8 * d8 + d9 * d9; - if (d10 > 100.0D && (!this.field_147367_d.isSinglePlayer() || !this.field_147367_d.getServerOwner().equals(this.field_147369_b.getCommandSenderName()))) -@@ -316,6 +330,11 @@ - this.field_147369_b.jump(); + if (d10 > 100.0D && (!this.serverController.isSinglePlayer() || !this.serverController.getServerOwner().equals(this.playerEntity.getCommandSenderName()))) +@@ -326,6 +340,11 @@ + this.playerEntity.jump(); } -+ if (!this.field_147380_r) //Fixes "Moved Too Fast" kick when being teleported while moving ++ if (!this.hasMoved) //Fixes "Moved Too Fast" kick when being teleported while moving + { + return; + } + - this.field_147369_b.moveEntity(d4, d5, d6); - this.field_147369_b.onGround = p_147347_1_.func_149465_i(); - this.field_147369_b.addMovementStat(d4, d5, d6); -@@ -338,10 +357,15 @@ - field_147370_c.warn(this.field_147369_b.getCommandSenderName() + " moved wrongly!"); + this.playerEntity.moveEntity(d4, d5, d6); + this.playerEntity.onGround = p_147347_1_.func_149465_i(); + this.playerEntity.addMovementStat(d4, d5, d6); +@@ -348,10 +367,15 @@ + logger.warn(this.playerEntity.getCommandSenderName() + " moved wrongly!"); } -+ if (!this.field_147380_r) //Fixes "Moved Too Fast" kick when being teleported while moving ++ if (!this.hasMoved) //Fixes "Moved Too Fast" kick when being teleported while moving + { + return; + } + - this.field_147369_b.setPositionAndRotation(d1, d2, d3, f1, f2); - boolean flag2 = worldserver.getCollidingBoundingBoxes(this.field_147369_b, this.field_147369_b.boundingBox.copy().contract((double)f3, (double)f3, (double)f3)).isEmpty(); + this.playerEntity.setPositionAndRotation(d1, d2, d3, f1, f2); + boolean flag2 = worldserver.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.boundingBox.copy().contract((double)f3, (double)f3, (double)f3)).isEmpty(); -- if (flag && (flag1 || !flag2) && !this.field_147369_b.isPlayerSleeping()) -+ if (flag && (flag1 || !flag2) && !this.field_147369_b.isPlayerSleeping() && !this.field_147369_b.noClip) +- if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping()) ++ if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.noClip) { - this.func_147364_a(this.field_147373_o, this.field_147382_p, this.field_147381_q, f1, f2); + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, f1, f2); return; -@@ -349,7 +373,7 @@ +@@ -359,7 +383,7 @@ - AxisAlignedBB axisalignedbb = this.field_147369_b.boundingBox.copy().expand((double)f3, (double)f3, (double)f3).addCoord(0.0D, -0.55D, 0.0D); + AxisAlignedBB axisalignedbb = this.playerEntity.boundingBox.copy().expand((double)f3, (double)f3, (double)f3).addCoord(0.0D, -0.55D, 0.0D); -- if (!this.field_147367_d.isFlightAllowed() && !this.field_147369_b.theItemInWorldManager.isCreative() && !worldserver.checkBlockCollision(axisalignedbb)) -+ if (!this.field_147367_d.isFlightAllowed() && !this.field_147369_b.theItemInWorldManager.isCreative() && !worldserver.checkBlockCollision(axisalignedbb) && !this.field_147369_b.capabilities.allowFlying) +- if (!this.serverController.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !worldserver.checkBlockCollision(axisalignedbb)) ++ if (!this.serverController.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !worldserver.checkBlockCollision(axisalignedbb) && !this.playerEntity.capabilities.allowFlying) { if (d11 >= -0.03125D) { -@@ -368,6 +392,11 @@ - this.field_147365_f = 0; +@@ -378,6 +402,11 @@ + this.floatingTickCount = 0; } -+ if (!this.field_147380_r) //Fixes "Moved Too Fast" kick when being teleported while moving ++ if (!this.hasMoved) //Fixes "Moved Too Fast" kick when being teleported while moving + { + return; + } + - this.field_147369_b.onGround = p_147347_1_.func_149465_i(); - this.field_147367_d.getConfigurationManager().serverUpdateMountedMovingPlayer(this.field_147369_b); - this.field_147369_b.updateFlyingState(this.field_147369_b.posY - d0, p_147347_1_.func_149465_i()); -@@ -436,7 +465,10 @@ - double d2 = this.field_147369_b.posZ - ((double)k + 0.5D); + this.playerEntity.onGround = p_147347_1_.func_149465_i(); + this.serverController.getConfigurationManager().updatePlayerPertinentChunks(this.playerEntity); + this.playerEntity.handleFalling(this.playerEntity.posY - d0, p_147347_1_.func_149465_i()); +@@ -448,7 +477,10 @@ + double d2 = this.playerEntity.posZ - ((double)k + 0.5D); double d3 = d0 * d0 + d1 * d1 + d2 * d2; - if (d3 > 36.0D) -+ double dist = field_147369_b.theItemInWorldManager.getBlockReachDistance() + 1; ++ double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 1; + dist *= dist; + + if (d3 > dist) { return; } -@@ -497,7 +529,11 @@ +@@ -510,7 +542,11 @@ return; } -- this.field_147369_b.theItemInWorldManager.tryUseItem(this.field_147369_b, worldserver, itemstack); -+ PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(field_147369_b, PlayerInteractEvent.Action.RIGHT_CLICK_AIR, 0, 0, 0, -1); +- this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, worldserver, itemstack); ++ PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(playerEntity, PlayerInteractEvent.Action.RIGHT_CLICK_AIR, 0, 0, 0, -1); + if (event.useItem != Event.Result.DENY) + { -+ this.field_147369_b.theItemInWorldManager.tryUseItem(this.field_147369_b, worldserver, itemstack); ++ this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, worldserver, itemstack); + } } - else if (p_147346_1_.func_149571_d() >= this.field_147367_d.getBuildLimit() - 1 && (p_147346_1_.func_149568_f() == 1 || p_147346_1_.func_149571_d() >= this.field_147367_d.getBuildLimit())) + else if (p_147346_1_.func_149571_d() >= this.serverController.getBuildLimit() - 1 && (p_147346_1_.func_149568_f() == 1 || p_147346_1_.func_149571_d() >= this.serverController.getBuildLimit())) { -@@ -508,7 +544,9 @@ +@@ -521,7 +557,9 @@ } else { -- if (this.field_147380_r && this.field_147369_b.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < 64.0D && !this.field_147367_d.isBlockProtected(worldserver, i, j, k, this.field_147369_b)) -+ double dist = field_147369_b.theItemInWorldManager.getBlockReachDistance() + 1; +- if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < 64.0D && !this.serverController.isBlockProtected(worldserver, i, j, k, this.playerEntity)) ++ double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 1; + dist *= dist; -+ if (this.field_147380_r && this.field_147369_b.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < dist && !this.field_147367_d.isBlockProtected(worldserver, i, j, k, this.field_147369_b)) ++ if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < dist && !this.serverController.isBlockProtected(worldserver, i, j, k, this.playerEntity)) { - this.field_147369_b.theItemInWorldManager.activateBlockOrUseItem(this.field_147369_b, worldserver, itemstack, i, j, k, l, p_147346_1_.func_149573_h(), p_147346_1_.func_149569_i(), p_147346_1_.func_149575_j()); + this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, i, j, k, l, p_147346_1_.func_149573_h(), p_147346_1_.func_149569_i(), p_147346_1_.func_149575_j()); } -@@ -674,6 +712,8 @@ +@@ -690,6 +728,8 @@ else { - ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", new Object[] {this.field_147369_b.func_145748_c_(), s}); + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", new Object[] {this.playerEntity.func_145748_c_(), s}); + chatcomponenttranslation1 = ForgeHooks.onServerChatEvent(this, s, chatcomponenttranslation1); + if (chatcomponenttranslation1 == null) return; - this.field_147367_d.getConfigurationManager().func_148544_a(chatcomponenttranslation1, false); + this.serverController.getConfigurationManager().sendChatMsgImpl(chatcomponenttranslation1, false); } -@@ -810,7 +850,7 @@ +@@ -831,7 +871,7 @@ return; } -- this.field_147369_b = this.field_147367_d.getConfigurationManager().respawnPlayer(this.field_147369_b, 0, false); -+ this.field_147369_b = this.field_147367_d.getConfigurationManager().respawnPlayer(this.field_147369_b, field_147369_b.dimension, false); +- this.playerEntity = this.serverController.getConfigurationManager().respawnPlayer(this.playerEntity, 0, false); ++ this.playerEntity = this.serverController.getConfigurationManager().respawnPlayer(this.playerEntity, playerEntity.dimension, false); } break; diff --git a/patches/minecraft/net/minecraft/network/play/server/S21PacketChunkData.java.patch b/patches/minecraft/net/minecraft/network/play/server/S21PacketChunkData.java.patch index 6c84cf2a18..93908ae12f 100644 --- a/patches/minecraft/net/minecraft/network/play/server/S21PacketChunkData.java.patch +++ b/patches/minecraft/net/minecraft/network/play/server/S21PacketChunkData.java.patch @@ -44,7 +44,7 @@ } finally { -@@ -75,13 +82,16 @@ +@@ -76,13 +83,16 @@ p_148837_1_.readBytes(field_149286_i, 0, this.field_149285_h); int i = 0; int j; @@ -61,9 +61,9 @@ if (this.field_149279_g) { -@@ -108,6 +118,15 @@ - - public void func_148840_b(PacketBuffer p_148840_1_) throws IOException +@@ -110,6 +120,15 @@ + // JAVADOC METHOD $$ func_148840_b + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + if (this.field_149281_e == null) + { diff --git a/patches/minecraft/net/minecraft/network/play/server/S26PacketMapChunkBulk.java.patch b/patches/minecraft/net/minecraft/network/play/server/S26PacketMapChunkBulk.java.patch index 98ad9d4e14..5124fc18fa 100644 --- a/patches/minecraft/net/minecraft/network/play/server/S26PacketMapChunkBulk.java.patch +++ b/patches/minecraft/net/minecraft/network/play/server/S26PacketMapChunkBulk.java.patch @@ -65,9 +65,9 @@ } finally { -@@ -148,6 +155,16 @@ - - public void func_148840_b(PacketBuffer p_148840_1_) throws IOException +@@ -150,6 +157,16 @@ + // JAVADOC METHOD $$ func_148840_b + public void writePacketData(PacketBuffer p_148840_1_) throws IOException { + if (this.field_149263_e == null) + { diff --git a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch index 4c30200c09..333735f5a6 100644 --- a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch @@ -18,7 +18,7 @@ + public abstract class MinecraftServer implements ICommandSender, Runnable, IPlayerUsage { - private static final Logger field_147145_h = LogManager.getLogger(); + private static final Logger logger = LogManager.getLogger(); @@ -93,7 +98,7 @@ // JAVADOC FIELD $$ field_71319_s private int serverPort = -1; @@ -156,7 +156,7 @@ + this.theProfiler.endStartSection("dim_unloading"); + DimensionManager.unloadWorlds(worldTickTimes); this.theProfiler.endStartSection("connection"); - this.func_147137_ag().func_151269_c(); + this.func_147137_ag().networkTick(); this.theProfiler.endStartSection("players"); @@ -731,7 +722,13 @@ // JAVADOC METHOD $$ func_71218_a @@ -173,7 +173,7 @@ } // JAVADOC METHOD $$ func_71249_w -@@ -1006,6 +1003,7 @@ +@@ -1007,6 +1004,7 @@ if (worldserver != null) { @@ -181,7 +181,7 @@ worldserver.flush(); } } -@@ -1494,7 +1492,6 @@ +@@ -1496,7 +1494,6 @@ this.field_147141_M = p_155759_1_; } diff --git a/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch b/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch index c6302da7de..9d41fb0266 100644 --- a/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch +++ b/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch @@ -31,7 +31,7 @@ + PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(thisPlayerMP, Action.LEFT_CLICK_BLOCK, par1, par2, par3, par4); + if (event.isCanceled()) + { -+ thisPlayerMP.playerNetServerHandler.func_147359_a(new S23PacketBlockChange(par1, par2, par3, theWorld)); ++ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(par1, par2, par3, theWorld)); + return; + } + @@ -45,32 +45,32 @@ - this.theWorld.extinguishFire((EntityPlayer)null, par1, par2, par3, par4); this.initialDamage = this.curblockDamage; float f = 1.0F; - Block block = this.theWorld.func_147439_a(par1, par2, par3); + Block block = this.theWorld.getBlock(par1, par2, par3); -- if (block.func_149688_o() != Material.field_151579_a) +- if (block.getMaterial() != Material.air) + + if (!block.isAir(theWorld, par1, par2, par3)) { -- block.func_149699_a(this.theWorld, par1, par2, par3, this.thisPlayerMP); -- f = block.func_149737_a(this.thisPlayerMP, this.thisPlayerMP.worldObj, par1, par2, par3); +- block.onBlockClicked(this.theWorld, par1, par2, par3, this.thisPlayerMP); +- f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, par1, par2, par3); + if (event.useBlock != Event.Result.DENY) + { -+ block.func_149699_a(theWorld, par1, par2, par3, thisPlayerMP); ++ block.onBlockClicked(theWorld, par1, par2, par3, thisPlayerMP); + theWorld.extinguishFire(thisPlayerMP, par1, par2, par3, par4); + } + else + { -+ thisPlayerMP.playerNetServerHandler.func_147359_a(new S23PacketBlockChange(par1, par2, par3, theWorld)); ++ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(par1, par2, par3, theWorld)); + } -+ f = block.func_149737_a(thisPlayerMP, thisPlayerMP.worldObj, par1, par2, par3); ++ f = block.getPlayerRelativeBlockHardness(thisPlayerMP, thisPlayerMP.worldObj, par1, par2, par3); } -- if (block.func_149688_o() != Material.field_151579_a && f >= 1.0F) +- if (block.getMaterial() != Material.air && f >= 1.0F) + if (event.useItem == Event.Result.DENY) { + if (f >= 1.0f) + { -+ thisPlayerMP.playerNetServerHandler.func_147359_a(new S23PacketBlockChange(par1, par2, par3, theWorld)); ++ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(par1, par2, par3, theWorld)); + } + return; + } @@ -82,18 +82,18 @@ else @@ -178,7 +213,7 @@ int l = this.curblockDamage - this.initialDamage; - Block block = this.theWorld.func_147439_a(par1, par2, par3); + Block block = this.theWorld.getBlock(par1, par2, par3); -- if (block.func_149688_o() != Material.field_151579_a) +- if (block.getMaterial() != Material.air) + if (!block.isAir(theWorld, par1, par2, par3)) { - float f = block.func_149737_a(this.thisPlayerMP, this.thisPlayerMP.worldObj, par1, par2, par3) * (float)(l + 1); + float f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, par1, par2, par3) * (float)(l + 1); @@ -214,7 +249,7 @@ - Block block = this.theWorld.func_147439_a(par1, par2, par3); + Block block = this.theWorld.getBlock(par1, par2, par3); int l = this.theWorld.getBlockMetadata(par1, par2, par3); - block.func_149681_a(this.theWorld, par1, par2, par3, l, this.thisPlayerMP); -- boolean flag = this.theWorld.func_147468_f(par1, par2, par3); + block.onBlockHarvested(this.theWorld, par1, par2, par3, l, this.thisPlayerMP); +- boolean flag = this.theWorld.setBlockToAir(par1, par2, par3); + boolean flag = block.removedByPlayer(theWorld, thisPlayerMP, par1, par2, par3); if (flag) @@ -119,21 +119,21 @@ + { + return false; + } - Block block = this.theWorld.func_147439_a(par1, par2, par3); + Block block = this.theWorld.getBlock(par1, par2, par3); int l = this.theWorld.getBlockMetadata(par1, par2, par3); - this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, par1, par2, par3, Block.func_149682_b(block) + (this.theWorld.getBlockMetadata(par1, par2, par3) << 12)); + this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, par1, par2, par3, Block.getIdFromBlock(block) + (this.theWorld.getBlockMetadata(par1, par2, par3) << 12)); - boolean flag = this.removeBlock(par1, par2, par3); + boolean flag = false; if (this.isCreative()) { + flag = this.removeBlock(par1, par2, par3); - this.thisPlayerMP.playerNetServerHandler.func_147359_a(new S23PacketBlockChange(par1, par2, par3, this.theWorld)); + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(par1, par2, par3, this.theWorld)); } else { ItemStack itemstack = this.thisPlayerMP.getCurrentEquippedItem(); -- boolean flag1 = this.thisPlayerMP.func_146099_a(block); +- boolean flag1 = this.thisPlayerMP.canHarvestBlock(block); + boolean flag1 = block.canHarvestBlock(thisPlayerMP, l); if (itemstack != null) @@ -145,14 +145,14 @@ + flag = this.removeBlock(par1, par2, par3); if (flag && flag1) { - block.func_149636_a(this.theWorld, this.thisPlayerMP, par1, par2, par3, l); + block.harvestBlock(this.theWorld, this.thisPlayerMP, par1, par2, par3, l); } } + // Drop experience + if (!this.isCreative() && flag && event != null) + { -+ block.func_149657_c(this.theWorld, par1, par2, par3, event.getExpToDrop()); ++ block.dropXpOnBlockBreak(this.theWorld, par1, par2, par3, event.getExpToDrop()); + } return flag; } @@ -169,12 +169,12 @@ // JAVADOC METHOD $$ func_73078_a public boolean activateBlockOrUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -- if ((!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null) && par2World.func_147439_a(par4, par5, par6).func_149727_a(par2World, par4, par5, par6, par1EntityPlayer, par7, par8, par9, par10)) +- if ((!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null) && par2World.getBlock(par4, par5, par6).onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, par8, par9, par10)) + PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(par1EntityPlayer, Action.RIGHT_CLICK_BLOCK, par4, par5, par6, par7); + if (event.isCanceled()) { - return true; -+ thisPlayerMP.playerNetServerHandler.func_147359_a(new S23PacketBlockChange(par4, par5, par6, theWorld)); ++ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(par4, par5, par6, theWorld)); + return false; } - else if (par3ItemStack == null) @@ -187,7 +187,7 @@ } - else if (this.isCreative()) + -+ Block block = par2World.func_147439_a(par4, par5, par6); ++ Block block = par2World.getBlock(par4, par5, par6); + boolean isAir = block.isAir(par2World, par4, par5, par6); + boolean useBlock = !par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null; + if (!useBlock) useBlock = par1EntityPlayer.getHeldItem().getItem().doesSneakBypassUse(par2World, par4, par5, par6, par1EntityPlayer); @@ -203,11 +203,11 @@ - return flag; + if (event.useBlock != Event.Result.DENY) + { -+ result = block.func_149727_a(par2World, par4, par5, par6, par1EntityPlayer, par7, par8, par9, par10); ++ result = block.onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, par8, par9, par10); + } + else + { -+ thisPlayerMP.playerNetServerHandler.func_147359_a(new S23PacketBlockChange(par4, par5, par6, theWorld)); ++ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(par4, par5, par6, theWorld)); + result = event.useItem != Event.Result.ALLOW; + } } diff --git a/patches/minecraft/net/minecraft/server/management/PlayerManager.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerManager.java.patch index b86c4659f3..a924a20919 100644 --- a/patches/minecraft/net/minecraft/server/management/PlayerManager.java.patch +++ b/patches/minecraft/net/minecraft/server/management/PlayerManager.java.patch @@ -19,12 +19,12 @@ public class PlayerManager { @@ -337,6 +341,8 @@ - this.playersInChunk.remove(par1EntityPlayerMP); + this.playersWatchingChunk.remove(par1EntityPlayerMP); par1EntityPlayerMP.loadedChunks.remove(this.chunkLocation); + MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.UnWatch(chunkLocation, par1EntityPlayerMP)); + - if (this.playersInChunk.isEmpty()) + if (this.playersWatchingChunk.isEmpty()) { long i = (long)this.chunkLocation.chunkXPos + 2147483647L | (long)this.chunkLocation.chunkZPos + 2147483647L << 32; @@ -376,7 +382,7 @@ @@ -40,21 +40,21 @@ } } -+ if (numberOfTilesToUpdate == field_151254_d.length) ++ if (numberOfTilesToUpdate == locationOfBlockChange.length) + { -+ field_151254_d = Arrays.copyOf(field_151254_d, field_151254_d.length << 1); ++ locationOfBlockChange = Arrays.copyOf(locationOfBlockChange, locationOfBlockChange.length << 1); + } - this.field_151254_d[this.numberOfTilesToUpdate++] = short1; + this.locationOfBlockChange[this.numberOfTilesToUpdate++] = short1; } } @@ -420,7 +430,7 @@ - k = this.chunkLocation.chunkZPos * 16 + (this.field_151254_d[0] >> 8 & 15); - this.func_151251_a(new S23PacketBlockChange(i, j, k, PlayerManager.this.theWorldServer)); + k = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[0] >> 8 & 15); + this.sendToAllPlayersWatchingChunk(new S23PacketBlockChange(i, j, k, PlayerManager.this.theWorldServer)); -- if (PlayerManager.this.theWorldServer.func_147439_a(i, j, k).func_149716_u()) -+ if (PlayerManager.this.theWorldServer.func_147439_a(i, j, k).hasTileEntity(PlayerManager.this.theWorldServer.getBlockMetadata(i, j, k))) +- if (PlayerManager.this.theWorldServer.getBlock(i, j, k).hasTileEntity()) ++ if (PlayerManager.this.theWorldServer.getBlock(i, j, k).hasTileEntity(PlayerManager.this.theWorldServer.getBlockMetadata(i, j, k))) { - this.func_151252_a(PlayerManager.this.theWorldServer.func_147438_o(i, j, k)); + this.sendTileToAllPlayersWatchingChunk(PlayerManager.this.theWorldServer.getTileEntity(i, j, k)); } @@ -429,12 +439,13 @@ { @@ -65,7 +65,7 @@ { i = this.chunkLocation.chunkXPos * 16; j = this.chunkLocation.chunkZPos * 16; - this.func_151251_a(new S21PacketChunkData(PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.flagsYAreasToUpdate)); + this.sendToAllPlayersWatchingChunk(new S21PacketChunkData(PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.flagsYAreasToUpdate)); + /* Forge: Grabs ALL tile entities is costly on a modded server, only send needed ones for (k = 0; k < 16; ++k) @@ -79,7 +79,7 @@ } else { - this.func_151251_a(new S22PacketMultiBlockChange(this.numberOfTilesToUpdate, this.field_151254_d, PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos))); + this.sendToAllPlayersWatchingChunk(new S22PacketMultiBlockChange(this.numberOfTilesToUpdate, this.locationOfBlockChange, PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos))); - + } + @@ -87,12 +87,12 @@ + WorldServer world = PlayerManager.this.theWorldServer; for (i = 0; i < this.numberOfTilesToUpdate; ++i) { - j = this.chunkLocation.chunkXPos * 16 + (this.field_151254_d[i] >> 12 & 15); - k = this.field_151254_d[i] & 255; - l = this.chunkLocation.chunkZPos * 16 + (this.field_151254_d[i] >> 8 & 15); + j = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[i] >> 12 & 15); + k = this.locationOfBlockChange[i] & 255; + l = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[i] >> 8 & 15); -- if (PlayerManager.this.theWorldServer.func_147439_a(j, k, l).func_149716_u()) -+ if (world.func_147439_a(j, k, l).hasTileEntity(world.getBlockMetadata(j, k, l))) +- if (PlayerManager.this.theWorldServer.getBlock(j, k, l).hasTileEntity()) ++ if (world.getBlock(j, k, l).hasTileEntity(world.getBlockMetadata(j, k, l))) { - this.func_151252_a(PlayerManager.this.theWorldServer.func_147438_o(j, k, l)); + this.sendTileToAllPlayersWatchingChunk(PlayerManager.this.theWorldServer.getTileEntity(j, k, l)); } diff --git a/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch b/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch index 3f75dcebe4..e91ca19108 100644 --- a/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch +++ b/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch @@ -10,7 +10,7 @@ import net.minecraft.world.WorldServer; import net.minecraft.world.WorldSettings; import net.minecraft.world.demo.DemoWorldManager; -@@ -375,13 +377,23 @@ +@@ -377,13 +379,23 @@ // JAVADOC METHOD $$ func_72368_a public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int par2, boolean par3) { @@ -36,15 +36,15 @@ par1EntityPlayerMP.dimension = par2; Object object; -@@ -397,6 +409,7 @@ - EntityPlayerMP entityplayermp1 = new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension), par1EntityPlayerMP.func_146103_bH(), (ItemInWorldManager)object); +@@ -399,6 +411,7 @@ + EntityPlayerMP entityplayermp1 = new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension), par1EntityPlayerMP.getGameProfile(), (ItemInWorldManager)object); entityplayermp1.playerNetServerHandler = par1EntityPlayerMP.playerNetServerHandler; entityplayermp1.clonePlayer(par1EntityPlayerMP, par3); + entityplayermp1.dimension = par2; - entityplayermp1.func_145769_d(par1EntityPlayerMP.func_145782_y()); + entityplayermp1.setEntityId(par1EntityPlayerMP.getEntityId()); WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension); this.func_72381_a(entityplayermp1, par1EntityPlayerMP, worldserver); -@@ -441,6 +454,11 @@ +@@ -443,6 +456,11 @@ public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2) { @@ -56,16 +56,16 @@ int j = par1EntityPlayerMP.dimension; WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension); par1EntityPlayerMP.dimension = par2; -@@ -448,7 +466,7 @@ - par1EntityPlayerMP.playerNetServerHandler.func_147359_a(new S07PacketRespawn(par1EntityPlayerMP.dimension, par1EntityPlayerMP.worldObj.difficultySetting, par1EntityPlayerMP.worldObj.getWorldInfo().getTerrainType(), par1EntityPlayerMP.theItemInWorldManager.getGameType())); +@@ -450,7 +468,7 @@ + par1EntityPlayerMP.playerNetServerHandler.sendPacket(new S07PacketRespawn(par1EntityPlayerMP.dimension, par1EntityPlayerMP.worldObj.difficultySetting, par1EntityPlayerMP.worldObj.getWorldInfo().getTerrainType(), par1EntityPlayerMP.theItemInWorldManager.getGameType())); worldserver.removePlayerEntityDangerously(par1EntityPlayerMP); par1EntityPlayerMP.isDead = false; - this.transferEntityToWorld(par1EntityPlayerMP, j, worldserver, worldserver1); + this.transferEntityToWorld(par1EntityPlayerMP, j, worldserver, worldserver1, teleporter); this.func_72375_a(par1EntityPlayerMP, worldserver); - par1EntityPlayerMP.playerNetServerHandler.func_147364_a(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch); + par1EntityPlayerMP.playerNetServerHandler.setPlayerLocation(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch); par1EntityPlayerMP.theItemInWorldManager.setWorld(worldserver1); -@@ -467,15 +485,23 @@ +@@ -469,15 +487,23 @@ // JAVADOC METHOD $$ func_82448_a public void transferEntityToWorld(Entity par1Entity, int par2, WorldServer par3WorldServer, WorldServer par4WorldServer) { @@ -92,7 +92,7 @@ if (par1Entity.dimension == -1) { d0 /= d2; -@@ -498,7 +524,8 @@ +@@ -500,7 +526,8 @@ par3WorldServer.updateEntityWithOptionalForce(par1Entity, false); } } @@ -102,7 +102,7 @@ { ChunkCoordinates chunkcoordinates; -@@ -533,7 +560,7 @@ +@@ -535,7 +562,7 @@ if (par1Entity.isEntityAlive()) { par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch); diff --git a/patches/minecraft/net/minecraft/stats/StatList.java.patch b/patches/minecraft/net/minecraft/stats/StatList.java.patch index f4576b668f..fa7f4a762f 100644 --- a/patches/minecraft/net/minecraft/stats/StatList.java.patch +++ b/patches/minecraft/net/minecraft/stats/StatList.java.patch @@ -4,26 +4,26 @@ if (item != null) { -- int i = Item.func_150891_b(item); -+ int i = Item.func_150891_b(item); //TODO: Hook FML's stat change event and re-assign these +- int i = Item.getIdFromItem(item); ++ int i = Item.getIdFromItem(item); //TODO: Hook FML's stat change event and re-assign these objectCraftStats[i] = (new StatCrafting("stat.craftItem." + i, new ChatComponentTranslation("stat.craftItem", new Object[] {(new ItemStack(item)).func_151000_E()}), item)).registerStat(); } } @@ -136,7 +136,7 @@ - if (Item.func_150898_a(block) != null) + if (Item.getItemFromBlock(block) != null) { -- int i = Block.func_149682_b(block); -+ int i = Block.func_149682_b(block); //TODO: Hook FML's stat change event and re-assign these +- int i = Block.getIdFromBlock(block); ++ int i = Block.getIdFromBlock(block); //TODO: Hook FML's stat change event and re-assign these - if (block.func_149652_G()) + if (block.getEnableStats()) { @@ -159,7 +159,7 @@ if (item != null) { -- int i = Item.func_150891_b(item); -+ int i = Item.func_150891_b(item); //TODO: Hook FML's stat change event and re-assign these +- int i = Item.getIdFromItem(item); ++ int i = Item.getIdFromItem(item); //TODO: Hook FML's stat change event and re-assign these objectUseStats[i] = (new StatCrafting("stat.useItem." + i, new ChatComponentTranslation("stat.useItem", new Object[] {(new ItemStack(item)).func_151000_E()}), item)).registerStat(); if (!(item instanceof ItemBlock)) @@ -31,8 +31,8 @@ if (item != null) { -- int i = Item.func_150891_b(item); -+ int i = Item.func_150891_b(item); //TODO: Hook FML's stat change event and re-assign these +- int i = Item.getIdFromItem(item); ++ int i = Item.getIdFromItem(item); //TODO: Hook FML's stat change event and re-assign these if (item.isDamageable()) { diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch index 4dfbf265e6..736205acf7 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch @@ -11,9 +11,9 @@ import net.minecraft.world.World; import org.apache.logging.log4j.Level; -@@ -279,4 +282,93 @@ - func_145826_a(TileEntityComparator.class, "Comparator"); - func_145826_a(TileEntityFlowerPot.class, "FlowerPot"); +@@ -296,4 +299,93 @@ + addMapping(TileEntityComparator.class, "Comparator"); + addMapping(TileEntityFlowerPot.class, "FlowerPot"); } + + // -- BEGIN FORGE PATCHES -- @@ -76,7 +76,7 @@ + public static final AxisAlignedBB INFINITE_EXTENT_AABB = AxisAlignedBB.getBoundingBox(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY); + /** + * Return an {@link AxisAlignedBB} that controls the visible scope of a {@link TileEntitySpecialRenderer} associated with this {@link TileEntity} -+ * Defaults to the collision bounding box {@link Block#func_149668_a(World, int, int, int)} associated with the block ++ * Defaults to the collision bounding box {@link Block#getCollisionBoundingBoxFromPool(World, int, int, int)} associated with the block + * at this location. + * + * @return an appropriately size {@link AxisAlignedBB} for the {@link TileEntity} @@ -85,18 +85,18 @@ + public AxisAlignedBB getRenderBoundingBox() + { + AxisAlignedBB bb = INFINITE_EXTENT_AABB; -+ Block type = func_145838_q(); ++ Block type = getBlockType(); + if (type == Blocks.enchanting_table) + { -+ bb = AxisAlignedBB.getAABBPool().getAABB(field_145851_c, field_145848_d, field_145849_e, field_145851_c + 1, field_145848_d + 1, field_145849_e + 1); ++ bb = AxisAlignedBB.getAABBPool().getAABB(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1); + } + else if (type == Blocks.chest || type == Blocks.trapped_chest) + { -+ bb = AxisAlignedBB.getAABBPool().getAABB(field_145851_c - 1, field_145848_d, field_145849_e - 1, field_145851_c + 2, field_145848_d + 2, field_145849_e + 2); ++ bb = AxisAlignedBB.getAABBPool().getAABB(xCoord - 1, yCoord, zCoord - 1, xCoord + 2, yCoord + 2, zCoord + 2); + } + else if (type != null && type != Blocks.beacon) + { -+ AxisAlignedBB cbb = type.func_149668_a(field_145850_b, field_145851_c, field_145848_d, field_145849_e); ++ AxisAlignedBB cbb = type.getCollisionBoundingBoxFromPool(worldObj, xCoord, yCoord, zCoord); + if (cbb != null) + { + bb = cbb; diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch index 72f29d0d0b..5e27aeba72 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityBeacon.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBeacon.java -@@ -110,7 +110,7 @@ +@@ -115,7 +115,7 @@ { - Block block = this.field_145850_b.func_147439_a(l, k, i1); + Block block = this.worldObj.getBlock(l, k, i1); - if (block != Blocks.emerald_block && block != Blocks.gold_block && block != Blocks.diamond_block && block != Blocks.iron_block) -+ if (!block.isBeaconBase(this.field_145850_b, l, k, i1, field_145851_c, field_145848_d, field_145849_e)) ++ if (!block.isBeaconBase(this.worldObj, l, k, i1, xCoord, yCoord, zCoord)) { flag = false; break; diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch index 94d56a7365..d33517b0ef 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch @@ -9,50 +9,50 @@ public class TileEntityBrewingStand extends TileEntity implements ISidedInventory { -@@ -105,7 +107,7 @@ +@@ -109,7 +111,7 @@ for (int i = 0; i < 3; ++i) { -- if (this.field_145945_j[i] != null && this.field_145945_j[i].getItem() == Items.potionitem) -+ if (this.field_145945_j[i] != null && this.field_145945_j[i].getItem() instanceof ItemPotion) +- if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() == Items.potionitem) ++ if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() instanceof ItemPotion) { - int j = this.field_145945_j[i].getItemDamage(); + int j = this.brewingItemStacks[i].getItemDamage(); int k = this.func_145936_c(j, itemstack); -@@ -144,7 +146,7 @@ +@@ -148,7 +150,7 @@ for (int i = 0; i < 3; ++i) { -- if (this.field_145945_j[i] != null && this.field_145945_j[i].getItem() == Items.potionitem) -+ if (this.field_145945_j[i] != null && this.field_145945_j[i].getItem() instanceof ItemPotion) +- if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() == Items.potionitem) ++ if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() instanceof ItemPotion) { - int j = this.field_145945_j[i].getItemDamage(); + int j = this.brewingItemStacks[i].getItemDamage(); int k = this.func_145936_c(j, itemstack); -@@ -165,9 +167,9 @@ +@@ -169,9 +171,9 @@ } } - if (itemstack.getItem().hasContainerItem()) + if (itemstack.getItem().hasContainerItem(itemstack)) { -- this.field_145945_j[3] = new ItemStack(itemstack.getItem().getContainerItem()); -+ this.field_145945_j[3] = itemstack.getItem().getContainerItem(itemstack); +- this.brewingItemStacks[3] = new ItemStack(itemstack.getItem().getContainerItem()); ++ this.brewingItemStacks[3] = itemstack.getItem().getContainerItem(itemstack); } else { -@@ -178,6 +180,7 @@ - this.field_145945_j[3] = null; +@@ -182,6 +184,7 @@ + this.brewingItemStacks[3] = null; } } -+ MinecraftForge.EVENT_BUS.post(new PotionBrewedEvent(field_145945_j)); ++ MinecraftForge.EVENT_BUS.post(new PotionBrewedEvent(brewingItemStacks)); } } -@@ -300,7 +303,7 @@ +@@ -304,7 +307,7 @@ // JAVADOC METHOD $$ func_94041_b public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { -- return par1 == 3 ? par2ItemStack.getItem().func_150892_m(par2ItemStack) : par2ItemStack.getItem() == Items.potionitem || par2ItemStack.getItem() == Items.glass_bottle; -+ return par1 == 3 ? par2ItemStack.getItem().func_150892_m(par2ItemStack) : par2ItemStack.getItem() instanceof ItemPotion || par2ItemStack.getItem() == Items.glass_bottle; +- return par1 == 3 ? par2ItemStack.getItem().isPotionIngredient(par2ItemStack) : par2ItemStack.getItem() == Items.potionitem || par2ItemStack.getItem() == Items.glass_bottle; ++ return par1 == 3 ? par2ItemStack.getItem().isPotionIngredient(par2ItemStack) : par2ItemStack.getItem() instanceof ItemPotion || par2ItemStack.getItem() == Items.glass_bottle; } @SideOnly(Side.CLIENT) diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch index 718d4eb0c4..bc5011a13e 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch @@ -1,34 +1,34 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityFurnace.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityFurnace.java -@@ -223,8 +223,7 @@ +@@ -232,8 +232,7 @@ - if (this.field_145957_n[1].stackSize == 0) + if (this.furnaceItemStacks[1].stackSize == 0) { -- Item item = this.field_145957_n[1].getItem().getContainerItem(); -- this.field_145957_n[1] = item != null ? new ItemStack(item) : null; -+ this.field_145957_n[1] = field_145957_n[1].getItem().getContainerItem(field_145957_n[1]); +- Item item = this.furnaceItemStacks[1].getItem().getContainerItem(); +- this.furnaceItemStacks[1] = item != null ? new ItemStack(item) : null; ++ this.furnaceItemStacks[1] = furnaceItemStacks[1].getItem().getContainerItem(furnaceItemStacks[1]); } } } -@@ -268,7 +267,11 @@ +@@ -278,7 +277,11 @@ else { - ItemStack itemstack = FurnaceRecipes.smelting().func_151395_a(this.field_145957_n[0]); -- return itemstack == null ? false : (this.field_145957_n[2] == null ? true : (!this.field_145957_n[2].isItemEqual(itemstack) ? false : (this.field_145957_n[2].stackSize < this.getInventoryStackLimit() && this.field_145957_n[2].stackSize < this.field_145957_n[2].getMaxStackSize() ? true : this.field_145957_n[2].stackSize < itemstack.getMaxStackSize()))); + ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]); +- return itemstack == null ? false : (this.furnaceItemStacks[2] == null ? true : (!this.furnaceItemStacks[2].isItemEqual(itemstack) ? false : (this.furnaceItemStacks[2].stackSize < this.getInventoryStackLimit() && this.furnaceItemStacks[2].stackSize < this.furnaceItemStacks[2].getMaxStackSize() ? true : this.furnaceItemStacks[2].stackSize < itemstack.getMaxStackSize()))); + if (itemstack == null) return false; -+ if (this.field_145957_n[2] == null) return true; -+ if (!this.field_145957_n[2].isItemEqual(itemstack)) return false; -+ int result = field_145957_n[2].stackSize + itemstack.stackSize; -+ return result <= getInventoryStackLimit() && result <= this.field_145957_n[2].getMaxStackSize(); //Forge BugFix: Make it respect stack sizes properly. ++ if (this.furnaceItemStacks[2] == null) return true; ++ if (!this.furnaceItemStacks[2].isItemEqual(itemstack)) return false; ++ int result = furnaceItemStacks[2].stackSize + itemstack.stackSize; ++ return result <= getInventoryStackLimit() && result <= this.furnaceItemStacks[2].getMaxStackSize(); //Forge BugFix: Make it respect stack sizes properly. } } -@@ -284,7 +287,7 @@ +@@ -295,7 +298,7 @@ } - else if (this.field_145957_n[2].getItem() == itemstack.getItem()) + else if (this.furnaceItemStacks[2].getItem() == itemstack.getItem()) { -- ++this.field_145957_n[2].stackSize; -+ this.field_145957_n[2].stackSize += itemstack.stackSize; // Forge BugFix: Results may have multiple items +- ++this.furnaceItemStacks[2].stackSize; ++ this.furnaceItemStacks[2].stackSize += itemstack.stackSize; // Forge BugFix: Results may have multiple items } - --this.field_145957_n[0].stackSize; + --this.furnaceItemStacks[0].stackSize; diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch index 82bc5b6c88..bed820709b 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityHopper.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityHopper.java -@@ -402,17 +402,30 @@ +@@ -404,17 +404,30 @@ if (itemstack1 == null) { diff --git a/patches/minecraft/net/minecraft/util/Session.java.patch b/patches/minecraft/net/minecraft/util/Session.java.patch index 68f2a1d4da..5cca61d864 100644 --- a/patches/minecraft/net/minecraft/util/Session.java.patch +++ b/patches/minecraft/net/minecraft/util/Session.java.patch @@ -18,5 +18,5 @@ + + } this.username = p_i45006_1_; - this.field_148257_b = p_i45006_2_; - this.field_148258_c = p_i45006_3_; + this.playerID = p_i45006_2_; + this.token = p_i45006_3_; diff --git a/patches/minecraft/net/minecraft/world/ChunkCache.java.patch b/patches/minecraft/net/minecraft/world/ChunkCache.java.patch index 91d3028998..a9b34b15ba 100644 --- a/patches/minecraft/net/minecraft/world/ChunkCache.java.patch +++ b/patches/minecraft/net/minecraft/world/ChunkCache.java.patch @@ -26,21 +26,21 @@ return this.chunkArray[l][i1].getBlockMetadata(par1 & 15, par2, par3 & 15); } } -@@ -145,10 +150,9 @@ - return this.worldObj.getWorldVec3Pool(); +@@ -146,10 +151,9 @@ } + // JAVADOC METHOD $$ func_147437_c - @SideOnly(Side.CLIENT) - public boolean func_147437_c(int p_147437_1_, int p_147437_2_, int p_147437_3_) + public boolean isAirBlock(int p_147437_1_, int p_147437_2_, int p_147437_3_) { -- return this.func_147439_a(p_147437_1_, p_147437_2_, p_147437_3_).func_149688_o() == Material.field_151579_a; -+ return this.func_147439_a(p_147437_1_, p_147437_2_, p_147437_3_).isAir(this, p_147437_1_, p_147437_2_, p_147437_3_); +- return this.getBlock(p_147437_1_, p_147437_2_, p_147437_3_).getMaterial() == Material.air; ++ return this.getBlock(p_147437_1_, p_147437_2_, p_147437_3_).isAir(this, p_147437_1_, p_147437_2_, p_147437_3_); } // JAVADOC METHOD $$ func_72810_a -@@ -258,4 +262,15 @@ +@@ -259,4 +263,15 @@ { - return this.func_147439_a(par1, par2, par3).func_149748_c(this, par1, par2, par3, par4); + return this.getBlock(par1, par2, par3).isProvidingStrongPower(this, par1, par2, par3, par4); } + + @Override @@ -51,6 +51,6 @@ + return _default; + } + -+ return func_147439_a(x, y, z).isSideSolid(this, x, y, z, side); ++ return getBlock(x, y, z).isSideSolid(this, x, y, z, side); + } } diff --git a/patches/minecraft/net/minecraft/world/Explosion.java.patch b/patches/minecraft/net/minecraft/world/Explosion.java.patch index 6f0dab8179..ac497ce46e 100644 --- a/patches/minecraft/net/minecraft/world/Explosion.java.patch +++ b/patches/minecraft/net/minecraft/world/Explosion.java.patch @@ -2,19 +2,19 @@ +++ ../src-work/minecraft/net/minecraft/world/Explosion.java @@ -90,7 +90,7 @@ - if (block.func_149688_o() != Material.field_151579_a) + if (block.getMaterial() != Material.air) { -- float f3 = this.exploder != null ? this.exploder.func_145772_a(this, this.worldObj, j1, k1, l1, block) : block.func_149638_a(this.exploder); +- float f3 = this.exploder != null ? this.exploder.func_145772_a(this, this.worldObj, j1, k1, l1, block) : block.getExplosionResistance(this.exploder); + float f3 = this.exploder != null ? this.exploder.func_145772_a(this, this.worldObj, j1, k1, l1, block) : block.getExplosionResistance(this.exploder, worldObj, j1, k1, l1, explosionX, explosionY, explosionZ); f1 -= (f3 + 0.3F) * f2; } @@ -216,8 +216,7 @@ - block.func_149690_a(this.worldObj, i, j, k, this.worldObj.getBlockMetadata(i, j, k), 1.0F / this.explosionSize, 0); + block.dropBlockAsItemWithChance(this.worldObj, i, j, k, this.worldObj.getBlockMetadata(i, j, k), 1.0F / this.explosionSize, 0); } -- this.worldObj.func_147465_d(i, j, k, Blocks.air, 0, 3); -- block.func_149723_a(this.worldObj, i, j, k, this); +- this.worldObj.setBlock(i, j, k, Blocks.air, 0, 3); +- block.onBlockDestroyedByExplosion(this.worldObj, i, j, k, this); + block.onBlockExploded(this.worldObj, i, j, k, this); } } diff --git a/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch b/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch index 31a82fd090..6171ab2a14 100644 --- a/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch +++ b/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch @@ -8,15 +8,15 @@ public interface IBlockAccess { -@@ -20,7 +21,6 @@ - // JAVADOC METHOD $$ func_72805_g +@@ -21,7 +22,6 @@ int getBlockMetadata(int var1, int var2, int var3); + // JAVADOC METHOD $$ func_147437_c - @SideOnly(Side.CLIENT) - boolean func_147437_c(int var1, int var2, int var3); + boolean isAirBlock(int var1, int var2, int var3); // JAVADOC METHOD $$ func_72807_a -@@ -40,4 +40,16 @@ +@@ -41,4 +41,16 @@ // JAVADOC METHOD $$ func_72879_k int isBlockProvidingPowerTo(int var1, int var2, int var3, int var4); diff --git a/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch b/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch index e051643bb0..11beb03dfa 100644 --- a/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch +++ b/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch @@ -58,10 +58,10 @@ @@ -210,7 +222,8 @@ else { - Block block = par1World.func_147439_a(par2, par3 - 1, par4); -- return block != Blocks.bedrock && !par1World.func_147439_a(par2, par3, par4).func_149721_r() && !par1World.func_147439_a(par2, par3, par4).func_149688_o().isLiquid() && !par1World.func_147439_a(par2, par3 + 1, par4).func_149721_r(); + Block block = par1World.getBlock(par2, par3 - 1, par4); +- return block != Blocks.bedrock && !par1World.getBlock(par2, par3, par4).isNormalCube() && !par1World.getBlock(par2, par3, par4).getMaterial().isLiquid() && !par1World.getBlock(par2, par3 + 1, par4).isNormalCube(); + boolean spawnBlock = block.canCreatureSpawn(par0EnumCreatureType, par1World, par2, par3, par4); -+ return spawnBlock && block != Blocks.bedrock && !par1World.func_147439_a(par2, par3, par4).func_149721_r() && !par1World.func_147439_a(par2, par3, par4).func_149688_o().isLiquid() && !par1World.func_147439_a(par2, par3 + 1, par4).func_149721_r(); ++ return spawnBlock && block != Blocks.bedrock && !par1World.getBlock(par2, par3, par4).isNormalCube() && !par1World.getBlock(par2, par3, par4).getMaterial().isLiquid() && !par1World.getBlock(par2, par3 + 1, par4).isNormalCube(); } } diff --git a/patches/minecraft/net/minecraft/world/World.java.patch b/patches/minecraft/net/minecraft/world/World.java.patch index 3bf4dcebe1..1800275ff0 100644 --- a/patches/minecraft/net/minecraft/world/World.java.patch +++ b/patches/minecraft/net/minecraft/world/World.java.patch @@ -36,7 +36,7 @@ // JAVADOC FIELD $$ field_72999_e public boolean scheduledUpdatesAreImmediate; // JAVADOC FIELD $$ field_72996_f -@@ -120,6 +147,11 @@ +@@ -121,6 +148,11 @@ // JAVADOC METHOD $$ func_72807_a public BiomeGenBase getBiomeGenForCoords(final int par1, final int par2) { @@ -48,7 +48,7 @@ if (this.blockExists(par1, 0, par2)) { Chunk chunk = this.getChunkFromBlockCoords(par1, par2); -@@ -166,7 +198,13 @@ +@@ -167,7 +199,13 @@ this.theProfiler = p_i45368_5_; this.worldInfo = new WorldInfo(p_i45368_4_, p_i45368_2_); this.provider = p_i45368_3_; @@ -63,7 +63,7 @@ VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages"); if (villagecollection == null) -@@ -180,7 +218,10 @@ +@@ -181,7 +219,10 @@ this.villageCollectionObj.func_82566_a(this); } @@ -75,7 +75,7 @@ this.chunkProvider = this.createChunkProvider(); this.calculateInitialSkylight(); this.calculateInitialWeather(); -@@ -195,7 +236,7 @@ +@@ -196,7 +237,7 @@ this.lightUpdateBlockList = new int[32768]; this.saveHandler = p_i45369_1_; this.theProfiler = p_i45369_5_; @@ -84,7 +84,7 @@ this.worldInfo = p_i45369_1_.loadWorldInfo(); if (p_i45369_4_ != null) -@@ -223,6 +264,15 @@ +@@ -224,6 +265,15 @@ this.provider.registerWorld(this); this.chunkProvider = this.createChunkProvider(); @@ -100,7 +100,7 @@ if (!this.worldInfo.isInitialized()) { try -@@ -248,12 +298,12 @@ +@@ -249,12 +299,12 @@ this.worldInfo.setServerInitialized(true); } @@ -115,7 +115,7 @@ } else { -@@ -265,6 +315,20 @@ +@@ -266,6 +316,20 @@ this.calculateInitialWeather(); } @@ -136,17 +136,17 @@ // JAVADOC METHOD $$ func_72970_h protected abstract IChunkProvider createChunkProvider(); -@@ -320,7 +384,8 @@ - - public boolean func_147437_c(int p_147437_1_, int p_147437_2_, int p_147437_3_) +@@ -322,7 +386,8 @@ + // JAVADOC METHOD $$ func_147437_c + public boolean isAirBlock(int p_147437_1_, int p_147437_2_, int p_147437_3_) { -- return this.func_147439_a(p_147437_1_, p_147437_2_, p_147437_3_).func_149688_o() == Material.field_151579_a; -+ Block block = this.func_147439_a(p_147437_1_, p_147437_2_, p_147437_3_); +- return this.getBlock(p_147437_1_, p_147437_2_, p_147437_3_).getMaterial() == Material.air; ++ Block block = this.getBlock(p_147437_1_, p_147437_2_, p_147437_3_); + return block.isAir(this, p_147437_1_, p_147437_2_, p_147437_3_); } // JAVADOC METHOD $$ func_72899_e -@@ -973,7 +1038,7 @@ +@@ -981,7 +1046,7 @@ // JAVADOC METHOD $$ func_72935_r public boolean isDaytime() { @@ -155,7 +155,7 @@ } // JAVADOC METHOD $$ func_72933_a -@@ -1207,6 +1272,12 @@ +@@ -1215,6 +1280,12 @@ // JAVADOC METHOD $$ func_72956_a public void playSoundAtEntity(Entity par1Entity, String par2Str, float par3, float par4) { @@ -168,7 +168,7 @@ for (int i = 0; i < this.worldAccesses.size(); ++i) { ((IWorldAccess)this.worldAccesses.get(i)).playSound(par2Str, par1Entity.posX, par1Entity.posY - (double)par1Entity.yOffset, par1Entity.posZ, par3, par4); -@@ -1216,6 +1287,12 @@ +@@ -1224,6 +1295,12 @@ // JAVADOC METHOD $$ func_85173_a public void playSoundToNearExcept(EntityPlayer par1EntityPlayer, String par2Str, float par3, float par4) { @@ -181,7 +181,7 @@ for (int i = 0; i < this.worldAccesses.size(); ++i) { ((IWorldAccess)this.worldAccesses.get(i)).playSoundToNearExcept(par1EntityPlayer, par2Str, par1EntityPlayer.posX, par1EntityPlayer.posY - (double)par1EntityPlayer.yOffset, par1EntityPlayer.posZ, par3, par4); -@@ -1283,6 +1360,7 @@ +@@ -1291,6 +1368,7 @@ this.playerEntities.add(entityplayer); this.updateAllPlayersSleepingFlag(); } @@ -189,7 +189,7 @@ this.getChunkFromChunkCoords(i, j).addEntity(par1Entity); this.loadedEntityList.add(par1Entity); -@@ -1479,7 +1557,6 @@ +@@ -1487,7 +1565,6 @@ } // JAVADOC METHOD $$ func_72848_b @@ -197,7 +197,7 @@ public void removeWorldAccess(IWorldAccess par1IWorldAccess) { this.worldAccesses.remove(par1IWorldAccess); -@@ -1512,6 +1589,12 @@ +@@ -1520,6 +1597,12 @@ @SideOnly(Side.CLIENT) public Vec3 getSkyColor(Entity par1Entity, float par2) { @@ -210,18 +210,18 @@ float f1 = this.getCelestialAngle(par2); float f2 = MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; -@@ -1528,9 +1611,7 @@ +@@ -1536,9 +1619,7 @@ int i = MathHelper.floor_double(par1Entity.posX); int j = MathHelper.floor_double(par1Entity.posY); int k = MathHelper.floor_double(par1Entity.posZ); - BiomeGenBase biomegenbase = this.getBiomeGenForCoords(i, k); -- float f3 = biomegenbase.func_150564_a(i, j, k); +- float f3 = biomegenbase.getFloatTemperature(i, j, k); - int l = biomegenbase.getSkyColorByTemp(f3); + int l = ForgeHooksClient.getSkyBlendColour(this, i, j, k); float f4 = (float)(l >> 16 & 255) / 255.0F; float f5 = (float)(l >> 8 & 255) / 255.0F; float f6 = (float)(l & 255) / 255.0F; -@@ -1607,6 +1688,12 @@ +@@ -1615,6 +1696,12 @@ @SideOnly(Side.CLIENT) public Vec3 getCloudColour(float par1) { @@ -234,7 +234,7 @@ float f1 = this.getCelestialAngle(par1); float f2 = MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; -@@ -1671,6 +1758,8 @@ +@@ -1679,6 +1766,8 @@ public int getTopSolidOrLiquidBlock(int par1, int par2) { Chunk chunk = this.getChunkFromBlockCoords(par1, par2); @@ -243,16 +243,16 @@ int k = chunk.getTopFilledSegment() + 15; par1 &= 15; -@@ -1678,7 +1767,7 @@ +@@ -1686,7 +1775,7 @@ { - Block block = chunk.func_150810_a(par1, k, par2); + Block block = chunk.getBlock(par1, k, par2); -- if (block.func_149688_o().blocksMovement() && block.func_149688_o() != Material.field_151584_j) -+ if (block.func_149688_o().blocksMovement() && block.func_149688_o() != Material.field_151584_j && !block.isFoliage(this, x, k, z)) +- if (block.getMaterial().blocksMovement() && block.getMaterial() != Material.leaves) ++ if (block.getMaterial().blocksMovement() && block.getMaterial() != Material.leaves && !block.isFoliage(this, x, k, z)) { return k + 1; } -@@ -1691,6 +1780,12 @@ +@@ -1699,6 +1788,12 @@ @SideOnly(Side.CLIENT) public float getStarBrightness(float par1) { @@ -265,7 +265,7 @@ float f1 = this.getCelestialAngle(par1); float f2 = 1.0F - (MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.25F); -@@ -1746,7 +1841,15 @@ +@@ -1755,7 +1850,15 @@ entity.addEntityCrashInfo(crashreportcategory); } @@ -282,7 +282,7 @@ } if (entity.isDead) -@@ -1808,7 +1911,16 @@ +@@ -1817,7 +1920,16 @@ crashreport = CrashReport.makeCrashReport(throwable1, "Ticking entity"); crashreportcategory = crashreport.makeCategory("Entity being ticked"); entity.addEntityCrashInfo(crashreportcategory); @@ -300,7 +300,7 @@ } } -@@ -1851,7 +1963,16 @@ +@@ -1860,7 +1972,16 @@ crashreport = CrashReport.makeCrashReport(throwable, "Ticking block entity"); crashreportcategory = crashreport.makeCategory("Block entity being ticked"); tileentity.func_145828_a(crashreportcategory); @@ -308,8 +308,8 @@ + if (ForgeModContainer.removeErroringTileEntities) + { + FMLLog.severe(crashreport.getCompleteReport()); -+ tileentity.func_145843_s(); -+ func_147468_f(tileentity.field_145851_c, tileentity.field_145848_d, tileentity.field_145849_e); ++ tileentity.invalidate(); ++ setBlockToAir(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord); + } + else + { @@ -318,16 +318,16 @@ } } -@@ -1865,7 +1986,7 @@ +@@ -1874,7 +1995,7 @@ if (chunk != null) { -- chunk.func_150805_f(tileentity.field_145851_c & 15, tileentity.field_145848_d, tileentity.field_145849_e & 15); -+ chunk.removeInvalidTileEntity(tileentity.field_145851_c & 15, tileentity.field_145848_d, tileentity.field_145849_e & 15); +- chunk.removeTileEntity(tileentity.xCoord & 15, tileentity.yCoord, tileentity.zCoord & 15); ++ chunk.removeInvalidTileEntity(tileentity.xCoord & 15, tileentity.yCoord, tileentity.zCoord & 15); } } } -@@ -1873,6 +1994,10 @@ +@@ -1882,6 +2003,10 @@ if (!this.field_147483_b.isEmpty()) { @@ -335,51 +335,51 @@ + { + ((TileEntity)tile).onChunkUnload(); + } - this.field_147482_g.removeAll(this.field_147483_b); + this.loadedTileEntityList.removeAll(this.field_147483_b); this.field_147483_b.clear(); } -@@ -1893,18 +2018,18 @@ +@@ -1902,18 +2027,18 @@ { - this.field_147482_g.add(tileentity1); + this.loadedTileEntityList.add(tileentity1); } - + } + else + { - if (this.chunkExists(tileentity1.field_145851_c >> 4, tileentity1.field_145849_e >> 4)) + if (this.chunkExists(tileentity1.xCoord >> 4, tileentity1.zCoord >> 4)) { - Chunk chunk1 = this.getChunkFromChunkCoords(tileentity1.field_145851_c >> 4, tileentity1.field_145849_e >> 4); + Chunk chunk1 = this.getChunkFromChunkCoords(tileentity1.xCoord >> 4, tileentity1.zCoord >> 4); if (chunk1 != null) { -- chunk1.func_150812_a(tileentity1.field_145851_c & 15, tileentity1.field_145848_d, tileentity1.field_145849_e & 15, tileentity1); -+ chunk1.removeInvalidTileEntity(tileentity1.field_145851_c & 15, tileentity1.field_145848_d, tileentity1.field_145849_e & 15); +- chunk1.func_150812_a(tileentity1.xCoord & 15, tileentity1.yCoord, tileentity1.zCoord & 15, tileentity1); ++ chunk1.removeInvalidTileEntity(tileentity1.xCoord & 15, tileentity1.yCoord, tileentity1.zCoord & 15); } } - -- this.func_147471_g(tileentity1.field_145851_c, tileentity1.field_145848_d, tileentity1.field_145849_e); +- this.markBlockForUpdate(tileentity1.xCoord, tileentity1.yCoord, tileentity1.zCoord); } } -@@ -1917,14 +2042,11 @@ +@@ -1926,14 +2051,11 @@ public void func_147448_a(Collection p_147448_1_) { - if (this.field_147481_N) -+ List dest = field_147481_N ? field_147484_a : field_147482_g; ++ List dest = field_147481_N ? addedTileEntityList : loadedTileEntityList; + for(TileEntity entity : (Collection)p_147448_1_) { -- this.field_147484_a.addAll(p_147448_1_); +- this.addedTileEntityList.addAll(p_147448_1_); + if(entity.canUpdate()) dest.add(entity); } - else - { -- this.field_147482_g.addAll(p_147448_1_); +- this.loadedTileEntityList.addAll(p_147448_1_); - } } // JAVADOC METHOD $$ func_72870_g -@@ -1938,10 +2060,19 @@ +@@ -1947,10 +2069,19 @@ { int i = MathHelper.floor_double(par1Entity.posX); int j = MathHelper.floor_double(par1Entity.posZ); @@ -401,7 +401,7 @@ par1Entity.lastTickPosX = par1Entity.posX; par1Entity.lastTickPosY = par1Entity.posY; par1Entity.lastTickPosZ = par1Entity.posZ; -@@ -2163,6 +2294,10 @@ +@@ -2172,6 +2303,10 @@ { return true; } @@ -412,12 +412,12 @@ } } } -@@ -2456,13 +2591,15 @@ +@@ -2465,13 +2600,15 @@ - public void func_147455_a(int p_147455_1_, int p_147455_2_, int p_147455_3_, TileEntity p_147455_4_) + public void setTileEntity(int p_147455_1_, int p_147455_2_, int p_147455_3_, TileEntity p_147455_4_) { -- if (p_147455_4_ != null && !p_147455_4_.func_145837_r()) -+ if (p_147455_4_ == null || p_147455_4_.func_145837_r()) +- if (p_147455_4_ != null && !p_147455_4_.isInvalid()) ++ if (p_147455_4_ == null || p_147455_4_.isInvalid()) { + return; + } @@ -426,16 +426,16 @@ + { if (this.field_147481_N) { -- p_147455_4_.field_145851_c = p_147455_1_; -- p_147455_4_.field_145848_d = p_147455_2_; -- p_147455_4_.field_145849_e = p_147455_3_; - Iterator iterator = this.field_147484_a.iterator(); +- p_147455_4_.xCoord = p_147455_1_; +- p_147455_4_.yCoord = p_147455_2_; +- p_147455_4_.zCoord = p_147455_3_; + Iterator iterator = this.addedTileEntityList.iterator(); while (iterator.hasNext()) -@@ -2481,40 +2618,22 @@ +@@ -2490,40 +2627,22 @@ else { - this.field_147482_g.add(p_147455_4_); + this.loadedTileEntityList.add(p_147455_4_); - Chunk chunk = this.getChunkFromChunkCoords(p_147455_1_ >> 4, p_147455_3_ >> 4); - - if (chunk != null) @@ -450,59 +450,59 @@ + chunk.func_150812_a(p_147455_1_ & 15, p_147455_2_, p_147455_3_ & 15, p_147455_4_); + } + //notify tile changes -+ func_147453_f(p_147455_1_, p_147455_2_, p_147455_3_, func_147439_a(p_147455_1_, p_147455_2_, p_147455_3_)); ++ func_147453_f(p_147455_1_, p_147455_2_, p_147455_3_, getBlock(p_147455_1_, p_147455_2_, p_147455_3_)); } - public void func_147475_p(int p_147475_1_, int p_147475_2_, int p_147475_3_) + public void removeTileEntity(int p_147475_1_, int p_147475_2_, int p_147475_3_) { -- TileEntity tileentity = this.func_147438_o(p_147475_1_, p_147475_2_, p_147475_3_); +- TileEntity tileentity = this.getTileEntity(p_147475_1_, p_147475_2_, p_147475_3_); - - if (tileentity != null && this.field_147481_N) - { -- tileentity.func_145843_s(); -- this.field_147484_a.remove(tileentity); +- tileentity.invalidate(); +- this.addedTileEntityList.remove(tileentity); - } - else - { - if (tileentity != null) - { -- this.field_147484_a.remove(tileentity); -- this.field_147482_g.remove(tileentity); +- this.addedTileEntityList.remove(tileentity); +- this.loadedTileEntityList.remove(tileentity); - } - - Chunk chunk = this.getChunkFromChunkCoords(p_147475_1_ >> 4, p_147475_3_ >> 4); - - if (chunk != null) - { -- chunk.func_150805_f(p_147475_1_ & 15, p_147475_2_, p_147475_3_ & 15); +- chunk.removeTileEntity(p_147475_1_ & 15, p_147475_2_, p_147475_3_ & 15); - } - } + Chunk chunk = getChunkFromChunkCoords(p_147475_1_ >> 4, p_147475_3_ >> 4); -+ if (chunk != null) chunk.func_150805_f(p_147475_1_ & 15, p_147475_2_, p_147475_3_ & 15); -+ func_147453_f(p_147475_1_, p_147475_2_, p_147475_3_, func_147439_a(p_147475_1_, p_147475_2_, p_147475_3_)); ++ if (chunk != null) chunk.removeTileEntity(p_147475_1_ & 15, p_147475_2_, p_147475_3_ & 15); ++ func_147453_f(p_147475_1_, p_147475_2_, p_147475_3_, getBlock(p_147475_1_, p_147475_2_, p_147475_3_)); } public void func_147457_a(TileEntity p_147457_1_) -@@ -2531,8 +2650,7 @@ - public static boolean func_147466_a(IBlockAccess p_147466_0_, int p_147466_1_, int p_147466_2_, int p_147466_3_) +@@ -2541,8 +2660,7 @@ + public static boolean doesBlockHaveSolidTopSurface(IBlockAccess p_147466_0_, int p_147466_1_, int p_147466_2_, int p_147466_3_) { - Block block = p_147466_0_.func_147439_a(p_147466_1_, p_147466_2_, p_147466_3_); + Block block = p_147466_0_.getBlock(p_147466_1_, p_147466_2_, p_147466_3_); - int l = p_147466_0_.getBlockMetadata(p_147466_1_, p_147466_2_, p_147466_3_); -- return block.func_149688_o().isOpaque() && block.func_149686_d() ? true : (block instanceof BlockStairs ? (l & 4) == 4 : (block instanceof BlockSlab ? (l & 8) == 8 : (block instanceof BlockHopper ? true : (block instanceof BlockSnow ? (l & 7) == 7 : false)))); +- return block.getMaterial().isOpaque() && block.renderAsNormalBlock() ? true : (block instanceof BlockStairs ? (l & 4) == 4 : (block instanceof BlockSlab ? (l & 8) == 8 : (block instanceof BlockHopper ? true : (block instanceof BlockSnow ? (l & 7) == 7 : false)))); + return block.isSideSolid(p_147466_0_, p_147466_1_, p_147466_2_, p_147466_3_, ForgeDirection.UP); } - public boolean func_147445_c(int p_147445_1_, int p_147445_2_, int p_147445_3_, boolean p_147445_4_) -@@ -2544,7 +2662,7 @@ + // JAVADOC METHOD $$ func_147445_c +@@ -2555,7 +2673,7 @@ if (chunk != null && !chunk.isEmpty()) { - Block block = this.func_147439_a(p_147445_1_, p_147445_2_, p_147445_3_); -- return block.func_149688_o().isOpaque() && block.func_149686_d(); + Block block = this.getBlock(p_147445_1_, p_147445_2_, p_147445_3_); +- return block.getMaterial().isOpaque() && block.renderAsNormalBlock(); + return block.isNormalCube(this, p_147445_1_, p_147445_2_, p_147445_3_); } else { -@@ -2571,8 +2689,7 @@ +@@ -2582,8 +2700,7 @@ // JAVADOC METHOD $$ func_72891_a public void setAllowedSpawnTypes(boolean par1, boolean par2) { @@ -512,7 +512,7 @@ } // JAVADOC METHOD $$ func_72835_b -@@ -2584,6 +2701,11 @@ +@@ -2595,6 +2712,11 @@ // JAVADOC METHOD $$ func_72947_a private void calculateInitialWeather() { @@ -524,7 +524,7 @@ if (this.worldInfo.isRaining()) { this.rainingStrength = 1.0F; -@@ -2598,6 +2720,11 @@ +@@ -2609,6 +2731,11 @@ // JAVADOC METHOD $$ func_72979_l protected void updateWeather() { @@ -536,7 +536,7 @@ if (!this.provider.hasNoSky) { if (!this.isRemote) -@@ -2682,6 +2809,7 @@ +@@ -2693,6 +2820,7 @@ { this.activeChunkSet.clear(); this.theProfiler.startSection("buildList"); @@ -544,7 +544,7 @@ int i; EntityPlayer entityplayer; int j; -@@ -2776,6 +2904,11 @@ +@@ -2787,6 +2915,11 @@ // JAVADOC METHOD $$ func_72834_c public boolean canBlockFreeze(int par1, int par2, int par3, boolean par4) { @@ -554,9 +554,9 @@ + public boolean canBlockFreezeBody(int par1, int par2, int par3, boolean par4) + { BiomeGenBase biomegenbase = this.getBiomeGenForCoords(par1, par3); - float f = biomegenbase.func_150564_a(par1, par2, par3); + float f = biomegenbase.getFloatTemperature(par1, par2, par3); -@@ -2831,6 +2964,11 @@ +@@ -2842,6 +2975,11 @@ public boolean func_147478_e(int p_147478_1_, int p_147478_2_, int p_147478_3_, boolean p_147478_4_) { @@ -566,33 +566,33 @@ + public boolean canSnowAtBody(int p_147478_1_, int p_147478_2_, int p_147478_3_, boolean p_147478_4_) + { BiomeGenBase biomegenbase = this.getBiomeGenForCoords(p_147478_1_, p_147478_3_); - float f = biomegenbase.func_150564_a(p_147478_1_, p_147478_2_, p_147478_3_); + float f = biomegenbase.getFloatTemperature(p_147478_1_, p_147478_2_, p_147478_3_); -@@ -2880,10 +3018,11 @@ +@@ -2891,10 +3029,11 @@ else { - Block block = this.func_147439_a(par1, par2, par3); -- int l = par4EnumSkyBlock == EnumSkyBlock.Sky ? 0 : block.func_149750_m(); -- int i1 = block.func_149717_k(); + Block block = this.getBlock(par1, par2, par3); +- int l = par4EnumSkyBlock == EnumSkyBlock.Sky ? 0 : block.getLightValue(); +- int i1 = block.getLightOpacity(); + int blockLight = block.getLightValue(this, par1, par2, par3); + int l = par4EnumSkyBlock == EnumSkyBlock.Sky ? 0 : blockLight; + int i1 = block.getLightOpacity(this, par1, par2, par3); -- if (i1 >= 15 && block.func_149750_m() > 0) +- if (i1 >= 15 && block.getLightValue() > 0) + if (i1 >= 15 && blockLight > 0) { i1 = 1; } -@@ -2983,7 +3122,7 @@ +@@ -2994,7 +3133,7 @@ int j4 = i2 + Facing.offsetsXForSide[i4]; int k4 = j2 + Facing.offsetsYForSide[i4]; int l4 = k2 + Facing.offsetsZForSide[i4]; -- int i5 = Math.max(1, this.func_147439_a(j4, k4, l4).func_149717_k()); -+ int i5 = Math.max(1, this.func_147439_a(j4, k4, l4).getLightOpacity(this, j4, k4, l4)); +- int i5 = Math.max(1, this.getBlock(j4, k4, l4).getLightOpacity()); ++ int i5 = Math.max(1, this.getBlock(j4, k4, l4).getLightOpacity(this, j4, k4, l4)); i3 = this.getSavedLightValue(p_147463_1_, j4, k4, l4); if (i3 == l2 - i5 && i1 < this.lightUpdateBlockList.length) -@@ -3083,10 +3222,10 @@ +@@ -3094,10 +3233,10 @@ public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) { ArrayList arraylist = new ArrayList(); @@ -607,7 +607,7 @@ for (int i1 = i; i1 <= j; ++i1) { -@@ -3110,10 +3249,10 @@ +@@ -3121,10 +3260,10 @@ public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) { @@ -622,7 +622,7 @@ ArrayList arraylist = new ArrayList(); for (int i1 = i; i1 <= j; ++i1) -@@ -3194,11 +3333,14 @@ +@@ -3206,11 +3345,14 @@ // JAVADOC METHOD $$ func_72868_a public void addLoadedEntities(List par1List) { @@ -640,26 +640,26 @@ } } -@@ -3212,7 +3354,7 @@ +@@ -3225,7 +3367,7 @@ { - Block block1 = this.func_147439_a(p_147472_2_, p_147472_3_, p_147472_4_); - AxisAlignedBB axisalignedbb = p_147472_5_ ? null : p_147472_1_.func_149668_a(this, p_147472_2_, p_147472_3_, p_147472_4_); -- return axisalignedbb != null && !this.checkNoEntityCollision(axisalignedbb, p_147472_7_) ? false : (block1.func_149688_o() == Material.field_151594_q && p_147472_1_ == Blocks.anvil ? true : block1.func_149688_o().isReplaceable() && p_147472_1_.func_149705_a(this, p_147472_2_, p_147472_3_, p_147472_4_, p_147472_6_, p_147472_8_)); -+ return axisalignedbb != null && !this.checkNoEntityCollision(axisalignedbb, p_147472_7_) ? false : (block1.func_149688_o() == Material.field_151594_q && p_147472_1_ == Blocks.anvil ? true : block1.isReplaceable(this, p_147472_2_, p_147472_3_, p_147472_4_) && p_147472_1_.func_149705_a(this, p_147472_2_, p_147472_3_, p_147472_4_, p_147472_6_, p_147472_8_)); + Block block1 = this.getBlock(p_147472_2_, p_147472_3_, p_147472_4_); + AxisAlignedBB axisalignedbb = p_147472_5_ ? null : p_147472_1_.getCollisionBoundingBoxFromPool(this, p_147472_2_, p_147472_3_, p_147472_4_); +- return axisalignedbb != null && !this.checkNoEntityCollision(axisalignedbb, p_147472_7_) ? false : (block1.getMaterial() == Material.circuits && p_147472_1_ == Blocks.anvil ? true : block1.getMaterial().isReplaceable() && p_147472_1_.canReplace(this, p_147472_2_, p_147472_3_, p_147472_4_, p_147472_6_, p_147472_8_)); ++ return axisalignedbb != null && !this.checkNoEntityCollision(axisalignedbb, p_147472_7_) ? false : (block1.getMaterial() == Material.circuits && p_147472_1_ == Blocks.anvil ? true : block1.isReplaceable(this, p_147472_2_, p_147472_3_, p_147472_4_) && p_147472_1_.canReplace(this, p_147472_2_, p_147472_3_, p_147472_4_, p_147472_6_, p_147472_8_)); } public PathEntity getPathEntityToEntity(Entity par1Entity, Entity par2Entity, float par3, boolean par4, boolean par5, boolean par6, boolean par7) -@@ -3321,7 +3463,8 @@ +@@ -3334,7 +3476,8 @@ // JAVADOC METHOD $$ func_72878_l public int getIndirectPowerLevelTo(int par1, int par2, int par3, int par4) { -- return this.func_147439_a(par1, par2, par3).func_149721_r() ? this.getBlockPowerInput(par1, par2, par3) : this.func_147439_a(par1, par2, par3).func_149709_b(this, par1, par2, par3, par4); -+ Block block = this.func_147439_a(par1, par2, par3); -+ return block.shouldCheckWeakPower(this, par1, par2, par3, par4) ? this.getBlockPowerInput(par1, par2, par3) : block.func_149709_b(this, par1, par2, par3, par4); +- return this.getBlock(par1, par2, par3).isNormalCube() ? this.getBlockPowerInput(par1, par2, par3) : this.getBlock(par1, par2, par3).isProvidingWeakPower(this, par1, par2, par3, par4); ++ Block block = this.getBlock(par1, par2, par3); ++ return block.shouldCheckWeakPower(this, par1, par2, par3, par4) ? this.getBlockPowerInput(par1, par2, par3) : block.isProvidingWeakPower(this, par1, par2, par3, par4); } // JAVADOC METHOD $$ func_72864_z -@@ -3461,7 +3604,7 @@ +@@ -3474,7 +3617,7 @@ // JAVADOC METHOD $$ func_72905_C public long getSeed() { @@ -668,7 +668,7 @@ } public long getTotalWorldTime() -@@ -3471,24 +3614,24 @@ +@@ -3484,24 +3627,24 @@ public long getWorldTime() { @@ -697,7 +697,7 @@ } // JAVADOC METHOD $$ func_72897_h -@@ -3509,13 +3652,21 @@ +@@ -3522,13 +3665,21 @@ if (!this.loadedEntityList.contains(par1Entity)) { @@ -720,7 +720,7 @@ return true; } -@@ -3615,8 +3766,7 @@ +@@ -3631,8 +3782,7 @@ // JAVADOC METHOD $$ func_72958_C public boolean isBlockHighHumidity(int par1, int par2, int par3) { @@ -730,7 +730,7 @@ } // JAVADOC METHOD $$ func_72823_a -@@ -3676,13 +3826,13 @@ +@@ -3692,13 +3842,13 @@ // JAVADOC METHOD $$ func_72800_K public int getHeight() { @@ -746,7 +746,7 @@ } // JAVADOC METHOD $$ func_72843_D -@@ -3709,7 +3859,7 @@ +@@ -3726,7 +3876,7 @@ @SideOnly(Side.CLIENT) public double getHorizon() { @@ -755,7 +755,7 @@ } // JAVADOC METHOD $$ func_72914_a -@@ -3782,25 +3932,24 @@ +@@ -3800,25 +3950,24 @@ public void func_147453_f(int p_147453_1_, int p_147453_2_, int p_147453_3_, Block p_147453_4_) { @@ -764,38 +764,38 @@ { - int i1 = p_147453_1_ + Direction.offsetX[l]; - int j1 = p_147453_3_ + Direction.offsetZ[l]; -- Block block1 = this.func_147439_a(i1, p_147453_2_, j1); +- Block block1 = this.getBlock(i1, p_147453_2_, j1); + int i1 = p_147453_1_ + dir.offsetX; + int y = p_147453_2_ + dir.offsetY; + int j1 = p_147453_3_ + dir.offsetZ; -+ Block block1 = this.func_147439_a(i1, y, j1); ++ Block block1 = this.getBlock(i1, y, j1); - if (Blocks.unpowered_comparator.func_149907_e(block1)) + block1.onNeighborChange(this, i1, y, j1, p_147453_1_, p_147453_2_, p_147453_3_); + if (block1.isNormalCube(this, i1, p_147453_2_, j1)) { -- block1.func_149695_a(this, i1, p_147453_2_, j1, p_147453_4_); +- block1.onNeighborBlockChange(this, i1, p_147453_2_, j1, p_147453_4_); - } -- else if (block1.func_149721_r()) +- else if (block1.isNormalCube()) - { - i1 += Direction.offsetX[l]; - j1 += Direction.offsetZ[l]; -- Block block2 = this.func_147439_a(i1, p_147453_2_, j1); +- Block block2 = this.getBlock(i1, p_147453_2_, j1); + i1 += dir.offsetX; + y += dir.offsetY; + j1 += dir.offsetZ; -+ Block block2 = this.func_147439_a(i1, y, j1); ++ Block block2 = this.getBlock(i1, y, j1); - if (Blocks.unpowered_comparator.func_149907_e(block2)) + if (block2.getWeakChanges(this, i1, y, j1)) { -- block2.func_149695_a(this, i1, p_147453_2_, j1, p_147453_4_); +- block2.onNeighborBlockChange(this, i1, p_147453_2_, j1, p_147453_4_); + block2.onNeighborChange(this, i1, y, j1, p_147453_1_, p_147453_2_, p_147453_3_); } } } -@@ -3841,4 +3990,110 @@ - iworldaccess.func_147584_b(); +@@ -3859,4 +4008,110 @@ + iworldaccess.onStaticEntitiesChanged(); } } + @@ -807,7 +807,7 @@ + */ + public void addTileEntity(TileEntity entity) + { -+ List dest = field_147481_N ? field_147484_a : field_147482_g; ++ List dest = field_147481_N ? addedTileEntityList : loadedTileEntityList; + if(entity.canUpdate()) + { + dest.add(entity); @@ -853,7 +853,7 @@ + { + return _default; + } -+ return func_147439_a(x, y, z).isSideSolid(this, x, y, z, side); ++ return getBlock(x, y, z).isSideSolid(this, x, y, z, side); + } + + /** diff --git a/patches/minecraft/net/minecraft/world/WorldServer.java.patch b/patches/minecraft/net/minecraft/world/WorldServer.java.patch index bf0e61e4b5..2f52a21b06 100644 --- a/patches/minecraft/net/minecraft/world/WorldServer.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldServer.java.patch @@ -129,8 +129,8 @@ { this.updateLCG = this.updateLCG * 3 + 1013904223; i1 = this.updateLCG >> 2; -@@ -401,6 +432,9 @@ - public void func_147454_a(int p_147454_1_, int p_147454_2_, int p_147454_3_, Block p_147454_4_, int p_147454_5_, int p_147454_6_) +@@ -403,6 +434,9 @@ + public void scheduleBlockUpdateWithPriority(int p_147454_1_, int p_147454_2_, int p_147454_3_, Block p_147454_4_, int p_147454_5_, int p_147454_6_) { NextTickListEntry nextticklistentry = new NextTickListEntry(p_147454_1_, p_147454_2_, p_147454_3_, p_147454_4_); + //Keeping here as a note for future when it may be restored. @@ -138,8 +138,8 @@ + //byte b0 = isForced ? 0 : 8; byte b0 = 0; - if (this.scheduledUpdatesAreImmediate && p_147454_4_.func_149688_o() != Material.field_151579_a) -@@ -461,7 +495,7 @@ + if (this.scheduledUpdatesAreImmediate && p_147454_4_.getMaterial() != Material.air) +@@ -463,7 +497,7 @@ // JAVADOC METHOD $$ func_72939_s public void updateEntities() { @@ -148,7 +148,7 @@ { if (this.updateEntityTick++ >= 1200) { -@@ -523,6 +557,9 @@ +@@ -525,6 +559,9 @@ { nextticklistentry = (NextTickListEntry)iterator.next(); iterator.remove(); @@ -158,29 +158,29 @@ byte b0 = 0; if (this.checkChunksExist(nextticklistentry.xCoord - b0, nextticklistentry.yCoord - b0, nextticklistentry.zCoord - b0, nextticklistentry.xCoord + b0, nextticklistentry.yCoord + b0, nextticklistentry.zCoord + b0)) -@@ -647,13 +684,26 @@ +@@ -649,13 +686,26 @@ { ArrayList arraylist = new ArrayList(); -- for (int k1 = 0; k1 < this.field_147482_g.size(); ++k1) +- for (int k1 = 0; k1 < this.loadedTileEntityList.size(); ++k1) + for(int x = (p_147486_1_ >> 4); x <= (p_147486_4_ >> 4); x++) { -- TileEntity tileentity = (TileEntity)this.field_147482_g.get(k1); +- TileEntity tileentity = (TileEntity)this.loadedTileEntityList.get(k1); - -- if (tileentity.field_145851_c >= p_147486_1_ && tileentity.field_145848_d >= p_147486_2_ && tileentity.field_145849_e >= p_147486_3_ && tileentity.field_145851_c < p_147486_4_ && tileentity.field_145848_d < p_147486_5_ && tileentity.field_145849_e < p_147486_6_) +- if (tileentity.xCoord >= p_147486_1_ && tileentity.yCoord >= p_147486_2_ && tileentity.zCoord >= p_147486_3_ && tileentity.xCoord < p_147486_4_ && tileentity.yCoord < p_147486_5_ && tileentity.zCoord < p_147486_6_) + for(int z = (p_147486_3_ >> 4); z <= (p_147486_6_ >> 4); z++) { - arraylist.add(tileentity); + Chunk chunk = getChunkFromChunkCoords(x, z); + if (chunk != null) + { -+ for(Object obj : chunk.field_150816_i.values()) ++ for(Object obj : chunk.chunkTileEntityMap.values()) + { + TileEntity entity = (TileEntity)obj; -+ if (!entity.func_145837_r()) ++ if (!entity.isInvalid()) + { -+ if (entity.field_145851_c >= p_147486_1_ && entity.field_145848_d >= p_147486_2_ && entity.field_145849_e >= p_147486_3_ && -+ entity.field_145851_c <= p_147486_4_ && entity.field_145848_d <= p_147486_5_ && entity.field_145849_e <= p_147486_6_) ++ if (entity.xCoord >= p_147486_1_ && entity.yCoord >= p_147486_2_ && entity.zCoord >= p_147486_3_ && ++ entity.xCoord <= p_147486_4_ && entity.yCoord <= p_147486_5_ && entity.zCoord <= p_147486_6_) + { + arraylist.add(entity); + } @@ -190,7 +190,7 @@ } } -@@ -663,6 +713,11 @@ +@@ -665,6 +715,11 @@ // JAVADOC METHOD $$ func_72962_a public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) { @@ -202,7 +202,7 @@ return !this.mcServer.isBlockProtected(this, par2, par3, par4, par1EntityPlayer); } -@@ -742,7 +797,7 @@ +@@ -744,7 +799,7 @@ // JAVADOC METHOD $$ func_73047_i protected void createBonusChest() { @@ -211,7 +211,7 @@ for (int i = 0; i < 10; ++i) { -@@ -781,6 +836,7 @@ +@@ -783,6 +838,7 @@ } this.chunkProvider.saveChunks(par1, par2IProgressUpdate); @@ -219,7 +219,7 @@ } } -@@ -799,6 +855,7 @@ +@@ -801,6 +857,7 @@ this.checkSessionLock(); this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.mcServer.getConfigurationManager().getHostPlayerData()); this.mapStorage.saveAllData(); @@ -227,7 +227,7 @@ } protected void onEntityAdded(Entity par1Entity) -@@ -1013,6 +1070,11 @@ +@@ -1015,6 +1072,11 @@ } } diff --git a/patches/minecraft/net/minecraft/world/WorldType.java.patch b/patches/minecraft/net/minecraft/world/WorldType.java.patch index 7cea98e9ac..2564713912 100644 --- a/patches/minecraft/net/minecraft/world/WorldType.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldType.java.patch @@ -23,7 +23,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -@@ -45,6 +53,7 @@ +@@ -46,6 +54,7 @@ private WorldType(int par1, String par2Str, int par3) { @@ -31,7 +31,7 @@ this.worldType = par2Str; this.generatorVersion = par3; this.canBeCreated = true; -@@ -199,8 +208,92 @@ +@@ -202,8 +211,92 @@ return this == FLAT ? random.nextInt(4) != 1 : false; } @@ -86,7 +86,7 @@ + { + if (this == FLAT) + { -+ instance.func_147108_a(new GuiCreateFlatWorld(guiCreateWorld, guiCreateWorld.field_146334_a)); ++ instance.displayGuiScreen(new GuiCreateFlatWorld(guiCreateWorld, guiCreateWorld.field_146334_a)); + } + } + diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch index 86a84fabd7..459a599dd7 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch @@ -14,7 +14,7 @@ // JAVADOC FIELD $$ field_76815_a @@ -136,26 +141,30 @@ - protected void func_150513_a(BiomeGenBase p_150513_1_) + protected void genDecorations(BiomeGenBase p_150513_1_) { + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); this.generateOres(); diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch index 1c13b47e14..393acb9089 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch @@ -9,7 +9,7 @@ + public abstract class BiomeGenBase { - private static final Logger field_150586_aC = LogManager.getLogger(); + private static final Logger logger = LogManager.getLogger(); @@ -155,6 +158,10 @@ public BiomeGenBase(int par1) @@ -44,25 +44,25 @@ } // JAVADOC METHOD $$ func_76732_a -@@ -373,7 +382,7 @@ +@@ -375,7 +384,7 @@ { - double d0 = (double)MathHelper.clamp_float(this.func_150564_a(p_150558_1_, p_150558_2_, p_150558_3_), 0.0F, 1.0F); + double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(p_150558_1_, p_150558_2_, p_150558_3_), 0.0F, 1.0F); double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); - return ColorizerGrass.getGrassColor(d0, d1); + return getModdedBiomeGrassColor(ColorizerGrass.getGrassColor(d0, d1)); } - @SideOnly(Side.CLIENT) -@@ -381,7 +390,7 @@ + // JAVADOC METHOD $$ func_150571_c +@@ -384,7 +393,7 @@ { - double d0 = (double)MathHelper.clamp_float(this.func_150564_a(p_150571_1_, p_150571_2_, p_150571_3_), 0.0F, 1.0F); + double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(p_150571_1_, p_150571_2_, p_150571_3_), 0.0F, 1.0F); double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); - return ColorizerFoliage.getFoliageColor(d0, d1); + return getModdedBiomeFoliageColor(ColorizerFoliage.getFoliageColor(d0, d1)); } public boolean func_150559_j() -@@ -529,6 +538,88 @@ +@@ -535,6 +544,88 @@ } } @@ -137,12 +137,12 @@ + String flowername = biome.func_150572_a(rand, x, y, z); + + FlowerEntry flower = (FlowerEntry)WeightedRandom.getRandomItem(rand, flowers); -+ if (flower == null || flower.block == null || !flower.block.func_149718_j(world, x, y, z)) ++ if (flower == null || flower.block == null || !flower.block.canBlockStay(world, x, y, z)) + { + return; + } + -+ world.func_147465_d(x, y, z, flower.block, flower.metadata, 3); ++ world.setBlock(x, y, z, flower.block, flower.metadata, 3); + } + + @@ -150,4 +150,4 @@ + static { - plains.func_150566_k(); + plains.createMutation(); diff --git a/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch b/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch index 1ffc74b1eb..cd742611cc 100644 --- a/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch @@ -11,27 +11,27 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -217,7 +221,7 @@ +@@ -218,7 +222,7 @@ { - Block block = this.func_150810_a(j, l - 1, k); + Block block = this.getBlock(j, l - 1, k); -- if (block.func_149717_k() == 0) +- if (block.getLightOpacity() == 0) + if (func_150808_b(j, l - 1, k) == 0) { --l; continue; -@@ -520,7 +524,9 @@ +@@ -521,7 +525,9 @@ public int func_150808_b(int p_150808_1_, int p_150808_2_, int p_150808_3_) { -- return this.func_150810_a(p_150808_1_, p_150808_2_, p_150808_3_).func_149717_k(); +- return this.getBlock(p_150808_1_, p_150808_2_, p_150808_3_).getLightOpacity(); + int x = (xPosition << 4) + p_150808_1_; + int z = (zPosition << 4) + p_150808_3_; -+ return this.func_150810_a(p_150808_1_, p_150808_2_, p_150808_3_).getLightOpacity(worldObj, x, p_150808_2_, p_150808_3_); ++ return this.getBlock(p_150808_1_, p_150808_2_, p_150808_3_).getLightOpacity(worldObj, x, p_150808_2_, p_150808_3_); } - public Block func_150810_a(final int p_150810_1_, final int p_150810_2_, final int p_150810_3_) -@@ -613,14 +619,19 @@ + // JAVADOC METHOD $$ func_150810_a +@@ -615,14 +621,19 @@ } extendedblockstorage.func_150818_a(p_150807_1_, p_150807_2_ & 15, p_150807_3_, p_150807_4_); @@ -39,21 +39,21 @@ if (!this.worldObj.isRemote) { - block1.func_149749_a(this.worldObj, l1, p_150807_2_, i2, block1, k1); + block1.breakBlock(this.worldObj, l1, p_150807_2_, i2, block1, k1); } - else if (block1 instanceof ITileEntityProvider && block1 != p_150807_4_) + else if (block1.hasTileEntity(k1)) { -- this.worldObj.func_147475_p(l1, p_150807_2_, i2); +- this.worldObj.removeTileEntity(l1, p_150807_2_, i2); + TileEntity te = this.getTileEntityUnsafe(p_150807_1_ & 0x0F, p_150807_2_, p_150807_3_ & 0x0F); + if (te != null && te.shouldRefresh(block1, p_150807_4_, k1, p_150807_5_, worldObj, l1, p_150807_2_, i2)) + { -+ this.worldObj.func_147475_p(l1, p_150807_2_, i2); ++ this.worldObj.removeTileEntity(l1, p_150807_2_, i2); + } } - if (extendedblockstorage.func_150819_a(p_150807_1_, p_150807_2_ & 15, p_150807_3_) != p_150807_4_) -@@ -629,8 +640,6 @@ + if (extendedblockstorage.getBlockByExtId(p_150807_1_, p_150807_2_ & 15, p_150807_3_) != p_150807_4_) +@@ -631,8 +642,6 @@ } else { @@ -62,7 +62,7 @@ if (flag) { this.generateSkylightMap(); -@@ -660,34 +669,19 @@ +@@ -662,34 +671,19 @@ TileEntity tileentity; @@ -72,13 +72,13 @@ - - if (tileentity != null) - { -- tileentity.func_145836_u(); +- tileentity.updateContainingBlockInfo(); - } - } - if (!this.worldObj.isRemote) { - p_150807_4_.func_149726_b(this.worldObj, l1, p_150807_2_, i2); + p_150807_4_.onBlockAdded(this.worldObj, l1, p_150807_2_, i2); } - if (p_150807_4_ instanceof ITileEntityProvider) @@ -88,27 +88,27 @@ - if (tileentity == null) - { -- tileentity = ((ITileEntityProvider)p_150807_4_).func_149915_a(this.worldObj, p_150807_5_); -- this.worldObj.func_147455_a(l1, p_150807_2_, i2, tileentity); +- tileentity = ((ITileEntityProvider)p_150807_4_).createNewTileEntity(this.worldObj, p_150807_5_); +- this.worldObj.setTileEntity(l1, p_150807_2_, i2, tileentity); - } - if (tileentity != null) { - tileentity.func_145836_u(); -+ tileentity.field_145847_g = p_150807_5_; + tileentity.updateContainingBlockInfo(); ++ tileentity.blockMetadata = p_150807_5_; } } -@@ -719,7 +713,7 @@ +@@ -721,7 +715,7 @@ this.isModified = true; extendedblockstorage.setExtBlockMetadata(par1, par2 & 15, par3, par4); -- if (extendedblockstorage.func_150819_a(par1, par2 & 15, par3) instanceof ITileEntityProvider) -+ if (extendedblockstorage.func_150819_a(par1, par2 & 15, par3).hasTileEntity(par4)) +- if (extendedblockstorage.getBlockByExtId(par1, par2 & 15, par3) instanceof ITileEntityProvider) ++ if (extendedblockstorage.getBlockByExtId(par1, par2 & 15, par3).hasTileEntity(par4)) { TileEntity tileentity = this.func_150806_e(par1, par2, par3); -@@ -823,6 +817,7 @@ +@@ -825,6 +819,7 @@ k = this.entityLists.length - 1; } @@ -116,35 +116,35 @@ par1Entity.addedToChunk = true; par1Entity.chunkCoordX = this.xPosition; par1Entity.chunkCoordY = k; -@@ -863,28 +858,27 @@ +@@ -865,28 +860,27 @@ ChunkPosition chunkposition = new ChunkPosition(p_150806_1_, p_150806_2_, p_150806_3_); - TileEntity tileentity = (TileEntity)this.field_150816_i.get(chunkposition); + TileEntity tileentity = (TileEntity)this.chunkTileEntityMap.get(chunkposition); -+ if (tileentity != null && tileentity.func_145837_r()) ++ if (tileentity != null && tileentity.isInvalid()) + { -+ field_150816_i.remove(chunkposition); ++ chunkTileEntityMap.remove(chunkposition); + tileentity = null; + } + if (tileentity == null) { - Block block = this.func_150810_a(p_150806_1_, p_150806_2_, p_150806_3_); + Block block = this.getBlock(p_150806_1_, p_150806_2_, p_150806_3_); + int meta = this.getBlockMetadata(p_150806_1_, p_150806_2_, p_150806_3_); -- if (!block.func_149716_u()) +- if (!block.hasTileEntity()) + if (!block.hasTileEntity(meta)) { return null; } -- tileentity = ((ITileEntityProvider)block).func_149915_a(this.worldObj, this.getBlockMetadata(p_150806_1_, p_150806_2_, p_150806_3_)); +- tileentity = ((ITileEntityProvider)block).createNewTileEntity(this.worldObj, this.getBlockMetadata(p_150806_1_, p_150806_2_, p_150806_3_)); + tileentity = block.createTileEntity(worldObj, meta); - this.worldObj.func_147455_a(this.xPosition * 16 + p_150806_1_, p_150806_2_, this.zPosition * 16 + p_150806_3_, tileentity); + this.worldObj.setTileEntity(this.xPosition * 16 + p_150806_1_, p_150806_2_, this.zPosition * 16 + p_150806_3_, tileentity); } -- if (tileentity != null && tileentity.func_145837_r()) +- if (tileentity != null && tileentity.isInvalid()) - { -- this.field_150816_i.remove(chunkposition); +- this.chunkTileEntityMap.remove(chunkposition); - return null; - } - else @@ -154,27 +154,27 @@ + return tileentity; } - public void func_150813_a(TileEntity p_150813_1_) -@@ -896,7 +890,7 @@ + public void addTileEntity(TileEntity p_150813_1_) +@@ -898,7 +892,7 @@ if (this.isChunkLoaded) { -- this.worldObj.field_147482_g.add(p_150813_1_); +- this.worldObj.loadedTileEntityList.add(p_150813_1_); + this.worldObj.addTileEntity(p_150813_1_); } } -@@ -908,7 +902,8 @@ - p_150812_4_.field_145848_d = p_150812_2_; - p_150812_4_.field_145849_e = this.zPosition * 16 + p_150812_3_; +@@ -910,7 +904,8 @@ + p_150812_4_.yCoord = p_150812_2_; + p_150812_4_.zCoord = this.zPosition * 16 + p_150812_3_; -- if (this.func_150810_a(p_150812_1_, p_150812_2_, p_150812_3_) instanceof ITileEntityProvider) +- if (this.getBlock(p_150812_1_, p_150812_2_, p_150812_3_) instanceof ITileEntityProvider) + int metadata = getBlockMetadata(p_150812_1_, p_150812_2_, p_150812_3_); -+ if (this.func_150810_a(p_150812_1_, p_150812_2_, p_150812_3_).hasTileEntity(metadata)) ++ if (this.getBlock(p_150812_1_, p_150812_2_, p_150812_3_).hasTileEntity(metadata)) { - if (this.field_150816_i.containsKey(chunkposition)) + if (this.chunkTileEntityMap.containsKey(chunkposition)) { -@@ -953,6 +948,7 @@ +@@ -955,6 +950,7 @@ this.worldObj.addLoadedEntities(this.entityLists[i]); } @@ -182,7 +182,7 @@ } // JAVADOC METHOD $$ func_76623_d -@@ -971,6 +967,7 @@ +@@ -973,6 +969,7 @@ { this.worldObj.unloadEntities(this.entityLists[i]); } @@ -190,7 +190,7 @@ } // JAVADOC METHOD $$ func_76630_e -@@ -982,8 +979,8 @@ +@@ -984,8 +981,8 @@ // JAVADOC METHOD $$ func_76588_a public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) { @@ -201,7 +201,7 @@ i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1); j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1); -@@ -1020,8 +1017,8 @@ +@@ -1022,8 +1019,8 @@ // JAVADOC METHOD $$ func_76618_a public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) { @@ -212,52 +212,52 @@ i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1); j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1); -@@ -1185,6 +1182,15 @@ +@@ -1187,6 +1184,15 @@ @SideOnly(Side.CLIENT) public void fillChunk(byte[] par1ArrayOfByte, int par2, int par3, boolean par4) { -+ Iterator iterator = field_150816_i.values().iterator(); ++ Iterator iterator = chunkTileEntityMap.values().iterator(); + while(iterator.hasNext()) + { + TileEntity tileEntity = (TileEntity)iterator.next(); -+ tileEntity.func_145836_u(); -+ tileEntity.func_145832_p(); -+ tileEntity.func_145838_q(); ++ tileEntity.updateContainingBlockInfo(); ++ tileEntity.getBlockMetadata(); ++ tileEntity.getBlockType(); + } + int k = 0; boolean flag1 = !this.worldObj.provider.hasNoSky; int l; -@@ -1287,13 +1293,27 @@ - this.field_150814_l = true; +@@ -1289,13 +1295,27 @@ + this.isLightPopulated = true; this.isTerrainPopulated = true; this.generateHeightMap(); -- Iterator iterator = this.field_150816_i.values().iterator(); +- Iterator iterator = this.chunkTileEntityMap.values().iterator(); + List invalidList = new ArrayList(); -+ iterator = this.field_150816_i.values().iterator(); ++ iterator = this.chunkTileEntityMap.values().iterator(); while (iterator.hasNext()) { TileEntity tileentity = (TileEntity)iterator.next(); -+ int x = tileentity.field_145851_c & 15; -+ int y = tileentity.field_145848_d; -+ int z = tileentity.field_145849_e & 15; -+ Block block = tileentity.func_145838_q(); -+ if (block != func_150810_a(x, y, z) || tileentity.field_145847_g != this.getBlockMetadata(x, y, z)) ++ int x = tileentity.xCoord & 15; ++ int y = tileentity.yCoord; ++ int z = tileentity.zCoord & 15; ++ Block block = tileentity.getBlockType(); ++ if (block != getBlock(x, y, z) || tileentity.blockMetadata != this.getBlockMetadata(x, y, z)) + { + invalidList.add(tileentity); + } - tileentity.func_145836_u(); + tileentity.updateContainingBlockInfo(); } + + for (TileEntity te : invalidList) + { -+ te.func_145843_s(); ++ te.invalidate(); + } } // JAVADOC METHOD $$ func_76591_a -@@ -1501,4 +1521,48 @@ +@@ -1503,4 +1523,48 @@ return true; } @@ -274,11 +274,11 @@ + public TileEntity getTileEntityUnsafe(int x, int y, int z) + { + ChunkPosition chunkposition = new ChunkPosition(x, y, z); -+ TileEntity tileentity = (TileEntity)this.field_150816_i.get(chunkposition); ++ TileEntity tileentity = (TileEntity)this.chunkTileEntityMap.get(chunkposition); + -+ if (tileentity != null && tileentity.func_145837_r()) ++ if (tileentity != null && tileentity.isInvalid()) + { -+ field_150816_i.remove(chunkposition); ++ chunkTileEntityMap.remove(chunkposition); + tileentity = null; + } + @@ -298,10 +298,10 @@ + ChunkPosition position = new ChunkPosition(x, y, z); + if (isChunkLoaded) + { -+ TileEntity entity = (TileEntity)field_150816_i.get(position); -+ if (entity != null && entity.func_145837_r()) ++ TileEntity entity = (TileEntity)chunkTileEntityMap.get(position); ++ if (entity != null && entity.isInvalid()) + { -+ field_150816_i.remove(position); ++ chunkTileEntityMap.remove(position); + } + } + } diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch index bda7c9044d..136939ae4b 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch @@ -51,7 +51,7 @@ @@ -341,10 +361,16 @@ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { - BlockFalling.field_149832_M = true; + BlockFalling.fallInstantly = true; + + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, endWorld, endWorld.rand, par2, par3, false)); + @@ -62,6 +62,6 @@ + + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, endWorld, endWorld.rand, par2, par3, false)); + - BlockFalling.field_149832_M = false; + BlockFalling.fallInstantly = false; } diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch index d3324161fe..064ad5abe9 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch @@ -30,7 +30,7 @@ { this.worldObj = par1World; @@ -86,6 +101,16 @@ - this.field_147433_r[j + 2 + (k + 2) * 5] = f; + this.parabolicField[j + 2 + (k + 2) * 5] = f; } } + @@ -48,7 +48,7 @@ public void func_147424_a(int p_147424_1_, int p_147424_2_, Block[] p_147424_3_) @@ -167,6 +192,10 @@ - public void func_147422_a(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_) + public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_) { + ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_5_); + MinecraftForge.EVENT_BUS.post(event); @@ -111,6 +111,6 @@ + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag)); + - BlockFalling.field_149832_M = false; + BlockFalling.fallInstantly = false; } diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch index 5d5c2c444c..9cf8fcb013 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch @@ -69,7 +69,7 @@ @@ -410,6 +441,9 @@ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { - BlockFalling.field_149832_M = true; + BlockFalling.fallInstantly = true; + + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, hellRNG, par2, par3, false)); + @@ -155,6 +155,6 @@ + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldObj, hellRNG, k, l)); + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, hellRNG, par2, par3, false)); + - BlockFalling.field_149832_M = false; + BlockFalling.fallInstantly = false; } diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch index 38169ce3d8..e66166ce9e 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch @@ -33,7 +33,7 @@ { @@ -272,6 +278,11 @@ { - if (!this.worldObj.canNotSave) + if (!this.worldObj.levelSaving) { + for (ChunkCoordIntPair forced : this.worldObj.getPersistentChunks().keySet()) + { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch index a95f248686..32eb0f656b 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch @@ -7,7 +7,7 @@ + + protected boolean isReplaceable(World world, int x, int y, int z) + { -+ Block block = world.func_147439_a(x, y, z); ++ Block block = world.getBlock(x, y, z); + return block.isAir(world, x, y, z) || block.isLeaves(world, x, y, z) || block.isWood(world, x, y, z) || func_150523_a(block); + } } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch index b2a592cacd..f38b32355d 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java @@ -57,7 +57,7 @@ { - Block block = par1World.func_147439_a(k1, j1, l1); + Block block = par1World.getBlock(k1, j1, l1); -- if (block.func_149688_o() != Material.field_151579_a && block.func_149688_o() != Material.field_151584_j) +- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) + if (!block.isAir(par1World, k1, j1, l1) && !block.isLeaves(par1World, k1, j1, l1)) { flag = false; @@ -13,17 +13,17 @@ j2 = 0; } -- if ((j2 != 0 || par4 >= par4 + i1 - 1) && !par1World.func_147439_a(l2, k1, i2).func_149730_j()) -+ if ((j2 != 0 || par4 >= par4 + i1 - 1) && par1World.func_147439_a(l2, k1, i2).canBeReplacedByLeaves(par1World, l2, k1, i2)) +- if ((j2 != 0 || par4 >= par4 + i1 - 1) && !par1World.getBlock(l2, k1, i2).func_149730_j()) ++ if ((j2 != 0 || par4 >= par4 + i1 - 1) && par1World.getBlock(l2, k1, i2).canBeReplacedByLeaves(par1World, l2, k1, i2)) { - this.func_150516_a(par1World, l2, k1, i2, Block.func_149729_e(Block.func_149682_b(Blocks.brown_mushroom_block) + l), j2); + this.setBlockAndNotifyAdequately(par1World, l2, k1, i2, Block.getBlockById(Block.getIdFromBlock(Blocks.brown_mushroom_block) + l), j2); } @@ -196,7 +196,7 @@ { - Block block2 = par1World.func_147439_a(par3, par4 + k1, par5); + Block block2 = par1World.getBlock(par3, par4 + k1, par5); - if (!block2.func_149730_j()) + if (block2.canBeReplacedByLeaves(par1World, par3, par4 + k1, par5)) { - this.func_150516_a(par1World, par3, par4 + k1, par5, Block.func_149729_e(Block.func_149682_b(Blocks.brown_mushroom_block) + l), 10); + this.setBlockAndNotifyAdequately(par1World, par3, par4 + k1, par5, Block.getBlockById(Block.getIdFromBlock(Blocks.brown_mushroom_block) + l), 10); } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch index 6e1c91f042..c67dab2d8d 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch @@ -15,16 +15,16 @@ { @@ -150,7 +152,7 @@ aint1[b2] = aint[b2] + j1; - Block block1 = this.worldObj.func_147439_a(aint1[0], aint1[1], aint1[2]); + Block block1 = this.worldObj.getBlock(aint1[0], aint1[1], aint1[2]); -- if (block1.func_149688_o() != Material.field_151579_a && block1.func_149688_o() != Material.field_151584_j) +- if (block1.getMaterial() != Material.air && block1.getMaterial() != Material.leaves) + if (!block1.isAir(worldObj, aint1[0], aint1[1], aint1[2]) && !block1.isLeaves(worldObj, aint1[0], aint1[1], aint1[2])) { ++j1; } @@ -389,7 +391,7 @@ aint3[b3] = MathHelper.floor_double((double)par1ArrayOfInteger[b3] + (double)i * d1); - Block block = this.worldObj.func_147439_a(aint3[0], aint3[1], aint3[2]); + Block block = this.worldObj.getBlock(aint3[0], aint3[1], aint3[2]); - if (!this.func_150523_a(block)) + if (!this.isReplaceable(worldObj, aint3[0], aint3[1], aint3[2])) @@ -33,7 +33,7 @@ } @@ -406,7 +408,8 @@ int[] aint1 = new int[] {this.basePos[0], this.basePos[1] + this.heightLimit - 1, this.basePos[2]}; - Block block = this.worldObj.func_147439_a(this.basePos[0], this.basePos[1] - 1, this.basePos[2]); + Block block = this.worldObj.getBlock(this.basePos[0], this.basePos[1] - 1, this.basePos[2]); - if (block != Blocks.dirt && block != Blocks.grass && block != Blocks.farmland) + boolean isSoil = block.canSustainPlant(worldObj, basePos[0], basePos[1] - 1, basePos[2], ForgeDirection.UP, (BlockSapling)Blocks.sapling); diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch index 7b520f7eb3..6ebb1406b5 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch @@ -15,7 +15,7 @@ { @@ -48,7 +50,7 @@ { - Block block = par1World.func_147439_a(j1, i1, k1); + Block block = par1World.getBlock(j1, i1, k1); - if (!this.func_150523_a(block)) + if (!this.isReplaceable(par1World, j1, i1, k1)) @@ -24,7 +24,7 @@ } @@ -69,12 +71,13 @@ { - Block block2 = par1World.func_147439_a(par3, par4 - 1, par5); + Block block2 = par1World.getBlock(par3, par4 - 1, par5); - if ((block2 == Blocks.grass || block2 == Blocks.dirt) && par4 < 256 - l - 1) + boolean isSoil = block2.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Blocks.sapling); @@ -43,27 +43,27 @@ k1 = 2 - par2Random.nextInt(3); @@ -97,7 +100,7 @@ - Block block1 = par1World.func_147439_a(k3, k2, l1); + Block block1 = par1World.getBlock(k3, k2, l1); -- if (block1.func_149688_o() == Material.field_151579_a || block1.func_149688_o() == Material.field_151584_j) +- if (block1.getMaterial() == Material.air || block1.getMaterial() == Material.leaves) + if (block1.isAir(par1World, k3, k2, l1) || block1.isLeaves(par1World, k3, k2, l1)) { - this.func_150516_a(par1World, k3, k2, l1, Blocks.log2, 1); - this.func_150516_a(par1World, k3 + 1, k2, l1, Blocks.log2, 1); + this.setBlockAndNotifyAdequately(par1World, k3, k2, l1, Blocks.log2, 1); + this.setBlockAndNotifyAdequately(par1World, k3 + 1, k2, l1, Blocks.log2, 1); @@ -203,9 +206,15 @@ { - Block block = p_150526_1_.func_147439_a(p_150526_2_, p_150526_3_, p_150526_4_); + Block block = p_150526_1_.getBlock(p_150526_2_, p_150526_3_, p_150526_4_); -- if (block.func_149688_o() == Material.field_151579_a) +- if (block.getMaterial() == Material.air) + if (block.isAir(p_150526_1_, p_150526_2_, p_150526_3_, p_150526_4_)) { - this.func_150516_a(p_150526_1_, p_150526_2_, p_150526_3_, p_150526_4_, Blocks.leaves2, 1); + this.setBlockAndNotifyAdequately(p_150526_1_, p_150526_2_, p_150526_3_, p_150526_4_, Blocks.leaves2, 1); } } + + //Just a helper macro + private void onPlantGrow(World world, int x, int y, int z, int sourceX, int sourceY, int sourceZ) + { -+ world.func_147439_a(x, y, z).onPlantGrow(world, x, y, z, sourceX, sourceY, sourceZ); ++ world.getBlock(x, y, z).onPlantGrow(world, x, y, z, sourceX, sourceY, sourceZ); + } } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch index 7c5f6b7d4b..40ca9d22c7 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch @@ -4,10 +4,10 @@ { Block block; -- while (((block = par1World.func_147439_a(par3, par4, par5)).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && par4 > 0) +- while (((block = par1World.getBlock(par3, par4, par5)).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && par4 > 0) + do { -+ block = par1World.func_147439_a(par3, par4, par5); ++ block = par1World.getBlock(par3, par4, par5); + if (!(block.isLeaves(par1World, par3, par4, par5) || block.isAir(par1World, par3, par4, par5))) + { + break; diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch index ab4df35e8c..b6da9f9fa8 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch @@ -13,9 +13,9 @@ @@ -123,12 +126,11 @@ if (k2 == 1) { - par1World.func_147465_d(i2, par4, j2, Blocks.chest, 0, 2); + par1World.setBlock(i2, par4, j2, Blocks.chest, 0, 2); - WeightedRandomChestContent[] aweightedrandomchestcontent = WeightedRandomChestContent.func_92080_a(field_111189_a, new WeightedRandomChestContent[] {Items.enchanted_book.func_92114_b(par2Random)}); - TileEntityChest tileentitychest = (TileEntityChest)par1World.func_147438_o(i2, par4, j2); + TileEntityChest tileentitychest = (TileEntityChest)par1World.getTileEntity(i2, par4, j2); if (tileentitychest != null) { diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch index 8817921921..795f0b52ab 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch @@ -14,7 +14,7 @@ { @@ -55,7 +57,7 @@ { - Block block = par1World.func_147439_a(j1, i1, k1); + Block block = par1World.getBlock(j1, i1, k1); - if (!this.func_150523_a(block)) + if (!this.isReplaceable(par1World, j1, i1, k1)) @@ -23,7 +23,7 @@ } @@ -76,9 +78,10 @@ { - Block block2 = par1World.func_147439_a(par3, par4 - 1, par5); + Block block2 = par1World.getBlock(par3, par4 - 1, par5); - if ((block2 == Blocks.grass || block2 == Blocks.dirt || block2 == Blocks.farmland) && par4 < 256 - l - 1) + boolean isSoil = block2.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Blocks.sapling); @@ -36,19 +36,19 @@ for (k2 = par4 - 3 + l; k2 <= par4 + l; ++k2) @@ -98,7 +101,7 @@ { - Block block1 = par1World.func_147439_a(l2, k2, i2); + Block block1 = par1World.getBlock(l2, k2, i2); -- if (block1.func_149688_o() == Material.field_151579_a || block1.func_149688_o() == Material.field_151584_j) +- if (block1.getMaterial() == Material.air || block1.getMaterial() == Material.leaves) + if (block1.isAir(par1World, l2, k2, i2) || block1.isLeaves(par1World, l2, k2, i2)) { - this.func_150516_a(par1World, l2, k2, i2, Blocks.leaves, 2); + this.setBlockAndNotifyAdequately(par1World, l2, k2, i2, Blocks.leaves, 2); } @@ -111,7 +114,7 @@ { - Block block3 = par1World.func_147439_a(par3, par4 + k2, par5); + Block block3 = par1World.getBlock(par3, par4 + k2, par5); -- if (block3.func_149688_o() == Material.field_151579_a || block3.func_149688_o() == Material.field_151584_j) +- if (block3.getMaterial() == Material.air || block3.getMaterial() == Material.leaves) + if (block3.isAir(par1World, par3, par4 + k2, par5) || block3.isLeaves(par1World, par3, par4 + k2, par5)) { - this.func_150516_a(par1World, par3, par4 + k2, par5, Blocks.log, 2); + this.setBlockAndNotifyAdequately(par1World, par3, par4 + k2, par5, Blocks.log, 2); } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch index 1ebd94f34f..59ed900214 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch @@ -14,7 +14,7 @@ { @@ -66,7 +68,7 @@ { - Block block = p_150536_1_.func_147439_a(j1, i1, k1); + Block block = p_150536_1_.getBlock(j1, i1, k1); - if (!this.func_150523_a(block)) + if (!this.isReplaceable(p_150536_1_, j1, i1, k1)) @@ -23,16 +23,16 @@ } @@ -91,12 +93,13 @@ { - Block block = p_150532_1_.func_147439_a(p_150532_3_, p_150532_4_ - 1, p_150532_5_); + Block block = p_150532_1_.getBlock(p_150532_3_, p_150532_4_ - 1, p_150532_5_); - if ((block == Blocks.grass || block == Blocks.dirt) && p_150532_4_ >= 2) + boolean isSoil = block.canSustainPlant(p_150532_1_, p_150532_3_, p_150532_4_ - 1, p_150532_5_, ForgeDirection.UP, (BlockSapling)Blocks.sapling); + if (isSoil && p_150532_4_ >= 2) { -- p_150532_1_.func_147465_d(p_150532_3_, p_150532_4_ - 1, p_150532_5_, Blocks.dirt, 0, 2); -- p_150532_1_.func_147465_d(p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_, Blocks.dirt, 0, 2); -- p_150532_1_.func_147465_d(p_150532_3_, p_150532_4_ - 1, p_150532_5_ + 1, Blocks.dirt, 0, 2); -- p_150532_1_.func_147465_d(p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_ + 1, Blocks.dirt, 0, 2); +- p_150532_1_.setBlock(p_150532_3_, p_150532_4_ - 1, p_150532_5_, Blocks.dirt, 0, 2); +- p_150532_1_.setBlock(p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_, Blocks.dirt, 0, 2); +- p_150532_1_.setBlock(p_150532_3_, p_150532_4_ - 1, p_150532_5_ + 1, Blocks.dirt, 0, 2); +- p_150532_1_.setBlock(p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_ + 1, Blocks.dirt, 0, 2); + onPlantGrow(p_150532_1_, p_150532_3_, p_150532_4_ - 1, p_150532_5_, p_150532_3_, p_150532_4_, p_150532_5_); + onPlantGrow(p_150532_1_, p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_, p_150532_3_, p_150532_4_, p_150532_5_); + onPlantGrow(p_150532_1_, p_150532_3_, p_150532_4_ - 1, p_150532_5_ + 1, p_150532_3_, p_150532_4_, p_150532_5_); @@ -42,21 +42,21 @@ else @@ -128,7 +131,7 @@ { - Block block = p_150535_1_.func_147439_a(j1, p_150535_3_, l1); + Block block = p_150535_1_.getBlock(j1, p_150535_3_, l1); -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + if (block.isAir(p_150535_1_, j1, p_150535_3_, l1) || block.isLeaves(p_150535_1_, j1, p_150535_3_, l1)) { - this.func_150516_a(p_150535_1_, j1, p_150535_3_, l1, Blocks.leaves, this.leavesMetadata); + this.setBlockAndNotifyAdequately(p_150535_1_, j1, p_150535_3_, l1, Blocks.leaves, this.leavesMetadata); } @@ -153,7 +156,7 @@ { - Block block = p_150534_1_.func_147439_a(j1, p_150534_3_, l1); + Block block = p_150534_1_.getBlock(j1, p_150534_3_, l1); -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + if (block.isAir(p_150534_1_, j1, p_150534_3_, l1) || block.isLeaves(p_150534_1_, j1, p_150534_3_, l1)) { - this.func_150516_a(p_150534_1_, j1, p_150534_3_, l1, Blocks.leaves, this.leavesMetadata); + this.setBlockAndNotifyAdequately(p_150534_1_, j1, p_150534_3_, l1, Blocks.leaves, this.leavesMetadata); } @@ -161,4 +164,10 @@ } @@ -66,6 +66,6 @@ + //Just a helper macro + private void onPlantGrow(World world, int x, int y, int z, int sourceX, int sourceY, int sourceZ) + { -+ world.func_147439_a(x, y, z).onPlantGrow(world, x, y, z, sourceX, sourceY, sourceZ); ++ world.getBlock(x, y, z).onPlantGrow(world, x, y, z, sourceX, sourceY, sourceZ); + } } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch index b425fd48d3..4366cbe334 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch @@ -2,37 +2,37 @@ +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java @@ -56,7 +56,7 @@ { - Block block = par1World.func_147439_a(par3, par4 + l2, par5); + Block block = par1World.getBlock(par3, par4 + l2, par5); -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + if (block.isAir(par1World, par3, par4 + l2, par5) || block.isLeaves(par1World, par3, par4 + l2, par5)) { - this.func_150516_a(par1World, par3, par4 + l2, par5, Blocks.log, this.woodMetadata); + this.setBlockAndNotifyAdequately(par1World, par3, par4 + l2, par5, Blocks.log, this.woodMetadata); @@ -78,7 +78,7 @@ { - block = par1World.func_147439_a(par3 + 1, par4 + l2, par5); + block = par1World.getBlock(par3 + 1, par4 + l2, par5); -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + if (block.isAir(par1World, par3 + 1, par4 + l2, par5) || block.isLeaves(par1World, par3 + 1, par4 + l2, par5)) { - this.func_150516_a(par1World, par3 + 1, par4 + l2, par5, Blocks.log, this.woodMetadata); + this.setBlockAndNotifyAdequately(par1World, par3 + 1, par4 + l2, par5, Blocks.log, this.woodMetadata); @@ -98,7 +98,7 @@ - block = par1World.func_147439_a(par3 + 1, par4 + l2, par5 + 1); + block = par1World.getBlock(par3 + 1, par4 + l2, par5 + 1); -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + if (block.isAir(par1World, par3 + 1, par4 + l2, par5 + 1) || block.isLeaves(par1World, par3 + 1, par4 + l2, par5 + 1)) { - this.func_150516_a(par1World, par3 + 1, par4 + l2, par5 + 1, Blocks.log, this.woodMetadata); + this.setBlockAndNotifyAdequately(par1World, par3 + 1, par4 + l2, par5 + 1, Blocks.log, this.woodMetadata); @@ -118,7 +118,7 @@ - block = par1World.func_147439_a(par3, par4 + l2, par5 + 1); + block = par1World.getBlock(par3, par4 + l2, par5 + 1); -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + if (block.isAir(par1World, par3, par4 + l2, par5 + 1) || block.isLeaves(par1World, par3, par4 + l2, par5 + 1)) { - this.func_150516_a(par1World, par3, par4 + l2, par5 + 1, Blocks.log, this.woodMetadata); + this.setBlockAndNotifyAdequately(par1World, par3, par4 + l2, par5 + 1, Blocks.log, this.woodMetadata); diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch index 440f31b6c1..d3b08688df 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch @@ -15,50 +15,50 @@ { @@ -34,7 +36,7 @@ { - Block block = par1World.func_147439_a(par3, par4 + i1, par5); + Block block = par1World.getBlock(par3, par4 + i1, par5); -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + if (block.isAir(par1World, par3, par4 + i1, par5) || block.isLeaves(par1World, par3, par4 + i1, par5)) { - this.func_150516_a(par1World, par3, par4 + i1, par5, Blocks.log, this.woodMetadata); + this.setBlockAndNotifyAdequately(par1World, par3, par4 + i1, par5, Blocks.log, this.woodMetadata); } @@ -43,21 +45,21 @@ { - block = par1World.func_147439_a(par3 + 1, par4 + i1, par5); + block = par1World.getBlock(par3 + 1, par4 + i1, par5); -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + if (block.isAir(par1World, par3 + 1, par4 + i1, par5) || block.isLeaves(par1World, par3 + 1, par4 + i1, par5)) { - this.func_150516_a(par1World, par3 + 1, par4 + i1, par5, Blocks.log, this.woodMetadata); + this.setBlockAndNotifyAdequately(par1World, par3 + 1, par4 + i1, par5, Blocks.log, this.woodMetadata); } - block = par1World.func_147439_a(par3 + 1, par4 + i1, par5 + 1); + block = par1World.getBlock(par3 + 1, par4 + i1, par5 + 1); -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + if (block.isAir(par1World, par3 + 1, par4 + i1, par5 + 1) || block.isLeaves(par1World, par3 + 1, par4 + i1, par5 + 1)) { - this.func_150516_a(par1World, par3 + 1, par4 + i1, par5 + 1, Blocks.log, this.woodMetadata); + this.setBlockAndNotifyAdequately(par1World, par3 + 1, par4 + i1, par5 + 1, Blocks.log, this.woodMetadata); } - block = par1World.func_147439_a(par3, par4 + i1, par5 + 1); + block = par1World.getBlock(par3, par4 + i1, par5 + 1); -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + if (block.isAir(par1World, par3, par4 + i1, par5 + 1) || block.isLeaves(par1World, par3, par4 + i1, par5 + 1)) { - this.func_150516_a(par1World, par3, par4 + i1, par5 + 1, Blocks.log, this.woodMetadata); + this.setBlockAndNotifyAdequately(par1World, par3, par4 + i1, par5 + 1, Blocks.log, this.woodMetadata); } @@ -132,13 +134,13 @@ { - Block block = p_150540_1_.func_147439_a(p_150540_2_, l, p_150540_4_); + Block block = p_150540_1_.getBlock(p_150540_2_, l, p_150540_4_); - if (block == Blocks.grass || block == Blocks.dirt) + if (block.canSustainPlant(p_150540_1_, p_150540_2_, l, p_150540_4_, ForgeDirection.UP, (BlockSapling)Blocks.sapling)) { - this.func_150516_a(p_150540_1_, p_150540_2_, l, p_150540_4_, Blocks.dirt, 2); + this.setBlockAndNotifyAdequately(p_150540_1_, p_150540_2_, l, p_150540_4_, Blocks.dirt, 2); break; } -- if (block.func_149688_o() != Material.field_151579_a && l < p_150540_3_) +- if (block.getMaterial() != Material.air && l < p_150540_3_) + if (block.isAir(p_150540_1_, p_150540_2_, l, p_150540_4_) && l < p_150540_3_) { break; diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch index 5722c1b937..7b55967694 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch @@ -25,11 +25,11 @@ { double d14 = ((double)i3 + 0.5D - d8) / (d10 / 2.0D); -- if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && par1World.func_147439_a(k2, l2, i3) == this.field_150518_c) -+ if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && par1World.func_147439_a(k2, l2, i3).isReplaceableOreGen(par1World, k2, l2, i3, field_150518_c)) +- if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && par1World.getBlock(k2, l2, i3) == this.field_150518_c) ++ if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && par1World.getBlock(k2, l2, i3).isReplaceableOreGen(par1World, k2, l2, i3, field_150518_c)) { -- par1World.func_147465_d(k2, l2, i3, this.field_150519_a, 0, 2); -+ par1World.func_147465_d(k2, l2, i3, this.field_150519_a, mineableBlockMeta, 2); +- par1World.setBlock(k2, l2, i3, this.field_150519_a, 0, 2); ++ par1World.setBlock(k2, l2, i3, this.field_150519_a, mineableBlockMeta, 2); } } } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch index 759a70ba0f..05671baae2 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch @@ -15,7 +15,7 @@ { @@ -48,7 +50,7 @@ { - Block block = par1World.func_147439_a(j1, i1, k1); + Block block = par1World.getBlock(j1, i1, k1); - if (!this.func_150523_a(block)) + if (!this.isReplaceable(par1World, j1, i1, k1)) @@ -24,7 +24,7 @@ } @@ -69,9 +71,10 @@ { - Block block3 = par1World.func_147439_a(par3, par4 - 1, par5); + Block block3 = par1World.getBlock(par3, par4 - 1, par5); - if ((block3 == Blocks.grass || block3 == Blocks.dirt) && par4 < 256 - l - 1) + boolean isSoil = block3.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Blocks.sapling); @@ -37,28 +37,28 @@ k1 = 3 - par2Random.nextInt(3); @@ -94,7 +97,7 @@ - Block block1 = par1World.func_147439_a(k3, k2, l1); + Block block1 = par1World.getBlock(k3, k2, l1); -- if (block1.func_149688_o() == Material.field_151579_a || block1.func_149688_o() == Material.field_151584_j) +- if (block1.getMaterial() == Material.air || block1.getMaterial() == Material.leaves) + if (block1.isAir(par1World, k3, k2, l1) || block1.isLeaves(par1World, k3, k2, l1)) { - this.func_150516_a(par1World, k3, k2, l1, Blocks.log2, 0); + this.setBlockAndNotifyAdequately(par1World, k3, k2, l1, Blocks.log2, 0); i2 = k2; @@ -146,7 +149,7 @@ l1 += Direction.offsetZ[j2]; - Block block2 = par1World.func_147439_a(k3, i3, l1); + Block block2 = par1World.getBlock(k3, i3, l1); -- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j) +- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves) + if (block2.isAir(par1World, k3, i3, l1) || block2.isLeaves(par1World, k3, i3, l1)) { - this.func_150516_a(par1World, k3, i3, l1, Blocks.log2, 0); + this.setBlockAndNotifyAdequately(par1World, k3, i3, l1, Blocks.log2, 0); i2 = i3; @@ -197,7 +200,7 @@ { - Block block = p_150525_1_.func_147439_a(p_150525_2_, p_150525_3_, p_150525_4_); + Block block = p_150525_1_.getBlock(p_150525_2_, p_150525_3_, p_150525_4_); -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + if (block.isAir(p_150525_1_, p_150525_2_, p_150525_3_, p_150525_4_) || block.isLeaves(p_150525_1_, p_150525_2_, p_150525_3_, p_150525_4_)) { - this.func_150516_a(p_150525_1_, p_150525_2_, p_150525_3_, p_150525_4_, Blocks.leaves2, 0); + this.setBlockAndNotifyAdequately(p_150525_1_, p_150525_2_, p_150525_3_, p_150525_4_, Blocks.leaves2, 0); } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch index afedc6218c..58fe84a23e 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch @@ -4,10 +4,10 @@ { Block block; -- while (((block = par1World.func_147439_a(par3, par4, par5)).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && par4 > 0) +- while (((block = par1World.getBlock(par3, par4, par5)).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && par4 > 0) + do { -+ block = par1World.func_147439_a(par3, par4, par5); ++ block = par1World.getBlock(par3, par4, par5); + if (!(block.isLeaves(par1World, par3, par4, par5) || block.isAir(par1World, par3, par4, par5))) + { + break; @@ -16,14 +16,14 @@ - } + } while (par4 > 0); - Block block1 = par1World.func_147439_a(par3, par4, par5); + Block block1 = par1World.getBlock(par3, par4, par5); @@ -48,7 +53,7 @@ { int j2 = i2 - par5; -- if ((Math.abs(l1) != j1 || Math.abs(j2) != j1 || par2Random.nextInt(2) != 0) && !par1World.func_147439_a(k1, l, i2).func_149730_j()) -+ if ((Math.abs(l1) != j1 || Math.abs(j2) != j1 || par2Random.nextInt(2) != 0) && par1World.func_147439_a(k1, l, i2).canBeReplacedByLeaves(par1World, k1, l, i2)) +- if ((Math.abs(l1) != j1 || Math.abs(j2) != j1 || par2Random.nextInt(2) != 0) && !par1World.getBlock(k1, l, i2).func_149730_j()) ++ if ((Math.abs(l1) != j1 || Math.abs(j2) != j1 || par2Random.nextInt(2) != 0) && par1World.getBlock(k1, l, i2).canBeReplacedByLeaves(par1World, k1, l, i2)) { - this.func_150516_a(par1World, k1, l, i2, Blocks.leaves, this.field_150528_a); + this.setBlockAndNotifyAdequately(par1World, k1, l, i2, Blocks.leaves, this.field_150528_a); } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch index 672aca5baa..f7ee53579d 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch @@ -14,16 +14,16 @@ { @@ -53,7 +55,7 @@ { - Block block = par1World.func_147439_a(j1, i1, k1); + Block block = par1World.getBlock(j1, i1, k1); -- if (block.func_149688_o() != Material.field_151579_a && block.func_149688_o() != Material.field_151584_j) +- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) + if (!(block.isAir(par1World, j1, i1, k1) || block.isLeaves(par1World, j1, i1, k1))) { if (block != Blocks.water && block != Blocks.flowing_water) { @@ -81,9 +83,10 @@ { - Block block1 = par1World.func_147439_a(par3, par4 - 1, par5); + Block block1 = par1World.getBlock(par3, par4 - 1, par5); - if ((block1 == Blocks.grass || block1 == Blocks.dirt) && par4 < 256 - l - 1) + boolean isSoil = block1.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Blocks.sapling); @@ -38,16 +38,16 @@ { int j2 = i2 - par5; -- if ((Math.abs(l1) != k1 || Math.abs(j2) != k1 || par2Random.nextInt(2) != 0 && j1 != 0) && !par1World.func_147439_a(l2, k2, i2).func_149730_j()) -+ if ((Math.abs(l1) != k1 || Math.abs(j2) != k1 || par2Random.nextInt(2) != 0 && j1 != 0) && par1World.func_147439_a(l2, k2, i2).canBeReplacedByLeaves(par1World, l2, k2, i2)) +- if ((Math.abs(l1) != k1 || Math.abs(j2) != k1 || par2Random.nextInt(2) != 0 && j1 != 0) && !par1World.getBlock(l2, k2, i2).func_149730_j()) ++ if ((Math.abs(l1) != k1 || Math.abs(j2) != k1 || par2Random.nextInt(2) != 0 && j1 != 0) && par1World.getBlock(l2, k2, i2).canBeReplacedByLeaves(par1World, l2, k2, i2)) { this.func_150515_a(par1World, l2, k2, i2, Blocks.leaves); } @@ -113,7 +116,7 @@ { - Block block2 = par1World.func_147439_a(par3, par4 + k2, par5); + Block block2 = par1World.getBlock(par3, par4 + k2, par5); -- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j || block2 == Blocks.flowing_water || block2 == Blocks.water) +- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves || block2 == Blocks.flowing_water || block2 == Blocks.water) + if (block2.isAir(par1World, par3, par4 + k2, par5) || block2.isLeaves(par1World, par3, par4 + k2, par5) || block2 == Blocks.flowing_water || block2 == Blocks.water) { this.func_150515_a(par1World, par3, par4 + k2, par5, Blocks.log); @@ -56,29 +56,29 @@ { for (l1 = par5 - k1; l1 <= par5 + k1; ++l1) { -- if (par1World.func_147439_a(l2, k2, l1).func_149688_o() == Material.field_151584_j) -+ if (par1World.func_147439_a(l2, k2, l1).isLeaves(par1World, l2, k2, l1)) +- if (par1World.getBlock(l2, k2, l1).getMaterial() == Material.leaves) ++ if (par1World.getBlock(l2, k2, l1).isLeaves(par1World, l2, k2, l1)) { -- if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(l2 - 1, k2, l1).func_149688_o() == Material.field_151579_a) -+ if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(l2 - 1, k2, l1).isAir(par1World, l2 - 1, k2, l1)) +- if (par2Random.nextInt(4) == 0 && par1World.getBlock(l2 - 1, k2, l1).getMaterial() == Material.air) ++ if (par2Random.nextInt(4) == 0 && par1World.getBlock(l2 - 1, k2, l1).isAir(par1World, l2 - 1, k2, l1)) { this.generateVines(par1World, l2 - 1, k2, l1, 8); } -- if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(l2 + 1, k2, l1).func_149688_o() == Material.field_151579_a) -+ if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(l2 + 1, k2, l1).isAir(par1World, l2 + 1, k2, l1)) +- if (par2Random.nextInt(4) == 0 && par1World.getBlock(l2 + 1, k2, l1).getMaterial() == Material.air) ++ if (par2Random.nextInt(4) == 0 && par1World.getBlock(l2 + 1, k2, l1).isAir(par1World, l2 + 1, k2, l1)) { this.generateVines(par1World, l2 + 1, k2, l1, 2); } -- if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(l2, k2, l1 - 1).func_149688_o() == Material.field_151579_a) -+ if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(l2, k2, l1 - 1).isAir(par1World, l2, k2, l1 - 1)) +- if (par2Random.nextInt(4) == 0 && par1World.getBlock(l2, k2, l1 - 1).getMaterial() == Material.air) ++ if (par2Random.nextInt(4) == 0 && par1World.getBlock(l2, k2, l1 - 1).isAir(par1World, l2, k2, l1 - 1)) { this.generateVines(par1World, l2, k2, l1 - 1, 1); } -- if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(l2, k2, l1 + 1).func_149688_o() == Material.field_151579_a) -+ if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(l2, k2, l1 + 1).isAir(par1World, l2, k2, l1 + 1)) +- if (par2Random.nextInt(4) == 0 && par1World.getBlock(l2, k2, l1 + 1).getMaterial() == Material.air) ++ if (par2Random.nextInt(4) == 0 && par1World.getBlock(l2, k2, l1 + 1).isAir(par1World, l2, k2, l1 + 1)) { this.generateVines(par1World, l2, k2, l1 + 1, 4); } @@ -86,8 +86,8 @@ { --par3; -- if (par1World.func_147439_a(par2, par3, par4).func_149688_o() != Material.field_151579_a || i1 <= 0) -+ if (!(par1World.func_147439_a(par2, par3, par4).isAir(par1World, par2, par3, par4)) || i1 <= 0) +- if (par1World.getBlock(par2, par3, par4).getMaterial() != Material.air || i1 <= 0) ++ if (!(par1World.getBlock(par2, par3, par4).isAir(par1World, par2, par3, par4)) || i1 <= 0) { return; } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch index 0b29ae2287..4af8526ab5 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch @@ -14,7 +14,7 @@ { @@ -50,7 +52,7 @@ { - Block block = par1World.func_147439_a(i2, l1, j2); + Block block = par1World.getBlock(i2, l1, j2); - if (!this.func_150523_a(block)) + if (!this.isReplaceable(par1World, i2, l1, j2)) @@ -23,7 +23,7 @@ } @@ -71,9 +73,10 @@ { - Block block1 = par1World.func_147439_a(par3, par4 - 1, par5); + Block block1 = par1World.getBlock(par3, par4 - 1, par5); - if ((block1 == Blocks.grass || block1 == Blocks.dirt) && par4 < 256 - l - 1) + boolean isSoil = block1.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Blocks.sapling); @@ -38,17 +38,17 @@ { int l2 = k2 - par5; -- if ((Math.abs(j3) != i3 || Math.abs(l2) != i3 || i3 <= 0) && !par1World.func_147439_a(j2, i2, k2).func_149730_j()) -+ if ((Math.abs(j3) != i3 || Math.abs(l2) != i3 || i3 <= 0) && par1World.func_147439_a(j2, i2, k2).canBeReplacedByLeaves(par1World, j2, i2, k2)) +- if ((Math.abs(j3) != i3 || Math.abs(l2) != i3 || i3 <= 0) && !par1World.getBlock(j2, i2, k2).func_149730_j()) ++ if ((Math.abs(j3) != i3 || Math.abs(l2) != i3 || i3 <= 0) && par1World.getBlock(j2, i2, k2).canBeReplacedByLeaves(par1World, j2, i2, k2)) { - this.func_150516_a(par1World, j2, i2, k2, Blocks.leaves, 1); + this.setBlockAndNotifyAdequately(par1World, j2, i2, k2, Blocks.leaves, 1); } @@ -107,7 +110,7 @@ { - Block block2 = par1World.func_147439_a(par3, par4 + i2, par5); + Block block2 = par1World.getBlock(par3, par4 + i2, par5); -- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j) +- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves) + if (block2.isAir(par1World, par3, par4 + i2, par5) || block2.isLeaves(par1World, par3, par4 + i2, par5)) { - this.func_150516_a(par1World, par3, par4 + i2, par5, Blocks.log, 1); + this.setBlockAndNotifyAdequately(par1World, par3, par4 + i2, par5, Blocks.log, 1); } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch index cd049f5d23..e6eec534ab 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch @@ -14,16 +14,16 @@ { @@ -49,7 +51,7 @@ { - Block block = par1World.func_147439_a(i2, l1, j2); + Block block = par1World.getBlock(i2, l1, j2); -- if (block.func_149688_o() != Material.field_151579_a && block.func_149688_o() != Material.field_151584_j) +- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) + if (!block.isAir(par1World, i2, l1, j2) && !block.isLeaves(par1World, i2, l1, j2)) { flag = false; } @@ -70,9 +72,10 @@ { - Block block1 = par1World.func_147439_a(par3, par4 - 1, par5); + Block block1 = par1World.getBlock(par3, par4 - 1, par5); - if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && par4 < 256 - l - 1) + boolean isSoil = block1.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Blocks.sapling); @@ -38,17 +38,17 @@ { int k3 = j3 - par5; -- if ((Math.abs(i3) != l3 || Math.abs(k3) != l3 || l3 <= 0) && !par1World.func_147439_a(l2, k2, j3).func_149730_j()) -+ if ((Math.abs(i3) != l3 || Math.abs(k3) != l3 || l3 <= 0) && par1World.func_147439_a(l2, k2, j3).canBeReplacedByLeaves(par1World, l2, k2, j3)) +- if ((Math.abs(i3) != l3 || Math.abs(k3) != l3 || l3 <= 0) && !par1World.getBlock(l2, k2, j3).func_149730_j()) ++ if ((Math.abs(i3) != l3 || Math.abs(k3) != l3 || l3 <= 0) && par1World.getBlock(l2, k2, j3).canBeReplacedByLeaves(par1World, l2, k2, j3)) { - this.func_150516_a(par1World, l2, k2, j3, Blocks.leaves, 1); + this.setBlockAndNotifyAdequately(par1World, l2, k2, j3, Blocks.leaves, 1); } @@ -121,7 +124,7 @@ { - Block block2 = par1World.func_147439_a(par3, par4 + k2, par5); + Block block2 = par1World.getBlock(par3, par4 + k2, par5); -- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j) +- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves) + if (block2.isAir(par1World, par3, par4 + k2, par5) || block2.isLeaves(par1World, par3, par4 + k2, par5)) { - this.func_150516_a(par1World, par3, par4 + k2, par5, Blocks.log, 1); + this.setBlockAndNotifyAdequately(par1World, par3, par4 + k2, par5, Blocks.log, 1); } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch index 87659cd64d..551e829ff3 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch @@ -4,10 +4,10 @@ { Block block; -- while (((block = par1World.func_147439_a(par3, par4, par5)).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && par4 > 0) +- while (((block = par1World.getBlock(par3, par4, par5)).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && par4 > 0) + do { -+ block = par1World.func_147439_a(par3, par4, par5); ++ block = par1World.getBlock(par3, par4, par5); + if (!(block.isLeaves(par1World, par3, par4, par5) || block.isAir(par1World, par3, par4, par5))) + { + break; diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch index 26f736408a..790185adc5 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch @@ -15,7 +15,7 @@ { @@ -66,7 +68,7 @@ { - block = par1World.func_147439_a(j1, i1, k1); + block = par1World.getBlock(j1, i1, k1); - if (!this.func_150523_a(block)) + if (!this.isReplaceable(par1World, j1, i1, k1)) @@ -24,7 +24,7 @@ } @@ -87,9 +89,10 @@ { - Block block2 = par1World.func_147439_a(par3, par4 - 1, par5); + Block block2 = par1World.getBlock(par3, par4 - 1, par5); - if ((block2 == Blocks.grass || block2 == Blocks.dirt || block2 == Blocks.farmland) && par4 < 256 - l - 1) + boolean isSoil = block2.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Blocks.sapling); @@ -37,49 +37,49 @@ int l1; @@ -114,7 +117,7 @@ { - Block block1 = par1World.func_147439_a(i2, k1, k2); + Block block1 = par1World.getBlock(i2, k1, k2); -- if (block1.func_149688_o() == Material.field_151579_a || block1.func_149688_o() == Material.field_151584_j) +- if (block1.getMaterial() == Material.air || block1.getMaterial() == Material.leaves) + if (block1.isAir(par1World, i2, k1, k2) || block1.isLeaves(par1World, i2, k1, k2)) { - this.func_150516_a(par1World, i2, k1, k2, Blocks.leaves, this.metaLeaves); + this.setBlockAndNotifyAdequately(par1World, i2, k1, k2, Blocks.leaves, this.metaLeaves); } @@ -127,7 +130,7 @@ { - block = par1World.func_147439_a(par3, par4 + k1, par5); + block = par1World.getBlock(par3, par4 + k1, par5); -- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) + if (block.isAir(par1World, par3, par4 + k1, par5) || block.isLeaves(par1World, par3, par4 + k1, par5)) { - this.func_150516_a(par1World, par3, par4 + k1, par5, Blocks.log, this.metaWood); + this.setBlockAndNotifyAdequately(par1World, par3, par4 + k1, par5, Blocks.log, this.metaWood); @@ -167,24 +170,24 @@ { for (j2 = par5 - l1; j2 <= par5 + l1; ++j2) { -- if (par1World.func_147439_a(i2, k1, j2).func_149688_o() == Material.field_151584_j) -+ if (par1World.func_147439_a(i2, k1, j2).isLeaves(par1World, i2, k1, j2)) +- if (par1World.getBlock(i2, k1, j2).getMaterial() == Material.leaves) ++ if (par1World.getBlock(i2, k1, j2).isLeaves(par1World, i2, k1, j2)) { -- if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(i2 - 1, k1, j2).func_149688_o() == Material.field_151579_a) -+ if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(i2 - 1, k1, j2).isAir(par1World, i2 - 1, k1, j2)) +- if (par2Random.nextInt(4) == 0 && par1World.getBlock(i2 - 1, k1, j2).getMaterial() == Material.air) ++ if (par2Random.nextInt(4) == 0 && par1World.getBlock(i2 - 1, k1, j2).isAir(par1World, i2 - 1, k1, j2)) { this.growVines(par1World, i2 - 1, k1, j2, 8); } -- if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(i2 + 1, k1, j2).func_149688_o() == Material.field_151579_a) -+ if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(i2 + 1, k1, j2).isAir(par1World, i2 + 1, k1, j2)) +- if (par2Random.nextInt(4) == 0 && par1World.getBlock(i2 + 1, k1, j2).getMaterial() == Material.air) ++ if (par2Random.nextInt(4) == 0 && par1World.getBlock(i2 + 1, k1, j2).isAir(par1World, i2 + 1, k1, j2)) { this.growVines(par1World, i2 + 1, k1, j2, 2); } -- if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(i2, k1, j2 - 1).func_149688_o() == Material.field_151579_a) -+ if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(i2, k1, j2 - 1).isAir(par1World, i2, k1, j2 - 1)) +- if (par2Random.nextInt(4) == 0 && par1World.getBlock(i2, k1, j2 - 1).getMaterial() == Material.air) ++ if (par2Random.nextInt(4) == 0 && par1World.getBlock(i2, k1, j2 - 1).isAir(par1World, i2, k1, j2 - 1)) { this.growVines(par1World, i2, k1, j2 - 1, 1); } -- if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(i2, k1, j2 + 1).func_149688_o() == Material.field_151579_a) -+ if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(i2, k1, j2 + 1).isAir(par1World, i2, k1, j2 + 1)) +- if (par2Random.nextInt(4) == 0 && par1World.getBlock(i2, k1, j2 + 1).getMaterial() == Material.air) ++ if (par2Random.nextInt(4) == 0 && par1World.getBlock(i2, k1, j2 + 1).isAir(par1World, i2, k1, j2 + 1)) { this.growVines(par1World, i2, k1, j2 + 1, 4); } @@ -87,8 +87,8 @@ { --par3; -- if (par1World.func_147439_a(par2, par3, par4).func_149688_o() != Material.field_151579_a || i1 <= 0) -+ if (par1World.func_147439_a(par2, par3, par4).isAir(par1World, par2, par3, par4) || i1 <= 0) +- if (par1World.getBlock(par2, par3, par4).getMaterial() != Material.air || i1 <= 0) ++ if (par1World.getBlock(par2, par3, par4).isAir(par1World, par2, par3, par4) || i1 <= 0) { return; } diff --git a/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch b/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch index 098b77d984..83b5cf37e4 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch @@ -4,12 +4,12 @@ { Block block; -- while (((block = par1World.func_147439_a(par3, par4, par5)).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && par4 > 1) +- while (((block = par1World.getBlock(par3, par4, par5)).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && par4 > 1) + do { - --par4; - } -+ block = par1World.func_147439_a(par3, par4, par5); ++ block = par1World.getBlock(par3, par4, par5); + if (!block.isAir(par1World, par3, par4, par5) && !block.isLeaves(par1World, par3, par4, par5)) break; + par4--; + } while (par4 > 1); diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch b/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch index 71b58a391d..a660dcef7b 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch @@ -30,9 +30,9 @@ GenLayer genlayer1 = GenLayerZoom.magnify(1000L, genlayerriverinit, 2); GenLayerHills genlayerhills = new GenLayerHills(1000L, (GenLayer)object, genlayer1); genlayer = GenLayerZoom.magnify(1000L, genlayerriverinit, 2); -@@ -213,4 +211,11 @@ +@@ -217,4 +215,11 @@ { - return p_151617_2_ == p_151617_3_ && p_151617_3_ == p_151617_4_ ? p_151617_2_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_3_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_3_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_2_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_4_ && p_151617_2_ != p_151617_3_ ? p_151617_1_ : (p_151617_2_ == p_151617_3_ && p_151617_1_ != p_151617_4_ ? p_151617_2_ : (p_151617_2_ == p_151617_4_ && p_151617_1_ != p_151617_3_ ? p_151617_2_ : (p_151617_3_ == p_151617_4_ && p_151617_1_ != p_151617_2_ ? p_151617_3_ : this.func_151619_a(new int[] {p_151617_1_, p_151617_2_, p_151617_3_, p_151617_4_})))))))))); + return p_151617_2_ == p_151617_3_ && p_151617_3_ == p_151617_4_ ? p_151617_2_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_3_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_3_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_2_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_4_ && p_151617_2_ != p_151617_3_ ? p_151617_1_ : (p_151617_2_ == p_151617_3_ && p_151617_1_ != p_151617_4_ ? p_151617_2_ : (p_151617_2_ == p_151617_4_ && p_151617_1_ != p_151617_3_ ? p_151617_2_ : (p_151617_3_ == p_151617_4_ && p_151617_1_ != p_151617_2_ ? p_151617_3_ : this.selectRandom(new int[] {p_151617_1_, p_151617_2_, p_151617_3_, p_151617_4_})))))))))); } + + public static byte getModdedBiomeSize(WorldType worldType, byte original) diff --git a/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch index 0e7085f420..9e2e14b4ae 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch @@ -11,8 +11,8 @@ { private static final String __OBFID = "CL_00000473"; @@ -277,9 +280,12 @@ - this.func_151550_a(par1World, Blocks.redstone_wire, 0, 4, -3, 1, par3StructureBoundingBox); - this.func_151550_a(par1World, Blocks.mossy_cobblestone, 0, 3, -3, 1, par3StructureBoundingBox); + this.placeBlockAtCurrentPosition(par1World, Blocks.redstone_wire, 0, 4, -3, 1, par3StructureBoundingBox); + this.placeBlockAtCurrentPosition(par1World, Blocks.mossy_cobblestone, 0, 3, -3, 1, par3StructureBoundingBox); + ChestGenHooks dispenser = ChestGenHooks.getInfo(PYRAMID_JUNGLE_DISPENSER); + ChestGenHooks chest = ChestGenHooks.getInfo(PYRAMID_JUNGLE_CHEST); @@ -23,7 +23,7 @@ + this.field_74945_j = this.generateStructureDispenserContents(par1World, par3StructureBoundingBox, par2Random, 3, -2, 1, 2, dispenser.getItems(par2Random), dispenser.getCount(par2Random)); } - this.func_151550_a(par1World, Blocks.vine, 15, 3, -2, 2, par3StructureBoundingBox); + this.placeBlockAtCurrentPosition(par1World, Blocks.vine, 15, 3, -2, 2, par3StructureBoundingBox); @@ -296,7 +302,7 @@ if (!this.field_74946_k) @@ -32,7 +32,7 @@ + this.field_74946_k = this.generateStructureDispenserContents(par1World, par3StructureBoundingBox, par2Random, 9, -2, 3, 4, dispenser.getItems(par2Random), dispenser.getCount(par2Random)); } - this.func_151550_a(par1World, Blocks.vine, 15, 8, -1, 3, par3StructureBoundingBox); + this.placeBlockAtCurrentPosition(par1World, Blocks.vine, 15, 8, -1, 3, par3StructureBoundingBox); @@ -304,7 +310,7 @@ if (!this.field_74947_h) @@ -41,7 +41,7 @@ + this.field_74947_h = this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 8, -3, 3, chest.getItems(par2Random), chest.getCount(par2Random)); } - this.func_151550_a(par1World, Blocks.mossy_cobblestone, 0, 9, -3, 2, par3StructureBoundingBox); + this.placeBlockAtCurrentPosition(par1World, Blocks.mossy_cobblestone, 0, 9, -3, 2, par3StructureBoundingBox); @@ -337,7 +343,7 @@ if (!this.field_74948_i) diff --git a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch index f70c5c1e7b..477112a866 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch @@ -12,8 +12,8 @@ { BiomeGenBase biomegenbase = abiomegenbase[j]; -- if (biomegenbase != null && biomegenbase.minHeight > 0.0F) -+ if (biomegenbase != null && biomegenbase.minHeight > 0.0F && !BiomeManager.strongHoldBiomesBlackList.contains(biomegenbase)) +- if (biomegenbase != null && biomegenbase.rootHeight > 0.0F) ++ if (biomegenbase != null && biomegenbase.rootHeight > 0.0F && !BiomeManager.strongHoldBiomesBlackList.contains(biomegenbase)) { this.field_151546_e.add(biomegenbase); } diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch index 7457c4da88..c0ac80a776 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch @@ -11,7 +11,7 @@ { private static final StructureStrongholdPieces.PieceWeight[] pieceWeightArray = new StructureStrongholdPieces.PieceWeight[] {new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Straight.class, 40, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Prison.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.LeftTurn.class, 20, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RightTurn.class, 20, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RoomCrossing.class, 10, 6), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.StairsStraight.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Stairs.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Crossing.class, 5, 4), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.ChestCorridor.class, 5, 4), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Library.class, 10, 2) @@ -573,12 +576,14 @@ - this.func_151550_a(par1World, Blocks.torch, 0, b1, 8, b2 + 1, par3StructureBoundingBox); + this.placeBlockAtCurrentPosition(par1World, Blocks.torch, 0, b1, 8, b2 + 1, par3StructureBoundingBox); } - this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 3, 5, WeightedRandomChestContent.func_92080_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.func_92112_a(par2Random, 1, 5, 2)}), 1 + par2Random.nextInt(4)); @@ -21,7 +21,7 @@ + if (this.isLargeRoom) { - this.func_151550_a(par1World, Blocks.air, 0, 12, 9, 1, par3StructureBoundingBox); + this.placeBlockAtCurrentPosition(par1World, Blocks.air, 0, 12, 9, 1, par3StructureBoundingBox); - this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 12, 8, 1, WeightedRandomChestContent.func_92080_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.func_92112_a(par2Random, 1, 5, 2)}), 1 + par2Random.nextInt(4)); + this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 12, 8, 1, info.getItems(par2Random), info.getCount(par2Random)); } @@ -37,9 +37,9 @@ } @@ -960,7 +965,7 @@ - this.func_151550_a(par1World, Blocks.ladder, this.func_151555_a(Blocks.ladder, 4), 9, 1, 3, par3StructureBoundingBox); - this.func_151550_a(par1World, Blocks.ladder, this.func_151555_a(Blocks.ladder, 4), 9, 2, 3, par3StructureBoundingBox); - this.func_151550_a(par1World, Blocks.ladder, this.func_151555_a(Blocks.ladder, 4), 9, 3, 3, par3StructureBoundingBox); + this.placeBlockAtCurrentPosition(par1World, Blocks.ladder, this.getMetadataWithOffset(Blocks.ladder, 4), 9, 1, 3, par3StructureBoundingBox); + this.placeBlockAtCurrentPosition(par1World, Blocks.ladder, this.getMetadataWithOffset(Blocks.ladder, 4), 9, 2, 3, par3StructureBoundingBox); + this.placeBlockAtCurrentPosition(par1World, Blocks.ladder, this.getMetadataWithOffset(Blocks.ladder, 4), 9, 3, 3, par3StructureBoundingBox); - this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 4, 8, WeightedRandomChestContent.func_92080_a(strongholdRoomCrossingChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.func_92114_b(par2Random)}), 1 + par2Random.nextInt(4)); + this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 4, 8, ChestGenHooks.getItems(STRONGHOLD_CROSSING, par2Random), ChestGenHooks.getCount(STRONGHOLD_CROSSING, par2Random)); } diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch index ef9791dd55..a4f6c3efba 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch @@ -56,7 +56,7 @@ if (this.field_143014_b) { if (p_151557_1_ == Blocks.log || p_151557_1_ == Blocks.log2) -@@ -1286,7 +1298,7 @@ +@@ -1288,7 +1300,7 @@ if (par3StructureBoundingBox.isVecInside(j, i, k)) { this.hasMadeChest = true; @@ -65,7 +65,7 @@ } } -@@ -1331,6 +1343,7 @@ +@@ -1333,6 +1345,7 @@ public List field_74932_i = new ArrayList(); public List field_74930_j = new ArrayList(); private static final String __OBFID = "CL_00000527"; @@ -73,7 +73,7 @@ public Start() {} -@@ -1342,6 +1355,7 @@ +@@ -1344,6 +1357,7 @@ this.terrainType = par7; BiomeGenBase biomegenbase = par1WorldChunkManager.getBiomeGenAt(par4, par5); this.inDesert = biomegenbase == BiomeGenBase.desert || biomegenbase == BiomeGenBase.desertHills; diff --git a/src/main/java/ibxm/Channel.java b/src/main/java/ibxm/Channel.java index 65c1bd46a4..13e6d5d894 100644 --- a/src/main/java/ibxm/Channel.java +++ b/src/main/java/ibxm/Channel.java @@ -1,7 +1,6 @@ package ibxm; -@SuppressWarnings("unused") public class Channel { public int pattern_loop_row; diff --git a/src/main/java/ibxm/Envelope.java b/src/main/java/ibxm/Envelope.java index 35fe85af35..94b9c656f5 100644 --- a/src/main/java/ibxm/Envelope.java +++ b/src/main/java/ibxm/Envelope.java @@ -10,7 +10,6 @@ public class Envelope { set_num_points( 1 ); } - @SuppressWarnings("unused") public void set_num_points( int num_points ) { int point; if( num_points <= 0 ) { diff --git a/src/main/java/ibxm/FastTracker2.java b/src/main/java/ibxm/FastTracker2.java index f179cc627b..4f05cf7f72 100644 --- a/src/main/java/ibxm/FastTracker2.java +++ b/src/main/java/ibxm/FastTracker2.java @@ -69,7 +69,6 @@ public class FastTracker2 { return module; } - @SuppressWarnings("unused") private static Pattern read_xm_pattern( DataInput data_input, int num_channels ) throws IOException { int pattern_header_length, packing_type, num_rows, pattern_data_length; byte[] structure_header, pattern_header, pattern_data; diff --git a/src/main/java/ibxm/IBXM.java b/src/main/java/ibxm/IBXM.java index dc9fe1b0ba..f1c05f25e4 100644 --- a/src/main/java/ibxm/IBXM.java +++ b/src/main/java/ibxm/IBXM.java @@ -85,7 +85,6 @@ public class IBXM { clear_vol_ramp_buffer(); } - @SuppressWarnings("unused") public void seek( int sample_position ) { int idx; set_sequence_index( 0, 0 ); diff --git a/src/main/java/ibxm/ScreamTracker3.java b/src/main/java/ibxm/ScreamTracker3.java index d6fc3241b5..8aa4f804d3 100644 --- a/src/main/java/ibxm/ScreamTracker3.java +++ b/src/main/java/ibxm/ScreamTracker3.java @@ -57,7 +57,6 @@ public class ScreamTracker3 { return s3m_identifier.equals( "SCRM" ); } - @SuppressWarnings("unused") public static Module load_s3m( byte[] header_96_bytes, DataInput data_input ) throws IOException { int num_pattern_orders, num_instruments, num_patterns, num_channels; int flags, tracker_version, master_volume, panning, channel_config, sequence_length; diff --git a/src/main/java/net/minecraftforge/client/ClientCommandHandler.java b/src/main/java/net/minecraftforge/client/ClientCommandHandler.java index 6dadff99e4..95c2af0055 100644 --- a/src/main/java/net/minecraftforge/client/ClientCommandHandler.java +++ b/src/main/java/net/minecraftforge/client/ClientCommandHandler.java @@ -74,20 +74,20 @@ public class ClientCommandHandler extends CommandHandler } else { - sender.func_145747_a(format(RED, "commands.generic.permission")); + sender.addChatMessage(format(RED, "commands.generic.permission")); } } catch (WrongUsageException wue) { - sender.func_145747_a(format(RED, "commands.generic.usage", format(RED, wue.getMessage(), wue.getErrorOjbects()))); + sender.addChatMessage(format(RED, "commands.generic.usage", format(RED, wue.getMessage(), wue.getErrorOjbects()))); } catch (CommandException ce) { - sender.func_145747_a(format(RED, ce.getMessage(), ce.getErrorOjbects())); + sender.addChatMessage(format(RED, ce.getMessage(), ce.getErrorOjbects())); } catch (Throwable t) { - sender.func_145747_a(format(RED, "commands.generic.exception")); + sender.addChatMessage(format(RED, "commands.generic.exception")); t.printStackTrace(); } @@ -98,7 +98,7 @@ public class ClientCommandHandler extends CommandHandler private ChatComponentTranslation format(EnumChatFormatting color, String str, Object... args) { ChatComponentTranslation ret = new ChatComponentTranslation(str, args); - ret.func_150256_b().func_150238_a(color); + ret.getChatStyle().setColor(color); return ret; } diff --git a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java index 83f55a3256..e651cf28ad 100644 --- a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java +++ b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java @@ -90,12 +90,12 @@ public class ForgeHooksClient boolean is3D = customRenderer.shouldUseRenderHelper(ENTITY, item, BLOCK_3D); engine.bindTexture(item.getItemSpriteNumber() == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture); - Block block = item.getItem() instanceof ItemBlock ? Block.func_149634_a(item.getItem()) : null; - if (is3D || (block != null && RenderBlocks.func_147739_a(block.func_149645_b()))) + Block block = item.getItem() instanceof ItemBlock ? Block.getBlockFromItem(item.getItem()) : null; + if (is3D || (block != null && RenderBlocks.renderItemIn3d(block.getRenderType()))) { - int renderType = (block != null ? block.func_149645_b() : 1); + int renderType = (block != null ? block.getRenderType() : 1); float scale = (renderType == 1 || renderType == 19 || renderType == 12 || renderType == 2 ? 0.5F : 0.25F); - boolean blend = block != null && block.func_149701_w() > 0; + boolean blend = block != null && block.getRenderBlockPass() > 0; if (RenderItem.renderInFrame) { @@ -108,7 +108,7 @@ public class ForgeHooksClient { GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); GL11.glEnable(GL11.GL_BLEND); - OpenGlHelper.func_148821_a(770, 771, 1, 0); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); } GL11.glScalef(scale, scale, scale); @@ -169,9 +169,9 @@ public class ForgeHooksClient } GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F); - renderBlocks.field_147844_c = inColor; + renderBlocks.useInventoryTint = inColor; customRenderer.renderItem(INVENTORY, item, renderBlocks); - renderBlocks.field_147844_c = true; + renderBlocks.useInventoryTint = true; GL11.glPopMatrix(); } else @@ -233,7 +233,7 @@ public class ForgeHooksClient int x = MathHelper.floor_double(entity.posX); int y = MathHelper.floor_double(entity.posY); int z = MathHelper.floor_double(entity.posZ); - Block block = mc.theWorld.func_147439_a(x, y, z); + Block block = mc.theWorld.getBlock(x, y, z); if (block != null && block.isBed(mc.theWorld, x, y, z, entity)) { @@ -260,8 +260,8 @@ public class ForgeHooksClient { MinecraftForge.EVENT_BUS.post(new TextureStitchEvent.Post(map)); - FluidRegistry.WATER.setIcons(BlockLiquid.func_149803_e("water_still"), BlockLiquid.func_149803_e("water_flow")); - FluidRegistry.LAVA.setIcons(BlockLiquid.func_149803_e("lava_still"), BlockLiquid.func_149803_e("lava_flow")); + FluidRegistry.WATER.setIcons(BlockLiquid.getLiquidIcon("water_still"), BlockLiquid.getLiquidIcon("water_flow")); + FluidRegistry.LAVA.setIcons(BlockLiquid.getLiquidIcon("lava_still"), BlockLiquid.getLiquidIcon("lava_flow")); } /** @@ -280,7 +280,7 @@ public class ForgeHooksClient Minecraft mc = FMLClientHandler.instance().getClient(); if (mc.ingameGUI != null) { - mc.ingameGUI.func_146158_b().func_146227_a(new ChatComponentTranslation("forge.texture.preload.warning", texture)); + mc.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("forge.texture.preload.warning", texture)); } } } @@ -366,9 +366,9 @@ public class ForgeHooksClient GameSettings settings = Minecraft.getMinecraft().gameSettings; int[] ranges = ForgeModContainer.blendRanges; int distance = 0; - if (settings.fancyGraphics && settings.field_151451_c >= 0 && settings.field_151451_c < ranges.length) + if (settings.fancyGraphics && settings.renderDistanceChunks >= 0 && settings.renderDistanceChunks < ranges.length) { - distance = ranges[settings.field_151451_c]; + distance = ranges[settings.renderDistanceChunks]; } int r = 0; @@ -381,7 +381,7 @@ public class ForgeHooksClient for (int z = -distance; z <= distance; ++z) { BiomeGenBase biome = world.getBiomeGenForCoords(playerX + x, playerZ + z); - int colour = biome.getSkyColorByTemp(biome.func_150564_a(playerX + x, playerY, playerZ + z)); + int colour = biome.getSkyColorByTemp(biome.getFloatTemperature(playerX + x, playerY, playerZ + z)); r += (colour & 0xFF0000) >> 16; g += (colour & 0x00FF00) >> 8; b += colour & 0x0000FF; diff --git a/src/main/java/net/minecraftforge/client/GuiIngameForge.java b/src/main/java/net/minecraftforge/client/GuiIngameForge.java index 9b6e900612..df997ab1d0 100644 --- a/src/main/java/net/minecraftforge/client/GuiIngameForge.java +++ b/src/main/java/net/minecraftforge/client/GuiIngameForge.java @@ -111,7 +111,7 @@ public class GuiIngameForge extends GuiIngame } else { - OpenGlHelper.func_148821_a(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); } if (renderHelmet) renderHelmet(res, partialTicks, hasScreen, mouseX, mouseY); @@ -162,7 +162,7 @@ public class GuiIngameForge extends GuiIngame } GL11.glEnable(GL11.GL_BLEND); - OpenGlHelper.func_148821_a(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); GL11.glDisable(GL11.GL_ALPHA_TEST); renderChat(width, height); @@ -217,9 +217,9 @@ public class GuiIngameForge extends GuiIngame if (pre(CROSSHAIRS)) return; bind(Gui.icons); GL11.glEnable(GL11.GL_BLEND); - OpenGlHelper.func_148821_a(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0); + OpenGlHelper.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0); drawTexturedModalRect(width / 2 - 7, height / 2 - 7, 0, 0, 16, 16); - OpenGlHelper.func_148821_a(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); GL11.glDisable(GL11.GL_BLEND); post(CROSSHAIRS); } @@ -244,7 +244,7 @@ public class GuiIngameForge extends GuiIngame if (this.mc.gameSettings.thirdPersonView == 0 && itemstack != null && itemstack.getItem() != null) { - if (itemstack.getItem() == Item.func_150898_a(Blocks.pumpkin)) + if (itemstack.getItem() == Item.getItemFromBlock(Blocks.pumpkin)) { renderPumpkinBlur(res.getScaledWidth(), res.getScaledHeight()); } @@ -312,7 +312,7 @@ public class GuiIngameForge extends GuiIngame int left = width / 2 + 91; int top = height - right_height; - if (mc.thePlayer.isInsideOfMaterial(Material.field_151586_h)) + if (mc.thePlayer.isInsideOfMaterial(Material.water)) { int air = mc.thePlayer.getAir(); int full = MathHelper.ceiling_double_int((double)(air - 2) * 10.0D / 300.0D); @@ -499,7 +499,7 @@ public class GuiIngameForge extends GuiIngame if (pre(EXPERIENCE)) return; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - if (mc.playerController.func_78763_f()) + if (mc.playerController.gameIsSurvivalOrAdventure()) { mc.mcProfiler.startSection("expBar"); int cap = this.mc.thePlayer.xpBarCap(); @@ -521,7 +521,7 @@ public class GuiIngameForge extends GuiIngame this.mc.mcProfiler.endSection(); - if (mc.playerController.func_78763_f() && mc.thePlayer.experienceLevel > 0) + if (mc.playerController.gameIsSurvivalOrAdventure() && mc.thePlayer.experienceLevel > 0) { mc.mcProfiler.startSection("expLevel"); boolean flag1 = false; @@ -588,7 +588,7 @@ public class GuiIngameForge extends GuiIngame GL11.glPushMatrix(); GL11.glEnable(GL11.GL_BLEND); - OpenGlHelper.func_148821_a(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); FontRenderer font = highlightingItemStack.getItem().getFontRenderer(highlightingItemStack); if (font != null) { @@ -612,7 +612,7 @@ public class GuiIngameForge extends GuiIngame protected void renderHUDText(int width, int height) { mc.mcProfiler.startSection("forgeHudText"); - OpenGlHelper.func_148821_a(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); ArrayList left = new ArrayList(); ArrayList right = new ArrayList(); @@ -621,11 +621,11 @@ public class GuiIngameForge extends GuiIngame long time = mc.theWorld.getTotalWorldTime(); if (time >= 120500L) { - right.add(I18n.getStringParams("demo.demoExpired")); + right.add(I18n.format("demo.demoExpired")); } else { - right.add(I18n.getStringParams("demo.remainingTime", StringUtils.ticksToElapsedTime((int)(120500L - time)))); + right.add(I18n.format("demo.remainingTime", StringUtils.ticksToElapsedTime((int)(120500L - time)))); } } @@ -676,9 +676,9 @@ public class GuiIngameForge extends GuiIngame } left.add(String.format("ws: %.3f, fs: %.3f, g: %b, fl: %d", mc.thePlayer.capabilities.getWalkSpeed(), mc.thePlayer.capabilities.getFlySpeed(), mc.thePlayer.onGround, mc.theWorld.getHeightValue(x, z))); - if (mc.entityRenderer != null && mc.entityRenderer.func_147702_a()) + if (mc.entityRenderer != null && mc.entityRenderer.isShaderActive()) { - left.add(String.format("shader: %s", mc.entityRenderer.func_147706_e().func_148022_b())); + left.add(String.format("shader: %s", mc.entityRenderer.getShaderGroup().getShaderGroupName())); } right.add(null); @@ -727,7 +727,7 @@ public class GuiIngameForge extends GuiIngame GL11.glPushMatrix(); GL11.glTranslatef((float)(width / 2), (float)(height - 48), 0.0F); GL11.glEnable(GL11.GL_BLEND); - OpenGlHelper.func_148821_a(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); int color = (recordIsPlaying ? Color.HSBtoRGB(hue / 50.0F, 0.7F, 0.6F) & WHITE : WHITE); fontrenderer.drawString(recordPlaying, -fontrenderer.getStringWidth(recordPlaying) / 2, -4, color | (opacity << 24)); GL11.glDisable(GL11.GL_BLEND); @@ -747,7 +747,7 @@ public class GuiIngameForge extends GuiIngame GL11.glPushMatrix(); GL11.glTranslatef((float)event.posX, (float)event.posY, 0.0F); - persistantChatGUI.func_146230_a(updateCounter); + persistantChatGUI.drawChat(updateCounter); GL11.glPopMatrix(); post(CHAT); @@ -761,12 +761,12 @@ public class GuiIngameForge extends GuiIngame ScoreObjective scoreobjective = this.mc.theWorld.getScoreboard().func_96539_a(0); NetHandlerPlayClient handler = mc.thePlayer.sendQueue; - if (mc.gameSettings.keyBindPlayerList.func_151470_d() && (!mc.isIntegratedServerRunning() || handler.field_147303_b.size() > 1 || scoreobjective != null)) + if (mc.gameSettings.keyBindPlayerList.getIsKeyPressed() && (!mc.isIntegratedServerRunning() || handler.playerInfoList.size() > 1 || scoreobjective != null)) { if (pre(PLAYER_LIST)) return; this.mc.mcProfiler.startSection("playerList"); - List players = (List)handler.field_147303_b; - int maxPlayers = handler.field_147304_c; + List players = (List)handler.playerInfoList; + int maxPlayers = handler.currentServerMaxPlayers; int rows = maxPlayers; int columns = 1; diff --git a/src/main/java/net/minecraftforge/client/model/techne/TechneModel.java b/src/main/java/net/minecraftforge/client/model/techne/TechneModel.java index 4618d5a8b3..c4c227c6d6 100644 --- a/src/main/java/net/minecraftforge/client/model/techne/TechneModel.java +++ b/src/main/java/net/minecraftforge/client/model/techne/TechneModel.java @@ -37,7 +37,6 @@ import net.minecraftforge.client.model.ModelFormatException; /** * Techne model importer, based on iChun's Hats importer */ -@SuppressWarnings("unused") @SideOnly(Side.CLIENT) public class TechneModel extends ModelBase implements IModelCustom { public static final List cubeTypes = Arrays.asList( diff --git a/src/main/java/net/minecraftforge/common/BiomeDictionary.java b/src/main/java/net/minecraftforge/common/BiomeDictionary.java index 2f4e21dd24..a8b1ca2534 100644 --- a/src/main/java/net/minecraftforge/common/BiomeDictionary.java +++ b/src/main/java/net/minecraftforge/common/BiomeDictionary.java @@ -62,7 +62,7 @@ public class BiomeDictionary */ public static boolean registerBiomeType(BiomeGenBase biome, Type ... types) { - if(BiomeGenBase.func_150565_n()[biome.biomeID] != null) + if(BiomeGenBase.getBiomeGenArray()[biome.biomeID] != null) { for(Type type : types) { @@ -202,9 +202,9 @@ public class BiomeDictionary */ public static void registerAllBiomesAndGenerateEvents() { - for(int i = 0; i < BiomeGenBase.func_150565_n().length; i++) + for(int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++) { - BiomeGenBase biome = BiomeGenBase.func_150565_n()[i]; + BiomeGenBase biome = BiomeGenBase.getBiomeGenArray()[i]; if(biome == null) { @@ -243,25 +243,25 @@ public class BiomeDictionary BiomeDictionary.registerBiomeType(biome, FOREST); } } - else if(biome.maxHeight <= 0.3F && biome.maxHeight >= 0.0F) + else if(biome.heightVariation <= 0.3F && biome.heightVariation >= 0.0F) { - if(!biome.isHighHumidity() || biome.minHeight >= 0.0F) + if(!biome.isHighHumidity() || biome.rootHeight >= 0.0F) { BiomeDictionary.registerBiomeType(biome, PLAINS); } } - if(biome.isHighHumidity() && biome.minHeight < 0.0F && (biome.maxHeight <= 0.3F && biome.maxHeight >= 0.0F)) + if(biome.isHighHumidity() && biome.rootHeight < 0.0F && (biome.heightVariation <= 0.3F && biome.heightVariation >= 0.0F)) { BiomeDictionary.registerBiomeType(biome, SWAMP); } - if(biome.minHeight <= -0.5F) + if(biome.rootHeight <= -0.5F) { BiomeDictionary.registerBiomeType(biome, WATER); } - if(biome.maxHeight >= 1.5F) + if(biome.heightVariation >= 1.5F) { BiomeDictionary.registerBiomeType(biome, MOUNTAIN); } diff --git a/src/main/java/net/minecraftforge/common/ChestGenHooks.java b/src/main/java/net/minecraftforge/common/ChestGenHooks.java index 9ce74e8200..c14fb106a1 100644 --- a/src/main/java/net/minecraftforge/common/ChestGenHooks.java +++ b/src/main/java/net/minecraftforge/common/ChestGenHooks.java @@ -140,7 +140,6 @@ public class ChestGenHooks public static void removeItem(String category, ItemStack item){ getInfo(category).removeItem(item); } public static ItemStack getOneItem(String category, Random rand){ return getInfo(category).getOneItem(rand); } - @SuppressWarnings("unused") private String category; private int countMin = 0; private int countMax = 0; diff --git a/src/main/java/net/minecraftforge/common/DimensionManager.java b/src/main/java/net/minecraftforge/common/DimensionManager.java index 32134256f9..93dfadb278 100644 --- a/src/main/java/net/minecraftforge/common/DimensionManager.java +++ b/src/main/java/net/minecraftforge/common/DimensionManager.java @@ -193,7 +193,7 @@ public class DimensionManager worlds.put(id, world); weakWorldMap.put(world, world); MinecraftServer.getServer().worldTickTimes.put(id, new long[100]); - FMLLog.info("Loading dimension %d (%s) (%s)", id, world.getWorldInfo().getWorldName(), world.getMinecraftServer()); + FMLLog.info("Loading dimension %d (%s) (%s)", id, world.getWorldInfo().getWorldName(), world.func_73046_m()); } else { @@ -238,7 +238,7 @@ public class DimensionManager System.err.println("Cannot Hotload Dim: " + e.getMessage()); return; // If a provider hasn't been registered then we can't hotload the dim } - MinecraftServer mcServer = overworld.getMinecraftServer(); + MinecraftServer mcServer = overworld.func_73046_m(); ISaveHandler savehandler = overworld.getSaveHandler(); WorldSettings worldSettings = new WorldSettings(overworld.getWorldInfo()); diff --git a/src/main/java/net/minecraftforge/common/ForgeChunkManager.java b/src/main/java/net/minecraftforge/common/ForgeChunkManager.java index daf9698ee0..e782d088b7 100644 --- a/src/main/java/net/minecraftforge/common/ForgeChunkManager.java +++ b/src/main/java/net/minecraftforge/common/ForgeChunkManager.java @@ -369,7 +369,7 @@ public class ForgeChunkManager try { NBTTagCompound forcedChunkData = CompressedStreamTools.read(chunkLoaderData); - return forcedChunkData.func_150295_c("TicketList", 9).tagCount() > 0; + return forcedChunkData.getTagList("TicketList", 9).tagCount() > 0; } catch (IOException e) { @@ -409,10 +409,10 @@ public class ForgeChunkManager FMLLog.log(Level.WARN, e, "Unable to read forced chunk data at %s - it will be ignored", chunkLoaderData.getAbsolutePath()); return; } - NBTTagList ticketList = forcedChunkData.func_150295_c("TicketList", 9); + NBTTagList ticketList = forcedChunkData.getTagList("TicketList", 9); for (int i = 0; i < ticketList.tagCount(); i++) { - NBTTagCompound ticketHolder = (NBTTagCompound)ticketList.func_150305_b(i); + NBTTagCompound ticketHolder = (NBTTagCompound)ticketList.getCompoundTagAt(i); String modId = ticketHolder.getString("Owner"); boolean isPlayer = "Forge".equals(modId); @@ -428,10 +428,10 @@ public class ForgeChunkManager continue; } - NBTTagList tickets = ticketHolder.func_150295_c("Tickets", 9); + NBTTagList tickets = ticketHolder.getTagList("Tickets", 9); for (int j = 0; j < tickets.tagCount(); j++) { - NBTTagCompound ticket = (NBTTagCompound) tickets.func_150305_b(j); + NBTTagCompound ticket = (NBTTagCompound) tickets.getCompoundTagAt(j); modId = ticket.hasKey("ModId") ? ticket.getString("ModId") : modId; Type type = Type.values()[ticket.getByte("Type")]; //byte ticketChunkDepth = ticket.getByte("ChunkListDepth"); diff --git a/src/main/java/net/minecraftforge/common/ForgeHooks.java b/src/main/java/net/minecraftforge/common/ForgeHooks.java index 45b6d82ec0..d2a4bbe31a 100644 --- a/src/main/java/net/minecraftforge/common/ForgeHooks.java +++ b/src/main/java/net/minecraftforge/common/ForgeHooks.java @@ -75,7 +75,7 @@ public class ForgeHooks public static boolean canHarvestBlock(Block block, EntityPlayer player, int metadata) { - if (block.func_149688_o().isToolNotRequired()) + if (block.getMaterial().isToolNotRequired()) { return true; } @@ -84,13 +84,13 @@ public class ForgeHooks String tool = block.getHarvestTool(metadata); if (stack == null || tool == null) { - return player.func_146099_a(block); + return player.canHarvestBlock(block); } int toolLevel = stack.getItem().getHarvestLevel(stack, tool); if (toolLevel < 0) { - return player.func_146099_a(block); + return player.canHarvestBlock(block); } return toolLevel >= block.getHarvestLevel(metadata); @@ -106,7 +106,7 @@ public class ForgeHooks public static float blockStrength(Block block, EntityPlayer player, World world, int x, int y, int z) { int metadata = world.getBlockMetadata(x, y, z); - float hardness = block.func_149712_f(world, x, y, z); + float hardness = block.getBlockHardness(world, x, y, z); if (hardness < 0.0F) { return 0.0F; @@ -206,7 +206,7 @@ public class ForgeHooks int x = target.blockX; int y = target.blockY; int z = target.blockZ; - Block block = world.func_147439_a(x, y, z); + Block block = world.getBlock(x, y, z); if (block.isAir(world, x, y, z)) { @@ -314,7 +314,7 @@ public class ForgeHooks { for (int z2 = mZ; z2 < bb.maxZ; z2++) { - block = world.func_147439_a(x2, y2, z2); + block = world.getBlock(x2, y2, z2); if (block != null && block.isLadder(world, x2, y2, z2, entity)) { return true; @@ -355,12 +355,12 @@ public class ForgeHooks public static float getEnchantPower(World world, int x, int y, int z) { - return world.func_147439_a(x, y, z).getEnchantPowerBonus(world, x, y, z); + return world.getBlock(x, y, z).getEnchantPowerBonus(world, x, y, z); } public static ChatComponentTranslation onServerChatEvent(NetHandlerPlayServer net, String raw, ChatComponentTranslation comp) { - ServerChatEvent event = new ServerChatEvent(net.field_147369_b, raw, comp); + ServerChatEvent event = new ServerChatEvent(net.playerEntity, raw, comp); if (MinecraftForge.EVENT_BUS.post(event)) { return null; @@ -389,16 +389,16 @@ public class ForgeHooks } // Tell client the block is gone immediately then process events - if (world.func_147438_o(x, y, z) == null) + if (world.getTileEntity(x, y, z) == null) { S23PacketBlockChange packet = new S23PacketBlockChange(x, y, z, world); packet.field_148883_d = Blocks.air; packet.field_148884_e = 0; - entityPlayer.playerNetServerHandler.func_147359_a(packet); + entityPlayer.playerNetServerHandler.sendPacket(packet); } // Post the block break event - Block block = world.func_147439_a(x, y, z); + Block block = world.getBlock(x, y, z); int blockMetadata = world.getBlockMetadata(x, y, z); BlockEvent.BreakEvent event = new BlockEvent.BreakEvent(x, y, z, world, block, blockMetadata, entityPlayer); event.setCanceled(preCancelEvent); @@ -408,16 +408,16 @@ public class ForgeHooks if (event.isCanceled()) { // Let the client know the block still exists - entityPlayer.playerNetServerHandler.func_147359_a(new S23PacketBlockChange(x, y, z, world)); + entityPlayer.playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world)); // Update any tile entity data for this block - TileEntity tileentity = world.func_147438_o(x, y, z); + TileEntity tileentity = world.getTileEntity(x, y, z); if (tileentity != null) { - Packet pkt = tileentity.func_145844_m(); + Packet pkt = tileentity.getDescriptionPacket(); if (pkt != null) { - entityPlayer.playerNetServerHandler.func_147359_a(pkt); + entityPlayer.playerNetServerHandler.sendPacket(pkt); } } } diff --git a/src/main/java/net/minecraftforge/common/WorldSpecificSaveHandler.java b/src/main/java/net/minecraftforge/common/WorldSpecificSaveHandler.java index da9a72507a..aaf2256c79 100644 --- a/src/main/java/net/minecraftforge/common/WorldSpecificSaveHandler.java +++ b/src/main/java/net/minecraftforge/common/WorldSpecificSaveHandler.java @@ -15,7 +15,6 @@ import net.minecraft.world.WorldServer; public class WorldSpecificSaveHandler implements ISaveHandler { - @SuppressWarnings("unused") private WorldServer world; private ISaveHandler parent; private File dataDir; diff --git a/src/main/java/net/minecraftforge/common/config/Configuration.java b/src/main/java/net/minecraftforge/common/config/Configuration.java index 5e3abe48aa..de7f5f5e6f 100644 --- a/src/main/java/net/minecraftforge/common/config/Configuration.java +++ b/src/main/java/net/minecraftforge/common/config/Configuration.java @@ -688,7 +688,6 @@ public class Configuration public static class UnicodeInputStreamReader extends Reader { private final InputStreamReader input; - @SuppressWarnings("unused") private final String defaultEnc; public UnicodeInputStreamReader(InputStream source, String encoding) throws IOException diff --git a/src/main/java/net/minecraftforge/common/util/FakePlayer.java b/src/main/java/net/minecraftforge/common/util/FakePlayer.java index 38add8ec7d..8d956201e4 100644 --- a/src/main/java/net/minecraftforge/common/util/FakePlayer.java +++ b/src/main/java/net/minecraftforge/common/util/FakePlayer.java @@ -28,7 +28,7 @@ public class FakePlayer extends EntityPlayerMP return new ChunkCoordinates(0,0,0); } - @Override public void func_146105_b(IChatComponent chatmessagecomponent){} + @Override public void addChatComponentMessage(IChatComponent chatmessagecomponent){} @Override public void addStat(StatBase par1StatBase, int par2){} @Override public void openGui(Object mod, int modGuiId, World world, int x, int y, int z){} @Override public boolean isEntityInvulnerable(){ return true; } diff --git a/src/main/java/net/minecraftforge/event/ServerChatEvent.java b/src/main/java/net/minecraftforge/event/ServerChatEvent.java index db11e5f8ae..2444ee3d7a 100644 --- a/src/main/java/net/minecraftforge/event/ServerChatEvent.java +++ b/src/main/java/net/minecraftforge/event/ServerChatEvent.java @@ -16,7 +16,7 @@ public class ServerChatEvent extends Event super(); this.message = message; this.player = player; - this.username = player.func_146103_bH().getName(); + this.username = player.getGameProfile().getName(); this.component = component; } } diff --git a/src/main/java/net/minecraftforge/event/terraingen/DeferredBiomeDecorator.java b/src/main/java/net/minecraftforge/event/terraingen/DeferredBiomeDecorator.java index d8a6b3c1a7..9f6dfa0f07 100644 --- a/src/main/java/net/minecraftforge/event/terraingen/DeferredBiomeDecorator.java +++ b/src/main/java/net/minecraftforge/event/terraingen/DeferredBiomeDecorator.java @@ -16,11 +16,11 @@ public class DeferredBiomeDecorator extends BiomeDecorator { } @Override - public void func_150512_a(World par1World, Random par2Random, BiomeGenBase biome, int par3, int par4) + public void decorateChunk(World par1World, Random par2Random, BiomeGenBase biome, int par3, int par4) { fireCreateEventAndReplace(biome); // On first call to decorate, we fire and substitute ourselves, if we haven't already done so - biome.theBiomeDecorator.func_150512_a(par1World, par2Random, biome, par3, par4); + biome.theBiomeDecorator.decorateChunk(par1World, par2Random, biome, par3, par4); } public void fireCreateEventAndReplace(BiomeGenBase biome) { diff --git a/src/main/java/net/minecraftforge/event/world/BlockEvent.java b/src/main/java/net/minecraftforge/event/world/BlockEvent.java index 60b95b08c0..40c3b3ec83 100644 --- a/src/main/java/net/minecraftforge/event/world/BlockEvent.java +++ b/src/main/java/net/minecraftforge/event/world/BlockEvent.java @@ -80,7 +80,7 @@ public class BlockEvent extends Event { } else { - int meta = block.func_149643_k(world, x, y, z); + int meta = block.getDamageValue(world, x, y, z); int bonusLevel = EnchantmentHelper.getFortuneModifier(player); this.exp = block.getExpDrop(world, meta, bonusLevel); } diff --git a/src/main/java/net/minecraftforge/fluids/BlockFluidBase.java b/src/main/java/net/minecraftforge/fluids/BlockFluidBase.java index f5ed005340..333dc9c0b9 100644 --- a/src/main/java/net/minecraftforge/fluids/BlockFluidBase.java +++ b/src/main/java/net/minecraftforge/fluids/BlockFluidBase.java @@ -24,7 +24,6 @@ import net.minecraft.world.World; * @author King Lemming, OvermindDL1 * */ -@SuppressWarnings("unused") public abstract class BlockFluidBase extends Block implements IFluidBlock { protected final static Map defaultDisplacements = Maps.newHashMap(); @@ -54,9 +53,9 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock public BlockFluidBase(Fluid fluid, Material material) { super(material); - this.func_149676_a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - this.func_149675_a(true); - this.func_149649_H(); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + this.setTickRandomly(true); + this.disableStats(); this.fluidName = fluid.getName(); this.density = fluid.density; @@ -115,9 +114,9 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock */ public boolean canDisplace(IBlockAccess world, int x, int y, int z) { - if (world.func_147439_a(x, y, z).isAir(world, x, y, z)) return true; + if (world.getBlock(x, y, z).isAir(world, x, y, z)) return true; - Block block = world.func_147439_a(x, y, z); + Block block = world.getBlock(x, y, z); if (block == this) { @@ -129,8 +128,8 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock return displacements.get(block); } - Material material = block.func_149688_o(); - if (material.blocksMovement() || material == Material.field_151567_E) + Material material = block.getMaterial(); + if (material.blocksMovement() || material == Material.portal) { return false; } @@ -156,12 +155,12 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock */ public boolean displaceIfPossible(World world, int x, int y, int z) { - if (world.func_147439_a(x, y, z).isAir(world, x, y, z)) + if (world.getBlock(x, y, z).isAir(world, x, y, z)) { return true; } - Block block = world.func_147439_a(x, y, z); + Block block = world.getBlock(x, y, z); if (block == this) { return false; @@ -171,14 +170,14 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock { if (displacements.get(block)) { - block.func_149697_b(world, x, y, z, world.getBlockMetadata(x, y, z), 0); + block.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); return true; } return false; } - Material material = block.func_149688_o(); - if (material.blocksMovement() || material == Material.field_151567_E) + Material material = block.getMaterial(); + if (material.blocksMovement() || material == Material.portal) { return false; } @@ -186,7 +185,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock int density = getDensity(world, x, y, z); if (density == Integer.MAX_VALUE) { - block.func_149697_b(world, x, y, z, world.getBlockMetadata(x, y, z), 0); + block.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); return true; } @@ -203,21 +202,21 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock public abstract int getQuantaValue(IBlockAccess world, int x, int y, int z); @Override - public abstract boolean func_149678_a(int meta, boolean fullHit); + public abstract boolean canCollideCheck(int meta, boolean fullHit); public abstract int getMaxRenderHeightMeta(); /* BLOCK FUNCTIONS */ @Override - public void func_149726_b(World world, int x, int y, int z) + public void onBlockAdded(World world, int x, int y, int z) { - world.func_147464_a(x, y, z, this, tickRate); + world.scheduleBlockUpdate(x, y, z, this, tickRate); } @Override - public void func_149695_a(World world, int x, int y, int z, Block block) + public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { - world.func_147464_a(x, y, z, this, tickRate); + world.scheduleBlockUpdate(x, y, z, this, tickRate); } // Used to prevent updates on chunk generation @@ -228,37 +227,37 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock } @Override - public boolean func_149655_b(IBlockAccess world, int x, int y, int z) + public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z) { return true; } @Override - public AxisAlignedBB func_149668_a(World world, int x, int y, int z) + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { return null; } @Override - public Item func_149650_a(int par1, Random par2Random, int par3) + public Item getItemDropped(int par1, Random par2Random, int par3) { return null; } @Override - public int func_149745_a(Random par1Random) + public int quantityDropped(Random par1Random) { return 0; } @Override - public int func_149738_a(World world) + public int tickRate(World world) { return tickRate; } @Override - public void func_149640_a(World world, int x, int y, int z, Entity entity, Vec3 vec) + public void velocityToAddToEntity(World world, int x, int y, int z, Entity entity, Vec3 vec) { if (densityDir > 0) return; Vec3 vec_flow = this.getFlowVector(world, x, y, z); @@ -279,19 +278,19 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock } @Override - public int func_149645_b() + public int getRenderType() { return FluidRegistry.renderIdFluid; } @Override - public boolean func_149662_c() + public boolean isOpaqueCube() { return false; } @Override - public boolean func_149686_d() + public boolean renderAsNormalBlock() { return false; } @@ -307,7 +306,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock */ @Override - public int func_149677_c(IBlockAccess world, int x, int y, int z) + public int getMixedBrightnessForBlock(IBlockAccess world, int x, int y, int z) { int lightThis = world.getLightBrightnessForSkyBlocks(x, y, z, 0); int lightUp = world.getLightBrightnessForSkyBlocks(x, y + 1, z, 0); @@ -320,26 +319,26 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock } @Override - public int func_149701_w() + public int getRenderBlockPass() { return renderPass; } @Override - public boolean func_149646_a(IBlockAccess world, int x, int y, int z, int side) + public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) { - Block block = world.func_147439_a(x, y, z); + Block block = world.getBlock(x, y, z); if (block != this) { - return !block.func_149662_c(); + return !block.isOpaqueCube(); } - return block.func_149688_o() == this.func_149688_o() ? false : super.func_149646_a(world, x, y, z, side); + return block.getMaterial() == this.getMaterial() ? false : super.shouldSideBeRendered(world, x, y, z, side); } /* FLUID FUNCTIONS */ public static final int getDensity(IBlockAccess world, int x, int y, int z) { - Block block = world.func_147439_a(x, y, z); + Block block = world.getBlock(x, y, z); if (!(block instanceof BlockFluidBase)) { return Integer.MAX_VALUE; @@ -349,7 +348,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock public static final int getTemperature(IBlockAccess world, int x, int y, int z) { - Block block = world.func_147439_a(x, y, z); + Block block = world.getBlock(x, y, z); if (!(block instanceof BlockFluidBase)) { return Integer.MAX_VALUE; @@ -359,8 +358,8 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock public static double getFlowDirection(IBlockAccess world, int x, int y, int z) { - Block block = world.func_147439_a(x, y, z); - if (!block.func_149688_o().isLiquid()) + Block block = world.getBlock(x, y, z); + if (!block.getMaterial().isLiquid()) { return -1000.0; } @@ -415,7 +414,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock int otherDecay = quantaPerBlock - getQuantaValue(world, x2, y, z2); if (otherDecay >= quantaPerBlock) { - if (!world.func_147439_a(x2, y, z2).func_149688_o().blocksMovement()) + if (!world.getBlock(x2, y, z2).getMaterial().blocksMovement()) { otherDecay = quantaPerBlock - getQuantaValue(world, x2, y - 1, z2); if (otherDecay >= 0) @@ -432,17 +431,17 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock } } - if (world.func_147439_a(x, y + 1, z) == this) + if (world.getBlock(x, y + 1, z) == this) { boolean flag = - func_149747_d(world, x, y, z - 1, 2) || - func_149747_d(world, x, y, z + 1, 3) || - func_149747_d(world, x - 1, y, z, 4) || - func_149747_d(world, x + 1, y, z, 5) || - func_149747_d(world, x, y + 1, z - 1, 2) || - func_149747_d(world, x, y + 1, z + 1, 3) || - func_149747_d(world, x - 1, y + 1, z, 4) || - func_149747_d(world, x + 1, y + 1, z, 5); + isBlockSolid(world, x, y, z - 1, 2) || + isBlockSolid(world, x, y, z + 1, 3) || + isBlockSolid(world, x - 1, y, z, 4) || + isBlockSolid(world, x + 1, y, z, 5) || + isBlockSolid(world, x, y + 1, z - 1, 2) || + isBlockSolid(world, x, y + 1, z + 1, 3) || + isBlockSolid(world, x - 1, y + 1, z, 4) || + isBlockSolid(world, x + 1, y + 1, z, 5); if (flag) { diff --git a/src/main/java/net/minecraftforge/fluids/BlockFluidClassic.java b/src/main/java/net/minecraftforge/fluids/BlockFluidClassic.java index fedf3c2f9e..76dc5ca8c5 100644 --- a/src/main/java/net/minecraftforge/fluids/BlockFluidClassic.java +++ b/src/main/java/net/minecraftforge/fluids/BlockFluidClassic.java @@ -43,12 +43,12 @@ public class BlockFluidClassic extends BlockFluidBase @Override public int getQuantaValue(IBlockAccess world, int x, int y, int z) { - if (world.func_147439_a(x, y, z) == Blocks.air) + if (world.getBlock(x, y, z) == Blocks.air) { return 0; } - if (world.func_147439_a(x, y, z) != this) + if (world.getBlock(x, y, z) != this) { return -1; } @@ -58,7 +58,7 @@ public class BlockFluidClassic extends BlockFluidBase } @Override - public boolean func_149678_a(int meta, boolean fullHit) + public boolean canCollideCheck(int meta, boolean fullHit) { return fullHit && meta == 0; } @@ -81,7 +81,7 @@ public class BlockFluidClassic extends BlockFluidBase } @Override - public void func_149674_a(World world, int x, int y, int z, Random rand) + public void updateTick(World world, int x, int y, int z, Random rand) { int quantaRemaining = quantaPerBlock - world.getBlockMetadata(x, y, z); int expQuanta = -101; @@ -91,11 +91,11 @@ public class BlockFluidClassic extends BlockFluidBase { int y2 = y - densityDir; - if (world.func_147439_a(x, y2, z ) == this || - world.func_147439_a(x - 1, y2, z ) == this || - world.func_147439_a(x + 1, y2, z ) == this || - world.func_147439_a(x, y2, z - 1) == this || - world.func_147439_a(x, y2, z + 1) == this) + if (world.getBlock(x, y2, z ) == this || + world.getBlock(x - 1, y2, z ) == this || + world.getBlock(x + 1, y2, z ) == this || + world.getBlock(x, y2, z - 1) == this || + world.getBlock(x, y2, z + 1) == this) { expQuanta = quantaPerBlock - 1; } @@ -117,13 +117,13 @@ public class BlockFluidClassic extends BlockFluidBase if (expQuanta <= 0) { - world.func_147449_b(x, y, z, Blocks.air); + world.setBlock(x, y, z, Blocks.air); } else { world.setBlockMetadataWithNotify(x, y, z, quantaPerBlock - expQuanta, 3); - world.func_147464_a(x, y, z, this, tickRate); - world.func_147459_d(x, y, z, this); + world.scheduleBlockUpdate(x, y, z, this, tickRate); + world.notifyBlocksOfNeighborChange(x, y, z, this); } } } @@ -149,7 +149,7 @@ public class BlockFluidClassic extends BlockFluidBase if (isSourceBlock(world, x, y, z) || !isFlowingVertically(world, x, y, z)) { - if (world.func_147439_a(x, y - densityDir, z) == this) + if (world.getBlock(x, y - densityDir, z) == this) { flowMeta = 1; } @@ -164,13 +164,13 @@ public class BlockFluidClassic extends BlockFluidBase public boolean isFlowingVertically(IBlockAccess world, int x, int y, int z) { - return world.func_147439_a(x, y + densityDir, z) == this || - (world.func_147439_a(x, y, z) == this && canFlowInto(world, x, y + densityDir, z)); + return world.getBlock(x, y + densityDir, z) == this || + (world.getBlock(x, y, z) == this && canFlowInto(world, x, y + densityDir, z)); } public boolean isSourceBlock(IBlockAccess world, int x, int y, int z) { - return world.func_147439_a(x, y, z) == this && world.getBlockMetadata(x, y, z) == 0; + return world.getBlock(x, y, z) == this && world.getBlockMetadata(x, y, z) == 0; } protected boolean[] getOptimalFlowDirections(World world, int x, int y, int z) @@ -275,15 +275,15 @@ public class BlockFluidClassic extends BlockFluidBase if (meta < 0) return; if (displaceIfPossible(world, x, y, z)) { - world.func_147465_d(x, y, z, this, meta, 3); + world.setBlock(x, y, z, this, meta, 3); } } protected boolean canFlowInto(IBlockAccess world, int x, int y, int z) { - if (world.func_147439_a(x, y, z).isAir(world, x, y, z)) return true; + if (world.getBlock(x, y, z).isAir(world, x, y, z)) return true; - Block block = world.func_147439_a(x, y, z); + Block block = world.getBlock(x, y, z); if (block == this) { return true; @@ -294,11 +294,11 @@ public class BlockFluidClassic extends BlockFluidBase return displacements.get(block); } - Material material = block.func_149688_o(); + Material material = block.getMaterial(); if (material.blocksMovement() || - material == Material.field_151586_h || - material == Material.field_151587_i || - material == Material.field_151567_E) + material == Material.water || + material == Material.lava || + material == Material.portal) { return false; } @@ -340,7 +340,7 @@ public class BlockFluidClassic extends BlockFluidBase if (doDrain) { - world.func_147449_b(x, y, z, Blocks.air); + world.setBlock(x, y, z, Blocks.air); } return stack.copy(); diff --git a/src/main/java/net/minecraftforge/fluids/BlockFluidFinite.java b/src/main/java/net/minecraftforge/fluids/BlockFluidFinite.java index 92fbf95533..7731f5b795 100644 --- a/src/main/java/net/minecraftforge/fluids/BlockFluidFinite.java +++ b/src/main/java/net/minecraftforge/fluids/BlockFluidFinite.java @@ -26,12 +26,12 @@ public class BlockFluidFinite extends BlockFluidBase @Override public int getQuantaValue(IBlockAccess world, int x, int y, int z) { - if (world.func_147439_a(x, y, z).isAir(world, x, y, z)) + if (world.getBlock(x, y, z).isAir(world, x, y, z)) { return 0; } - if (world.func_147439_a(x, y, z) != this) + if (world.getBlock(x, y, z) != this) { return -1; } @@ -41,7 +41,7 @@ public class BlockFluidFinite extends BlockFluidBase } @Override - public boolean func_149678_a(int meta, boolean fullHit) + public boolean canCollideCheck(int meta, boolean fullHit) { return fullHit && meta == quantaPerBlock - 1; } @@ -53,7 +53,7 @@ public class BlockFluidFinite extends BlockFluidBase } @Override - public void func_149674_a(World world, int x, int y, int z, Random rand) + public void updateTick(World world, int x, int y, int z, Random rand) { boolean changed = false; int quantaRemaining = world.getBlockMetadata(x, y, z) + 1; @@ -82,10 +82,10 @@ public class BlockFluidFinite extends BlockFluidBase // Flow out if possible int lowerthan = quantaRemaining - 1; - if (displaceIfPossible(world, x, y, z - 1)) world.func_147449_b(x, y, z - 1, Blocks.air); - if (displaceIfPossible(world, x, y, z + 1)) world.func_147449_b(x, y, z + 1, Blocks.air); - if (displaceIfPossible(world, x - 1, y, z )) world.func_147449_b(x - 1, y, z, Blocks.air); - if (displaceIfPossible(world, x + 1, y, z )) world.func_147449_b(x + 1, y, z, Blocks.air); + if (displaceIfPossible(world, x, y, z - 1)) world.setBlock(x, y, z - 1, Blocks.air); + if (displaceIfPossible(world, x, y, z + 1)) world.setBlock(x, y, z + 1, Blocks.air); + if (displaceIfPossible(world, x - 1, y, z )) world.setBlock(x - 1, y, z, Blocks.air); + if (displaceIfPossible(world, x + 1, y, z )) world.setBlock(x + 1, y, z, Blocks.air); int north = getQuantaValueBelow(world, x, y, z - 1, lowerthan); int south = getQuantaValueBelow(world, x, y, z + 1, lowerthan); int west = getQuantaValueBelow(world, x - 1, y, z, lowerthan); @@ -141,13 +141,13 @@ public class BlockFluidFinite extends BlockFluidBase { if (newnorth == 0) { - world.func_147449_b(x, y, z - 1, Blocks.air); + world.setBlock(x, y, z - 1, Blocks.air); } else { - world.func_147465_d(x, y, z - 1, this, newnorth - 1, 2); + world.setBlock(x, y, z - 1, this, newnorth - 1, 2); } - world.func_147464_a(x, y, z - 1, this, tickRate); + world.scheduleBlockUpdate(x, y, z - 1, this, tickRate); } --count; } @@ -165,13 +165,13 @@ public class BlockFluidFinite extends BlockFluidBase { if (newsouth == 0) { - world.func_147449_b(x, y, z + 1, Blocks.air); + world.setBlock(x, y, z + 1, Blocks.air); } else { - world.func_147465_d(x, y, z + 1, this, newsouth - 1, 2); + world.setBlock(x, y, z + 1, this, newsouth - 1, 2); } - world.func_147464_a(x, y, z + 1, this, tickRate); + world.scheduleBlockUpdate(x, y, z + 1, this, tickRate); } --count; } @@ -188,13 +188,13 @@ public class BlockFluidFinite extends BlockFluidBase { if (newwest == 0) { - world.func_147449_b(x - 1, y, z, Blocks.air); + world.setBlock(x - 1, y, z, Blocks.air); } else { - world.func_147465_d(x - 1, y, z, this, newwest - 1, 2); + world.setBlock(x - 1, y, z, this, newwest - 1, 2); } - world.func_147464_a(x - 1, y, z, this, tickRate); + world.scheduleBlockUpdate(x - 1, y, z, this, tickRate); } --count; } @@ -212,13 +212,13 @@ public class BlockFluidFinite extends BlockFluidBase { if (neweast == 0) { - world.func_147449_b(x + 1, y, z, Blocks.air); + world.setBlock(x + 1, y, z, Blocks.air); } else { - world.func_147465_d(x + 1, y, z, this, neweast - 1, 2); + world.setBlock(x + 1, y, z, this, neweast - 1, 2); } - world.func_147464_a(x + 1, y, z, this, tickRate); + world.scheduleBlockUpdate(x + 1, y, z, this, tickRate); } --count; } @@ -235,7 +235,7 @@ public class BlockFluidFinite extends BlockFluidBase int otherY = y + densityDir; if (otherY < 0 || otherY >= world.getHeight()) { - world.func_147449_b(x, y, z, Blocks.air); + world.setBlock(x, y, z, Blocks.air); return 0; } @@ -245,15 +245,15 @@ public class BlockFluidFinite extends BlockFluidBase amt += amtToInput; if (amt > quantaPerBlock) { - world.func_147465_d(x, otherY, z, this, quantaPerBlock - 1, 3); - world.func_147464_a(x, otherY, z, this, tickRate); + world.setBlock(x, otherY, z, this, quantaPerBlock - 1, 3); + world.scheduleBlockUpdate(x, otherY, z, this, tickRate); return amt - quantaPerBlock; } else if (amt > 0) { - world.func_147465_d(x, otherY, z, this, amt - 1, 3); - world.func_147464_a(x, otherY, z, this, tickRate); - world.func_147449_b(x, y, z, Blocks.air); + world.setBlock(x, otherY, z, this, amt - 1, 3); + world.scheduleBlockUpdate(x, otherY, z, this, tickRate); + world.setBlock(x, y, z, Blocks.air); return 0; } return amtToInput; @@ -265,9 +265,9 @@ public class BlockFluidFinite extends BlockFluidBase { if (displaceIfPossible(world, x, otherY, z)) { - world.func_147465_d(x, otherY, z, this, amtToInput - 1, 3); - world.func_147464_a(x, otherY, z, this, tickRate); - world.func_147449_b(x, y, z, Blocks.air); + world.setBlock(x, otherY, z, this, amtToInput - 1, 3); + world.scheduleBlockUpdate(x, otherY, z, this, tickRate); + world.setBlock(x, y, z, Blocks.air); return 0; } else @@ -280,12 +280,12 @@ public class BlockFluidFinite extends BlockFluidBase { if (density_other < density) // then swap { - BlockFluidBase block = (BlockFluidBase)world.func_147439_a(x, otherY, z); + BlockFluidBase block = (BlockFluidBase)world.getBlock(x, otherY, z); int otherData = world.getBlockMetadata(x, otherY, z); - world.func_147465_d(x, otherY, z, this, amtToInput - 1, 3); - world.func_147465_d(x, y, z, block, otherData, 3); - world.func_147464_a(x, otherY, z, this, tickRate); - world.func_147464_a(x, y, z, block, block.func_149738_a(world)); + world.setBlock(x, otherY, z, this, amtToInput - 1, 3); + world.setBlock(x, y, z, block, otherData, 3); + world.scheduleBlockUpdate(x, otherY, z, this, tickRate); + world.scheduleBlockUpdate(x, y, z, block, block.tickRate(world)); return 0; } } @@ -293,12 +293,12 @@ public class BlockFluidFinite extends BlockFluidBase { if (density_other > density) { - BlockFluidBase block = (BlockFluidBase)world.func_147439_a(x, otherY, z); + BlockFluidBase block = (BlockFluidBase)world.getBlock(x, otherY, z); int otherData = world.getBlockMetadata(x, otherY, z); - world.func_147465_d(x, otherY, z, this, amtToInput - 1, 3); - world.func_147465_d(x, y, z, block, otherData, 3); - world.func_147464_a(x, otherY, z, this, tickRate); - world.func_147464_a(x, y, z, block, block.func_149738_a(world)); + world.setBlock(x, otherY, z, this, amtToInput - 1, 3); + world.setBlock(x, y, z, block, otherData, 3); + world.scheduleBlockUpdate(x, otherY, z, this, tickRate); + world.scheduleBlockUpdate(x, y, z, block, block.tickRate(world)); return 0; } } diff --git a/src/main/java/net/minecraftforge/fluids/FluidContainerRegistry.java b/src/main/java/net/minecraftforge/fluids/FluidContainerRegistry.java index 4eec8b979d..c3a3a8189e 100644 --- a/src/main/java/net/minecraftforge/fluids/FluidContainerRegistry.java +++ b/src/main/java/net/minecraftforge/fluids/FluidContainerRegistry.java @@ -26,7 +26,6 @@ import net.minecraftforge.common.MinecraftForge; * @author King Lemming * */ -@SuppressWarnings("unused") public abstract class FluidContainerRegistry { // Holder object that implements HashCode for an ItemStack, diff --git a/src/main/java/net/minecraftforge/fluids/FluidRegistry.java b/src/main/java/net/minecraftforge/fluids/FluidRegistry.java index f66135cfb6..b3a7e1691a 100644 --- a/src/main/java/net/minecraftforge/fluids/FluidRegistry.java +++ b/src/main/java/net/minecraftforge/fluids/FluidRegistry.java @@ -34,14 +34,14 @@ public abstract class FluidRegistry public String getLocalizedName() { return StatCollector.translateToLocal("tile.water.name"); } - }.setBlock(Blocks.water).setUnlocalizedName(Blocks.water.func_149739_a()); + }.setBlock(Blocks.water).setUnlocalizedName(Blocks.water.getUnlocalizedName()); public static final Fluid LAVA = new Fluid("lava") { @Override public String getLocalizedName() { return StatCollector.translateToLocal("tile.lava.name"); } - }.setBlock(Blocks.lava).setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300).setUnlocalizedName(Blocks.lava.func_149739_a()); + }.setBlock(Blocks.lava).setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300).setUnlocalizedName(Blocks.lava.getUnlocalizedName()); public static int renderIdFluid = -1; diff --git a/src/main/java/net/minecraftforge/fluids/FluidTank.java b/src/main/java/net/minecraftforge/fluids/FluidTank.java index ca5a5c19f9..c4d3259529 100644 --- a/src/main/java/net/minecraftforge/fluids/FluidTank.java +++ b/src/main/java/net/minecraftforge/fluids/FluidTank.java @@ -127,7 +127,7 @@ public class FluidTank implements IFluidTank if (tile != null) { - FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.func_145831_w(), tile.field_145851_c, tile.field_145848_d, tile.field_145849_e, this)); + FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this)); } return fluid.amount; } @@ -150,7 +150,7 @@ public class FluidTank implements IFluidTank if (tile != null) { - FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.func_145831_w(), tile.field_145851_c, tile.field_145848_d, tile.field_145849_e, this)); + FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this)); } return filled; } @@ -180,7 +180,7 @@ public class FluidTank implements IFluidTank if (tile != null) { - FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluid, tile.func_145831_w(), tile.field_145851_c, tile.field_145848_d, tile.field_145849_e, this)); + FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluid, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this)); } } return stack; diff --git a/src/main/java/net/minecraftforge/fluids/RenderBlockFluid.java b/src/main/java/net/minecraftforge/fluids/RenderBlockFluid.java index a1783d5a6c..93590ba779 100644 --- a/src/main/java/net/minecraftforge/fluids/RenderBlockFluid.java +++ b/src/main/java/net/minecraftforge/fluids/RenderBlockFluid.java @@ -55,9 +55,9 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler public float getFluidHeightForRender(IBlockAccess world, int x, int y, int z, BlockFluidBase block) { - if (world.func_147439_a(x, y, z) == block) + if (world.getBlock(x, y, z) == block) { - if (world.func_147439_a(x, y - block.densityDir, z).func_149688_o().isLiquid()) + if (world.getBlock(x, y - block.densityDir, z).getMaterial().isLiquid()) { return 1; } @@ -67,7 +67,7 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler return 0.875F; } } - return !world.func_147439_a(x, y, z).func_149688_o().isSolid() && world.func_147439_a(x, y - block.densityDir, z) == block ? 1 : block.getQuantaPercentage(world, x, y, z) * 0.875F; + return !world.getBlock(x, y, z).getMaterial().isSolid() && world.getBlock(x, y - block.densityDir, z) == block ? 1 : block.getQuantaPercentage(world, x, y, z) * 0.875F; } /* ISimpleBlockRenderingHandler */ @@ -83,7 +83,7 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler } Tessellator tessellator = Tessellator.instance; - int color = block.func_149720_d(world, x, y, z); + int color = block.colorMultiplier(world, x, y, z); float red = (color >> 16 & 255) / 255.0F; float green = (color >> 8 & 255) / 255.0F; float blue = (color & 255) / 255.0F; @@ -91,16 +91,16 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler BlockFluidBase theFluid = (BlockFluidBase) block; int bMeta = world.getBlockMetadata(x, y, z); - boolean renderTop = world.func_147439_a(x, y - theFluid.densityDir, z) != theFluid; + boolean renderTop = world.getBlock(x, y - theFluid.densityDir, z) != theFluid; - boolean renderBottom = block.func_149646_a(world, x, y + theFluid.densityDir, z, 0) && world.func_147439_a(x, y + theFluid.densityDir, z) != theFluid; + boolean renderBottom = block.shouldSideBeRendered(world, x, y + theFluid.densityDir, z, 0) && world.getBlock(x, y + theFluid.densityDir, z) != theFluid; boolean[] renderSides = new boolean[] { - block.func_149646_a(world, x, y, z - 1, 2), - block.func_149646_a(world, x, y, z + 1, 3), - block.func_149646_a(world, x - 1, y, z, 4), - block.func_149646_a(world, x + 1, y, z, 5) + block.shouldSideBeRendered(world, x, y, z - 1, 2), + block.shouldSideBeRendered(world, x, y, z + 1, 3), + block.shouldSideBeRendered(world, x - 1, y, z, 4), + block.shouldSideBeRendered(world, x + 1, y, z, 5) }; if (!renderTop && !renderBottom && !renderSides[0] && !renderSides[1] && !renderSides[2] && !renderSides[3]) @@ -138,15 +138,15 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler } boolean rises = theFluid.densityDir == 1; - if (renderer.field_147837_f || renderTop) + if (renderer.renderAllFaces || renderTop) { rendered = true; - IIcon iconStill = getIcon(block.func_149691_a(1, bMeta)); + IIcon iconStill = getIcon(block.getIcon(1, bMeta)); float flowDir = (float) BlockFluidBase.getFlowDirection(world, x, y, z); if (flowDir > -999.0F) { - iconStill = getIcon(block.func_149691_a(2, bMeta)); + iconStill = getIcon(block.getIcon(2, bMeta)); } heightNW -= RENDER_OFFSET; @@ -181,7 +181,7 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler v3 = iconStill.getInterpolatedV(8.0F + (-zFlow - xFlow) * 16.0F); } - tessellator.setBrightness(block.func_149677_c(world, x, y, z)); + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); tessellator.setColorOpaque_F(LIGHT_Y_POS * red, LIGHT_Y_POS * green, LIGHT_Y_POS * blue); if (!rises) @@ -200,19 +200,19 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler } } - if (renderer.field_147837_f || renderBottom) + if (renderer.renderAllFaces || renderBottom) { rendered = true; - tessellator.setBrightness(block.func_149677_c(world, x, y - 1, z)); + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y - 1, z)); if (!rises) { tessellator.setColorOpaque_F(LIGHT_Y_NEG * red, LIGHT_Y_NEG * green, LIGHT_Y_NEG * blue); - renderer.func_147768_a(block, x, y + RENDER_OFFSET, z, getIcon(block.func_149691_a(0, bMeta))); + renderer.renderFaceYNeg(block, x, y + RENDER_OFFSET, z, getIcon(block.getIcon(0, bMeta))); } else { tessellator.setColorOpaque_F(LIGHT_Y_POS * red, LIGHT_Y_POS * green, LIGHT_Y_POS * blue); - renderer.func_147806_b(block, x, y + RENDER_OFFSET, z, getIcon(block.func_149691_a(1, bMeta))); + renderer.renderFaceYPos(block, x, y + RENDER_OFFSET, z, getIcon(block.getIcon(1, bMeta))); } } @@ -229,8 +229,8 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler case 3: ++x2; break; } - IIcon iconFlow = getIcon(block.func_149691_a(side + 2, bMeta)); - if (renderer.field_147837_f || renderSides[side]) + IIcon iconFlow = getIcon(block.getIcon(side + 2, bMeta)); + if (renderer.renderAllFaces || renderSides[side]) { rendered = true; @@ -283,7 +283,7 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler float v1Flow = iconFlow.getInterpolatedV((1.0D - ty1) * 16.0D * 0.5D); float v2Flow = iconFlow.getInterpolatedV((1.0D - ty2) * 16.0D * 0.5D); float v3Flow = iconFlow.getInterpolatedV(8.0D); - tessellator.setBrightness(block.func_149677_c(world, x2, y, z2)); + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x2, y, z2)); float sideLighting = 1.0F; if (side < 2) @@ -313,8 +313,8 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler } } } - renderer.field_147855_j = 0; - renderer.field_147857_k = 1; + renderer.renderMinY = 0; + renderer.renderMaxY = 1; return rendered; } } diff --git a/src/main/java/net/minecraftforge/fluids/TileFluidHandler.java b/src/main/java/net/minecraftforge/fluids/TileFluidHandler.java index a457df5386..5388666569 100644 --- a/src/main/java/net/minecraftforge/fluids/TileFluidHandler.java +++ b/src/main/java/net/minecraftforge/fluids/TileFluidHandler.java @@ -16,16 +16,16 @@ public class TileFluidHandler extends TileEntity implements IFluidHandler protected FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME); @Override - public void func_145839_a(NBTTagCompound tag) + public void readFromNBT(NBTTagCompound tag) { - super.func_145839_a(tag); + super.readFromNBT(tag); tank.readFromNBT(tag); } @Override - public void func_145841_b(NBTTagCompound tag) + public void writeToNBT(NBTTagCompound tag) { - super.func_145841_b(tag); + super.writeToNBT(tag); tank.writeToNBT(tag); } diff --git a/src/main/java/net/minecraftforge/server/ForgeTimeTracker.java b/src/main/java/net/minecraftforge/server/ForgeTimeTracker.java index ed698b6e58..e6357b0a7d 100644 --- a/src/main/java/net/minecraftforge/server/ForgeTimeTracker.java +++ b/src/main/java/net/minecraftforge/server/ForgeTimeTracker.java @@ -18,13 +18,11 @@ public class ForgeTimeTracker { public static long tileEntityTrackingTime; private Map tileEntityTimings; - @SuppressWarnings("unused") private Map entityTimings; private static final ForgeTimeTracker INSTANCE = new ForgeTimeTracker(); private WeakReference tile; - @SuppressWarnings("unused") private WeakReference entity; private long timing; diff --git a/src/main/java/net/minecraftforge/server/command/ForgeCommand.java b/src/main/java/net/minecraftforge/server/command/ForgeCommand.java index 29af302d40..c71d17237c 100644 --- a/src/main/java/net/minecraftforge/server/command/ForgeCommand.java +++ b/src/main/java/net/minecraftforge/server/command/ForgeCommand.java @@ -88,7 +88,7 @@ public class ForgeCommand extends CommandBase { { ForgeTimeTracker.tileEntityTrackingDuration = duration; ForgeTimeTracker.tileEntityTracking = true; - sender.func_145747_a(new ChatComponentTranslation("commands.forge.tracking.te.enabled", duration)); + sender.addChatMessage(new ChatComponentTranslation("commands.forge.tracking.te.enabled", duration)); } private void doTPSLog(ICommandSender sender, String[] args) @@ -111,17 +111,17 @@ public class ForgeCommand extends CommandBase { { double worldTickTime = ForgeCommand.mean(this.server.worldTickTimes.get(dimId)) * 1.0E-6D; double worldTPS = Math.min(1000.0/worldTickTime, 20); - sender.func_145747_a(new ChatComponentTranslation("commands.forge.tps.summary",String.format("Dim %d", dimId), timeFormatter.format(worldTickTime), timeFormatter.format(worldTPS))); + sender.addChatMessage(new ChatComponentTranslation("commands.forge.tps.summary",String.format("Dim %d", dimId), timeFormatter.format(worldTickTime), timeFormatter.format(worldTPS))); } double meanTickTime = ForgeCommand.mean(this.server.tickTimeArray) * 1.0E-6D; double meanTPS = Math.min(1000.0/meanTickTime, 20); - sender.func_145747_a(new ChatComponentTranslation("commands.forge.tps.summary","Overall", timeFormatter.format(meanTickTime), timeFormatter.format(meanTPS))); + sender.addChatMessage(new ChatComponentTranslation("commands.forge.tps.summary","Overall", timeFormatter.format(meanTickTime), timeFormatter.format(meanTPS))); } else { double worldTickTime = ForgeCommand.mean(this.server.worldTickTimes.get(dim)) * 1.0E-6D; double worldTPS = Math.min(1000.0/worldTickTime, 20); - sender.func_145747_a(new ChatComponentTranslation("commands.forge.tps.summary",String.format("Dim %d", dim), timeFormatter.format(worldTickTime), timeFormatter.format(worldTPS))); + sender.addChatMessage(new ChatComponentTranslation("commands.forge.tps.summary",String.format("Dim %d", dim), timeFormatter.format(worldTickTime), timeFormatter.format(worldTPS))); } } diff --git a/src/main/java/paulscode/sound/codecs/CodecIBXM.java b/src/main/java/paulscode/sound/codecs/CodecIBXM.java index 95e076888d..fb5c165de0 100644 --- a/src/main/java/paulscode/sound/codecs/CodecIBXM.java +++ b/src/main/java/paulscode/sound/codecs/CodecIBXM.java @@ -501,7 +501,6 @@ public class CodecIBXM implements ICodec * @param maxLength Maximum size this array may be. * @return New array. */ - @SuppressWarnings("unused") private static byte[] trimArray( byte[] array, int maxLength ) { byte[] trimmedArray = null; @@ -546,7 +545,6 @@ public class CodecIBXM implements ICodec * @param two_bytes_data For stereo sounds. * @return byte array containing the converted data. */ - @SuppressWarnings("unused") private static byte[] convertAudioBytes( byte[] audio_bytes, boolean two_bytes_data ) {