From e70fb50b51da3c7faf83e463ccf48a407c0594e9 Mon Sep 17 00:00:00 2001 From: cpw Date: Sun, 22 Nov 2015 00:46:26 -0500 Subject: [PATCH] Back to srgnames for patches. We should be starting to look OK now. --- build.gradle | 4 +- .../net/minecraft/block/Block.java.patch | 346 +++++----- .../net/minecraft/block/BlockBush.java.patch | 56 +- .../minecraft/block/BlockButton.java.patch | 8 +- .../minecraft/block/BlockCactus.java.patch | 14 +- .../net/minecraft/block/BlockChest.java.patch | 8 +- .../net/minecraft/block/BlockCocoa.java.patch | 14 +- .../net/minecraft/block/BlockCrops.java.patch | 42 +- .../minecraft/block/BlockDeadBush.java.patch | 12 +- .../net/minecraft/block/BlockDoor.java.patch | 10 +- .../block/BlockDoublePlant.java.patch | 56 +- .../minecraft/block/BlockFalling.java.patch | 10 +- .../minecraft/block/BlockFarmland.java.patch | 8 +- .../net/minecraft/block/BlockFire.java.patch | 146 ++-- .../minecraft/block/BlockFlowerPot.java.patch | 22 +- .../net/minecraft/block/BlockGrass.java.patch | 24 +- .../block/BlockHugeMushroom.java.patch | 10 +- .../net/minecraft/block/BlockIce.java.patch | 26 +- .../minecraft/block/BlockLadder.java.patch | 24 +- .../minecraft/block/BlockLeaves.java.patch | 70 +- .../net/minecraft/block/BlockLever.java.patch | 2 +- .../net/minecraft/block/BlockLog.java.patch | 12 +- .../block/BlockMobSpawner.java.patch | 10 +- .../minecraft/block/BlockMushroom.java.patch | 8 +- .../minecraft/block/BlockMycelium.java.patch | 18 +- .../block/BlockNetherWart.java.patch | 26 +- .../minecraft/block/BlockNewLeaf.java.patch | 14 +- .../net/minecraft/block/BlockNote.java.patch | 24 +- .../minecraft/block/BlockOldLeaf.java.patch | 12 +- .../net/minecraft/block/BlockOre.java.patch | 46 +- .../net/minecraft/block/BlockPane.java.patch | 40 +- .../block/BlockPistonBase.java.patch | 18 +- .../block/BlockPistonMoving.java.patch | 22 +- .../minecraft/block/BlockPotato.java.patch | 16 +- .../minecraft/block/BlockPumpkin.java.patch | 8 +- .../minecraft/block/BlockQuartz.java.patch | 12 +- .../minecraft/block/BlockRailBase.java.patch | 46 +- .../block/BlockRedstoneComparator.java.patch | 6 +- .../block/BlockRedstoneDiode.java.patch | 10 +- .../block/BlockRedstoneOre.java.patch | 12 +- .../block/BlockRedstoneWire.java.patch | 58 +- .../net/minecraft/block/BlockReed.java.patch | 12 +- .../block/BlockRotatedPillar.java.patch | 8 +- .../minecraft/block/BlockSapling.java.patch | 6 +- .../net/minecraft/block/BlockSkull.java.patch | 40 +- .../net/minecraft/block/BlockSnow.java.patch | 42 +- .../net/minecraft/block/BlockStem.java.patch | 31 +- .../minecraft/block/BlockTallGrass.java.patch | 28 +- .../net/minecraft/block/BlockTorch.java.patch | 28 +- .../minecraft/block/BlockTrapDoor.java.patch | 36 +- .../block/BlockTripWireHook.java.patch | 22 +- .../net/minecraft/block/BlockVine.java.patch | 14 +- .../BlockPistonStructureHelper.java.patch | 20 +- .../block/state/BlockState.java.patch | 32 +- .../client/LoadingScreenRenderer.java.patch | 18 +- .../net/minecraft/client/Minecraft.java.patch | 392 ++++++----- .../client/audio/SoundManager.java.patch | 24 +- .../client/entity/EntityPlayerSP.java.patch | 44 +- .../client/gui/FontRenderer.java.patch | 108 +-- .../minecraft/client/gui/GuiButton.java.patch | 12 +- .../minecraft/client/gui/GuiChat.java.patch | 14 +- .../client/gui/GuiCreateWorld.java.patch | 28 +- .../client/gui/GuiIngameMenu.java.patch | 28 +- .../client/gui/GuiMainMenu.java.patch | 36 +- .../client/gui/GuiMultiplayer.java.patch | 14 +- .../client/gui/GuiOverlayDebug.java.patch | 4 +- .../minecraft/client/gui/GuiScreen.java.patch | 76 +- .../client/gui/GuiSelectWorld.java.patch | 4 +- .../client/gui/GuiSleepMP.java.patch | 6 +- .../minecraft/client/gui/GuiSlot.java.patch | 42 +- .../gui/ServerListEntryNormal.java.patch | 16 +- .../achievement/GuiAchievements.java.patch | 100 +-- .../gui/achievement/GuiStats.java.patch | 54 +- .../gui/inventory/GuiContainer.java.patch | 50 +- .../inventory/GuiContainerCreative.java.patch | 198 +++--- .../client/model/ModelBase.java.patch | 2 +- .../client/model/ModelBox.java.patch | 6 +- .../client/model/ModelRenderer.java.patch | 20 +- .../model/PositionTextureVertex.java.patch | 2 +- .../client/model/TexturedQuad.java.patch | 2 +- .../ChunkProviderClient.java.patch | 8 +- .../multiplayer/GuiConnecting.java.patch | 12 +- .../multiplayer/PlayerControllerMP.java.patch | 44 +- .../client/multiplayer/WorldClient.java.patch | 22 +- .../NetHandlerHandshakeMemory.java.patch | 8 +- .../network/NetHandlerLoginClient.java.patch | 14 +- .../network/NetHandlerPlayClient.java.patch | 56 +- .../client/network/OldServerPinger.java.patch | 8 +- .../client/particle/EffectRenderer.java.patch | 16 +- .../BlockRendererDispatcher.java.patch | 26 +- .../client/renderer/EntityRenderer.java.patch | 162 ++--- .../InventoryEffectRenderer.java.patch | 8 +- .../renderer/ItemModelMesher.java.patch | 4 +- .../client/renderer/ItemRenderer.java.patch | 42 +- .../client/renderer/OpenGlHelper.java.patch | 10 +- .../client/renderer/RenderGlobal.java.patch | 106 +-- .../client/renderer/WorldRenderer.java.patch | 2 +- .../WorldVertexBufferUploader.java.patch | 32 +- .../renderer/block/model/BakedQuad.java.patch | 6 +- .../block/model/FaceBakery.java.patch | 70 +- .../model/ItemCameraTransforms.java.patch | 2 +- .../block/model/ItemTransformVec3f.java.patch | 6 +- .../model/ModelBlockDefinition.java.patch | 18 +- .../block/statemap/StateMap.java.patch | 6 +- .../renderer/chunk/RenderChunk.java.patch | 20 +- .../entity/RenderEntityItem.java.patch | 12 +- .../renderer/entity/RenderItem.java.patch | 94 +-- .../renderer/entity/RenderManager.java.patch | 24 +- .../renderer/entity/RenderPlayer.java.patch | 14 +- .../renderer/entity/RenderVillager.java.patch | 6 +- .../entity/RendererLivingEntity.java.patch | 34 +- .../entity/layers/LayerArmorBase.java.patch | 38 +- .../entity/layers/LayerBipedArmor.java.patch | 2 +- .../renderer/texture/Stitcher.java.patch | 18 +- .../texture/TextureAtlasSprite.java.patch | 2 +- .../texture/TextureManager.java.patch | 8 +- .../renderer/texture/TextureMap.java.patch | 99 +-- .../renderer/texture/TextureUtil.java.patch | 6 +- .../tileentity/RenderItemFrame.java.patch | 20 +- .../TileEntityItemStackRenderer.java.patch | 6 +- .../vertex/VertexFormatElement.java.patch | 2 +- .../resources/AbstractResourcePack.java.patch | 8 +- .../FallbackResourceManager.java.patch | 4 +- .../resources/LanguageManager.java.patch | 6 +- .../client/resources/Locale.java.patch | 4 +- ...SimpleReloadableResourceManager.java.patch | 26 +- .../resources/model/IBakedModel.java.patch | 4 +- .../resources/model/ModelBakery.java.patch | 71 +- .../resources/model/ModelManager.java.patch | 14 +- .../resources/model/ModelRotation.java.patch | 6 +- .../client/settings/GameSettings.java.patch | 4 +- .../client/shader/Framebuffer.java.patch | 24 +- .../command/CommandEnchant.java.patch | 8 +- .../minecraft/command/CommandFill.java.patch | 20 +- .../command/CommandHandler.java.patch | 6 +- .../command/server/CommandSetBlock.java.patch | 14 +- .../server/CommandTestForBlock.java.patch | 6 +- .../minecraft/crash/CrashReport.java.patch | 8 +- .../crash/CrashReportCategory.java.patch | 12 +- .../creativetab/CreativeTabs.java.patch | 54 +- .../enchantment/Enchantment.java.patch | 16 +- .../enchantment/EnchantmentHelper.java.patch | 26 +- .../net/minecraft/entity/Entity.java.patch | 120 ++-- .../minecraft/entity/EntityHanging.java.patch | 8 +- .../minecraft/entity/EntityList.java.patch | 38 +- .../minecraft/entity/EntityLiving.java.patch | 24 +- .../entity/EntityLivingBase.java.patch | 154 ++--- .../EntityMinecartCommandBlock.java.patch | 6 +- .../minecraft/entity/EntityTracker.java.patch | 8 +- .../entity/EntityTrackerEntry.java.patch | 38 +- .../ai/EntityAIAttackOnCollide.java.patch | 20 +- .../entity/boss/EntityDragon.java.patch | 12 +- .../entity/boss/EntityWither.java.patch | 8 +- .../entity/boss/IBossDisplayData.java.patch | 2 +- .../effect/EntityLightningBolt.java.patch | 4 +- .../entity/item/EntityEnderPearl.java.patch | 20 +- .../entity/item/EntityItem.java.patch | 88 +-- .../entity/item/EntityItemFrame.java.patch | 8 +- .../entity/item/EntityMinecart.java.patch | 216 +++--- .../item/EntityMinecartContainer.java.patch | 8 +- .../item/EntityMinecartEmpty.java.patch | 6 +- .../item/EntityMinecartFurnace.java.patch | 8 +- .../item/EntityMinecartHopper.java.patch | 8 +- .../entity/item/EntityXPOrb.java.patch | 10 +- .../entity/monster/EntityEnderman.java.patch | 32 +- .../entity/monster/EntityMagmaCube.java.patch | 4 +- .../entity/monster/EntitySlime.java.patch | 8 +- .../entity/monster/EntityZombie.java.patch | 54 +- .../entity/passive/EntityHorse.java.patch | 4 +- .../entity/passive/EntityMooshroom.java.patch | 42 +- .../entity/passive/EntityOcelot.java.patch | 6 +- .../entity/passive/EntitySheep.java.patch | 22 +- .../entity/passive/EntityVillager.java.patch | 28 +- .../entity/player/EntityPlayer.java.patch | 424 ++++++------ .../entity/player/EntityPlayerMP.java.patch | 74 +- .../entity/player/InventoryPlayer.java.patch | 10 +- .../projectile/EntityFishHook.java.patch | 14 +- .../net/minecraft/init/Bootstrap.java.patch | 264 ++++++- .../minecraft/inventory/Container.java.patch | 10 +- .../inventory/ContainerBeacon.java.patch | 8 +- .../ContainerBrewingStand.java.patch | 20 +- .../inventory/ContainerEnchantment.java.patch | 42 +- .../inventory/ContainerPlayer.java.patch | 10 +- .../inventory/ContainerRepair.java.patch | 36 +- .../net/minecraft/inventory/Slot.java.patch | 14 +- .../inventory/SlotCrafting.java.patch | 10 +- .../inventory/SlotFurnaceOutput.java.patch | 6 +- .../net/minecraft/item/Item.java.patch | 136 ++-- .../net/minecraft/item/ItemArmor.java.patch | 34 +- .../net/minecraft/item/ItemBlock.java.patch | 32 +- .../net/minecraft/item/ItemBow.java.patch | 14 +- .../net/minecraft/item/ItemBucket.java.patch | 6 +- .../minecraft/item/ItemBucketMilk.java.patch | 8 +- .../net/minecraft/item/ItemDye.java.patch | 44 +- .../minecraft/item/ItemEmptyMap.java.patch | 14 +- .../item/ItemFlintAndSteel.java.patch | 8 +- .../net/minecraft/item/ItemHoe.java.patch | 12 +- .../net/minecraft/item/ItemLilyPad.java.patch | 12 +- .../net/minecraft/item/ItemMap.java.patch | 12 +- .../item/ItemMonsterPlacer.java.patch | 72 +- .../net/minecraft/item/ItemRecord.java.patch | 2 +- .../minecraft/item/ItemSeedFood.java.patch | 14 +- .../net/minecraft/item/ItemSeeds.java.patch | 16 +- .../net/minecraft/item/ItemShears.java.patch | 54 +- .../net/minecraft/item/ItemSkull.java.patch | 20 +- .../net/minecraft/item/ItemSnow.java.patch | 8 +- .../net/minecraft/item/ItemStack.java.patch | 124 ++-- .../net/minecraft/item/ItemSword.java.patch | 12 +- .../net/minecraft/item/ItemTool.java.patch | 28 +- .../item/crafting/FurnaceRecipes.java.patch | 16 +- .../item/crafting/RecipeFireworks.java.patch | 18 +- .../item/crafting/RecipeRepairItem.java.patch | 22 +- .../item/crafting/RecipesArmorDyes.java.patch | 6 +- .../item/crafting/RecipesBanners.java.patch | 14 +- .../crafting/RecipesMapCloning.java.patch | 6 +- .../item/crafting/ShapedRecipes.java.patch | 6 +- .../item/crafting/ShapelessRecipes.java.patch | 6 +- .../nbt/CompressedStreamTools.java.patch | 12 +- .../minecraft/nbt/NBTSizeTracker.java.patch | 6 +- .../minecraft/nbt/NBTTagCompound.java.patch | 12 +- .../net/minecraft/nbt/NBTTagString.java.patch | 10 +- .../network/NetHandlerPlayServer.java.patch | 98 +-- .../network/NetworkManager.java.patch | 28 +- .../network/NetworkSystem.java.patch | 2 +- .../network/ServerStatusResponse.java.patch | 28 +- .../handshake/client/C00Handshake.java.patch | 36 +- .../client/C17PacketCustomPayload.java.patch | 14 +- .../server/S3FPacketCustomPayload.java.patch | 14 +- .../server/S00PacketServerInfo.java.patch | 8 +- .../net/minecraft/potion/Potion.java.patch | 2 +- .../minecraft/potion/PotionEffect.java.patch | 40 +- .../minecraft/realms/RealmsConnect.java.patch | 4 +- .../server/MinecraftServer.java.patch | 206 +++--- .../dedicated/DedicatedServer.java.patch | 28 +- .../server/gui/MinecraftServerGui.java.patch | 2 +- .../integrated/IntegratedServer.java.patch | 72 +- .../management/ItemInWorldManager.java.patch | 186 ++--- .../management/PlayerManager.java.patch | 140 ++-- .../ServerConfigurationManager.java.patch | 244 +++---- .../network/NetHandlerHandshakeTCP.java.patch | 6 +- .../network/NetHandlerLoginServer.java.patch | 16 +- .../net/minecraft/stats/StatList.java.patch | 92 +-- .../tileentity/TileEntity.java.patch | 52 +- .../tileentity/TileEntityBeacon.java.patch | 14 +- .../TileEntityBrewingStand.java.patch | 52 +- .../tileentity/TileEntityFurnace.java.patch | 46 +- .../tileentity/TileEntityHopper.java.patch | 24 +- .../tileentity/TileEntityNote.java.patch | 8 +- .../tileentity/TileEntityPiston.java.patch | 20 +- .../tileentity/TileEntitySign.java.patch | 6 +- .../net/minecraft/util/EnumFacing.java.patch | 30 +- .../net/minecraft/util/MouseHelper.java.patch | 6 +- .../util/MovingObjectPosition.java.patch | 4 +- .../util/ResourceLocation.java.patch | 6 +- .../net/minecraft/util/Session.java.patch | 32 +- .../minecraft/util/StringTranslate.java.patch | 14 +- .../net/minecraft/util/Vec3.java.patch | 20 +- .../WeightedRandomChestContent.java.patch | 44 +- .../net/minecraft/world/ChunkCache.java.patch | 54 +- .../net/minecraft/world/Explosion.java.patch | 42 +- .../minecraft/world/IBlockAccess.java.patch | 2 +- .../minecraft/world/SpawnerAnimals.java.patch | 34 +- .../net/minecraft/world/World.java.patch | 649 +++++++++--------- .../minecraft/world/WorldProvider.java.patch | 122 ++-- .../minecraft/world/WorldServer.java.patch | 202 +++--- .../world/WorldServerMulti.java.patch | 44 +- .../net/minecraft/world/WorldType.java.patch | 58 +- .../world/biome/BiomeColorHelper.java.patch | 4 +- .../world/biome/BiomeDecorator.java.patch | 158 ++--- .../world/biome/BiomeGenBase.java.patch | 62 +- .../world/biome/BiomeGenForest.java.patch | 16 +- .../world/biome/BiomeGenHills.java.patch | 8 +- .../world/biome/BiomeGenJungle.java.patch | 8 +- .../world/biome/BiomeGenPlains.java.patch | 20 +- .../world/biome/BiomeGenSwamp.java.patch | 2 +- .../world/biome/WorldChunkManager.java.patch | 36 +- .../world/border/WorldBorder.java.patch | 4 +- .../minecraft/world/chunk/Chunk.java.patch | 194 +++--- .../chunk/storage/AnvilChunkLoader.java.patch | 82 +-- .../chunk/storage/AnvilSaveHandler.java.patch | 10 +- .../storage/ExtendedBlockStorage.java.patch | 12 +- .../world/chunk/storage/RegionFile.java.patch | 16 +- .../world/gen/ChunkProviderEnd.java.patch | 52 +- .../gen/ChunkProviderGenerate.java.patch | 98 +-- .../world/gen/ChunkProviderHell.java.patch | 142 ++-- .../world/gen/ChunkProviderServer.java.patch | 84 +-- .../world/gen/MapGenCaves.java.patch | 56 +- .../world/gen/MapGenRavine.java.patch | 54 +- .../feature/WorldGenAbstractTree.java.patch | 6 +- .../feature/WorldGenBigMushroom.java.patch | 24 +- .../gen/feature/WorldGenBigTree.java.patch | 36 +- .../gen/feature/WorldGenCanopyTree.java.patch | 58 +- .../gen/feature/WorldGenDeadBush.java.patch | 10 +- .../gen/feature/WorldGenDungeons.java.patch | 18 +- .../gen/feature/WorldGenForest.java.patch | 42 +- .../gen/feature/WorldGenHugeTrees.java.patch | 56 +- .../gen/feature/WorldGenMegaJungle.java.patch | 36 +- .../feature/WorldGenMegaPineTree.java.patch | 48 +- .../gen/feature/WorldGenMinable.java.patch | 6 +- .../feature/WorldGenSavannaTree.java.patch | 58 +- .../gen/feature/WorldGenShrub.java.patch | 26 +- .../gen/feature/WorldGenSwamp.java.patch | 86 +-- .../gen/feature/WorldGenTaiga1.java.patch | 40 +- .../gen/feature/WorldGenTaiga2.java.patch | 40 +- .../gen/feature/WorldGenTallGrass.java.patch | 10 +- .../gen/feature/WorldGenTrees.java.patch | 82 +-- .../WorldGeneratorBonusChest.java.patch | 12 +- .../world/gen/layer/GenLayer.java.patch | 26 +- .../world/gen/layer/GenLayerBiome.java.patch | 56 +- ...ComponentScatteredFeaturePieces.java.patch | 44 +- .../gen/structure/MapGenStronghold.java.patch | 6 +- .../gen/structure/MapGenStructure.java.patch | 10 +- .../structure/StructureComponent.java.patch | 4 +- .../StructureMineshaftPieces.java.patch | 18 +- .../StructureNetherBridgePieces.java.patch | 18 +- .../gen/structure/StructureStart.java.patch | 12 +- .../StructureStrongholdPieces.java.patch | 52 +- .../StructureVillagePieces.java.patch | 30 +- .../world/storage/MapData.java.patch | 48 +- .../world/storage/SaveHandler.java.patch | 38 +- .../world/storage/WorldInfo.java.patch | 6 +- 321 files changed, 6253 insertions(+), 5933 deletions(-) diff --git a/build.gradle b/build.gradle index 7c924c382..f6acdc606 100644 --- a/build.gradle +++ b/build.gradle @@ -50,8 +50,8 @@ minecraft { patchDir "patches/minecraft" patchAfter "clean" genPatchesFrom "clean" - genMcpPatches = true - applyMcpPatches = true + genMcpPatches = false + applyMcpPatches = false with common } } diff --git a/patches/minecraft/net/minecraft/block/Block.java.patch b/patches/minecraft/net/minecraft/block/Block.java.patch index e15a21353..4585774b7 100644 --- a/patches/minecraft/net/minecraft/block/Block.java.patch +++ b/patches/minecraft/net/minecraft/block/Block.java.patch @@ -3,184 +3,184 @@ @@ -38,8 +38,9 @@ public class Block { - private static final ResourceLocation AIR_ID = new ResourceLocation("air"); -- public static final RegistryNamespacedDefaultedByKey blockRegistry = new RegistryNamespacedDefaultedByKey(AIR_ID); -- public static final ObjectIntIdentityMap BLOCK_STATE_IDS = new ObjectIntIdentityMap(); -+ public static final RegistryNamespacedDefaultedByKey blockRegistry = net.minecraftforge.fml.common.registry.GameData.getBlockRegistry(); + private static final ResourceLocation field_176230_a = new ResourceLocation("air"); +- public static final RegistryNamespacedDefaultedByKey field_149771_c = new RegistryNamespacedDefaultedByKey(field_176230_a); +- public static final ObjectIntIdentityMap field_176229_d = new ObjectIntIdentityMap(); ++ public static final RegistryNamespacedDefaultedByKey field_149771_c = net.minecraftforge.fml.common.registry.GameData.getBlockRegistry(); + @Deprecated //Modders: DO NOT use this! Use GameRegistry -+ public static final ObjectIntIdentityMap BLOCK_STATE_IDS = net.minecraftforge.fml.common.registry.GameData.getBlockStateIDMap(); - private CreativeTabs displayOnCreativeTab; - public static final Block.SoundType soundTypeStone = new Block.SoundType("stone", 1.0F, 1.0F); - public static final Block.SoundType soundTypeWood = new Block.SoundType("wood", 1.0F, 1.0F); ++ public static final ObjectIntIdentityMap field_176229_d = net.minecraftforge.fml.common.registry.GameData.getBlockStateIDMap(); + private CreativeTabs field_149772_a; + public static final Block.SoundType field_149769_e = new Block.SoundType("stone", 1.0F, 1.0F); + public static final Block.SoundType field_149766_f = new Block.SoundType("wood", 1.0F, 1.0F); @@ -119,6 +120,9 @@ - private IBlockState defaultBlockState; - private String unlocalizedName; + private IBlockState field_176228_M; + private String field_149770_b; + public final net.minecraftforge.fml.common.registry.RegistryDelegate delegate = -+ ((net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry)blockRegistry).getDelegate(this, Block.class); ++ ((net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry)field_149771_c).getDelegate(this, Block.class); + - public static int getIdFromBlock(Block blockIn) + public static int func_149682_b(Block p_149682_0_) { - return blockRegistry.getIDForObject(blockIn); + return field_149771_c.func_148757_b(p_149682_0_); @@ -132,7 +136,8 @@ - public static Block getBlockById(int id) + public static Block func_149729_e(int p_149729_0_) { -- return (Block)blockRegistry.getObjectById(id); -+ Block ret = (Block)blockRegistry.getObjectById(id); -+ return ret == null ? net.minecraft.init.Blocks.air : ret; +- return (Block)field_149771_c.func_148754_a(p_149729_0_); ++ Block ret = (Block)field_149771_c.func_148754_a(p_149729_0_); ++ return ret == null ? net.minecraft.init.Blocks.field_150350_a : ret; } - public static IBlockState getStateById(int id) + public static IBlockState func_176220_d(int p_176220_0_) @@ -303,7 +308,7 @@ - public boolean isReplaceable(World worldIn, BlockPos pos) + public boolean func_176200_f(World p_176200_1_, BlockPos p_176200_2_) { - return false; -+ return getMaterial().isReplaceable(); ++ return func_149688_o().func_76222_j(); } - public Block setHardness(float hardness) + public Block func_149711_c(float p_149711_1_) @@ -340,9 +345,10 @@ - return this.needsRandomTick; + return this.field_149789_z; } + @Deprecated //Forge: New State sensitive version. - public boolean hasTileEntity() + public boolean func_149716_u() { -- return this.isBlockContainer; -+ return hasTileEntity(getDefaultState()); +- return this.field_149758_A; ++ return hasTileEntity(func_176223_P()); } - public final void setBlockBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) + 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_) @@ -359,13 +365,13 @@ - public int getMixedBrightnessForBlock(IBlockAccess worldIn, BlockPos pos) + public int func_176207_c(IBlockAccess p_176207_1_, BlockPos p_176207_2_) { - Block block = worldIn.getBlockState(pos).getBlock(); -- int i = worldIn.getCombinedLight(pos, block.getLightValue()); -+ int i = worldIn.getCombinedLight(pos, block.getLightValue(worldIn, pos)); + Block block = p_176207_1_.func_180495_p(p_176207_2_).func_177230_c(); +- int i = p_176207_1_.func_175626_b(p_176207_2_, block.func_149750_m()); ++ int i = p_176207_1_.func_175626_b(p_176207_2_, block.getLightValue(p_176207_1_, p_176207_2_)); if (i == 0 && block instanceof BlockSlab) { - pos = pos.down(); - block = worldIn.getBlockState(pos).getBlock(); -- return worldIn.getCombinedLight(pos, block.getLightValue()); -+ return worldIn.getCombinedLight(pos, block.getLightValue(worldIn, pos)); + p_176207_2_ = p_176207_2_.func_177977_b(); + block = p_176207_1_.func_180495_p(p_176207_2_).func_177230_c(); +- return p_176207_1_.func_175626_b(p_176207_2_, block.func_149750_m()); ++ return p_176207_1_.func_175626_b(p_176207_2_, block.getLightValue(p_176207_1_, p_176207_2_)); } else { @@ -453,6 +459,10 @@ - public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_) { -+ if (hasTileEntity(state) && !(this instanceof BlockContainer)) ++ if (hasTileEntity(p_180663_3_) && !(this instanceof BlockContainer)) + { -+ worldIn.removeTileEntity(pos); ++ p_180663_1_.func_175713_t(p_180663_2_); + } } - public int quantityDropped(Random random) + public int func_149745_a(Random p_149745_1_) @@ -467,8 +477,7 @@ - public float getPlayerRelativeBlockHardness(EntityPlayer playerIn, World worldIn, BlockPos pos) + public float func_180647_a(EntityPlayer p_180647_1_, World p_180647_2_, BlockPos p_180647_3_) { -- float f = this.getBlockHardness(worldIn, pos); -- return f < 0.0F ? 0.0F : (!playerIn.canHarvestBlock(this) ? playerIn.getToolDigEfficiency(this) / f / 100.0F : playerIn.getToolDigEfficiency(this) / f / 30.0F); -+ return net.minecraftforge.common.ForgeHooks.blockStrength(worldIn.getBlockState(pos), playerIn, worldIn, pos); +- float f = this.func_176195_g(p_180647_2_, p_180647_3_); +- return f < 0.0F ? 0.0F : (!p_180647_1_.func_146099_a(this) ? p_180647_1_.func_180471_a(this) / f / 100.0F : p_180647_1_.func_180471_a(this) / f / 30.0F); ++ return net.minecraftforge.common.ForgeHooks.blockStrength(p_180647_2_.func_180495_p(p_180647_3_), p_180647_1_, p_180647_2_, p_180647_3_); } - public final void dropBlockAsItem(World worldIn, BlockPos pos, IBlockState state, int forture) + public final void func_176226_b(World p_176226_1_, BlockPos p_176226_2_, IBlockState p_176226_3_, int p_176226_4_) @@ -478,20 +487,16 @@ - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { -- if (!worldIn.isRemote) -+ if (!worldIn.isRemote && !worldIn.restoringBlockSnapshots) // do not drop items while restoring blockstates, prevents item dupe +- if (!p_180653_1_.field_72995_K) ++ if (!p_180653_1_.field_72995_K && !p_180653_1_.restoringBlockSnapshots) // do not drop items while restoring blockstates, prevents item dupe { -- int i = this.quantityDroppedWithBonus(fortune, worldIn.rand); -+ java.util.List items = getDrops(worldIn, pos, state, fortune); -+ chance = net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, worldIn, pos, state, fortune, chance, false, harvesters.get()); +- int i = this.func_149679_a(p_180653_5_, p_180653_1_.field_73012_v); ++ java.util.List items = getDrops(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_5_); ++ p_180653_4_ = net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180653_1_, p_180653_2_, p_180653_3_, p_180653_5_, p_180653_4_, false, harvesters.get()); - for (int j = 0; j < i; ++j) + for (ItemStack item : items) { - if (worldIn.rand.nextFloat() <= chance) + if (p_180653_1_.field_73012_v.nextFloat() <= p_180653_4_) { -- Item item = this.getItemDropped(state, worldIn.rand, fortune); +- Item item = this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_); - - if (item != null) - { -- spawnAsEntity(worldIn, pos, new ItemStack(item, 1, this.damageDropped(state))); +- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item, 1, this.func_180651_a(p_180653_3_))); - } -+ spawnAsEntity(worldIn, pos, item); ++ func_180635_a(p_180653_1_, p_180653_2_, item); } } } @@ -499,8 +504,13 @@ - public static void spawnAsEntity(World worldIn, BlockPos pos, ItemStack stack) + public static void func_180635_a(World p_180635_0_, BlockPos p_180635_1_, ItemStack p_180635_2_) { -- if (!worldIn.isRemote && worldIn.getGameRules().getGameRuleBooleanValue("doTileDrops")) -+ if (!worldIn.isRemote && worldIn.getGameRules().getGameRuleBooleanValue("doTileDrops") && !worldIn.restoringBlockSnapshots) // do not drop items while restoring blockstates, prevents item dupe +- if (!p_180635_0_.field_72995_K && p_180635_0_.func_82736_K().func_82766_b("doTileDrops")) ++ if (!p_180635_0_.field_72995_K && p_180635_0_.func_82736_K().func_82766_b("doTileDrops") && !p_180635_0_.restoringBlockSnapshots) // do not drop items while restoring blockstates, prevents item dupe { + if (captureDrops.get()) + { -+ capturedDrops.get().add(stack); ++ capturedDrops.get().add(p_180635_2_); + return; + } float f = 0.5F; - double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; - double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d0 = (double)(p_180635_0_.field_73012_v.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d1 = (double)(p_180635_0_.field_73012_v.nextFloat() * f) + (double)(1.0F - f) * 0.5D; @@ -687,7 +697,7 @@ - public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) { -- return worldIn.getBlockState(pos).getBlock().blockMaterial.isReplaceable(); -+ return worldIn.getBlockState(pos).getBlock().isReplaceable(worldIn, pos); +- return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().field_149764_J.func_76222_j(); ++ return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().func_176200_f(p_176196_1_, p_176196_2_); } - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) + public boolean func_180639_a(World p_180639_1_, BlockPos p_180639_2_, IBlockState p_180639_3_, EntityPlayer p_180639_4_, EnumFacing p_180639_5_, float p_180639_6_, float p_180639_7_, float p_180639_8_) @@ -799,25 +809,35 @@ - player.triggerAchievement(StatList.mineBlockStatArray[getIdFromBlock(this)]); - player.addExhaustion(0.025F); + p_180657_2_.func_71029_a(StatList.field_75934_C[func_149682_b(this)]); + p_180657_2_.func_71020_j(0.025F); -- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(player)) -+ if (this.canSilkHarvest(worldIn, pos, worldIn.getBlockState(pos), player) && EnchantmentHelper.getSilkTouchModifier(player)) +- if (this.func_149700_E() && EnchantmentHelper.func_77502_d(p_180657_2_)) ++ if (this.canSilkHarvest(p_180657_1_, p_180657_3_, p_180657_1_.func_180495_p(p_180657_3_), p_180657_2_) && EnchantmentHelper.func_77502_d(p_180657_2_)) { + java.util.ArrayList items = new java.util.ArrayList(); - ItemStack itemstack = this.createStackedBlock(state); + ItemStack itemstack = this.func_180643_i(p_180657_4_); if (itemstack != null) { -- spawnAsEntity(worldIn, pos, itemstack); +- func_180635_a(p_180657_1_, p_180657_3_, itemstack); + items.add(itemstack); } + -+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, worldIn, pos, worldIn.getBlockState(pos), 0, 1.0f, true, player); ++ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_1_.func_180495_p(p_180657_3_), 0, 1.0f, true, p_180657_2_); + for (ItemStack stack : items) + { -+ spawnAsEntity(worldIn, pos, stack); ++ func_180635_a(p_180657_1_, p_180657_3_, stack); + } } else { -+ harvesters.set(player); - int i = EnchantmentHelper.getFortuneModifier(player); - this.dropBlockAsItem(worldIn, pos, state, i); ++ harvesters.set(p_180657_2_); + int i = EnchantmentHelper.func_77517_e(p_180657_2_); + this.func_176226_b(p_180657_1_, p_180657_3_, p_180657_4_, i); + harvesters.set(null); } } + @Deprecated //Forge: State sensitive version - protected boolean canSilkHarvest() + protected boolean func_149700_E() { -- return this.isFullCube() && !this.isBlockContainer; -+ return this.isFullCube() && !this.hasTileEntity(silk_check_state.get()); +- return this.func_149686_d() && !this.field_149758_A; ++ return this.func_149686_d() && !this.hasTileEntity(silk_check_state.get()); } - protected ItemStack createStackedBlock(IBlockState state) + protected ItemStack func_180643_i(IBlockState p_180643_1_) @@ -1010,6 +1030,1029 @@ - return "Block{" + blockRegistry.getNameForObject(this) + "}"; + return "Block{" + field_149771_c.func_177774_c(this) + "}"; } + /* ======================================== FORGE START =====================================*/ @@ -197,12 +197,12 @@ + */ + public int getLightValue(IBlockAccess world, BlockPos pos) + { -+ Block block = world.getBlockState(pos).getBlock(); ++ Block block = world.func_180495_p(pos).func_177230_c(); + if (block != this) + { + return block.getLightValue(world, pos); + } -+ return getLightValue(); ++ return func_149750_m(); + } + + /** @@ -226,7 +226,7 @@ + */ + public boolean isNormalCube(IBlockAccess world, BlockPos pos) + { -+ return getMaterial().isOpaque() && isFullCube() && !canProvidePower(); ++ return func_149688_o().func_76218_k() && func_149686_d() && !func_149744_f(); + } + + /** @@ -239,11 +239,11 @@ + */ + public boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side) + { -+ IBlockState state = this.getActualState(world.getBlockState(pos), world, pos); ++ IBlockState state = this.func_176221_a(world.func_180495_p(pos), world, pos); + + if (this instanceof BlockSlab) + { -+ return isFullBlock() || (state.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP && side == EnumFacing.UP); ++ return func_149730_j() || (state.func_177229_b(BlockSlab.field_176554_a) == BlockSlab.EnumBlockHalf.TOP && side == EnumFacing.UP); + } + else if (this instanceof BlockFarmland) + { @@ -251,26 +251,26 @@ + } + else if (this instanceof BlockStairs) + { -+ boolean flipped = state.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP; -+ BlockStairs.EnumShape shape = (BlockStairs.EnumShape)state.getValue(BlockStairs.SHAPE); -+ EnumFacing facing = (EnumFacing)state.getValue(BlockStairs.FACING); ++ boolean flipped = state.func_177229_b(BlockStairs.field_176308_b) == BlockStairs.EnumHalf.TOP; ++ BlockStairs.EnumShape shape = (BlockStairs.EnumShape)state.func_177229_b(BlockStairs.field_176310_M); ++ EnumFacing facing = (EnumFacing)state.func_177229_b(BlockStairs.field_176309_a); + if (side == EnumFacing.UP) return flipped; + if (facing == side) return true; + if (flipped) + { -+ if (shape == BlockStairs.EnumShape.INNER_LEFT ) return side == facing.rotateYCCW(); -+ if (shape == BlockStairs.EnumShape.INNER_RIGHT) return side == facing.rotateY(); ++ if (shape == BlockStairs.EnumShape.INNER_LEFT ) return side == facing.func_176735_f(); ++ if (shape == BlockStairs.EnumShape.INNER_RIGHT) return side == facing.func_176746_e(); + } + else + { -+ if (shape == BlockStairs.EnumShape.INNER_LEFT ) return side == facing.rotateY(); -+ if (shape == BlockStairs.EnumShape.INNER_RIGHT) return side == facing.rotateYCCW(); ++ if (shape == BlockStairs.EnumShape.INNER_LEFT ) return side == facing.func_176746_e(); ++ if (shape == BlockStairs.EnumShape.INNER_RIGHT) return side == facing.func_176735_f(); + } + return false; + } + else if (this instanceof BlockSnow) + { -+ return ((Integer)state.getValue(BlockSnow.LAYERS)) >= 8; ++ return ((Integer)state.func_177229_b(BlockSnow.field_176315_a)) >= 8; + } + else if (this instanceof BlockHopper && side == EnumFacing.UP) + { @@ -308,7 +308,7 @@ + */ + public boolean isAir(IBlockAccess world, BlockPos pos) + { -+ return getMaterial() == Material.air; ++ return func_149688_o() == Material.field_151579_a; + } + + /** @@ -343,7 +343,7 @@ + */ + public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest) + { -+ return world.setBlockToAir(pos); ++ return world.func_175698_g(pos); + } + + /** @@ -357,7 +357,7 @@ + */ + public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face) + { -+ return net.minecraft.init.Blocks.fire.getFlammability(this); ++ return net.minecraft.init.Blocks.field_150480_ab.func_176532_c(this); + } + + /** @@ -385,7 +385,7 @@ + */ + public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face) + { -+ return net.minecraft.init.Blocks.fire.getEncouragement(this); ++ return net.minecraft.init.Blocks.field_150480_ab.func_176534_d(this); + } + + /** @@ -401,11 +401,11 @@ + */ + public boolean isFireSource(World world, BlockPos pos, EnumFacing side) + { -+ if (this == net.minecraft.init.Blocks.netherrack && side == EnumFacing.UP) ++ if (this == net.minecraft.init.Blocks.field_150424_aL && side == EnumFacing.UP) + { + return true; + } -+ if ((world.provider instanceof net.minecraft.world.WorldProviderEnd) && this == net.minecraft.init.Blocks.bedrock && side == EnumFacing.UP) ++ if ((world.field_73011_w instanceof net.minecraft.world.WorldProviderEnd) && this == net.minecraft.init.Blocks.field_150357_h && side == EnumFacing.UP) + { + return true; + } @@ -440,7 +440,7 @@ + { + if (isTileProvider) + { -+ return ((ITileEntityProvider)this).createNewTileEntity(world, getMetaFromState(state)); ++ return ((ITileEntityProvider)this).func_149915_a(world, func_176201_c(state)); + } + return null; + } @@ -456,7 +456,7 @@ + */ + public int quantityDropped(IBlockState state, int fortune, Random random) + { -+ return quantityDroppedWithBonus(fortune, random); ++ return func_149679_a(fortune, random); + } + + /** @@ -472,15 +472,15 @@ + { + List ret = new java.util.ArrayList(); + -+ Random rand = world instanceof World ? ((World)world).rand : RANDOM; ++ Random rand = world instanceof World ? ((World)world).field_73012_v : RANDOM; + + int count = quantityDropped(state, fortune, rand); + for(int i = 0; i < count; i++) + { -+ Item item = this.getItemDropped(state, rand, fortune); ++ Item item = this.func_180660_a(state, rand, fortune); + if (item != null) + { -+ ret.add(new ItemStack(item, 1, this.damageDropped(state))); ++ ret.add(new ItemStack(item, 1, this.func_180651_a(state))); + } + } + return ret; @@ -498,7 +498,7 @@ + public boolean canSilkHarvest(World world, BlockPos pos, IBlockState state, EntityPlayer player) + { + silk_check_state.set(state);; -+ boolean ret = this.canSilkHarvest(); ++ boolean ret = this.func_149700_E(); + silk_check_state.set(null); + return ret; + } @@ -514,14 +514,14 @@ + */ + public boolean canCreatureSpawn(IBlockAccess world, BlockPos pos, net.minecraft.entity.EntityLiving.SpawnPlacementType type) + { -+ IBlockState state = world.getBlockState(pos); ++ IBlockState state = world.func_180495_p(pos); + if (this instanceof BlockSlab) + { -+ return (isFullBlock() || state.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP); ++ return (func_149730_j() || state.func_177229_b(BlockSlab.field_176554_a) == BlockSlab.EnumBlockHalf.TOP); + } + else if (this instanceof BlockStairs) + { -+ return state.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP; ++ return state.func_177229_b(BlockStairs.field_176308_b) == BlockStairs.EnumHalf.TOP; + } + return isSideSolid(world, pos, EnumFacing.UP); + } @@ -538,7 +538,7 @@ + */ + public boolean isBed(IBlockAccess world, BlockPos pos, Entity player) + { -+ return this == net.minecraft.init.Blocks.bed; ++ return this == net.minecraft.init.Blocks.field_150324_C; + } + + /** @@ -553,7 +553,7 @@ + public BlockPos getBedSpawnPosition(IBlockAccess world, BlockPos pos, EntityPlayer player) + { + if (world instanceof World) -+ return BlockBed.getSafeExitLocation((World)world, pos, 0); ++ return BlockBed.func_176468_a((World)world, pos, 0); + return null; + } + @@ -569,10 +569,10 @@ + { + if (world instanceof World) + { -+ IBlockState state = world.getBlockState(pos); -+ state = state.getBlock().getActualState(state, world, pos); -+ state = state.withProperty(BlockBed.OCCUPIED, true); -+ ((World)world).setBlockState(pos, state, 4); ++ IBlockState state = world.func_180495_p(pos); ++ state = state.func_177230_c().func_176221_a(state, world, pos); ++ state = state.func_177226_a(BlockBed.field_176471_b, true); ++ ((World)world).func_180501_a(pos, state, 4); + } + } + @@ -586,7 +586,7 @@ + */ + public EnumFacing getBedDirection(IBlockAccess world, BlockPos pos) + { -+ return (EnumFacing)getActualState(world.getBlockState(pos), world, pos).getValue(BlockDirectional.FACING); ++ return (EnumFacing)func_176221_a(world.func_180495_p(pos), world, pos).func_177229_b(BlockDirectional.field_176387_N); + } + + /** @@ -598,7 +598,7 @@ + */ + public boolean isBedFoot(IBlockAccess world, BlockPos pos) + { -+ return getActualState(world.getBlockState(pos), world, pos).getValue(BlockBed.PART) == BlockBed.EnumPartType.FOOT; ++ return func_176221_a(world.func_180495_p(pos), world, pos).func_177229_b(BlockBed.field_176472_a) == BlockBed.EnumPartType.FOOT; + } + + /** @@ -630,7 +630,7 @@ + */ + public boolean isLeaves(IBlockAccess world, BlockPos pos) + { -+ return getMaterial() == Material.leaves; ++ return func_149688_o() == Material.field_151584_j; + } + + /** @@ -642,7 +642,7 @@ + */ + public boolean canBeReplacedByLeaves(IBlockAccess world, BlockPos pos) + { -+ return !isFullBlock(); ++ return !func_149730_j(); + } + + /** @@ -667,7 +667,7 @@ + */ + public boolean isReplaceableOreGen(World world, BlockPos pos, com.google.common.base.Predicate target) + { -+ return target.apply(world.getBlockState(pos)); ++ return target.apply(world.func_180495_p(pos)); + } + + /** @@ -681,7 +681,7 @@ + */ + public float getExplosionResistance(World world, BlockPos pos, Entity exploder, Explosion explosion) + { -+ return getExplosionResistance(exploder); ++ return func_149638_a(exploder); + } + + /** @@ -695,8 +695,8 @@ + */ + public void onBlockExploded(World world, BlockPos pos, Explosion explosion) + { -+ world.setBlockToAir(pos); -+ onBlockDestroyedByExplosion(world, pos, explosion); ++ world.func_175698_g(pos); ++ func_180652_a(world, pos, explosion); + } + + /** @@ -710,7 +710,7 @@ + */ + public boolean canConnectRedstone(IBlockAccess world, BlockPos pos, EnumFacing side) + { -+ return canProvidePower() && side != null; ++ return func_149744_f() && side != null; + } + + /** @@ -729,7 +729,7 @@ + } + else + { -+ return this instanceof BlockFence || this == net.minecraft.init.Blocks.glass || this == net.minecraft.init.Blocks.cobblestone_wall || this == net.minecraft.init.Blocks.stained_glass; ++ return this instanceof BlockFence || this == net.minecraft.init.Blocks.field_150359_w || this == net.minecraft.init.Blocks.field_150463_bK || this == net.minecraft.init.Blocks.field_150399_cn; + } + } + @@ -759,15 +759,15 @@ + @Deprecated + public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos) + { -+ Item item = getItem(world, pos); ++ Item item = func_180665_b(world, pos); + + if (item == null) + { + return null; + } + -+ Block block = item instanceof ItemBlock && !isFlowerPot() ? Block.getBlockFromItem(item) : this; -+ return new ItemStack(item, 1, block.getDamageValue(world, pos)); ++ Block block = item instanceof ItemBlock && !func_149648_K() ? Block.func_149634_a(item) : this; ++ return new ItemStack(item, 1, block.func_176222_j(world, pos)); + } + + /** @@ -834,39 +834,39 @@ + */ + public boolean canSustainPlant(IBlockAccess world, BlockPos pos, EnumFacing direction, net.minecraftforge.common.IPlantable plantable) + { -+ IBlockState state = world.getBlockState(pos); -+ IBlockState plant = plantable.getPlant(world, pos.offset(direction)); -+ net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction)); ++ IBlockState state = world.func_180495_p(pos); ++ IBlockState plant = plantable.getPlant(world, pos.func_177972_a(direction)); ++ net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.func_177972_a(direction)); + -+ if (plant.getBlock() == net.minecraft.init.Blocks.cactus && this == net.minecraft.init.Blocks.cactus) ++ if (plant.func_177230_c() == net.minecraft.init.Blocks.field_150434_aF && this == net.minecraft.init.Blocks.field_150434_aF) + { + return true; + } + -+ if (plant.getBlock() == net.minecraft.init.Blocks.reeds && this == net.minecraft.init.Blocks.reeds) ++ if (plant.func_177230_c() == net.minecraft.init.Blocks.field_150436_aH && this == net.minecraft.init.Blocks.field_150436_aH) + { + return true; + } + -+ if (plantable instanceof BlockBush && ((BlockBush)plantable).canPlaceBlockOn(this)) ++ if (plantable instanceof BlockBush && ((BlockBush)plantable).func_149854_a(this)) + { + return true; + } + + switch (plantType) + { -+ case Desert: return this == net.minecraft.init.Blocks.sand || this == net.minecraft.init.Blocks.hardened_clay || this == net.minecraft.init.Blocks.stained_hardened_clay || this == net.minecraft.init.Blocks.dirt; -+ case Nether: return this == net.minecraft.init.Blocks.soul_sand; -+ case Crop: return this == net.minecraft.init.Blocks.farmland; ++ case Desert: return this == net.minecraft.init.Blocks.field_150354_m || this == net.minecraft.init.Blocks.field_150405_ch || this == net.minecraft.init.Blocks.field_150406_ce || this == net.minecraft.init.Blocks.field_150346_d; ++ case Nether: return this == net.minecraft.init.Blocks.field_150425_aM; ++ case Crop: return this == net.minecraft.init.Blocks.field_150458_ak; + case Cave: return isSideSolid(world, pos, EnumFacing.UP); -+ case Plains: return this == net.minecraft.init.Blocks.grass || this == net.minecraft.init.Blocks.dirt || this == net.minecraft.init.Blocks.farmland; -+ case Water: return getMaterial() == Material.water && ((Integer)state.getValue(BlockLiquid.LEVEL)) == 0; ++ case Plains: return this == net.minecraft.init.Blocks.field_150349_c || this == net.minecraft.init.Blocks.field_150346_d || this == net.minecraft.init.Blocks.field_150458_ak; ++ case Water: return func_149688_o() == Material.field_151586_h && ((Integer)state.func_177229_b(BlockLiquid.field_176367_b)) == 0; + case Beach: -+ boolean isBeach = this == net.minecraft.init.Blocks.grass || this == net.minecraft.init.Blocks.dirt || this == net.minecraft.init.Blocks.sand; -+ boolean hasWater = (world.getBlockState(pos.east()).getBlock().getMaterial() == Material.water || -+ world.getBlockState(pos.west()).getBlock().getMaterial() == Material.water || -+ world.getBlockState(pos.north()).getBlock().getMaterial() == Material.water || -+ world.getBlockState(pos.south()).getBlock().getMaterial() == Material.water); ++ boolean isBeach = this == net.minecraft.init.Blocks.field_150349_c || this == net.minecraft.init.Blocks.field_150346_d || this == net.minecraft.init.Blocks.field_150354_m; ++ boolean hasWater = (world.func_180495_p(pos.func_177974_f()).func_177230_c().func_149688_o() == Material.field_151586_h || ++ world.func_180495_p(pos.func_177976_e()).func_177230_c().func_149688_o() == Material.field_151586_h || ++ world.func_180495_p(pos.func_177978_c()).func_177230_c().func_149688_o() == Material.field_151586_h || ++ world.func_180495_p(pos.func_177968_d()).func_177230_c().func_149688_o() == Material.field_151586_h); + return isBeach && hasWater; + } + @@ -888,9 +888,9 @@ + */ + public void onPlantGrow(World world, BlockPos pos, BlockPos source) + { -+ if (this == net.minecraft.init.Blocks.grass || this == net.minecraft.init.Blocks.farmland) ++ if (this == net.minecraft.init.Blocks.field_150349_c || this == net.minecraft.init.Blocks.field_150458_ak) + { -+ world.setBlockState(pos, net.minecraft.init.Blocks.dirt.getDefaultState(), 2); ++ world.func_180501_a(pos, net.minecraft.init.Blocks.field_150346_d.func_176223_P(), 2); + } + } + @@ -905,9 +905,9 @@ + */ + public boolean isFertile(World world, BlockPos pos) + { -+ if (this == net.minecraft.init.Blocks.farmland) ++ if (this == net.minecraft.init.Blocks.field_150458_ak) + { -+ return ((Integer)world.getBlockState(pos).getValue(BlockFarmland.MOISTURE)) > 0; ++ return ((Integer)world.func_180495_p(pos).func_177229_b(BlockFarmland.field_176531_a)) > 0; + } + + return false; @@ -927,7 +927,7 @@ + */ + public int getLightOpacity(IBlockAccess world, BlockPos pos) + { -+ return getLightOpacity(); ++ return func_149717_k(); + } + + /** @@ -941,7 +941,7 @@ + { + if (entity instanceof net.minecraft.entity.boss.EntityDragon) + { -+ return this != net.minecraft.init.Blocks.barrier && this != net.minecraft.init.Blocks.obsidian && this != net.minecraft.init.Blocks.end_stone && this != net.minecraft.init.Blocks.bedrock && this != net.minecraft.init.Blocks.command_block; ++ return this != net.minecraft.init.Blocks.field_180401_cv && this != net.minecraft.init.Blocks.field_150343_Z && this != net.minecraft.init.Blocks.field_150377_bs && this != net.minecraft.init.Blocks.field_150357_h && this != net.minecraft.init.Blocks.field_150483_bI; + } + + return true; @@ -957,7 +957,7 @@ + */ + public boolean isBeaconBase(IBlockAccess worldObj, BlockPos pos, BlockPos beacon) + { -+ return this == net.minecraft.init.Blocks.emerald_block || this == net.minecraft.init.Blocks.gold_block || this == net.minecraft.init.Blocks.diamond_block || this == net.minecraft.init.Blocks.iron_block; ++ return this == net.minecraft.init.Blocks.field_150475_bE || this == net.minecraft.init.Blocks.field_150340_R || this == net.minecraft.init.Blocks.field_150484_ah || this == net.minecraft.init.Blocks.field_150339_S; + } + + /** @@ -973,12 +973,12 @@ + */ + public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) + { -+ IBlockState state = world.getBlockState(pos); -+ for (IProperty prop : (java.util.Set)state.getProperties().keySet()) ++ IBlockState state = world.func_180495_p(pos); ++ for (IProperty prop : (java.util.Set)state.func_177228_b().keySet()) + { -+ if (prop.getName().equals("facing") || prop.getName().equals("rotation")) ++ if (prop.func_177701_a().equals("facing") || prop.func_177701_a().equals("rotation")) + { -+ world.setBlockState(pos, state.cycleProperty(prop)); ++ world.func_175656_a(pos, state.func_177231_a(prop)); + return true; + } + } @@ -994,12 +994,12 @@ + */ + public EnumFacing[] getValidRotations(World world, BlockPos pos) + { -+ IBlockState state = world.getBlockState(pos); -+ for (IProperty prop : (java.util.Set)state.getProperties().keySet()) ++ IBlockState state = world.func_180495_p(pos); ++ for (IProperty prop : (java.util.Set)state.func_177228_b().keySet()) + { -+ if (prop.getName().equals("facing") && prop.getValueClass() == EnumFacing.class) ++ if (prop.func_177701_a().equals("facing") && prop.func_177699_b() == EnumFacing.class) + { -+ java.util.Collection values = ((java.util.Collection)prop.getAllowedValues()); ++ java.util.Collection values = ((java.util.Collection)prop.func_177700_c()); + return values.toArray(new EnumFacing[values.size()]); + } + } @@ -1014,7 +1014,7 @@ + */ + public float getEnchantPowerBonus(World world, BlockPos pos) + { -+ return this == net.minecraft.init.Blocks.bookshelf ? 1 : 0; ++ return this == net.minecraft.init.Blocks.field_150342_X ? 1 : 0; + } + + /** @@ -1027,15 +1027,15 @@ + */ + public boolean recolorBlock(World world, BlockPos pos, EnumFacing side, net.minecraft.item.EnumDyeColor color) + { -+ IBlockState state = world.getBlockState(pos); -+ for (IProperty prop : (java.util.Set)state.getProperties().keySet()) ++ IBlockState state = world.func_180495_p(pos); ++ for (IProperty prop : (java.util.Set)state.func_177228_b().keySet()) + { -+ if (prop.getName().equals("color") && prop.getValueClass() == net.minecraft.item.EnumDyeColor.class) ++ if (prop.func_177701_a().equals("color") && prop.func_177699_b() == net.minecraft.item.EnumDyeColor.class) + { -+ net.minecraft.item.EnumDyeColor current = (net.minecraft.item.EnumDyeColor)state.getValue(prop); ++ net.minecraft.item.EnumDyeColor current = (net.minecraft.item.EnumDyeColor)state.func_177229_b(prop); + if (current != color) + { -+ world.setBlockState(pos, state.withProperty(prop, color)); ++ world.func_175656_a(pos, state.func_177226_a(prop, color)); + return true; + } + } @@ -1073,7 +1073,7 @@ + */ + public boolean shouldCheckWeakPower(IBlockAccess world, BlockPos pos, EnumFacing side) + { -+ return isNormalCube(); ++ return func_149721_r(); + } + + /** @@ -1106,7 +1106,7 @@ + */ + public void setHarvestLevel(String toolClass, int level) + { -+ java.util.Iterator itr = getBlockState().getValidStates().iterator(); ++ java.util.Iterator itr = func_176194_O().func_177619_a().iterator(); + while (itr.hasNext()) + { + setHarvestLevel(toolClass, level, itr.next()); @@ -1127,7 +1127,7 @@ + */ + public void setHarvestLevel(String toolClass, int level, IBlockState state) + { -+ int idx = this.getMetaFromState(state); ++ int idx = this.func_176201_c(state); + this.harvestTool[idx] = toolClass; + this.harvestLevel[idx] = level; + } @@ -1138,7 +1138,7 @@ + */ + public String getHarvestTool(IBlockState state) + { -+ return harvestTool[getMetaFromState(state)]; ++ return harvestTool[func_176201_c(state)]; + } + + /** @@ -1150,7 +1150,7 @@ + */ + public int getHarvestLevel(IBlockState state) + { -+ return harvestLevel[getMetaFromState(state)]; ++ return harvestLevel[func_176201_c(state)]; + } + + /** @@ -1159,7 +1159,7 @@ + */ + public boolean isToolEffective(String type, IBlockState state) + { -+ if ("pickaxe".equals(type) && (this == net.minecraft.init.Blocks.redstone_ore || this == net.minecraft.init.Blocks.lit_redstone_ore || this == net.minecraft.init.Blocks.obsidian)) ++ if ("pickaxe".equals(type) && (this == net.minecraft.init.Blocks.field_150450_ax || this == net.minecraft.init.Blocks.field_150439_ay || this == net.minecraft.init.Blocks.field_150343_Z)) + return false; + return type != null && type.equals(getHarvestTool(state)); + } @@ -1169,7 +1169,7 @@ + */ + public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) + { -+ return getActualState(state, world, pos); ++ return func_176221_a(state, world, pos); + } + + /** @@ -1178,7 +1178,7 @@ + */ + public boolean canRenderInLayer(EnumWorldBlockLayer layer) + { -+ return getBlockLayer() == layer; ++ return func_180664_k() == layer; + } + + // For Internal use only to capture droped items inside getDrops @@ -1206,6 +1206,6 @@ + } + /* ========================================= FORGE END ======================================*/ + - public static void registerBlocks() + public static void func_149671_p() { - registerBlock(0, AIR_ID, (new BlockAir()).setUnlocalizedName("air")); + func_176215_a(0, field_176230_a, (new BlockAir()).func_149663_c("air")); diff --git a/patches/minecraft/net/minecraft/block/BlockBush.java.patch b/patches/minecraft/net/minecraft/block/BlockBush.java.patch index 26af27af2..c8c22a6eb 100644 --- a/patches/minecraft/net/minecraft/block/BlockBush.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockBush.java.patch @@ -11,25 +11,25 @@ { @@ -36,7 +36,7 @@ - public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) { -- return super.canPlaceBlockAt(worldIn, pos) && this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); -+ return super.canPlaceBlockAt(worldIn, pos) && worldIn.getBlockState(pos.down()).getBlock().canSustainPlant(worldIn, pos.down(), net.minecraft.util.EnumFacing.UP, this); +- return super.func_176196_c(p_176196_1_, p_176196_2_) && this.func_149854_a(p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c()); ++ return super.func_176196_c(p_176196_1_, p_176196_2_) && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c().canSustainPlant(p_176196_1_, p_176196_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this); } - protected boolean canPlaceBlockOn(Block ground) + protected boolean func_149854_a(Block p_149854_1_) @@ -66,7 +66,10 @@ - public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_) { -- return this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); -+ BlockPos down = pos.down(); -+ Block soil = worldIn.getBlockState(down).getBlock(); -+ if (state.getBlock() != this) return this.canPlaceBlockOn(soil); //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. -+ return soil.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, this); +- return this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c()); ++ BlockPos down = p_180671_2_.func_177977_b(); ++ Block soil = p_180671_1_.func_180495_p(down).func_177230_c(); ++ if (p_180671_3_.func_177230_c() != this) return this.func_149854_a(soil); //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. ++ return soil.canSustainPlant(p_180671_1_, down, net.minecraft.util.EnumFacing.UP, this); } - public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) + public AxisAlignedBB func_180640_a(World p_180640_1_, BlockPos p_180640_2_, IBlockState p_180640_3_) @@ -89,4 +92,33 @@ { return EnumWorldBlockLayer.CUTOUT; @@ -38,29 +38,29 @@ + @Override + public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) + { -+ if (this == Blocks.wheat) return net.minecraftforge.common.EnumPlantType.Crop; -+ if (this == Blocks.carrots) return net.minecraftforge.common.EnumPlantType.Crop; -+ if (this == Blocks.potatoes) return net.minecraftforge.common.EnumPlantType.Crop; -+ if (this == Blocks.melon_stem) return net.minecraftforge.common.EnumPlantType.Crop; -+ if (this == Blocks.pumpkin_stem) return net.minecraftforge.common.EnumPlantType.Crop; -+ if (this == Blocks.deadbush) return net.minecraftforge.common.EnumPlantType.Desert; -+ if (this == Blocks.waterlily) return net.minecraftforge.common.EnumPlantType.Water; -+ if (this == Blocks.red_mushroom) return net.minecraftforge.common.EnumPlantType.Cave; -+ if (this == Blocks.brown_mushroom) return net.minecraftforge.common.EnumPlantType.Cave; -+ if (this == Blocks.nether_wart) return net.minecraftforge.common.EnumPlantType.Nether; -+ if (this == Blocks.sapling) return net.minecraftforge.common.EnumPlantType.Plains; -+ if (this == Blocks.tallgrass) return net.minecraftforge.common.EnumPlantType.Plains; -+ if (this == Blocks.double_plant) return net.minecraftforge.common.EnumPlantType.Plains; -+ if (this == Blocks.red_flower) return net.minecraftforge.common.EnumPlantType.Plains; -+ if (this == Blocks.yellow_flower) return net.minecraftforge.common.EnumPlantType.Plains; ++ if (this == Blocks.field_150464_aj) return net.minecraftforge.common.EnumPlantType.Crop; ++ if (this == Blocks.field_150459_bM) return net.minecraftforge.common.EnumPlantType.Crop; ++ if (this == Blocks.field_150469_bN) return net.minecraftforge.common.EnumPlantType.Crop; ++ if (this == Blocks.field_150394_bc) return net.minecraftforge.common.EnumPlantType.Crop; ++ if (this == Blocks.field_150393_bb) return net.minecraftforge.common.EnumPlantType.Crop; ++ if (this == Blocks.field_150330_I) return net.minecraftforge.common.EnumPlantType.Desert; ++ if (this == Blocks.field_150392_bi) return net.minecraftforge.common.EnumPlantType.Water; ++ if (this == Blocks.field_150337_Q) return net.minecraftforge.common.EnumPlantType.Cave; ++ if (this == Blocks.field_150338_P) return net.minecraftforge.common.EnumPlantType.Cave; ++ if (this == Blocks.field_150388_bm) return net.minecraftforge.common.EnumPlantType.Nether; ++ if (this == Blocks.field_150345_g) return net.minecraftforge.common.EnumPlantType.Plains; ++ if (this == Blocks.field_150329_H) return net.minecraftforge.common.EnumPlantType.Plains; ++ if (this == Blocks.field_150398_cm) return net.minecraftforge.common.EnumPlantType.Plains; ++ if (this == Blocks.field_150328_O) return net.minecraftforge.common.EnumPlantType.Plains; ++ if (this == Blocks.field_150327_N) return net.minecraftforge.common.EnumPlantType.Plains; + return net.minecraftforge.common.EnumPlantType.Plains; + } + + @Override + public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos) + { -+ IBlockState state = world.getBlockState(pos); -+ if (state.getBlock() != this) return getDefaultState(); ++ IBlockState state = world.func_180495_p(pos); ++ if (state.func_177230_c() != this) return func_176223_P(); + return state; + } } diff --git a/patches/minecraft/net/minecraft/block/BlockButton.java.patch b/patches/minecraft/net/minecraft/block/BlockButton.java.patch index c5bfc5fa7..c4ca0f384 100644 --- a/patches/minecraft/net/minecraft/block/BlockButton.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockButton.java.patch @@ -4,9 +4,9 @@ protected static boolean func_181088_a(World p_181088_0_, BlockPos p_181088_1_, EnumFacing p_181088_2_) { -- BlockPos blockpos = p_181088_1_.offset(p_181088_2_); -- return p_181088_2_ == EnumFacing.DOWN ? World.doesBlockHaveSolidTopSurface(p_181088_0_, blockpos) : p_181088_0_.getBlockState(blockpos).getBlock().isNormalCube(); -+ return p_181088_2_ == EnumFacing.UP && World.doesBlockHaveSolidTopSurface(p_181088_0_, p_181088_1_.down()) ? true : p_181088_0_.isSideSolid(p_181088_1_.offset(p_181088_2_.getOpposite()), p_181088_2_); +- BlockPos blockpos = p_181088_1_.func_177972_a(p_181088_2_); +- return p_181088_2_ == EnumFacing.DOWN ? World.func_175683_a(p_181088_0_, blockpos) : p_181088_0_.func_180495_p(blockpos).func_177230_c().func_149721_r(); ++ return p_181088_2_ == EnumFacing.UP && World.func_175683_a(p_181088_0_, p_181088_1_.func_177977_b()) ? true : p_181088_0_.isSideSolid(p_181088_1_.func_177972_a(p_181088_2_.func_176734_d()), p_181088_2_); } - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_) diff --git a/patches/minecraft/net/minecraft/block/BlockCactus.java.patch b/patches/minecraft/net/minecraft/block/BlockCactus.java.patch index 04f56d217..17dfb0356 100644 --- a/patches/minecraft/net/minecraft/block/BlockCactus.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCactus.java.patch @@ -7,20 +7,20 @@ -public class BlockCactus extends Block +public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable { - public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15); + public static final PropertyInteger field_176587_a = PropertyInteger.func_177719_a("age", 0, 15); @@ -109,7 +109,7 @@ } - Block block = worldIn.getBlockState(pos.down()).getBlock(); -- return block == Blocks.cactus || block == Blocks.sand; -+ return block.canSustainPlant(worldIn, pos.down(), EnumFacing.UP, this); + Block block = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b()).func_177230_c(); +- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m; ++ return block.canSustainPlant(p_176586_1_, p_176586_2_.func_177977_b(), EnumFacing.UP, this); } - public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) + public void func_180634_a(World p_180634_1_, BlockPos p_180634_2_, IBlockState p_180634_3_, Entity p_180634_4_) @@ -137,4 +137,16 @@ { - return new BlockState(this, new IProperty[] {AGE}); + return new BlockState(this, new IProperty[] {field_176587_a}); } + + @Override @@ -32,6 +32,6 @@ + @Override + public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos) + { -+ return getDefaultState(); ++ return func_176223_P(); + } } diff --git a/patches/minecraft/net/minecraft/block/BlockChest.java.patch b/patches/minecraft/net/minecraft/block/BlockChest.java.patch index af3911451..90f209e19 100644 --- a/patches/minecraft/net/minecraft/block/BlockChest.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockChest.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockChest.java @@ -527,7 +527,7 @@ - private boolean isBelowSolidBlock(World worldIn, BlockPos pos) + private boolean func_176456_n(World p_176456_1_, BlockPos p_176456_2_) { -- return worldIn.getBlockState(pos.up()).getBlock().isNormalCube(); -+ return worldIn.isSideSolid(pos.up(), EnumFacing.DOWN, false); +- return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).func_177230_c().func_149721_r(); ++ return p_176456_1_.isSideSolid(p_176456_2_.func_177984_a(), EnumFacing.DOWN, false); } - private boolean isOcelotSittingOnChest(World worldIn, BlockPos pos) + private boolean func_176453_o(World p_176453_1_, BlockPos p_176453_2_) diff --git a/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch b/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch index e5f3922b4..5ecbf9a68 100644 --- a/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCocoa.java.patch @@ -1,25 +1,27 @@ --- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java +++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java -@@ -137,6 +137,13 @@ +@@ -137,7 +137,14 @@ - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { -+ super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); +- int i = ((Integer)p_180653_3_.func_177229_b(field_176501_a)).intValue(); ++ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); + } + + @Override + public java.util.List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + java.util.List dropped = super.getDrops(world, pos, state, fortune); - int i = ((Integer)state.getValue(AGE)).intValue(); ++ int i = ((Integer)state.func_177229_b(field_176501_a)).intValue(); int j = 1; + if (i >= 2) @@ -147,8 +154,9 @@ for (int k = 0; k < j; ++k) { -- spawnAsEntity(worldIn, pos, new ItemStack(Items.dye, 1, EnumDyeColor.BROWN.getDyeDamage())); -+ dropped.add(new ItemStack(Items.dye, 1, EnumDyeColor.BROWN.getDyeDamage())); +- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b())); ++ dropped.add(new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b())); } + return dropped; } diff --git a/patches/minecraft/net/minecraft/block/BlockCrops.java.patch b/patches/minecraft/net/minecraft/block/BlockCrops.java.patch index 3d2a7232a..ed9298153 100644 --- a/patches/minecraft/net/minecraft/block/BlockCrops.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockCrops.java.patch @@ -2,63 +2,63 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java @@ -81,11 +81,11 @@ float f1 = 0.0F; - IBlockState iblockstate = worldIn.getBlockState(blockpos.add(i, 0, j)); + IBlockState iblockstate = p_180672_1_.func_180495_p(blockpos.func_177982_a(i, 0, j)); -- if (iblockstate.getBlock() == Blocks.farmland) -+ if (iblockstate.getBlock().canSustainPlant(worldIn, blockpos.add(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)blockIn)) +- if (iblockstate.func_177230_c() == Blocks.field_150458_ak) ++ if (iblockstate.func_177230_c().canSustainPlant(p_180672_1_, blockpos.func_177982_a(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)p_180672_0_)) { f1 = 1.0F; -- if (((Integer)iblockstate.getValue(BlockFarmland.MOISTURE)).intValue() > 0) -+ if (iblockstate.getBlock().isFertile(worldIn, blockpos.add(i, 0, j))) +- if (((Integer)iblockstate.func_177229_b(BlockFarmland.field_176531_a)).intValue() > 0) ++ if (iblockstate.func_177230_c().isFertile(p_180672_1_, blockpos.func_177982_a(i, 0, j))) { f1 = 3.0F; } @@ -126,7 +126,7 @@ - public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_) { -- return (worldIn.getLight(pos) >= 8 || worldIn.canSeeSky(pos)) && this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); -+ return (worldIn.getLight(pos) >= 8 || worldIn.canSeeSky(pos)) && worldIn.getBlockState(pos.down()).getBlock().canSustainPlant(worldIn, pos.down(), net.minecraft.util.EnumFacing.UP, this); +- return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c()); ++ return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c().canSustainPlant(p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this); } - protected Item getSeed() + protected Item func_149866_i() @@ -142,24 +142,6 @@ - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { - super.dropBlockAsItemWithChance(worldIn, pos, state, chance, 0); + super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, 0); - -- if (!worldIn.isRemote) +- if (!p_180653_1_.field_72995_K) - { -- int i = ((Integer)state.getValue(AGE)).intValue(); +- int i = ((Integer)p_180653_3_.func_177229_b(field_176488_a)).intValue(); - - if (i >= 7) - { -- int j = 3 + fortune; +- int j = 3 + p_180653_5_; - - for (int k = 0; k < j; ++k) - { -- if (worldIn.rand.nextInt(15) <= i) +- if (p_180653_1_.field_73012_v.nextInt(15) <= i) - { -- spawnAsEntity(worldIn, pos, new ItemStack(this.getSeed(), 1, 0)); +- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(this.func_149866_i(), 1, 0)); - } - } - } - } } - public Item getItemDropped(IBlockState state, Random rand, int fortune) + public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_) @@ -202,4 +184,26 @@ { - return new BlockState(this, new IProperty[] {AGE}); + return new BlockState(this, new IProperty[] {field_176488_a}); } + + @Override + public java.util.List getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + java.util.List ret = super.getDrops(world, pos, state, fortune); -+ int age = ((Integer)state.getValue(AGE)).intValue(); -+ Random rand = world instanceof World ? ((World)world).rand : new Random(); ++ int age = ((Integer)state.func_177229_b(field_176488_a)).intValue(); ++ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random(); + + if (age >= 7) + { @@ -68,7 +68,7 @@ + { + if (rand.nextInt(15) <= age) + { -+ ret.add(new ItemStack(this.getSeed(), 1, 0)); ++ ret.add(new ItemStack(this.func_149866_i(), 1, 0)); + } + } + } diff --git a/patches/minecraft/net/minecraft/block/BlockDeadBush.java.patch b/patches/minecraft/net/minecraft/block/BlockDeadBush.java.patch index c0c9491c9..a350513b4 100644 --- a/patches/minecraft/net/minecraft/block/BlockDeadBush.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockDeadBush.java.patch @@ -11,16 +11,16 @@ { @@ -45,14 +45,15 @@ - public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_) { -- if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) +- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) { -- player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); -- spawnAsEntity(worldIn, pos, new ItemStack(Blocks.deadbush, 1, 0)); +- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]); +- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150330_I, 1, 0)); - } - else - { - super.harvestBlock(worldIn, player, pos, state, te); + super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_); } } + @@ -28,6 +28,6 @@ + @Override + public java.util.List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) + { -+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(Blocks.deadbush))); ++ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(Blocks.field_150330_I))); + } } diff --git a/patches/minecraft/net/minecraft/block/BlockDoor.java.patch b/patches/minecraft/net/minecraft/block/BlockDoor.java.patch index ec621d11f..de31efb01 100644 --- a/patches/minecraft/net/minecraft/block/BlockDoor.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockDoor.java.patch @@ -2,7 +2,7 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java @@ -154,7 +154,7 @@ { - if (this.blockMaterial == Material.iron) + if (this.field_149764_J == Material.field_151573_f) { - return true; + return false; //Allow items to interact with the door @@ -11,10 +11,10 @@ { @@ -272,7 +272,7 @@ - public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) { -- return pos.getY() >= 255 ? false : World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && super.canPlaceBlockAt(worldIn, pos) && super.canPlaceBlockAt(worldIn, pos.up()); -+ return pos.getY() >= worldIn.getHeight() - 1 ? false : World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && super.canPlaceBlockAt(worldIn, pos) && super.canPlaceBlockAt(worldIn, pos.up()); +- return p_176196_2_.func_177956_o() >= 255 ? false : World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a()); ++ return p_176196_2_.func_177956_o() >= p_176196_1_.func_72800_K() - 1 ? false : World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a()); } - public int getMobilityFlag() + public int func_149656_h() diff --git a/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch b/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch index 8cbc62e73..2218435af 100644 --- a/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockDoublePlant.java.patch @@ -7,50 +7,50 @@ -public class BlockDoublePlant extends BlockBush implements IGrowable +public class BlockDoublePlant extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable { - public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockDoublePlant.EnumPlantType.class); - public static final PropertyEnum HALF = PropertyEnum.create("half", BlockDoublePlant.EnumBlockHalf.class); + public static final PropertyEnum field_176493_a = PropertyEnum.func_177709_a("variant", BlockDoublePlant.EnumPlantType.class); + public static final PropertyEnum field_176492_b = PropertyEnum.func_177709_a("half", BlockDoublePlant.EnumBlockHalf.class); @@ -90,6 +90,8 @@ - Block block = (Block)(flag ? this : worldIn.getBlockState(blockpos).getBlock()); - Block block1 = (Block)(flag ? worldIn.getBlockState(blockpos1).getBlock() : this); + Block block = (Block)(flag ? this : p_176475_1_.func_180495_p(blockpos).func_177230_c()); + Block block1 = (Block)(flag ? p_176475_1_.func_180495_p(blockpos1).func_177230_c() : this); -+ if (!flag) this.dropBlockAsItem(worldIn, pos, state, 0); //Forge move above the setting to air. ++ if (!flag) this.func_176226_b(p_176475_1_, p_176475_2_, p_176475_3_, 0); //Forge move above the setting to air. + if (block == this) { - worldIn.setBlockState(blockpos, Blocks.air.getDefaultState(), 2); + p_176475_1_.func_180501_a(blockpos, Blocks.field_150350_a.func_176223_P(), 2); @@ -98,17 +100,13 @@ if (block1 == this) { - worldIn.setBlockState(blockpos1, Blocks.air.getDefaultState(), 3); + p_176475_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 3); - - if (!flag) - { -- this.dropBlockAsItem(worldIn, blockpos1, state, 0); +- this.func_176226_b(p_176475_1_, blockpos1, p_176475_3_, 0); - } } } } - public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_) { -+ if (state.getBlock() != this) return super.canBlockStay(worldIn, pos, state); //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 (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) ++ if (p_180671_3_.func_177230_c() != this) return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_); //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_180671_3_.func_177229_b(field_176492_b) == BlockDoublePlant.EnumBlockHalf.UPPER) { - return worldIn.getBlockState(pos.down()).getBlock() == this; + return p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c() == this; @@ -158,7 +156,6 @@ - public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_) { -- if (worldIn.isRemote || player.getCurrentEquippedItem() == null || player.getCurrentEquippedItem().getItem() != Items.shears || state.getValue(HALF) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.onHarvest(worldIn, pos, state, player)) +- if (p_180657_1_.field_72995_K || p_180657_2_.func_71045_bC() == null || p_180657_2_.func_71045_bC().func_77973_b() != Items.field_151097_aZ || p_180657_4_.func_177229_b(field_176492_b) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.func_176489_b(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_)) { - super.harvestBlock(worldIn, player, pos, state, te); + super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_); } @@ -221,8 +218,6 @@ else { - player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); -- int i = (blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS ? BlockTallGrass.EnumType.GRASS : BlockTallGrass.EnumType.FERN).getMeta(); -- spawnAsEntity(worldIn, pos, new ItemStack(Blocks.tallgrass, 2, i)); + p_176489_4_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]); +- int i = (blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS ? BlockTallGrass.EnumType.GRASS : BlockTallGrass.EnumType.FERN).func_177044_a(); +- func_180635_a(p_176489_1_, p_176489_2_, new ItemStack(Blocks.field_150329_H, 2, i)); return true; } } @@ -61,27 +61,27 @@ + @Override + public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos) + { -+ IBlockState state = world.getBlockState(pos); -+ EnumPlantType type = (EnumPlantType)state.getValue(VARIANT); -+ return state.getValue(HALF) == EnumBlockHalf.LOWER && (type == EnumPlantType.FERN || type == EnumPlantType.GRASS); ++ IBlockState state = world.func_180495_p(pos); ++ EnumPlantType type = (EnumPlantType)state.func_177229_b(field_176493_a); ++ return state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && (type == EnumPlantType.FERN || type == EnumPlantType.GRASS); + } + @Override + public java.util.List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) + { + java.util.List ret = new java.util.ArrayList(); -+ EnumPlantType type = (EnumPlantType)world.getBlockState(pos).getValue(VARIANT); -+ if (type == EnumPlantType.FERN) ret.add(new ItemStack(Blocks.tallgrass, 2, BlockTallGrass.EnumType.FERN.getMeta())); -+ if (type == EnumPlantType.GRASS) ret.add(new ItemStack(Blocks.tallgrass, 2, BlockTallGrass.EnumType.GRASS.getMeta())); ++ EnumPlantType type = (EnumPlantType)world.func_180495_p(pos).func_177229_b(field_176493_a); ++ if (type == EnumPlantType.FERN) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.FERN.func_177044_a())); ++ if (type == EnumPlantType.GRASS) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.GRASS.func_177044_a())); + return ret; + } + @Override + public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest) + { + //Forge: Break both parts on the client to prevent the top part flickering as default type for a few frames. -+ IBlockState state = world.getBlockState(pos); -+ if (state.getBlock() == this && state.getValue(HALF) == EnumBlockHalf.LOWER && world.getBlockState(pos.up()).getBlock() == this) -+ world.setBlockToAir(pos.up()); -+ return world.setBlockToAir(pos); ++ IBlockState state = world.func_180495_p(pos); ++ if (state.func_177230_c() == this && state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && world.func_180495_p(pos.func_177984_a()).func_177230_c() == this) ++ world.func_175698_g(pos.func_177984_a()); ++ return world.func_175698_g(pos); + } + public static enum EnumBlockHalf implements IStringSerializable diff --git a/patches/minecraft/net/minecraft/block/BlockFalling.java.patch b/patches/minecraft/net/minecraft/block/BlockFalling.java.patch index 4ac1d2847..811cb1a2c 100644 --- a/patches/minecraft/net/minecraft/block/BlockFalling.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFalling.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java @@ -86,6 +86,7 @@ - public static boolean canFallInto(World worldIn, BlockPos pos) + public static boolean func_180685_d(World p_180685_0_, BlockPos p_180685_1_) { -+ if (worldIn.isAirBlock(pos)) return true; - Block block = worldIn.getBlockState(pos).getBlock(); - Material material = block.blockMaterial; - return block == Blocks.fire || material == Material.air || material == Material.water || material == Material.lava; ++ if (p_180685_0_.func_175623_d(p_180685_1_)) return true; + Block block = p_180685_0_.func_180495_p(p_180685_1_).func_177230_c(); + Material material = block.field_149764_J; + return block == Blocks.field_150480_ab || material == Material.field_151579_a || material == Material.field_151586_h || material == Material.field_151587_i; diff --git a/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch b/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch index b94b5429e..7547658d3 100644 --- a/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFarmland.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java +++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java @@ -89,7 +89,7 @@ - private boolean hasCrops(World worldIn, BlockPos pos) + private boolean func_176529_d(World p_176529_1_, BlockPos p_176529_2_) { - Block block = worldIn.getBlockState(pos.up()).getBlock(); + Block block = p_176529_1_.func_180495_p(p_176529_2_.func_177984_a()).func_177230_c(); - return block instanceof BlockCrops || block instanceof BlockStem; -+ return block instanceof net.minecraftforge.common.IPlantable && canSustainPlant(worldIn, pos, net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)block); ++ return block instanceof net.minecraftforge.common.IPlantable && canSustainPlant(p_176529_1_, p_176529_2_, net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)block); } - private boolean hasWater(World worldIn, BlockPos pos) + private boolean func_176530_e(World p_176530_1_, BlockPos p_176530_2_) diff --git a/patches/minecraft/net/minecraft/block/BlockFire.java.patch b/patches/minecraft/net/minecraft/block/BlockFire.java.patch index 287e8d5dd..05ab962bc 100644 --- a/patches/minecraft/net/minecraft/block/BlockFire.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFire.java.patch @@ -1,81 +1,81 @@ --- ../src-base/minecraft/net/minecraft/block/BlockFire.java +++ ../src-work/minecraft/net/minecraft/block/BlockFire.java @@ -41,18 +41,24 @@ - int j = pos.getY(); - int k = pos.getZ(); + int j = p_176221_3_.func_177956_o(); + int k = p_176221_3_.func_177952_p(); -- if (!World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && !Blocks.fire.canCatchFire(worldIn, pos.down())) -+ if (!World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && !Blocks.fire.canCatchFire(worldIn, pos.down(), EnumFacing.UP)) +- if (!World.func_175683_a(p_176221_2_, p_176221_3_.func_177977_b()) && !Blocks.field_150480_ab.func_176535_e(p_176221_2_, p_176221_3_.func_177977_b())) ++ if (!World.func_175683_a(p_176221_2_, p_176221_3_.func_177977_b()) && !Blocks.field_150480_ab.canCatchFire(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP)) { boolean flag = (i + j + k & 1) == 1; boolean flag1 = (i / 2 + j / 2 + k / 2 & 1) == 1; int l = 0; -- if (this.canCatchFire(worldIn, pos.up())) -+ if (this.canCatchFire(worldIn, pos.up(), EnumFacing.DOWN)) +- if (this.func_176535_e(p_176221_2_, p_176221_3_.func_177984_a())) ++ if (this.canCatchFire(p_176221_2_, p_176221_3_.func_177984_a(), EnumFacing.DOWN)) { l = flag ? 1 : 2; } -- return state.withProperty(NORTH, Boolean.valueOf(this.canCatchFire(worldIn, pos.north()))).withProperty(EAST, Boolean.valueOf(this.canCatchFire(worldIn, pos.east()))).withProperty(SOUTH, Boolean.valueOf(this.canCatchFire(worldIn, pos.south()))).withProperty(WEST, Boolean.valueOf(this.canCatchFire(worldIn, pos.west()))).withProperty(UPPER, Integer.valueOf(l)).withProperty(FLIP, Boolean.valueOf(flag1)).withProperty(ALT, Boolean.valueOf(flag)); -+ return state.withProperty(NORTH, Boolean.valueOf(this.canCatchFire(worldIn, pos.north(), EnumFacing.SOUTH))) -+ .withProperty(EAST, Boolean.valueOf(this.canCatchFire(worldIn, pos.east(), EnumFacing.EAST ))) -+ .withProperty(SOUTH, Boolean.valueOf(this.canCatchFire(worldIn, pos.south(), EnumFacing.NORTH))) -+ .withProperty(WEST, Boolean.valueOf(this.canCatchFire(worldIn, pos.west(), EnumFacing.EAST ))) -+ .withProperty(UPPER, Integer.valueOf(l)) -+ .withProperty(FLIP, Boolean.valueOf(flag1)) -+ .withProperty(ALT, Boolean.valueOf(flag)); +- return p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177978_c()))).func_177226_a(field_176546_O, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177974_f()))).func_177226_a(field_176541_P, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177968_d()))).func_177226_a(field_176539_Q, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177976_e()))).func_177226_a(field_176542_R, Integer.valueOf(l)).func_177226_a(field_176540_b, Boolean.valueOf(flag1)).func_177226_a(field_176544_M, Boolean.valueOf(flag)); ++ return p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH))) ++ .func_177226_a(field_176546_O, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.EAST ))) ++ .func_177226_a(field_176541_P, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH))) ++ .func_177226_a(field_176539_Q, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST ))) ++ .func_177226_a(field_176542_R, Integer.valueOf(l)) ++ .func_177226_a(field_176540_b, Boolean.valueOf(flag1)) ++ .func_177226_a(field_176544_M, Boolean.valueOf(flag)); } else { @@ -108,6 +114,7 @@ - public void setFireInfo(Block blockIn, int encouragement, int flammability) + public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_) { -+ if (blockIn == Blocks.air) throw new IllegalArgumentException("Tried to set air on fire... This is bad."); - this.encouragements.put(blockIn, Integer.valueOf(encouragement)); - this.flammabilities.put(blockIn, Integer.valueOf(flammability)); ++ if (p_180686_1_ == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad."); + this.field_149849_a.put(p_180686_1_, Integer.valueOf(p_180686_2_)); + this.field_149848_b.put(p_180686_1_, Integer.valueOf(p_180686_3_)); } @@ -147,13 +154,8 @@ } - Block block = worldIn.getBlockState(pos.down()).getBlock(); -- boolean flag = block == Blocks.netherrack; -+ boolean flag = block.isFireSource(worldIn, pos.down(), EnumFacing.UP); + Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c(); +- boolean flag = block == Blocks.field_150424_aL; ++ boolean flag = block.isFireSource(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP); -- if (worldIn.provider instanceof WorldProviderEnd && block == Blocks.bedrock) +- if (p_180650_1_.field_73011_w instanceof WorldProviderEnd && block == Blocks.field_150357_h) - { - flag = true; - } - - if (!flag && worldIn.isRaining() && this.canDie(worldIn, pos)) + if (!flag && p_180650_1_.func_72896_J() && this.func_176537_d(p_180650_1_, p_180650_2_)) { - worldIn.setBlockToAir(pos); + p_180650_1_.func_175698_g(p_180650_2_); @@ -182,7 +184,7 @@ return; } -- if (!this.canCatchFire(worldIn, pos.down()) && i == 15 && rand.nextInt(4) == 0) -+ if (!this.canCatchFire(worldIn, pos.down(), EnumFacing.UP) && i == 15 && rand.nextInt(4) == 0) +- if (!this.func_176535_e(p_180650_1_, p_180650_2_.func_177977_b()) && i == 15 && p_180650_4_.nextInt(4) == 0) ++ if (!this.canCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP) && i == 15 && p_180650_4_.nextInt(4) == 0) { - worldIn.setBlockToAir(pos); + p_180650_1_.func_175698_g(p_180650_2_); return; @@ -197,12 +199,12 @@ j = -50; } -- this.catchOnFire(worldIn, pos.east(), 300 + j, rand, i); -- this.catchOnFire(worldIn, pos.west(), 300 + j, rand, i); -- this.catchOnFire(worldIn, pos.down(), 250 + j, rand, i); -- this.catchOnFire(worldIn, pos.up(), 250 + j, rand, i); -- this.catchOnFire(worldIn, pos.north(), 300 + j, rand, i); -- this.catchOnFire(worldIn, pos.south(), 300 + j, rand, i); -+ this.tryCatchFire(worldIn, pos.east(), 300 + j, rand, i, EnumFacing.WEST); -+ this.tryCatchFire(worldIn, pos.west(), 300 + j, rand, i, EnumFacing.EAST); -+ this.tryCatchFire(worldIn, pos.down(), 250 + j, rand, i, EnumFacing.UP); -+ this.tryCatchFire(worldIn, pos.up(), 250 + j, rand, i, EnumFacing.DOWN); -+ this.tryCatchFire(worldIn, pos.north(), 300 + j, rand, i, EnumFacing.SOUTH); -+ this.tryCatchFire(worldIn, pos.south(), 300 + j, rand, i, EnumFacing.NORTH); +- this.func_176536_a(p_180650_1_, p_180650_2_.func_177974_f(), 300 + j, p_180650_4_, i); +- this.func_176536_a(p_180650_1_, p_180650_2_.func_177976_e(), 300 + j, p_180650_4_, i); +- this.func_176536_a(p_180650_1_, p_180650_2_.func_177977_b(), 250 + j, p_180650_4_, i); +- this.func_176536_a(p_180650_1_, p_180650_2_.func_177984_a(), 250 + j, p_180650_4_, i); +- this.func_176536_a(p_180650_1_, p_180650_2_.func_177978_c(), 300 + j, p_180650_4_, i); +- this.func_176536_a(p_180650_1_, p_180650_2_.func_177968_d(), 300 + j, p_180650_4_, i); ++ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177974_f(), 300 + j, p_180650_4_, i, EnumFacing.WEST); ++ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177976_e(), 300 + j, p_180650_4_, i, EnumFacing.EAST); ++ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), 250 + j, p_180650_4_, i, EnumFacing.UP); ++ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177984_a(), 250 + j, p_180650_4_, i, EnumFacing.DOWN); ++ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177978_c(), 300 + j, p_180650_4_, i, EnumFacing.SOUTH); ++ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177968_d(), 300 + j, p_180650_4_, i, EnumFacing.NORTH); for (int k = -1; k <= 1; ++k) { @@ -84,39 +84,39 @@ } + @Deprecated // Use Block.getFlammability - public int getFlammability(Block blockIn) + public int func_176532_c(Block p_176532_1_) { - Integer integer = (Integer)this.flammabilities.get(blockIn); + Integer integer = (Integer)this.field_149848_b.get(p_176532_1_); return integer == null ? 0 : integer.intValue(); } + @Deprecated // Use Block.getFlammability - public int getEncouragement(Block blockIn) + public int func_176534_d(Block p_176534_1_) { - Integer integer = (Integer)this.encouragements.get(blockIn); + Integer integer = (Integer)this.field_149849_a.get(p_176534_1_); return integer == null ? 0 : integer.intValue(); } + @Deprecated // Use tryCatchFire with face below - private void catchOnFire(World worldIn, BlockPos pos, int chance, Random random, int age) + private void func_176536_a(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_) { -- int i = this.getFlammability(worldIn.getBlockState(pos).getBlock()); -+ this.tryCatchFire(worldIn, pos, chance, random, age, EnumFacing.UP); +- int i = this.func_176532_c(p_176536_1_.func_180495_p(p_176536_2_).func_177230_c()); ++ this.tryCatchFire(p_176536_1_, p_176536_2_, p_176536_3_, p_176536_4_, p_176536_5_, EnumFacing.UP); + } -+ private void tryCatchFire(World worldIn, BlockPos pos, int chance, Random random, int age, EnumFacing face) ++ private void tryCatchFire(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_, EnumFacing face) + { -+ int i = worldIn.getBlockState(pos).getBlock().getFlammability(worldIn, pos, face); ++ int i = p_176536_1_.func_180495_p(p_176536_2_).func_177230_c().getFlammability(p_176536_1_, p_176536_2_, face); + - if (random.nextInt(chance) < i) + if (p_176536_4_.nextInt(p_176536_3_) < i) { - IBlockState iblockstate = worldIn.getBlockState(pos); + IBlockState iblockstate = p_176536_1_.func_180495_p(p_176536_2_); @@ -308,7 +318,7 @@ { for (EnumFacing enumfacing : EnumFacing.values()) { -- if (this.canCatchFire(worldIn, pos.offset(enumfacing))) -+ if (this.canCatchFire(worldIn, pos.offset(enumfacing), enumfacing.getOpposite())) +- if (this.func_176535_e(p_176533_1_, p_176533_2_.func_177972_a(enumfacing))) ++ if (this.canCatchFire(p_176533_1_, p_176533_2_.func_177972_a(enumfacing), enumfacing.func_176734_d())) { return true; } @@ -124,8 +124,8 @@ for (EnumFacing enumfacing : EnumFacing.values()) { -- i = Math.max(this.getEncouragement(worldIn.getBlockState(pos.offset(enumfacing)).getBlock()), i); -+ i = Math.max(worldIn.getBlockState(pos.offset(enumfacing)).getBlock().getFlammability(worldIn, pos.offset(enumfacing), enumfacing.getOpposite()), i); +- i = Math.max(this.func_176534_d(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c()), i); ++ i = Math.max(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c().getFlammability(p_176538_1_, p_176538_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()), i); } return i; @@ -134,22 +134,22 @@ } + @Deprecated // Use canCatchFire with face sensitive version below - public boolean canCatchFire(IBlockAccess worldIn, BlockPos pos) + public boolean func_176535_e(IBlockAccess p_176535_1_, BlockPos p_176535_2_) { -- return this.getEncouragement(worldIn.getBlockState(pos).getBlock()) > 0; -+ return canCatchFire(worldIn, pos, EnumFacing.UP); +- return this.func_176534_d(p_176535_1_.func_180495_p(p_176535_2_).func_177230_c()) > 0; ++ return canCatchFire(p_176535_1_, p_176535_2_, EnumFacing.UP); } - public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) @@ -382,9 +393,9 @@ - worldIn.playSound((double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), "fire.fire", 1.0F + rand.nextFloat(), rand.nextFloat() * 0.7F + 0.3F, false); + p_180655_1_.func_72980_b((double)((float)p_180655_2_.func_177958_n() + 0.5F), (double)((float)p_180655_2_.func_177956_o() + 0.5F), (double)((float)p_180655_2_.func_177952_p() + 0.5F), "fire.fire", 1.0F + p_180655_4_.nextFloat(), p_180655_4_.nextFloat() * 0.7F + 0.3F, false); } -- if (!World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && !Blocks.fire.canCatchFire(worldIn, pos.down())) -+ if (!World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) && !Blocks.fire.canCatchFire(worldIn, pos.down(), EnumFacing.UP)) +- if (!World.func_175683_a(p_180655_1_, p_180655_2_.func_177977_b()) && !Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177977_b())) ++ if (!World.func_175683_a(p_180655_1_, p_180655_2_.func_177977_b()) && !Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177977_b(), EnumFacing.UP)) { -- if (Blocks.fire.canCatchFire(worldIn, pos.west())) -+ if (Blocks.fire.canCatchFire(worldIn, pos.west(), EnumFacing.EAST)) +- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177976_e())) ++ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177976_e(), EnumFacing.EAST)) { for (int j = 0; j < 2; ++j) { @@ -157,8 +157,8 @@ } } -- if (Blocks.fire.canCatchFire(worldIn, pos.east())) -+ if (Blocks.fire.canCatchFire(worldIn, pos.east(), EnumFacing.WEST)) +- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177974_f())) ++ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177974_f(), EnumFacing.WEST)) { for (int k = 0; k < 2; ++k) { @@ -166,8 +166,8 @@ } } -- if (Blocks.fire.canCatchFire(worldIn, pos.north())) -+ if (Blocks.fire.canCatchFire(worldIn, pos.north(), EnumFacing.SOUTH)) +- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177978_c())) ++ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177978_c(), EnumFacing.SOUTH)) { for (int l = 0; l < 2; ++l) { @@ -175,8 +175,8 @@ } } -- if (Blocks.fire.canCatchFire(worldIn, pos.south())) -+ if (Blocks.fire.canCatchFire(worldIn, pos.south(), EnumFacing.NORTH)) +- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177968_d())) ++ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177968_d(), EnumFacing.NORTH)) { for (int i1 = 0; i1 < 2; ++i1) { @@ -184,14 +184,14 @@ } } -- if (Blocks.fire.canCatchFire(worldIn, pos.up())) -+ if (Blocks.fire.canCatchFire(worldIn, pos.up(), EnumFacing.DOWN)) +- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177984_a())) ++ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177984_a(), EnumFacing.DOWN)) { for (int j1 = 0; j1 < 2; ++j1) { @@ -476,4 +487,19 @@ { - return new BlockState(this, new IProperty[] {AGE, NORTH, EAST, SOUTH, WEST, UPPER, FLIP, ALT}); + return new BlockState(this, new IProperty[] {field_176543_a, field_176545_N, field_176546_O, field_176541_P, field_176539_Q, field_176542_R, field_176540_b, field_176544_M}); } + + /*================================= Forge Start ======================================*/ @@ -205,7 +205,7 @@ + */ + public boolean canCatchFire(IBlockAccess world, BlockPos pos, EnumFacing face) + { -+ return world.getBlockState(pos).getBlock().isFlammable(world, pos, face); ++ return world.func_180495_p(pos).func_177230_c().isFlammable(world, pos, face); + } + /*================================= Forge Start ======================================*/ } diff --git a/patches/minecraft/net/minecraft/block/BlockFlowerPot.java.patch b/patches/minecraft/net/minecraft/block/BlockFlowerPot.java.patch index d4e12c92c..24229b07b 100644 --- a/patches/minecraft/net/minecraft/block/BlockFlowerPot.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockFlowerPot.java.patch @@ -2,16 +2,16 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java @@ -169,13 +169,6 @@ - public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_) { -- TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos); +- TileEntityFlowerPot tileentityflowerpot = this.func_176442_d(p_180663_1_, p_180663_2_); - -- if (tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null) +- if (tileentityflowerpot != null && tileentityflowerpot.func_145965_a() != null) - { -- spawnAsEntity(worldIn, pos, new ItemStack(tileentityflowerpot.getFlowerPotItem(), 1, tileentityflowerpot.getFlowerPotData())); +- func_180635_a(p_180663_1_, p_180663_2_, new ItemStack(tileentityflowerpot.func_145965_a(), 1, tileentityflowerpot.func_145966_b())); - } - - super.breakBlock(worldIn, pos, state); + super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_); } @@ -395,6 +388,31 @@ @@ -24,9 +24,9 @@ + public java.util.List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + java.util.List ret = super.getDrops(world, pos, state, fortune); -+ TileEntityFlowerPot te = world.getTileEntity(pos) instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)world.getTileEntity(pos) : null; -+ if (te != null && te.getFlowerPotItem() != null) -+ ret.add(new ItemStack(te.getFlowerPotItem(), 1, te.getFlowerPotData())); ++ TileEntityFlowerPot te = world.func_175625_s(pos) instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)world.func_175625_s(pos) : null; ++ if (te != null && te.func_145965_a() != null) ++ ret.add(new ItemStack(te.func_145965_a(), 1, te.func_145966_b())); + return ret; + } + @Override @@ -36,10 +36,10 @@ + return super.removedByPlayer(world, pos, player, willHarvest); + } + @Override -+ public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) ++ public void func_180657_a(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { -+ super.harvestBlock(world, player, pos, state, te); -+ world.setBlockToAir(pos); ++ super.func_180657_a(world, player, pos, state, te); ++ world.func_175698_g(pos); + } + /*===========================FORGE END==========================================*/ + diff --git a/patches/minecraft/net/minecraft/block/BlockGrass.java.patch b/patches/minecraft/net/minecraft/block/BlockGrass.java.patch index b373fbe3a..7f957e591 100644 --- a/patches/minecraft/net/minecraft/block/BlockGrass.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockGrass.java.patch @@ -2,28 +2,28 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java @@ -58,7 +58,7 @@ { - if (!worldIn.isRemote) + if (!p_180650_1_.field_72995_K) { -- if (worldIn.getLightFromNeighbors(pos.up()) < 4 && worldIn.getBlockState(pos.up()).getBlock().getLightOpacity() > 2) -+ if (worldIn.getLightFromNeighbors(pos.up()) < 4 && worldIn.getBlockState(pos.up()).getBlock().getLightOpacity(worldIn, pos.up()) > 2) +- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().func_149717_k() > 2) ++ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2) { - worldIn.setBlockState(pos, Blocks.dirt.getDefaultState()); + p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P()); } @@ -72,7 +72,7 @@ - Block block = worldIn.getBlockState(blockpos.up()).getBlock(); - IBlockState iblockstate = worldIn.getBlockState(blockpos); + Block block = p_180650_1_.func_180495_p(blockpos.func_177984_a()).func_177230_c(); + IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos); -- if (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && worldIn.getLightFromNeighbors(blockpos.up()) >= 4 && block.getLightOpacity() <= 2) -+ if (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && worldIn.getLightFromNeighbors(blockpos.up()) >= 4 && block.getLightOpacity(worldIn, blockpos.up()) <= 2) +- if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && block.func_149717_k() <= 2) ++ if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && block.getLightOpacity(p_180650_1_, blockpos.func_177984_a()) <= 2) { - worldIn.setBlockState(blockpos, Blocks.grass.getDefaultState()); + p_180650_1_.func_175656_a(blockpos, Blocks.field_150349_c.func_176223_P()); } @@ -110,7 +110,7 @@ { if (j >= i / 16) { -- if (worldIn.getBlockState(blockpos1).getBlock().blockMaterial == Material.air) -+ if (worldIn.isAirBlock(blockpos1)) +- if (p_176474_1_.func_180495_p(blockpos1).func_177230_c().field_149764_J == Material.field_151579_a) ++ if (p_176474_1_.func_175623_d(blockpos1)) { - if (rand.nextInt(8) == 0) + if (p_176474_2_.nextInt(8) == 0) { diff --git a/patches/minecraft/net/minecraft/block/BlockHugeMushroom.java.patch b/patches/minecraft/net/minecraft/block/BlockHugeMushroom.java.patch index 4034822ae..cfc4d531f 100644 --- a/patches/minecraft/net/minecraft/block/BlockHugeMushroom.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockHugeMushroom.java.patch @@ -1,17 +1,17 @@ --- ../src-base/minecraft/net/minecraft/block/BlockHugeMushroom.java +++ ../src-work/minecraft/net/minecraft/block/BlockHugeMushroom.java @@ -79,6 +79,20 @@ - return new BlockState(this, new IProperty[] {VARIANT}); + return new BlockState(this, new IProperty[] {field_176380_a}); } + public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) + { -+ IBlockState state = world.getBlockState(pos); -+ for (IProperty prop : (java.util.Set)state.getProperties().keySet()) ++ IBlockState state = world.func_180495_p(pos); ++ for (IProperty prop : (java.util.Set)state.func_177228_b().keySet()) + { -+ if (prop.getName().equals("variant")) ++ if (prop.func_177701_a().equals("variant")) + { -+ world.setBlockState(pos, state.cycleProperty(prop)); ++ world.func_175656_a(pos, state.func_177231_a(prop)); + return true; + } + } diff --git a/patches/minecraft/net/minecraft/block/BlockIce.java.patch b/patches/minecraft/net/minecraft/block/BlockIce.java.patch index c1631128c..b2ff04fe6 100644 --- a/patches/minecraft/net/minecraft/block/BlockIce.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockIce.java.patch @@ -1,35 +1,35 @@ --- ../src-base/minecraft/net/minecraft/block/BlockIce.java +++ ../src-work/minecraft/net/minecraft/block/BlockIce.java @@ -38,14 +38,17 @@ - player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); - player.addExhaustion(0.025F); + p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]); + p_180657_2_.func_71020_j(0.025F); -- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(player)) -+ if (this.canSilkHarvest(worldIn, pos, worldIn.getBlockState(pos), player) && EnchantmentHelper.getSilkTouchModifier(player)) +- if (this.func_149700_E() && EnchantmentHelper.func_77502_d(p_180657_2_)) ++ if (this.canSilkHarvest(p_180657_1_, p_180657_3_, p_180657_1_.func_180495_p(p_180657_3_), p_180657_2_) && EnchantmentHelper.func_77502_d(p_180657_2_)) { + java.util.List items = new java.util.ArrayList(); - ItemStack itemstack = this.createStackedBlock(state); + ItemStack itemstack = this.func_180643_i(p_180657_4_); - if (itemstack != null) - { -- spawnAsEntity(worldIn, pos, itemstack); +- func_180635_a(p_180657_1_, p_180657_3_, itemstack); - } + if (itemstack != null) items.add(itemstack); + -+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, worldIn, pos, worldIn.getBlockState(pos), 0, 1.0f, true, player); ++ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_1_.func_180495_p(p_180657_3_), 0, 1.0f, true, p_180657_2_); + + for (ItemStack is : items) -+ spawnAsEntity(worldIn, pos, is); ++ func_180635_a(p_180657_1_, p_180657_3_, is); } else { @@ -56,7 +59,9 @@ } - int i = EnchantmentHelper.getFortuneModifier(player); -+ harvesters.set(player); - this.dropBlockAsItem(worldIn, pos, state, i); + int i = EnchantmentHelper.func_77517_e(p_180657_2_); ++ harvesters.set(p_180657_2_); + this.func_176226_b(p_180657_1_, p_180657_3_, p_180657_4_, i); + harvesters.set(null); - Material material = worldIn.getBlockState(pos.down()).getBlock().getMaterial(); + Material material = p_180657_1_.func_180495_p(p_180657_3_.func_177977_b()).func_177230_c().func_149688_o(); - if (material.blocksMovement() || material.isLiquid()) + if (material.func_76230_c() || material.func_76224_d()) diff --git a/patches/minecraft/net/minecraft/block/BlockLadder.java.patch b/patches/minecraft/net/minecraft/block/BlockLadder.java.patch index a6e678065..84fa2d3db 100644 --- a/patches/minecraft/net/minecraft/block/BlockLadder.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLadder.java.patch @@ -2,28 +2,28 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java @@ -78,7 +78,10 @@ - public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) { -- return worldIn.getBlockState(pos.west()).getBlock().isNormalCube() ? true : (worldIn.getBlockState(pos.east()).getBlock().isNormalCube() ? true : (worldIn.getBlockState(pos.north()).getBlock().isNormalCube() ? true : worldIn.getBlockState(pos.south()).getBlock().isNormalCube())); -+ return worldIn.isSideSolid(pos.west(), EnumFacing.EAST, true) || -+ worldIn.isSideSolid(pos.east(), EnumFacing.WEST, true) || -+ worldIn.isSideSolid(pos.north(), EnumFacing.SOUTH, true) || -+ worldIn.isSideSolid(pos.south(), EnumFacing.NORTH, true); +- return p_176196_1_.func_180495_p(p_176196_2_.func_177976_e()).func_177230_c().func_149721_r() ? true : (p_176196_1_.func_180495_p(p_176196_2_.func_177974_f()).func_177230_c().func_149721_r() ? true : (p_176196_1_.func_180495_p(p_176196_2_.func_177978_c()).func_177230_c().func_149721_r() ? true : p_176196_1_.func_180495_p(p_176196_2_.func_177968_d()).func_177230_c().func_149721_r())); ++ return p_176196_1_.isSideSolid(p_176196_2_.func_177976_e(), EnumFacing.EAST, true) || ++ p_176196_1_.isSideSolid(p_176196_2_.func_177974_f(), EnumFacing.WEST, true) || ++ p_176196_1_.isSideSolid(p_176196_2_.func_177978_c(), EnumFacing.SOUTH, true) || ++ p_176196_1_.isSideSolid(p_176196_2_.func_177968_d(), EnumFacing.NORTH, true); } - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_) @@ -116,7 +119,7 @@ - protected boolean canBlockStay(World worldIn, BlockPos pos, EnumFacing facing) + protected boolean func_176381_b(World p_176381_1_, BlockPos p_176381_2_, EnumFacing p_176381_3_) { -- return worldIn.getBlockState(pos.offset(facing.getOpposite())).getBlock().isNormalCube(); -+ return worldIn.isSideSolid(pos.offset(facing.getOpposite()), facing, true); +- return p_176381_1_.func_180495_p(p_176381_2_.func_177972_a(p_176381_3_.func_176734_d())).func_177230_c().func_149721_r(); ++ return p_176381_1_.isSideSolid(p_176381_2_.func_177972_a(p_176381_3_.func_176734_d()), p_176381_3_, true); } - public IBlockState getStateFromMeta(int meta) + public IBlockState func_176203_a(int p_176203_1_) @@ -146,4 +149,6 @@ { - return new BlockState(this, new IProperty[] {FACING}); + return new BlockState(this, new IProperty[] {field_176382_a}); } + + @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; } diff --git a/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch b/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch index a736fd6bb..4dcb42a4d 100644 --- a/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLeaves.java.patch @@ -7,43 +7,43 @@ -public abstract class BlockLeaves extends BlockLeavesBase +public abstract class BlockLeaves extends BlockLeavesBase implements net.minecraftforge.common.IShearable { - public static final PropertyBool DECAYABLE = PropertyBool.create("decayable"); - public static final PropertyBool CHECK_DECAY = PropertyBool.create("check_decay"); + public static final PropertyBool field_176237_a = PropertyBool.func_177716_a("decayable"); + public static final PropertyBool field_176236_b = PropertyBool.func_177716_a("check_decay"); @@ -75,9 +75,9 @@ - BlockPos blockpos = pos.add(j1, k1, l1); - IBlockState iblockstate = worldIn.getBlockState(blockpos); + BlockPos blockpos = p_180663_2_.func_177982_a(j1, k1, l1); + IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos); -- if (iblockstate.getBlock().getMaterial() == Material.leaves && !((Boolean)iblockstate.getValue(CHECK_DECAY)).booleanValue()) -+ if (iblockstate.getBlock().isLeaves(worldIn, blockpos)) +- if (iblockstate.func_177230_c().func_149688_o() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(field_176236_b)).booleanValue()) ++ if (iblockstate.func_177230_c().isLeaves(p_180663_1_, blockpos)) { -- worldIn.setBlockState(blockpos, iblockstate.withProperty(CHECK_DECAY, Boolean.valueOf(true)), 4); -+ iblockstate.getBlock().beginLeavesDecay(worldIn, blockpos); +- p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(field_176236_b, Boolean.valueOf(true)), 4); ++ iblockstate.func_177230_c().beginLeavesDecay(p_180663_1_, blockpos); } } } @@ -117,9 +117,9 @@ { - Block block = worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)).getBlock(); + Block block = p_180650_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)).func_177230_c(); -- if (block != Blocks.log && block != Blocks.log2) -+ if (!block.canSustainLeaves(worldIn, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2))) +- if (block != Blocks.field_150364_r && block != Blocks.field_150363_s) ++ if (!block.canSustainLeaves(p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2))) { -- if (block.getMaterial() == Material.leaves) -+ if (block.isLeaves(worldIn, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2))) +- if (block.func_149688_o() == Material.field_151584_j) ++ if (block.isLeaves(p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2))) { - this.surroundings[(i2 + l1) * k1 + (j2 + l1) * j1 + k2 + l1] = -2; + this.field_150128_a[(i2 + l1) * k1 + (j2 + l1) * j1 + k2 + l1] = -2; } @@ -226,40 +226,7 @@ - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { -- if (!worldIn.isRemote) +- if (!p_180653_1_.field_72995_K) - { -- int i = this.getSaplingDropChance(state); +- int i = this.func_176232_d(p_180653_3_); - -- if (fortune > 0) +- if (p_180653_5_ > 0) - { -- i -= 2 << fortune; +- i -= 2 << p_180653_5_; - - if (i < 10) - { @@ -51,17 +51,17 @@ - } - } - -- if (worldIn.rand.nextInt(i) == 0) +- if (p_180653_1_.field_73012_v.nextInt(i) == 0) - { -- Item item = this.getItemDropped(state, worldIn.rand, fortune); -- spawnAsEntity(worldIn, pos, new ItemStack(item, 1, this.damageDropped(state))); +- Item item = this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_); +- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item, 1, this.func_180651_a(p_180653_3_))); - } - - i = 200; - -- if (fortune > 0) +- if (p_180653_5_ > 0) - { -- i -= 10 << fortune; +- i -= 10 << p_180653_5_; - - if (i < 40) - { @@ -69,16 +69,16 @@ - } - } - -- this.dropApple(worldIn, pos, state, i); +- this.func_176234_a(p_180653_1_, p_180653_2_, p_180653_3_, i); - } -+ super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); ++ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); } - protected void dropApple(World worldIn, BlockPos pos, IBlockState state, int chance) + protected void func_176234_a(World p_176234_1_, BlockPos p_176234_2_, IBlockState p_176234_3_, int p_176234_4_) @@ -296,4 +263,48 @@ } - public abstract BlockPlanks.EnumType getWoodType(int meta); + public abstract BlockPlanks.EnumType func_176233_b(int p_176233_1_); + + @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; } + @Override public boolean isLeaves(IBlockAccess world, BlockPos pos){ return true; } @@ -86,10 +86,10 @@ + @Override + public void beginLeavesDecay(World world, BlockPos pos) + { -+ IBlockState state = world.getBlockState(pos); -+ if (!(Boolean)state.getValue(CHECK_DECAY)) ++ IBlockState state = world.func_180495_p(pos); ++ if (!(Boolean)state.func_177229_b(field_176236_b)) + { -+ world.setBlockState(pos, state.withProperty(CHECK_DECAY, true), 4); ++ world.func_180501_a(pos, state.func_177226_a(field_176236_b, true), 4); + } + } + @@ -97,8 +97,8 @@ + public java.util.List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + java.util.List ret = new java.util.ArrayList(); -+ Random rand = world instanceof World ? ((World)world).rand : new Random(); -+ int chance = this.getSaplingDropChance(state); ++ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random(); ++ int chance = this.func_176232_d(state); + + if (fortune > 0) + { @@ -107,7 +107,7 @@ + } + + if (rand.nextInt(chance) == 0) -+ ret.add(new ItemStack(getItemDropped(state, rand, fortune), 1, damageDropped(state))); ++ ret.add(new ItemStack(func_180660_a(state, rand, fortune), 1, func_180651_a(state))); + + chance = 200; + if (fortune > 0) @@ -118,7 +118,7 @@ + + this.captureDrops(true); + if (world instanceof World) -+ this.dropApple((World)world, pos, state, chance); // Dammet mojang ++ this.func_176234_a((World)world, pos, state, chance); // Dammet mojang + ret.addAll(this.captureDrops(false)); + return ret; + } diff --git a/patches/minecraft/net/minecraft/block/BlockLever.java.patch b/patches/minecraft/net/minecraft/block/BlockLever.java.patch index 21869253d..7bee93321 100644 --- a/patches/minecraft/net/minecraft/block/BlockLever.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLever.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/block/BlockLever.java +++ ../src-work/minecraft/net/minecraft/block/BlockLever.java @@ -237,6 +237,12 @@ - return new BlockState(this, new IProperty[] {FACING, POWERED}); + return new BlockState(this, new IProperty[] {field_176360_a, field_176359_b}); } + diff --git a/patches/minecraft/net/minecraft/block/BlockLog.java.patch b/patches/minecraft/net/minecraft/block/BlockLog.java.patch index e1ad4d6e7..a6247c0c2 100644 --- a/patches/minecraft/net/minecraft/block/BlockLog.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockLog.java.patch @@ -2,18 +2,18 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockLog.java @@ -33,9 +33,9 @@ { - IBlockState iblockstate = worldIn.getBlockState(blockpos); + IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos); -- if (iblockstate.getBlock().getMaterial() == Material.leaves && !((Boolean)iblockstate.getValue(BlockLeaves.CHECK_DECAY)).booleanValue()) -+ if (iblockstate.getBlock().isLeaves(worldIn, blockpos)) +- if (iblockstate.func_177230_c().func_149688_o() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(BlockLeaves.field_176236_b)).booleanValue()) ++ if (iblockstate.func_177230_c().isLeaves(p_180663_1_, blockpos)) { -- worldIn.setBlockState(blockpos, iblockstate.withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(true)), 4); -+ iblockstate.getBlock().beginLeavesDecay(worldIn, blockpos); +- p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(BlockLeaves.field_176236_b, Boolean.valueOf(true)), 4); ++ iblockstate.func_177230_c().beginLeavesDecay(p_180663_1_, blockpos); } } } @@ -46,6 +46,9 @@ - return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(LOG_AXIS, BlockLog.EnumAxis.fromFacingAxis(facing.getAxis())); + return super.func_180642_a(p_180642_1_, p_180642_2_, p_180642_3_, p_180642_4_, p_180642_5_, p_180642_6_, p_180642_7_, p_180642_8_).func_177226_a(field_176299_a, BlockLog.EnumAxis.func_176870_a(p_180642_3_.func_176740_k())); } + @Override public boolean canSustainLeaves(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; } diff --git a/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch b/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch index 1ea021a24..89062cf38 100644 --- a/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockMobSpawner.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java +++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java @@ -37,10 +37,14 @@ - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { - super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); -- int i = 15 + worldIn.rand.nextInt(15) + worldIn.rand.nextInt(15); -- this.dropXpOnBlockBreak(worldIn, pos, i); + super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); +- int i = 15 + p_180653_1_.field_73012_v.nextInt(15) + p_180653_1_.field_73012_v.nextInt(15); +- this.func_180637_b(p_180653_1_, p_180653_2_, i); } + @Override @@ -14,6 +14,6 @@ + return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15); + } + - public boolean isOpaqueCube() + public boolean func_149662_c() { return false; diff --git a/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch b/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch index c8f6e6acd..c78e7fc1d 100644 --- a/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockMushroom.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java +++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java @@ -71,7 +71,7 @@ - if (pos.getY() >= 0 && pos.getY() < 256) + if (p_180671_2_.func_177956_o() >= 0 && p_180671_2_.func_177956_o() < 256) { - IBlockState iblockstate = worldIn.getBlockState(pos.down()); -- return iblockstate.getBlock() == Blocks.mycelium ? true : (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.PODZOL ? true : worldIn.getLight(pos) < 13 && this.canPlaceBlockOn(iblockstate.getBlock())); -+ return iblockstate.getBlock() == Blocks.mycelium ? true : (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.PODZOL ? true : worldIn.getLight(pos) < 13 && iblockstate.getBlock().canSustainPlant(worldIn, pos.down(), net.minecraft.util.EnumFacing.UP, this)); + IBlockState iblockstate = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()); +- return iblockstate.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && this.func_149854_a(iblockstate.func_177230_c())); ++ return iblockstate.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && iblockstate.func_177230_c().canSustainPlant(p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this)); } else { diff --git a/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch b/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch index 774ac7079..c7bd1a280 100644 --- a/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockMycelium.java.patch @@ -2,19 +2,19 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java @@ -39,7 +39,7 @@ { - if (!worldIn.isRemote) + if (!p_180650_1_.field_72995_K) { -- if (worldIn.getLightFromNeighbors(pos.up()) < 4 && worldIn.getBlockState(pos.up()).getBlock().getLightOpacity() > 2) -+ if (worldIn.getLightFromNeighbors(pos.up()) < 4 && worldIn.getBlockState(pos.up()).getBlock().getLightOpacity(worldIn, pos.up()) > 2) +- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().func_149717_k() > 2) ++ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2) { - worldIn.setBlockState(pos, Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT)); + p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P().func_177226_a(BlockDirt.field_176386_a, BlockDirt.DirtType.DIRT)); } @@ -53,7 +53,7 @@ - IBlockState iblockstate = worldIn.getBlockState(blockpos); - Block block = worldIn.getBlockState(blockpos.up()).getBlock(); + IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos); + Block block = p_180650_1_.func_180495_p(blockpos.func_177984_a()).func_177230_c(); -- if (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && worldIn.getLightFromNeighbors(blockpos.up()) >= 4 && block.getLightOpacity() <= 2) -+ if (iblockstate.getBlock() == Blocks.dirt && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && worldIn.getLightFromNeighbors(blockpos.up()) >= 4 && block.getLightOpacity(worldIn, blockpos.up()) <= 2) +- if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && block.func_149717_k() <= 2) ++ if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && block.getLightOpacity(p_180650_1_, blockpos.func_177984_a()) <= 2) { - worldIn.setBlockState(blockpos, this.getDefaultState()); + p_180650_1_.func_175656_a(blockpos, this.func_176223_P()); } diff --git a/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch b/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch index 1640b0ea1..959b41a0b 100644 --- a/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockNetherWart.java.patch @@ -2,46 +2,46 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java @@ -38,7 +38,7 @@ - public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_) { -- return this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); -+ return super.canBlockStay(worldIn, pos, state); +- return this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c()); ++ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_); } - public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_) @@ -54,9 +54,11 @@ - super.updateTick(worldIn, pos, state, rand); + super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_); } + @SuppressWarnings("unused") - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { -- if (!worldIn.isRemote) -+ super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); -+ if (false && !worldIn.isRemote) +- if (!p_180653_1_.field_72995_K) ++ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); ++ if (false && !p_180653_1_.field_72995_K) { int i = 1; @@ -107,4 +109,24 @@ { - return new BlockState(this, new IProperty[] {AGE}); + return new BlockState(this, new IProperty[] {field_176486_a}); } + + @Override + public java.util.List getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + java.util.List ret = new java.util.ArrayList(); -+ Random rand = world instanceof World ? ((World)world).rand : new Random(); ++ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random(); + int count = 1; + -+ if (((Integer)state.getValue(AGE)) >= 3) ++ if (((Integer)state.func_177229_b(field_176486_a)) >= 3) + { + count = 2 + rand.nextInt(3) + (fortune > 0 ? rand.nextInt(fortune + 1) : 0); + } + + for (int i = 0; i < count; i++) + { -+ ret.add(new ItemStack(Items.nether_wart)); ++ ret.add(new ItemStack(Items.field_151075_bm)); + } + + return ret; diff --git a/patches/minecraft/net/minecraft/block/BlockNewLeaf.java.patch b/patches/minecraft/net/minecraft/block/BlockNewLeaf.java.patch index 4696ecb98..9cfc32668 100644 --- a/patches/minecraft/net/minecraft/block/BlockNewLeaf.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockNewLeaf.java.patch @@ -2,23 +2,23 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockNewLeaf.java @@ -99,14 +99,15 @@ - public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_) { -- if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) +- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) { -- player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); -- spawnAsEntity(worldIn, pos, new ItemStack(Item.getItemFromBlock(this), 1, ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata() - 4)); +- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]); +- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Item.func_150898_a(this), 1, ((BlockPlanks.EnumType)p_180657_4_.func_177229_b(field_176240_P)).func_176839_a() - 4)); - } - else - { - super.harvestBlock(worldIn, player, pos, state, te); + super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_); } } + + @Override + public List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) + { -+ IBlockState state = world.getBlockState(pos); -+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata() - 4))); ++ IBlockState state = world.func_180495_p(pos); ++ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, ((BlockPlanks.EnumType)state.func_177229_b(field_176240_P)).func_176839_a() - 4))); + } } diff --git a/patches/minecraft/net/minecraft/block/BlockNote.java.patch b/patches/minecraft/net/minecraft/block/BlockNote.java.patch index f93eeb428..6899eb877 100644 --- a/patches/minecraft/net/minecraft/block/BlockNote.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockNote.java.patch @@ -4,20 +4,20 @@ if (tileentity instanceof TileEntityNote) { TileEntityNote tileentitynote = (TileEntityNote)tileentity; -+ int old = tileentitynote.note; - tileentitynote.changePitch(); -+ if (old == tileentitynote.note) return false; - tileentitynote.triggerNote(worldIn, pos); - playerIn.triggerAchievement(StatList.field_181735_S); ++ int old = tileentitynote.field_145879_a; + tileentitynote.func_145877_a(); ++ if (old == tileentitynote.field_145879_a) return false; + tileentitynote.func_175108_a(p_180639_1_, p_180639_2_); + p_180639_4_.func_71029_a(StatList.field_181735_S); } @@ -98,6 +100,10 @@ - public boolean onBlockEventReceived(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam) + public boolean func_180648_a(World p_180648_1_, BlockPos p_180648_2_, IBlockState p_180648_3_, int p_180648_4_, int p_180648_5_) { -+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(worldIn, pos, state, eventParam, eventID); ++ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_180648_1_, p_180648_2_, p_180648_3_, p_180648_5_, p_180648_4_); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false; -+ eventID = e.instrument.ordinal(); -+ eventParam = e.getVanillaNoteId(); - float f = (float)Math.pow(2.0D, (double)(eventParam - 12) / 12.0D); - worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "note." + this.getInstrument(eventID), 3.0F, f); - worldIn.spawnParticle(EnumParticleTypes.NOTE, (double)pos.getX() + 0.5D, (double)pos.getY() + 1.2D, (double)pos.getZ() + 0.5D, (double)eventParam / 24.0D, 0.0D, 0.0D, new int[0]); ++ p_180648_4_ = e.instrument.ordinal(); ++ p_180648_5_ = e.getVanillaNoteId(); + float f = (float)Math.pow(2.0D, (double)(p_180648_5_ - 12) / 12.0D); + p_180648_1_.func_72908_a((double)p_180648_2_.func_177958_n() + 0.5D, (double)p_180648_2_.func_177956_o() + 0.5D, (double)p_180648_2_.func_177952_p() + 0.5D, "note." + this.func_176433_b(p_180648_4_), 3.0F, f); + p_180648_1_.func_175688_a(EnumParticleTypes.NOTE, (double)p_180648_2_.func_177958_n() + 0.5D, (double)p_180648_2_.func_177956_o() + 1.2D, (double)p_180648_2_.func_177952_p() + 0.5D, (double)p_180648_5_ / 24.0D, 0.0D, 0.0D, new int[0]); diff --git a/patches/minecraft/net/minecraft/block/BlockOldLeaf.java.patch b/patches/minecraft/net/minecraft/block/BlockOldLeaf.java.patch index efca433f4..c81ddd561 100644 --- a/patches/minecraft/net/minecraft/block/BlockOldLeaf.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockOldLeaf.java.patch @@ -1,21 +1,21 @@ --- ../src-base/minecraft/net/minecraft/block/BlockOldLeaf.java +++ ../src-work/minecraft/net/minecraft/block/BlockOldLeaf.java @@ -142,11 +142,17 @@ - if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) + if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) { - player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); -- spawnAsEntity(worldIn, pos, new ItemStack(Item.getItemFromBlock(this), 1, ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata())); + p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]); +- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Item.func_150898_a(this), 1, ((BlockPlanks.EnumType)p_180657_4_.func_177229_b(field_176239_P)).func_176839_a())); } else { - super.harvestBlock(worldIn, player, pos, state, te); + super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_); } } + + @Override + public List onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) + { -+ IBlockState state = world.getBlockState(pos); -+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata()))); ++ IBlockState state = world.func_180495_p(pos); ++ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, ((BlockPlanks.EnumType)state.func_177229_b(field_176239_P)).func_176839_a()))); + } } diff --git a/patches/minecraft/net/minecraft/block/BlockOre.java.patch b/patches/minecraft/net/minecraft/block/BlockOre.java.patch index 28763cd3c..a08f33dec 100644 --- a/patches/minecraft/net/minecraft/block/BlockOre.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockOre.java.patch @@ -1,51 +1,51 @@ --- ../src-base/minecraft/net/minecraft/block/BlockOre.java +++ ../src-work/minecraft/net/minecraft/block/BlockOre.java @@ -58,34 +58,40 @@ - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { - super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); + super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); - -- if (this.getItemDropped(state, worldIn.rand, fortune) != Item.getItemFromBlock(this)) +- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this)) + } + @Override + public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) + { -+ IBlockState state = world.getBlockState(pos); -+ Random rand = world instanceof World ? ((World)world).rand : new Random(); -+ if (this.getItemDropped(state, rand, fortune) != Item.getItemFromBlock(this)) ++ IBlockState state = world.func_180495_p(pos); ++ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random(); ++ if (this.func_180660_a(state, rand, fortune) != Item.func_150898_a(this)) { int i = 0; - if (this == Blocks.coal_ore) + if (this == Blocks.field_150365_q) { -- i = MathHelper.getRandomIntegerInRange(worldIn.rand, 0, 2); -+ i = MathHelper.getRandomIntegerInRange(rand, 0, 2); +- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 0, 2); ++ i = MathHelper.func_76136_a(rand, 0, 2); } - else if (this == Blocks.diamond_ore) + else if (this == Blocks.field_150482_ag) { -- i = MathHelper.getRandomIntegerInRange(worldIn.rand, 3, 7); -+ i = MathHelper.getRandomIntegerInRange(rand, 3, 7); +- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7); ++ i = MathHelper.func_76136_a(rand, 3, 7); } - else if (this == Blocks.emerald_ore) + else if (this == Blocks.field_150412_bA) { -- i = MathHelper.getRandomIntegerInRange(worldIn.rand, 3, 7); -+ i = MathHelper.getRandomIntegerInRange(rand, 3, 7); +- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7); ++ i = MathHelper.func_76136_a(rand, 3, 7); } - else if (this == Blocks.lapis_ore) + else if (this == Blocks.field_150369_x) { -- i = MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5); -+ i = MathHelper.getRandomIntegerInRange(rand, 2, 5); +- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5); ++ i = MathHelper.func_76136_a(rand, 2, 5); } - else if (this == Blocks.quartz_ore) + else if (this == Blocks.field_150449_bY) { -- i = MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5); -+ i = MathHelper.getRandomIntegerInRange(rand, 2, 5); +- i = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5); ++ i = MathHelper.func_76136_a(rand, 2, 5); } -- this.dropXpOnBlockBreak(worldIn, pos, i); +- this.func_180637_b(p_180653_1_, p_180653_2_, i); + return i; } + return 0; } - public int getDamageValue(World worldIn, BlockPos pos) + public int func_176222_j(World p_176222_1_, BlockPos p_176222_2_) diff --git a/patches/minecraft/net/minecraft/block/BlockPane.java.patch b/patches/minecraft/net/minecraft/block/BlockPane.java.patch index c5061c08f..bf26e9faf 100644 --- a/patches/minecraft/net/minecraft/block/BlockPane.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPane.java.patch @@ -2,40 +2,40 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockPane.java @@ -38,7 +38,10 @@ - public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) + public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_) { -- return state.withProperty(NORTH, Boolean.valueOf(this.canPaneConnectToBlock(worldIn.getBlockState(pos.north()).getBlock()))).withProperty(SOUTH, Boolean.valueOf(this.canPaneConnectToBlock(worldIn.getBlockState(pos.south()).getBlock()))).withProperty(WEST, Boolean.valueOf(this.canPaneConnectToBlock(worldIn.getBlockState(pos.west()).getBlock()))).withProperty(EAST, Boolean.valueOf(this.canPaneConnectToBlock(worldIn.getBlockState(pos.east()).getBlock()))); -+ return state.withProperty(NORTH, canPaneConnectTo(worldIn, pos, EnumFacing.NORTH)) -+ .withProperty(SOUTH, canPaneConnectTo(worldIn, pos, EnumFacing.SOUTH)) -+ .withProperty(WEST, canPaneConnectTo(worldIn, pos, EnumFacing.WEST)) -+ .withProperty(EAST, canPaneConnectTo(worldIn, pos, EnumFacing.EAST)); +- return p_176221_1_.func_177226_a(field_176241_b, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()).func_177230_c()))).func_177226_a(field_176243_N, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()).func_177230_c()))).func_177226_a(field_176244_O, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()).func_177230_c()))).func_177226_a(field_176242_M, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()).func_177230_c()))); ++ return p_176221_1_.func_177226_a(field_176241_b, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.NORTH)) ++ .func_177226_a(field_176243_N, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.SOUTH)) ++ .func_177226_a(field_176244_O, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.WEST)) ++ .func_177226_a(field_176242_M, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.EAST)); } - public Item getItemDropped(IBlockState state, Random rand, int fortune) + public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_) @@ -64,10 +67,10 @@ - public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) + public void func_180638_a(World p_180638_1_, BlockPos p_180638_2_, IBlockState p_180638_3_, AxisAlignedBB p_180638_4_, List p_180638_5_, Entity p_180638_6_) { -- boolean flag = this.canPaneConnectToBlock(worldIn.getBlockState(pos.north()).getBlock()); -- boolean flag1 = this.canPaneConnectToBlock(worldIn.getBlockState(pos.south()).getBlock()); -- boolean flag2 = this.canPaneConnectToBlock(worldIn.getBlockState(pos.west()).getBlock()); -- boolean flag3 = this.canPaneConnectToBlock(worldIn.getBlockState(pos.east()).getBlock()); -+ boolean flag = this.canPaneConnectTo(worldIn, pos, EnumFacing.NORTH); -+ boolean flag1 = this.canPaneConnectTo(worldIn, pos, EnumFacing.SOUTH); -+ boolean flag2 = this.canPaneConnectTo(worldIn, pos, EnumFacing.WEST); -+ boolean flag3 = this.canPaneConnectTo(worldIn, pos, EnumFacing.EAST); +- boolean flag = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177978_c()).func_177230_c()); +- boolean flag1 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177968_d()).func_177230_c()); +- boolean flag2 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177976_e()).func_177230_c()); +- boolean flag3 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177974_f()).func_177230_c()); ++ boolean flag = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.NORTH); ++ boolean flag1 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.SOUTH); ++ boolean flag2 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.WEST); ++ boolean flag3 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.EAST); if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) { @@ -186,4 +189,11 @@ { - return new BlockState(this, new IProperty[] {NORTH, EAST, WEST, SOUTH}); + return new BlockState(this, new IProperty[] {field_176241_b, field_176242_M, field_176244_O, field_176243_N}); } + + public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir) + { -+ BlockPos off = pos.offset(dir); -+ Block block = world.getBlockState(off).getBlock(); -+ return canPaneConnectToBlock(block) || block.isSideSolid(world, off, dir.getOpposite()); ++ BlockPos off = pos.func_177972_a(dir); ++ Block block = world.func_180495_p(off).func_177230_c(); ++ return func_150098_a(block) || block.isSideSolid(world, off, dir.func_176734_d()); + } } diff --git a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch index c696444af..db2e7cfae 100644 --- a/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPistonBase.java.patch @@ -4,28 +4,28 @@ } } -- if (!flag1 && block.getMaterial() != Material.air && canPush(block, worldIn, blockpos, enumfacing.getOpposite(), false) && (block.getMobilityFlag() == 0 || block == Blocks.piston || block == Blocks.sticky_piston)) -+ if (!flag1 && !block.isAir(worldIn, blockpos) && canPush(block, worldIn, blockpos, enumfacing.getOpposite(), false) && (block.getMobilityFlag() == 0 || block == Blocks.piston || block == Blocks.sticky_piston)) +- if (!flag1 && block.func_149688_o() != Material.field_151579_a && func_180696_a(block, p_180648_1_, blockpos, enumfacing.func_176734_d(), false) && (block.func_149656_h() == 0 || block == Blocks.field_150331_J || block == Blocks.field_150320_F)) ++ if (!flag1 && !block.isAir(p_180648_1_, blockpos) && func_180696_a(block, p_180648_1_, blockpos, enumfacing.func_176734_d(), false) && (block.func_149656_h() == 0 || block == Blocks.field_150331_J || block == Blocks.field_150320_F)) { - this.doMove(worldIn, pos, enumfacing, false); + this.func_176319_a(p_180648_1_, p_180648_2_, enumfacing, false); } @@ -333,7 +333,7 @@ return false; } -- return !(blockIn instanceof ITileEntityProvider); -+ return !(blockIn.hasTileEntity(worldIn.getBlockState(pos))); +- return !(p_180696_0_ instanceof ITileEntityProvider); ++ return !(p_180696_0_.hasTileEntity(p_180696_1_.func_180495_p(p_180696_2_))); } else { @@ -371,7 +371,9 @@ { BlockPos blockpos = (BlockPos)list1.get(j); - Block block = worldIn.getBlockState(blockpos).getBlock(); -- block.dropBlockAsItem(worldIn, blockpos, worldIn.getBlockState(blockpos), 0); + Block block = p_176319_1_.func_180495_p(blockpos).func_177230_c(); +- block.func_176226_b(p_176319_1_, blockpos, p_176319_1_.func_180495_p(blockpos), 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.dropBlockAsItemWithChance(worldIn, blockpos, worldIn.getBlockState(blockpos), chance, 0); - worldIn.setBlockToAir(blockpos); ++ block.func_180653_a(p_176319_1_, blockpos, p_176319_1_.func_180495_p(blockpos), chance, 0); + p_176319_1_.func_175698_g(blockpos); --i; ablock[i] = block; diff --git a/patches/minecraft/net/minecraft/block/BlockPistonMoving.java.patch b/patches/minecraft/net/minecraft/block/BlockPistonMoving.java.patch index c1bf64fbd..3ba28b443 100644 --- a/patches/minecraft/net/minecraft/block/BlockPistonMoving.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPistonMoving.java.patch @@ -2,35 +2,35 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockPistonMoving.java @@ -109,16 +109,7 @@ - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { -- if (!worldIn.isRemote) +- if (!p_180653_1_.field_72995_K) - { -- TileEntityPiston tileentitypiston = this.getTileEntity(worldIn, pos); +- TileEntityPiston tileentitypiston = this.func_176422_e(p_180653_1_, p_180653_2_); - - if (tileentitypiston != null) - { -- IBlockState iblockstate = tileentitypiston.getPistonState(); -- iblockstate.getBlock().dropBlockAsItem(worldIn, pos, iblockstate, 0); +- IBlockState iblockstate = tileentitypiston.func_174927_b(); +- iblockstate.func_177230_c().func_176226_b(p_180653_1_, p_180653_2_, iblockstate, 0); - } - } -+ super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); ++ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); } - public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) + public MovingObjectPosition func_180636_a(World p_180636_1_, BlockPos p_180636_2_, Vec3 p_180636_3_, Vec3 p_180636_4_) @@ -282,4 +273,16 @@ { - return new BlockState(this, new IProperty[] {FACING, TYPE}); + return new BlockState(this, new IProperty[] {field_176426_a, field_176425_b}); } + + @Override + public java.util.List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { -+ TileEntityPiston tileentitypiston = this.getTileEntity(world, pos); ++ TileEntityPiston tileentitypiston = this.func_176422_e(world, pos); + if (tileentitypiston != null) + { -+ IBlockState pushed = tileentitypiston.getPistonState(); -+ return pushed.getBlock().getDrops(world, pos, pushed, fortune); ++ IBlockState pushed = tileentitypiston.func_174927_b(); ++ return pushed.func_177230_c().getDrops(world, pos, pushed, fortune); + } + return new java.util.ArrayList(); + } diff --git a/patches/minecraft/net/minecraft/block/BlockPotato.java.patch b/patches/minecraft/net/minecraft/block/BlockPotato.java.patch index 7c4e2d199..f507e3336 100644 --- a/patches/minecraft/net/minecraft/block/BlockPotato.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPotato.java.patch @@ -1,15 +1,15 @@ --- ../src-base/minecraft/net/minecraft/block/BlockPotato.java +++ ../src-work/minecraft/net/minecraft/block/BlockPotato.java @@ -22,13 +22,14 @@ - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { - super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); + super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); - -- if (!worldIn.isRemote) +- if (!p_180653_1_.field_72995_K) - { -- if (((Integer)state.getValue(AGE)).intValue() >= 7 && worldIn.rand.nextInt(50) == 0) +- if (((Integer)p_180653_3_.func_177229_b(field_176488_a)).intValue() >= 7 && p_180653_1_.field_73012_v.nextInt(50) == 0) - { -- spawnAsEntity(worldIn, pos, new ItemStack(Items.poisonous_potato)); +- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(Items.field_151170_bI)); - } - } } @@ -17,9 +17,9 @@ + public java.util.List getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + java.util.List ret = super.getDrops(world, pos, state, fortune); -+ java.util.Random rand = world instanceof World ? ((World)world).rand : new java.util.Random(); -+ if (((Integer)state.getValue(AGE)) >= 7 && rand.nextInt(50) == 0) -+ ret.add(new ItemStack(Items.poisonous_potato)); ++ java.util.Random rand = world instanceof World ? ((World)world).field_73012_v : new java.util.Random(); ++ if (((Integer)state.func_177229_b(field_176488_a)) >= 7 && rand.nextInt(50) == 0) ++ ret.add(new ItemStack(Items.field_151170_bI)); + return ret; + } } diff --git a/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch b/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch index 6d75c0f94..256bace07 100644 --- a/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockPumpkin.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java @@ -115,7 +115,7 @@ - public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) { -- return worldIn.getBlockState(pos).getBlock().blockMaterial.isReplaceable() && World.doesBlockHaveSolidTopSurface(worldIn, pos.down()); -+ return worldIn.getBlockState(pos).getBlock().isReplaceable(worldIn, pos) && World.doesBlockHaveSolidTopSurface(worldIn, pos.down()); +- return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().field_149764_J.func_76222_j() && World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()); ++ return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().func_176200_f(p_176196_1_, p_176196_2_) && World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()); } - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_) diff --git a/patches/minecraft/net/minecraft/block/BlockQuartz.java.patch b/patches/minecraft/net/minecraft/block/BlockQuartz.java.patch index 413d42a6f..b78be41ea 100644 --- a/patches/minecraft/net/minecraft/block/BlockQuartz.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockQuartz.java.patch @@ -1,23 +1,23 @@ --- ../src-base/minecraft/net/minecraft/block/BlockQuartz.java +++ ../src-work/minecraft/net/minecraft/block/BlockQuartz.java @@ -90,6 +90,26 @@ - return new BlockState(this, new IProperty[] {VARIANT}); + return new BlockState(this, new IProperty[] {field_176335_a}); } + public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) + { -+ IBlockState state = world.getBlockState(pos); -+ for (IProperty prop : (java.util.Set)state.getProperties().keySet()) ++ IBlockState state = world.func_180495_p(pos); ++ for (IProperty prop : (java.util.Set)state.func_177228_b().keySet()) + { -+ if (prop.getName().equals("variant") && prop.getValueClass() == EnumType.class) ++ if (prop.func_177701_a().equals("variant") && prop.func_177699_b() == EnumType.class) + { -+ EnumType current = (EnumType)state.getValue(prop); ++ EnumType current = (EnumType)state.func_177229_b(prop); + EnumType next = current == EnumType.LINES_X ? EnumType.LINES_Y : + current == EnumType.LINES_Y ? EnumType.LINES_Z : + current == EnumType.LINES_Z ? EnumType.LINES_X : current; + if (next == current) + return false; -+ world.setBlockState(pos, state.withProperty(prop, next)); ++ world.func_175656_a(pos, state.func_177226_a(prop, next)); + return true; + } + } diff --git a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch b/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch index 8dea2624e..9f7a36165 100644 --- a/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRailBase.java.patch @@ -1,17 +1,17 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java +++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java @@ -31,7 +31,7 @@ - public static boolean isRailBlock(IBlockState state) + public static boolean func_176563_d(IBlockState p_176563_0_) { - Block block = state.getBlock(); -- return block == Blocks.rail || block == Blocks.golden_rail || block == Blocks.detector_rail || block == Blocks.activator_rail; + Block block = p_176563_0_.func_177230_c(); +- return block == Blocks.field_150448_aq || block == Blocks.field_150318_D || block == Blocks.field_150319_E || block == Blocks.field_150408_cc; + return block instanceof BlockRailBase; } - protected BlockRailBase(boolean isPowered) + protected BlockRailBase(boolean p_i45389_1_) @@ -175,6 +175,81 @@ - public abstract IProperty getShapeProperty(); + public abstract IProperty func_176560_l(); + /* ======================================== FORGE START =====================================*/ + /** @@ -23,7 +23,7 @@ + */ + public boolean isFlexibleRail(IBlockAccess world, BlockPos pos) + { -+ return !this.isPowered; ++ return !this.field_150053_a; + } + + /** @@ -74,12 +74,12 @@ + */ + public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) + { -+ IBlockState state = world.getBlockState(pos); -+ for (IProperty prop : (java.util.Set)state.getProperties().keySet()) ++ IBlockState state = world.func_180495_p(pos); ++ for (IProperty prop : (java.util.Set)state.func_177228_b().keySet()) + { -+ if (prop.getName().equals("shape")) ++ if (prop.func_177701_a().equals("shape")) + { -+ world.setBlockState(pos, state.cycleProperty(prop)); ++ world.func_175656_a(pos, state.func_177231_a(prop)); + return true; + } + } @@ -92,20 +92,20 @@ { NORTH_SOUTH(0, "north_south"), @@ -245,6 +320,7 @@ - private IBlockState state; - private final boolean isPowered; + private IBlockState field_180366_e; + private final boolean field_150656_f; private final List field_150657_g = Lists.newArrayList(); + private final boolean canMakeSlopes; - public Rail(World worldIn, BlockPos pos, IBlockState state) + public Rail(World p_i45739_2_, BlockPos p_i45739_3_, IBlockState p_i45739_4_) { @@ -253,7 +329,8 @@ - this.state = state; - this.block = (BlockRailBase)state.getBlock(); - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)state.getValue(BlockRailBase.this.getShapeProperty()); -- this.isPowered = this.block.isPowered; -+ this.isPowered = !this.block.isFlexibleRail(worldIn, pos); -+ canMakeSlopes = this.block.canMakeSlopes(worldIn, pos); + this.field_180366_e = p_i45739_4_; + this.field_180365_d = (BlockRailBase)p_i45739_4_.func_177230_c(); + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_i45739_4_.func_177229_b(BlockRailBase.this.func_176560_l()); +- this.field_150656_f = this.field_180365_d.field_150053_a; ++ this.field_150656_f = !this.field_180365_d.isFlexibleRail(p_i45739_2_, p_i45739_3_); ++ canMakeSlopes = this.field_180365_d.canMakeSlopes(p_i45739_2_, p_i45739_3_); this.func_180360_a(blockrailbase$enumraildirection); } @@ -116,7 +116,7 @@ - if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH) + if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes) { - if (BlockRailBase.isRailBlock(this.world, blockpos.up())) + if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a())) { @@ -452,7 +529,7 @@ } @@ -125,7 +125,7 @@ - if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST) + if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes) { - if (BlockRailBase.isRailBlock(this.world, blockpos3.up())) + if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a())) { @@ -595,7 +672,7 @@ } @@ -134,7 +134,7 @@ - if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH) + if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes) { - if (BlockRailBase.isRailBlock(this.world, blockpos.up())) + if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a())) { @@ -608,7 +685,7 @@ } @@ -143,5 +143,5 @@ - if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST) + if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes) { - if (BlockRailBase.isRailBlock(this.world, blockpos3.up())) + if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a())) { diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch index 6799d4271..1ad9b4abf 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneComparator.java.patch @@ -1,15 +1,15 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRedstoneComparator.java +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneComparator.java @@ -295,6 +295,21 @@ - return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()).withProperty(POWERED, Boolean.valueOf(false)).withProperty(MODE, BlockRedstoneComparator.Mode.COMPARE); + return this.func_176223_P().func_177226_a(field_176387_N, p_180642_8_.func_174811_aO().func_176734_d()).func_177226_a(field_176464_a, Boolean.valueOf(false)).func_177226_a(field_176463_b, BlockRedstoneComparator.Mode.COMPARE); } + @Override + public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor) + { -+ if (pos.getY() == neighbor.getY() && world instanceof World) ++ if (pos.func_177956_o() == neighbor.func_177956_o() && world instanceof World) + { -+ onNeighborBlockChange((World)world, pos, world.getBlockState(pos), world.getBlockState(neighbor).getBlock()); ++ func_176204_a((World)world, pos, world.func_180495_p(pos), world.func_180495_p(neighbor).func_177230_c()); + } + } + diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch index f165b66c8..fe20ed8f6 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneDiode.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneDiode.java @@ -198,6 +198,8 @@ { - EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); - BlockPos blockpos = pos.offset(enumfacing.getOpposite()); -+ if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(worldIn, pos, worldIn.getBlockState(pos), java.util.EnumSet.of(enumfacing.getOpposite())).isCanceled()) + EnumFacing enumfacing = (EnumFacing)p_176400_3_.func_177229_b(field_176387_N); + BlockPos blockpos = p_176400_2_.func_177972_a(enumfacing.func_176734_d()); ++ if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(p_176400_1_, p_176400_2_, p_176400_1_.func_180495_p(p_176400_2_), java.util.EnumSet.of(enumfacing.func_176734_d())).isCanceled()) + return; - worldIn.notifyBlockOfStateChange(blockpos, this); - worldIn.notifyNeighborsOfStateExcept(blockpos, this, enumfacing); + p_176400_1_.func_180496_d(blockpos, this); + p_176400_1_.func_175695_a(blockpos, this, enumfacing); } diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch index 61ff6434e..daefa904e 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneOre.java.patch @@ -1,19 +1,19 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java @@ -91,12 +91,16 @@ - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { - super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); + super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); + } -- if (this.getItemDropped(state, worldIn.rand, fortune) != Item.getItemFromBlock(this)) +- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this)) + @Override + public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) + { -+ if (this.getItemDropped(world.getBlockState(pos), RANDOM, fortune) != Item.getItemFromBlock(this)) ++ if (this.func_180660_a(world.func_180495_p(pos), RANDOM, fortune) != Item.func_150898_a(this)) { -- int i = 1 + worldIn.rand.nextInt(5); -- this.dropXpOnBlockBreak(worldIn, pos, i); +- int i = 1 + p_180653_1_.field_73012_v.nextInt(5); +- this.func_180637_b(p_180653_1_, p_180653_2_, i); + return 1 + RANDOM.nextInt(5); } + return 0; diff --git a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch index 8fc040e78..69aa76b4d 100644 --- a/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch @@ -1,59 +1,59 @@ --- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java +++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java @@ -58,10 +58,10 @@ - BlockPos blockpos = pos.offset(direction); - Block block = worldIn.getBlockState(pos.offset(direction)).getBlock(); + BlockPos blockpos = p_176341_2_.func_177972_a(p_176341_3_); + Block block = p_176341_1_.func_180495_p(p_176341_2_.func_177972_a(p_176341_3_)).func_177230_c(); -- if (!canConnectTo(worldIn.getBlockState(blockpos), direction) && (block.isSolidFullCube() || !canConnectUpwardsTo(worldIn.getBlockState(blockpos.down())))) -+ if (!canRestoneConnect(worldIn, blockpos, direction) && (block.isSolidFullCube() || !canRestoneConnect(worldIn, blockpos.down(), null))) +- if (!func_176343_a(p_176341_1_.func_180495_p(blockpos), p_176341_3_) && (block.func_149637_q() || !func_176346_d(p_176341_1_.func_180495_p(blockpos.func_177977_b())))) ++ if (!canRestoneConnect(p_176341_1_, blockpos, p_176341_3_) && (block.func_149637_q() || !canRestoneConnect(p_176341_1_, blockpos.func_177977_b(), null))) { - Block block1 = worldIn.getBlockState(pos.up()).getBlock(); -- return !block1.isSolidFullCube() && block.isSolidFullCube() && canConnectUpwardsTo(worldIn.getBlockState(blockpos.up())) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE; -+ return !block1.isSolidFullCube() && block.isSolidFullCube() && canRestoneConnect(worldIn, blockpos.up(), null) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE; + Block block1 = p_176341_1_.func_180495_p(p_176341_2_.func_177984_a()).func_177230_c(); +- return !block1.func_149637_q() && block.func_149637_q() && func_176346_d(p_176341_1_.func_180495_p(blockpos.func_177984_a())) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE; ++ return !block1.func_149637_q() && block.func_149637_q() && canRestoneConnect(p_176341_1_, blockpos.func_177984_a(), null) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE; } else { @@ -359,35 +359,24 @@ - Block block = iblockstate.getBlock(); - boolean flag = block.isNormalCube(); - boolean flag1 = worldIn.getBlockState(pos.up()).getBlock().isNormalCube(); -- return !flag1 && flag && canConnectUpwardsTo(worldIn, blockpos.up()) ? true : (canConnectTo(iblockstate, side) ? true : (block == Blocks.powered_repeater && iblockstate.getValue(BlockRedstoneDiode.FACING) == side ? true : !flag && canConnectUpwardsTo(worldIn, blockpos.down()))); -+ return !flag1 && flag && canRestoneConnect(worldIn, blockpos.up(), null) ? true : (canRestoneConnect(worldIn, blockpos, side) ? true : (block == Blocks.powered_repeater && iblockstate.getValue(BlockRedstoneDiode.FACING) == side ? true : !flag && canRestoneConnect(worldIn, blockpos.down(), null))); + Block block = iblockstate.func_177230_c(); + boolean flag = block.func_149721_r(); + boolean flag1 = p_176339_1_.func_180495_p(p_176339_2_.func_177984_a()).func_177230_c().func_149721_r(); +- return !flag1 && flag && func_176340_e(p_176339_1_, blockpos.func_177984_a()) ? true : (func_176343_a(iblockstate, p_176339_3_) ? true : (block == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_176387_N) == p_176339_3_ ? true : !flag && func_176340_e(p_176339_1_, blockpos.func_177977_b()))); ++ return !flag1 && flag && canRestoneConnect(p_176339_1_, blockpos.func_177984_a(), null) ? true : (canRestoneConnect(p_176339_1_, blockpos, p_176339_3_) ? true : (block == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_176387_N) == p_176339_3_ ? true : !flag && canRestoneConnect(p_176339_1_, blockpos.func_177977_b(), null))); } -- protected static boolean canConnectUpwardsTo(IBlockAccess worldIn, BlockPos pos) +- protected static boolean func_176340_e(IBlockAccess p_176340_0_, BlockPos p_176340_1_) + protected static boolean canRestoneConnect(IBlockAccess world, BlockPos pos, EnumFacing side) { -- return canConnectUpwardsTo(worldIn.getBlockState(pos)); +- return func_176346_d(p_176340_0_.func_180495_p(p_176340_1_)); - } - -- protected static boolean canConnectUpwardsTo(IBlockState state) +- protected static boolean func_176346_d(IBlockState p_176346_0_) - { -- return canConnectTo(state, (EnumFacing)null); +- return func_176343_a(p_176346_0_, (EnumFacing)null); - } - -- protected static boolean canConnectTo(IBlockState blockState, EnumFacing side) +- protected static boolean func_176343_a(IBlockState p_176343_0_, EnumFacing p_176343_1_) - { -- Block block = blockState.getBlock(); +- Block block = p_176343_0_.func_177230_c(); - -- if (block == Blocks.redstone_wire) -+ IBlockState state = world.getBlockState(pos); -+ if (state.getBlock() == Blocks.redstone_wire) +- if (block == Blocks.field_150488_af) ++ IBlockState state = world.func_180495_p(pos); ++ if (state.func_177230_c() == Blocks.field_150488_af) { return true; } -- else if (Blocks.unpowered_repeater.isAssociated(block)) -+ else if (Blocks.unpowered_repeater.isAssociated(state.getBlock())) +- else if (Blocks.field_150413_aR.func_149907_e(block)) ++ else if (Blocks.field_150413_aR.func_149907_e(state.func_177230_c())) { -- EnumFacing enumfacing = (EnumFacing)blockState.getValue(BlockRedstoneRepeater.FACING); -- return enumfacing == side || enumfacing.getOpposite() == side; -+ EnumFacing direction = (EnumFacing)state.getValue(BlockRedstoneRepeater.FACING); -+ return direction == side || direction.getOpposite() == side; +- EnumFacing enumfacing = (EnumFacing)p_176343_0_.func_177229_b(BlockRedstoneRepeater.field_176387_N); +- return enumfacing == p_176343_1_ || enumfacing.func_176734_d() == p_176343_1_; ++ EnumFacing direction = (EnumFacing)state.func_177229_b(BlockRedstoneRepeater.field_176387_N); ++ return direction == side || direction.func_176734_d() == side; } else { -- return block.canProvidePower() && side != null; -+ return state.getBlock().canConnectRedstone(world, pos, side); +- return block.func_149744_f() && p_176343_1_ != null; ++ return state.func_177230_c().canConnectRedstone(world, pos, side); } } diff --git a/patches/minecraft/net/minecraft/block/BlockReed.java.patch b/patches/minecraft/net/minecraft/block/BlockReed.java.patch index a6e2c2ae8..95f05667f 100644 --- a/patches/minecraft/net/minecraft/block/BlockReed.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockReed.java.patch @@ -7,19 +7,19 @@ -public class BlockReed extends Block +public class BlockReed extends Block implements net.minecraftforge.common.IPlantable { - public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15); + public static final PropertyInteger field_176355_a = PropertyInteger.func_177719_a("age", 0, 15); @@ -65,6 +65,7 @@ - public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) { - Block block = worldIn.getBlockState(pos.down()).getBlock(); -+ if (block.canSustainPlant(worldIn, pos.down(), EnumFacing.UP, this)) return true; + Block block = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c(); ++ if (block.canSustainPlant(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP, this)) return true; if (block == this) { @@ -164,4 +165,15 @@ { - return new BlockState(this, new IProperty[] {AGE}); + return new BlockState(this, new IProperty[] {field_176355_a}); } + + @Override @@ -30,6 +30,6 @@ + @Override + public IBlockState getPlant(IBlockAccess world, BlockPos pos) + { -+ return this.getDefaultState(); ++ return this.func_176223_P(); + } } diff --git a/patches/minecraft/net/minecraft/block/BlockRotatedPillar.java.patch b/patches/minecraft/net/minecraft/block/BlockRotatedPillar.java.patch index e450bf907..bd3714927 100644 --- a/patches/minecraft/net/minecraft/block/BlockRotatedPillar.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockRotatedPillar.java.patch @@ -7,12 +7,12 @@ + + public boolean rotateBlock(net.minecraft.world.World world, net.minecraft.util.BlockPos pos, EnumFacing axis) + { -+ net.minecraft.block.state.IBlockState state = world.getBlockState(pos); -+ for (net.minecraft.block.properties.IProperty prop : state.getProperties().keySet()) ++ net.minecraft.block.state.IBlockState state = world.func_180495_p(pos); ++ for (net.minecraft.block.properties.IProperty prop : state.func_177228_b().keySet()) + { -+ if (prop.getName().equals("axis")) ++ if (prop.func_177701_a().equals("axis")) + { -+ world.setBlockState(pos, state.cycleProperty(prop)); ++ world.func_175656_a(pos, state.func_177231_a(prop)); + return true; + } + } diff --git a/patches/minecraft/net/minecraft/block/BlockSapling.java.patch b/patches/minecraft/net/minecraft/block/BlockSapling.java.patch index ce119c1ba..1bef67eb0 100644 --- a/patches/minecraft/net/minecraft/block/BlockSapling.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSapling.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java @@ -71,6 +71,7 @@ - public void generateTree(World worldIn, BlockPos pos, IBlockState state, Random rand) + public void func_176476_e(World p_176476_1_, BlockPos p_176476_2_, IBlockState p_176476_3_, Random p_176476_4_) { -+ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(worldIn, rand, pos)) return; - WorldGenerator worldgenerator = (WorldGenerator)(rand.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true)); ++ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(p_176476_1_, p_176476_4_, p_176476_2_)) return; + WorldGenerator worldgenerator = (WorldGenerator)(p_176476_4_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true)); int i = 0; int j = 0; diff --git a/patches/minecraft/net/minecraft/block/BlockSkull.java.patch b/patches/minecraft/net/minecraft/block/BlockSkull.java.patch index abe2893df..3ec9807b9 100644 --- a/patches/minecraft/net/minecraft/block/BlockSkull.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSkull.java.patch @@ -1,57 +1,57 @@ --- ../src-base/minecraft/net/minecraft/block/BlockSkull.java +++ ../src-work/minecraft/net/minecraft/block/BlockSkull.java @@ -121,10 +121,6 @@ - return tileentity instanceof TileEntitySkull ? ((TileEntitySkull)tileentity).getSkullType() : super.getDamageValue(worldIn, pos); + return tileentity instanceof TileEntitySkull ? ((TileEntitySkull)tileentity).func_145904_a() : super.func_176222_j(p_176222_1_, p_176222_2_); } -- public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) +- public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) - { - } - - public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) + public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, IBlockState p_176208_3_, EntityPlayer p_176208_4_) { - if (player.capabilities.isCreativeMode) + if (p_176208_4_.field_71075_bZ.field_75098_d) @@ -132,13 +128,18 @@ - state = state.withProperty(NODROP, Boolean.valueOf(true)); - worldIn.setBlockState(pos, state, 4); + p_176208_3_ = p_176208_3_.func_177226_a(field_176417_b, Boolean.valueOf(true)); + p_176208_1_.func_180501_a(p_176208_2_, p_176208_3_, 4); } -+ this.dropBlockAsItem(worldIn, pos, state, 0); ++ this.func_176226_b(p_176208_1_, p_176208_2_, p_176208_3_, 0); - super.onBlockHarvested(worldIn, pos, state, player); + super.func_176208_a(p_176208_1_, p_176208_2_, p_176208_3_, p_176208_4_); } - public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_) { -- if (!worldIn.isRemote) -+ super.breakBlock(worldIn, pos, state); +- if (!p_180663_1_.field_72995_K) ++ super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_); + } -+ public java.util.List getDrops(IBlockAccess worldIn, BlockPos pos, IBlockState state, int fortune) ++ public java.util.List getDrops(IBlockAccess p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_, int fortune) + { + java.util.List ret = new java.util.ArrayList(); { - if (!((Boolean)state.getValue(NODROP)).booleanValue()) + if (!((Boolean)p_180663_3_.func_177229_b(field_176417_b)).booleanValue()) { @@ -147,7 +148,7 @@ if (tileentity instanceof TileEntitySkull) { TileEntitySkull tileentityskull = (TileEntitySkull)tileentity; -- ItemStack itemstack = new ItemStack(Items.skull, 1, this.getDamageValue(worldIn, pos)); -+ ItemStack itemstack = new ItemStack(Items.skull, 1, tileentityskull.getSkullType()); +- ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, this.func_176222_j(p_180663_1_, p_180663_2_)); ++ ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, tileentityskull.func_145904_a()); - if (tileentityskull.getSkullType() == 3 && tileentityskull.getPlayerProfile() != null) + if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_152108_a() != null) { @@ -157,12 +158,11 @@ - itemstack.getTagCompound().setTag("SkullOwner", nbttagcompound); + itemstack.func_77978_p().func_74782_a("SkullOwner", nbttagcompound); } -- spawnAsEntity(worldIn, pos, itemstack); +- func_180635_a(p_180663_1_, p_180663_2_, itemstack); + ret.add(itemstack); } } - -- super.breakBlock(worldIn, pos, state); +- super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_); } + return ret; } - public Item getItemDropped(IBlockState state, Random rand, int fortune) + public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_) diff --git a/patches/minecraft/net/minecraft/block/BlockSnow.java.patch b/patches/minecraft/net/minecraft/block/BlockSnow.java.patch index 0e607c12d..78104241b 100644 --- a/patches/minecraft/net/minecraft/block/BlockSnow.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockSnow.java.patch @@ -2,52 +2,52 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java @@ -79,7 +79,7 @@ { - IBlockState iblockstate = worldIn.getBlockState(pos.down()); - Block block = iblockstate.getBlock(); -- return block != Blocks.ice && block != Blocks.packed_ice ? (block.getMaterial() == Material.leaves ? true : (block == this && ((Integer)iblockstate.getValue(LAYERS)).intValue() >= 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false; -+ return block != Blocks.ice && block != Blocks.packed_ice ? (block.isLeaves(worldIn, pos.down()) ? true : (block == this && ((Integer)iblockstate.getValue(LAYERS)).intValue() == 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false; + IBlockState iblockstate = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()); + Block block = iblockstate.func_177230_c(); +- return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.func_149688_o() == Material.field_151584_j ? true : (block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() >= 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false; ++ return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.isLeaves(p_176196_1_, p_176196_2_.func_177977_b()) ? true : (block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false; } - public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + public void func_176204_a(World p_176204_1_, BlockPos p_176204_2_, IBlockState p_176204_3_, Block p_176204_4_) @@ -91,7 +91,6 @@ { - if (!this.canPlaceBlockAt(worldIn, p_176314_2_)) + if (!this.func_176196_c(p_176314_1_, p_176314_2_)) { -- this.dropBlockAsItem(worldIn, p_176314_2_, p_176314_3_, 0); - worldIn.setBlockToAir(p_176314_2_); +- this.func_176226_b(p_176314_1_, p_176314_2_, p_176314_3_, 0); + p_176314_1_.func_175698_g(p_176314_2_); return false; } @@ -103,9 +102,8 @@ - public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_) { -- spawnAsEntity(worldIn, pos, new ItemStack(Items.snowball, ((Integer)state.getValue(LAYERS)).intValue() + 1, 0)); -+ super.harvestBlock(worldIn, player, pos, state, te); - worldIn.setBlockToAir(pos); -- player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); +- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Items.field_151126_ay, ((Integer)p_180657_4_.func_177229_b(field_176315_a)).intValue() + 1, 0)); ++ super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_); + p_180657_1_.func_175698_g(p_180657_3_); +- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]); } - public Item getItemDropped(IBlockState state, Random rand, int fortune) + public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_) @@ -115,14 +113,13 @@ - public int quantityDropped(Random random) + public int func_149745_a(Random p_149745_1_) { - return 0; + return 1; } - public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_) { - if (worldIn.getLightFor(EnumSkyBlock.BLOCK, pos) > 11) + if (p_180650_1_.func_175642_b(EnumSkyBlock.BLOCK, p_180650_2_) > 11) { -- this.dropBlockAsItem(worldIn, pos, worldIn.getBlockState(pos), 0); - worldIn.setBlockToAir(pos); +- this.func_176226_b(p_180650_1_, p_180650_2_, p_180650_1_.func_180495_p(p_180650_2_), 0); + p_180650_1_.func_175698_g(p_180650_2_); } } @@ -152,4 +149,6 @@ { - return new BlockState(this, new IProperty[] {LAYERS}); + return new BlockState(this, new IProperty[] {field_176315_a}); } + -+ @Override public int quantityDropped(IBlockState state, int fortune, Random random){ return ((Integer)state.getValue(LAYERS)) + 1; } ++ @Override public int quantityDropped(IBlockState state, int fortune, Random random){ return ((Integer)state.func_177229_b(field_176315_a)) + 1; } } diff --git a/patches/minecraft/net/minecraft/block/BlockStem.java.patch b/patches/minecraft/net/minecraft/block/BlockStem.java.patch index 41d70ce17..90fd806ba 100644 --- a/patches/minecraft/net/minecraft/block/BlockStem.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockStem.java.patch @@ -1,36 +1,39 @@ --- ../src-base/minecraft/net/minecraft/block/BlockStem.java +++ ../src-work/minecraft/net/minecraft/block/BlockStem.java @@ -94,7 +94,7 @@ - pos = pos.offset(EnumFacing.Plane.HORIZONTAL.random(rand)); - Block block = worldIn.getBlockState(pos.down()).getBlock(); + p_180650_2_ = p_180650_2_.func_177972_a(EnumFacing.Plane.HORIZONTAL.func_179518_a(p_180650_4_)); + Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c(); -- if (worldIn.getBlockState(pos).getBlock().blockMaterial == Material.air && (block == Blocks.farmland || block == Blocks.dirt || block == Blocks.grass)) -+ if (worldIn.isAirBlock(pos) && (block.canSustainPlant(worldIn, pos.down(), EnumFacing.UP, this) || block == Blocks.dirt || block == Blocks.grass)) +- if (p_180650_1_.func_180495_p(p_180650_2_).func_177230_c().field_149764_J == Material.field_151579_a && (block == Blocks.field_150458_ak || block == Blocks.field_150346_d || block == Blocks.field_150349_c)) ++ if (p_180650_1_.func_175623_d(p_180650_2_) && (block.canSustainPlant(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP, this) || block == Blocks.field_150346_d || block == Blocks.field_150349_c)) { - worldIn.setBlockState(pos, this.crop.getDefaultState()); + p_180650_1_.func_175656_a(p_180650_2_, this.field_149877_a.func_176223_P()); } -@@ -148,8 +148,12 @@ - public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) +@@ -148,24 +148,29 @@ + public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_) { - super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); + super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_); + } -- if (!worldIn.isRemote) +- if (!p_180653_1_.field_72995_K) + @Override + public java.util.List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + java.util.List ret = new java.util.ArrayList(); { - Item item = this.getSeedItem(); + Item item = this.func_176481_j(); -@@ -159,13 +163,14 @@ + if (item != null) + { +- int i = ((Integer)p_180653_3_.func_177229_b(field_176484_a)).intValue(); ++ int i = ((Integer)state.func_177229_b(field_176484_a)).intValue(); for (int j = 0; j < 3; ++j) { -- if (worldIn.rand.nextInt(15) <= i) +- if (p_180653_1_.field_73012_v.nextInt(15) <= i) + if (RANDOM.nextInt(15) <= i) { -- spawnAsEntity(worldIn, pos, new ItemStack(item)); +- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item)); + ret.add(new ItemStack(item)); } } @@ -39,4 +42,4 @@ + return ret; } - protected Item getSeedItem() + protected Item func_176481_j() diff --git a/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch b/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch index d0a3b75f3..e9629da02 100644 --- a/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTallGrass.java.patch @@ -7,38 +7,38 @@ -public class BlockTallGrass extends BlockBush implements IGrowable +public class BlockTallGrass extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable { - public static final PropertyEnum TYPE = PropertyEnum.create("type", BlockTallGrass.EnumType.class); + public static final PropertyEnum field_176497_a = PropertyEnum.func_177709_a("type", BlockTallGrass.EnumType.class); @@ -43,7 +43,7 @@ - public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_) { -- return this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); -+ return super.canBlockStay(worldIn, pos, state); +- return this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c()); ++ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_); } - public boolean isReplaceable(World worldIn, BlockPos pos) + public boolean func_176200_f(World p_176200_1_, BlockPos p_176200_2_) @@ -53,7 +53,7 @@ - public Item getItemDropped(IBlockState state, Random rand, int fortune) + public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_) { -- return rand.nextInt(8) == 0 ? Items.wheat_seeds : null; +- return p_180660_2_.nextInt(8) == 0 ? Items.field_151014_N : null; + return null; } - public int quantityDroppedWithBonus(int fortune, Random random) + public int func_149679_a(int p_149679_1_, Random p_149679_2_) @@ -63,13 +63,7 @@ - public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_) { -- if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) +- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) { -- player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); -- spawnAsEntity(worldIn, pos, new ItemStack(Blocks.tallgrass, 1, ((BlockTallGrass.EnumType)state.getValue(TYPE)).getMeta())); +- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]); +- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150329_H, 1, ((BlockTallGrass.EnumType)p_180657_4_.func_177229_b(field_176497_a)).func_177044_a())); - } - else - { - super.harvestBlock(worldIn, player, pos, state, te); + super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_); } } @@ -204,4 +198,22 @@ @@ -51,7 +51,7 @@ + public List onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) + { + List ret = new java.util.ArrayList(); -+ ret.add(new ItemStack(Blocks.tallgrass, 1, ((BlockTallGrass.EnumType)world.getBlockState(pos).getValue(TYPE)).getMeta())); ++ ret.add(new ItemStack(Blocks.field_150329_H, 1, ((BlockTallGrass.EnumType)world.func_180495_p(pos).func_177229_b(field_176497_a)).func_177044_a())); + return ret; + } + @Override diff --git a/patches/minecraft/net/minecraft/block/BlockTorch.java.patch b/patches/minecraft/net/minecraft/block/BlockTorch.java.patch index ca42046b1..8a44d448a 100644 --- a/patches/minecraft/net/minecraft/block/BlockTorch.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTorch.java.patch @@ -3,36 +3,36 @@ @@ -63,7 +63,7 @@ else { - Block block = worldIn.getBlockState(pos).getBlock(); -- return block instanceof BlockFence || block == Blocks.glass || block == Blocks.cobblestone_wall || block == Blocks.stained_glass; -+ return block.canPlaceTorchOnTop(worldIn, pos); + Block block = p_176594_1_.func_180495_p(p_176594_2_).func_177230_c(); +- return block instanceof BlockFence || block == Blocks.field_150359_w || block == Blocks.field_150463_bK || block == Blocks.field_150399_cn; ++ return block.canPlaceTorchOnTop(p_176594_1_, p_176594_2_); } } @@ -84,7 +84,7 @@ { - BlockPos blockpos = pos.offset(facing.getOpposite()); - boolean flag = facing.getAxis().isHorizontal(); -- return flag && worldIn.isBlockNormalCube(blockpos, true) || facing.equals(EnumFacing.UP) && this.canPlaceOn(worldIn, blockpos); -+ return flag && worldIn.isSideSolid(blockpos, facing, true) || facing.equals(EnumFacing.UP) && this.canPlaceOn(worldIn, blockpos); + BlockPos blockpos = p_176595_2_.func_177972_a(p_176595_3_.func_176734_d()); + boolean flag = p_176595_3_.func_176740_k().func_176722_c(); +- return flag && p_176595_1_.func_175677_d(blockpos, true) || p_176595_3_.equals(EnumFacing.UP) && this.func_176594_d(p_176595_1_, blockpos); ++ return flag && p_176595_1_.isSideSolid(blockpos, p_176595_3_, true) || p_176595_3_.equals(EnumFacing.UP) && this.func_176594_d(p_176595_1_, blockpos); } - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_) @@ -97,7 +97,7 @@ { for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { -- if (worldIn.isBlockNormalCube(pos.offset(enumfacing.getOpposite()), true)) -+ if (worldIn.isSideSolid(pos.offset(enumfacing.getOpposite()), enumfacing, true)) +- if (p_180642_1_.func_175677_d(p_180642_2_.func_177972_a(enumfacing.func_176734_d()), true)) ++ if (p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(enumfacing.func_176734_d()), enumfacing, true)) { - return this.getDefaultState().withProperty(FACING, enumfacing); + return this.func_176223_P().func_177226_a(field_176596_a, enumfacing); } @@ -130,7 +130,7 @@ - EnumFacing enumfacing1 = enumfacing.getOpposite(); + EnumFacing enumfacing1 = enumfacing.func_176734_d(); boolean flag = false; -- if (enumfacing$axis.isHorizontal() && !worldIn.isBlockNormalCube(pos.offset(enumfacing1), true)) -+ if (enumfacing$axis.isHorizontal() && !worldIn.isSideSolid(pos.offset(enumfacing1), enumfacing1, true)) +- if (enumfacing$axis.func_176722_c() && !p_176592_1_.func_175677_d(p_176592_2_.func_177972_a(enumfacing1), true)) ++ if (enumfacing$axis.func_176722_c() && !p_176592_1_.isSideSolid(p_176592_2_.func_177972_a(enumfacing1), enumfacing1, true)) { flag = true; } diff --git a/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch b/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch index 7de11cc75..0eb19ae31 100644 --- a/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTrapDoor.java.patch @@ -6,38 +6,38 @@ { + /** Set this to allow trapdoors to remain free-floating */ + public static boolean disableValidation = false; - public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); - public static final PropertyBool OPEN = PropertyBool.create("open"); - public static final PropertyEnum HALF = PropertyEnum.create("half", BlockTrapDoor.DoorHalf.class); + public static final PropertyDirection field_176284_a = PropertyDirection.func_177712_a("facing", EnumFacing.Plane.HORIZONTAL); + public static final PropertyBool field_176283_b = PropertyBool.func_177716_a("open"); + public static final PropertyEnum field_176285_M = PropertyEnum.func_177709_a("half", BlockTrapDoor.DoorHalf.class); @@ -140,9 +142,10 @@ { - if (!worldIn.isRemote) + if (!p_176204_1_.field_72995_K) { -+ EnumFacing direction = (EnumFacing)state.getValue(FACING); - BlockPos blockpos = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite()); ++ EnumFacing direction = (EnumFacing)p_176204_3_.func_177229_b(field_176284_a); + BlockPos blockpos = p_176204_2_.func_177972_a(((EnumFacing)p_176204_3_.func_177229_b(field_176284_a)).func_176734_d()); -- if (!isValidSupportBlock(worldIn.getBlockState(blockpos).getBlock())) -+ if (!(isValidSupportBlock(worldIn.getBlockState(blockpos).getBlock()) || worldIn.isSideSolid(blockpos, direction, true))) +- if (!func_150119_a(p_176204_1_.func_180495_p(blockpos).func_177230_c())) ++ if (!(func_150119_a(p_176204_1_.func_180495_p(blockpos).func_177230_c()) || p_176204_1_.isSideSolid(blockpos, direction, true))) { - worldIn.setBlockToAir(pos); - this.dropBlockAsItem(worldIn, pos, state, 0); + p_176204_1_.func_175698_g(p_176204_2_); + this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0); @@ -186,7 +189,10 @@ - public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) + public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_) { -- return !side.getAxis().isVertical() && isValidSupportBlock(worldIn.getBlockState(pos.offset(side.getOpposite())).getBlock()); +- return !p_176198_3_.func_176740_k().func_176720_b() && func_150119_a(p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_177230_c()); + if (disableValidation) return true; -+ EnumFacing dir = side.getOpposite(); -+ pos = pos.offset(dir); -+ return !side.getAxis().isVertical() && (isValidSupportBlock(worldIn.getBlockState(pos).getBlock()) || worldIn.isSideSolid(pos, side, true)); ++ EnumFacing dir = p_176198_3_.func_176734_d(); ++ p_176198_2_ = p_176198_2_.func_177972_a(dir); ++ return !p_176198_3_.func_176740_k().func_176720_b() && (func_150119_a(p_176198_1_.func_180495_p(p_176198_2_).func_177230_c()) || p_176198_1_.isSideSolid(p_176198_2_, p_176198_3_, true)); } - protected static EnumFacing getFacing(int meta) + protected static EnumFacing func_176281_b(int p_176281_0_) @@ -223,6 +229,7 @@ - private static boolean isValidSupportBlock(Block blockIn) + private static boolean func_150119_a(Block p_150119_0_) { + if (disableValidation) return true; - return blockIn.blockMaterial.isOpaque() && blockIn.isFullCube() || blockIn == Blocks.glowstone || blockIn instanceof BlockSlab || blockIn instanceof BlockStairs; + return p_150119_0_.field_149764_J.func_76218_k() && p_150119_0_.func_149686_d() || p_150119_0_ == Blocks.field_150426_aN || 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 a8de6b96f..6a6ba2054 100644 --- a/patches/minecraft/net/minecraft/block/BlockTripWireHook.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockTripWireHook.java.patch @@ -2,27 +2,27 @@ +++ ../src-work/minecraft/net/minecraft/block/BlockTripWireHook.java @@ -58,14 +58,14 @@ - public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) + public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_) { -- return side.getAxis().isHorizontal() && worldIn.getBlockState(pos.offset(side.getOpposite())).getBlock().isNormalCube(); -+ return side.getAxis().isHorizontal() && worldIn.isSideSolid(pos.offset(side.getOpposite()), side, true); +- return p_176198_3_.func_176740_k().func_176722_c() && p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_177230_c().func_149721_r(); ++ return p_176198_3_.func_176740_k().func_176722_c() && p_176198_1_.isSideSolid(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()), p_176198_3_, true); } - public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_) { for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) { -- if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock().isNormalCube()) -+ if (worldIn.isSideSolid(pos.offset(enumfacing), enumfacing.getOpposite(), true)) +- if (p_176196_1_.func_180495_p(p_176196_2_.func_177972_a(enumfacing)).func_177230_c().func_149721_r()) ++ if (p_176196_1_.isSideSolid(p_176196_2_.func_177972_a(enumfacing), enumfacing.func_176734_d(), true)) { return true; } @@ -99,7 +99,7 @@ { - EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + EnumFacing enumfacing = (EnumFacing)p_176204_3_.func_177229_b(field_176264_a); -- if (!worldIn.getBlockState(pos.offset(enumfacing.getOpposite())).getBlock().isNormalCube()) -+ if (!worldIn.isSideSolid(pos.offset(enumfacing.getOpposite()), enumfacing, true)) +- if (!p_176204_1_.func_180495_p(p_176204_2_.func_177972_a(enumfacing.func_176734_d())).func_177230_c().func_149721_r()) ++ if (!p_176204_1_.isSideSolid(p_176204_2_.func_177972_a(enumfacing.func_176734_d()), enumfacing, true)) { - this.dropBlockAsItem(worldIn, pos, state, 0); - worldIn.setBlockToAir(pos); + this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0); + p_176204_1_.func_175698_g(p_176204_2_); diff --git a/patches/minecraft/net/minecraft/block/BlockVine.java.patch b/patches/minecraft/net/minecraft/block/BlockVine.java.patch index a3536a850..e64d0dd18 100644 --- a/patches/minecraft/net/minecraft/block/BlockVine.java.patch +++ b/patches/minecraft/net/minecraft/block/BlockVine.java.patch @@ -7,20 +7,20 @@ -public class BlockVine extends Block +public class BlockVine extends Block implements net.minecraftforge.common.IShearable { - public static final PropertyBool UP = PropertyBool.create("up"); - public static final PropertyBool NORTH = PropertyBool.create("north"); + public static final PropertyBool field_176277_a = PropertyBool.func_177716_a("up"); + public static final PropertyBool field_176273_b = PropertyBool.func_177716_a("north"); @@ -387,13 +387,7 @@ - public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_) { -- if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) +- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) { -- player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); -- spawnAsEntity(worldIn, pos, new ItemStack(Blocks.vine, 1, 0)); +- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]); +- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150395_bd, 1, 0)); - } - else - { - super.harvestBlock(worldIn, player, pos, state, te); + super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_); } } @@ -474,4 +468,14 @@ diff --git a/patches/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch b/patches/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch index a9bcee491..9b66c108c 100644 --- a/patches/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch +++ b/patches/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch @@ -2,28 +2,28 @@ +++ ../src-work/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java @@ -78,7 +78,7 @@ { - Block block = this.world.getBlockState(origin).getBlock(); + Block block = this.field_177261_a.func_180495_p(p_177251_1_).func_177230_c(); -- if (block.getMaterial() == Material.air) -+ if (block.isAir(world, origin)) +- if (block.func_149688_o() == Material.field_151579_a) ++ if (block.isAir(field_177261_a, p_177251_1_)) { return true; } @@ -109,7 +109,7 @@ - BlockPos blockpos = origin.offset(this.moveDirection.getOpposite(), i); - block = this.world.getBlockState(blockpos).getBlock(); + BlockPos blockpos = p_177251_1_.func_177967_a(this.field_177257_d.func_176734_d(), i); + block = this.field_177261_a.func_180495_p(blockpos).func_177230_c(); -- if (block.getMaterial() == Material.air || !BlockPistonBase.canPush(block, this.world, blockpos, this.moveDirection, false) || blockpos.equals(this.pistonPos)) -+ if (block.isAir(world, blockpos)|| !BlockPistonBase.canPush(block, this.world, blockpos, this.moveDirection, false) || blockpos.equals(this.pistonPos)) +- if (block.func_149688_o() == Material.field_151579_a || !BlockPistonBase.func_180696_a(block, this.field_177261_a, blockpos, this.field_177257_d, false) || blockpos.equals(this.field_177259_b)) ++ if (block.isAir(field_177261_a, blockpos)|| !BlockPistonBase.func_180696_a(block, this.field_177261_a, blockpos, this.field_177257_d, false) || blockpos.equals(this.field_177259_b)) { break; } @@ -156,7 +156,7 @@ - block = this.world.getBlockState(blockpos1).getBlock(); + block = this.field_177261_a.func_180495_p(blockpos1).func_177230_c(); -- if (block.getMaterial() == Material.air) -+ if (block.isAir(world, blockpos1)) +- if (block.func_149688_o() == Material.field_151579_a) ++ if (block.isAir(field_177261_a, blockpos1)) { return true; } diff --git a/patches/minecraft/net/minecraft/block/state/BlockState.java.patch b/patches/minecraft/net/minecraft/block/state/BlockState.java.patch index 357204736..8d775ed11 100644 --- a/patches/minecraft/net/minecraft/block/state/BlockState.java.patch +++ b/patches/minecraft/net/minecraft/block/state/BlockState.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/block/state/BlockState.java @@ -38,6 +38,16 @@ - public BlockState(Block blockIn, IProperty... properties) + public BlockState(Block p_i45663_1_, IProperty... p_i45663_2_) { -+ this(blockIn, properties, null); ++ this(p_i45663_1_, p_i45663_2_, null); + } + + protected StateImplementation createState(Block block, ImmutableMap properties, ImmutableMap, com.google.common.base.Optional> unlistedProperties) @@ -12,17 +12,17 @@ + return new StateImplementation(block, properties); + } + -+ protected BlockState(Block blockIn, IProperty[] properties, ImmutableMap, com.google.common.base.Optional> unlistedProperties) ++ protected BlockState(Block p_i45663_1_, IProperty[] p_i45663_2_, ImmutableMap, com.google.common.base.Optional> unlistedProperties) + { - this.block = blockIn; - Arrays.sort(properties, new Comparator() + this.field_177627_c = p_i45663_1_; + Arrays.sort(p_i45663_2_, new Comparator() { @@ -53,7 +63,7 @@ - for (List list1 : Cartesian.cartesianProduct(this.getAllowedValues())) + for (List list1 : Cartesian.func_179321_a(this.func_177620_e())) { - Map map1 = MapPopulator.createMap(this.properties, list1); -- BlockState.StateImplementation blockstate$stateimplementation = new BlockState.StateImplementation(blockIn, ImmutableMap.copyOf(map1)); -+ BlockState.StateImplementation blockstate$stateimplementation = createState(blockIn, ImmutableMap.copyOf(map1), unlistedProperties); + Map map1 = MapPopulator.func_179400_b(this.field_177624_d, list1); +- BlockState.StateImplementation blockstate$stateimplementation = new BlockState.StateImplementation(p_i45663_1_, ImmutableMap.copyOf(map1)); ++ BlockState.StateImplementation blockstate$stateimplementation = createState(p_i45663_1_, ImmutableMap.copyOf(map1), unlistedProperties); map.put(map1, blockstate$stateimplementation); list.add(blockstate$stateimplementation); } @@ -32,22 +32,22 @@ + protected StateImplementation(Block blockIn, ImmutableMap propertiesIn, ImmutableTable propertyValueTable) + { -+ this.block = blockIn; -+ this.properties = propertiesIn; -+ this.propertyValueTable = propertyValueTable; ++ this.field_177239_a = blockIn; ++ this.field_177237_b = propertiesIn; ++ this.field_177238_c = propertyValueTable; + } + - public , V extends T> IBlockState withProperty(IProperty property, V value) + public , V extends T> IBlockState func_177226_a(IProperty p_177226_1_, V p_177226_2_) { - if (!this.properties.containsKey(property)) + if (!this.field_177237_b.containsKey(p_177226_1_)) @@ -199,5 +216,10 @@ - map.put(property, value); + map.put(p_177236_1_, p_177236_2_); return map; } + + public ImmutableTable getPropertyValueTable() + { -+ return propertyValueTable; ++ return field_177238_c; + } } } diff --git a/patches/minecraft/net/minecraft/client/LoadingScreenRenderer.java.patch b/patches/minecraft/net/minecraft/client/LoadingScreenRenderer.java.patch index 093758d5b..2d8b6e47e 100644 --- a/patches/minecraft/net/minecraft/client/LoadingScreenRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/LoadingScreenRenderer.java.patch @@ -1,26 +1,26 @@ --- ../src-base/minecraft/net/minecraft/client/LoadingScreenRenderer.java +++ ../src-work/minecraft/net/minecraft/client/LoadingScreenRenderer.java @@ -139,6 +139,10 @@ - GlStateManager.clear(16640); + GlStateManager.func_179086_m(16640); } + try + { + if (!net.minecraftforge.fml.client.FMLClientHandler.instance().handleLoadingScreen(scaledresolution)) //FML Don't render while FML's pre-screen is rendering + { - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer worldrenderer = tessellator.getWorldRenderer(); - this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); + this.field_73725_b.func_110434_K().func_110577_a(Gui.field_110325_k); @@ -174,6 +178,12 @@ - GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); - this.mc.fontRendererObj.drawStringWithShadow(this.currentlyDisplayedText, (float)((k - this.mc.fontRendererObj.getStringWidth(this.currentlyDisplayedText)) / 2), (float)(l / 2 - 4 - 16), 16777215); - this.mc.fontRendererObj.drawStringWithShadow(this.message, (float)((k - this.mc.fontRendererObj.getStringWidth(this.message)) / 2), (float)(l / 2 - 4 + 8), 16777215); + GlStateManager.func_179120_a(770, 771, 1, 0); + this.field_73725_b.field_71466_p.func_175063_a(this.field_73726_c, (float)((k - this.field_73725_b.field_71466_p.func_78256_a(this.field_73726_c)) / 2), (float)(l / 2 - 4 - 16), 16777215); + this.field_73725_b.field_71466_p.func_175063_a(this.field_73727_a, (float)((k - this.field_73725_b.field_71466_p.func_78256_a(this.field_73727_a)) / 2), (float)(l / 2 - 4 + 8), 16777215); + } + } + catch (java.io.IOException e) + { + com.google.common.base.Throwables.propagate(e); + } //FML End - this.framebuffer.unbindFramebuffer(); + this.field_146588_g.func_147609_e(); - if (OpenGlHelper.isFramebufferEnabled()) + if (OpenGlHelper.func_148822_b()) diff --git a/patches/minecraft/net/minecraft/client/Minecraft.java.patch b/patches/minecraft/net/minecraft/client/Minecraft.java.patch index d1f5d382a..15098b70c 100644 --- a/patches/minecraft/net/minecraft/client/Minecraft.java.patch +++ b/patches/minecraft/net/minecraft/client/Minecraft.java.patch @@ -1,181 +1,181 @@ --- ../src-base/minecraft/net/minecraft/client/Minecraft.java +++ ../src-work/minecraft/net/minecraft/client/Minecraft.java @@ -301,7 +301,6 @@ - this.sessionService = (new YggdrasilAuthenticationService(gameConfig.userInfo.proxy, UUID.randomUUID().toString())).createMinecraftSessionService(); - this.session = gameConfig.userInfo.session; - logger.info("Setting user: " + this.session.getUsername()); -- logger.info("(Session ID is " + this.session.getSessionID() + ")"); - this.isDemo = gameConfig.gameInfo.isDemo; - this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1; - this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1; + this.field_152355_az = (new YggdrasilAuthenticationService(p_i45547_1_.field_178745_a.field_178751_c, UUID.randomUUID().toString())).createMinecraftSessionService(); + this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a; + field_147123_G.info("Setting user: " + this.field_71449_j.func_111285_a()); +- field_147123_G.info("(Session ID is " + this.field_71449_j.func_111286_b() + ")"); + this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a; + this.field_71443_c = p_i45547_1_.field_178743_b.field_178764_a > 0 ? p_i45547_1_.field_178743_b.field_178764_a : 1; + this.field_71440_d = p_i45547_1_.field_178743_b.field_178762_b > 0 ? p_i45547_1_.field_178743_b.field_178762_b : 1; @@ -415,10 +414,10 @@ - this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_); - this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language); - this.mcResourceManager.registerReloadListener(this.mcLanguageManager); -- this.refreshResources(); -+ net.minecraftforge.fml.client.FMLClientHandler.instance().beginMinecraftLoading(this, this.defaultResourcePacks, this.mcResourceManager); - this.renderEngine = new TextureManager(this.mcResourceManager); - this.mcResourceManager.registerReloadListener(this.renderEngine); -- this.drawSplashScreen(this.renderEngine); -+ net.minecraftforge.fml.client.SplashProgress.drawVanillaScreen(this.renderEngine); - this.initStream(); - this.skinManager = new SkinManager(this.renderEngine, new File(this.fileAssets, "skins"), this.sessionService); - this.saveLoader = new AnvilSaveConverter(new File(this.mcDataDir, "saves")); + this.field_110451_am = new SimpleReloadableResourceManager(this.field_110452_an); + this.field_135017_as = new LanguageManager(this.field_110452_an, this.field_71474_y.field_74363_ab); + this.field_110451_am.func_110542_a(this.field_135017_as); +- this.func_110436_a(); ++ net.minecraftforge.fml.client.FMLClientHandler.instance().beginMinecraftLoading(this, this.field_110449_ao, this.field_110451_am); + this.field_71446_o = new TextureManager(this.field_110451_am); + this.field_110451_am.func_110542_a(this.field_71446_o); +- this.func_180510_a(this.field_71446_o); ++ net.minecraftforge.fml.client.SplashProgress.drawVanillaScreen(this.field_71446_o); + this.func_175595_al(); + this.field_152350_aA = new SkinManager(this.field_71446_o, new File(this.field_110446_Y, "skins"), this.field_152355_az); + this.field_71469_aa = new AnvilSaveConverter(new File(this.field_71412_D, "saves")); @@ -453,6 +452,8 @@ } }); - this.mouseHelper = new MouseHelper(); + this.field_71417_B = new MouseHelper(); + net.minecraftforge.fml.common.ProgressManager.ProgressBar bar= net.minecraftforge.fml.common.ProgressManager.push("Rendering Setup", 5, true); + bar.step("GL Setup"); - this.checkGLError("Pre startup"); - GlStateManager.enableTexture2D(); - GlStateManager.shadeModel(7425); + this.func_71361_d("Pre startup"); + GlStateManager.func_179098_w(); + GlStateManager.func_179103_j(7425); @@ -466,17 +467,21 @@ - GlStateManager.loadIdentity(); - GlStateManager.matrixMode(5888); - this.checkGLError("Startup"); -- this.textureMapBlocks = new TextureMap("textures"); + GlStateManager.func_179096_D(); + GlStateManager.func_179128_n(5888); + this.func_71361_d("Startup"); +- this.field_147128_au = new TextureMap("textures"); + bar.step("Loading Texture Map"); -+ this.textureMapBlocks = new TextureMap("textures",true); - this.textureMapBlocks.setMipmapLevels(this.gameSettings.mipmapLevels); - this.renderEngine.loadTickableTexture(TextureMap.locationBlocksTexture, this.textureMapBlocks); - this.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - this.textureMapBlocks.setBlurMipmapDirect(false, this.gameSettings.mipmapLevels > 0); ++ this.field_147128_au = new TextureMap("textures",true); + this.field_147128_au.func_147633_a(this.field_71474_y.field_151442_I); + this.field_71446_o.func_110580_a(TextureMap.field_110575_b, this.field_147128_au); + this.field_71446_o.func_110577_a(TextureMap.field_110575_b); + this.field_147128_au.func_174937_a(false, this.field_71474_y.field_151442_I > 0); + bar.step("Loading Model Manager"); - this.modelManager = new ModelManager(this.textureMapBlocks); - this.mcResourceManager.registerReloadListener(this.modelManager); + this.field_175617_aL = new ModelManager(this.field_147128_au); + this.field_110451_am.func_110542_a(this.field_175617_aL); + bar.step("Loading Item Renderer"); - this.renderItem = new RenderItem(this.renderEngine, this.modelManager); - this.renderManager = new RenderManager(this.renderEngine, this.renderItem); - this.itemRenderer = new ItemRenderer(this); - this.mcResourceManager.registerReloadListener(this.renderItem); + this.field_175621_X = new RenderItem(this.field_71446_o, this.field_175617_aL); + this.field_175616_W = new RenderManager(this.field_71446_o, this.field_175621_X); + this.field_175620_Y = new ItemRenderer(this); + this.field_110451_am.func_110542_a(this.field_175621_X); + bar.step("Loading Entity Renderer"); - this.entityRenderer = new EntityRenderer(this, this.mcResourceManager); - this.mcResourceManager.registerReloadListener(this.entityRenderer); - this.blockRenderDispatcher = new BlockRendererDispatcher(this.modelManager.getBlockModelShapes(), this.gameSettings); + this.field_71460_t = new EntityRenderer(this, this.field_110451_am); + this.field_110451_am.func_110542_a(this.field_71460_t); + this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_71474_y); @@ -486,22 +491,25 @@ - this.guiAchievement = new GuiAchievement(this); - GlStateManager.viewport(0, 0, this.displayWidth, this.displayHeight); - this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine); + this.field_71458_u = new GuiAchievement(this); + GlStateManager.func_179083_b(0, 0, this.field_71443_c, this.field_71440_d); + this.field_71452_i = new EffectRenderer(this.field_71441_e, this.field_71446_o); + net.minecraftforge.fml.common.ProgressManager.pop(bar); + net.minecraftforge.fml.client.FMLClientHandler.instance().finishMinecraftLoading(); - this.checkGLError("Post startup"); -- this.ingameGUI = new GuiIngame(this); -+ this.ingameGUI = new net.minecraftforge.client.GuiIngameForge(this); + this.func_71361_d("Post startup"); +- this.field_71456_v = new GuiIngame(this); ++ this.field_71456_v = new net.minecraftforge.client.GuiIngameForge(this); - if (this.serverName != null) + if (this.field_71475_ae != null) { -- this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort)); -+ net.minecraftforge.fml.client.FMLClientHandler.instance().connectToServerAtStartup(this.serverName, this.serverPort); +- this.func_147108_a(new GuiConnecting(new GuiMainMenu(), this, this.field_71475_ae, this.field_71477_af)); ++ net.minecraftforge.fml.client.FMLClientHandler.instance().connectToServerAtStartup(this.field_71475_ae, this.field_71477_af); } else { - this.displayGuiScreen(new GuiMainMenu()); + this.func_147108_a(new GuiMainMenu()); } -- this.renderEngine.deleteTexture(this.mojangLogo); -+ net.minecraftforge.fml.client.SplashProgress.clearVanillaResources(renderEngine, mojangLogo); - this.mojangLogo = null; - this.loadingScreen = new LoadingScreenRenderer(this); +- this.field_71446_o.func_147645_c(this.field_152354_ay); ++ net.minecraftforge.fml.client.SplashProgress.clearVanillaResources(field_71446_o, field_152354_ay); + this.field_152354_ay = null; + this.field_71461_s = new LoadingScreenRenderer(this); + net.minecraftforge.fml.client.FMLClientHandler.instance().onInitializationComplete(); - if (this.gameSettings.fullScreen && !this.fullscreen) + if (this.field_71474_y.field_74353_u && !this.field_71431_Q) { - this.toggleFullscreen(); + this.func_71352_k(); @@ -681,21 +689,23 @@ File file2 = new File(file1, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt"); - Bootstrap.printToSYSOUT(crashReportIn.getCompleteReport()); + Bootstrap.func_179870_a(p_71377_1_.func_71502_e()); + int retVal; - if (crashReportIn.getFile() != null) + if (p_71377_1_.func_71497_f() != null) { - Bootstrap.printToSYSOUT("#@!@# Game crashed! Crash report saved to: #@!@# " + crashReportIn.getFile()); + Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_1_.func_71497_f()); - System.exit(-1); + retVal = -1; } - else if (crashReportIn.saveToFile(file2)) + else if (p_71377_1_.func_147149_a(file2)) { - Bootstrap.printToSYSOUT("#@!@# Game crashed! Crash report saved to: #@!@# " + file2.getAbsolutePath()); + Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + file2.getAbsolutePath()); - System.exit(-1); + retVal = -1; } else { - Bootstrap.printToSYSOUT("#@?@# Game crashed! Crash report could not be saved. #@?@#"); + Bootstrap.func_179870_a("#@?@# Game crashed! Crash report could not be saved. #@?@#"); - System.exit(-2); + retVal = -2; } + net.minecraftforge.fml.common.FMLCommonHandler.instance().handleExit(retVal); } - public boolean isUnicode() + public boolean func_152349_b() @@ -883,11 +893,6 @@ - public void displayGuiScreen(GuiScreen guiScreenIn) + public void func_147108_a(GuiScreen p_147108_1_) { -- if (this.currentScreen != null) +- if (this.field_71462_r != null) - { -- this.currentScreen.onGuiClosed(); +- this.field_71462_r.func_146281_b(); - } - - if (guiScreenIn == null && this.theWorld == null) + if (p_147108_1_ == null && this.field_71441_e == null) { - guiScreenIn = new GuiMainMenu(); + p_147108_1_ = new GuiMainMenu(); @@ -897,6 +902,17 @@ - guiScreenIn = new GuiGameOver(); + p_147108_1_ = new GuiGameOver(); } -+ GuiScreen old = this.currentScreen; -+ net.minecraftforge.client.event.GuiOpenEvent event = new net.minecraftforge.client.event.GuiOpenEvent(guiScreenIn); ++ GuiScreen old = this.field_71462_r; ++ net.minecraftforge.client.event.GuiOpenEvent event = new net.minecraftforge.client.event.GuiOpenEvent(p_147108_1_); + + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; + -+ guiScreenIn = event.gui; -+ if (old != null && guiScreenIn != old) ++ p_147108_1_ = event.gui; ++ if (old != null && p_147108_1_ != old) + { -+ old.onGuiClosed(); ++ old.func_146281_b(); + } + - if (guiScreenIn instanceof GuiMainMenu) + if (p_147108_1_ instanceof GuiMainMenu) { - this.gameSettings.showDebugInfo = false; + this.field_71474_y.field_74330_P = false; @@ -1030,9 +1046,11 @@ - if (!this.skipRenderWorld) + if (!this.field_71454_w) { -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onRenderTickStart(this.timer.renderPartialTicks); - this.mcProfiler.endStartSection("gameRenderer"); - this.entityRenderer.func_181560_a(this.timer.renderPartialTicks, i); - this.mcProfiler.endSection(); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onRenderTickEnd(this.timer.renderPartialTicks); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().onRenderTickStart(this.field_71428_T.field_74281_c); + this.field_71424_I.func_76318_c("gameRenderer"); + this.field_71460_t.func_181560_a(this.field_71428_T.field_74281_c, i); + this.field_71424_I.func_76319_b(); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().onRenderTickEnd(this.field_71428_T.field_74281_c); } - this.mcProfiler.endSection(); + this.field_71424_I.func_76319_b(); @@ -1377,7 +1395,7 @@ - if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air && this.playerController.func_180512_c(blockpos, this.objectMouseOver.sideHit)) + if (this.field_71441_e.func_180495_p(blockpos).func_177230_c().func_149688_o() != Material.field_151579_a && this.field_71442_b.func_180512_c(blockpos, this.field_71476_x.field_178784_b)) { -- this.effectRenderer.addBlockHitEffects(blockpos, this.objectMouseOver.sideHit); -+ this.effectRenderer.addBlockHitEffects(blockpos, this.objectMouseOver); - this.thePlayer.swingItem(); +- this.field_71452_i.func_180532_a(blockpos, this.field_71476_x.field_178784_b); ++ this.field_71452_i.addBlockHitEffects(blockpos, this.field_71476_x); + this.field_71439_g.func_71038_i(); } } @@ -1463,15 +1481,19 @@ case BLOCK: - BlockPos blockpos = this.objectMouseOver.getBlockPos(); + BlockPos blockpos = this.field_71476_x.func_178782_a(); -- if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air) -+ if (!this.theWorld.isAirBlock(blockpos)) +- if (this.field_71441_e.func_180495_p(blockpos).func_177230_c().func_149688_o() != Material.field_151579_a) ++ if (!this.field_71441_e.func_175623_d(blockpos)) { - int i = itemstack != null ? itemstack.stackSize : 0; + int i = itemstack != null ? itemstack.field_77994_a : 0; + -+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thePlayer, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, this.theWorld, blockpos, this.objectMouseOver.sideHit).isCanceled(); ++ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_71439_g, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, this.field_71441_e, blockpos, this.field_71476_x.field_178784_b).isCanceled(); + if (result) { //Forge: Kept separate to simplify patch - if (this.playerController.func_178890_a(this.thePlayer, this.theWorld, itemstack, blockpos, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec)) + if (this.field_71442_b.func_178890_a(this.field_71439_g, this.field_71441_e, itemstack, blockpos, this.field_71476_x.field_178784_b, this.field_71476_x.field_72307_f)) { flag = false; - this.thePlayer.swingItem(); + this.field_71439_g.func_71038_i(); } + } @@ -183,23 +183,23 @@ { @@ -1494,7 +1516,8 @@ { - ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem(); + ItemStack itemstack1 = this.field_71439_g.field_71071_by.func_70448_g(); -- if (itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1)) -+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thePlayer, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR, theWorld, null, null).isCanceled(); -+ if (result && itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1)) +- if (itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1)) ++ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_71439_g, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR, field_71441_e, null, null).isCanceled(); ++ if (result && itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1)) { - this.entityRenderer.itemRenderer.resetEquippedProgress2(); + this.field_71460_t.field_78516_c.func_78445_c(); } @@ -1598,6 +1621,8 @@ - --this.rightClickDelayTimer; + --this.field_71467_ac; } + net.minecraftforge.fml.common.FMLCommonHandler.instance().onPreClientTick(); + - this.mcProfiler.startSection("gui"); + this.field_71424_I.func_76320_a("gui"); - if (!this.isGamePaused) + if (!this.field_71445_n) @@ -1690,6 +1715,8 @@ while (Mouse.next()) @@ -207,16 +207,16 @@ + if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue; + int i = Mouse.getEventButton(); - KeyBinding.setKeyBindState(i - 100, Mouse.getEventButtonState()); + KeyBinding.func_74510_a(i - 100, Mouse.getEventButtonState()); @@ -1745,6 +1772,7 @@ - this.currentScreen.handleMouseInput(); + this.field_71462_r.func_146274_d(); } } + net.minecraftforge.fml.common.FMLCommonHandler.instance().fireMouseInput(); } - if (this.leftClickCounter > 0) + if (this.field_71429_W > 0) @@ -1923,6 +1951,7 @@ } } @@ -226,69 +226,69 @@ for (int l = 0; l < 9; ++l) @@ -2119,12 +2148,15 @@ - this.myNetworkManager.processReceivedPackets(); + this.field_71453_ak.func_74428_b(); } + net.minecraftforge.fml.common.FMLCommonHandler.instance().onPostClientTick(); + - this.mcProfiler.endSection(); - this.systemTime = getSystemTime(); + this.field_71424_I.func_76319_b(); + this.field_71423_H = func_71386_F(); } - public void launchIntegratedServer(String folderName, String worldName, WorldSettings worldSettingsIn) + public void func_71371_a(String p_71371_1_, String p_71371_2_, WorldSettings p_71371_3_) { -+ net.minecraftforge.fml.client.FMLClientHandler.instance().startIntegratedServer(folderName, worldName, worldSettingsIn); - this.loadWorld((WorldClient)null); ++ net.minecraftforge.fml.client.FMLClientHandler.instance().startIntegratedServer(p_71371_1_, p_71371_2_, p_71371_3_); + this.func_71403_a((WorldClient)null); System.gc(); - ISaveHandler isavehandler = this.saveLoader.getSaveLoader(folderName, false); + ISaveHandler isavehandler = this.field_71469_aa.func_75804_a(p_71371_1_, false); @@ -2160,6 +2192,12 @@ - while (!this.theIntegratedServer.serverIsInRunLoop()) + while (!this.field_71437_Z.func_71200_ad()) { + if (!net.minecraftforge.fml.common.StartupQuery.check()) + { -+ loadWorld(null); -+ displayGuiScreen(null); ++ func_71403_a(null); ++ func_147108_a(null); + return; + } - String s = this.theIntegratedServer.getUserMessage(); + String s = this.field_71437_Z.func_71195_b_(); if (s != null) @@ -2185,8 +2223,14 @@ - SocketAddress socketaddress = this.theIntegratedServer.getNetworkSystem().addLocalEndpoint(); - NetworkManager networkmanager = NetworkManager.provideLocalClient(socketaddress); - networkmanager.setNetHandler(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null)); -- networkmanager.sendPacket(new C00Handshake(47, socketaddress.toString(), 0, EnumConnectionState.LOGIN)); -- networkmanager.sendPacket(new C00PacketLoginStart(this.getSession().getProfile())); -+ networkmanager.sendPacket(new C00Handshake(47, socketaddress.toString(), 0, EnumConnectionState.LOGIN, true)); -+ com.mojang.authlib.GameProfile gameProfile = this.getSession().getProfile(); -+ if (!this.getSession().hasCachedProperties()) + SocketAddress socketaddress = this.field_71437_Z.func_147137_ag().func_151270_a(); + NetworkManager networkmanager = NetworkManager.func_150722_a(socketaddress); + networkmanager.func_150719_a(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null)); +- networkmanager.func_179290_a(new C00Handshake(47, socketaddress.toString(), 0, EnumConnectionState.LOGIN)); +- networkmanager.func_179290_a(new C00PacketLoginStart(this.func_110432_I().func_148256_e())); ++ networkmanager.func_179290_a(new C00Handshake(47, socketaddress.toString(), 0, EnumConnectionState.LOGIN, true)); ++ com.mojang.authlib.GameProfile gameProfile = this.func_110432_I().func_148256_e(); ++ if (!this.func_110432_I().hasCachedProperties()) + { -+ gameProfile = sessionService.fillProfileProperties(gameProfile, true); //Forge: Fill profile properties upon game load. Fixes MC-52974. -+ this.getSession().setProperties(gameProfile.getProperties()); ++ gameProfile = field_152355_az.fillProfileProperties(gameProfile, true); //Forge: Fill profile properties upon game load. Fixes MC-52974. ++ this.func_110432_I().setProperties(gameProfile.getProperties()); + } -+ networkmanager.sendPacket(new C00PacketLoginStart(gameProfile)); - this.myNetworkManager = networkmanager; ++ networkmanager.func_179290_a(new C00PacketLoginStart(gameProfile)); + this.field_71453_ak = networkmanager; } @@ -2197,6 +2241,8 @@ - public void loadWorld(WorldClient worldClientIn, String loadingMessage) + public void func_71353_a(WorldClient p_71353_1_, String p_71353_2_) { -+ if (theWorld != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(theWorld)); ++ if (field_71441_e != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(field_71441_e)); + - if (worldClientIn == null) + if (p_71353_1_ == null) { - NetHandlerPlayClient nethandlerplayclient = this.getNetHandler(); + NetHandlerPlayClient nethandlerplayclient = this.func_147114_u(); @@ -2210,6 +2256,18 @@ { - this.theIntegratedServer.initiateShutdown(); - this.theIntegratedServer.setStaticInstance(); -+ if (loadingScreen != null) + this.field_71437_Z.func_71263_m(); + this.field_71437_Z.func_175592_a(); ++ if (field_71461_s != null) + { -+ this.loadingScreen.displayLoadingString(I18n.format("forge.client.shutdown.internal")); ++ this.field_71461_s.func_73719_c(I18n.func_135052_a("forge.client.shutdown.internal")); + } -+ while (!theIntegratedServer.isServerStopped()) ++ while (!field_71437_Z.func_71241_aa()) + { + try + { @@ -298,147 +298,147 @@ + } } - this.theIntegratedServer = null; + this.field_71437_Z = null; @@ -2232,6 +2290,7 @@ - this.ingameGUI.func_181029_i(); - this.setServerData((ServerData)null); - this.integratedServerIsRunning = false; -+ net.minecraftforge.fml.client.FMLClientHandler.instance().handleClientWorldClosing(this.theWorld); + this.field_71456_v.func_181029_i(); + this.func_71351_a((ServerData)null); + this.field_71455_al = false; ++ net.minecraftforge.fml.client.FMLClientHandler.instance().handleClientWorldClosing(this.field_71441_e); } - this.mcSoundHandler.stopSounds(); + this.field_147127_av.func_147690_c(); @@ -2336,126 +2395,10 @@ - if (this.objectMouseOver != null) + if (this.field_71476_x != null) { - boolean flag = this.thePlayer.capabilities.isCreativeMode; + boolean flag = this.field_71439_g.field_71075_bZ.field_75098_d; - int i = 0; - boolean flag1 = false; - TileEntity tileentity = null; - Item item; - -- if (this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) +- if (this.field_71476_x.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK) - { -- BlockPos blockpos = this.objectMouseOver.getBlockPos(); -- Block block = this.theWorld.getBlockState(blockpos).getBlock(); +- BlockPos blockpos = this.field_71476_x.func_178782_a(); +- Block block = this.field_71441_e.func_180495_p(blockpos).func_177230_c(); - -- if (block.getMaterial() == Material.air) +- if (block.func_149688_o() == Material.field_151579_a) - { - return; - } - -- item = block.getItem(this.theWorld, blockpos); +- item = block.func_180665_b(this.field_71441_e, blockpos); - - if (item == null) - { - return; - } - -- if (flag && GuiScreen.isCtrlKeyDown()) +- if (flag && GuiScreen.func_146271_m()) - { -- tileentity = this.theWorld.getTileEntity(blockpos); +- tileentity = this.field_71441_e.func_175625_s(blockpos); - } - -- Block block1 = item instanceof ItemBlock && !block.isFlowerPot() ? Block.getBlockFromItem(item) : block; -- i = block1.getDamageValue(this.theWorld, blockpos); -- flag1 = item.getHasSubtypes(); +- Block block1 = item instanceof ItemBlock && !block.func_149648_K() ? Block.func_149634_a(item) : block; +- i = block1.func_176222_j(this.field_71441_e, blockpos); +- flag1 = item.func_77614_k(); - } - else - { -- if (this.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !flag) +- if (this.field_71476_x.field_72313_a != MovingObjectPosition.MovingObjectType.ENTITY || this.field_71476_x.field_72308_g == null || !flag) - { - return; - } - -- if (this.objectMouseOver.entityHit instanceof EntityPainting) +- if (this.field_71476_x.field_72308_g instanceof EntityPainting) - { -- item = Items.painting; +- item = Items.field_151159_an; - } -- else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot) +- else if (this.field_71476_x.field_72308_g instanceof EntityLeashKnot) - { -- item = Items.lead; +- item = Items.field_151058_ca; - } -- else if (this.objectMouseOver.entityHit instanceof EntityItemFrame) +- else if (this.field_71476_x.field_72308_g instanceof EntityItemFrame) - { -- EntityItemFrame entityitemframe = (EntityItemFrame)this.objectMouseOver.entityHit; -- ItemStack itemstack = entityitemframe.getDisplayedItem(); +- EntityItemFrame entityitemframe = (EntityItemFrame)this.field_71476_x.field_72308_g; +- ItemStack itemstack = entityitemframe.func_82335_i(); - - if (itemstack == null) - { -- item = Items.item_frame; +- item = Items.field_151160_bD; - } - else - { -- item = itemstack.getItem(); -- i = itemstack.getMetadata(); +- item = itemstack.func_77973_b(); +- i = itemstack.func_77960_j(); - flag1 = true; - } - } -- else if (this.objectMouseOver.entityHit instanceof EntityMinecart) +- else if (this.field_71476_x.field_72308_g instanceof EntityMinecart) - { -- EntityMinecart entityminecart = (EntityMinecart)this.objectMouseOver.entityHit; +- EntityMinecart entityminecart = (EntityMinecart)this.field_71476_x.field_72308_g; - -- switch (entityminecart.getMinecartType()) +- switch (entityminecart.func_180456_s()) - { - case FURNACE: -- item = Items.furnace_minecart; +- item = Items.field_151109_aJ; - break; - case CHEST: -- item = Items.chest_minecart; +- item = Items.field_151108_aI; - break; - case TNT: -- item = Items.tnt_minecart; +- item = Items.field_151142_bV; - break; - case HOPPER: -- item = Items.hopper_minecart; +- item = Items.field_151140_bW; - break; - case COMMAND_BLOCK: -- item = Items.command_block_minecart; +- item = Items.field_151095_cc; - break; - default: -- item = Items.minecart; +- item = Items.field_151143_au; - } - } -- else if (this.objectMouseOver.entityHit instanceof EntityBoat) +- else if (this.field_71476_x.field_72308_g instanceof EntityBoat) - { -- item = Items.boat; +- item = Items.field_151124_az; - } -- else if (this.objectMouseOver.entityHit instanceof EntityArmorStand) +- else if (this.field_71476_x.field_72308_g instanceof EntityArmorStand) - { -- item = Items.armor_stand; +- item = Items.field_179565_cj; - } - else - { -- item = Items.spawn_egg; -- i = EntityList.getEntityID(this.objectMouseOver.entityHit); +- item = Items.field_151063_bx; +- i = EntityList.func_75619_a(this.field_71476_x.field_72308_g); - flag1 = true; - -- if (!EntityList.entityEggs.containsKey(Integer.valueOf(i))) +- if (!EntityList.field_75627_a.containsKey(Integer.valueOf(i))) - { - return; - } - } - } - - InventoryPlayer inventoryplayer = this.thePlayer.inventory; + InventoryPlayer inventoryplayer = this.field_71439_g.field_71071_by; - if (tileentity == null) - { -- inventoryplayer.setCurrentItem(item, i, flag1, flag); +- inventoryplayer.func_146030_a(item, i, flag1, flag); - } - else - { - ItemStack itemstack1 = this.func_181036_a(item, i, tileentity); -- inventoryplayer.setInventorySlotContents(inventoryplayer.currentItem, itemstack1); +- inventoryplayer.func_70299_a(inventoryplayer.field_70461_c, itemstack1); - } - -+ if (!net.minecraftforge.common.ForgeHooks.onPickBlock(this.objectMouseOver, this.thePlayer, this.theWorld)) return; ++ if (!net.minecraftforge.common.ForgeHooks.onPickBlock(this.field_71476_x, this.field_71439_g, this.field_71441_e)) return; + // We delete this code wholly instead of commenting it out, to make sure we detect changes in it between MC versions if (flag) { - int j = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + inventoryplayer.currentItem; + int j = this.field_71439_g.field_71069_bz.field_75151_b.size() - 9 + inventoryplayer.field_70461_c; @@ -2756,18 +2699,8 @@ - public static int getGLMaximumTextureSize() + public static int func_71369_N() { - for (int i = 16384; i > 0; i >>= 1) - { @@ -456,4 +456,16 @@ + return net.minecraftforge.fml.client.SplashProgress.getMaxTextureSize(); } - public boolean isSnooperEnabled() + public boolean func_70002_Q() +@@ -2924,9 +2857,9 @@ + { + this.func_147108_a(new GuiYesNo(new GuiYesNoCallback() + { +- public void func_73878_a(boolean p_73878_1_, int p_73878_2_) ++ public void func_73878_a(boolean result, int id) + { +- if (p_73878_1_) ++ if (result) + { + Minecraft.this.func_152346_Z().func_152930_t(); + } diff --git a/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch b/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch index 3d4c13816..90c31e791 100644 --- a/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch +++ b/patches/minecraft/net/minecraft/client/audio/SoundManager.java.patch @@ -10,32 +10,32 @@ { @@ -80,6 +81,7 @@ { - this.unloadSoundSystem(); - this.loadSoundSystem(); + this.func_148613_b(); + this.func_148608_i(); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.SoundLoadEvent(this)); } - private synchronized void loadSoundSystem() + private synchronized void func_148608_i() @@ -316,6 +318,9 @@ } else { -+ sound = net.minecraftforge.client.ForgeHooksClient.playSound(this, sound); -+ if (sound == null) return; ++ p_148611_1_ = net.minecraftforge.client.ForgeHooksClient.playSound(this, p_148611_1_); ++ if (p_148611_1_ == null) return; + - SoundEventAccessorComposite soundeventaccessorcomposite = this.sndHandler.getSound(sound.getSoundLocation()); + SoundEventAccessorComposite soundeventaccessorcomposite = this.field_148622_c.func_147680_a(p_148611_1_.func_147650_b()); if (soundeventaccessorcomposite == null) @@ -357,10 +362,12 @@ - if (soundpoolentry.isStreamingSound()) + if (soundpoolentry.func_148648_d()) { - this.sndSystem.newStreamingSource(false, s, getURLForSoundResource(resourcelocation), resourcelocation.toString(), flag, sound.getXPosF(), sound.getYPosF(), sound.getZPosF(), sound.getAttenuationType().getTypeInt(), f1); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlayStreamingSourceEvent(this, sound, s)); + this.field_148620_e.newStreamingSource(false, s, func_148612_a(resourcelocation), resourcelocation.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f1); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlayStreamingSourceEvent(this, p_148611_1_, s)); } else { - this.sndSystem.newSource(false, s, getURLForSoundResource(resourcelocation), resourcelocation.toString(), flag, sound.getXPosF(), sound.getYPosF(), sound.getZPosF(), sound.getAttenuationType().getTypeInt(), f1); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlaySoundSourceEvent(this, sound, s)); + this.field_148620_e.newSource(false, s, func_148612_a(resourcelocation), resourcelocation.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f1); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlaySoundSourceEvent(this, p_148611_1_, s)); } - logger.debug(LOG_MARKER, "Playing sound {} for event {} as channel {}", new Object[] {soundpoolentry.getSoundPoolEntryLocation(), soundeventaccessorcomposite.getSoundEventLocation(), s}); + field_148621_b.debug(field_148623_a, "Playing sound {} for event {} as channel {}", new Object[] {soundpoolentry.func_148652_a(), soundeventaccessorcomposite.func_148729_c(), s}); diff --git a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch index 42c1d4605..8182064b7 100644 --- a/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch +++ b/patches/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch @@ -1,27 +1,27 @@ --- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java +++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java @@ -345,6 +345,15 @@ - this.mc.ingameGUI.getChatGUI().printChatMessage(chatComponent); + this.field_71159_c.field_71456_v.func_146158_b().func_146227_a(p_146105_1_); } + private boolean isHeadspaceFree(BlockPos pos, int height) + { + for (int y = 0; y < height; y++) + { -+ if (isOpenBlockSpace(pos.add(0, y, 0))) return false; ++ if (func_175162_d(pos.func_177982_a(0, y, 0))) return false; + } + return true; + } + - protected boolean pushOutOfBlocks(double x, double y, double z) + protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_) { - if (this.noClip) + if (this.field_70145_X) @@ -357,30 +366,34 @@ - double d0 = x - (double)blockpos.getX(); - double d1 = z - (double)blockpos.getZ(); + double d0 = p_145771_1_ - (double)blockpos.func_177958_n(); + double d1 = p_145771_5_ - (double)blockpos.func_177952_p(); -- if (!this.isOpenBlockSpace(blockpos)) -+ int entHeight = Math.max(Math.round(this.height), 1); +- if (!this.func_175162_d(blockpos)) ++ int entHeight = Math.max(Math.round(this.field_70131_O), 1); + + boolean inTranslucentBlock = this.isHeadspaceFree(blockpos, entHeight); + @@ -30,42 +30,42 @@ int i = -1; double d2 = 9999.0D; -- if (this.isOpenBlockSpace(blockpos.west()) && d0 < d2) -+ if (!this.isHeadspaceFree(blockpos.west(), entHeight) && d0 < d2) +- if (this.func_175162_d(blockpos.func_177976_e()) && d0 < d2) ++ if (!this.isHeadspaceFree(blockpos.func_177976_e(), entHeight) && d0 < d2) { d2 = d0; i = 0; } -- if (this.isOpenBlockSpace(blockpos.east()) && 1.0D - d0 < d2) -+ if (!this.isHeadspaceFree(blockpos.east(), entHeight) && 1.0D - d0 < d2) +- if (this.func_175162_d(blockpos.func_177974_f()) && 1.0D - d0 < d2) ++ if (!this.isHeadspaceFree(blockpos.func_177974_f(), entHeight) && 1.0D - d0 < d2) { d2 = 1.0D - d0; i = 1; } -- if (this.isOpenBlockSpace(blockpos.north()) && d1 < d2) -+ if (!this.isHeadspaceFree(blockpos.north(), entHeight) && d1 < d2) +- if (this.func_175162_d(blockpos.func_177978_c()) && d1 < d2) ++ if (!this.isHeadspaceFree(blockpos.func_177978_c(), entHeight) && d1 < d2) { d2 = d1; i = 4; } -- if (this.isOpenBlockSpace(blockpos.south()) && 1.0D - d1 < d2) -+ if (!this.isHeadspaceFree(blockpos.south(), entHeight) && 1.0D - d1 < d2) +- if (this.func_175162_d(blockpos.func_177968_d()) && 1.0D - d1 < d2) ++ if (!this.isHeadspaceFree(blockpos.func_177968_d(), entHeight) && 1.0D - d1 < d2) { d2 = 1.0D - d1; i = 5; @@ -448,6 +461,12 @@ - public void playSound(String name, float volume, float pitch) + public void func_85030_a(String p_85030_1_, float p_85030_2_, float p_85030_3_) { -+ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(this, name, volume, pitch); ++ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(this, p_85030_1_, p_85030_2_, p_85030_3_); + if (event.isCanceled() || event.name == null) return; -+ name = event.name; -+ volume = event.newVolume; -+ pitch = event.newPitch; ++ p_85030_1_ = event.name; ++ p_85030_2_ = event.newVolume; ++ p_85030_3_ = event.newPitch; + - this.worldObj.playSound(this.posX, this.posY, this.posZ, name, volume, pitch, false); + this.field_70170_p.func_72980_b(this.field_70165_t, this.field_70163_u, this.field_70161_v, p_85030_1_, p_85030_2_, p_85030_3_, false); } diff --git a/patches/minecraft/net/minecraft/client/gui/FontRenderer.java.patch b/patches/minecraft/net/minecraft/client/gui/FontRenderer.java.patch index 04062e634..7fc54e8f0 100644 --- a/patches/minecraft/net/minecraft/client/gui/FontRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/FontRenderer.java.patch @@ -1,28 +1,28 @@ --- ../src-base/minecraft/net/minecraft/client/gui/FontRenderer.java +++ ../src-work/minecraft/net/minecraft/client/gui/FontRenderer.java @@ -57,7 +57,7 @@ - this.locationFontTexture = p_i1035_2_; - this.renderEngine = p_i1035_3_; - this.unicodeFlag = p_i1035_4_; -- p_i1035_3_.bindTexture(this.locationFontTexture); -+ bindTexture(this.locationFontTexture); + this.field_111273_g = p_i1035_2_; + this.field_78298_i = p_i1035_3_; + this.field_78293_l = p_i1035_4_; +- p_i1035_3_.func_110577_a(this.field_111273_g); ++ bindTexture(this.field_111273_g); for (int i = 0; i < 32; ++i) { @@ -97,6 +97,7 @@ - public void onResourceManagerReload(IResourceManager resourceManager) + public void func_110549_a(IResourceManager p_110549_1_) { - this.readFontTexture(); -+ this.readGlyphSizes(); + this.func_111272_d(); ++ this.func_98306_d(); } - private void readFontTexture() + private void func_111272_d() @@ -105,7 +106,7 @@ try { -- bufferedimage = TextureUtil.readBufferedImage(Minecraft.getMinecraft().getResourceManager().getResource(this.locationFontTexture).getInputStream()); -+ bufferedimage = TextureUtil.readBufferedImage(getResourceInputStream(this.locationFontTexture)); +- bufferedimage = TextureUtil.func_177053_a(Minecraft.func_71410_x().func_110442_L().func_110536_a(this.field_111273_g).func_110527_b()); ++ bufferedimage = TextureUtil.func_177053_a(getResourceInputStream(this.field_111273_g)); } catch (IOException ioexception) { @@ -30,53 +30,53 @@ try { -- inputstream = Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation("font/glyph_sizes.bin")).getInputStream(); +- inputstream = Minecraft.func_71410_x().func_110442_L().func_110536_a(new ResourceLocation("font/glyph_sizes.bin")).func_110527_b(); + inputstream = getResourceInputStream(new ResourceLocation("font/glyph_sizes.bin")); - inputstream.read(this.glyphWidth); + inputstream.read(this.field_78287_e); } catch (IOException ioexception) @@ -196,7 +197,7 @@ int i = p_78266_1_ % 16 * 8; int j = p_78266_1_ / 16 * 8; int k = p_78266_2_ ? 1 : 0; -- this.renderEngine.bindTexture(this.locationFontTexture); -+ bindTexture(this.locationFontTexture); - int l = this.charWidth[p_78266_1_]; +- this.field_78298_i.func_110577_a(this.field_111273_g); ++ bindTexture(this.field_111273_g); + int l = this.field_78286_d[p_78266_1_]; float f = (float)l - 0.01F; GL11.glBegin(GL11.GL_TRIANGLE_STRIP); @@ -224,7 +225,7 @@ - private void loadGlyphTexture(int p_78257_1_) + private void func_78257_a(int p_78257_1_) { -- this.renderEngine.bindTexture(this.getUnicodePageLocation(p_78257_1_)); -+ bindTexture(this.getUnicodePageLocation(p_78257_1_)); +- this.field_78298_i.func_110577_a(this.func_111271_a(p_78257_1_)); ++ bindTexture(this.func_111271_a(p_78257_1_)); } - protected float renderUnicodeChar(char p_78277_1_, boolean p_78277_2_) + protected float func_78277_a(char p_78277_1_, boolean p_78277_2_) @@ -271,7 +272,7 @@ - public int drawString(String p_175065_1_, float p_175065_2_, float p_175065_3_, int p_175065_4_, boolean p_175065_5_) + public int func_175065_a(String p_175065_1_, float p_175065_2_, float p_175065_3_, int p_175065_4_, boolean p_175065_5_) { -- GlStateManager.enableAlpha(); +- GlStateManager.func_179141_d(); + enableAlpha(); - this.resetStyles(); + this.func_78265_b(); int i; @@ -341,7 +342,7 @@ - int j1 = this.colorCode[i1]; - this.textColor = j1; -- GlStateManager.color((float)(j1 >> 16) / 255.0F, (float)(j1 >> 8 & 255) / 255.0F, (float)(j1 & 255) / 255.0F, this.alpha); -+ setColor((float)(j1 >> 16) / 255.0F, (float)(j1 >> 8 & 255) / 255.0F, (float)(j1 & 255) / 255.0F, this.alpha); + int j1 = this.field_78285_g[i1]; + this.field_78304_r = j1; +- GlStateManager.func_179131_c((float)(j1 >> 16) / 255.0F, (float)(j1 >> 8 & 255) / 255.0F, (float)(j1 & 255) / 255.0F, this.field_78305_q); ++ setColor((float)(j1 >> 16) / 255.0F, (float)(j1 >> 8 & 255) / 255.0F, (float)(j1 & 255) / 255.0F, this.field_78305_q); } else if (i1 == 16) { @@ -370,7 +371,7 @@ - this.strikethroughStyle = false; - this.underlineStyle = false; - this.italicStyle = false; -- GlStateManager.color(this.red, this.blue, this.green, this.alpha); -+ setColor(this.red, this.blue, this.green, this.alpha); + this.field_78299_w = false; + this.field_78300_v = false; + this.field_78301_u = false; +- GlStateManager.func_179131_c(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q); ++ setColor(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q); } ++i; @@ -84,9 +84,9 @@ c0 = c1; } -- float f1 = this.unicodeFlag ? 0.5F : 1.0F; -+ float f1 = getCharWidth(c0) / 32f; - boolean flag = (c0 == 0 || j == -1 || this.unicodeFlag) && p_78255_2_; +- float f1 = this.field_78293_l ? 0.5F : 1.0F; ++ float f1 = func_78263_a(c0) / 32f; + boolean flag = (c0 == 0 || j == -1 || this.field_78293_l) && p_78255_2_; if (flag) @@ -436,7 +437,16 @@ @@ -103,21 +103,21 @@ + { + { + - if (this.strikethroughStyle) + if (this.field_78299_w) { - Tessellator tessellator = Tessellator.getInstance(); + Tessellator tessellator = Tessellator.func_178181_a(); @@ -509,7 +519,7 @@ - this.blue = (float)(p_180455_4_ >> 8 & 255) / 255.0F; - this.green = (float)(p_180455_4_ & 255) / 255.0F; - this.alpha = (float)(p_180455_4_ >> 24 & 255) / 255.0F; -- GlStateManager.color(this.red, this.blue, this.green, this.alpha); -+ setColor(this.red, this.blue, this.green, this.alpha); - this.posX = p_180455_2_; - this.posY = p_180455_3_; - this.renderStringAtPos(p_180455_1_, p_180455_5_); + this.field_78292_o = (float)(p_180455_4_ >> 8 & 255) / 255.0F; + this.field_78306_p = (float)(p_180455_4_ & 255) / 255.0F; + this.field_78305_q = (float)(p_180455_4_ >> 24 & 255) / 255.0F; +- GlStateManager.func_179131_c(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q); ++ setColor(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q); + this.field_78295_j = p_180455_2_; + this.field_78296_k = p_180455_3_; + this.func_78255_a(p_180455_1_, p_180455_5_); @@ -588,11 +598,6 @@ - int j = this.glyphWidth[p_78263_1_] >>> 4; - int k = this.glyphWidth[p_78263_1_] & 15; + int j = this.field_78287_e[p_78263_1_] >>> 4; + int k = this.field_78287_e[p_78263_1_] & 15; - if (k > 7) - { @@ -128,29 +128,29 @@ ++k; return (k - j) / 2 + 1; @@ -846,6 +851,26 @@ - return this.bidiFlag; + return this.field_78294_m; } + protected void setColor(float r, float g, float b, float a) + { -+ GlStateManager.color(r,g,b,a); ++ GlStateManager.func_179131_c(r,g,b,a); + } + + protected void enableAlpha() + { -+ GlStateManager.enableAlpha(); ++ GlStateManager.func_179141_d(); + } + + protected void bindTexture(ResourceLocation location) + { -+ renderEngine.bindTexture(location); ++ field_78298_i.func_110577_a(location); + } + + protected InputStream getResourceInputStream(ResourceLocation location) throws IOException + { -+ return Minecraft.getMinecraft().getResourceManager().getResource(location).getInputStream(); ++ return Minecraft.func_71410_x().func_110442_L().func_110536_a(location).func_110527_b(); + } + - public int getColorCode(char p_175064_1_) + public int func_175064_b(char p_175064_1_) { - return this.colorCode["0123456789abcdef".indexOf(p_175064_1_)]; + return this.field_78285_g["0123456789abcdef".indexOf(p_175064_1_)]; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiButton.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiButton.java.patch index ee9c09180..b212709d6 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiButton.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiButton.java.patch @@ -1,15 +1,15 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiButton.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiButton.java @@ -21,6 +21,7 @@ - public boolean enabled; - public boolean visible; - protected boolean hovered; + public boolean field_146124_l; + public boolean field_146125_m; + protected boolean field_146123_n; + public int packedFGColour; //FML - public GuiButton(int buttonId, int x, int y, String buttonText) + public GuiButton(int p_i1020_1_, int p_i1020_2_, int p_i1020_3_, String p_i1020_4_) { @@ -74,6 +75,11 @@ - this.mouseDragged(mc, mouseX, mouseY); + this.func_146119_b(p_146112_1_, p_146112_2_, p_146112_3_); int j = 14737632; + if (packedFGColour != 0) @@ -17,6 +17,6 @@ + j = packedFGColour; + } + else - if (!this.enabled) + if (!this.field_146124_l) { j = 10526880; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch index 3b956b4e3..8b16ab92b 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiChat.java.patch @@ -1,24 +1,24 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiChat.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiChat.java @@ -215,13 +215,14 @@ - this.mc.ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new ChatComponentText(stringbuilder.toString()), 1); + this.field_146297_k.field_71456_v.func_146158_b().func_146234_a(new ChatComponentText(stringbuilder.toString()), 1); } -- this.inputField.writeText((String)this.foundPlayerNames.get(this.autocompleteIndex++)); -+ this.inputField.writeText(net.minecraft.util.EnumChatFormatting.getTextWithoutFormattingCodes((String)this.foundPlayerNames.get(this.autocompleteIndex++))); +- this.field_146415_a.func_146191_b((String)this.field_146412_t.get(this.field_146413_s++)); ++ this.field_146415_a.func_146191_b(net.minecraft.util.EnumChatFormatting.func_110646_a((String)this.field_146412_t.get(this.field_146413_s++))); } - private void sendAutocompleteRequest(String p_146405_1_, String p_146405_2_) + private void func_146405_a(String p_146405_1_, String p_146405_2_) { if (p_146405_1_.length() >= 1) { + net.minecraftforge.client.ClientCommandHandler.instance.autoComplete(p_146405_1_, p_146405_2_); BlockPos blockpos = null; - if (this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + if (this.field_146297_k.field_71476_x != null && this.field_146297_k.field_71476_x.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK) @@ -281,6 +282,12 @@ - this.playerNamesFound = false; - this.foundPlayerNames.clear(); + this.field_146417_i = false; + this.field_146412_t.clear(); + String[] complete = net.minecraftforge.client.ClientCommandHandler.instance.latestAutoComplete; + if (complete != null) diff --git a/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch index 2555e2a26..4f9d297f4 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch @@ -4,33 +4,33 @@ } } -+ WorldType.worldTypes[this.selectedIndex].onGUICreateWorldPress(); ++ WorldType.field_77139_a[this.field_146331_K].onGUICreateWorldPress(); + - WorldSettings.GameType worldsettings$gametype = WorldSettings.GameType.getByName(this.field_146342_r); - WorldSettings worldsettings = new WorldSettings(i, worldsettings$gametype, this.field_146341_s, this.field_146337_w, WorldType.worldTypes[this.selectedIndex]); - worldsettings.setWorldName(this.chunkProviderSettingsJson); + WorldSettings.GameType worldsettings$gametype = WorldSettings.GameType.func_77142_a(this.field_146342_r); + WorldSettings worldsettings = new WorldSettings(i, worldsettings$gametype, this.field_146341_s, this.field_146337_w, WorldType.field_77139_a[this.field_146331_K]); + worldsettings.func_82750_a(this.field_146334_a); @@ -312,14 +314,7 @@ } - else if (button.id == 8) + else if (p_146284_1_.field_146127_k == 8) { -- if (WorldType.worldTypes[this.selectedIndex] == WorldType.FLAT) +- if (WorldType.field_77139_a[this.field_146331_K] == WorldType.field_77138_c) - { -- this.mc.displayGuiScreen(new GuiCreateFlatWorld(this, this.chunkProviderSettingsJson)); +- this.field_146297_k.func_147108_a(new GuiCreateFlatWorld(this, this.field_146334_a)); - } - else - { -- this.mc.displayGuiScreen(new GuiCustomizeWorldScreen(this, this.chunkProviderSettingsJson)); +- this.field_146297_k.func_147108_a(new GuiCustomizeWorldScreen(this, this.field_146334_a)); - } -+ WorldType.worldTypes[this.selectedIndex].onCustomizeButton(mc, this); ++ WorldType.field_77139_a[this.field_146331_K].onCustomizeButton(field_146297_k, this); } } } @@ -371,7 +366,7 @@ - this.btnBonusItems.visible = this.field_146344_y; - this.btnMapType.visible = this.field_146344_y; - this.btnAllowCommands.visible = this.field_146344_y; -- this.btnCustomizeType.visible = this.field_146344_y && (WorldType.worldTypes[this.selectedIndex] == WorldType.FLAT || WorldType.worldTypes[this.selectedIndex] == WorldType.CUSTOMIZED); -+ this.btnCustomizeType.visible = this.field_146344_y && WorldType.worldTypes[this.selectedIndex].isCustomizable(); + 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.field_77139_a[this.field_146331_K] == WorldType.field_77138_c || WorldType.field_77139_a[this.field_146331_K] == WorldType.field_180271_f); ++ this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K].isCustomizable(); } this.func_146319_h(); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiIngameMenu.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiIngameMenu.java.patch index aef607d2c..492f39e3e 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiIngameMenu.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiIngameMenu.java.patch @@ -2,28 +2,28 @@ +++ ../src-work/minecraft/net/minecraft/client/gui/GuiIngameMenu.java @@ -30,8 +30,9 @@ - this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24 + i, I18n.format("menu.returnToGame", new Object[0]))); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + i, 98, 20, I18n.format("menu.options", new Object[0]))); -+ this.buttonList.add(new GuiButton(12, this.width / 2 + 2, this.height / 4 + 96 + i, 98, 20, I18n.format("fml.menu.modoptions"))); + this.field_146292_n.add(new GuiButton(4, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 24 + i, I18n.func_135052_a("menu.returnToGame", new Object[0]))); + this.field_146292_n.add(new GuiButton(0, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 96 + i, 98, 20, I18n.func_135052_a("menu.options", new Object[0]))); ++ this.field_146292_n.add(new GuiButton(12, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 96 + i, 98, 20, I18n.func_135052_a("fml.menu.modoptions"))); GuiButton guibutton; -- this.buttonList.add(guibutton = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + i, 98, 20, I18n.format("menu.shareToLan", new Object[0]))); -+ this.buttonList.add(guibutton = new GuiButton(7, this.width / 2 - 100, this.height / 4 + 72 + i, 200, 20, I18n.format("menu.shareToLan", new Object[0]))); - this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + i, 98, 20, I18n.format("gui.achievements", new Object[0]))); - this.buttonList.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + i, 98, 20, I18n.format("gui.stats", new Object[0]))); - guibutton.enabled = this.mc.isSingleplayer() && !this.mc.getIntegratedServer().getPublic(); +- this.field_146292_n.add(guibutton = new GuiButton(7, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 96 + i, 98, 20, I18n.func_135052_a("menu.shareToLan", new Object[0]))); ++ this.field_146292_n.add(guibutton = new GuiButton(7, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 72 + i, 200, 20, I18n.func_135052_a("menu.shareToLan", new Object[0]))); + this.field_146292_n.add(new GuiButton(5, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 48 + i, 98, 20, I18n.func_135052_a("gui.achievements", new Object[0]))); + this.field_146292_n.add(new GuiButton(6, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 48 + i, 98, 20, I18n.func_135052_a("gui.stats", new Object[0]))); + guibutton.field_146124_l = this.field_146297_k.func_71356_B() && !this.field_146297_k.func_71401_C().func_71344_c(); @@ -74,13 +75,19 @@ - this.mc.setIngameFocus(); + this.field_146297_k.func_71381_h(); break; case 5: -+ if (this.mc.thePlayer != null) - this.mc.displayGuiScreen(new GuiAchievements(this, this.mc.thePlayer.getStatFileWriter())); ++ if (this.field_146297_k.field_71439_g != null) + this.field_146297_k.func_147108_a(new GuiAchievements(this, this.field_146297_k.field_71439_g.func_146107_m())); break; case 6: -+ if (this.mc.thePlayer != null) - this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter())); ++ if (this.field_146297_k.field_71439_g != null) + this.field_146297_k.func_147108_a(new GuiStats(this, this.field_146297_k.field_71439_g.func_146107_m())); break; case 7: - this.mc.displayGuiScreen(new GuiShareToLan(this)); + this.field_146297_k.func_147108_a(new GuiShareToLan(this)); + break; + case 12: + net.minecraftforge.fml.client.FMLClientHandler.instance().showInGameModOptions(this); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch index 35d380457..cad9873e2 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiMainMenu.java.patch @@ -1,44 +1,44 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiMainMenu.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiMainMenu.java @@ -197,6 +197,11 @@ - this.buttonList.add(new GuiButton(1, this.width / 2 - 100, p_73969_1_, I18n.format("menu.singleplayer", new Object[0]))); - this.buttonList.add(new GuiButton(2, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 1, I18n.format("menu.multiplayer", new Object[0]))); - this.buttonList.add(this.realmsButton = new GuiButton(14, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 2, I18n.format("menu.online", new Object[0]))); -+ GuiButton fmlModButton = new GuiButton(6, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 2, I18n.format("fml.menu.mods")); -+ fmlModButton.xPosition = this.width / 2 + 2; -+ realmsButton.width = 98; -+ fmlModButton.width = 98; -+ this.buttonList.add(fmlModButton); + this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 100, p_73969_1_, I18n.func_135052_a("menu.singleplayer", new Object[0]))); + this.field_146292_n.add(new GuiButton(2, this.field_146294_l / 2 - 100, p_73969_1_ + p_73969_2_ * 1, I18n.func_135052_a("menu.multiplayer", new Object[0]))); + this.field_146292_n.add(this.field_175372_K = new GuiButton(14, this.field_146294_l / 2 - 100, p_73969_1_ + p_73969_2_ * 2, I18n.func_135052_a("menu.online", new Object[0]))); ++ GuiButton fmlModButton = new GuiButton(6, this.field_146294_l / 2 - 100, p_73969_1_ + p_73969_2_ * 2, I18n.func_135052_a("fml.menu.mods")); ++ fmlModButton.field_146128_h = this.field_146294_l / 2 + 2; ++ field_175372_K.field_146120_f = 98; ++ fmlModButton.field_146120_f = 98; ++ this.field_146292_n.add(fmlModButton); } - private void addDemoButtons(int p_73972_1_, int p_73972_2_) + private void func_73972_b(int p_73972_1_, int p_73972_2_) @@ -244,6 +249,11 @@ - this.mc.shutdown(); + this.field_146297_k.func_71400_g(); } -+ if (button.id == 6) ++ if (p_146284_1_.field_146127_k == 6) + { -+ this.mc.displayGuiScreen(new net.minecraftforge.fml.client.GuiModList(this)); ++ this.field_146297_k.func_147108_a(new net.minecraftforge.fml.client.GuiModList(this)); + } + - if (button.id == 11) + if (p_146284_1_.field_146127_k == 11) { - this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings); + this.field_146297_k.func_71371_a("Demo_World", "Demo_World", DemoWorldServer.field_73071_a); @@ -489,7 +499,16 @@ s = s + " Demo"; } -- this.drawString(this.fontRendererObj, s, 2, this.height - 10, -1); +- this.func_73731_b(this.field_146289_q, s, 2, this.field_146295_m - 10, -1); + java.util.List brandings = com.google.common.collect.Lists.reverse(net.minecraftforge.fml.common.FMLCommonHandler.instance().getBrandings(true)); + for (int brdline = 0; brdline < brandings.size(); brdline++) + { + String brd = brandings.get(brdline); + if (!com.google.common.base.Strings.isNullOrEmpty(brd)) + { -+ this.drawString(this.fontRendererObj, brd, 2, this.height - ( 10 + brdline * (this.fontRendererObj.FONT_HEIGHT + 1)), 16777215); ++ this.func_73731_b(this.field_146289_q, brd, 2, this.field_146295_m - ( 10 + brdline * (this.field_146289_q.field_78288_b + 1)), 16777215); + } + } -+ net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, this.fontRendererObj, this.width, this.height); ++ net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, this.field_146289_q, this.field_146294_l, this.field_146295_m); String s1 = "Copyright Mojang AB. Do not distribute!"; - this.drawString(this.fontRendererObj, s1, this.width - this.fontRendererObj.getStringWidth(s1) - 2, this.height - 10, -1); + this.func_73731_b(this.field_146289_q, s1, this.field_146294_l - this.field_146289_q.func_78256_a(s1) - 2, this.field_146295_m - 10, -1); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiMultiplayer.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiMultiplayer.java.patch index 4e8b2f3eb..fadee0c78 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiMultiplayer.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiMultiplayer.java.patch @@ -1,19 +1,19 @@ --- ../src-base/minecraft/net/minecraft/client/gui/GuiMultiplayer.java +++ ../src-work/minecraft/net/minecraft/client/gui/GuiMultiplayer.java @@ -40,6 +40,7 @@ - public GuiMultiplayer(GuiScreen parentScreen) + public GuiMultiplayer(GuiScreen p_i1040_1_) { - this.parentScreen = parentScreen; + this.field_146798_g = p_i1040_1_; + net.minecraftforge.fml.client.FMLClientHandler.instance().setupServerList(); } - public void initGui() + public void func_73866_w_() @@ -372,7 +373,7 @@ - private void connectToServer(ServerData server) + private void func_146791_a(ServerData p_146791_1_) { -- this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, server)); -+ net.minecraftforge.fml.client.FMLClientHandler.instance().connectToServer(this, server); +- this.field_146297_k.func_147108_a(new GuiConnecting(this, this.field_146297_k, p_146791_1_)); ++ net.minecraftforge.fml.client.FMLClientHandler.instance().connectToServer(this, p_146791_1_); } - public void selectServer(int index) + public void func_146790_a(int p_146790_1_) diff --git a/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java.patch index 73cf65cef..0841e6d3c 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java.patch @@ -2,11 +2,11 @@ +++ ../src-work/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java @@ -176,6 +176,9 @@ long l = j - k; - List list = Lists.newArrayList(new String[] {String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.mc.isJava64bit() ? 64 : 32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(bytesToMb(l)), Long.valueOf(bytesToMb(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(bytesToMb(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.func_183029_j()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GL11.glGetString(GL11.GL_VENDOR)}), GL11.glGetString(GL11.GL_RENDERER), GL11.glGetString(GL11.GL_VERSION)}); + List list = Lists.newArrayList(new String[] {String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.field_175242_a.func_147111_S() ? 64 : 32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(func_175240_a(l)), Long.valueOf(func_175240_a(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(func_175240_a(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.func_183029_j()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GL11.glGetString(GL11.GL_VENDOR)}), GL11.glGetString(GL11.GL_RENDERER), GL11.glGetString(GL11.GL_VERSION)}); + list.add(""); + list.addAll(net.minecraftforge.fml.common.FMLCommonHandler.instance().getBrandings(false)); + - if (this.isReducedDebug()) + if (this.func_175236_d()) { return list; diff --git a/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch index f97ed83fd..4496af75e 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiScreen.java.patch @@ -4,86 +4,86 @@ } } -- this.drawHoveringText(list, x, y); -+ FontRenderer font = stack.getItem().getFontRenderer(stack); -+ this.drawHoveringText(list, x, y, (font == null ? fontRendererObj : font)); +- this.func_146283_a(list, p_146285_2_, p_146285_3_); ++ FontRenderer font = p_146285_1_.func_77973_b().getFontRenderer(p_146285_1_); ++ this.drawHoveringText(list, p_146285_2_, p_146285_3_, (font == null ? field_146289_q : font)); } - protected void drawCreativeTabHoveringText(String tabName, int mouseX, int mouseY) + protected void func_146279_a(String p_146279_1_, int p_146279_2_, int p_146279_3_) @@ -153,6 +154,11 @@ - protected void drawHoveringText(List textLines, int x, int y) + protected void func_146283_a(List p_146283_1_, int p_146283_2_, int p_146283_3_) { -+ drawHoveringText(textLines, x, y, fontRendererObj); ++ drawHoveringText(p_146283_1_, p_146283_2_, p_146283_3_, field_146289_q); + } + -+ protected void drawHoveringText(List textLines, int x, int y, FontRenderer font) ++ protected void drawHoveringText(List p_146283_1_, int p_146283_2_, int p_146283_3_, FontRenderer font) + { - if (!textLines.isEmpty()) + if (!p_146283_1_.isEmpty()) { - GlStateManager.disableRescaleNormal(); + GlStateManager.func_179101_C(); @@ -163,7 +169,7 @@ - for (String s : textLines) + for (String s : p_146283_1_) { -- int j = this.fontRendererObj.getStringWidth(s); -+ int j = font.getStringWidth(s); +- int j = this.field_146289_q.func_78256_a(s); ++ int j = font.func_78256_a(s); if (j > i) { @@ -208,7 +214,7 @@ - for (int k1 = 0; k1 < textLines.size(); ++k1) + for (int k1 = 0; k1 < p_146283_1_.size(); ++k1) { - String s1 = (String)textLines.get(k1); -- this.fontRendererObj.drawStringWithShadow(s1, (float)l1, (float)i2, -1); -+ font.drawStringWithShadow(s1, (float)l1, (float)i2, -1); + String s1 = (String)p_146283_1_.get(k1); +- this.field_146289_q.func_175063_a(s1, (float)l1, (float)i2, -1); ++ font.func_175063_a(s1, (float)l1, (float)i2, -1); if (k1 == 0) { @@ -436,6 +442,7 @@ { - this.mc.ingameGUI.getChatGUI().addToSentMessages(msg); + this.field_146297_k.field_71456_v.func_146158_b().func_146239_a(p_175281_1_); } -+ if (net.minecraftforge.client.ClientCommandHandler.instance.executeCommand(mc.thePlayer, msg) != 0) return; ++ if (net.minecraftforge.client.ClientCommandHandler.instance.func_71556_a(field_146297_k.field_71439_g, p_175281_1_) != 0) return; - this.mc.thePlayer.sendChatMessage(msg); + this.field_146297_k.field_71439_g.func_71165_d(p_175281_1_); } @@ -450,9 +457,15 @@ - if (guibutton.mousePressed(this.mc, mouseX, mouseY)) + if (guibutton.func_146116_c(this.field_146297_k, p_73864_1_, p_73864_2_)) { -+ net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Pre event = new net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Pre(this, guibutton, this.buttonList); ++ net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Pre event = new net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Pre(this, guibutton, this.field_146292_n); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) + break; + guibutton = event.button; - this.selectedButton = guibutton; - guibutton.playPressSound(this.mc.getSoundHandler()); - this.actionPerformed(guibutton); -+ if (this.equals(this.mc.currentScreen)) -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Post(this, event.button, this.buttonList)); + this.field_146290_a = guibutton; + guibutton.func_146113_a(this.field_146297_k.func_147118_V()); + this.func_146284_a(guibutton); ++ if (this.equals(this.field_146297_k.field_71462_r)) ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Post(this, event.button, this.field_146292_n)); } } } @@ -482,8 +495,12 @@ - this.fontRendererObj = mc.fontRendererObj; - this.width = width; - this.height = height; -+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent.Pre(this, this.buttonList))) + this.field_146289_q = p_146280_1_.field_71466_p; + this.field_146294_l = p_146280_2_; + this.field_146295_m = p_146280_3_; ++ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent.Pre(this, this.field_146292_n))) + { - this.buttonList.clear(); - this.initGui(); + this.field_146292_n.clear(); + this.func_73866_w_(); + } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent.Post(this, this.buttonList)); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent.Post(this, this.field_146292_n)); } - public void initGui() + public void func_73866_w_() @@ -496,7 +513,9 @@ { while (Mouse.next()) { + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.MouseInputEvent.Pre(this))) continue; - this.handleMouseInput(); -+ if (this.equals(this.mc.currentScreen)) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.MouseInputEvent.Post(this)); + this.func_146274_d(); ++ if (this.equals(this.field_146297_k.field_71462_r)) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.MouseInputEvent.Post(this)); } } @@ -92,8 +92,8 @@ while (Keyboard.next()) { + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.KeyboardInputEvent.Pre(this))) continue; - this.handleKeyboardInput(); -+ if (this.equals(this.mc.currentScreen)) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.KeyboardInputEvent.Post(this)); + this.func_146282_l(); ++ if (this.equals(this.field_146297_k.field_71462_r)) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.KeyboardInputEvent.Post(this)); } } } diff --git a/patches/minecraft/net/minecraft/client/gui/GuiSelectWorld.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiSelectWorld.java.patch index 8327deb5f..d1ee63656 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiSelectWorld.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiSelectWorld.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/client/gui/GuiSelectWorld.java @@ -186,7 +186,7 @@ - if (this.mc.getSaveLoader().canLoadWorld(s)) + if (this.field_146297_k.func_71359_d().func_90033_f(s)) { -- this.mc.launchIntegratedServer(s, s1, (WorldSettings)null); +- this.field_146297_k.func_71371_a(s, s1, (WorldSettings)null); + net.minecraftforge.fml.client.FMLClientHandler.instance().tryLoadExistingWorld(this, s, s1); } } diff --git a/patches/minecraft/net/minecraft/client/gui/GuiSleepMP.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiSleepMP.java.patch index a179369e2..11a0b4f04 100644 --- a/patches/minecraft/net/minecraft/client/gui/GuiSleepMP.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/GuiSleepMP.java.patch @@ -4,8 +4,8 @@ if (!s.isEmpty()) { -- this.mc.thePlayer.sendChatMessage(s); -+ this.sendChatMessage(s); // Forge: fix vanilla not adding messages to the sent list while sleeping +- this.field_146297_k.field_71439_g.func_71165_d(s); ++ this.func_175275_f(s); // Forge: fix vanilla not adding messages to the sent list while sleeping } - this.inputField.setText(""); + this.field_146415_a.func_146180_a(""); diff --git a/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch b/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch index 726608794..d4b2b22e5 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 @@ -181,15 +181,8 @@ - GlStateManager.disableFog(); - Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer worldrenderer = tessellator.getWorldRenderer(); -- this.mc.getTextureManager().bindTexture(Gui.optionsBackground); -- GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.func_179106_n(); + Tessellator tessellator = Tessellator.func_178181_a(); + WorldRenderer worldrenderer = tessellator.func_178180_c(); +- this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k); +- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); - float f = 32.0F; - worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181709_i); -- worldrenderer.func_181662_b((double)this.left, (double)this.bottom, 0.0D).func_181673_a((double)((float)this.left / f), (double)((float)(this.bottom + (int)this.amountScrolled) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -- worldrenderer.func_181662_b((double)this.right, (double)this.bottom, 0.0D).func_181673_a((double)((float)this.right / f), (double)((float)(this.bottom + (int)this.amountScrolled) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -- worldrenderer.func_181662_b((double)this.right, (double)this.top, 0.0D).func_181673_a((double)((float)this.right / f), (double)((float)(this.top + (int)this.amountScrolled) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -- worldrenderer.func_181662_b((double)this.left, (double)this.top, 0.0D).func_181673_a((double)((float)this.left / f), (double)((float)(this.top + (int)this.amountScrolled) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -- tessellator.draw(); +- worldrenderer.func_181662_b((double)this.field_148152_e, (double)this.field_148154_c, 0.0D).func_181673_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); +- worldrenderer.func_181662_b((double)this.field_148151_d, (double)this.field_148154_c, 0.0D).func_181673_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); +- worldrenderer.func_181662_b((double)this.field_148151_d, (double)this.field_148153_b, 0.0D).func_181673_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); +- worldrenderer.func_181662_b((double)this.field_148152_e, (double)this.field_148153_b, 0.0D).func_181673_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); +- tessellator.func_78381_a(); + // Forge: background rendering moved into separate method. + this.drawContainerBackground(tessellator); - int k = this.left + this.width / 2 - this.getListWidth() / 2 + 2; - int l = this.top + 4 - (int)this.amountScrolled; + int k = this.field_148152_e + this.field_148155_a / 2 - this.func_148139_c() / 2 + 2; + int l = this.field_148153_b + 4 - (int)this.field_148169_q; @@ -458,4 +451,18 @@ { - return this.slotHeight; + return this.field_148149_f; } + + protected void drawContainerBackground(Tessellator tessellator) + { -+ WorldRenderer worldrenderer = tessellator.getWorldRenderer(); -+ this.mc.getTextureManager().bindTexture(Gui.optionsBackground); -+ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); ++ WorldRenderer worldrenderer = tessellator.func_178180_c(); ++ this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k); ++ GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + float f = 32.0F; + worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181709_i); -+ worldrenderer.func_181662_b((double)this.left, (double)this.bottom, 0.0D).func_181673_a((double)((float)this.left / f), (double)((float)(this.bottom + (int)this.amountScrolled) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -+ worldrenderer.func_181662_b((double)this.right, (double)this.bottom, 0.0D).func_181673_a((double)((float)this.right / f), (double)((float)(this.bottom + (int)this.amountScrolled) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -+ worldrenderer.func_181662_b((double)this.right, (double)this.top, 0.0D).func_181673_a((double)((float)this.right / f), (double)((float)(this.top + (int)this.amountScrolled) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -+ worldrenderer.func_181662_b((double)this.left, (double)this.top, 0.0D).func_181673_a((double)((float)this.left / f), (double)((float)(this.top + (int)this.amountScrolled) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); -+ tessellator.draw(); ++ worldrenderer.func_181662_b((double)this.field_148152_e, (double)this.field_148154_c, 0.0D).func_181673_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); ++ worldrenderer.func_181662_b((double)this.field_148151_d, (double)this.field_148154_c, 0.0D).func_181673_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); ++ worldrenderer.func_181662_b((double)this.field_148151_d, (double)this.field_148153_b, 0.0D).func_181673_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); ++ worldrenderer.func_181662_b((double)this.field_148152_e, (double)this.field_148153_b, 0.0D).func_181673_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d(); ++ tessellator.func_78381_a(); + } } diff --git a/patches/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java.patch b/patches/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java.patch index 658585c9c..a79cd9dd2 100644 --- a/patches/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java.patch @@ -1,23 +1,23 @@ --- ../src-base/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java +++ ../src-work/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java @@ -82,7 +82,7 @@ - boolean flag1 = this.field_148301_e.version < 47; + boolean flag1 = this.field_148301_e.field_82821_f < 47; boolean flag2 = flag || flag1; - this.field_148300_d.fontRendererObj.drawString(this.field_148301_e.serverName, x + 32 + 3, y + 1, 16777215); -- List list = this.field_148300_d.fontRendererObj.listFormattedStringToWidth(this.field_148301_e.serverMOTD, listWidth - 32 - 2); -+ List list = this.field_148300_d.fontRendererObj.listFormattedStringToWidth(net.minecraftforge.fml.client.FMLClientHandler.instance().fixDescription(this.field_148301_e.serverMOTD), listWidth - 48 - 2); + this.field_148300_d.field_71466_p.func_78276_b(this.field_148301_e.field_78847_a, p_180790_2_ + 32 + 3, p_180790_3_ + 1, 16777215); +- List list = this.field_148300_d.field_71466_p.func_78271_c(this.field_148301_e.field_78843_d, p_180790_4_ - 32 - 2); ++ List list = this.field_148300_d.field_71466_p.func_78271_c(net.minecraftforge.fml.client.FMLClientHandler.instance().fixDescription(this.field_148301_e.field_78843_d), p_180790_4_ - 48 - 2); for (int i = 0; i < Math.min(list.size(), 2); ++i) { @@ -176,6 +176,11 @@ - int i1 = mouseX - x; - int j1 = mouseY - y; + int i1 = p_180790_6_ - p_180790_2_; + int j1 = p_180790_7_ - p_180790_3_; -+ String tooltip = net.minecraftforge.fml.client.FMLClientHandler.instance().enhanceServerListEntry(this, this.field_148301_e, x, listWidth, y, i1, j1); ++ String tooltip = net.minecraftforge.fml.client.FMLClientHandler.instance().enhanceServerListEntry(this, this.field_148301_e, p_180790_2_, p_180790_4_, p_180790_3_, i1, j1); + if (tooltip != null) + { + this.field_148303_c.func_146793_a(tooltip); + } else - if (i1 >= listWidth - 15 && i1 <= listWidth - 5 && j1 >= 0 && j1 <= 8) + if (i1 >= p_180790_4_ - 15 && i1 <= p_180790_4_ - 5 && j1 >= 0 && j1 <= 8) { this.field_148303_c.func_146793_a(s1); 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 44c399134..5512b3cdc 100644 --- a/patches/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java +++ ../src-work/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java @@ -49,6 +49,10 @@ - private StatFileWriter statFileWriter; - private boolean loadingAchievements = true; + private StatFileWriter field_146556_E; + private boolean field_146558_F = true; + private int currentPage = -1; + private GuiButton button; @@ -10,13 +10,13 @@ + public GuiAchievements(GuiScreen p_i45026_1_, StatFileWriter p_i45026_2_) { - this.parentScreen = p_i45026_1_; + this.field_146562_a = p_i45026_1_; @@ -57,6 +61,14 @@ int j = 141; - this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.openInventory.displayColumn * 24 - i / 2 - 12); - this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.openInventory.displayRow * 24 - j / 2); + this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.field_76004_f.field_75993_a * 24 - i / 2 - 12); + this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.field_76004_f.field_75991_b * 24 - j / 2); + minecraftAchievements.clear(); -+ for (Achievement achievement : AchievementList.achievementList) ++ for (Achievement achievement : AchievementList.field_76007_e) + { + if (!net.minecraftforge.common.AchievementPage.isAchievementInPages(achievement)) + { @@ -25,93 +25,93 @@ + } } - public void initGui() + public void func_73866_w_() @@ -64,6 +76,7 @@ - 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, net.minecraftforge.common.AchievementPage.getTitle(currentPage))); + 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.func_135052_a("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, net.minecraftforge.common.AchievementPage.getTitle(currentPage))); } - protected void actionPerformed(GuiButton button) throws IOException + protected void func_146284_a(GuiButton p_146284_1_) throws IOException @@ -74,6 +87,16 @@ { - this.mc.displayGuiScreen(this.parentScreen); + this.field_146297_k.func_147108_a(this.field_146562_a); } + -+ if (button.id == 2) ++ if (p_146284_1_.field_146127_k == 2) + { + currentPage++; + if (currentPage >= net.minecraftforge.common.AchievementPage.getAchievementPages().size()) + { + currentPage = -1; + } -+ this.button.displayString = net.minecraftforge.common.AchievementPage.getTitle(currentPage); ++ this.button.field_146126_j = net.minecraftforge.common.AchievementPage.getTitle(currentPage); + } } } @@ -257,7 +280,9 @@ - GlStateManager.depthFunc(518); - GlStateManager.pushMatrix(); - GlStateManager.translate((float)i1, (float)j1, -200.0F); -- GlStateManager.scale(1.0F / this.field_146570_r, 1.0F / this.field_146570_r, 0.0F); + GlStateManager.func_179143_c(518); + GlStateManager.func_179094_E(); + GlStateManager.func_179109_b((float)i1, (float)j1, -200.0F); +- GlStateManager.func_179152_a(1.0F / this.field_146570_r, 1.0F / this.field_146570_r, 0.0F); + // FIXES models rendering weirdly in the acheivements pane + // see https://github.com/MinecraftForge/MinecraftForge/commit/1b7ce7592caafb760ec93066184182ae0711e793#commitcomment-10512284 -+ GlStateManager.scale(1.0F / this.field_146570_r, 1.0F / this.field_146570_r, 1.0F); - GlStateManager.enableTexture2D(); - GlStateManager.disableLighting(); - GlStateManager.enableRescaleNormal(); ++ GlStateManager.func_179152_a(1.0F / this.field_146570_r, 1.0F / this.field_146570_r, 1.0F); + GlStateManager.func_179098_w(); + GlStateManager.func_179140_f(); + GlStateManager.func_179091_B(); @@ -331,11 +356,12 @@ - GlStateManager.depthFunc(515); - this.mc.getTextureManager().bindTexture(field_146561_C); + GlStateManager.func_179143_c(515); + this.field_146297_k.func_110434_K().func_110577_a(field_146561_C); -- for (int j5 = 0; j5 < AchievementList.achievementList.size(); ++j5) +- for (int j5 = 0; j5 < AchievementList.field_76007_e.size(); ++j5) + java.util.List achievementList = (currentPage == -1 ? minecraftAchievements : net.minecraftforge.common.AchievementPage.getAchievementPage(currentPage).getAchievements()); + for (int j5 = 0; j5 < achievementList.size(); ++j5) { -- Achievement achievement1 = (Achievement)AchievementList.achievementList.get(j5); +- Achievement achievement1 = (Achievement)AchievementList.field_76007_e.get(j5); + Achievement achievement1 = achievementList.get(j5); -- if (achievement1.parentAchievement != null) -+ if (achievement1.parentAchievement != null && achievementList.contains(achievement1.parentAchievement)) +- if (achievement1.field_75992_c != null) ++ if (achievement1.field_75992_c != null && achievementList.contains(achievement1.field_75992_c)) { - int k5 = achievement1.displayColumn * 24 - i + 11; - int l5 = achievement1.displayRow * 24 - j + 11; + int k5 = achievement1.field_75993_a * 24 - i + 11; + int l5 = achievement1.field_75991_b * 24 - j + 11; @@ -389,9 +415,9 @@ - GlStateManager.enableRescaleNormal(); - GlStateManager.enableColorMaterial(); + GlStateManager.func_179091_B(); + GlStateManager.func_179142_g(); -- for (int i6 = 0; i6 < AchievementList.achievementList.size(); ++i6) +- for (int i6 = 0; i6 < AchievementList.field_76007_e.size(); ++i6) + for (int i6 = 0; i6 < achievementList.size(); ++i6) { -- Achievement achievement2 = (Achievement)AchievementList.achievementList.get(i6); +- Achievement achievement2 = (Achievement)AchievementList.field_76007_e.get(i6); + Achievement achievement2 = achievementList.get(i6); - int l6 = achievement2.displayColumn * 24 - i; - int j7 = achievement2.displayRow * 24 - j; + int l6 = achievement2.field_75993_a * 24 - i; + int j7 = achievement2.field_75991_b * 24 - j; @@ -432,6 +458,7 @@ - this.mc.getTextureManager().bindTexture(field_146561_C); + this.field_146297_k.func_110434_K().func_110577_a(field_146561_C); -+ GlStateManager.enableBlend(); // Forge: Specifically enable blend because it is needed here. And we fix Generic RenderItem's leakage of it. - if (achievement2.getSpecial()) ++ GlStateManager.func_179147_l(); // Forge: Specifically enable blend because it is needed here. And we fix Generic RenderItem's leakage of it. + if (achievement2.func_75984_f()) { - this.drawTexturedModalRect(l6 - 2, j7 - 2, 26, 202, 26, 26); + this.func_73729_b(l6 - 2, j7 - 2, 26, 202, 26, 26); @@ -440,6 +467,7 @@ { - this.drawTexturedModalRect(l6 - 2, j7 - 2, 0, 202, 26, 26); + this.func_73729_b(l6 - 2, j7 - 2, 0, 202, 26, 26); } -+ GlStateManager.disableBlend(); //Forge: Cleanup states we set. ++ GlStateManager.func_179084_k(); //Forge: Cleanup states we set. - if (!this.statFileWriter.canUnlockAchievement(achievement2)) + if (!this.field_146556_E.func_77442_b(achievement2)) { @@ -448,7 +476,7 @@ - this.itemRender.func_175039_a(false); + this.field_146296_j.func_175039_a(false); } -- GlStateManager.enableLighting(); -+ GlStateManager.disableLighting(); //Forge: Make sure Lighting is disabled. Fixes MC-33065 - GlStateManager.enableCull(); - this.itemRender.renderItemAndEffectIntoGUI(achievement2.theItemStack, l6 + 3, j7 + 3); - GlStateManager.blendFunc(770, 771); +- GlStateManager.func_179145_e(); ++ GlStateManager.func_179140_f(); //Forge: Make sure Lighting is disabled. Fixes MC-33065 + GlStateManager.func_179089_o(); + this.field_146296_j.func_180450_b(achievement2.field_75990_d, l6 + 3, j7 + 3); + GlStateManager.func_179112_b(770, 771); diff --git a/patches/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch b/patches/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch index 6363f6f74..f2890750d 100644 --- a/patches/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch @@ -10,24 +10,24 @@ import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.gui.GuiButton; @@ -443,17 +445,18 @@ - for (StatCrafting statcrafting : StatList.objectMineStats) + for (StatCrafting statcrafting : StatList.field_75939_e) { boolean flag = false; -- int i = Item.getIdFromItem(statcrafting.func_150959_a()); -+ int i = Block.getIdFromBlock(Block.getBlockFromItem(statcrafting.func_150959_a())); -+ int itemId = Item.getIdFromItem(statcrafting.func_150959_a()); +- int i = Item.func_150891_b(statcrafting.func_150959_a()); ++ int i = Block.func_149682_b(Block.func_149634_a(statcrafting.func_150959_a())); ++ int itemId = Item.func_150891_b(statcrafting.func_150959_a()); - if (GuiStats.this.field_146546_t.readStat(statcrafting) > 0) + if (GuiStats.this.field_146546_t.func_77444_a(statcrafting) > 0) { flag = true; } -- else if (StatList.objectUseStats[i] != null && GuiStats.this.field_146546_t.readStat(StatList.objectUseStats[i]) > 0) -+ else if (StatList.objectUseStats[itemId] != null && GuiStats.this.field_146546_t.readStat(StatList.objectUseStats[itemId]) > 0) +- else if (StatList.field_75929_E[i] != null && GuiStats.this.field_146546_t.func_77444_a(StatList.field_75929_E[i]) > 0) ++ else if (StatList.field_75929_E[itemId] != null && GuiStats.this.field_146546_t.func_77444_a(StatList.field_75929_E[itemId]) > 0) { flag = true; } -- else if (StatList.objectCraftStats[i] != null && GuiStats.this.field_146546_t.readStat(StatList.objectCraftStats[i]) > 0) -+ else if (StatList.objectCraftStats[itemId] != null && GuiStats.this.field_146546_t.readStat(StatList.objectCraftStats[itemId]) > 0) +- else if (StatList.field_75928_D[i] != null && GuiStats.this.field_146546_t.func_77444_a(StatList.field_75928_D[i]) > 0) ++ else if (StatList.field_75928_D[itemId] != null && GuiStats.this.field_146546_t.func_77444_a(StatList.field_75928_D[itemId]) > 0) { flag = true; } @@ -35,35 +35,35 @@ { public int compare(StatCrafting p_compare_1_, StatCrafting p_compare_2_) { -- int j = Item.getIdFromItem(p_compare_1_.func_150959_a()); -- int k = Item.getIdFromItem(p_compare_2_.func_150959_a()); +- int j = Item.func_150891_b(p_compare_1_.func_150959_a()); +- int k = Item.func_150891_b(p_compare_2_.func_150959_a()); + int j; + int k; + if (StatsBlock.this.field_148217_o == 2) { -+ j = Block.getIdFromBlock(Block.getBlockFromItem(p_compare_1_.func_150959_a())); -+ k = Block.getIdFromBlock(Block.getBlockFromItem(p_compare_2_.func_150959_a())); ++ j = Block.func_149682_b(Block.func_149634_a(p_compare_1_.func_150959_a())); ++ k = Block.func_149682_b(Block.func_149634_a(p_compare_2_.func_150959_a())); + } else { -+ j = Item.getIdFromItem(p_compare_1_.func_150959_a()); -+ k = Item.getIdFromItem(p_compare_2_.func_150959_a()); ++ j = Item.func_150891_b(p_compare_1_.func_150959_a()); ++ k = Item.func_150891_b(p_compare_2_.func_150959_a()); + } StatBase statbase = null; StatBase statbase1 = null; @@ -748,7 +758,7 @@ - super(mcIn, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, GuiStats.this.fontRendererObj.FONT_HEIGHT * 4); - this.setShowSelectionBox(false); + super(p_i45510_2_, GuiStats.this.field_146294_l, GuiStats.this.field_146295_m, 32, GuiStats.this.field_146295_m - 64, GuiStats.this.field_146289_q.field_78288_b * 4); + this.func_148130_a(false); -- for (EntityList.EntityEggInfo entitylist$entityegginfo : EntityList.entityEggs.values()) -+ for (EntityList.EntityEggInfo entitylist$entityegginfo : com.google.common.collect.Iterables.concat(EntityList.entityEggs.values(), net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().values())) +- for (EntityList.EntityEggInfo entitylist$entityegginfo : EntityList.field_75627_a.values()) ++ for (EntityList.EntityEggInfo entitylist$entityegginfo : com.google.common.collect.Iterables.concat(EntityList.field_75627_a.values(), net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().values())) { - if (GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151512_d) > 0 || GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151513_e) > 0) + if (GuiStats.this.field_146546_t.func_77444_a(entitylist$entityegginfo.field_151512_d) > 0 || GuiStats.this.field_146546_t.func_77444_a(entitylist$entityegginfo.field_151513_e) > 0) { @@ -784,7 +794,7 @@ - protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int p_180791_5_, int p_180791_6_) + protected void func_180791_a(int p_180791_1_, int p_180791_2_, int p_180791_3_, int p_180791_4_, int p_180791_5_, int p_180791_6_) { - EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)this.field_148222_l.get(entryID); -- String s = I18n.format("entity." + EntityList.getStringFromID(entitylist$entityegginfo.spawnedID) + ".name", new Object[0]); -+ String s = I18n.format("entity." + entitylist$entityegginfo.name + ".name", new Object[0]); - int i = GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151512_d); - int j = GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151513_e); - String s1 = I18n.format("stat.entityKills", new Object[] {Integer.valueOf(i), s}); + EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)this.field_148222_l.get(p_180791_1_); +- String s = I18n.func_135052_a("entity." + EntityList.func_75617_a(entitylist$entityegginfo.field_75613_a) + ".name", new Object[0]); ++ String s = I18n.func_135052_a("entity." + entitylist$entityegginfo.name + ".name", new Object[0]); + int i = GuiStats.this.field_146546_t.func_77444_a(entitylist$entityegginfo.field_151512_d); + int j = GuiStats.this.field_146546_t.func_77444_a(entitylist$entityegginfo.field_151513_e); + String s1 = I18n.func_135052_a("stat.entityKills", new Object[] {Integer.valueOf(i), s}); 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 52bb89b7e..2f9a3929a 100644 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch @@ -1,45 +1,45 @@ --- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java +++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java @@ -175,8 +175,11 @@ - GlStateManager.translate(0.0F, 0.0F, 32.0F); - this.zLevel = 200.0F; - this.itemRender.zLevel = 200.0F; + GlStateManager.func_179109_b(0.0F, 0.0F, 32.0F); + this.field_73735_i = 200.0F; + this.field_146296_j.field_77023_b = 200.0F; + net.minecraft.client.gui.FontRenderer font = null; -+ if (stack != null) font = stack.getItem().getFontRenderer(stack); -+ if (font == null) font = fontRendererObj; - this.itemRender.renderItemAndEffectIntoGUI(stack, x, y); -- this.itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, stack, x, y - (this.draggedStack == null ? 0 : 8), altText); -+ this.itemRender.renderItemOverlayIntoGUI(font, stack, x, y - (this.draggedStack == null ? 0 : 8), altText); - this.zLevel = 0.0F; - this.itemRender.zLevel = 0.0F; ++ if (p_146982_1_ != null) font = p_146982_1_.func_77973_b().getFontRenderer(p_146982_1_); ++ if (font == null) font = field_146289_q; + this.field_146296_j.func_180450_b(p_146982_1_, p_146982_2_, p_146982_3_); +- this.field_146296_j.func_180453_a(this.field_146289_q, p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_); ++ this.field_146296_j.func_180453_a(font, p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_); + this.field_73735_i = 0.0F; + this.field_146296_j.field_77023_b = 0.0F; } @@ -239,13 +242,12 @@ if (itemstack == null) { -- String s1 = slotIn.getSlotTexture(); -+ TextureAtlasSprite textureatlassprite = slotIn.getBackgroundSprite(); +- String s1 = p_146977_1_.func_178171_c(); ++ TextureAtlasSprite textureatlassprite = p_146977_1_.getBackgroundSprite(); - if (s1 != null) + if (textureatlassprite != null) { -- TextureAtlasSprite textureatlassprite = this.mc.getTextureMapBlocks().getAtlasSprite(s1); - GlStateManager.disableLighting(); -- this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); -+ this.mc.getTextureManager().bindTexture(slotIn.getBackgroundLocation()); - this.drawTexturedModalRect(i, j, textureatlassprite, 16, 16); - GlStateManager.enableLighting(); +- TextureAtlasSprite textureatlassprite = this.field_146297_k.func_147117_R().func_110572_b(s1); + GlStateManager.func_179140_f(); +- this.field_146297_k.func_110434_K().func_110577_a(TextureMap.field_110575_b); ++ this.field_146297_k.func_110434_K().func_110577_a(p_146977_1_.getBackgroundLocation()); + this.func_175175_a(i, j, textureatlassprite, 16, 16); + GlStateManager.func_179145_e(); flag1 = true; @@ -463,6 +465,7 @@ - protected void mouseReleased(int mouseX, int mouseY, int state) + protected void func_146286_b(int p_146286_1_, int p_146286_2_, int p_146286_3_) { -+ super.mouseReleased(mouseX, mouseY, state); //Forge, Call parent to release buttons - Slot slot = this.getSlotAtPosition(mouseX, mouseY); - int i = this.guiLeft; - int j = this.guiTop; ++ super.func_146286_b(p_146286_1_, p_146286_2_, p_146286_3_); //Forge, Call parent to release buttons + Slot slot = this.func_146975_c(p_146286_1_, p_146286_2_); + int i = this.field_147003_i; + int j = this.field_147009_r; @@ -685,4 +688,16 @@ - this.mc.thePlayer.closeScreen(); + this.field_146297_k.field_71439_g.func_71053_j(); } } + @@ -50,7 +50,7 @@ + */ + public Slot getSlotUnderMouse() + { -+ return this.theSlot; ++ return this.field_147006_u; + } + + /* ======================================== FORGE END =====================================*/ 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 6ae29806b..671aff30b 100644 --- a/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch +++ b/patches/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch @@ -13,20 +13,20 @@ return; } -- if (itemstack1 != null && itemstack2 != null && itemstack1.isItemEqual(itemstack2)) -+ if (itemstack1 != null && itemstack2 != null && itemstack1.isItemEqual(itemstack2) && ItemStack.areItemStackTagsEqual(itemstack1, itemstack2)) //Forge: Bugfix, Compare NBT data, allow for deletion of enchanted books, MC-12770 +- if (itemstack1 != null && itemstack2 != null && itemstack1.func_77969_a(itemstack2)) ++ if (itemstack1 != null && itemstack2 != null && itemstack1.func_77969_a(itemstack2) && ItemStack.func_77970_a(itemstack1, itemstack2)) //Forge: Bugfix, Compare NBT data, allow for deletion of enchanted books, MC-12770 { - if (clickedButton == 0) + if (p_146984_3_ == 0) { @@ -259,6 +261,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; + this.func_147050_b(CreativeTabs.field_78032_a[i]); + this.field_147059_E = new CreativeCrafting(this.field_146297_k); + this.field_146297_k.field_71439_g.field_71069_bz.func_75132_a(this.field_147059_E); ++ int tabCount = CreativeTabs.field_78032_a.length; + if (tabCount > 12) + { -+ buttonList.add(new GuiButton(101, guiLeft, guiTop - 50, 20, 20, "<")); -+ buttonList.add(new GuiButton(102, guiLeft + xSize - 20, guiTop - 50, 20, 20, ">")); ++ 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, ">")); + maxPages = ((tabCount - 12) / 10) + 1; + } } @@ -34,30 +34,30 @@ { @@ -280,7 +289,7 @@ - protected void keyTyped(char typedChar, int keyCode) throws IOException + protected void func_73869_a(char p_73869_1_, int p_73869_2_) throws IOException { -- if (selectedTabIndex != CreativeTabs.tabAllSearch.getTabIndex()) -+ if (!CreativeTabs.creativeTabArray[selectedTabIndex].hasSearchBar()) +- if (field_147058_w != CreativeTabs.field_78027_g.func_78021_a()) ++ if (!CreativeTabs.field_78032_a[field_147058_w].hasSearchBar()) { - if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat)) + if (GameSettings.func_100015_a(this.field_146297_k.field_71474_y.field_74310_D)) { @@ -318,6 +327,14 @@ - GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots; - guicontainercreative$containercreative.itemList.clear(); + GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h; + guicontainercreative$containercreative.field_148330_a.clear(); -+ CreativeTabs tab = CreativeTabs.creativeTabArray[selectedTabIndex]; -+ if (tab.hasSearchBar() && tab != CreativeTabs.tabAllSearch) ++ CreativeTabs tab = CreativeTabs.field_78032_a[field_147058_w]; ++ if (tab.hasSearchBar() && tab != CreativeTabs.field_78027_g) + { -+ tab.displayAllReleventItems(guicontainercreative$containercreative.itemList); ++ tab.func_78018_a(guicontainercreative$containercreative.field_148330_a); + updateFilteredItems(guicontainercreative$containercreative); + return; + } + - for (Item item : Item.itemRegistry) + for (Item item : Item.field_150901_e) { - if (item != null && item.getCreativeTab() != null) + if (item != null && item.func_77640_w() != null) @@ -325,7 +342,13 @@ - item.getSubItems(item, (CreativeTabs)null, guicontainercreative$containercreative.itemList); + item.func_150895_a(item, (CreativeTabs)null, guicontainercreative$containercreative.field_148330_a); } } + updateFilteredItems(guicontainercreative$containercreative); @@ -66,126 +66,126 @@ + //split from above for custom search tabs + private void updateFilteredItems(GuiContainerCreative.ContainerCreative guicontainercreative$containercreative) + { -+ if (CreativeTabs.creativeTabArray[selectedTabIndex] == CreativeTabs.tabAllSearch) // FORGE: Only add enchanted books to the regular search - for (Enchantment enchantment : Enchantment.enchantmentsBookList) ++ if (CreativeTabs.field_78032_a[field_147058_w] == CreativeTabs.field_78027_g) // FORGE: Only add enchanted books to the regular search + for (Enchantment enchantment : Enchantment.field_77331_b) { - if (enchantment != null && enchantment.type != null) + if (enchantment != null && enchantment.field_77351_y != null) @@ -333,7 +356,6 @@ - Items.enchanted_book.getAll(enchantment, guicontainercreative$containercreative.itemList); + Items.field_151134_bR.func_92113_a(enchantment, guicontainercreative$containercreative.field_148330_a); } } - - Iterator iterator = guicontainercreative$containercreative.itemList.iterator(); - String s1 = this.searchField.getText().toLowerCase(); + Iterator iterator = guicontainercreative$containercreative.field_148330_a.iterator(); + String s1 = this.field_147062_A.func_146179_b().toLowerCase(); @@ -365,7 +387,7 @@ { - CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex]; + CreativeTabs creativetabs = CreativeTabs.field_78032_a[field_147058_w]; -- if (creativetabs.drawInForegroundOfTab()) -+ if (creativetabs != null && creativetabs.drawInForegroundOfTab()) +- if (creativetabs.func_78019_g()) ++ if (creativetabs != null && creativetabs.func_78019_g()) { - GlStateManager.disableBlend(); - this.fontRendererObj.drawString(I18n.format(creativetabs.getTranslatedTabLabel(), new Object[0]), 8, 6, 4210752); + GlStateManager.func_179084_k(); + this.field_146289_q.func_78276_b(I18n.func_135052_a(creativetabs.func_78024_c(), new Object[0]), 8, 6, 4210752); @@ -400,7 +422,7 @@ - for (CreativeTabs creativetabs : CreativeTabs.creativeTabArray) + for (CreativeTabs creativetabs : CreativeTabs.field_78032_a) { - if (this.func_147049_a(creativetabs, i, j)) + if (creativetabs != null && this.func_147049_a(creativetabs, i, j)) { - this.setCurrentCreativeTab(creativetabs); + this.func_147050_b(creativetabs); return; @@ -413,11 +435,13 @@ - private boolean needsScrollBars() + private boolean func_147055_p() { -+ if (CreativeTabs.creativeTabArray[selectedTabIndex] == null) return false; - return selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && CreativeTabs.creativeTabArray[selectedTabIndex].shouldHidePlayerInventory() && ((GuiContainerCreative.ContainerCreative)this.inventorySlots).func_148328_e(); ++ if (CreativeTabs.field_78032_a[field_147058_w] == null) return false; + return field_147058_w != CreativeTabs.field_78036_m.func_78021_a() && CreativeTabs.field_78032_a[field_147058_w].func_78017_i() && ((GuiContainerCreative.ContainerCreative)this.field_147002_h).func_148328_e(); } - private void setCurrentCreativeTab(CreativeTabs p_147050_1_) + private void func_147050_b(CreativeTabs p_147050_1_) { + if (p_147050_1_ == null) return; - int i = selectedTabIndex; - selectedTabIndex = p_147050_1_.getTabIndex(); - GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots; + int i = field_147058_w; + field_147058_w = p_147050_1_.func_78021_a(); + GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h; @@ -483,12 +507,14 @@ - if (this.searchField != null) + if (this.field_147062_A != null) { -- if (p_147050_1_ == CreativeTabs.tabAllSearch) +- if (p_147050_1_ == CreativeTabs.field_78027_g) + if (p_147050_1_.hasSearchBar()) { - this.searchField.setVisible(true); - this.searchField.setCanLoseFocus(false); - this.searchField.setFocused(true); - this.searchField.setText(""); -+ this.searchField.width = p_147050_1_.getSearchbarWidth(); -+ this.searchField.xPosition = this.guiLeft + (82 /*default left*/ + 89 /*default width*/) - this.searchField.width; - this.updateCreativeSearch(); + this.field_147062_A.func_146189_e(true); + this.field_147062_A.func_146205_d(false); + this.field_147062_A.func_146195_b(true); + this.field_147062_A.func_146180_a(""); ++ this.field_147062_A.field_146218_h = p_147050_1_.getSearchbarWidth(); ++ this.field_147062_A.field_146209_f = this.field_147003_i + (82 /*default left*/ + 89 /*default width*/) - this.field_147062_A.field_146218_h; + this.func_147053_i(); } else @@ -558,20 +584,43 @@ } - super.drawScreen(mouseX, mouseY, partialTicks); + super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); + int start = tabPage * 10; -+ int end = Math.min(CreativeTabs.creativeTabArray.length, ((tabPage + 1) * 10) + 2); ++ int end = Math.min(CreativeTabs.field_78032_a.length, ((tabPage + 1) * 10) + 2); + if (tabPage != 0) start += 2; + boolean rendered = false; -- for (CreativeTabs creativetabs : CreativeTabs.creativeTabArray) -+ for (CreativeTabs creativetabs : java.util.Arrays.copyOfRange(CreativeTabs.creativeTabArray,start,end)) +- for (CreativeTabs creativetabs : CreativeTabs.field_78032_a) ++ for (CreativeTabs creativetabs : java.util.Arrays.copyOfRange(CreativeTabs.field_78032_a,start,end)) { + if (creativetabs == null) continue; - if (this.renderCreativeInventoryHoveringText(creativetabs, mouseX, mouseY)) + if (this.func_147052_b(creativetabs, p_73863_1_, p_73863_2_)) { + rendered = true; break; } } -+ if (!rendered && renderCreativeInventoryHoveringText(CreativeTabs.tabAllSearch, mouseX, mouseY)) ++ if (!rendered && func_147052_b(CreativeTabs.field_78027_g, p_73863_1_, p_73863_2_)) + { -+ renderCreativeInventoryHoveringText(CreativeTabs.tabInventory, mouseX, mouseY); ++ func_147052_b(CreativeTabs.field_78036_m, p_73863_1_, p_73863_2_); + } + - if (this.field_147064_C != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.isPointInRegion(this.field_147064_C.xDisplayPosition, this.field_147064_C.yDisplayPosition, 16, 16, mouseX, mouseY)) + if (this.field_147064_C != null && field_147058_w == CreativeTabs.field_78036_m.func_78021_a() && this.func_146978_c(this.field_147064_C.field_75223_e, this.field_147064_C.field_75221_f, 16, 16, p_73863_1_, p_73863_2_)) { - this.drawCreativeTabHoveringText(I18n.format("inventory.binSlot", new Object[0]), mouseX, mouseY); + this.func_146279_a(I18n.func_135052_a("inventory.binSlot", new Object[0]), p_73863_1_, p_73863_2_); } + if (maxPages != 0) + { + String page = String.format("%d / %d", tabPage + 1, maxPages + 1); -+ int width = fontRendererObj.getStringWidth(page); -+ GlStateManager.disableLighting(); -+ this.zLevel = 300.0F; -+ itemRender.zLevel = 300.0F; -+ fontRendererObj.drawString(page, guiLeft + (xSize / 2) - (width / 2), guiTop - 44, -1); -+ this.zLevel = 0.0F; -+ itemRender.zLevel = 0.0F; ++ int width = field_146289_q.func_78256_a(page); ++ GlStateManager.func_179140_f(); ++ this.field_73735_i = 300.0F; ++ field_146296_j.field_77023_b = 300.0F; ++ field_146289_q.func_78276_b(page, field_147003_i + (field_146999_f / 2) - (width / 2), field_147009_r - 44, -1); ++ this.field_73735_i = 0.0F; ++ field_146296_j.field_77023_b = 0.0F; + } + - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GlStateManager.disableLighting(); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.func_179140_f(); } @@ -633,16 +682,35 @@ - RenderHelper.enableGUIStandardItemLighting(); - CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex]; + RenderHelper.func_74520_c(); + CreativeTabs creativetabs = CreativeTabs.field_78032_a[field_147058_w]; -- for (CreativeTabs creativetabs1 : CreativeTabs.creativeTabArray) +- for (CreativeTabs creativetabs1 : CreativeTabs.field_78032_a) + int start = tabPage * 10; -+ int end = Math.min(CreativeTabs.creativeTabArray.length, ((tabPage + 1) * 10 + 2)); ++ int end = Math.min(CreativeTabs.field_78032_a.length, ((tabPage + 1) * 10 + 2)); + if (tabPage != 0) start += 2; + -+ for (CreativeTabs creativetabs1 : java.util.Arrays.copyOfRange(CreativeTabs.creativeTabArray,start,end)) ++ for (CreativeTabs creativetabs1 : java.util.Arrays.copyOfRange(CreativeTabs.field_78032_a,start,end)) { - this.mc.getTextureManager().bindTexture(creativeInventoryTabs); + this.field_146297_k.func_110434_K().func_110577_a(field_147061_u); + if (creativetabs1 == null) continue; - if (creativetabs1.getTabIndex() != selectedTabIndex) + if (creativetabs1.func_78021_a() != field_147058_w) { this.func_147051_a(creativetabs1); } @@ -193,28 +193,28 @@ + if (tabPage != 0) + { -+ if (creativetabs != CreativeTabs.tabAllSearch) ++ if (creativetabs != CreativeTabs.field_78027_g) + { -+ this.mc.getTextureManager().bindTexture(creativeInventoryTabs); -+ func_147051_a(CreativeTabs.tabAllSearch); ++ this.field_146297_k.func_110434_K().func_110577_a(field_147061_u); ++ func_147051_a(CreativeTabs.field_78027_g); + } -+ if (creativetabs != CreativeTabs.tabInventory) ++ if (creativetabs != CreativeTabs.field_78036_m) + { -+ this.mc.getTextureManager().bindTexture(creativeInventoryTabs); -+ func_147051_a(CreativeTabs.tabInventory); ++ this.field_146297_k.func_110434_K().func_110577_a(field_147061_u); ++ func_147051_a(CreativeTabs.field_78036_m); + } + } + - 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(); + this.field_146297_k.func_110434_K().func_110577_a(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.func_78015_f())); + this.func_73729_b(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(); @@ -657,6 +725,14 @@ - this.drawTexturedModalRect(i, j + (int)((float)(k - j - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15); + this.func_73729_b(i, j + (int)((float)(k - j - 17) * this.field_147067_x), 232 + (this.func_147055_p() ? 0 : 12), 0, 12, 15); } + if (creativetabs == null || creativetabs.getTabPage() != tabPage) + { -+ if (creativetabs != CreativeTabs.tabAllSearch && creativetabs != CreativeTabs.tabInventory) ++ if (creativetabs != CreativeTabs.field_78027_g && creativetabs != CreativeTabs.field_78036_m) + { + return; + } @@ -222,44 +222,44 @@ + this.func_147051_a(creativetabs); - if (creativetabs == CreativeTabs.tabInventory) + if (creativetabs == CreativeTabs.field_78036_m) @@ -667,6 +743,14 @@ protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_) { + if (p_147049_1_.getTabPage() != tabPage) + { -+ if (p_147049_1_ != CreativeTabs.tabAllSearch && p_147049_1_ != CreativeTabs.tabInventory) ++ if (p_147049_1_ != CreativeTabs.field_78027_g && p_147049_1_ != CreativeTabs.field_78036_m) + { + return false; + } + } + - int i = p_147049_1_.getTabColumn(); + int i = p_147049_1_.func_78020_k(); int j = 28 * i; int k = 0; @@ -763,6 +847,8 @@ } - GlStateManager.disableLighting(); -+ GlStateManager.color(1F, 1F, 1F); //Forge: Reset color in case Items change it. -+ GlStateManager.enableBlend(); //Forge: Make sure blend is enabled else tabs show a white border. - this.drawTexturedModalRect(l, i1, j, k, 28, j1); - this.zLevel = 100.0F; - this.itemRender.zLevel = 100.0F; + GlStateManager.func_179140_f(); ++ GlStateManager.func_179124_c(1F, 1F, 1F); //Forge: Reset color in case Items change it. ++ GlStateManager.func_179147_l(); //Forge: Make sure blend is enabled else tabs show a white border. + this.func_73729_b(l, i1, j, k, 28, j1); + this.field_73735_i = 100.0F; + this.field_146296_j.field_77023_b = 100.0F; @@ -789,6 +875,15 @@ { - this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter())); + this.field_146297_k.func_147108_a(new GuiStats(this, this.field_146297_k.field_71439_g.func_146107_m())); } + -+ if (button.id == 101) ++ if (p_146284_1_.field_146127_k == 101) + { + tabPage = Math.max(tabPage - 1, 0); + } -+ else if (button.id == 102) ++ else if (p_146284_1_.field_146127_k == 102) + { + tabPage = Math.min(tabPage + 1, maxPages); + } } - public int getSelectedTabIndex() + public int func_147056_g() diff --git a/patches/minecraft/net/minecraft/client/model/ModelBase.java.patch b/patches/minecraft/net/minecraft/client/model/ModelBase.java.patch index 4f3c8aede..04667710a 100644 --- a/patches/minecraft/net/minecraft/client/model/ModelBase.java.patch +++ b/patches/minecraft/net/minecraft/client/model/ModelBase.java.patch @@ -7,4 +7,4 @@ -@SideOnly(Side.CLIENT) public abstract class ModelBase { - public float swingProgress; + public float field_78095_p; diff --git a/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch b/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch index 5b0a3f1d0..d91355e16 100644 --- a/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch +++ b/patches/minecraft/net/minecraft/client/model/ModelBox.java.patch @@ -7,12 +7,12 @@ -@SideOnly(Side.CLIENT) public class ModelBox { - private PositionTextureVertex[] vertexPositions; + private PositionTextureVertex[] field_78253_h; @@ -81,6 +80,7 @@ } } + @SideOnly(Side.CLIENT) - public void render(WorldRenderer p_178780_1_, float p_178780_2_) + public void func_178780_a(WorldRenderer p_178780_1_, float p_178780_2_) { - for (int i = 0; i < this.quadList.length; ++i) + for (int i = 0; i < this.field_78254_i.length; ++i) diff --git a/patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch b/patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch index 2e3e1f197..77e0a42cb 100644 --- a/patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/model/ModelRenderer.java.patch @@ -7,36 +7,36 @@ -@SideOnly(Side.CLIENT) public class ModelRenderer { - public float textureWidth; + public float field_78801_a; @@ -109,6 +108,7 @@ - this.rotationPointZ = p_78793_3_; + this.field_78798_e = p_78793_3_; } + @SideOnly(Side.CLIENT) - public void render(float p_78785_1_) + public void func_78785_a(float p_78785_1_) { - if (!this.isHidden) + if (!this.field_78807_k) @@ -190,6 +190,7 @@ } } + @SideOnly(Side.CLIENT) - public void renderWithRotation(float p_78791_1_) + public void func_78791_b(float p_78791_1_) { - if (!this.isHidden) + if (!this.field_78807_k) @@ -225,6 +226,7 @@ } } + @SideOnly(Side.CLIENT) - public void postRender(float p_78794_1_) + public void func_78794_c(float p_78794_1_) { - if (!this.isHidden) + if (!this.field_78807_k) @@ -266,6 +268,7 @@ } } + @SideOnly(Side.CLIENT) - private void compileDisplayList(float p_78788_1_) + private void func_78788_d(float p_78788_1_) { - this.displayList = GLAllocation.generateDisplayLists(1); + this.field_78811_r = GLAllocation.func_74526_a(1); diff --git a/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch b/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch index c3d2571d6..dbe66e303 100644 --- a/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch +++ b/patches/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch @@ -10,4 +10,4 @@ -@SideOnly(Side.CLIENT) public class PositionTextureVertex { - public Vec3 vector3D; + public Vec3 field_78243_a; diff --git a/patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch b/patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch index 321941a6b..ea7d9cd31 100644 --- a/patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch +++ b/patches/minecraft/net/minecraft/client/model/TexturedQuad.java.patch @@ -10,4 +10,4 @@ -@SideOnly(Side.CLIENT) public class TexturedQuad { - public PositionTextureVertex[] vertexPositions; + public PositionTextureVertex[] field_78239_a; diff --git a/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch index dd87a5fdd..feb70661e 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java +++ ../src-work/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java @@ -55,6 +55,7 @@ - Chunk chunk = new Chunk(this.worldObj, p_73158_1_, p_73158_2_); - this.chunkMapping.add(ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_), chunk); - this.chunkListing.add(chunk); + Chunk chunk = new Chunk(this.field_73235_d, p_73158_1_, p_73158_2_); + this.field_73236_b.func_76163_a(ChunkCoordIntPair.func_77272_a(p_73158_1_, p_73158_2_), chunk); + this.field_73237_c.add(chunk); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(chunk)); - chunk.setChunkLoaded(true); + chunk.func_177417_c(true); return chunk; } diff --git a/patches/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch index d19712b43..fbd519d25 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java +++ ../src-work/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java @@ -67,7 +67,7 @@ - inetaddress = InetAddress.getByName(ip); - GuiConnecting.this.networkManager = NetworkManager.func_181124_a(inetaddress, port, GuiConnecting.this.mc.gameSettings.func_181148_f()); - GuiConnecting.this.networkManager.setNetHandler(new NetHandlerLoginClient(GuiConnecting.this.networkManager, GuiConnecting.this.mc, GuiConnecting.this.previousGuiScreen)); -- GuiConnecting.this.networkManager.sendPacket(new C00Handshake(47, ip, port, EnumConnectionState.LOGIN)); -+ GuiConnecting.this.networkManager.sendPacket(new C00Handshake(47, ip, port, EnumConnectionState.LOGIN, true)); - GuiConnecting.this.networkManager.sendPacket(new C00PacketLoginStart(GuiConnecting.this.mc.getSession().getProfile())); + inetaddress = InetAddress.getByName(p_146367_1_); + GuiConnecting.this.field_146371_g = NetworkManager.func_181124_a(inetaddress, p_146367_2_, GuiConnecting.this.field_146297_k.field_71474_y.func_181148_f()); + GuiConnecting.this.field_146371_g.func_150719_a(new NetHandlerLoginClient(GuiConnecting.this.field_146371_g, GuiConnecting.this.field_146297_k, GuiConnecting.this.field_146374_i)); +- GuiConnecting.this.field_146371_g.func_179290_a(new C00Handshake(47, p_146367_1_, p_146367_2_, EnumConnectionState.LOGIN)); ++ GuiConnecting.this.field_146371_g.func_179290_a(new C00Handshake(47, p_146367_1_, p_146367_2_, EnumConnectionState.LOGIN, true)); + GuiConnecting.this.field_146371_g.func_179290_a(new C00PacketLoginStart(GuiConnecting.this.field_146297_k.func_110432_I().func_148256_e())); } catch (UnknownHostException unknownhostexception) diff --git a/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch index 4193c9878..d571ffad0 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch @@ -4,66 +4,66 @@ } } -+ ItemStack stack = mc.thePlayer.getCurrentEquippedItem(); -+ if (stack != null && stack.getItem() != null && stack.getItem().onBlockStartBreak(stack, pos, mc.thePlayer)) ++ ItemStack stack = field_78776_a.field_71439_g.func_71045_bC(); ++ if (stack != null && stack.func_77973_b() != null && stack.func_77973_b().onBlockStartBreak(stack, p_178888_1_, field_78776_a.field_71439_g)) + { + return false; + } + - if (this.currentGameType.isCreative() && this.mc.thePlayer.getHeldItem() != null && this.mc.thePlayer.getHeldItem().getItem() instanceof ItemSword) + if (this.field_78779_k.func_77145_d() && this.field_78776_a.field_71439_g.func_70694_bm() != null && this.field_78776_a.field_71439_g.func_70694_bm().func_77973_b() instanceof ItemSword) { return false; @@ -128,7 +134,7 @@ else { - world.playAuxSFX(2001, pos, Block.getStateId(iblockstate)); -- boolean flag = world.setBlockToAir(pos); -+ boolean flag = block1.removedByPlayer(world, pos, mc.thePlayer, false); + world.func_175718_b(2001, p_178888_1_, Block.func_176210_f(iblockstate)); +- boolean flag = world.func_175698_g(p_178888_1_); ++ boolean flag = block1.removedByPlayer(world, p_178888_1_, field_78776_a.field_71439_g, false); if (flag) { @@ -356,11 +362,19 @@ { - if (this.currentGameType != WorldSettings.GameType.SPECTATOR) + if (this.field_78779_k != WorldSettings.GameType.SPECTATOR) { + + if (p_178890_3_ != null && -+ p_178890_3_.getItem() != null && -+ p_178890_3_.getItem().onItemUseFirst(p_178890_3_, p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2)) ++ p_178890_3_.func_77973_b() != null && ++ p_178890_3_.func_77973_b().onItemUseFirst(p_178890_3_, p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2)) + { + return true; + } + - IBlockState iblockstate = p_178890_2_.getBlockState(p_178890_4_); + IBlockState iblockstate = p_178890_2_.func_180495_p(p_178890_4_); -- if ((!p_178890_1_.isSneaking() || p_178890_1_.getHeldItem() == null) && iblockstate.getBlock().onBlockActivated(p_178890_2_, p_178890_4_, iblockstate, p_178890_1_, p_178890_5_, f, f1, f2)) -+ if ((!p_178890_1_.isSneaking() || p_178890_1_.getHeldItem() == null || p_178890_1_.getHeldItem().getItem().doesSneakBypassUse(p_178890_2_, p_178890_4_, p_178890_1_))) +- if ((!p_178890_1_.func_70093_af() || p_178890_1_.func_70694_bm() == null) && iblockstate.func_177230_c().func_180639_a(p_178890_2_, p_178890_4_, iblockstate, p_178890_1_, p_178890_5_, f, f1, f2)) ++ if ((!p_178890_1_.func_70093_af() || p_178890_1_.func_70694_bm() == null || p_178890_1_.func_70694_bm().func_77973_b().doesSneakBypassUse(p_178890_2_, p_178890_4_, p_178890_1_))) { - flag = true; -+ flag = iblockstate.getBlock().onBlockActivated(p_178890_2_, p_178890_4_, iblockstate, p_178890_1_, p_178890_5_, f, f1, f2); ++ flag = iblockstate.func_177230_c().func_180639_a(p_178890_2_, p_178890_4_, iblockstate, p_178890_1_, p_178890_5_, f, f1, f2); } - if (!flag && p_178890_3_ != null && p_178890_3_.getItem() instanceof ItemBlock) + if (!flag && p_178890_3_ != null && p_178890_3_.func_77973_b() instanceof ItemBlock) @@ -393,7 +407,9 @@ } else { -- return p_178890_3_.onItemUse(p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2); -+ if (!p_178890_3_.onItemUse(p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2)) return false; -+ if (p_178890_3_.stackSize <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_178890_1_, p_178890_3_); +- return p_178890_3_.func_179546_a(p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2); ++ if (!p_178890_3_.func_179546_a(p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2)) return false; ++ if (p_178890_3_.field_77994_a <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_178890_1_, p_178890_3_); + return true; } } else @@ -420,9 +436,10 @@ { - playerIn.inventory.mainInventory[playerIn.inventory.currentItem] = itemstack; + p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = itemstack; -- if (itemstack.stackSize == 0) -+ if (itemstack.stackSize <= 0) +- if (itemstack.field_77994_a == 0) ++ if (itemstack.field_77994_a <= 0) { - playerIn.inventory.mainInventory[playerIn.inventory.currentItem] = null; -+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(playerIn, itemstack); + p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = null; ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_78769_1_, itemstack); } return true; diff --git a/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch b/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch index a0e81d054..0996e6ecd 100644 --- a/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch +++ b/patches/minecraft/net/minecraft/client/multiplayer/WorldClient.java.patch @@ -1,17 +1,17 @@ --- ../src-base/minecraft/net/minecraft/client/multiplayer/WorldClient.java +++ ../src-work/minecraft/net/minecraft/client/multiplayer/WorldClient.java @@ -52,12 +52,13 @@ - super(new SaveHandlerMP(), new WorldInfo(p_i45063_2_, "MpServer"), WorldProvider.getProviderForDimension(p_i45063_3_), p_i45063_5_, true); - this.sendQueue = p_i45063_1_; - this.getWorldInfo().setDifficulty(p_i45063_4_); -- this.setSpawnPoint(new BlockPos(8, 64, 8)); - this.provider.registerWorld(this); -+ this.setSpawnPoint(new BlockPos(8, 64, 8)); //Forge: Moved below registerWorld to prevent NPE in our redirect. - this.chunkProvider = this.createChunkProvider(); - this.mapStorage = new SaveDataMemoryStorage(); - this.calculateInitialSkylight(); - this.calculateInitialWeather(); + super(new SaveHandlerMP(), new WorldInfo(p_i45063_2_, "MpServer"), WorldProvider.func_76570_a(p_i45063_3_), p_i45063_5_, true); + this.field_73035_a = p_i45063_1_; + this.func_72912_H().func_176144_a(p_i45063_4_); +- this.func_175652_B(new BlockPos(8, 64, 8)); + this.field_73011_w.func_76558_a(this); ++ this.func_175652_B(new BlockPos(8, 64, 8)); //Forge: Moved below registerWorld to prevent NPE in our redirect. + this.field_73020_y = this.func_72970_h(); + this.field_72988_C = new SaveDataMemoryStorage(); + this.func_72966_v(); + this.func_72947_a(); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(this)); } - public void tick() + public void func_72835_b() diff --git a/patches/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java.patch b/patches/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java.patch index e1acbc07d..a09e9fe7b 100644 --- a/patches/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java.patch +++ b/patches/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java @@ -23,6 +23,7 @@ - public void processHandshake(C00Handshake packetIn) + public void func_147383_a(C00Handshake p_147383_1_) { -+ if (!net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerHandshake(packetIn, this.networkManager)) return; - this.networkManager.setConnectionState(packetIn.getRequestedState()); - this.networkManager.setNetHandler(new NetHandlerLoginServer(this.mcServer, this.networkManager)); ++ if (!net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerHandshake(p_147383_1_, this.field_147384_b)) return; + this.field_147384_b.func_150723_a(p_147383_1_.func_149594_c()); + this.field_147384_b.func_150719_a(new NetHandlerLoginServer(this.field_147385_a, this.field_147384_b)); } diff --git a/patches/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch b/patches/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch index 2c10876e5..445652888 100644 --- a/patches/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch +++ b/patches/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java.patch @@ -2,13 +2,13 @@ +++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java @@ -104,7 +104,10 @@ { - this.gameProfile = packetIn.getProfile(); - this.networkManager.setConnectionState(EnumConnectionState.PLAY); -- this.networkManager.setNetHandler(new NetHandlerPlayClient(this.mc, this.previousGuiScreen, this.networkManager, this.gameProfile)); -+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlClientHandshake(this.networkManager); -+ NetHandlerPlayClient nhpc = new NetHandlerPlayClient(this.mc, this.previousGuiScreen, this.networkManager, this.gameProfile); -+ this.networkManager.setNetHandler(nhpc); + this.field_175091_e = p_147390_1_.func_179730_a(); + this.field_147393_d.func_150723_a(EnumConnectionState.PLAY); +- this.field_147393_d.func_150719_a(new NetHandlerPlayClient(this.field_147394_b, this.field_147395_c, this.field_147393_d, this.field_175091_e)); ++ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlClientHandshake(this.field_147393_d); ++ NetHandlerPlayClient nhpc = new NetHandlerPlayClient(this.field_147394_b, this.field_147395_c, this.field_147393_d, this.field_175091_e); ++ this.field_147393_d.func_150719_a(nhpc); + net.minecraftforge.fml.client.FMLClientHandler.instance().setPlayClient(nhpc); } - public void onDisconnect(IChatComponent reason) + public void func_147231_a(IChatComponent p_147231_1_) diff --git a/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch b/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch index 6a68a7639..4fa630f5f 100644 --- a/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch +++ b/patches/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch @@ -2,51 +2,51 @@ +++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java @@ -246,7 +246,7 @@ { - PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); - this.gameController.playerController = new PlayerControllerMP(this.gameController, this); -- this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler); -+ this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.get(getNetworkManager()).getOverrideDimension(packetIn), packetIn.getDifficulty(), this.gameController.mcProfiler); - this.gameController.gameSettings.difficulty = packetIn.getDifficulty(); - this.gameController.loadWorld(this.clientWorldController); - this.gameController.thePlayer.dimension = packetIn.getDimension(); + PacketThreadUtil.func_180031_a(p_147282_1_, this, this.field_147299_f); + this.field_147299_f.field_71442_b = new PlayerControllerMP(this.field_147299_f, this); +- this.field_147300_g = new WorldClient(this, new WorldSettings(0L, p_147282_1_.func_149198_e(), false, p_147282_1_.func_149195_d(), p_147282_1_.func_149196_i()), p_147282_1_.func_149194_f(), p_147282_1_.func_149192_g(), this.field_147299_f.field_71424_I); ++ this.field_147300_g = new WorldClient(this, new WorldSettings(0L, p_147282_1_.func_149198_e(), false, p_147282_1_.func_149195_d(), p_147282_1_.func_149196_i()), net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.get(func_147298_b()).getOverrideDimension(p_147282_1_), p_147282_1_.func_149192_g(), this.field_147299_f.field_71424_I); + this.field_147299_f.field_71474_y.field_74318_M = p_147282_1_.func_149192_g(); + this.field_147299_f.func_71403_a(this.field_147300_g); + this.field_147299_f.field_71439_g.field_71093_bK = p_147282_1_.func_149194_f(); @@ -750,14 +750,16 @@ - public void handleChat(S02PacketChat packetIn) + public void func_147251_a(S02PacketChat p_147251_1_) { - PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); -+ net.minecraft.util.IChatComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(packetIn.func_179841_c(), packetIn.func_148915_c()); + PacketThreadUtil.func_180031_a(p_147251_1_, this, this.field_147299_f); ++ net.minecraft.util.IChatComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(p_147251_1_.func_179841_c(), p_147251_1_.func_148915_c()); + if (message == null) return; - if (packetIn.func_179841_c() == 2) + if (p_147251_1_.func_179841_c() == 2) { -- this.gameController.ingameGUI.func_175188_a(packetIn.func_148915_c(), false); -+ this.gameController.ingameGUI.func_175188_a(message, false); +- this.field_147299_f.field_71456_v.func_175188_a(p_147251_1_.func_148915_c(), false); ++ this.field_147299_f.field_71456_v.func_175188_a(message, false); } else { -- this.gameController.ingameGUI.getChatGUI().printChatMessage(packetIn.func_148915_c()); -+ this.gameController.ingameGUI.getChatGUI().printChatMessage(message); +- this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(p_147251_1_.func_148915_c()); ++ this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(message); } } @@ -808,6 +810,11 @@ - float f = (float)(packetIn.func_149028_l() * 360) / 256.0F; - float f1 = (float)(packetIn.func_149030_m() * 360) / 256.0F; - EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.createEntityByID(packetIn.func_149025_e(), this.gameController.theWorld); + float f = (float)(p_147281_1_.func_149028_l() * 360) / 256.0F; + float f1 = (float)(p_147281_1_.func_149030_m() * 360) / 256.0F; + EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.func_75616_a(p_147281_1_.func_149025_e(), this.field_147299_f.field_71441_e); + if (entitylivingbase == null) + { -+ net.minecraftforge.fml.common.FMLLog.info("Server attempted to spawn an unknown entity using ID: {0} at ({1}, {2}, {3}) Skipping!", packetIn.func_149025_e(), d0, d1, d2); ++ net.minecraftforge.fml.common.FMLLog.info("Server attempted to spawn an unknown entity using ID: {0} at ({1}, {2}, {3}) Skipping!", p_147281_1_.func_149025_e(), d0, d1, d2); + return; + } - entitylivingbase.serverPosX = packetIn.func_149023_f(); - entitylivingbase.serverPosY = packetIn.func_149034_g(); - entitylivingbase.serverPosZ = packetIn.func_149029_h(); + entitylivingbase.field_70118_ct = p_147281_1_.func_149023_f(); + entitylivingbase.field_70117_cu = p_147281_1_.func_149034_g(); + entitylivingbase.field_70116_cv = p_147281_1_.func_149029_h(); @@ -1133,6 +1140,10 @@ { - tileentity.readFromNBT(packetIn.getNbtCompound()); + tileentity.func_145839_a(p_147273_1_.func_148857_g()); } + else + { -+ tileentity.onDataPacket(netManager, packetIn); ++ tileentity.onDataPacket(field_147302_e, p_147273_1_); + } } } @@ -55,8 +55,8 @@ if (entity instanceof EntityLivingBase) { -- PotionEffect potioneffect = new PotionEffect(packetIn.func_149427_e(), packetIn.func_180755_e(), packetIn.func_149428_f(), false, packetIn.func_179707_f()); -+ PotionEffect potioneffect = new PotionEffect(packetIn.func_149427_e() & 0xff, packetIn.func_180755_e(), packetIn.func_149428_f(), false, packetIn.func_179707_f()); - potioneffect.setPotionDurationMax(packetIn.func_149429_c()); - ((EntityLivingBase)entity).addPotionEffect(potioneffect); +- PotionEffect potioneffect = new PotionEffect(p_147260_1_.func_149427_e(), p_147260_1_.func_180755_e(), p_147260_1_.func_149428_f(), false, p_147260_1_.func_179707_f()); ++ PotionEffect potioneffect = new PotionEffect(p_147260_1_.func_149427_e() & 0xff, p_147260_1_.func_180755_e(), p_147260_1_.func_149428_f(), false, p_147260_1_.func_179707_f()); + potioneffect.func_100012_b(p_147260_1_.func_149429_c()); + ((EntityLivingBase)entity).func_70690_d(potioneffect); } diff --git a/patches/minecraft/net/minecraft/client/network/OldServerPinger.java.patch b/patches/minecraft/net/minecraft/client/network/OldServerPinger.java.patch index 5631206e3..d7aad9ec1 100644 --- a/patches/minecraft/net/minecraft/client/network/OldServerPinger.java.patch +++ b/patches/minecraft/net/minecraft/client/network/OldServerPinger.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/client/network/OldServerPinger.java +++ ../src-work/minecraft/net/minecraft/client/network/OldServerPinger.java @@ -150,6 +150,7 @@ - server.setBase64EncodedIconData((String)null); + p_147224_1_.func_147407_a((String)null); } -+ net.minecraftforge.fml.client.FMLClientHandler.instance().bindServerListData(server, serverstatusresponse); - this.field_175092_e = Minecraft.getSystemTime(); - networkmanager.sendPacket(new C01PacketPing(this.field_175092_e)); ++ net.minecraftforge.fml.client.FMLClientHandler.instance().bindServerListData(p_147224_1_, serverstatusresponse); + this.field_175092_e = Minecraft.func_71386_F(); + networkmanager.func_179290_a(new C01PacketPing(this.field_175092_e)); this.field_147403_d = true; diff --git a/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch b/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch index 3acadd6a8..08e6f7261 100644 --- a/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch @@ -2,20 +2,20 @@ +++ ../src-work/minecraft/net/minecraft/client/particle/EffectRenderer.java @@ -133,6 +133,7 @@ - public void addEffect(EntityFX p_78873_1_) + public void func_78873_a(EntityFX p_78873_1_) { + if (p_78873_1_ == null) return; //Forge: Prevent modders from being bad and adding nulls causing untraceable NPEs. - int i = p_78873_1_.getFXLayer(); + int i = p_78873_1_.func_70537_b(); int j = p_78873_1_.func_174838_j() != 1.0F ? 0 : 1; @@ -351,7 +352,7 @@ public void func_180533_a(BlockPos p_180533_1_, IBlockState p_180533_2_) { -- if (p_180533_2_.getBlock().getMaterial() != Material.air) -+ if (!p_180533_2_.getBlock().isAir(worldObj, p_180533_1_) && !p_180533_2_.getBlock().addDestroyEffects(worldObj, p_180533_1_, this)) +- if (p_180533_2_.func_177230_c().func_149688_o() != Material.field_151579_a) ++ if (!p_180533_2_.func_177230_c().isAir(field_78878_a, p_180533_1_) && !p_180533_2_.func_177230_c().addDestroyEffects(field_78878_a, p_180533_1_, this)) { - p_180533_2_ = p_180533_2_.getBlock().getActualState(p_180533_2_, this.worldObj, p_180533_1_); + p_180533_2_ = p_180533_2_.func_177230_c().func_176221_a(p_180533_2_, this.field_78878_a, p_180533_1_); int i = 4; @@ -457,4 +458,13 @@ @@ -24,10 +24,10 @@ + + public void addBlockHitEffects(BlockPos pos, net.minecraft.util.MovingObjectPosition target) + { -+ Block block = worldObj.getBlockState(pos).getBlock(); -+ if (block != null && !block.addHitEffects(worldObj, target, this)) ++ Block block = field_78878_a.func_180495_p(pos).func_177230_c(); ++ if (block != null && !block.addHitEffects(field_78878_a, target, this)) + { -+ addBlockHitEffects(pos, target.sideHit); ++ func_180532_a(pos, target.field_178784_b); + } + } } diff --git a/patches/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch b/patches/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch index ab5266c3f..72ea50b40 100644 --- a/patches/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch @@ -2,17 +2,17 @@ +++ ../src-work/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java @@ -24,7 +24,7 @@ { - private BlockModelShapes blockModelShapes; - private final GameSettings gameSettings; -- private final BlockModelRenderer blockModelRenderer = new BlockModelRenderer(); -+ private final BlockModelRenderer blockModelRenderer = new net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer(); - private final ChestRenderer chestRenderer = new ChestRenderer(); - private final BlockFluidRenderer fluidRenderer = new BlockFluidRenderer(); + private BlockModelShapes field_175028_a; + private final GameSettings field_175026_b; +- private final BlockModelRenderer field_175027_c = new BlockModelRenderer(); ++ private final BlockModelRenderer field_175027_c = new net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer(); + private final ChestRenderer field_175024_d = new ChestRenderer(); + private final BlockFluidRenderer field_175025_e = new BlockFluidRenderer(); @@ -48,6 +48,24 @@ { - p_175020_1_ = block.getActualState(p_175020_1_, p_175020_4_, p_175020_2_); - IBakedModel ibakedmodel = this.blockModelShapes.getModelForState(p_175020_1_); + p_175020_1_ = block.func_176221_a(p_175020_1_, p_175020_4_, p_175020_2_); + IBakedModel ibakedmodel = this.field_175028_a.func_178125_b(p_175020_1_); + + if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartBlockModel) + { @@ -24,18 +24,18 @@ + net.minecraftforge.client.ForgeHooksClient.setRenderLayer(layer); + + IBakedModel targetLayer = ((net.minecraftforge.client.model.ISmartBlockModel)ibakedmodel).handleBlockState(extendedState); -+ IBakedModel damageModel = (new SimpleBakedModel.Builder(targetLayer, p_175020_3_)).makeBakedModel(); -+ this.blockModelRenderer.renderModel(p_175020_4_, damageModel, p_175020_1_, p_175020_2_, Tessellator.getInstance().getWorldRenderer()); ++ IBakedModel damageModel = (new SimpleBakedModel.Builder(targetLayer, p_175020_3_)).func_177645_b(); ++ this.field_175027_c.func_178259_a(p_175020_4_, damageModel, p_175020_1_, p_175020_2_, Tessellator.func_178181_a().func_178180_c()); + } + } + return; + } + - IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(ibakedmodel, p_175020_3_)).makeBakedModel(); - this.blockModelRenderer.renderModel(p_175020_4_, ibakedmodel1, p_175020_1_, p_175020_2_, Tessellator.getInstance().getWorldRenderer()); + IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(ibakedmodel, p_175020_3_)).func_177645_b(); + this.field_175027_c.func_178259_a(p_175020_4_, ibakedmodel1, p_175020_1_, p_175020_2_, Tessellator.func_178181_a().func_178180_c()); } @@ -128,6 +146,12 @@ - ibakedmodel = ((WeightedBakedModel)ibakedmodel).getAlternativeModel(MathHelper.getPositionRandom(p_175022_3_)); + ibakedmodel = ((WeightedBakedModel)ibakedmodel).func_177564_a(MathHelper.func_180186_a(p_175022_3_)); } + if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartBlockModel) diff --git a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch index 6195c804c..ea7e48861 100644 --- a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch @@ -4,172 +4,172 @@ if (d3 < d2 || d2 == 0.0D) { -- if (entity1 == entity.ridingEntity) -+ if (entity1 == entity.ridingEntity && !entity.canRiderInteract()) +- if (entity1 == entity.field_70154_o) ++ if (entity1 == entity.field_70154_o && !entity.canRiderInteract()) { if (d2 == 0.0D) { @@ -576,14 +576,8 @@ { BlockPos blockpos = new BlockPos(entity); - IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos); -- Block block = iblockstate.getBlock(); -+ net.minecraftforge.client.ForgeHooksClient.orientBedCamera(this.mc.theWorld, blockpos, iblockstate, entity); + IBlockState iblockstate = this.field_78531_r.field_71441_e.func_180495_p(blockpos); +- Block block = iblockstate.func_177230_c(); ++ net.minecraftforge.client.ForgeHooksClient.orientBedCamera(this.field_78531_r.field_71441_e, blockpos, iblockstate, entity); -- if (block == Blocks.bed) +- if (block == Blocks.field_150324_C) - { -- int j = ((EnumFacing)iblockstate.getValue(BlockBed.FACING)).getHorizontalIndex(); -- GlStateManager.rotate((float)(j * 90), 0.0F, 1.0F, 0.0F); +- int j = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_176387_N)).func_176736_b(); +- GlStateManager.func_179114_b((float)(j * 90), 0.0F, 1.0F, 0.0F); - } - - GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F); - GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * p_78467_1_, -1.0F, 0.0F, 0.0F); + GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F); + GlStateManager.func_179114_b(entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_, -1.0F, 0.0F, 0.0F); } @@ -650,17 +644,20 @@ - if (!this.mc.gameSettings.debugCamEnable) + if (!this.field_78531_r.field_71474_y.field_74325_U) { -- GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * p_78467_1_, 1.0F, 0.0F, 0.0F); +- GlStateManager.func_179114_b(entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_, 1.0F, 0.0F, 0.0F); - -+ float yaw = entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * p_78467_1_ + 180.0F; -+ float pitch = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * p_78467_1_; ++ float yaw = entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F; ++ float pitch = entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_; + float roll = 0.0F; if (entity instanceof EntityAnimal) { EntityAnimal entityanimal = (EntityAnimal)entity; -- GlStateManager.rotate(entityanimal.prevRotationYawHead + (entityanimal.rotationYawHead - entityanimal.prevRotationYawHead) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F); -+ yaw = entityanimal.prevRotationYawHead + (entityanimal.rotationYawHead - entityanimal.prevRotationYawHead) * p_78467_1_ + 180.0F; +- GlStateManager.func_179114_b(entityanimal.field_70758_at + (entityanimal.field_70759_as - entityanimal.field_70758_at) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F); ++ yaw = entityanimal.field_70758_at + (entityanimal.field_70759_as - entityanimal.field_70758_at) * p_78467_1_ + 180.0F; } - else - { -- GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F); +- GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F); - } -+ Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entity, p_78467_1_); ++ Block block = ActiveRenderInfo.func_180786_a(this.field_78531_r.field_71441_e, entity, p_78467_1_); + net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup event = new net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup(this, entity, block, p_78467_1_, yaw, pitch, roll); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); -+ GlStateManager.rotate(event.roll, 0.0F, 0.0F, 1.0F); -+ GlStateManager.rotate(event.pitch, 1.0F, 0.0F, 0.0F); -+ GlStateManager.rotate(event.yaw, 0.0F, 1.0F, 0.0F); ++ GlStateManager.func_179114_b(event.roll, 0.0F, 0.0F, 1.0F); ++ GlStateManager.func_179114_b(event.pitch, 1.0F, 0.0F, 0.0F); ++ GlStateManager.func_179114_b(event.yaw, 0.0F, 1.0F, 0.0F); } - GlStateManager.translate(0.0F, -f, 0.0F); + GlStateManager.func_179109_b(0.0F, -f, 0.0F); @@ -1103,7 +1100,7 @@ try { -- this.mc.currentScreen.drawScreen(k1, l1, p_181560_1_); -+ net.minecraftforge.client.ForgeHooksClient.drawScreen(this.mc.currentScreen, k1, l1, p_181560_1_); +- this.field_78531_r.field_71462_r.func_73863_a(k1, l1, p_181560_1_); ++ net.minecraftforge.client.ForgeHooksClient.drawScreen(this.field_78531_r.field_71462_r, k1, l1, p_181560_1_); } catch (Throwable throwable) { @@ -1164,7 +1161,7 @@ - if (this.mc.playerController.getCurrentGameType() == WorldSettings.GameType.SPECTATOR) + if (this.field_78531_r.field_71442_b.func_178889_l() == WorldSettings.GameType.SPECTATOR) { -- flag = block.hasTileEntity() && this.mc.theWorld.getTileEntity(blockpos) instanceof IInventory; -+ flag = block.hasTileEntity(this.mc.theWorld.getBlockState(blockpos)) && this.mc.theWorld.getTileEntity(blockpos) instanceof IInventory; +- flag = block.func_149716_u() && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory; ++ flag = block.hasTileEntity(this.field_78531_r.field_71441_e.func_180495_p(blockpos)) && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory; } else { @@ -1314,7 +1311,9 @@ - GlStateManager.pushMatrix(); - RenderHelper.enableStandardItemLighting(); - this.mc.mcProfiler.endStartSection("entities"); + GlStateManager.func_179094_E(); + RenderHelper.func_74519_b(); + this.field_78531_r.field_71424_I.func_76318_c("entities"); + net.minecraftforge.client.ForgeHooksClient.setRenderPass(0); - renderglobal.renderEntities(entity, icamera, partialTicks); + renderglobal.func_180446_a(entity, icamera, p_175068_2_); + net.minecraftforge.client.ForgeHooksClient.setRenderPass(0); - RenderHelper.disableStandardItemLighting(); - this.disableLightmap(); - GlStateManager.matrixMode(5888); + RenderHelper.func_74518_a(); + this.func_175072_h(); + GlStateManager.func_179128_n(5888); @@ -1326,6 +1325,7 @@ EntityPlayer entityplayer = (EntityPlayer)entity; - GlStateManager.disableAlpha(); - this.mc.mcProfiler.endStartSection("outline"); -+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, entityplayer.getHeldItem(), partialTicks)) - renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, partialTicks); - GlStateManager.enableAlpha(); + GlStateManager.func_179118_c(); + this.field_78531_r.field_71424_I.func_76318_c("outline"); ++ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.func_70694_bm(), p_175068_2_)) + renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_); + GlStateManager.func_179141_d(); } @@ -1339,6 +1339,7 @@ EntityPlayer entityplayer1 = (EntityPlayer)entity; - GlStateManager.disableAlpha(); - this.mc.mcProfiler.endStartSection("outline"); -+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer1, mc.objectMouseOver, 0, entityplayer1.getHeldItem(), partialTicks)) - renderglobal.drawSelectionBox(entityplayer1, this.mc.objectMouseOver, 0, partialTicks); - GlStateManager.enableAlpha(); + GlStateManager.func_179118_c(); + this.field_78531_r.field_71424_I.func_76318_c("outline"); ++ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer1, field_78531_r.field_71476_x, 0, entityplayer1.func_70694_bm(), p_175068_2_)) + renderglobal.func_72731_b(entityplayer1, this.field_78531_r.field_71476_x, 0, p_175068_2_); + GlStateManager.func_179141_d(); } @@ -1380,6 +1381,15 @@ - GlStateManager.shadeModel(7425); - this.mc.mcProfiler.endStartSection("translucent"); - renderglobal.renderBlockLayer(EnumWorldBlockLayer.TRANSLUCENT, (double)partialTicks, pass, entity); -+ if (!this.debugView) //Only render if render pass 0 happens as well. + GlStateManager.func_179103_j(7425); + this.field_78531_r.field_71424_I.func_76318_c("translucent"); + renderglobal.func_174977_a(EnumWorldBlockLayer.TRANSLUCENT, (double)p_175068_2_, p_175068_1_, entity); ++ if (!this.field_175078_W) //Only render if render pass 0 happens as well. + { -+ RenderHelper.enableStandardItemLighting(); -+ this.mc.mcProfiler.endStartSection("entities"); ++ RenderHelper.func_74519_b(); ++ this.field_78531_r.field_71424_I.func_76318_c("entities"); + net.minecraftforge.client.ForgeHooksClient.setRenderPass(1); -+ renderglobal.renderEntities(entity, icamera, partialTicks); ++ renderglobal.func_180446_a(entity, icamera, p_175068_2_); + net.minecraftforge.client.ForgeHooksClient.setRenderPass(-1); -+ RenderHelper.disableStandardItemLighting(); ++ RenderHelper.func_74518_a(); + } - GlStateManager.shadeModel(7424); - GlStateManager.depthMask(true); - GlStateManager.enableCull(); + GlStateManager.func_179103_j(7424); + GlStateManager.func_179132_a(true); + GlStateManager.func_179089_o(); @@ -1392,8 +1402,12 @@ - this.renderCloudsCheck(renderglobal, partialTicks, pass); + this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_); } -+ this.mc.mcProfiler.endStartSection("forge_render_last"); -+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(renderglobal, partialTicks); ++ this.field_78531_r.field_71424_I.func_76318_c("forge_render_last"); ++ net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(renderglobal, p_175068_2_); + - this.mc.mcProfiler.endStartSection("hand"); + this.field_78531_r.field_71424_I.func_76318_c("hand"); -+ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(renderglobal, partialTicks, pass)) - if (this.renderHand) ++ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(renderglobal, p_175068_2_, p_175068_1_)) + if (this.field_175074_C) { - GlStateManager.clear(256); + GlStateManager.func_179086_m(256); @@ -1505,6 +1519,13 @@ - protected void renderRainSnow(float partialTicks) + protected void func_78474_d(float p_78474_1_) { -+ net.minecraftforge.client.IRenderHandler renderer = this.mc.theWorld.provider.getWeatherRenderer(); ++ net.minecraftforge.client.IRenderHandler renderer = this.field_78531_r.field_71441_e.field_73011_w.getWeatherRenderer(); + if (renderer != null) + { -+ renderer.render(partialTicks, this.mc.theWorld, mc); ++ renderer.render(p_78474_1_, this.field_78531_r.field_71441_e, field_78531_r); + return; + } + - float f = this.mc.theWorld.getRainStrength(partialTicks); + float f = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_); if (f > 0.0F) @@ -1830,6 +1851,13 @@ - this.fogColorBlue = f7; + this.field_175081_S = f7; } -+ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, block, partialTicks, this.fogColorRed, this.fogColorGreen, this.fogColorBlue); ++ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, block, p_78466_1_, this.field_175080_Q, this.field_175082_R, this.field_175081_S); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); + -+ this.fogColorRed = event.red; -+ this.fogColorGreen = event.green; -+ this.fogColorBlue = event.blue; ++ this.field_175080_Q = event.red; ++ this.field_175082_R = event.green; ++ this.field_175081_S = event.blue; + - GlStateManager.clearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F); + GlStateManager.func_179082_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 0.0F); } @@ -1848,6 +1876,10 @@ - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entity, partialTicks); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + Block block = ActiveRenderInfo.func_180786_a(this.field_78531_r.field_71441_e, entity, p_78468_2_); -+ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, block, partialTicks, 0.1F); ++ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, block, p_78468_2_, 0.1F); + if (hook >= 0) -+ GlStateManager.setFogDensity(hook); ++ GlStateManager.func_179095_a(hook); + else - if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isPotionActive(Potion.blindness)) + if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(Potion.field_76440_q)) { float f1 = 5.0F; @@ -1925,6 +1957,7 @@ - GlStateManager.setFogStart(f * 0.05F); - GlStateManager.setFogEnd(Math.min(f, 192.0F) * 0.5F); + GlStateManager.func_179102_b(f * 0.05F); + GlStateManager.func_179153_c(Math.min(f, 192.0F) * 0.5F); } -+ net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, block, partialTicks, p_78468_1_, f); ++ net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, block, p_78468_2_, p_78468_1_, f); } - GlStateManager.enableColorMaterial(); + GlStateManager.func_179142_g(); diff --git a/patches/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch index 54170de87..fd3e46ca8 100644 --- a/patches/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java +++ ../src-work/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java @@ -80,6 +80,8 @@ - this.drawTexturedModalRect(i + 6, j + 7, 0 + i1 % 8 * 18, 198 + i1 / 8 * 18, 18, 18); + this.func_73729_b(i + 6, j + 7, 0 + i1 % 8 * 18, 198 + i1 / 8 * 18, 18, 18); } -+ potion.renderInventoryEffect(i, j, potioneffect, mc); ++ potion.renderInventoryEffect(i, j, potioneffect, field_146297_k); + if (!potion.shouldRenderInvText(potioneffect)) continue; - String s1 = I18n.format(potion.getName(), new Object[0]); + String s1 = I18n.func_135052_a(potion.func_76393_a(), new Object[0]); - if (potioneffect.getAmplifier() == 1) + if (potioneffect.func_76458_c() == 1) diff --git a/patches/minecraft/net/minecraft/client/renderer/ItemModelMesher.java.patch b/patches/minecraft/net/minecraft/client/renderer/ItemModelMesher.java.patch index deb8b5987..09c4a9878 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ItemModelMesher.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/ItemModelMesher.java.patch @@ -6,9 +6,9 @@ + if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartItemModel) + { -+ ibakedmodel = ((net.minecraftforge.client.model.ISmartItemModel)ibakedmodel).handleItemState(stack); ++ ibakedmodel = ((net.minecraftforge.client.model.ISmartItemModel)ibakedmodel).handleItemState(p_178089_1_); + } + if (ibakedmodel == null) { - ibakedmodel = this.modelManager.getMissingModel(); + ibakedmodel = this.field_178090_d.func_174951_a(); diff --git a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch index 601dcb350..9e4e3ebcd 100644 --- a/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch @@ -2,57 +2,57 @@ +++ ../src-work/minecraft/net/minecraft/client/renderer/ItemRenderer.java @@ -313,7 +313,7 @@ - if (this.itemToRender != null) + if (this.field_78453_b != null) { -- if (this.itemToRender.getItem() == Items.filled_map) -+ if (this.itemToRender.getItem() instanceof net.minecraft.item.ItemMap) +- if (this.field_78453_b.func_77973_b() == Items.field_151098_aY) ++ if (this.field_78453_b.func_77973_b() instanceof net.minecraft.item.ItemMap) { this.func_178097_a(abstractclientplayer, f2, f, f1); } @@ -365,6 +365,7 @@ - if (this.mc.thePlayer.isEntityInsideOpaqueBlock()) + if (this.field_78455_a.field_71439_g.func_70094_T()) { - IBlockState iblockstate = this.mc.theWorld.getBlockState(new BlockPos(this.mc.thePlayer)); -+ BlockPos overlayPos = new BlockPos(this.mc.thePlayer); - EntityPlayer entityplayer = this.mc.thePlayer; + IBlockState iblockstate = this.field_78455_a.field_71441_e.func_180495_p(new BlockPos(this.field_78455_a.field_71439_g)); ++ BlockPos overlayPos = new BlockPos(this.field_78455_a.field_71439_g); + EntityPlayer entityplayer = this.field_78455_a.field_71439_g; for (int i = 0; i < 8; ++i) @@ -378,11 +379,13 @@ - if (iblockstate1.getBlock().isVisuallyOpaque()) + if (iblockstate1.func_177230_c().func_176214_u()) { iblockstate = iblockstate1; + overlayPos = blockpos; } } - if (iblockstate.getBlock().getRenderType() != -1) + if (iblockstate.func_177230_c().func_149645_b() != -1) { -+ if (!net.minecraftforge.event.ForgeEventFactory.renderBlockOverlay(mc.thePlayer, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, iblockstate, overlayPos)) - this.func_178108_a(p_78447_1_, this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(iblockstate)); ++ if (!net.minecraftforge.event.ForgeEventFactory.renderBlockOverlay(field_78455_a.field_71439_g, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, iblockstate, overlayPos)) + this.func_178108_a(p_78447_1_, this.field_78455_a.func_175602_ab().func_175023_a().func_178122_a(iblockstate)); } } @@ -391,11 +394,13 @@ { - if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) + if (this.field_78455_a.field_71439_g.func_70055_a(Material.field_151586_h)) { -+ if (!net.minecraftforge.event.ForgeEventFactory.renderWaterOverlay(mc.thePlayer, p_78447_1_)) - this.renderWaterOverlayTexture(p_78447_1_); ++ if (!net.minecraftforge.event.ForgeEventFactory.renderWaterOverlay(field_78455_a.field_71439_g, p_78447_1_)) + this.func_78448_c(p_78447_1_); } - if (this.mc.thePlayer.isBurning()) + if (this.field_78455_a.field_71439_g.func_70027_ad()) { -+ if (!net.minecraftforge.event.ForgeEventFactory.renderFireOverlay(mc.thePlayer, p_78447_1_)) - this.renderFireInFirstPerson(p_78447_1_); ++ if (!net.minecraftforge.event.ForgeEventFactory.renderFireOverlay(field_78455_a.field_71439_g, p_78447_1_)) + this.func_78442_d(p_78447_1_); } } @@ -512,6 +517,12 @@ { - if (!this.itemToRender.getIsItemStackEqual(itemstack)) + if (!this.field_78453_b.func_179549_c(itemstack)) { -+ if (!this.itemToRender.getItem().shouldCauseReequipAnimation(this.itemToRender, itemstack, equippedItemSlot != entityplayer.inventory.currentItem)) ++ if (!this.field_78453_b.func_77973_b().shouldCauseReequipAnimation(this.field_78453_b, itemstack, field_78450_g != entityplayer.field_71071_by.field_70461_c)) + { -+ this.itemToRender = itemstack; -+ this.equippedItemSlot = entityplayer.inventory.currentItem; ++ this.field_78453_b = itemstack; ++ this.field_78450_g = entityplayer.field_71071_by.field_70461_c; + return; + } flag = true; diff --git a/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch b/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch index 385023ab0..98273ca48 100644 --- a/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/OpenGlHelper.java.patch @@ -1,14 +1,14 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java +++ ../src-work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java @@ -83,6 +83,10 @@ - public static int GL_ARRAY_BUFFER; - public static int GL_STATIC_DRAW; + public static int field_176089_P; + public static int field_148826_e; + /* Stores the last values sent into setLightmapTextureCoords */ + public static float lastBrightnessX = 0.0f; + public static float lastBrightnessY = 0.0f; + - public static void initializeTextures() + public static void func_77474_a() { ContextCapabilities contextcapabilities = GLContext.getCapabilities(); @@ -843,6 +847,12 @@ @@ -16,11 +16,11 @@ GL13.glMultiTexCoord2f(p_77475_0_, p_77475_1_, p_77475_2_); } + -+ if (p_77475_0_ == lightmapTexUnit) ++ if (p_77475_0_ == field_77476_b) + { + lastBrightnessX = p_77475_1_; + lastBrightnessY = p_77475_2_; + } } - public static void glBlendFunc(int p_148821_0_, int p_148821_1_, int p_148821_2_, int p_148821_3_) + public static void func_148821_a(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/RenderGlobal.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch index b16266d6c..395aa5466 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch @@ -2,116 +2,116 @@ +++ ../src-work/minecraft/net/minecraft/client/renderer/RenderGlobal.java @@ -525,8 +525,10 @@ - public void renderEntities(Entity p_180446_1_, ICamera p_180446_2_, float partialTicks) + public void func_180446_a(Entity p_180446_1_, ICamera p_180446_2_, float p_180446_3_) { + int pass = net.minecraftforge.client.MinecraftForgeClient.getRenderPass(); - if (this.renderEntitiesStartupCounter > 0) + if (this.field_72740_G > 0) { + if (pass > 0) return; - --this.renderEntitiesStartupCounter; + --this.field_72740_G; } else @@ -537,9 +539,12 @@ - this.theWorld.theProfiler.startSection("prepare"); - TileEntityRendererDispatcher.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRendererObj, this.mc.getRenderViewEntity(), partialTicks); - this.renderManager.cacheActiveRenderInfo(this.theWorld, this.mc.fontRendererObj, this.mc.getRenderViewEntity(), this.mc.pointedEntity, this.mc.gameSettings, partialTicks); + this.field_72769_h.field_72984_F.func_76320_a("prepare"); + TileEntityRendererDispatcher.field_147556_a.func_178470_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), p_180446_3_); + this.field_175010_j.func_180597_a(this.field_72769_h, this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_180446_3_); + if(pass == 0) + { - this.countEntitiesTotal = 0; - this.countEntitiesRendered = 0; - this.countEntitiesHidden = 0; + this.field_72748_H = 0; + this.field_72749_I = 0; + this.field_72750_J = 0; + } - Entity entity = this.mc.getRenderViewEntity(); - double d3 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks; - double d4 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partialTicks; + Entity entity = this.field_72777_q.func_175606_aa(); + double d3 = entity.field_70142_S + (entity.field_70165_t - entity.field_70142_S) * (double)p_180446_3_; + double d4 = entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_180446_3_; @@ -551,11 +556,15 @@ - this.mc.entityRenderer.enableLightmap(); - this.theWorld.theProfiler.endStartSection("global"); - List list = this.theWorld.getLoadedEntityList(); + this.field_72777_q.field_71460_t.func_180436_i(); + this.field_72769_h.field_72984_F.func_76318_c("global"); + List list = this.field_72769_h.func_72910_y(); + if (pass == 0) + { - this.countEntitiesTotal = list.size(); + this.field_72748_H = list.size(); + } - for (int i = 0; i < this.theWorld.weatherEffects.size(); ++i) + for (int i = 0; i < this.field_72769_h.field_73007_j.size(); ++i) { - Entity entity1 = (Entity)this.theWorld.weatherEffects.get(i); + Entity entity1 = (Entity)this.field_72769_h.field_73007_j.get(i); + if (!entity1.shouldRenderInPass(pass)) continue; - ++this.countEntitiesRendered; + ++this.field_72749_I; - if (entity1.isInRangeToRender3d(d0, d1, d2)) + if (entity1.func_145770_h(d0, d1, d2)) @@ -577,6 +586,7 @@ for (int j = 0; j < list.size(); ++j) { Entity entity3 = (Entity)list.get(j); + if (!entity3.shouldRenderInPass(pass)) continue; - boolean flag = this.mc.getRenderViewEntity() instanceof EntityLivingBase && ((EntityLivingBase)this.mc.getRenderViewEntity()).isPlayerSleeping(); - boolean flag1 = entity3.isInRangeToRender3d(d0, d1, d2) && (entity3.ignoreFrustumCheck || p_180446_2_.isBoundingBoxInFrustum(entity3.getEntityBoundingBox()) || entity3.riddenByEntity == this.mc.thePlayer) && entity3 instanceof EntityPlayer; + boolean flag = this.field_72777_q.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_72777_q.func_175606_aa()).func_70608_bn(); + boolean flag1 = entity3.func_145770_h(d0, d1, d2) && (entity3.field_70158_ak || p_180446_2_.func_78546_a(entity3.func_174813_aQ()) || entity3.field_70153_n == this.field_72777_q.field_71439_g) && entity3 instanceof EntityPlayer; @@ -626,6 +636,7 @@ } entity2 = (Entity)iterator.next(); + if (!entity2.shouldRenderInPass(pass)) continue; - flag2 = this.renderManager.shouldRender(entity2, p_180446_2_, d0, d1, d2) || entity2.riddenByEntity == this.mc.thePlayer; + flag2 = this.field_175010_j.func_178635_a(entity2, p_180446_2_, d0, d1, d2) || entity2.field_70153_n == this.field_72777_q.field_71439_g; if (!flag2) @@ -662,6 +673,7 @@ { for (TileEntity tileentity2 : list1) { -+ if (!tileentity2.shouldRenderInPass(pass) || !p_180446_2_.isBoundingBoxInFrustum(tileentity2.getRenderBoundingBox())) continue; - TileEntityRendererDispatcher.instance.renderTileEntity(tileentity2, partialTicks, -1); ++ if (!tileentity2.shouldRenderInPass(pass) || !p_180446_2_.func_78546_a(tileentity2.getRenderBoundingBox())) continue; + TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity2, p_180446_3_, -1); } } @@ -671,6 +683,7 @@ { for (TileEntity tileentity : this.field_181024_n) { -+ if (!tileentity.shouldRenderInPass(pass) || !p_180446_2_.isBoundingBoxInFrustum(tileentity.getRenderBoundingBox())) continue; - TileEntityRendererDispatcher.instance.renderTileEntity(tileentity, partialTicks, -1); ++ if (!tileentity.shouldRenderInPass(pass) || !p_180446_2_.func_78546_a(tileentity.getRenderBoundingBox())) continue; + TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, p_180446_3_, -1); } } @@ -700,7 +713,7 @@ - Block block = this.theWorld.getBlockState(blockpos).getBlock(); + Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c(); - if (tileentity1 != null && (block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull)) -+ if (tileentity1 != null && tileentity1.shouldRenderInPass(pass) && tileentity1.canRenderBreaking() && p_180446_2_.isBoundingBoxInFrustum(tileentity1.getRenderBoundingBox())) ++ if (tileentity1 != null && tileentity1.shouldRenderInPass(pass) && tileentity1.canRenderBreaking() && p_180446_2_.func_78546_a(tileentity1.getRenderBoundingBox())) { - TileEntityRendererDispatcher.instance.renderTileEntity(tileentity1, partialTicks, destroyblockprogress.getPartialBlockDamage()); + TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity1, p_180446_3_, destroyblockprogress.func_73106_e()); } @@ -1161,6 +1174,12 @@ - public void renderSky(float partialTicks, int pass) + public void func_174976_a(float p_174976_1_, int p_174976_2_) { -+ net.minecraftforge.client.IRenderHandler renderer = this.theWorld.provider.getSkyRenderer(); ++ net.minecraftforge.client.IRenderHandler renderer = this.field_72769_h.field_73011_w.getSkyRenderer(); + if (renderer != null) + { -+ renderer.render(partialTicks, theWorld, mc); ++ renderer.render(p_174976_1_, field_72769_h, field_72777_q); + return; + } - if (this.mc.theWorld.provider.getDimensionId() == 1) + if (this.field_72777_q.field_71441_e.field_73011_w.func_177502_q() == 1) { - this.renderSkyEnd(); + this.func_180448_r(); @@ -1378,6 +1397,12 @@ - public void renderClouds(float p_180447_1_, int p_180447_2_) + public void func_180447_b(float p_180447_1_, int p_180447_2_) { -+ net.minecraftforge.client.IRenderHandler renderer = this.mc.theWorld.provider.getCloudRenderer(); ++ net.minecraftforge.client.IRenderHandler renderer = this.field_72777_q.field_71441_e.field_73011_w.getCloudRenderer(); + if (renderer != null) + { -+ renderer.render(p_180447_1_, this.mc.theWorld, mc); ++ renderer.render(p_180447_1_, this.field_72777_q.field_71441_e, field_72777_q); + return; + } - if (this.mc.theWorld.provider.isSurfaceWorld()) + if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) { - if (this.mc.gameSettings.func_181147_e() == 2) + if (this.field_72777_q.field_71474_y.func_181147_e() == 2) @@ -1793,8 +1818,11 @@ - double d4 = (double)blockpos.getY() - d1; - double d5 = (double)blockpos.getZ() - d2; - Block block = this.theWorld.getBlockState(blockpos).getBlock(); -+ TileEntity te = this.theWorld.getTileEntity(blockpos); + double d4 = (double)blockpos.func_177956_o() - d1; + double d5 = (double)blockpos.func_177952_p() - d2; + Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c(); ++ TileEntity te = this.field_72769_h.func_175625_s(blockpos); + boolean hasBreak = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull; + if (!hasBreak) hasBreak = te != null && te.canRenderBreaking(); @@ -121,20 +121,20 @@ if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D) { @@ -1949,13 +1977,16 @@ - if (recordName != null) + if (p_174961_1_ != null) { - ItemRecord itemrecord = ItemRecord.getRecord(recordName); + ItemRecord itemrecord = ItemRecord.func_150926_b(p_174961_1_); + ResourceLocation resource = null; if (itemrecord != null) { - this.mc.ingameGUI.setRecordPlayingMessage(itemrecord.getRecordNameLocal()); -+ resource = itemrecord.getRecordResource(recordName); + this.field_72777_q.field_71456_v.func_73833_a(itemrecord.func_150927_i()); ++ resource = itemrecord.getRecordResource(p_174961_1_); } -- PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.create(new ResourceLocation(recordName), (float)blockPosIn.getX(), (float)blockPosIn.getY(), (float)blockPosIn.getZ()); -+ if (resource == null) resource = new ResourceLocation(recordName); -+ PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.create(resource, (float)blockPosIn.getX(), (float)blockPosIn.getY(), (float)blockPosIn.getZ()); - this.mapSoundPositions.put(blockPosIn, positionedsoundrecord); - this.mc.getSoundHandler().playSound(positionedsoundrecord); +- PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(new ResourceLocation(p_174961_1_), (float)p_174961_2_.func_177958_n(), (float)p_174961_2_.func_177956_o(), (float)p_174961_2_.func_177952_p()); ++ if (resource == null) resource = new ResourceLocation(p_174961_1_); ++ PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(resource, (float)p_174961_2_.func_177958_n(), (float)p_174961_2_.func_177956_o(), (float)p_174961_2_.func_177952_p()); + this.field_147593_P.put(p_174961_2_, positionedsoundrecord); + this.field_72777_q.func_147118_V().func_147682_a(positionedsoundrecord); } diff --git a/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch index 4e597ab6f..4b2f9e3c2 100644 --- a/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch @@ -6,7 +6,7 @@ + public void checkAndGrow() + { -+ this.func_181670_b(vertexFormat.getNextOffset()/* / 4 * 4 */); ++ this.func_181670_b(field_179011_q.func_177338_f()/* / 4 * 4 */); + } + @SideOnly(Side.CLIENT) diff --git a/patches/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch b/patches/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch index 2551f52b9..3102b6d98 100644 --- a/patches/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch @@ -6,41 +6,41 @@ { + // moved to VertexFormatElement.preDraw VertexFormatElement vertexformatelement = (VertexFormatElement)list.get(j); -- VertexFormatElement.EnumUsage vertexformatelement$enumusage = vertexformatelement.getUsage(); -- int k = vertexformatelement.getType().getGlConstant(); -- int l = vertexformatelement.getIndex(); +- VertexFormatElement.EnumUsage vertexformatelement$enumusage = vertexformatelement.func_177375_c(); +- int k = vertexformatelement.func_177367_b().func_177397_c(); +- int l = vertexformatelement.func_177369_e(); - bytebuffer.position(vertexformat.func_181720_d(j)); - - switch (vertexformatelement$enumusage) - { - case POSITION: -- GL11.glVertexPointer(vertexformatelement.getElementCount(), k, i, bytebuffer); +- GL11.glVertexPointer(vertexformatelement.func_177370_d(), k, i, bytebuffer); - GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); - break; - case UV: -- OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + l); -- GL11.glTexCoordPointer(vertexformatelement.getElementCount(), k, i, bytebuffer); +- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + l); +- GL11.glTexCoordPointer(vertexformatelement.func_177370_d(), k, i, bytebuffer); - GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); -- OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); +- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a); - break; - case COLOR: -- GL11.glColorPointer(vertexformatelement.getElementCount(), k, i, bytebuffer); +- GL11.glColorPointer(vertexformatelement.func_177370_d(), k, i, bytebuffer); - GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); - break; - case NORMAL: - GL11.glNormalPointer(k, i, bytebuffer); - GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY); - } -+ vertexformatelement.getUsage().preDraw(vertexformat, j, i, bytebuffer); ++ vertexformatelement.func_177375_c().preDraw(vertexformat, j, i, bytebuffer); } - GL11.glDrawArrays(p_181679_1_.getDrawMode(), 0, p_181679_1_.getVertexCount()); + GL11.glDrawArrays(p_181679_1_.func_178979_i(), 0, p_181679_1_.func_178989_h()); @@ -57,26 +34,8 @@ for (int j1 = list.size(); i1 < j1; ++i1) { VertexFormatElement vertexformatelement1 = (VertexFormatElement)list.get(i1); -- VertexFormatElement.EnumUsage vertexformatelement$enumusage1 = vertexformatelement1.getUsage(); -- int k1 = vertexformatelement1.getIndex(); +- VertexFormatElement.EnumUsage vertexformatelement$enumusage1 = vertexformatelement1.func_177375_c(); +- int k1 = vertexformatelement1.func_177369_e(); - - switch (vertexformatelement$enumusage1) - { @@ -48,19 +48,19 @@ - GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); - break; - case UV: -- OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + k1); +- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + k1); - GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); -- OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); +- OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a); - break; - case COLOR: - GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); -- GlStateManager.resetColor(); +- GlStateManager.func_179117_G(); - break; - case NORMAL: - GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); - } + // moved to VertexFormatElement.postDraw -+ vertexformatelement1.getUsage().postDraw(vertexformat, i1, i, bytebuffer); ++ vertexformatelement1.func_177375_c().postDraw(vertexformat, i1, i, bytebuffer); } } diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch index 97dc4cd38..656fce0df 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java.patch @@ -8,6 +8,6 @@ +public class BakedQuad implements net.minecraftforge.client.model.pipeline.IVertexProducer { + @Override public void pipe(net.minecraftforge.client.model.pipeline.IVertexConsumer consumer) { net.minecraftforge.client.model.pipeline.LightUtil.putBakedQuad(consumer, this); } - protected final int[] vertexData; - protected final int tintIndex; - protected final EnumFacing face; + protected final int[] field_178215_a; + protected final int field_178213_b; + protected final EnumFacing field_178214_c; diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch index a26f6c4b9..fb28a524d 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch @@ -1,68 +1,82 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java +++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java -@@ -20,6 +20,11 @@ +@@ -20,7 +20,12 @@ - public BakedQuad makeBakedQuad(Vector3f posFrom, Vector3f posTo, BlockPartFace face, TextureAtlasSprite sprite, EnumFacing facing, ModelRotation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) + public BakedQuad func_178414_a(Vector3f p_178414_1_, Vector3f p_178414_2_, BlockPartFace p_178414_3_, TextureAtlasSprite p_178414_4_, EnumFacing p_178414_5_, ModelRotation p_178414_6_, BlockPartRotation p_178414_7_, boolean p_178414_8_, boolean p_178414_9_) { -+ return makeBakedQuad(posFrom, posTo, face, sprite, facing, (net.minecraftforge.client.model.ITransformation)modelRotationIn, partRotation, uvLocked, shade); +- int[] aint = this.func_178405_a(p_178414_3_, p_178414_4_, p_178414_5_, this.func_178403_a(p_178414_1_, p_178414_2_), p_178414_6_, p_178414_7_, p_178414_8_, p_178414_9_); ++ return makeBakedQuad(p_178414_1_, p_178414_2_, p_178414_3_, p_178414_4_, p_178414_5_, (net.minecraftforge.client.model.ITransformation)p_178414_6_, p_178414_7_, p_178414_8_, p_178414_9_); + } + -+ public BakedQuad makeBakedQuad(Vector3f posFrom, Vector3f posTo, BlockPartFace face, TextureAtlasSprite sprite, EnumFacing facing, net.minecraftforge.client.model.ITransformation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) ++ public BakedQuad makeBakedQuad(Vector3f p_178414_1_, Vector3f p_178414_2_, BlockPartFace p_178414_3_, TextureAtlasSprite p_178414_4_, EnumFacing p_178414_5_, net.minecraftforge.client.model.ITransformation p_178414_6_, BlockPartRotation p_178414_7_, boolean p_178414_8_, boolean p_178414_9_) + { - int[] aint = this.makeQuadVertexData(face, sprite, facing, this.getPositionsDiv16(posFrom, posTo), modelRotationIn, partRotation, uvLocked, shade); - EnumFacing enumfacing = getFacingFromVertexData(aint); ++ int[] aint = this.makeQuadVertexData(p_178414_3_, p_178414_4_, p_178414_5_, this.func_178403_a(p_178414_1_, p_178414_2_), p_178414_6_, p_178414_7_, p_178414_8_, p_178414_9_); + EnumFacing enumfacing = func_178410_a(aint); -@@ -33,11 +38,17 @@ + if (p_178414_8_) +@@ -33,16 +38,22 @@ this.func_178408_a(aint, enumfacing); } + net.minecraftforge.client.ForgeHooksClient.fillNormal(aint, enumfacing); - return new BakedQuad(aint, face.tintIndex, enumfacing); + return new BakedQuad(aint, p_178414_3_.field_178245_c, enumfacing); } - private int[] makeQuadVertexData(BlockPartFace p_178405_1_, TextureAtlasSprite p_178405_2_, EnumFacing p_178405_3_, float[] p_178405_4_, ModelRotation p_178405_5_, BlockPartRotation p_178405_6_, boolean p_178405_7_, boolean shade) + private int[] func_178405_a(BlockPartFace p_178405_1_, TextureAtlasSprite p_178405_2_, EnumFacing p_178405_3_, float[] p_178405_4_, ModelRotation p_178405_5_, BlockPartRotation p_178405_6_, boolean p_178405_7_, boolean p_178405_8_) { -+ return makeQuadVertexData(p_178405_1_, p_178405_2_, p_178405_3_, p_178405_4_, p_178405_5_, p_178405_6_, p_178405_7_, shade); ++ return func_178405_a(p_178405_1_, p_178405_2_, p_178405_3_, p_178405_4_, p_178405_5_, p_178405_6_, p_178405_7_, p_178405_8_); + } + -+ private int[] makeQuadVertexData(BlockPartFace p_178405_1_, TextureAtlasSprite p_178405_2_, EnumFacing p_178405_3_, float[] p_178405_4_, net.minecraftforge.client.model.ITransformation p_178405_5_, BlockPartRotation p_178405_6_, boolean p_178405_7_, boolean shade) ++ private int[] makeQuadVertexData(BlockPartFace p_178405_1_, TextureAtlasSprite p_178405_2_, EnumFacing p_178405_3_, float[] p_178405_4_, net.minecraftforge.client.model.ITransformation p_178405_5_, BlockPartRotation p_178405_6_, boolean p_178405_7_, boolean p_178405_8_) + { int[] aint = new int[28]; for (int i = 0; i < 4; ++i) -@@ -88,7 +99,12 @@ + { +- this.func_178402_a(aint, i, p_178405_3_, p_178405_1_, p_178405_4_, p_178405_2_, p_178405_5_, p_178405_6_, p_178405_7_, p_178405_8_); ++ this.fillVertexData(aint, i, p_178405_3_, p_178405_1_, p_178405_4_, p_178405_2_, p_178405_5_, p_178405_6_, p_178405_7_, p_178405_8_); + } - private void fillVertexData(int[] faceData, int vertexIndex, EnumFacing facing, BlockPartFace partFace, float[] p_178402_5_, TextureAtlasSprite sprite, ModelRotation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) + return aint; +@@ -88,12 +99,17 @@ + + private void func_178402_a(int[] p_178402_1_, int p_178402_2_, EnumFacing p_178402_3_, BlockPartFace p_178402_4_, float[] p_178402_5_, TextureAtlasSprite p_178402_6_, ModelRotation p_178402_7_, BlockPartRotation p_178402_8_, boolean p_178402_9_, boolean p_178402_10_) { -- EnumFacing enumfacing = modelRotationIn.rotateFace(facing); -+ fillVertexData(faceData, vertexIndex, facing, partFace, p_178402_5_, sprite, modelRotationIn, partRotation, uvLocked, shade); +- EnumFacing enumfacing = p_178402_7_.func_177523_a(p_178402_3_); ++ func_178402_a(p_178402_1_, p_178402_2_, p_178402_3_, p_178402_4_, p_178402_5_, p_178402_6_, p_178402_7_, p_178402_8_, p_178402_9_, p_178402_10_); + } + -+ private void fillVertexData(int[] faceData, int vertexIndex, EnumFacing facing, BlockPartFace partFace, float[] p_178402_5_, TextureAtlasSprite sprite, net.minecraftforge.client.model.ITransformation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) ++ private void fillVertexData(int[] p_178402_1_, int p_178402_2_, EnumFacing p_178402_3_, BlockPartFace p_178402_4_, float[] p_178402_5_, TextureAtlasSprite p_178402_6_, net.minecraftforge.client.model.ITransformation p_178402_7_, BlockPartRotation p_178402_8_, boolean p_178402_9_, boolean p_178402_10_) + { -+ EnumFacing enumfacing = modelRotationIn.rotate(facing); - int i = shade ? this.getFaceShadeColor(enumfacing) : -1; - EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = EnumFaceDirection.getFacing(facing).func_179025_a(vertexIndex); ++ EnumFacing enumfacing = p_178402_7_.rotate(p_178402_3_); + int i = p_178402_10_ ? this.func_178413_a(enumfacing) : -1; + EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = EnumFaceDirection.func_179027_a(p_178402_3_).func_179025_a(p_178402_2_); Vector3f vector3f = new Vector3f(p_178402_5_[enumfacedirection$vertexinformation.field_179184_a], p_178402_5_[enumfacedirection$vertexinformation.field_179182_b], p_178402_5_[enumfacedirection$vertexinformation.field_179183_c]); + this.func_178407_a(vector3f, p_178402_8_); +- int j = this.func_178415_a(vector3f, p_178402_3_, p_178402_2_, p_178402_7_, p_178402_9_); ++ int j = this.rotateVertex(vector3f, p_178402_3_, p_178402_2_, p_178402_7_, p_178402_9_); + this.func_178404_a(p_178402_1_, j, p_178402_2_, vector3f, i, p_178402_6_, p_178402_4_.field_178243_e); + } + @@ -154,14 +170,19 @@ - public int rotateVertex(Vector3f position, EnumFacing facing, int vertexIndex, ModelRotation modelRotationIn, boolean uvLocked) + public int func_178415_a(Vector3f p_178415_1_, EnumFacing p_178415_2_, int p_178415_3_, ModelRotation p_178415_4_, boolean p_178415_5_) { -+ return rotateVertex(position, facing, vertexIndex, modelRotationIn, uvLocked); ++ return func_178415_a(p_178415_1_, p_178415_2_, p_178415_3_, p_178415_4_, p_178415_5_); + } + -+ public int rotateVertex(Vector3f position, EnumFacing facing, int vertexIndex, net.minecraftforge.client.model.ITransformation modelRotationIn, boolean uvLocked) ++ public int rotateVertex(Vector3f p_178415_1_, EnumFacing p_178415_2_, int p_178415_3_, net.minecraftforge.client.model.ITransformation p_178415_4_, boolean p_178415_5_) + { - if (modelRotationIn == ModelRotation.X0_Y0) + if (p_178415_4_ == ModelRotation.X0_Y0) { - return vertexIndex; + return p_178415_3_; } else { -- this.rotateScale(position, new Vector3f(0.5F, 0.5F, 0.5F), modelRotationIn.getMatrix4d(), new Vector3f(1.0F, 1.0F, 1.0F)); -- return modelRotationIn.rotateVertex(facing, vertexIndex); -+ net.minecraftforge.client.ForgeHooksClient.transform(position, modelRotationIn.getMatrix()); -+ return modelRotationIn.rotate(facing, vertexIndex); +- this.func_178406_a(p_178415_1_, new Vector3f(0.5F, 0.5F, 0.5F), p_178415_4_.func_177525_a(), new Vector3f(1.0F, 1.0F, 1.0F)); +- return p_178415_4_.func_177520_a(p_178415_2_, p_178415_3_); ++ net.minecraftforge.client.ForgeHooksClient.transform(p_178415_1_, p_178415_4_.getMatrix()); ++ return p_178415_4_.rotate(p_178415_2_, p_178415_3_); } } diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch index f38fed84c..2226f0b87 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch @@ -11,4 +11,4 @@ +@Deprecated public class ItemCameraTransforms { - public static final ItemCameraTransforms DEFAULT = new ItemCameraTransforms(); + public static final ItemCameraTransforms field_178357_a = new ItemCameraTransforms(); diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java.patch index fc01e17a3..e0fa743a5 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/ItemTransformVec3f.java.patch @@ -13,6 +13,6 @@ +public class ItemTransformVec3f implements net.minecraftforge.client.model.IModelState { + public net.minecraftforge.client.model.TRSRTransformation apply(net.minecraftforge.client.model.IModelPart part) { return new net.minecraftforge.client.model.TRSRTransformation(this); } - public static final ItemTransformVec3f DEFAULT = new ItemTransformVec3f(new Vector3f(), new Vector3f(), new Vector3f(1.0F, 1.0F, 1.0F)); - public final Vector3f rotation; - public final Vector3f translation; + public static final ItemTransformVec3f field_178366_a = new ItemTransformVec3f(new Vector3f(), new Vector3f(), new Vector3f(1.0F, 1.0F, 1.0F)); + public final Vector3f field_178364_b; + public final Vector3f field_178365_c; diff --git a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch index f336ff667..30299b290 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch @@ -2,28 +2,28 @@ +++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java @@ -29,7 +29,7 @@ - public static ModelBlockDefinition parseFromReader(Reader p_178331_0_) + public static ModelBlockDefinition func_178331_a(Reader p_178331_0_) { -- return (ModelBlockDefinition)GSON.fromJson(p_178331_0_, ModelBlockDefinition.class); -+ return net.minecraftforge.client.model.BlockStateLoader.load(p_178331_0_, GSON); +- return (ModelBlockDefinition)field_178333_a.fromJson(p_178331_0_, ModelBlockDefinition.class); ++ return net.minecraftforge.client.model.BlockStateLoader.load(p_178331_0_, field_178333_a); } public ModelBlockDefinition(Collection p_i46221_1_) @@ -155,11 +155,17 @@ - return this.modelLocation; + return this.field_178437_a; } + @Deprecated - public ModelRotation getRotation() + public ModelRotation func_178432_b() { - return this.modelRotation; + return this.field_178435_b; } + public net.minecraftforge.client.model.IModelState getState() + { -+ return this.modelRotation; ++ return this.field_178435_b; + } + - public boolean isUvLocked() + public boolean func_178433_c() { - return this.uvLock; + return this.field_178436_c; diff --git a/patches/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch b/patches/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch index 8bc0885c1..035810033 100644 --- a/patches/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch @@ -4,8 +4,8 @@ } else { -- s = ((IProperty)this.property).getName((Comparable)map.remove(this.property)); -+ s = String.format("%s:%s", ((ResourceLocation)Block.blockRegistry.getNameForObject(p_178132_1_.getBlock())).getResourceDomain(), ((IProperty)this.property).getName((Comparable)map.remove(this.property))); +- s = ((IProperty)this.field_178142_a).func_177702_a((Comparable)map.remove(this.field_178142_a)); ++ s = String.format("%s:%s", ((ResourceLocation)Block.field_149771_c.func_177774_c(p_178132_1_.func_177230_c())).func_110624_b(), ((IProperty)this.field_178142_a).func_177702_a((Comparable)map.remove(this.field_178142_a))); } - if (this.suffix != null) + if (this.field_178141_c != null) diff --git a/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch b/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch index 2703427da..f88c6b175 100644 --- a/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch @@ -4,41 +4,41 @@ return; } -- iblockaccess = new RegionRenderCache(this.world, blockpos.add(-1, -1, -1), blockpos1.add(1, 1, 1), 1); -+ iblockaccess = createRegionRenderCache(this.world, blockpos.add(-1, -1, -1), blockpos1.add(1, 1, 1), 1); - p_178581_4_.setCompiledChunk(compiledchunk); +- iblockaccess = new RegionRenderCache(this.field_178588_d, blockpos.func_177982_a(-1, -1, -1), blockpos1.func_177982_a(1, 1, 1), 1); ++ iblockaccess = createRegionRenderCache(this.field_178588_d, blockpos.func_177982_a(-1, -1, -1), blockpos1.func_177982_a(1, 1, 1), 1); + p_178581_4_.func_178543_a(compiledchunk); } finally @@ -158,7 +158,7 @@ lvt_10_1_.func_178606_a(blockpos$mutableblockpos); } -- if (block.hasTileEntity()) +- if (block.func_149716_u()) + if (block.hasTileEntity(iblockstate)) { - TileEntity tileentity = iblockaccess.getTileEntity(new BlockPos(blockpos$mutableblockpos)); - TileEntitySpecialRenderer tileentityspecialrenderer = TileEntityRendererDispatcher.instance.getSpecialRenderer(tileentity); + TileEntity tileentity = iblockaccess.func_175625_s(new BlockPos(blockpos$mutableblockpos)); + TileEntitySpecialRenderer tileentityspecialrenderer = TileEntityRendererDispatcher.field_147556_a.func_147547_b(tileentity); @@ -174,7 +174,9 @@ } } -- EnumWorldBlockLayer enumworldblocklayer1 = block.getBlockLayer(); +- EnumWorldBlockLayer enumworldblocklayer1 = block.func_180664_k(); + for(EnumWorldBlockLayer enumworldblocklayer1 : EnumWorldBlockLayer.values()) { + if(!block.canRenderInLayer(enumworldblocklayer1)) continue; + net.minecraftforge.client.ForgeHooksClient.setRenderLayer(enumworldblocklayer1); int j = enumworldblocklayer1.ordinal(); - if (block.getRenderType() != -1) + if (block.func_149645_b() != -1) @@ -189,6 +191,7 @@ - aboolean[j] |= blockrendererdispatcher.renderBlock(iblockstate, blockpos$mutableblockpos, iblockaccess, worldrenderer); + aboolean[j] |= blockrendererdispatcher.func_175018_a(iblockstate, blockpos$mutableblockpos, iblockaccess, worldrenderer); } + } } for (EnumWorldBlockLayer enumworldblocklayer : EnumWorldBlockLayer.values()) @@ -385,6 +388,26 @@ - return this.needsUpdate; + return this.field_178593_n; } + /* ======================================== FORGE START =====================================*/ diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch index 2025f1404..ce01adce8 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch @@ -1,17 +1,17 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java @@ -41,7 +41,7 @@ - boolean flag = p_177077_9_.isGui3d(); + boolean flag = p_177077_9_.func_177556_c(); int i = this.func_177078_a(itemstack); float f = 0.25F; -- float f1 = MathHelper.sin(((float)p_177077_1_.getAge() + p_177077_8_) / 10.0F + p_177077_1_.hoverStart) * 0.1F + 0.1F; -+ float f1 = shouldBob() ? MathHelper.sin(((float)p_177077_1_.getAge() + p_177077_8_) / 10.0F + p_177077_1_.hoverStart) * 0.1F + 0.1F : 0; - float f2 = p_177077_9_.getItemCameraTransforms().func_181688_b(ItemCameraTransforms.TransformType.GROUND).scale.y; - GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_); +- float f1 = MathHelper.func_76126_a(((float)p_177077_1_.func_174872_o() + p_177077_8_) / 10.0F + p_177077_1_.field_70290_d) * 0.1F + 0.1F; ++ float f1 = shouldBob() ? MathHelper.func_76126_a(((float)p_177077_1_.func_174872_o() + p_177077_8_) / 10.0F + p_177077_1_.field_70290_d) * 0.1F + 0.1F : 0; + float f2 = p_177077_9_.func_177552_f().func_181688_b(ItemCameraTransforms.TransformType.GROUND).field_178363_d.y; + GlStateManager.func_179109_b((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_); @@ -157,4 +157,25 @@ { - return TextureMap.locationBlocksTexture; + return TextureMap.field_110575_b; } + + /*==================================== FORGE START ===========================================*/ 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 79fc448ff..253b492fc 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch @@ -1,20 +1,20 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderItem.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderItem.java @@ -72,7 +72,7 @@ - public RenderItem(TextureManager textureManager, ModelManager modelManager) + public RenderItem(TextureManager p_i46165_1_, ModelManager p_i46165_2_) { - this.textureManager = textureManager; -- this.itemModelMesher = new ItemModelMesher(modelManager); -+ this.itemModelMesher = new net.minecraftforge.client.ItemModelMesherForge(modelManager); - this.registerItems(); + this.field_175057_n = p_i46165_1_; +- this.field_175059_m = new ItemModelMesher(p_i46165_2_); ++ this.field_175059_m = new net.minecraftforge.client.ItemModelMesherForge(p_i46165_2_); + this.func_175041_b(); } @@ -226,7 +226,7 @@ k = k | -16777216; } -- this.renderQuad(renderer, bakedquad, k); -+ net.minecraftforge.client.model.pipeline.LightUtil.renderQuadColor(renderer, bakedquad, k); +- this.func_175033_a(p_175032_1_, bakedquad, k); ++ net.minecraftforge.client.model.pipeline.LightUtil.renderQuadColor(p_175032_1_, bakedquad, k); } } @@ -25,66 +25,66 @@ + else + { + // TODO: maybe switch to the smart player model / normal smart item model? -+ modelresourcelocation = item.getModel(stack, entityplayer, entityplayer.getItemInUseCount()); ++ modelresourcelocation = item.getModel(p_175049_1_, entityplayer, entityplayer.func_71052_bv()); + } if (modelresourcelocation != null) { @@ -317,14 +322,9 @@ - GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); - GlStateManager.pushMatrix(); -- ItemCameraTransforms itemcameratransforms = model.getItemCameraTransforms(); -- itemcameratransforms.func_181689_a(cameraTransformType); + GlStateManager.func_179147_l(); + GlStateManager.func_179120_a(770, 771, 1, 0); + GlStateManager.func_179094_E(); +- ItemCameraTransforms itemcameratransforms = p_175040_2_.func_177552_f(); +- itemcameratransforms.func_181689_a(p_175040_3_); + // TODO: check if negative scale is a thing -+ model = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(model, cameraTransformType); ++ p_175040_2_ = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(p_175040_2_, p_175040_3_); -- if (this.func_183005_a(itemcameratransforms.func_181688_b(cameraTransformType))) +- if (this.func_183005_a(itemcameratransforms.func_181688_b(p_175040_3_))) - { -- GlStateManager.cullFace(1028); +- GlStateManager.func_179107_e(1028); - } - - this.renderItem(stack, model); - GlStateManager.cullFace(1029); - GlStateManager.popMatrix(); + this.func_180454_a(p_175040_1_, p_175040_2_); + GlStateManager.func_179107_e(1029); + GlStateManager.func_179121_F(); @@ -352,7 +352,7 @@ - GlStateManager.blendFunc(770, 771); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.setupGuiTransform(x, y, ibakedmodel.isGui3d()); -- ibakedmodel.getItemCameraTransforms().func_181689_a(ItemCameraTransforms.TransformType.GUI); + GlStateManager.func_179112_b(770, 771); + GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); + this.func_180452_a(p_175042_2_, p_175042_3_, ibakedmodel.func_177556_c()); +- ibakedmodel.func_177552_f().func_181689_a(ItemCameraTransforms.TransformType.GUI); + ibakedmodel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.GUI); - this.renderItem(stack, ibakedmodel); - GlStateManager.disableAlpha(); - GlStateManager.disableRescaleNormal(); + this.func_180454_a(p_175042_1_, ibakedmodel); + GlStateManager.func_179118_c(); + GlStateManager.func_179101_C(); @@ -459,10 +459,11 @@ - GlStateManager.enableDepth(); + GlStateManager.func_179126_j(); } -- if (stack.isItemDamaged()) -+ if (stack.getItem().showDurabilityBar(stack)) +- if (p_180453_2_.func_77951_h()) ++ if (p_180453_2_.func_77973_b().showDurabilityBar(p_180453_2_)) { -- int j = (int)Math.round(13.0D - (double)stack.getItemDamage() * 13.0D / (double)stack.getMaxDamage()); -- int i = (int)Math.round(255.0D - (double)stack.getItemDamage() * 255.0D / (double)stack.getMaxDamage()); -+ double health = stack.getItem().getDurabilityForDisplay(stack); +- int j = (int)Math.round(13.0D - (double)p_180453_2_.func_77952_i() * 13.0D / (double)p_180453_2_.func_77958_k()); +- int i = (int)Math.round(255.0D - (double)p_180453_2_.func_77952_i() * 255.0D / (double)p_180453_2_.func_77958_k()); ++ double health = p_180453_2_.func_77973_b().getDurabilityForDisplay(p_180453_2_); + int j = (int)Math.round(13.0D - health * 13.0D); + int i = (int)Math.round(255.0D - health * 255.0D); - GlStateManager.disableLighting(); - GlStateManager.disableDepth(); - GlStateManager.disableTexture2D(); + GlStateManager.func_179140_f(); + GlStateManager.func_179097_i(); + GlStateManager.func_179090_x(); @@ -473,7 +474,7 @@ - this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, 13, 2, 0, 0, 0, 255); - this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, 12, 1, (255 - i) / 4, 64, 0, 255); - this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, j, 1, 255 - i, i, 0, 255); -- GlStateManager.enableBlend(); + this.func_181565_a(worldrenderer, p_180453_3_ + 2, p_180453_4_ + 13, 13, 2, 0, 0, 0, 255); + this.func_181565_a(worldrenderer, p_180453_3_ + 2, p_180453_4_ + 13, 12, 1, (255 - i) / 4, 64, 0, 255); + this.func_181565_a(worldrenderer, p_180453_3_ + 2, p_180453_4_ + 13, j, 1, 255 - i, i, 0, 255); +- GlStateManager.func_179147_l(); + //GlStateManager.enableBlend(); // Forge: Disable Blend because it screws with a lot of things down the line. - GlStateManager.enableAlpha(); - GlStateManager.enableTexture2D(); - GlStateManager.enableLighting(); + GlStateManager.func_179141_d(); + GlStateManager.func_179098_w(); + GlStateManager.func_179145_e(); @@ -1038,6 +1039,7 @@ - this.registerBlock(Blocks.brown_mushroom_block, BlockHugeMushroom.EnumType.ALL_INSIDE.getMetadata(), "brown_mushroom_block"); - this.registerBlock(Blocks.red_mushroom_block, BlockHugeMushroom.EnumType.ALL_INSIDE.getMetadata(), "red_mushroom_block"); - this.registerBlock(Blocks.dragon_egg, "dragon_egg"); -+ net.minecraftforge.client.model.ModelLoader.onRegisterItems(this.itemModelMesher); + this.func_175029_a(Blocks.field_150420_aW, BlockHugeMushroom.EnumType.ALL_INSIDE.func_176896_a(), "brown_mushroom_block"); + this.func_175029_a(Blocks.field_150419_aX, BlockHugeMushroom.EnumType.ALL_INSIDE.func_176896_a(), "red_mushroom_block"); + this.func_175031_a(Blocks.field_150380_bt, "dragon_egg"); ++ net.minecraftforge.client.model.ModelLoader.onRegisterItems(this.field_175059_m); } - public void onResourceManagerReload(IResourceManager resourceManager) + public void func_110549_a(IResourceManager p_110549_1_) 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 7513d3e08..7b9014d93 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch @@ -1,25 +1,25 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderManager.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderManager.java @@ -193,6 +193,10 @@ - this.skinMap.put("default", this.field_178637_m); - this.skinMap.put("slim", new RenderPlayer(this, true)); + this.field_178636_l.put("default", this.field_178637_m); + this.field_178636_l.put("slim", new RenderPlayer(this, true)); } + + public Map getSkinMap() { -+ return (Map) java.util.Collections.unmodifiableMap(skinMap); ++ return (Map) java.util.Collections.unmodifiableMap(field_178636_l); + } - public void setRenderPosition(double p_178628_1_, double p_178628_3_, double p_178628_5_) + public void func_178628_a(double p_178628_1_, double p_178628_3_, double p_178628_5_) { @@ -241,9 +245,9 @@ - IBlockState iblockstate = worldIn.getBlockState(new BlockPos(p_180597_3_)); - Block block = iblockstate.getBlock(); + IBlockState iblockstate = p_180597_1_.func_180495_p(new BlockPos(p_180597_3_)); + Block block = iblockstate.func_177230_c(); -- if (block == Blocks.bed) -+ if (block.isBed(worldIn, new BlockPos(p_180597_3_), (EntityLivingBase)p_180597_3_)) +- if (block == Blocks.field_150324_C) ++ if (block.isBed(p_180597_1_, new BlockPos(p_180597_3_), (EntityLivingBase)p_180597_3_)) { -- int i = ((EnumFacing)iblockstate.getValue(BlockBed.FACING)).getHorizontalIndex(); -+ int i = block.getBedDirection(worldIn, new BlockPos(p_180597_3_)).getHorizontalIndex(); - this.playerViewY = (float)(i * 90 + 180); - this.playerViewX = 0.0F; +- int i = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_176387_N)).func_176736_b(); ++ int i = block.getBedDirection(p_180597_1_, new BlockPos(p_180597_3_)).func_176736_b(); + this.field_78735_i = (float)(i * 90 + 180); + this.field_78732_j = 0.0F; } 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 af5f1e424..984365594 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java.patch @@ -2,17 +2,17 @@ +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java @@ -49,6 +49,7 @@ - public void doRender(AbstractClientPlayer entity, double x, double y, double z, float p_76986_8_, float partialTicks) + public void func_76986_a(AbstractClientPlayer p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Pre(entity, this, partialTicks, x, y, z))) return; - if (!entity.isUser() || this.renderManager.livingPlayer == entity) ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Pre(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_))) return; + if (!p_76986_1_.func_175144_cb() || this.field_76990_c.field_78734_h == p_76986_1_) { - double d0 = y; + double d0 = p_76986_4_; @@ -61,6 +62,7 @@ - this.func_177137_d(entity); - super.doRender(entity, x, d0, z, p_76986_8_, partialTicks); + this.func_177137_d(p_76986_1_); + super.func_76986_a(p_76986_1_, p_76986_2_, d0, p_76986_6_, p_76986_8_, p_76986_9_); } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Post(entity, this, partialTicks, x, y, z)); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Post(p_76986_1_, this, p_76986_9_, p_76986_2_, p_76986_4_, p_76986_6_)); } private void func_177137_d(AbstractClientPlayer p_177137_1_) diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java.patch index e4a92b81b..75cae2f1b 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java @@ -44,7 +44,7 @@ case 4: - return butcherVillagerTextures; + return field_110906_m; default: -- return villagerTextures; -+ return net.minecraftforge.fml.common.registry.VillagerRegistry.getVillagerSkin(entity.getProfession(), villagerTextures); +- return field_110903_f; ++ return net.minecraftforge.fml.common.registry.VillagerRegistry.getVillagerSkin(p_110775_1_.func_70946_n(), field_110903_f); } } diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch index e45eb4648..d92c907a6 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java @@ -38,6 +38,9 @@ - protected List> layerRenderers = Lists.>newArrayList(); - protected boolean renderOutlines = false; + protected List> field_177097_h = Lists.>newArrayList(); + protected boolean field_177098_i = false; + public static float NAME_TAG_RANGE = 64.0f; + public static float NAME_TAG_RANGE_SNEAK = 32.0f; @@ -12,30 +12,30 @@ super(p_i46156_1_); @@ -83,6 +86,7 @@ - public void doRender(T entity, double x, double y, double z, float p_76986_8_, float partialTicks) + public void func_76986_a(T p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Pre(entity, this, x, y, z))) return; - GlStateManager.pushMatrix(); - GlStateManager.disableCull(); - this.mainModel.swingProgress = this.getSwingProgress(entity, partialTicks); ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Pre(p_76986_1_, this, p_76986_2_, p_76986_4_, p_76986_6_))) return; + GlStateManager.func_179094_E(); + GlStateManager.func_179129_p(); + this.field_77045_g.field_78095_p = this.func_77040_d(p_76986_1_, p_76986_9_); @@ -191,6 +195,7 @@ { - super.doRender(entity, x, y, z, p_76986_8_, partialTicks); + super.func_76986_a(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Post(entity, this, x, y, z)); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Post(p_76986_1_, this, p_76986_2_, p_76986_4_, p_76986_6_)); } protected boolean func_177088_c(T p_177088_1_) @@ -469,10 +474,11 @@ - public void renderName(T entity, double x, double y, double z) + public void func_177067_a(T p_177067_1_, double p_177067_2_, double p_177067_4_, double p_177067_6_) { -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Pre(entity, this, x, y, z))) return; - if (this.canRenderName(entity)) ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Pre(p_177067_1_, this, p_177067_2_, p_177067_4_, p_177067_6_))) return; + if (this.func_177070_b(p_177067_1_)) { - double d0 = entity.getDistanceSqToEntity(this.renderManager.livingPlayer); -- float f = entity.isSneaking() ? 32.0F : 64.0F; -+ float f = entity.isSneaking() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE; + double d0 = p_177067_1_.func_70068_e(this.field_76990_c.field_78734_h); +- float f = p_177067_1_.func_70093_af() ? 32.0F : 64.0F; ++ float f = p_177067_1_.func_70093_af() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE; if (d0 < (double)(f * f)) { @@ -43,7 +43,7 @@ } } } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Post(entity, this, x, y, z)); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Post(p_177067_1_, this, p_177067_2_, p_177067_4_, p_177067_6_)); } - protected boolean canRenderName(T entity) + protected boolean func_177070_b(T p_177070_1_) diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch index b87eb4a6c..4c6befc54 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch @@ -2,57 +2,57 @@ +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java @@ -55,28 +55,28 @@ T t = this.func_177175_a(p_177182_9_); - t.setModelAttributes(this.field_177190_a.getMainModel()); - t.setLivingAnimations(p_177182_1_, p_177182_2_, p_177182_3_, p_177182_4_); + t.func_178686_a(this.field_177190_a.func_177087_b()); + t.func_78086_a(p_177182_1_, p_177182_2_, p_177182_3_, p_177182_4_); + t = getArmorModelHook(p_177182_1_, itemstack, p_177182_9_, t); this.func_177179_a(t, p_177182_9_); boolean flag = this.func_177180_b(p_177182_9_); - this.field_177190_a.bindTexture(this.getArmorResource(itemarmor, flag)); + this.field_177190_a.func_110776_a(this.func_177181_a(itemarmor, flag)); -- switch (itemarmor.getArmorMaterial()) +- switch (itemarmor.func_82812_d()) - { - case LEATHER: - int i = itemarmor.getColor(itemstack); + int i = itemarmor.func_82814_b(itemstack); + { + if (i != -1) // Allow this for anything, not only cloth. + { float f = (float)(i >> 16 & 255) / 255.0F; float f1 = (float)(i >> 8 & 255) / 255.0F; float f2 = (float)(i & 255) / 255.0F; - GlStateManager.color(this.field_177184_f * f, this.field_177185_g * f1, this.field_177192_h * f2, this.field_177187_e); - t.render(p_177182_1_, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_); -- this.field_177190_a.bindTexture(this.getArmorResource(itemarmor, flag, "overlay")); + GlStateManager.func_179131_c(this.field_177184_f * f, this.field_177185_g * f1, this.field_177192_h * f2, this.field_177187_e); + t.func_78088_a(p_177182_1_, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_); +- this.field_177190_a.func_110776_a(this.func_177178_a(itemarmor, flag, "overlay")); - case CHAIN: - case IRON: - case GOLD: - case DIAMOND: -+ this.field_177190_a.bindTexture(this.getArmorResource(p_177182_1_, itemstack, flag ? 2 : 1, "overlay")); ++ this.field_177190_a.func_110776_a(this.getArmorResource(p_177182_1_, itemstack, flag ? 2 : 1, "overlay")); + } + else // Non-colored + { - GlStateManager.color(this.field_177184_f, this.field_177185_g, this.field_177192_h, this.field_177187_e); - t.render(p_177182_1_, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_); + GlStateManager.func_179131_c(this.field_177184_f, this.field_177185_g, this.field_177192_h, this.field_177187_e); + t.func_78088_a(p_177182_1_, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_); - default: - + } + // Default - if (!this.field_177193_i && itemstack.isItemEnchanted()) + if (!this.field_177193_i && itemstack.func_77948_v()) { this.func_177183_a(p_177182_1_, t, p_177182_2_, p_177182_3_, p_177182_4_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_); @@ -135,11 +135,13 @@ - GlStateManager.disableBlend(); + GlStateManager.func_179084_k(); } + @Deprecated //Use the more sensitive version getArmorResource below - private ResourceLocation getArmorResource(ItemArmor p_177181_1_, boolean p_177181_2_) + private ResourceLocation func_177181_a(ItemArmor p_177181_1_, boolean p_177181_2_) { - return this.getArmorResource(p_177181_1_, p_177181_2_, (String)null); + return this.func_177178_a(p_177181_1_, p_177181_2_, (String)null); } + @Deprecated //Use the more sensitive version getArmorResource below - private ResourceLocation getArmorResource(ItemArmor p_177178_1_, boolean p_177178_2_, String p_177178_3_) + private ResourceLocation func_177178_a(ItemArmor p_177178_1_, boolean p_177178_2_, String p_177178_3_) { - String s = String.format("textures/models/armor/%s_layer_%d%s.png", new Object[] {p_177178_1_.getArmorMaterial().getName(), Integer.valueOf(p_177178_2_ ? 2 : 1), p_177178_3_ == null ? "" : String.format("_%s", new Object[]{p_177178_3_})}); + String s = String.format("textures/models/armor/%s_layer_%d%s.png", new Object[] {p_177178_1_.func_82812_d().func_179242_c(), Integer.valueOf(p_177178_2_ ? 2 : 1), p_177178_3_ == null ? "" : String.format("_%s", new Object[]{p_177178_3_})}); @@ -157,4 +159,49 @@ protected abstract void func_177177_a(); @@ -79,8 +79,8 @@ + */ + public ResourceLocation getArmorResource(net.minecraft.entity.Entity entity, ItemStack stack, int slot, String type) + { -+ ItemArmor item = (ItemArmor)stack.getItem(); -+ String texture = item.getArmorMaterial().getName(); ++ ItemArmor item = (ItemArmor)stack.func_77973_b(); ++ String texture = item.func_82812_d().func_179242_c(); + String domain = "minecraft"; + int idx = texture.indexOf(':'); + if (idx != -1) diff --git a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch index 50001b770..e391d61ac 100644 --- a/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java.patch @@ -2,7 +2,7 @@ +++ ../src-work/minecraft/net/minecraft/client/renderer/entity/layers/LayerBipedArmor.java @@ -49,4 +49,10 @@ { - p_177194_1_.setInvisible(false); + p_177194_1_.func_178719_a(false); } + + @Override diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch index fdbf34c9e..1dbb9630a 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch @@ -2,16 +2,16 @@ +++ ../src-work/minecraft/net/minecraft/client/renderer/texture/Stitcher.java @@ -58,12 +58,17 @@ { - Stitcher.Holder[] astitcher$holder = (Stitcher.Holder[])this.setStitchHolders.toArray(new Stitcher.Holder[this.setStitchHolders.size()]); + Stitcher.Holder[] astitcher$holder = (Stitcher.Holder[])this.field_94319_a.toArray(new Stitcher.Holder[this.field_94319_a.size()]); Arrays.sort((Object[])astitcher$holder); + net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Texture stitching", astitcher$holder.length); for (Stitcher.Holder stitcher$holder : astitcher$holder) { -+ bar.step(stitcher$holder.getAtlasSprite().getIconName()); - if (!this.allocateSlot(stitcher$holder)) ++ bar.step(stitcher$holder.func_98150_a().func_94215_i()); + if (!this.func_94310_b(stitcher$holder)) { - String s = String.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution resourcepack?", new Object[] {stitcher$holder.getAtlasSprite().getIconName(), Integer.valueOf(stitcher$holder.getAtlasSprite().getIconWidth()), Integer.valueOf(stitcher$holder.getAtlasSprite().getIconHeight())}); + String s = String.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution resourcepack?", new Object[] {stitcher$holder.func_98150_a().func_94215_i(), Integer.valueOf(stitcher$holder.func_98150_a().func_94211_a()), Integer.valueOf(stitcher$holder.func_98150_a().func_94216_b())}); + net.minecraftforge.fml.common.FMLLog.info(s); + for (Stitcher.Holder h : astitcher$holder) + net.minecraftforge.fml.common.FMLLog.info(" %s", h); @@ -19,19 +19,19 @@ } } @@ -73,6 +78,7 @@ - this.currentWidth = MathHelper.roundUpToPowerOfTwo(this.currentWidth); - this.currentHeight = MathHelper.roundUpToPowerOfTwo(this.currentHeight); + this.field_94318_c = MathHelper.func_151236_b(this.field_94318_c); + this.field_94315_d = MathHelper.func_151236_b(this.field_94315_d); } + net.minecraftforge.fml.common.ProgressManager.pop(bar); } - public List getStichSlots() + public List func_94309_g() @@ -260,7 +266,7 @@ public String toString() { -- return "Holder{width=" + this.width + ", height=" + this.height + '}'; -+ return "Holder{width=" + this.width + ", height=" + this.height + ", name=" + this.theTexture.getIconName() + '}'; +- return "Holder{width=" + this.field_94204_c + ", height=" + this.field_94201_d + '}'; ++ return "Holder{width=" + this.field_94204_c + ", height=" + this.field_94201_d + ", name=" + this.field_98151_a.func_94215_i() + '}'; } public int compareTo(Stitcher.Holder p_compareTo_1_) diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch index fb734bf69..7d8895248 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch @@ -2,7 +2,7 @@ +++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java @@ -402,4 +402,30 @@ { - return "TextureAtlasSprite{name=\'" + this.iconName + '\'' + ", frameCount=" + this.framesTextureData.size() + ", rotated=" + this.rotated + ", x=" + this.originX + ", y=" + this.originY + ", height=" + this.height + ", width=" + this.width + ", u0=" + this.minU + ", u1=" + this.maxU + ", v0=" + this.minV + ", v1=" + this.maxV + '}'; + return "TextureAtlasSprite{name=\'" + this.field_110984_i + '\'' + ", frameCount=" + this.field_110976_a.size() + ", rotated=" + this.field_130222_e + ", x=" + this.field_110975_c + ", y=" + this.field_110974_d + ", height=" + this.field_130224_d + ", width=" + this.field_130223_c + ", u0=" + this.field_110979_l + ", u1=" + this.field_110980_m + ", v0=" + this.field_110977_n + ", v1=" + this.field_110978_o + '}'; } + + /*===================================== FORGE START =====================================*/ diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch index 62022a2a2..796c37a03 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureManager.java.patch @@ -2,13 +2,13 @@ +++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureManager.java @@ -137,9 +137,12 @@ - public void onResourceManagerReload(IResourceManager resourceManager) + public void func_110549_a(IResourceManager p_110549_1_) { -+ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Reloading Texture Manager", this.mapTextureObjects.keySet().size(), true); - for (Entry entry : this.mapTextureObjects.entrySet()) ++ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Reloading Texture Manager", this.field_110585_a.keySet().size(), true); + for (Entry entry : this.field_110585_a.entrySet()) { + bar.step(entry.getKey().toString()); - this.loadTexture((ResourceLocation)entry.getKey(), (ITextureObject)entry.getValue()); + this.func_110579_a((ResourceLocation)entry.getKey(), (ITextureObject)entry.getValue()); } + net.minecraftforge.fml.common.ProgressManager.pop(bar); } 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 a73196716..133b68b97 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch @@ -5,22 +5,22 @@ public class TextureMap extends AbstractTexture implements ITickableTextureObject { + private static final boolean ENABLE_SKIP = Boolean.parseBoolean(System.getProperty("fml.skipFirstTextureLoad", "true")); - private static final Logger logger = LogManager.getLogger(); - public static final ResourceLocation LOCATION_MISSING_TEXTURE = new ResourceLocation("missingno"); - public static final ResourceLocation locationBlocksTexture = new ResourceLocation("textures/atlas/blocks.png"); + private static final Logger field_147635_d = LogManager.getLogger(); + public static final ResourceLocation field_174945_f = new ResourceLocation("missingno"); + public static final ResourceLocation field_110575_b = new ResourceLocation("textures/atlas/blocks.png"); @@ -38,6 +39,7 @@ - private final IIconCreator iconCreator; - private int mipmapLevels; - private final TextureAtlasSprite missingImage; + private final IIconCreator field_174946_m; + private int field_147636_j; + private final TextureAtlasSprite field_94249_f; + private boolean skipFirst = false; public TextureMap(String p_i46099_1_) { @@ -46,12 +48,23 @@ - public TextureMap(String p_i46100_1_, IIconCreator iconCreatorIn) + public TextureMap(String p_i46100_1_, IIconCreator p_i46100_2_) { -+ this(p_i46100_1_, iconCreatorIn, false); ++ this(p_i46100_1_, p_i46100_2_, false); + } + + public TextureMap(String p_i46100_1_, boolean skipFirst) @@ -30,86 +30,87 @@ + + public TextureMap(String p_i46100_1_, IIconCreator iconCreatorIn, boolean skipFirst) + { - this.listAnimatedSprites = Lists.newArrayList(); - this.mapRegisteredSprites = Maps.newHashMap(); - this.mapUploadedSprites = Maps.newHashMap(); - this.missingImage = new TextureAtlasSprite("missingno"); - this.basePath = p_i46100_1_; - this.iconCreator = iconCreatorIn; + this.field_94258_i = Lists.newArrayList(); + this.field_110574_e = Maps.newHashMap(); + this.field_94252_e = Maps.newHashMap(); + this.field_94249_f = new TextureAtlasSprite("missingno"); + this.field_94254_c = p_i46100_1_; +- this.field_174946_m = p_i46100_2_; ++ this.field_174946_m = iconCreatorIn; + this.skipFirst = skipFirst && ENABLE_SKIP; } - private void initMissingImage() + private void func_110569_e() @@ -90,12 +103,28 @@ int j = Integer.MAX_VALUE; - int k = 1 << this.mipmapLevels; + int k = 1 << this.field_147636_j; + net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPre(this); + net.minecraftforge.fml.common.FMLLog.info("Max texture size: %d", i); -+ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Texture stitching", skipFirst ? 0 : this.mapRegisteredSprites.size()); ++ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar = net.minecraftforge.fml.common.ProgressManager.push("Texture stitching", skipFirst ? 0 : this.field_110574_e.size()); + + if(!skipFirst) - for (Entry entry : this.mapRegisteredSprites.entrySet()) + for (Entry entry : this.field_110574_e.entrySet()) { TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)entry.getValue(); - ResourceLocation resourcelocation = new ResourceLocation(textureatlassprite.getIconName()); - ResourceLocation resourcelocation1 = this.completeResourceLocation(resourcelocation, 0); -+ bar.step(resourcelocation1.getResourcePath()); + ResourceLocation resourcelocation = new ResourceLocation(textureatlassprite.func_94215_i()); + ResourceLocation resourcelocation1 = this.func_147634_a(resourcelocation, 0); ++ bar.step(resourcelocation1.func_110623_a()); -+ if (textureatlassprite.hasCustomLoader(resourceManager, resourcelocation)) ++ if (textureatlassprite.hasCustomLoader(p_110571_1_, resourcelocation)) + { -+ if (!textureatlassprite.load(resourceManager, resourcelocation)) ++ if (!textureatlassprite.load(p_110571_1_, resourcelocation)) + { -+ j = Math.min(j, Math.min(textureatlassprite.getIconWidth(), textureatlassprite.getIconHeight())); -+ stitcher.addSprite(textureatlassprite); ++ j = Math.min(j, Math.min(textureatlassprite.func_94211_a(), textureatlassprite.func_94216_b())); ++ stitcher.func_110934_a(textureatlassprite); + } + continue; + } + try { - IResource iresource = resourceManager.getResource(resourcelocation1); + IResource iresource = p_110571_1_.func_110536_a(resourcelocation1); @@ -145,12 +174,14 @@ } catch (RuntimeException runtimeexception) { -- logger.error((String)("Unable to parse metadata from " + resourcelocation1), (Throwable)runtimeexception); +- field_147635_d.error((String)("Unable to parse metadata from " + resourcelocation1), (Throwable)runtimeexception); + //logger.error((String)("Unable to parse metadata from " + resourcelocation1), (Throwable)runtimeexception); + net.minecraftforge.fml.client.FMLClientHandler.instance().trackBrokenTexture(resourcelocation1, runtimeexception.getMessage()); continue; } catch (IOException ioexception1) { -- logger.error((String)("Using missing texture, unable to load " + resourcelocation1), (Throwable)ioexception1); +- field_147635_d.error((String)("Using missing texture, unable to load " + resourcelocation1), (Throwable)ioexception1); + //logger.error((String)("Using missing texture, unable to load " + resourcelocation1), (Throwable)ioexception1); + net.minecraftforge.fml.client.FMLClientHandler.instance().trackMissingTexture(resourcelocation1); continue; } @@ -166,6 +197,7 @@ - stitcher.addSprite(textureatlassprite); + stitcher.func_110934_a(textureatlassprite); } + net.minecraftforge.fml.common.ProgressManager.pop(bar); int j1 = Math.min(j, k); - int k1 = MathHelper.calculateLogBaseTwo(j1); + int k1 = MathHelper.func_151239_c(j1); @@ -175,8 +207,11 @@ - this.mipmapLevels = k1; + this.field_147636_j = k1; } -+ bar = net.minecraftforge.fml.common.ProgressManager.push("Mipmap generation", skipFirst ? 0 : this.mapRegisteredSprites.size()); - for (final TextureAtlasSprite textureatlassprite1 : this.mapRegisteredSprites.values()) ++ bar = net.minecraftforge.fml.common.ProgressManager.push("Mipmap generation", skipFirst ? 0 : this.field_110574_e.size()); + for (final TextureAtlasSprite textureatlassprite1 : this.field_110574_e.values()) { + if (skipFirst) break; -+ bar.step(textureatlassprite1.getIconName()); ++ bar.step(textureatlassprite1.func_94215_i()); try { - textureatlassprite1.generateMipmaps(this.mipmapLevels); + textureatlassprite1.func_147963_d(this.field_147636_j); @@ -213,9 +248,13 @@ - this.missingImage.generateMipmaps(this.mipmapLevels); - stitcher.addSprite(this.missingImage); + this.field_94249_f.func_147963_d(this.field_147636_j); + stitcher.func_110934_a(this.field_94249_f); + net.minecraftforge.fml.common.ProgressManager.pop(bar); + skipFirst = false; + bar = net.minecraftforge.fml.common.ProgressManager.push("Texture creation", 3); @@ -117,24 +118,24 @@ try { + bar.step("Stitching"); - stitcher.doStitch(); + stitcher.func_94305_f(); } catch (StitcherException stitcherexception) @@ -224,9 +263,11 @@ } - logger.info("Created: {}x{} {}-atlas", new Object[] {Integer.valueOf(stitcher.getCurrentWidth()), Integer.valueOf(stitcher.getCurrentHeight()), this.basePath}); + field_147635_d.info("Created: {}x{} {}-atlas", new Object[] {Integer.valueOf(stitcher.func_110935_a()), Integer.valueOf(stitcher.func_110936_b()), this.field_94254_c}); + bar.step("Allocating GL texture"); - TextureUtil.allocateTextureImpl(this.getGlTextureId(), this.mipmapLevels, stitcher.getCurrentWidth(), stitcher.getCurrentHeight()); - Map map = Maps.newHashMap(this.mapRegisteredSprites); + TextureUtil.func_180600_a(this.func_110552_b(), this.field_147636_j, stitcher.func_110935_a(), stitcher.func_110936_b()); + Map map = Maps.newHashMap(this.field_110574_e); + bar.step("Uploading GL texture"); - for (TextureAtlasSprite textureatlassprite2 : stitcher.getStichSlots()) + for (TextureAtlasSprite textureatlassprite2 : stitcher.func_94309_g()) { - String s = textureatlassprite2.getIconName(); + String s = textureatlassprite2.func_94215_i(); @@ -256,6 +297,13 @@ { - textureatlassprite3.copyFrom(this.missingImage); + textureatlassprite3.func_94217_a(this.field_94249_f); } + + net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPost(this); @@ -145,10 +146,10 @@ + net.minecraftforge.fml.common.ProgressManager.pop(bar); } - private ResourceLocation completeResourceLocation(ResourceLocation location, int p_147634_2_) + private ResourceLocation func_147634_a(ResourceLocation p_147634_1_, int p_147634_2_) @@ -319,4 +367,37 @@ { - return this.missingImage; + return this.field_94249_f; } + + //=================================================================================================== @@ -163,7 +164,7 @@ + */ + public TextureAtlasSprite getTextureExtry(String name) + { -+ return (TextureAtlasSprite)mapRegisteredSprites.get(name); ++ return (TextureAtlasSprite)field_110574_e.get(name); + } + + /** @@ -176,9 +177,9 @@ + */ + public boolean setTextureEntry(String name, TextureAtlasSprite entry) + { -+ if (!mapRegisteredSprites.containsKey(name)) ++ if (!field_110574_e.containsKey(name)) + { -+ mapRegisteredSprites.put(name, entry); ++ field_110574_e.put(name, entry); + return true; + } + return false; diff --git a/patches/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch b/patches/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch index d067a7ffb..a9d758ece 100644 --- a/patches/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java.patch @@ -2,12 +2,12 @@ +++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java @@ -197,9 +197,11 @@ - public static void allocateTextureImpl(int p_180600_0_, int p_180600_1_, int p_180600_2_, int p_180600_3_) + public static void func_180600_a(int p_180600_0_, int p_180600_1_, int p_180600_2_, int p_180600_3_) { + synchronized (net.minecraftforge.fml.client.SplashProgress.class) + { - deleteTexture(p_180600_0_); - bindTexture(p_180600_0_); + func_147942_a(p_180600_0_); + func_94277_a(p_180600_0_); - + } if (p_180600_1_ >= 0) diff --git a/patches/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java.patch b/patches/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java.patch index d05ff8ac8..d0ec3a7d9 100644 --- a/patches/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java.patch @@ -1,31 +1,31 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java +++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java @@ -99,15 +99,18 @@ - GlStateManager.disableLighting(); - int i = p_82402_1_.getRotation(); + GlStateManager.func_179140_f(); + int i = p_82402_1_.func_82333_j(); -- if (item == Items.filled_map) +- if (item == Items.field_151098_aY) + if (item instanceof net.minecraft.item.ItemMap) { i = i % 4 * 2; } - GlStateManager.rotate((float)i * 360.0F / 8.0F, 0.0F, 0.0F, 1.0F); + GlStateManager.func_179114_b((float)i * 360.0F / 8.0F, 0.0F, 0.0F, 1.0F); -- if (item == Items.filled_map) +- if (item == Items.field_151098_aY) + net.minecraftforge.client.event.RenderItemInFrameEvent event = new net.minecraftforge.client.event.RenderItemInFrameEvent(p_82402_1_, this); + if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) { + if (item instanceof net.minecraft.item.ItemMap) + { - this.renderManager.renderEngine.bindTexture(mapBackgroundTextures); - GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); + this.field_76990_c.field_78724_e.func_110577_a(field_110789_a); + GlStateManager.func_179114_b(180.0F, 0.0F, 0.0F, 1.0F); float f = 0.0078125F; @@ -165,6 +168,7 @@ - textureatlassprite.updateAnimation(); + textureatlassprite.func_94219_l(); } } + } - GlStateManager.enableLighting(); - GlStateManager.popMatrix(); + GlStateManager.func_179145_e(); + GlStateManager.func_179121_F(); diff --git a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch index 9de0c31ca..22634cf06 100644 --- a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/TileEntityItemStackRenderer.java @@ -78,6 +78,7 @@ { - TileEntityRendererDispatcher.instance.renderTileEntityAt(this.field_147718_c, 0.0D, 0.0D, 0.0D, 0.0F); + TileEntityRendererDispatcher.field_147556_a.func_147549_a(this.field_147718_c, 0.0D, 0.0D, 0.0D, 0.0F); } -+ else if (block != Blocks.chest) net.minecraftforge.client.ForgeHooksClient.renderTileItem(p_179022_1_.getItem(), p_179022_1_.getMetadata()); ++ else if (block != Blocks.field_150486_ae) net.minecraftforge.client.ForgeHooksClient.renderTileItem(p_179022_1_.func_77973_b(), p_179022_1_.func_77960_j()); else { - TileEntityRendererDispatcher.instance.renderTileEntityAt(this.field_147717_b, 0.0D, 0.0D, 0.0D, 0.0F); + TileEntityRendererDispatcher.field_147556_a.func_147549_a(this.field_147717_b, 0.0D, 0.0D, 0.0D, 0.0F); diff --git a/patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormatElement.java.patch b/patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormatElement.java.patch index c51b7af57..9faa76e8f 100644 --- a/patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormatElement.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/vertex/VertexFormatElement.java.patch @@ -16,6 +16,6 @@ + public void preDraw(VertexFormat format, int element, int stride, java.nio.ByteBuffer buffer) { net.minecraftforge.client.ForgeHooksClient.preDraw(this, format, element, stride, buffer); } + public void postDraw(VertexFormat format, int element, int stride, java.nio.ByteBuffer buffer) { net.minecraftforge.client.ForgeHooksClient.postDraw(this, format, element, stride, buffer); } + - private final String displayName; + private final String field_177392_h; private EnumUsage(String p_i46094_3_) diff --git a/patches/minecraft/net/minecraft/client/resources/AbstractResourcePack.java.patch b/patches/minecraft/net/minecraft/client/resources/AbstractResourcePack.java.patch index 2e4117099..375865cd4 100644 --- a/patches/minecraft/net/minecraft/client/resources/AbstractResourcePack.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/AbstractResourcePack.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/client/resources/AbstractResourcePack.java @@ -58,7 +58,7 @@ - protected void logNameNotLowercase(String p_110594_1_) + protected void func_110594_c(String p_110594_1_) { -- resourceLog.warn("ResourcePack: ignored non-lowercase namespace: %s in %s", new Object[] {p_110594_1_, this.resourcePackFile}); -+ resourceLog.warn("ResourcePack: ignored non-lowercase namespace: {} in {}", new Object[] {p_110594_1_, this.resourcePackFile}); +- field_110598_a.warn("ResourcePack: ignored non-lowercase namespace: %s in %s", new Object[] {p_110594_1_, this.field_110597_b}); ++ field_110598_a.warn("ResourcePack: ignored non-lowercase namespace: {} in {}", new Object[] {p_110594_1_, this.field_110597_b}); } - public T getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException + public T func_135058_a(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException diff --git a/patches/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch b/patches/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch index f80172ba7..fa5296e39 100644 --- a/patches/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/FallbackResourceManager.java.patch @@ -5,6 +5,6 @@ } + @SuppressWarnings("resource") - protected InputStream getInputStream(ResourceLocation p_177245_1_, IResourcePack p_177245_2_) throws IOException + protected InputStream func_177245_a(ResourceLocation p_177245_1_, IResourcePack p_177245_2_) throws IOException { - InputStream inputstream = p_177245_2_.getInputStream(p_177245_1_); + InputStream inputstream = p_177245_2_.func_110590_a(p_177245_1_); diff --git a/patches/minecraft/net/minecraft/client/resources/LanguageManager.java.patch b/patches/minecraft/net/minecraft/client/resources/LanguageManager.java.patch index fa44d5f1b..4bc3d483c 100644 --- a/patches/minecraft/net/minecraft/client/resources/LanguageManager.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/LanguageManager.java.patch @@ -3,8 +3,8 @@ @@ -73,6 +73,7 @@ } - currentLocale.loadLocaleDataFiles(resourceManager, list); -+ net.minecraftforge.fml.common.registry.LanguageRegistry.instance().mergeLanguageTable(currentLocale.properties, this.currentLanguage); - StringTranslate.replaceWith(currentLocale.properties); + field_135049_a.func_135022_a(p_110549_1_, list); ++ net.minecraftforge.fml.common.registry.LanguageRegistry.instance().mergeLanguageTable(field_135049_a.field_135032_a, this.field_135048_c); + StringTranslate.func_135063_a(field_135049_a.field_135032_a); } diff --git a/patches/minecraft/net/minecraft/client/resources/Locale.java.patch b/patches/minecraft/net/minecraft/client/resources/Locale.java.patch index c6fcea8cd..95dc701db 100644 --- a/patches/minecraft/net/minecraft/client/resources/Locale.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/Locale.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/client/resources/Locale.java @@ -95,6 +95,8 @@ - private void loadLocaleData(InputStream p_135021_1_) throws IOException + private void func_135021_a(InputStream p_135021_1_) throws IOException { -+ p_135021_1_ = net.minecraftforge.fml.common.FMLCommonHandler.instance().loadLanguage(properties, p_135021_1_); ++ p_135021_1_ = net.minecraftforge.fml.common.FMLCommonHandler.instance().loadLanguage(field_135032_a, p_135021_1_); + if (p_135021_1_ == null) return; for (String s : IOUtils.readLines(p_135021_1_, Charsets.UTF_8)) { diff --git a/patches/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java.patch b/patches/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java.patch index 9859bbc84..5dd733b35 100644 --- a/patches/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java.patch @@ -1,42 +1,42 @@ --- ../src-base/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java +++ ../src-work/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java @@ -92,6 +92,7 @@ - public void reloadResources(List p_110541_1_) + public void func_110541_a(List p_110541_1_) { - this.clearResources(); + this.func_110543_a(); + net.minecraftforge.fml.common.ProgressManager.ProgressBar resReload = net.minecraftforge.fml.common.ProgressManager.push("Loading Resources", p_110541_1_.size()+1, true); - logger.info("Reloading ResourceManager: " + joinerResourcePacks.join(Iterables.transform(p_110541_1_, new Function() + field_147967_a.info("Reloading ResourceManager: " + field_130074_a.join(Iterables.transform(p_110541_1_, new Function() { public String apply(IResourcePack p_apply_1_) @@ -102,23 +103,32 @@ for (IResourcePack iresourcepack : p_110541_1_) { -+ resReload.step(iresourcepack.getPackName()); - this.reloadResourcePack(iresourcepack); ++ resReload.step(iresourcepack.func_130077_b()); + this.func_110545_a(iresourcepack); } + resReload.step("Reloading listeners"); - this.notifyReloadListeners(); + this.func_110544_b(); + net.minecraftforge.fml.common.ProgressManager.pop(resReload); } - public void registerReloadListener(IResourceManagerReloadListener p_110542_1_) + public void func_110542_a(IResourceManagerReloadListener p_110542_1_) { + net.minecraftforge.fml.common.ProgressManager.ProgressBar resReload = net.minecraftforge.fml.common.ProgressManager.push("Loading Resource", 1); + resReload.step(p_110542_1_.getClass()); - this.reloadListeners.add(p_110542_1_); - p_110542_1_.onResourceManagerReload(this); + this.field_110546_b.add(p_110542_1_); + p_110542_1_.func_110549_a(this); + net.minecraftforge.fml.common.ProgressManager.pop(resReload); } - private void notifyReloadListeners() + private void func_110544_b() { -+ net.minecraftforge.fml.common.ProgressManager.ProgressBar resReload = net.minecraftforge.fml.common.ProgressManager.push("Reloading", this.reloadListeners.size()); - for (IResourceManagerReloadListener iresourcemanagerreloadlistener : this.reloadListeners) ++ net.minecraftforge.fml.common.ProgressManager.ProgressBar resReload = net.minecraftforge.fml.common.ProgressManager.push("Reloading", this.field_110546_b.size()); + for (IResourceManagerReloadListener iresourcemanagerreloadlistener : this.field_110546_b) { + resReload.step(iresourcemanagerreloadlistener.getClass()); - iresourcemanagerreloadlistener.onResourceManagerReload(this); + iresourcemanagerreloadlistener.func_110549_a(this); } + net.minecraftforge.fml.common.ProgressManager.pop(resReload); } diff --git a/patches/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch b/patches/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch index d032f72eb..d792aea1b 100644 --- a/patches/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch @@ -2,8 +2,8 @@ +++ ../src-work/minecraft/net/minecraft/client/resources/model/IBakedModel.java @@ -23,5 +23,6 @@ - TextureAtlasSprite getTexture(); + TextureAtlasSprite func_177554_e(); + @Deprecated - ItemCameraTransforms getItemCameraTransforms(); + ItemCameraTransforms func_177552_f(); } diff --git a/patches/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch b/patches/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch index 16b116a9f..35547cd4e 100644 --- a/patches/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch @@ -4,8 +4,8 @@ } catch (Exception var6) { -- LOGGER.warn("Unable to load variant: " + modelresourcelocation.getVariant() + " from " + modelresourcelocation); -+ LOGGER.warn("Unable to load variant: " + modelresourcelocation.getVariant() + " from " + modelresourcelocation, var6); +- field_177603_c.warn("Unable to load variant: " + modelresourcelocation.func_177518_c() + " from " + modelresourcelocation); ++ field_177603_c.warn("Unable to load variant: " + modelresourcelocation.func_177518_c() + " from " + modelresourcelocation, var6); } } catch (Exception exception) @@ -19,66 +19,71 @@ throw new RuntimeException("Encountered an exception when loading model definition of model " + resourcelocation.toString(), ioexception); @@ -294,6 +295,7 @@ - protected void registerVariantNames() + protected void func_177592_e() { -+ this.variantNames.clear(); //FML clear this to prevent double ups. - this.variantNames.put(Item.getItemFromBlock(Blocks.stone), Lists.newArrayList(new String[] {"stone", "granite", "granite_smooth", "diorite", "diorite_smooth", "andesite", "andesite_smooth"})); - this.variantNames.put(Item.getItemFromBlock(Blocks.dirt), Lists.newArrayList(new String[] {"dirt", "coarse_dirt", "podzol"})); - this.variantNames.put(Item.getItemFromBlock(Blocks.planks), Lists.newArrayList(new String[] {"oak_planks", "spruce_planks", "birch_planks", "jungle_planks", "acacia_planks", "dark_oak_planks"})); ++ this.field_177613_u.clear(); //FML clear this to prevent double ups. + this.field_177613_u.put(Item.func_150898_a(Blocks.field_150348_b), Lists.newArrayList(new String[] {"stone", "granite", "granite_smooth", "diorite", "diorite_smooth", "andesite", "andesite_smooth"})); + this.field_177613_u.put(Item.func_150898_a(Blocks.field_150346_d), Lists.newArrayList(new String[] {"dirt", "coarse_dirt", "podzol"})); + this.field_177613_u.put(Item.func_150898_a(Blocks.field_150344_f), Lists.newArrayList(new String[] {"oak_planks", "spruce_planks", "birch_planks", "jungle_planks", "acacia_planks", "dark_oak_planks"})); @@ -336,6 +338,10 @@ - this.variantNames.put(Item.getItemFromBlock(Blocks.oak_fence_gate), Lists.newArrayList(new String[] {"oak_fence_gate"})); - this.variantNames.put(Item.getItemFromBlock(Blocks.oak_fence), Lists.newArrayList(new String[] {"oak_fence"})); - this.variantNames.put(Items.oak_door, Lists.newArrayList(new String[] {"oak_door"})); + this.field_177613_u.put(Item.func_150898_a(Blocks.field_180390_bo), Lists.newArrayList(new String[] {"oak_fence_gate"})); + this.field_177613_u.put(Item.func_150898_a(Blocks.field_180407_aO), Lists.newArrayList(new String[] {"oak_fence"})); + this.field_177613_u.put(Items.field_179570_aq, Lists.newArrayList(new String[] {"oak_door"})); + for (Entry, Set> e : customVariantNames.entrySet()) + { -+ this.variantNames.put(e.getKey().get(), Lists.newArrayList(e.getValue().iterator())); ++ this.field_177613_u.put(e.getKey().get(), Lists.newArrayList(e.getValue().iterator())); + } } - protected List getVariantNames(Item p_177596_1_) + protected List func_177596_a(Item p_177596_1_) @@ -453,6 +459,11 @@ - private IBakedModel bakeModel(ModelBlock modelBlockIn, ModelRotation modelRotationIn, boolean uvLocked) + private IBakedModel func_177578_a(ModelBlock p_177578_1_, ModelRotation p_177578_2_, boolean p_177578_3_) { -+ return bakeModel(modelBlockIn, (net.minecraftforge.client.model.ITransformation)modelRotationIn, uvLocked); ++ return bakeModel(p_177578_1_, (net.minecraftforge.client.model.ITransformation)p_177578_2_, p_177578_3_); + } + -+ protected IBakedModel bakeModel(ModelBlock modelBlockIn, net.minecraftforge.client.model.ITransformation modelRotationIn, boolean uvLocked) ++ protected IBakedModel bakeModel(ModelBlock p_177578_1_, net.minecraftforge.client.model.ITransformation p_177578_2_, boolean p_177578_3_) + { - TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.sprites.get(new ResourceLocation(modelBlockIn.resolveTextureName("particle"))); - SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(modelBlockIn)).setTexture(textureatlassprite); + TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.field_177599_g.get(new ResourceLocation(p_177578_1_.func_178308_c("particle"))); + SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(p_177578_1_)).func_177646_a(textureatlassprite); @@ -463,13 +474,13 @@ - BlockPartFace blockpartface = (BlockPartFace)blockpart.mapFaces.get(enumfacing); - TextureAtlasSprite textureatlassprite1 = (TextureAtlasSprite)this.sprites.get(new ResourceLocation(modelBlockIn.resolveTextureName(blockpartface.texture))); + BlockPartFace blockpartface = (BlockPartFace)blockpart.field_178240_c.get(enumfacing); + TextureAtlasSprite textureatlassprite1 = (TextureAtlasSprite)this.field_177599_g.get(new ResourceLocation(p_177578_1_.func_178308_c(blockpartface.field_178242_d))); -- if (blockpartface.cullFace == null) -+ if (blockpartface.cullFace == null || !net.minecraftforge.client.model.TRSRTransformation.isInteger(modelRotationIn.getMatrix())) +- if (blockpartface.field_178244_b == null) ++ if (blockpartface.field_178244_b == null || !net.minecraftforge.client.model.TRSRTransformation.isInteger(p_177578_2_.getMatrix())) { - simplebakedmodel$builder.addGeneralQuad(this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, modelRotationIn, uvLocked)); +- simplebakedmodel$builder.func_177648_a(this.func_177589_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_)); ++ simplebakedmodel$builder.func_177648_a(this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_)); } else { -- simplebakedmodel$builder.addFaceQuad(modelRotationIn.rotateFace(blockpartface.cullFace), this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, modelRotationIn, uvLocked)); -+ simplebakedmodel$builder.addFaceQuad(modelRotationIn.rotate(blockpartface.cullFace), this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, modelRotationIn, uvLocked)); +- simplebakedmodel$builder.func_177650_a(p_177578_2_.func_177523_a(blockpartface.field_178244_b), this.func_177589_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_)); ++ simplebakedmodel$builder.func_177650_a(p_177578_2_.rotate(blockpartface.field_178244_b), this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_)); } } } -@@ -479,6 +490,11 @@ +@@ -479,9 +490,14 @@ - private BakedQuad makeBakedQuad(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, ModelRotation p_177589_5_, boolean p_177589_6_) + private BakedQuad func_177589_a(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, ModelRotation p_177589_5_, boolean p_177589_6_) { +- return this.field_177607_l.func_178414_a(p_177589_1_.field_178241_a, p_177589_1_.field_178239_b, p_177589_2_, p_177589_3_, p_177589_4_, p_177589_5_, p_177589_1_.field_178237_d, p_177589_6_, p_177589_1_.field_178238_e); + return makeBakedQuad(p_177589_1_, p_177589_2_, p_177589_3_, p_177589_4_, (net.minecraftforge.client.model.ITransformation)p_177589_5_, p_177589_6_); -+ } -+ -+ protected BakedQuad makeBakedQuad(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, net.minecraftforge.client.model.ITransformation p_177589_5_, boolean p_177589_6_) -+ { - return this.faceBakery.makeBakedQuad(p_177589_1_.positionFrom, p_177589_1_.positionTo, p_177589_2_, p_177589_3_, p_177589_4_, p_177589_5_, p_177589_1_.partRotation, p_177589_6_, p_177589_1_.shade); } ++ protected BakedQuad makeBakedQuad(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, net.minecraftforge.client.model.ITransformation p_177589_5_, boolean p_177589_6_) ++ { ++ return this.field_177607_l.makeBakedQuad(p_177589_1_.field_178241_a, p_177589_1_.field_178239_b, p_177589_2_, p_177589_3_, p_177589_4_, p_177589_5_, p_177589_1_.field_178237_d, p_177589_6_, p_177589_1_.field_178238_e); ++ } ++ + private void func_177597_h() + { + this.func_177574_i(); @@ -722,4 +738,19 @@ - MODEL_CLOCK.name = "class generation marker"; - MODEL_ENTITY.name = "block entity marker"; + field_177617_q.field_178317_b = "class generation marker"; + field_177616_r.field_178317_b = "block entity marker"; } + + /*********************************************************** diff --git a/patches/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch b/patches/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch index 62b6e2b6e..9b92db76e 100644 --- a/patches/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch @@ -2,13 +2,13 @@ +++ ../src-work/minecraft/net/minecraft/client/resources/model/ModelManager.java @@ -24,9 +24,10 @@ - public void onResourceManagerReload(IResourceManager resourceManager) + public void func_110549_a(IResourceManager p_110549_1_) { -- ModelBakery modelbakery = new ModelBakery(resourceManager, this.texMap, this.modelProvider); -+ ModelBakery modelbakery = new net.minecraftforge.client.model.ModelLoader(resourceManager, this.texMap, this.modelProvider); - this.modelRegistry = modelbakery.setupModelRegistry(); - this.defaultModel = (IBakedModel)this.modelRegistry.getObject(ModelBakery.MODEL_MISSING); -+ net.minecraftforge.client.ForgeHooksClient.onModelBake(this, this.modelRegistry, modelbakery); - this.modelProvider.reloadModels(); +- ModelBakery modelbakery = new ModelBakery(p_110549_1_, this.field_174956_b, this.field_174957_c); ++ ModelBakery modelbakery = new net.minecraftforge.client.model.ModelLoader(p_110549_1_, this.field_174956_b, this.field_174957_c); + this.field_174958_a = modelbakery.func_177570_a(); + this.field_174955_d = (IBakedModel)this.field_174958_a.func_82594_a(ModelBakery.field_177604_a); ++ net.minecraftforge.client.ForgeHooksClient.onModelBake(this, this.field_174958_a, modelbakery); + this.field_174957_c.func_178124_c(); } diff --git a/patches/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch b/patches/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch index 33a8da83d..f7b079566 100644 --- a/patches/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch +++ b/patches/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch @@ -10,12 +10,12 @@ X0_Y0(0, 0), X0_Y90(0, 90), @@ -116,4 +116,9 @@ - mapRotations.put(Integer.valueOf(modelrotation.combinedXY), modelrotation); + field_177546_q.put(Integer.valueOf(modelrotation.field_177545_r), modelrotation); } } + + public net.minecraftforge.client.model.TRSRTransformation apply(net.minecraftforge.client.model.IModelPart part) { return new net.minecraftforge.client.model.TRSRTransformation(getMatrix()); } + public javax.vecmath.Matrix4f getMatrix() { return net.minecraftforge.client.ForgeHooksClient.getMatrix(this); } -+ public EnumFacing rotate(EnumFacing facing) { return rotateFace(facing); } -+ public int rotate(EnumFacing facing, int vertexIndex) { return rotateVertex(facing, vertexIndex); } ++ public EnumFacing rotate(EnumFacing facing) { return func_177523_a(facing); } ++ public int rotate(EnumFacing facing, int vertexIndex) { return func_177520_a(facing, vertexIndex); } } diff --git a/patches/minecraft/net/minecraft/client/settings/GameSettings.java.patch b/patches/minecraft/net/minecraft/client/settings/GameSettings.java.patch index 1b0f54267..72506bbfa 100644 --- a/patches/minecraft/net/minecraft/client/settings/GameSettings.java.patch +++ b/patches/minecraft/net/minecraft/client/settings/GameSettings.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/client/settings/GameSettings.java @@ -981,6 +981,7 @@ - public void saveOptions() + public void func_74303_b() { + if (net.minecraftforge.fml.client.FMLClientHandler.instance().isLoading()) return; try { - PrintWriter printwriter = new PrintWriter(new FileWriter(this.optionsFile)); + PrintWriter printwriter = new PrintWriter(new FileWriter(this.field_74354_ai)); diff --git a/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch b/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch index ec5e56034..5c9c777d2 100644 --- a/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch +++ b/patches/minecraft/net/minecraft/client/shader/Framebuffer.java.patch @@ -1,26 +1,26 @@ --- ../src-base/minecraft/net/minecraft/client/shader/Framebuffer.java +++ ../src-work/minecraft/net/minecraft/client/shader/Framebuffer.java @@ -119,8 +119,17 @@ - if (this.useDepth) + if (this.field_147619_e) { - OpenGlHelper.glBindRenderbuffer(OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer); + OpenGlHelper.func_153176_h(OpenGlHelper.field_153199_f, this.field_147624_h); + if (!this.stencilEnabled) + { - OpenGlHelper.glRenderbufferStorage(OpenGlHelper.GL_RENDERBUFFER, 33190, this.framebufferTextureWidth, this.framebufferTextureHeight); - OpenGlHelper.glFramebufferRenderbuffer(OpenGlHelper.GL_FRAMEBUFFER, OpenGlHelper.GL_DEPTH_ATTACHMENT, OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer); + OpenGlHelper.func_153186_a(OpenGlHelper.field_153199_f, 33190, this.field_147622_a, this.field_147620_b); + OpenGlHelper.func_153190_b(OpenGlHelper.field_153198_e, OpenGlHelper.field_153201_h, OpenGlHelper.field_153199_f, this.field_147624_h); + } + else + { -+ OpenGlHelper.glRenderbufferStorage(OpenGlHelper.GL_RENDERBUFFER, org.lwjgl.opengl.EXTPackedDepthStencil.GL_DEPTH24_STENCIL8_EXT, this.framebufferTextureWidth, this.framebufferTextureHeight); -+ OpenGlHelper.glFramebufferRenderbuffer(OpenGlHelper.GL_FRAMEBUFFER, org.lwjgl.opengl.EXTFramebufferObject.GL_DEPTH_ATTACHMENT_EXT, OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer); -+ OpenGlHelper.glFramebufferRenderbuffer(OpenGlHelper.GL_FRAMEBUFFER, org.lwjgl.opengl.EXTFramebufferObject.GL_STENCIL_ATTACHMENT_EXT, OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer); ++ OpenGlHelper.func_153186_a(OpenGlHelper.field_153199_f, org.lwjgl.opengl.EXTPackedDepthStencil.GL_DEPTH24_STENCIL8_EXT, this.field_147622_a, this.field_147620_b); ++ OpenGlHelper.func_153190_b(OpenGlHelper.field_153198_e, org.lwjgl.opengl.EXTFramebufferObject.GL_DEPTH_ATTACHMENT_EXT, OpenGlHelper.field_153199_f, this.field_147624_h); ++ OpenGlHelper.func_153190_b(OpenGlHelper.field_153198_e, org.lwjgl.opengl.EXTFramebufferObject.GL_STENCIL_ATTACHMENT_EXT, OpenGlHelper.field_153199_f, this.field_147624_h); + } } - this.framebufferClear(); + this.func_147614_f(); @@ -280,4 +289,36 @@ - GlStateManager.clear(i); - this.unbindFramebuffer(); + GlStateManager.func_179086_m(i); + this.func_147609_e(); } + + /*================================ FORGE START ================================================*/ @@ -39,9 +39,9 @@ + */ + public boolean enableStencil() + { -+ if (!OpenGlHelper.isFramebufferEnabled()) return false; ++ if (!OpenGlHelper.func_148822_b()) return false; + stencilEnabled = true; -+ this.createBindFramebuffer(framebufferWidth, framebufferHeight); ++ this.func_147613_a(field_147621_c, field_147618_d); + return true; //TODO: Find a way to detect if this failed? + } + diff --git a/patches/minecraft/net/minecraft/command/CommandEnchant.java.patch b/patches/minecraft/net/minecraft/command/CommandEnchant.java.patch index 630385eaa..361b3dc03 100644 --- a/patches/minecraft/net/minecraft/command/CommandEnchant.java.patch +++ b/patches/minecraft/net/minecraft/command/CommandEnchant.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/command/CommandEnchant.java @@ -93,7 +93,7 @@ { - Enchantment enchantment2 = Enchantment.getEnchantmentById(l); + Enchantment enchantment2 = Enchantment.func_180306_c(l); -- if (!enchantment2.canApplyTogether(enchantment1)) -+ if (!enchantment2.canApplyTogether(enchantment1) || !enchantment1.canApplyTogether(enchantment2)) //Forge BugFix: Let Both enchantments veto being together +- if (!enchantment2.func_77326_a(enchantment1)) ++ if (!enchantment2.func_77326_a(enchantment1) || !enchantment1.func_77326_a(enchantment2)) //Forge BugFix: Let Both enchantments veto being together { - throw new CommandException("commands.enchant.cantCombine", new Object[] {enchantment1.getTranslatedName(j), enchantment2.getTranslatedName(nbttaglist.getCompoundTagAt(k).getShort("lvl"))}); + throw new CommandException("commands.enchant.cantCombine", new Object[] {enchantment1.func_77316_c(j), enchantment2.func_77316_c(nbttaglist.func_150305_b(k).func_74765_d("lvl"))}); } diff --git a/patches/minecraft/net/minecraft/command/CommandFill.java.patch b/patches/minecraft/net/minecraft/command/CommandFill.java.patch index 777a3d061..c9950fe71 100644 --- a/patches/minecraft/net/minecraft/command/CommandFill.java.patch +++ b/patches/minecraft/net/minecraft/command/CommandFill.java.patch @@ -2,27 +2,27 @@ +++ ../src-work/minecraft/net/minecraft/command/CommandFill.java @@ -48,6 +48,7 @@ { - i = parseInt(args[7], 0, 15); + i = func_175764_a(p_71515_2_[7], 0, 15); } -+ IBlockState state = block.getStateFromMeta(i); ++ IBlockState state = block.func_176203_a(i); - BlockPos blockpos2 = new BlockPos(Math.min(blockpos.getX(), blockpos1.getX()), Math.min(blockpos.getY(), blockpos1.getY()), Math.min(blockpos.getZ(), blockpos1.getZ())); - BlockPos blockpos3 = new BlockPos(Math.max(blockpos.getX(), blockpos1.getX()), Math.max(blockpos.getY(), blockpos1.getY()), Math.max(blockpos.getZ(), blockpos1.getZ())); + BlockPos blockpos2 = new BlockPos(Math.min(blockpos.func_177958_n(), blockpos1.func_177958_n()), Math.min(blockpos.func_177956_o(), blockpos1.func_177956_o()), Math.min(blockpos.func_177952_p(), blockpos1.func_177952_p())); + BlockPos blockpos3 = new BlockPos(Math.max(blockpos.func_177958_n(), blockpos1.func_177958_n()), Math.max(blockpos.func_177956_o(), blockpos1.func_177956_o()), Math.max(blockpos.func_177952_p(), blockpos1.func_177952_p())); @@ -75,7 +76,7 @@ NBTTagCompound nbttagcompound = new NBTTagCompound(); boolean flag = false; -- if (args.length >= 10 && block.hasTileEntity()) -+ if (args.length >= 10 && block.hasTileEntity(state)) +- if (p_71515_2_.length >= 10 && block.func_149716_u()) ++ if (p_71515_2_.length >= 10 && block.hasTileEntity(state)) { - String s = getChatComponentFromNthArg(sender, args, 9).getUnformattedText(); + String s = func_147178_a(p_71515_1_, p_71515_2_, 9).func_150260_c(); @@ -116,7 +117,7 @@ continue; } } -- else if (args[8].equals("replace") && !block.hasTileEntity()) -+ else if (args[8].equals("replace") && !block.hasTileEntity(state)) +- else if (p_71515_2_[8].equals("replace") && !block.func_149716_u()) ++ else if (p_71515_2_[8].equals("replace") && !block.hasTileEntity(state)) { - if (args.length > 9) + if (p_71515_2_.length > 9) { diff --git a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch index 3d877eba8..1bc893d80 100644 --- a/patches/minecraft/net/minecraft/command/CommandHandler.java.patch +++ b/patches/minecraft/net/minecraft/command/CommandHandler.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/command/CommandHandler.java @@ -44,6 +44,16 @@ } - else if (icommand.canCommandSenderUse(sender)) + else if (icommand.func_71519_b(p_71556_1_)) { -+ net.minecraftforge.event.CommandEvent event = new net.minecraftforge.event.CommandEvent(icommand, sender, astring); ++ net.minecraftforge.event.CommandEvent event = new net.minecraftforge.event.CommandEvent(icommand, p_71556_1_, astring); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) + { + if (event.exception != null) @@ -16,4 +16,4 @@ + if (i > -1) { - List list = PlayerSelector.matchEntities(sender, astring[i], Entity.class); + List list = PlayerSelector.func_179656_b(p_71556_1_, astring[i], Entity.class); diff --git a/patches/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch b/patches/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch index b67266339..e5ef73f0b 100644 --- a/patches/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch +++ b/patches/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch @@ -1,20 +1,20 @@ --- ../src-base/minecraft/net/minecraft/command/server/CommandSetBlock.java +++ ../src-work/minecraft/net/minecraft/command/server/CommandSetBlock.java @@ -52,6 +52,8 @@ - i = parseInt(args[4], 0, 15); + i = func_175764_a(p_71515_2_[4], 0, 15); } -+ IBlockState state = block.getStateFromMeta(i); ++ IBlockState state = block.func_176203_a(i); + - World world = sender.getEntityWorld(); + World world = p_71515_1_.func_130014_f_(); - if (!world.isBlockLoaded(blockpos)) + if (!world.func_175667_e(blockpos)) @@ -63,7 +65,7 @@ NBTTagCompound nbttagcompound = new NBTTagCompound(); boolean flag = false; -- if (args.length >= 7 && block.hasTileEntity()) -+ if (args.length >= 7 && block.hasTileEntity(state)) +- if (p_71515_2_.length >= 7 && block.func_149716_u()) ++ if (p_71515_2_.length >= 7 && block.hasTileEntity(state)) { - String s = getChatComponentFromNthArg(sender, args, 6).getUnformattedText(); + String s = func_147178_a(p_71515_1_, p_71515_2_, 6).func_150260_c(); diff --git a/patches/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch b/patches/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch index be6dce538..a9dae5314 100644 --- a/patches/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch +++ b/patches/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch @@ -4,8 +4,8 @@ NBTTagCompound nbttagcompound = new NBTTagCompound(); boolean flag = false; -- if (args.length >= 6 && block.hasTileEntity()) -+ if (args.length >= 6 && block.hasTileEntity(block.getStateFromMeta(i))) +- if (p_71515_2_.length >= 6 && block.func_149716_u()) ++ if (p_71515_2_.length >= 6 && block.hasTileEntity(block.func_176203_a(i))) { - String s = getChatComponentFromNthArg(sender, args, 5).getUnformattedText(); + String s = func_147178_a(p_71515_1_, p_71515_2_, 5).func_150260_c(); diff --git a/patches/minecraft/net/minecraft/crash/CrashReport.java.patch b/patches/minecraft/net/minecraft/crash/CrashReport.java.patch index 2ad18820d..7b4d498c8 100644 --- a/patches/minecraft/net/minecraft/crash/CrashReport.java.patch +++ b/patches/minecraft/net/minecraft/crash/CrashReport.java.patch @@ -1,13 +1,13 @@ --- ../src-base/minecraft/net/minecraft/crash/CrashReport.java +++ ../src-work/minecraft/net/minecraft/crash/CrashReport.java @@ -115,6 +115,7 @@ - return IntCache.getCacheSizes(); + return IntCache.func_85144_b(); } }); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().enhanceCrashReport(this, this.theReportCategory); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().enhanceCrashReport(this, this.field_85061_c); } - public String getDescription() + public String func_71501_a() @@ -203,6 +204,8 @@ { StringBuilder stringbuilder = new StringBuilder(); @@ -15,5 +15,5 @@ + net.minecraftforge.fml.common.asm.transformers.BlamingTransformer.onCrash(stringbuilder); + net.minecraftforge.fml.relauncher.CoreModManager.onCrash(stringbuilder); stringbuilder.append("// "); - stringbuilder.append(getWittyComment()); + stringbuilder.append(func_71503_h()); stringbuilder.append("\n\n"); diff --git a/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch b/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch index 3918b6866..6af34573d 100644 --- a/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch +++ b/patches/minecraft/net/minecraft/crash/CrashReportCategory.java.patch @@ -4,13 +4,13 @@ } else { -- this.stackTrace = new StackTraceElement[astacktraceelement.length - 3 - size]; -- System.arraycopy(astacktraceelement, 3 + size, this.stackTrace, 0, this.stackTrace.length); -+ int len = astacktraceelement.length - 3 - size; +- this.field_85075_d = new StackTraceElement[astacktraceelement.length - 3 - p_85073_1_]; +- System.arraycopy(astacktraceelement, 3 + p_85073_1_, this.field_85075_d, 0, this.field_85075_d.length); ++ int len = astacktraceelement.length - 3 - p_85073_1_; + // Really Mojang, Still, god damn... + if (len <= 0) len = astacktraceelement.length; -+ this.stackTrace = new StackTraceElement[len]; -+ System.arraycopy(astacktraceelement, astacktraceelement.length - len, this.stackTrace, 0, this.stackTrace.length); - return this.stackTrace.length; ++ this.field_85075_d = new StackTraceElement[len]; ++ System.arraycopy(astacktraceelement, astacktraceelement.length - len, this.field_85075_d, 0, this.field_85075_d.length); + return this.field_85075_d.length; } } diff --git a/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch b/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch index 83ecfbcea..d8d07737b 100644 --- a/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch +++ b/patches/minecraft/net/minecraft/creativetab/CreativeTabs.java.patch @@ -2,68 +2,68 @@ +++ ../src-work/minecraft/net/minecraft/creativetab/CreativeTabs.java @@ -125,8 +125,22 @@ @SideOnly(Side.CLIENT) - private ItemStack iconItemStack; + private ItemStack field_151245_t; + public CreativeTabs(String label) + { + this(getNextID(), label); + } + - public CreativeTabs(int index, String label) + public CreativeTabs(int p_i1853_1_, String p_i1853_2_) { -+ if (index >= creativeTabArray.length) ++ if (p_i1853_1_ >= field_78032_a.length) + { -+ CreativeTabs[] tmp = new CreativeTabs[index + 1]; -+ for (int x = 0; x < creativeTabArray.length; x++) ++ CreativeTabs[] tmp = new CreativeTabs[p_i1853_1_ + 1]; ++ for (int x = 0; x < field_78032_a.length; x++) + { -+ tmp[x] = creativeTabArray[x]; ++ tmp[x] = field_78032_a[x]; + } -+ creativeTabArray = tmp; ++ field_78032_a = tmp; + } - this.tabIndex = index; - this.tabLabel = label; - creativeTabArray[index] = this; + this.field_78033_n = p_i1853_1_; + this.field_78034_o = p_i1853_2_; + field_78032_a[p_i1853_1_] = this; @@ -209,12 +223,20 @@ @SideOnly(Side.CLIENT) - public int getTabColumn() + public int func_78020_k() { -+ if (tabIndex > 11) ++ if (field_78033_n > 11) + { -+ return ((tabIndex - 12) % 10) % 5; ++ return ((field_78033_n - 12) % 10) % 5; + } - return this.tabIndex % 6; + return this.field_78033_n % 6; } @SideOnly(Side.CLIENT) - public boolean isTabInFirstRow() + public boolean func_78023_l() { -+ if (tabIndex > 11) ++ if (field_78033_n > 11) + { -+ return ((tabIndex - 12) % 10) < 5; ++ return ((field_78033_n - 12) % 10) < 5; + } - return this.tabIndex < 6; + return this.field_78033_n < 6; } @@ -256,10 +278,17 @@ { - for (Item item : Item.itemRegistry) + for (Item item : Item.field_150901_e) { -- if (item != null && item.getCreativeTab() == this) +- if (item != null && item.func_77640_w() == this) + if (item == null) { -- item.getSubItems(item, this, p_78018_1_); +- item.func_150895_a(item, this, p_78018_1_); + continue; } + for (CreativeTabs tab : item.getCreativeTabs()) + { + if (tab == this) + { -+ item.getSubItems(item, this, p_78018_1_); ++ item.func_150895_a(item, this, p_78018_1_); + } + } } - if (this.getRelevantEnchantmentTypes() != null) + if (this.func_111225_m() != null) @@ -292,4 +321,39 @@ } } @@ -71,16 +71,16 @@ + + public int getTabPage() + { -+ if (tabIndex > 11) ++ if (field_78033_n > 11) + { -+ return ((tabIndex - 12) / 10) + 1; ++ return ((field_78033_n - 12) / 10) + 1; + } + return 0; + } + + public static int getNextID() + { -+ return creativeTabArray.length; ++ return field_78032_a.length; + } + + /** @@ -90,7 +90,7 @@ + */ + public boolean hasSearchBar() + { -+ return tabIndex == CreativeTabs.tabAllSearch.tabIndex; ++ return field_78033_n == CreativeTabs.field_78027_g.field_78033_n; + } + + /** diff --git a/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch b/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch index f3dc07bd2..92f2bc57b 100644 --- a/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch +++ b/patches/minecraft/net/minecraft/enchantment/Enchantment.java.patch @@ -2,22 +2,22 @@ +++ ../src-work/minecraft/net/minecraft/enchantment/Enchantment.java @@ -61,7 +61,7 @@ - if (enchantmentsList[enchID] != null) + if (field_180311_a[p_i45771_1_] != null) { - throw new IllegalArgumentException("Duplicate enchantment id!"); -+ throw new IllegalArgumentException("Duplicate enchantment id! " + this.getClass() + " and " + enchantmentsList[enchID].getClass() + " Enchantment ID:" + enchID); ++ throw new IllegalArgumentException("Duplicate enchantment id! " + this.getClass() + " and " + field_180311_a[p_i45771_1_].getClass() + " Enchantment ID:" + p_i45771_1_); } else { @@ -139,7 +139,7 @@ - public boolean canApply(ItemStack stack) + public boolean func_92089_a(ItemStack p_92089_1_) { -- return this.type.canEnchantItem(stack.getItem()); -+ return canApplyAtEnchantingTable(stack); +- return this.field_77351_y.func_77557_a(p_92089_1_.func_77973_b()); ++ return canApplyAtEnchantingTable(p_92089_1_); } - public void onEntityDamaged(EntityLivingBase user, Entity target, int level) + public void func_151368_a(EntityLivingBase p_151368_1_, Entity p_151368_2_, int p_151368_3_) @@ -150,6 +150,45 @@ { } @@ -30,7 +30,7 @@ + */ + public boolean canApplyAtEnchantingTable(ItemStack stack) + { -+ return this.type.canEnchantItem(stack.getItem()); ++ return this.field_77351_y.func_77557_a(stack.func_77973_b()); + } + + private static final java.lang.reflect.Field bookSetter = Enchantment.class.getDeclaredFields()[1]; @@ -44,7 +44,7 @@ + try + { + net.minecraftforge.common.util.EnumHelper.setFailsafeFieldValue(bookSetter, null, -+ com.google.common.collect.ObjectArrays.concat(enchantmentsBookList, enchantment)); ++ com.google.common.collect.ObjectArrays.concat(field_77331_b, enchantment)); + } + catch (Exception e) + { diff --git a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch index 7632c6c5d..fe2ae4132 100644 --- a/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch +++ b/patches/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch @@ -1,19 +1,19 @@ --- ../src-base/minecraft/net/minecraft/enchantment/EnchantmentHelper.java +++ ../src-work/minecraft/net/minecraft/enchantment/EnchantmentHelper.java @@ -296,7 +296,7 @@ - public static int calcItemStackEnchantability(Random p_77514_0_, int p_77514_1_, int p_77514_2_, ItemStack p_77514_3_) + public static int func_77514_a(Random p_77514_0_, int p_77514_1_, int p_77514_2_, ItemStack p_77514_3_) { - Item item = p_77514_3_.getItem(); -- int i = item.getItemEnchantability(); + Item item = p_77514_3_.func_77973_b(); +- int i = item.func_77619_b(); + int i = item.getItemEnchantability(p_77514_3_); if (i <= 0) { @@ -345,7 +345,7 @@ - public static List buildEnchantmentList(Random p_77513_0_, ItemStack p_77513_1_, int p_77513_2_) + public static List func_77513_b(Random p_77513_0_, ItemStack p_77513_1_, int p_77513_2_) { - Item item = p_77513_1_.getItem(); -- int i = item.getItemEnchantability(); + Item item = p_77513_1_.func_77973_b(); +- int i = item.func_77619_b(); + int i = item.getItemEnchantability(p_77513_1_); if (i <= 0) @@ -22,20 +22,20 @@ for (EnchantmentData enchantmentdata1 : list) { -- if (!enchantmentdata1.enchantmentobj.canApplyTogether(Enchantment.getEnchantmentById(integer.intValue()))) -+ Enchantment e1 = enchantmentdata1.enchantmentobj; -+ Enchantment e2 = Enchantment.getEnchantmentById(integer.intValue()); -+ if (e1.canApplyTogether(e2) && e2.canApplyTogether(e1)) //Forge BugFix: Let Both enchantments veto being together +- if (!enchantmentdata1.field_76302_b.func_77326_a(Enchantment.func_180306_c(integer.intValue()))) ++ Enchantment e1 = enchantmentdata1.field_76302_b; ++ Enchantment e2 = Enchantment.func_180306_c(integer.intValue()); ++ if (e1.func_77326_a(e2) && e2.func_77326_a(e1)) //Forge BugFix: Let Both enchantments veto being together { flag = false; break; @@ -421,7 +423,8 @@ - for (Enchantment enchantment : Enchantment.enchantmentsBookList) + for (Enchantment enchantment : Enchantment.field_77331_b) { -- if (enchantment != null && (enchantment.type.canEnchantItem(item) || flag)) +- if (enchantment != null && (enchantment.field_77351_y.func_77557_a(item) || flag)) + if (enchantment == null) continue; + if (enchantment.canApplyAtEnchantingTable(p_77505_1_) || (flag && enchantment.isAllowedOnBooks())) { - for (int i = enchantment.getMinLevel(); i <= enchantment.getMaxLevel(); ++i) + for (int i = enchantment.func_77319_d(); i <= enchantment.func_77325_b(); ++i) { diff --git a/patches/minecraft/net/minecraft/entity/Entity.java.patch b/patches/minecraft/net/minecraft/entity/Entity.java.patch index e19b11f4d..2b356e922 100644 --- a/patches/minecraft/net/minecraft/entity/Entity.java.patch +++ b/patches/minecraft/net/minecraft/entity/Entity.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/entity/Entity.java +++ ../src-work/minecraft/net/minecraft/entity/Entity.java @@ -129,6 +129,14 @@ - protected UUID entityUniqueID; - private final CommandResultStats cmdResultStats; + protected UUID field_96093_i; + private final CommandResultStats field_174837_as; + /** Forge: Used to store custom data for each entity. */ + private NBTTagCompound customEntityData; @@ -12,41 +12,41 @@ + + protected java.util.HashMap extendedProperties = new java.util.HashMap(); + - public int getEntityId() + public int func_145782_y() { - return this.entityId; + return this.field_145783_c; @@ -172,6 +180,8 @@ - this.dataWatcher.addObject(2, ""); - this.dataWatcher.addObject(4, Byte.valueOf((byte)0)); - this.entityInit(); + this.field_70180_af.func_75682_a(2, ""); + this.field_70180_af.func_75682_a(4, Byte.valueOf((byte)0)); + this.func_70088_a(); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityEvent.EntityConstructing(this)); -+ for (net.minecraftforge.common.IExtendedEntityProperties props : extendedProperties.values()) props.init(this, worldIn); ++ for (net.minecraftforge.common.IExtendedEntityProperties props : extendedProperties.values()) props.init(this, p_i1582_1_); } - protected abstract void entityInit(); + protected abstract void func_70088_a(); @@ -998,10 +1008,7 @@ - if (block.getMaterial() == materialIn) + if (block.func_149688_o() == p_70055_1_) { -- float f = BlockLiquid.getLiquidHeightPercent(iblockstate.getBlock().getMetaFromState(iblockstate)) - 0.11111111F; -- float f1 = (float)(blockpos.getY() + 1) - f; +- float f = BlockLiquid.func_149801_b(iblockstate.func_177230_c().func_176201_c(iblockstate)) - 0.11111111F; +- float f1 = (float)(blockpos.func_177956_o() + 1) - f; - boolean flag = d0 < (double)f1; - return !flag && this instanceof EntityPlayer ? false : flag; -+ return net.minecraftforge.common.ForgeHooks.isInsideOfMaterial(materialIn, this, blockpos); ++ return net.minecraftforge.common.ForgeHooks.isInsideOfMaterial(p_70055_1_, this, blockpos); } else { @@ -1356,6 +1363,21 @@ - tagCompund.setBoolean("Silent", this.isSilent()); + p_70109_1_.func_74757_a("Silent", this.func_174814_R()); } -+ if (customEntityData != null) tagCompund.setTag("ForgeData", customEntityData); ++ if (customEntityData != null) p_70109_1_.func_74782_a("ForgeData", customEntityData); + for (String identifier : this.extendedProperties.keySet()) + { + try + { + net.minecraftforge.common.IExtendedEntityProperties props = this.extendedProperties.get(identifier); -+ props.saveNBTData(tagCompund); ++ props.saveNBTData(p_70109_1_); + } + catch (Throwable t) + { @@ -55,21 +55,21 @@ + } + } + - this.writeEntityToNBT(tagCompund); + this.func_70014_b(p_70109_1_); - if (this.ridingEntity != null) + if (this.field_70154_o != null) @@ -1438,6 +1460,28 @@ - this.setAlwaysRenderNameTag(tagCompund.getBoolean("CustomNameVisible")); - this.cmdResultStats.func_179668_a(tagCompund); - this.setSilent(tagCompund.getBoolean("Silent")); + this.func_174805_g(p_70020_1_.func_74767_n("CustomNameVisible")); + this.field_174837_as.func_179668_a(p_70020_1_); + this.func_174810_b(p_70020_1_.func_74767_n("Silent")); + -+ if (tagCompund.hasKey("ForgeData")) customEntityData = tagCompund.getCompoundTag("ForgeData"); ++ if (p_70020_1_.func_74764_b("ForgeData")) customEntityData = p_70020_1_.func_74775_l("ForgeData"); + for (String identifier : this.extendedProperties.keySet()) + { + try + { + net.minecraftforge.common.IExtendedEntityProperties props = this.extendedProperties.get(identifier); -+ props.loadNBTData(tagCompund); ++ props.loadNBTData(p_70020_1_); + } + catch (Throwable t) + { @@ -79,52 +79,52 @@ + } + + //Rawr, legacy code, Vanilla added a UUID, keep this so older maps will convert properly -+ if (tagCompund.hasKey("PersistentIDMSB") && tagCompund.hasKey("PersistentIDLSB")) ++ if (p_70020_1_.func_74764_b("PersistentIDMSB") && p_70020_1_.func_74764_b("PersistentIDLSB")) + { -+ this.entityUniqueID = new UUID(tagCompund.getLong("PersistentIDMSB"), tagCompund.getLong("PersistentIDLSB")); ++ this.field_96093_i = new UUID(p_70020_1_.func_74763_f("PersistentIDMSB"), p_70020_1_.func_74763_f("PersistentIDLSB")); + } + - this.readEntityFromNBT(tagCompund); + this.func_70037_a(p_70020_1_); - if (this.shouldSetPosAfterLoading()) + if (this.func_142008_O()) @@ -1512,7 +1556,10 @@ { - EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double)offsetY, this.posZ, itemStackIn); - entityitem.setDefaultPickupDelay(); -- this.worldObj.spawnEntityInWorld(entityitem); + EntityItem entityitem = new EntityItem(this.field_70170_p, this.field_70165_t, this.field_70163_u + (double)p_70099_2_, this.field_70161_v, p_70099_1_); + entityitem.func_174869_p(); +- this.field_70170_p.func_72838_d(entityitem); + if (captureDrops) + this.capturedDrops.add(entityitem); + else -+ this.worldObj.spawnEntityInWorld(entityitem); ++ this.field_70170_p.func_72838_d(entityitem); return entityitem; } else @@ -1655,6 +1702,7 @@ - public void mountEntity(Entity entityIn) + public void func_70078_a(Entity p_70078_1_) { -+ if(!(this instanceof EntityLivingBase) && !net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, entityIn, true)){ return; } - this.entityRiderPitchDelta = 0.0D; - this.entityRiderYawDelta = 0.0D; ++ if(!(this instanceof EntityLivingBase) && !net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, p_70078_1_, true)){ return; } + this.field_70149_e = 0.0D; + this.field_70147_f = 0.0D; @@ -1789,7 +1837,7 @@ - public boolean isRiding() + public boolean func_70115_ae() { -- return this.ridingEntity != null; -+ return this.ridingEntity != null && ridingEntity.shouldRiderSit(); +- return this.field_70154_o != null; ++ return this.field_70154_o != null && field_70154_o.shouldRiderSit(); } - public boolean isSneaking() + public boolean func_70093_af() @@ -2092,7 +2140,7 @@ - public float getExplosionResistance(Explosion p_180428_1_, World worldIn, BlockPos p_180428_3_, IBlockState p_180428_4_) + public float func_180428_a(Explosion p_180428_1_, World p_180428_2_, BlockPos p_180428_3_, IBlockState p_180428_4_) { -- return p_180428_4_.getBlock().getExplosionResistance(this); -+ return p_180428_4_.getBlock().getExplosionResistance(worldIn, p_180428_3_.add(0, getEyeHeight(), 0), this, p_180428_1_); +- return p_180428_4_.func_177230_c().func_149638_a(this); ++ return p_180428_4_.func_177230_c().getExplosionResistance(p_180428_2_, p_180428_3_.func_177963_a(0, func_70047_e(), 0), this, p_180428_1_); } - public boolean func_174816_a(Explosion p_174816_1_, World worldIn, BlockPos p_174816_3_, IBlockState p_174816_4_, float p_174816_5_) + public boolean func_174816_a(Explosion p_174816_1_, World p_174816_2_, BlockPos p_174816_3_, IBlockState p_174816_4_, float p_174816_5_) @@ -2353,4 +2401,184 @@ EnchantmentHelper.func_151385_b(p_174815_1_, p_174815_2_); @@ -164,22 +164,22 @@ + { + if (this instanceof net.minecraft.entity.item.EntityPainting) + { -+ return new ItemStack(net.minecraft.init.Items.painting); ++ return new ItemStack(net.minecraft.init.Items.field_151159_an); + } + else if (this instanceof EntityLeashKnot) + { -+ return new ItemStack(net.minecraft.init.Items.lead); ++ return new ItemStack(net.minecraft.init.Items.field_151058_ca); + } + else if (this instanceof net.minecraft.entity.item.EntityItemFrame) + { -+ ItemStack held = ((net.minecraft.entity.item.EntityItemFrame)this).getDisplayedItem(); ++ ItemStack held = ((net.minecraft.entity.item.EntityItemFrame)this).func_82335_i(); + if (held == null) + { -+ return new ItemStack(net.minecraft.init.Items.item_frame); ++ return new ItemStack(net.minecraft.init.Items.field_151160_bD); + } + else + { -+ return held.copy(); ++ return held.func_77946_l(); + } + } + else if (this instanceof net.minecraft.entity.item.EntityMinecart) @@ -188,24 +188,24 @@ + } + else if (this instanceof net.minecraft.entity.item.EntityBoat) + { -+ return new ItemStack(net.minecraft.init.Items.boat); ++ return new ItemStack(net.minecraft.init.Items.field_151124_az); + } + else if (this instanceof net.minecraft.entity.item.EntityArmorStand) + { -+ return new ItemStack(net.minecraft.init.Items.armor_stand); ++ return new ItemStack(net.minecraft.init.Items.field_179565_cj); + } + else + { -+ int id = EntityList.getEntityID(this); -+ if (id > 0 && EntityList.entityEggs.containsKey(id)) ++ int id = EntityList.func_75619_a(this); ++ if (id > 0 && EntityList.field_75627_a.containsKey(id)) + { -+ return new ItemStack(net.minecraft.init.Items.spawn_egg, 1, id); ++ return new ItemStack(net.minecraft.init.Items.field_151063_bx, 1, id); + } -+ String name = EntityList.getEntityString(this); ++ String name = EntityList.func_75621_b(this); + if (name != null && net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().containsKey(name)) + { -+ ItemStack stack = new ItemStack(net.minecraft.init.Items.spawn_egg); -+ stack.setTagInfo("entity_name", new net.minecraft.nbt.NBTTagString(name)); ++ ItemStack stack = new ItemStack(net.minecraft.init.Items.field_151063_bx); ++ stack.func_77983_a("entity_name", new net.minecraft.nbt.NBTTagString(name)); + return stack; + } + } @@ -214,7 +214,7 @@ + + public UUID getPersistentID() + { -+ return entityUniqueID; ++ return field_96093_i; + } + + /** @@ -222,7 +222,7 @@ + */ + public final void resetEntityId() + { -+ this.entityId = nextEntityID++; ++ this.field_145783_c = field_70152_a++; + } + + public boolean shouldRenderInPass(int pass) @@ -238,8 +238,8 @@ + */ + public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount) + { -+ if (forSpawnCount && (this instanceof EntityLiving) && ((EntityLiving)this).isNoDespawnRequired()) return false; -+ return type.getCreatureClass().isAssignableFrom(this.getClass()); ++ if (forSpawnCount && (this instanceof EntityLiving) && ((EntityLiving)this).func_104002_bU()) return false; ++ return type.func_75598_a().isAssignableFrom(this.getClass()); + } + + /** diff --git a/patches/minecraft/net/minecraft/entity/EntityHanging.java.patch b/patches/minecraft/net/minecraft/entity/EntityHanging.java.patch index e064546a1..29d340d07 100644 --- a/patches/minecraft/net/minecraft/entity/EntityHanging.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityHanging.java.patch @@ -2,11 +2,11 @@ +++ ../src-work/minecraft/net/minecraft/entity/EntityHanging.java @@ -123,6 +123,9 @@ { - BlockPos blockpos1 = blockpos.offset(enumfacing, k).up(l); - Block block = this.worldObj.getBlockState(blockpos1).getBlock(); + BlockPos blockpos1 = blockpos.func_177967_a(enumfacing, k).func_177981_b(l); + Block block = this.field_70170_p.func_180495_p(blockpos1).func_177230_c(); + -+ if ( block.isSideSolid( this.worldObj, blockpos1, this.field_174860_b )) ++ if ( block.isSideSolid( this.field_70170_p, blockpos1, this.field_174860_b )) + continue; - if (!block.getMaterial().isSolid() && !BlockRedstoneDiode.isRedstoneRepeaterBlockID(block)) + if (!block.func_149688_o().func_76220_a() && !BlockRedstoneDiode.func_149909_d(block)) { diff --git a/patches/minecraft/net/minecraft/entity/EntityList.java.patch b/patches/minecraft/net/minecraft/entity/EntityList.java.patch index ed5935e63..0a51ed53e 100644 --- a/patches/minecraft/net/minecraft/entity/EntityList.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityList.java.patch @@ -2,21 +2,21 @@ +++ ../src-work/minecraft/net/minecraft/entity/EntityList.java @@ -88,6 +88,7 @@ - public static void addMapping(Class p_75618_0_, String p_75618_1_, int p_75618_2_) + public static void func_75618_a(Class p_75618_0_, String p_75618_1_, int p_75618_2_) { + if (p_75618_2_ < 0 || p_75618_2_ > 255) throw new IllegalArgumentException("Attempted to register a entity with invalid ID: " + p_75618_2_ + " Name: " + p_75618_1_ + " Class: " + p_75618_0_); - if (stringToClassMapping.containsKey(p_75618_1_)) + if (field_75625_b.containsKey(p_75618_1_)) { throw new IllegalArgumentException("ID is already registered: " + p_75618_1_); @@ -151,9 +152,10 @@ - p_75615_0_.removeTag("Type"); + p_75615_0_.func_82580_o("Type"); } + Class oclass = null; try { -- Class oclass = (Class)stringToClassMapping.get(p_75615_0_.getString("id")); -+ oclass = stringToClassMapping.get(p_75615_0_.getString("id")); +- Class oclass = (Class)field_75625_b.get(p_75615_0_.func_74779_i("id")); ++ oclass = field_75625_b.get(p_75615_0_.func_74779_i("id")); if (oclass != null) { @@ -26,13 +26,13 @@ { + try + { - entity.readFromNBT(p_75615_0_); + entity.func_70020_e(p_75615_0_); + } + catch (Exception e) + { + net.minecraftforge.fml.common.FMLLog.log(org.apache.logging.log4j.Level.ERROR, e, + "An Entity %s(%s) has thrown an exception during loading, its state cannot be restored. Report this to the mod author", -+ p_75615_0_.getString("id"), oclass.getName()); ++ p_75615_0_.func_74779_i("id"), oclass.getName()); + entity = null; + } } @@ -43,26 +43,26 @@ public static class EntityEggInfo { + @Deprecated // This is not always a valid number in the global ID list. - public final int spawnedID; + public final int field_75613_a; + public final String name; - public final int primaryColor; - public final int secondaryColor; + public final int field_75611_b; + public final int field_75612_c; public final StatBase field_151512_d; @@ -356,6 +370,17 @@ - this.secondaryColor = p_i1583_3_; - this.field_151512_d = StatList.getStatKillEntity(this); - this.field_151513_e = StatList.getStatEntityKilledBy(this); -+ this.name = EntityList.getStringFromID(p_i1583_1_); + this.field_75612_c = p_i1583_3_; + this.field_151512_d = StatList.func_151182_a(this); + this.field_151513_e = StatList.func_151176_b(this); ++ this.name = EntityList.func_75617_a(p_i1583_1_); } + + public EntityEggInfo(String name, int primaryColor, int secondaryColor) + { -+ this.spawnedID = -1; ++ this.field_75613_a = -1; + this.name = name; -+ this.primaryColor = primaryColor; -+ this.secondaryColor = secondaryColor; -+ this.field_151512_d = (new StatBase("stat.killEntity." + name, new net.minecraft.util.ChatComponentTranslation("stat.entityKill", new net.minecraft.util.ChatComponentTranslation("entity." + name + ".name")))).registerStat(); -+ this.field_151513_e = (new StatBase("stat.entityKilledBy." + name, new net.minecraft.util.ChatComponentTranslation("stat.entityKilledBy", new net.minecraft.util.ChatComponentTranslation("entity." + name + ".name")))).registerStat(); ++ this.field_75611_b = primaryColor; ++ this.field_75612_c = secondaryColor; ++ this.field_151512_d = (new StatBase("stat.killEntity." + name, new net.minecraft.util.ChatComponentTranslation("stat.entityKill", new net.minecraft.util.ChatComponentTranslation("entity." + name + ".name")))).func_75971_g(); ++ this.field_151513_e = (new StatBase("stat.entityKilledBy." + name, new net.minecraft.util.ChatComponentTranslation("stat.entityKilledBy", new net.minecraft.util.ChatComponentTranslation("entity." + name + ".name")))).func_75971_g(); + } } } diff --git a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch index c5577637a..915de5e84 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch @@ -1,41 +1,41 @@ --- ../src-base/minecraft/net/minecraft/entity/EntityLiving.java +++ ../src-work/minecraft/net/minecraft/entity/EntityLiving.java @@ -121,6 +121,7 @@ - public void setAttackTarget(EntityLivingBase p_70624_1_) + public void func_70624_b(EntityLivingBase p_70624_1_) { - this.attackTarget = p_70624_1_; + this.field_70696_bz = p_70624_1_; + net.minecraftforge.common.ForgeHooks.onLivingSetAttackTarget(this, p_70624_1_); } - public boolean canAttackClass(Class p_70686_1_) + public boolean func_70686_a(Class p_70686_1_) @@ -498,10 +499,22 @@ - protected void despawnEntity() + protected void func_70623_bb() { + net.minecraftforge.fml.common.eventhandler.Event.Result result = null; - if (this.persistenceRequired) + if (this.field_82179_bU) { - this.entityAge = 0; + this.field_70708_bq = 0; } -+ else if ((this.entityAge & 0x1F) == 0x1F && (result = net.minecraftforge.event.ForgeEventFactory.canEntityDespawn(this)) != net.minecraftforge.fml.common.eventhandler.Event.Result.DEFAULT) ++ else if ((this.field_70708_bq & 0x1F) == 0x1F && (result = net.minecraftforge.event.ForgeEventFactory.canEntityDespawn(this)) != net.minecraftforge.fml.common.eventhandler.Event.Result.DEFAULT) + { + if (result == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) + { -+ this.entityAge = 0; ++ this.field_70708_bq = 0; + } + else + { -+ this.setDead(); ++ this.func_70106_y(); + } + } else { - Entity entity = this.worldObj.getClosestPlayerToEntity(this, -1.0D); + Entity entity = this.field_70170_p.func_72890_a(this, -1.0D); @@ -621,7 +634,6 @@ - return this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox(), this) && this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty() && !this.worldObj.isAnyLiquid(this.getEntityBoundingBox()); + return this.field_70170_p.func_72917_a(this.func_174813_aQ(), this) && this.field_70170_p.func_72945_a(this, this.func_174813_aQ()).isEmpty() && !this.field_70170_p.func_72953_d(this.func_174813_aQ()); } - @SideOnly(Side.CLIENT) - public float getRenderSizeModifier() + public float func_70603_bj() { return 1.0F; diff --git a/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch b/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch index c528bd8cd..945d7ebcc 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch @@ -4,56 +4,56 @@ } } -- if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity instanceof EntityLivingBase) -+ if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity != null && ridingEntity.shouldDismountInWater(this)) +- if (!this.field_70170_p.field_72995_K && this.func_70115_ae() && this.field_70154_o instanceof EntityLivingBase) ++ if (!this.field_70170_p.field_72995_K && this.func_70115_ae() && this.field_70154_o != null && field_70154_o.shouldDismountInWater(this)) { - this.mountEntity((Entity)null); + this.func_70078_a((Entity)null); } @@ -319,7 +319,7 @@ - if (!this.worldObj.isRemote && (this.recentlyHit > 0 || this.isPlayer()) && this.func_146066_aG() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) + if (!this.field_70170_p.field_72995_K && (this.field_70718_bc > 0 || this.func_70684_aJ()) && this.func_146066_aG() && this.field_70170_p.func_82736_K().func_82766_b("doMobLoot")) { - int i = this.getExperiencePoints(this.attackingPlayer); + int i = this.func_70693_a(this.field_70717_bb); - -+ i = net.minecraftforge.event.ForgeEventFactory.getExperienceDrop(this, this.attackingPlayer, i); ++ i = net.minecraftforge.event.ForgeEventFactory.getExperienceDrop(this, this.field_70717_bb, i); while (i > 0) { - int j = EntityXPOrb.getXPSplit(i); + int j = EntityXPOrb.func_70527_a(i); @@ -380,6 +380,7 @@ { - this.entityLivingToAttack = livingBase; - this.revengeTimer = this.ticksExisted; -+ net.minecraftforge.common.ForgeHooks.onLivingSetAttackTarget(this, livingBase); + this.field_70755_b = p_70604_1_; + this.field_70756_c = this.field_70173_aa; ++ net.minecraftforge.common.ForgeHooks.onLivingSetAttackTarget(this, p_70604_1_); } - public EntityLivingBase getLastAttacker() + public EntityLivingBase func_110144_aD() @@ -663,7 +664,6 @@ - return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD; + return this.func_70668_bt() == EnumCreatureAttribute.UNDEAD; } - @SideOnly(Side.CLIENT) - public void removePotionEffectClient(int p_70618_1_) + public void func_70618_n(int p_70618_1_) { - this.activePotionsMap.remove(Integer.valueOf(p_70618_1_)); + this.field_70713_bf.remove(Integer.valueOf(p_70618_1_)); @@ -712,6 +712,8 @@ - public void heal(float healAmount) + public void func_70691_i(float p_70691_1_) { -+ healAmount = net.minecraftforge.event.ForgeEventFactory.onLivingHeal(this, healAmount); -+ if (healAmount <= 0) return; - float f = this.getHealth(); ++ p_70691_1_ = net.minecraftforge.event.ForgeEventFactory.onLivingHeal(this, p_70691_1_); ++ if (p_70691_1_ <= 0) return; + float f = this.func_110143_aJ(); if (f > 0.0F) @@ -732,6 +734,7 @@ - public boolean attackEntityFrom(DamageSource source, float amount) + public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { -+ if (!net.minecraftforge.common.ForgeHooks.onLivingAttack(this, source, amount)) return false; - if (this.isEntityInvulnerable(source)) ++ if (!net.minecraftforge.common.ForgeHooks.onLivingAttack(this, p_70097_1_, p_70097_2_)) return false; + if (this.func_180431_b(p_70097_1_)) { return false; @@ -797,9 +800,9 @@ - this.recentlyHit = 100; - this.attackingPlayer = (EntityPlayer)entity; + this.field_70718_bc = 100; + this.field_70717_bb = (EntityPlayer)entity; } - else if (entity instanceof EntityWolf) + else if (entity instanceof net.minecraft.entity.passive.EntityTameable) @@ -61,118 +61,118 @@ - EntityWolf entitywolf = (EntityWolf)entity; + net.minecraft.entity.passive.EntityTameable entitywolf = (net.minecraft.entity.passive.EntityTameable)entity; - if (entitywolf.isTamed()) + if (entitywolf.func_70909_n()) { @@ -883,6 +886,7 @@ - public void onDeath(DamageSource cause) + public void func_70645_a(DamageSource p_70645_1_) { -+ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, cause)) return; - Entity entity = cause.getEntity(); ++ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, p_70645_1_)) return; + Entity entity = p_70645_1_.func_76346_g(); EntityLivingBase entitylivingbase = this.func_94060_bK(); @@ -908,6 +912,9 @@ - i = EnchantmentHelper.getLootingModifier((EntityLivingBase)entity); + i = EnchantmentHelper.func_77519_f((EntityLivingBase)entity); } + captureDrops = true; + capturedDrops.clear(); + - if (this.func_146066_aG() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) + if (this.func_146066_aG() && this.field_70170_p.func_82736_K().func_82766_b("doMobLoot")) { - this.dropFewItems(this.recentlyHit > 0, i); + this.func_70628_a(this.field_70718_bc > 0, i); @@ -918,6 +925,16 @@ - this.addRandomArmor(); + this.func_82164_bB(); } } + + captureDrops = false; + -+ if (!net.minecraftforge.common.ForgeHooks.onLivingDrops(this, cause, capturedDrops, i, recentlyHit > 0)) ++ if (!net.minecraftforge.common.ForgeHooks.onLivingDrops(this, p_70645_1_, capturedDrops, i, field_70718_bc > 0)) + { + for (EntityItem item : capturedDrops) + { -+ worldObj.spawnEntityInWorld(item); ++ field_70170_p.func_72838_d(item); + } + } } - this.worldObj.setEntityState(this, (byte)3); + this.field_70170_p.func_72960_a(this, (byte)3); @@ -972,7 +989,7 @@ - int j = MathHelper.floor_double(this.getEntityBoundingBox().minY); - int k = MathHelper.floor_double(this.posZ); - Block block = this.worldObj.getBlockState(new BlockPos(i, j, k)).getBlock(); -- return (block == Blocks.ladder || block == Blocks.vine) && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).isSpectator()); -+ return net.minecraftforge.common.ForgeHooks.isLivingOnLadder(block, worldObj, new BlockPos(i, j, k), this); + int j = MathHelper.func_76128_c(this.func_174813_aQ().field_72338_b); + int k = MathHelper.func_76128_c(this.field_70161_v); + Block block = this.field_70170_p.func_180495_p(new BlockPos(i, j, k)).func_177230_c(); +- return (block == Blocks.field_150468_ap || block == Blocks.field_150395_bd) && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).func_175149_v()); ++ return net.minecraftforge.common.ForgeHooks.isLivingOnLadder(block, field_70170_p, new BlockPos(i, j, k), this); } - public boolean isEntityAlive() + public boolean func_70089_S() @@ -982,6 +999,9 @@ - public void fall(float distance, float damageMultiplier) + public void func_180430_e(float p_180430_1_, float p_180430_2_) { -+ float[] ret = net.minecraftforge.common.ForgeHooks.onLivingFall(this, distance, damageMultiplier); ++ float[] ret = net.minecraftforge.common.ForgeHooks.onLivingFall(this, p_180430_1_, p_180430_2_); + if (ret == null) return; -+ distance = ret[0]; damageMultiplier = ret[1]; - super.fall(distance, damageMultiplier); - PotionEffect potioneffect = this.getActivePotionEffect(Potion.jump); - float f = potioneffect != null ? (float)(potioneffect.getAmplifier() + 1) : 0.0F; ++ p_180430_1_ = ret[0]; p_180430_2_ = ret[1]; + super.func_180430_e(p_180430_1_, p_180430_2_); + PotionEffect potioneffect = this.func_70660_b(Potion.field_76430_j); + float f = potioneffect != null ? (float)(potioneffect.func_76458_c() + 1) : 0.0F; @@ -1094,6 +1114,8 @@ { - if (!this.isEntityInvulnerable(damageSrc)) + if (!this.func_180431_b(p_70665_1_)) { -+ damageAmount = net.minecraftforge.common.ForgeHooks.onLivingHurt(this, damageSrc, damageAmount); -+ if (damageAmount <= 0) return; - damageAmount = this.applyArmorCalculations(damageSrc, damageAmount); - damageAmount = this.applyPotionDamageCalculations(damageSrc, damageAmount); - float f = damageAmount; ++ p_70665_2_ = net.minecraftforge.common.ForgeHooks.onLivingHurt(this, p_70665_1_, p_70665_2_); ++ if (p_70665_2_ <= 0) return; + p_70665_2_ = this.func_70655_b(p_70665_1_, p_70665_2_); + p_70665_2_ = this.func_70672_c(p_70665_1_, p_70665_2_); + float f = p_70665_2_; @@ -1142,6 +1164,11 @@ - public void swingItem() + public void func_71038_i() { -+ ItemStack stack = this.getHeldItem(); -+ if (stack != null && stack.getItem() != null) ++ ItemStack stack = this.func_70694_bm(); ++ if (stack != null && stack.func_77973_b() != null) + { -+ if (stack.getItem().onEntitySwing(this, stack)) return; ++ if (stack.func_77973_b().onEntitySwing(this, stack)) return; + } - if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0) + if (!this.field_82175_bq || this.field_110158_av >= this.func_82166_i() / 2 || this.field_110158_av < 0) { - this.swingProgressInt = -1; + this.field_110158_av = -1; @@ -1281,6 +1308,7 @@ - public void dismountEntity(Entity p_110145_1_) + public void func_110145_l(Entity p_110145_1_) { + if(!net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, p_110145_1_, false)){ return; } - double d0 = p_110145_1_.posX; - double d1 = p_110145_1_.getEntityBoundingBox().minY + (double)p_110145_1_.height; - double d2 = p_110145_1_.posZ; + double d0 = p_110145_1_.field_70165_t; + double d1 = p_110145_1_.func_174813_aQ().field_72338_b + (double)p_110145_1_.field_70131_O; + double d2 = p_110145_1_.field_70161_v; @@ -1346,6 +1374,7 @@ } - this.isAirBorne = true; + this.field_70160_al = true; + net.minecraftforge.common.ForgeHooks.onLivingJump(this); } - protected void updateAITick() + protected void func_70629_bd() @@ -1530,6 +1559,7 @@ - public void onUpdate() + public void func_70071_h_() { + if (net.minecraftforge.common.ForgeHooks.onLivingUpdate(this)) return; - super.onUpdate(); + super.func_70071_h_(); - if (!this.worldObj.isRemote) + if (!this.field_70170_p.field_72995_K) @@ -1817,6 +1847,7 @@ - public void mountEntity(Entity entityIn) + public void func_70078_a(Entity p_70078_1_) { -+ if(!net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, entityIn, true)){ return; } - if (this.ridingEntity != null && entityIn == null) ++ if(!net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, p_70078_1_, true)){ return; } + if (this.field_70154_o != null && p_70078_1_ == null) { - if (!this.worldObj.isRemote) + if (!this.field_70170_p.field_72995_K) @@ -1998,4 +2029,39 @@ { - this.potionsNeedUpdate = true; + this.field_70752_e = true; } + + /*** @@ -181,19 +181,19 @@ + */ + public void curePotionEffects(ItemStack curativeItem) + { -+ Iterator potionKey = activePotionsMap.keySet().iterator(); -+ if (worldObj.isRemote) return; ++ Iterator potionKey = field_70713_bf.keySet().iterator(); ++ if (field_70170_p.field_72995_K) return; + + while (potionKey.hasNext()) + { + Integer key = potionKey.next(); -+ PotionEffect effect = (PotionEffect)activePotionsMap.get(key); ++ PotionEffect effect = (PotionEffect)field_70713_bf.get(key); + + if (effect.isCurativeItem(curativeItem)) + { + potionKey.remove(); -+ onFinishedPotionEffect(effect); -+ this.potionsNeedUpdate = true; ++ func_70688_c(effect); ++ this.field_70752_e = true; + } + } + } diff --git a/patches/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java.patch b/patches/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java.patch index c7d458160..9f22ee7e1 100644 --- a/patches/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java @@ -109,6 +109,7 @@ - public boolean interactFirst(EntityPlayer playerIn) + public boolean func_130002_c(EntityPlayer p_130002_1_) { -+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, playerIn))) return true; - this.commandBlockLogic.func_175574_a(playerIn); ++ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_130002_1_))) return true; + this.field_145824_a.func_175574_a(p_130002_1_); return false; } diff --git a/patches/minecraft/net/minecraft/entity/EntityTracker.java.patch b/patches/minecraft/net/minecraft/entity/EntityTracker.java.patch index d3e15e11d..ba155b961 100644 --- a/patches/minecraft/net/minecraft/entity/EntityTracker.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityTracker.java.patch @@ -2,13 +2,13 @@ +++ ../src-work/minecraft/net/minecraft/entity/EntityTracker.java @@ -56,6 +56,8 @@ - public void trackEntity(Entity p_72786_1_) + public void func_72786_a(Entity p_72786_1_) { + if (net.minecraftforge.fml.common.registry.EntityRegistry.instance().tryTrackingEntity(this, p_72786_1_)) return; + if (p_72786_1_ instanceof EntityPlayerMP) { - this.trackEntity(p_72786_1_, 512, 2); + this.func_72791_a(p_72786_1_, 512, 2); @@ -331,4 +333,23 @@ } } @@ -24,11 +24,11 @@ + */ + public Set getTrackingPlayers(Entity entity) + { -+ EntityTrackerEntry entry = (EntityTrackerEntry) trackedEntityHashTable.lookup(entity.getEntityId()); ++ EntityTrackerEntry entry = (EntityTrackerEntry) field_72794_c.func_76041_a(entity.func_145782_y()); + if (entry == null) + return java.util.Collections.emptySet(); + else -+ return java.util.Collections.unmodifiableSet(entry.trackingPlayers); ++ return java.util.Collections.unmodifiableSet(entry.field_73134_o); + } + + /* ======================================== FORGE END =====================================*/ diff --git a/patches/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch b/patches/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch index 324f26799..20e203ef1 100644 --- a/patches/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch @@ -1,42 +1,42 @@ --- ../src-base/minecraft/net/minecraft/entity/EntityTrackerEntry.java +++ ../src-work/minecraft/net/minecraft/entity/EntityTrackerEntry.java @@ -379,6 +379,14 @@ - this.lastTrackedEntityMotionY = this.trackedEntity.motionY; - this.motionZ = this.trackedEntity.motionZ; + this.field_73138_k = this.field_73132_a.field_70181_x; + this.field_73135_l = this.field_73132_a.field_70179_y; -+ int posX = MathHelper.floor_double(this.trackedEntity.posX * 32.0D); -+ int posY = MathHelper.floor_double(this.trackedEntity.posY * 32.0D); -+ int posZ = MathHelper.floor_double(this.trackedEntity.posZ * 32.0D); -+ if (posX != this.encodedPosX || posY != this.encodedPosY || posZ != this.encodedPosZ) ++ int posX = MathHelper.func_76128_c(this.field_73132_a.field_70165_t * 32.0D); ++ int posY = MathHelper.func_76128_c(this.field_73132_a.field_70163_u * 32.0D); ++ int posZ = MathHelper.func_76128_c(this.field_73132_a.field_70161_v * 32.0D); ++ if (posX != this.field_73128_d || posY != this.field_73129_e || posZ != this.field_73126_f) + { -+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.makeEntitySpawnAdjustment(this.trackedEntity, p_73117_1_, this.encodedPosX, this.encodedPosY, this.encodedPosZ); ++ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.makeEntitySpawnAdjustment(this.field_73132_a, p_73117_1_, this.field_73128_d, this.field_73129_e, this.field_73126_f); + } + - if (this.sendVelocityUpdates && !(packet instanceof S0FPacketSpawnMob)) + if (this.field_73143_t && !(packet instanceof S0FPacketSpawnMob)) { - p_73117_1_.playerNetServerHandler.sendPacket(new S12PacketEntityVelocity(this.trackedEntity.getEntityId(), this.trackedEntity.motionX, this.trackedEntity.motionY, this.trackedEntity.motionZ)); + p_73117_1_.field_71135_a.func_147359_a(new S12PacketEntityVelocity(this.field_73132_a.func_145782_y(), this.field_73132_a.field_70159_w, this.field_73132_a.field_70181_x, this.field_73132_a.field_70179_y)); @@ -426,12 +434,14 @@ - p_73117_1_.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(this.trackedEntity.getEntityId(), potioneffect)); + p_73117_1_.field_71135_a.func_147359_a(new S1DPacketEntityEffect(this.field_73132_a.func_145782_y(), potioneffect)); } } -+ net.minecraftforge.event.ForgeEventFactory.onStartEntityTracking(trackedEntity, p_73117_1_); ++ net.minecraftforge.event.ForgeEventFactory.onStartEntityTracking(field_73132_a, p_73117_1_); } } - else if (this.trackingPlayers.contains(p_73117_1_)) + else if (this.field_73134_o.contains(p_73117_1_)) { - this.trackingPlayers.remove(p_73117_1_); - p_73117_1_.func_152339_d(this.trackedEntity); -+ net.minecraftforge.event.ForgeEventFactory.onStopEntityTracking(trackedEntity, p_73117_1_); + this.field_73134_o.remove(p_73117_1_); + p_73117_1_.func_152339_d(this.field_73132_a); ++ net.minecraftforge.event.ForgeEventFactory.onStopEntityTracking(field_73132_a, p_73117_1_); } } } @@ -463,6 +473,9 @@ - logger.warn("Fetching addPacket for removed entity"); + field_151262_p.warn("Fetching addPacket for removed entity"); } -+ Packet pkt = net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.getEntitySpawningPacket(this.trackedEntity); ++ Packet pkt = net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.getEntitySpawningPacket(this.field_73132_a); + if (pkt != null) return pkt; + - if (this.trackedEntity instanceof EntityItem) + if (this.field_73132_a instanceof EntityItem) { - return new S0EPacketSpawnObject(this.trackedEntity, 2, 1); + return new S0EPacketSpawnObject(this.field_73132_a, 2, 1); diff --git a/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch b/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch index 85d012159..d869b3547 100644 --- a/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch +++ b/patches/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch @@ -17,29 +17,29 @@ + { + if (--this.field_75445_i <= 0) + { -+ this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(entitylivingbase); -+ this.field_151497_i = 4 + this.attacker.getRNG().nextInt(7); -+ return this.entityPathEntity != null; ++ this.field_75438_g = this.field_75441_b.func_70661_as().func_75494_a(entitylivingbase); ++ this.field_151497_i = 4 + this.field_75441_b.func_70681_au().nextInt(7); ++ return this.field_75438_g != null; + } + else + { + return true; + } + } - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(entitylivingbase); - return this.entityPathEntity != null; + this.field_75438_g = this.field_75441_b.func_70661_as().func_75494_a(entitylivingbase); + return this.field_75438_g != null; } @@ -91,6 +106,23 @@ - this.field_151496_k = entitylivingbase.posZ; - this.field_75445_i = 4 + this.attacker.getRNG().nextInt(7); + this.field_151496_k = entitylivingbase.field_70161_v; + this.field_75445_i = 4 + this.field_75441_b.func_70681_au().nextInt(7); + if (this.canPenalize) + { + this.field_151497_i += failedPathFindingPenalty; -+ if (this.attacker.getNavigator().getPath() != null) ++ if (this.field_75441_b.func_70661_as().func_75505_d() != null) + { -+ net.minecraft.pathfinding.PathPoint finalPathPoint = this.attacker.getNavigator().getPath().getFinalPathPoint(); -+ if (finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1) ++ net.minecraft.pathfinding.PathPoint finalPathPoint = this.field_75441_b.func_70661_as().func_75505_d().func_75870_c(); ++ if (finalPathPoint != null && entitylivingbase.func_70092_e(finalPathPoint.field_75839_a, finalPathPoint.field_75837_b, finalPathPoint.field_75838_c) < 1) + failedPathFindingPenalty = 0; + else + failedPathFindingPenalty += 10; diff --git a/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch b/patches/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch index dc04cfb26..2ccf20bdd 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 @@ -479,9 +479,9 @@ BlockPos blockpos = new BlockPos(k1, l1, i2); - Block block = this.worldObj.getBlockState(blockpos).getBlock(); + Block block = this.field_70170_p.func_180495_p(blockpos).func_177230_c(); -- if (block.getMaterial() != Material.air) -+ if (!block.isAir(worldObj, new BlockPos(k1, l1, i2))) +- if (block.func_149688_o() != Material.field_151579_a) ++ if (!block.isAir(field_70170_p, new BlockPos(k1, l1, i2))) { -- if (block != Blocks.barrier && block != Blocks.obsidian && block != Blocks.end_stone && block != Blocks.bedrock && block != Blocks.command_block && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) -+ if (block.canEntityDestroy(worldObj, new BlockPos(k1, l1, i2), this) && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) +- if (block != Blocks.field_180401_cv && block != Blocks.field_150343_Z && block != Blocks.field_150377_bs && block != Blocks.field_150357_h && block != Blocks.field_150483_bI && this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) ++ if (block.canEntityDestroy(field_70170_p, new BlockPos(k1, l1, i2), this) && this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) { - flag1 = this.worldObj.setBlockToAir(blockpos) || flag1; + flag1 = this.field_70170_p.func_175698_g(blockpos) || flag1; } diff --git a/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch b/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch index c999b9d32..38dc16d7a 100644 --- a/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch +++ b/patches/minecraft/net/minecraft/entity/boss/EntityWither.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/entity/boss/EntityWither.java @@ -343,7 +343,7 @@ BlockPos blockpos = new BlockPos(i3, k, l); - Block block = this.worldObj.getBlockState(blockpos).getBlock(); + Block block = this.field_70170_p.func_180495_p(blockpos).func_177230_c(); -- if (block.getMaterial() != Material.air && func_181033_a(block)) -+ if (!block.isAir(worldObj,blockpos) && func_181033_a(block) && block.canEntityDestroy(worldObj, blockpos, this)) +- if (block.func_149688_o() != Material.field_151579_a && func_181033_a(block)) ++ if (!block.isAir(field_70170_p,blockpos) && func_181033_a(block) && block.canEntityDestroy(field_70170_p, blockpos, this)) { - flag = this.worldObj.destroyBlock(blockpos, true) || flag; + flag = this.field_70170_p.func_175655_b(blockpos, true) || flag; } diff --git a/patches/minecraft/net/minecraft/entity/boss/IBossDisplayData.java.patch b/patches/minecraft/net/minecraft/entity/boss/IBossDisplayData.java.patch index 98bf84269..ee9c56e4c 100644 --- a/patches/minecraft/net/minecraft/entity/boss/IBossDisplayData.java.patch +++ b/patches/minecraft/net/minecraft/entity/boss/IBossDisplayData.java.patch @@ -7,4 +7,4 @@ -@SideOnly(Side.CLIENT) public interface IBossDisplayData { - float getMaxHealth(); + float func_110138_aP(); diff --git a/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch b/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch index 662a54e4d..4778abec5 100644 --- a/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch +++ b/patches/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java.patch @@ -4,9 +4,9 @@ for (int i = 0; i < list.size(); ++i) { Entity entity = (Entity)list.get(i); -- entity.onStruckByLightning(this); +- entity.func_70077_a(this); + if (!net.minecraftforge.event.ForgeEventFactory.onEntityStruckByLightning(entity, this)) -+ entity.onStruckByLightning(this); ++ entity.func_70077_a(this); } } } diff --git a/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch index 2e2f47cd3..4a8b020c5 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityEnderPearl.java.patch @@ -2,23 +2,23 @@ +++ ../src-work/minecraft/net/minecraft/entity/item/EntityEnderPearl.java @@ -61,6 +61,9 @@ - if (entityplayermp.playerNetServerHandler.getNetworkManager().isChannelOpen() && entityplayermp.worldObj == this.worldObj && !entityplayermp.isPlayerSleeping()) + if (entityplayermp.field_71135_a.func_147362_b().func_150724_d() && entityplayermp.field_70170_p == this.field_70170_p && !entityplayermp.func_70608_bn()) { -+ net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(entityplayermp, this.posX, this.posY, this.posZ, 5.0F); ++ net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(entityplayermp, this.field_70165_t, this.field_70163_u, this.field_70161_v, 5.0F); + if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) + { // Don't indent to lower patch size - if (this.rand.nextFloat() < 0.05F && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobSpawning")) + if (this.field_70146_Z.nextFloat() < 0.05F && this.field_70170_p.func_82736_K().func_82766_b("doMobSpawning")) { - EntityEndermite entityendermite = new EntityEndermite(this.worldObj); + EntityEndermite entityendermite = new EntityEndermite(this.field_70170_p); @@ -74,9 +77,10 @@ - entitylivingbase.mountEntity((Entity)null); + entitylivingbase.func_70078_a((Entity)null); } -- entitylivingbase.setPositionAndUpdate(this.posX, this.posY, this.posZ); -+ entitylivingbase.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); - entitylivingbase.fallDistance = 0.0F; -- entitylivingbase.attackEntityFrom(DamageSource.fall, 5.0F); -+ entitylivingbase.attackEntityFrom(DamageSource.fall, event.attackDamage); +- entitylivingbase.func_70634_a(this.field_70165_t, this.field_70163_u, this.field_70161_v); ++ entitylivingbase.func_70634_a(event.targetX, event.targetY, event.targetZ); + entitylivingbase.field_70143_R = 0.0F; +- entitylivingbase.func_70097_a(DamageSource.field_76379_h, 5.0F); ++ entitylivingbase.func_70097_a(DamageSource.field_76379_h, event.attackDamage); + } } } diff --git a/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch index a2c16df04..85b198887 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityItem.java.patch @@ -1,94 +1,94 @@ --- ../src-base/minecraft/net/minecraft/entity/item/EntityItem.java +++ ../src-work/minecraft/net/minecraft/entity/item/EntityItem.java @@ -29,6 +29,11 @@ - private String owner; - public float hoverStart; + private String field_145802_g; + public float field_70290_d; + /** + * The maximum age of this EntityItem. The item is expired once this is reached. + */ + public int lifespan = 6000; + - public EntityItem(World worldIn, double x, double y, double z) + public EntityItem(World p_i1709_1_, double p_i1709_2_, double p_i1709_4_, double p_i1709_6_) { - super(worldIn); + super(p_i1709_1_); @@ -46,6 +51,7 @@ { - this(worldIn, x, y, z); - this.setEntityItemStack(stack); -+ this.lifespan = (stack.getItem() == null ? 6000 : stack.getItem().getEntityLifespan(stack, worldIn)); + this(p_i1710_1_, p_i1710_2_, p_i1710_4_, p_i1710_6_); + this.func_92058_a(p_i1710_8_); ++ this.lifespan = (p_i1710_8_.func_77973_b() == null ? 6000 : p_i1710_8_.func_77973_b().getEntityLifespan(p_i1710_8_, p_i1710_1_)); } - protected boolean canTriggerWalking() + protected boolean func_70041_e_() @@ -69,6 +75,8 @@ - public void onUpdate() + public void func_70071_h_() { -+ ItemStack stack = this.getDataWatcher().getWatchableObjectItemStack(10); -+ if (stack != null && stack.getItem() != null && stack.getItem().onEntityItemUpdate(this)) return; - if (this.getEntityItem() == null) ++ ItemStack stack = this.func_70096_w().func_82710_f(10); ++ if (stack != null && stack.func_77973_b() != null && stack.func_77973_b().onEntityItemUpdate(this)) return; + if (this.func_92059_d() == null) { - this.setDead(); + this.func_70106_y(); @@ -129,8 +137,16 @@ - this.handleWaterMovement(); + this.func_70072_I(); -- if (!this.worldObj.isRemote && this.age >= 6000) -+ ItemStack item = getDataWatcher().getWatchableObjectItemStack(10); +- if (!this.field_70170_p.field_72995_K && this.field_70292_b >= 6000) ++ ItemStack item = func_70096_w().func_82710_f(10); + -+ if (!this.worldObj.isRemote && this.age >= lifespan) ++ if (!this.field_70170_p.field_72995_K && this.field_70292_b >= lifespan) { + int hook = net.minecraftforge.event.ForgeEventFactory.onItemExpire(this, item); -+ if (hook < 0) this.setDead(); ++ if (hook < 0) this.func_70106_y(); + else this.lifespan += hook; + } -+ if (item != null && item.stackSize <= 0) ++ if (item != null && item.field_77994_a <= 0) + { - this.setDead(); + this.func_70106_y(); } } @@ -271,6 +287,7 @@ - tagCompound.setShort("Health", (short)((byte)this.health)); - tagCompound.setShort("Age", (short)this.age); - tagCompound.setShort("PickupDelay", (short)this.delayBeforeCanPickup); -+ tagCompound.setInteger("Lifespan", lifespan); + p_70014_1_.func_74777_a("Health", (short)((byte)this.field_70291_e)); + p_70014_1_.func_74777_a("Age", (short)this.field_70292_b); + p_70014_1_.func_74777_a("PickupDelay", (short)this.field_145804_b); ++ p_70014_1_.func_74768_a("Lifespan", lifespan); - if (this.getThrower() != null) + if (this.func_145800_j() != null) { @@ -311,20 +328,23 @@ - NBTTagCompound nbttagcompound = tagCompund.getCompoundTag("Item"); - this.setEntityItemStack(ItemStack.loadItemStackFromNBT(nbttagcompound)); + NBTTagCompound nbttagcompound = p_70037_1_.func_74775_l("Item"); + this.func_92058_a(ItemStack.func_77949_a(nbttagcompound)); -- if (this.getEntityItem() == null) +- if (this.func_92059_d() == null) - { -- this.setDead(); +- this.func_70106_y(); - } -+ ItemStack item = getDataWatcher().getWatchableObjectItemStack(10); -+ if (item == null || item.stackSize <= 0) this.setDead(); -+ if (tagCompund.hasKey("Lifespan")) lifespan = tagCompund.getInteger("Lifespan"); ++ ItemStack item = func_70096_w().func_82710_f(10); ++ if (item == null || item.field_77994_a <= 0) this.func_70106_y(); ++ if (p_70037_1_.func_74764_b("Lifespan")) lifespan = p_70037_1_.func_74762_e("Lifespan"); } - public void onCollideWithPlayer(EntityPlayer entityIn) + public void func_70100_b_(EntityPlayer p_70100_1_) { - if (!this.worldObj.isRemote) + if (!this.field_70170_p.field_72995_K) { -+ if (this.delayBeforeCanPickup > 0) return; - ItemStack itemstack = this.getEntityItem(); - int i = itemstack.stackSize; ++ if (this.field_145804_b > 0) return; + ItemStack itemstack = this.func_92059_d(); + int i = itemstack.field_77994_a; -- if (this.delayBeforeCanPickup == 0 && (this.owner == null || 6000 - this.age <= 200 || this.owner.equals(entityIn.getName())) && entityIn.inventory.addItemStackToInventory(itemstack)) -+ int hook = net.minecraftforge.event.ForgeEventFactory.onItemPickup(this, entityIn, itemstack); +- if (this.field_145804_b == 0 && (this.field_145802_g == null || 6000 - this.field_70292_b <= 200 || this.field_145802_g.equals(p_70100_1_.func_70005_c_())) && p_70100_1_.field_71071_by.func_70441_a(itemstack)) ++ int hook = net.minecraftforge.event.ForgeEventFactory.onItemPickup(this, p_70100_1_, itemstack); + if (hook < 0) return; + -+ if (this.delayBeforeCanPickup <= 0 && (this.owner == null || lifespan - this.age <= 200 || this.owner.equals(entityIn.getName())) && (hook == 1 || i <= 0 || entityIn.inventory.addItemStackToInventory(itemstack))) ++ if (this.field_145804_b <= 0 && (this.field_145802_g == null || lifespan - this.field_70292_b <= 200 || this.field_145802_g.equals(p_70100_1_.func_70005_c_())) && (hook == 1 || i <= 0 || p_70100_1_.field_71071_by.func_70441_a(itemstack))) { - if (itemstack.getItem() == Item.getItemFromBlock(Blocks.log)) + if (itemstack.func_77973_b() == Item.func_150898_a(Blocks.field_150364_r)) { @@ -361,6 +381,7 @@ } } -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerItemPickupEvent(entityIn, this); - if (!this.isSilent()) ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerItemPickupEvent(p_70100_1_, this); + if (!this.func_174814_R()) { - this.worldObj.playSoundAtEntity(entityIn, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); + this.field_70170_p.func_72956_a(p_70100_1_, "random.pop", 0.2F, ((this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.7F + 1.0F) * 2.0F); diff --git a/patches/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch index 6a6f26cf8..dfb0cf0e5 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityItemFrame.java.patch @@ -4,8 +4,8 @@ { if (p_110131_1_ != null) { -- if (p_110131_1_.getItem() == Items.filled_map) -+ if (p_110131_1_.getItem() instanceof net.minecraft.item.ItemMap) +- if (p_110131_1_.func_77973_b() == Items.field_151098_aY) ++ if (p_110131_1_.func_77973_b() instanceof net.minecraft.item.ItemMap) { - MapData mapdata = ((ItemMap)p_110131_1_.getItem()).getMapData(p_110131_1_, this.worldObj); - mapdata.playersVisibleOnMap.remove("frame-" + this.getEntityId()); + MapData mapdata = ((ItemMap)p_110131_1_.func_77973_b()).func_77873_a(p_110131_1_, this.field_70170_p); + mapdata.field_76203_h.remove("frame-" + this.func_145782_y()); diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch index 48be61e48..da822bd07 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch @@ -2,7 +2,7 @@ +++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecart.java @@ -50,6 +50,20 @@ @SideOnly(Side.CLIENT) - private double velocityZ; + private double field_70506_as; + /* Forge: Minecart Compatibility Layer Integration. */ + public static float defaultMaxSpeedAirLateral = 0.4f; @@ -18,97 +18,97 @@ + protected float maxSpeedAirVertical = defaultMaxSpeedAirVertical; + protected double dragAir = defaultDragAir; + - public EntityMinecart(World worldIn) + public EntityMinecart(World p_i1712_1_) { - super(worldIn); + super(p_i1712_1_); @@ -95,17 +109,19 @@ - public AxisAlignedBB getCollisionBox(Entity entityIn) + public AxisAlignedBB func_70114_g(Entity p_70114_1_) { -+ if (getCollisionHandler() != null) return getCollisionHandler().getCollisionBox(this, entityIn); - return entityIn.canBePushed() ? entityIn.getEntityBoundingBox() : null; ++ if (getCollisionHandler() != null) return getCollisionHandler().getCollisionBox(this, p_70114_1_); + return p_70114_1_.func_70104_M() ? p_70114_1_.func_174813_aQ() : null; } - public AxisAlignedBB getBoundingBox() + public AxisAlignedBB func_70046_E() { + if (getCollisionHandler() != null) return getCollisionHandler().getBoundingBox(this); return null; } - public boolean canBePushed() + public boolean func_70104_M() { - return true; + return canBePushed; } - public EntityMinecart(World worldIn, double p_i1713_2_, double p_i1713_4_, double p_i1713_6_) + public EntityMinecart(World p_i1713_1_, double p_i1713_2_, double p_i1713_4_, double p_i1713_6_) @@ -309,7 +325,7 @@ BlockPos blockpos = new BlockPos(k, l, i1); - IBlockState iblockstate = this.worldObj.getBlockState(blockpos); + IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos); -- if (BlockRailBase.isRailBlock(iblockstate)) -+ if (canUseRail() && BlockRailBase.isRailBlock(iblockstate)) +- if (BlockRailBase.func_176563_d(iblockstate)) ++ if (canUseRail() && BlockRailBase.func_176563_d(iblockstate)) { this.func_180460_a(blockpos, iblockstate); @@ -348,7 +364,10 @@ - this.setRotation(this.rotationYaw, this.rotationPitch); + this.func_70101_b(this.field_70177_z, this.field_70125_A); -- for (Entity entity : this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().expand(0.20000000298023224D, 0.0D, 0.20000000298023224D))) +- for (Entity entity : this.field_70170_p.func_72839_b(this, this.func_174813_aQ().func_72314_b(0.20000000298023224D, 0.0D, 0.20000000298023224D))) + AxisAlignedBB box; + if (getCollisionHandler() != null) box = getCollisionHandler().getMinecartCollisionBox(this); -+ else box = this.getEntityBoundingBox().expand(0.20000000298023224D, 0.0D, 0.20000000298023224D); -+ for (Entity entity : this.worldObj.getEntitiesWithinAABBExcludingEntity(this, box)) ++ else box = this.func_174813_aQ().func_72314_b(0.20000000298023224D, 0.0D, 0.20000000298023224D); ++ for (Entity entity : this.field_70170_p.func_72839_b(this, box)) { - if (entity != this.riddenByEntity && entity.canBePushed() && entity instanceof EntityMinecart) + if (entity != this.field_70153_n && entity.func_70104_M() && entity instanceof EntityMinecart) { @@ -367,6 +386,7 @@ } - this.handleWaterMovement(); + this.func_70072_I(); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartUpdateEvent(this, this.getCurrentRailPosition())); } } @@ -381,10 +401,21 @@ - protected void moveDerailedMinecart() + protected void func_180459_n() { - double d0 = this.func_174898_m(); -+ double d0 = onGround ? this.func_174898_m() : getMaxSpeedAirLateral(); - this.motionX = MathHelper.clamp_double(this.motionX, -d0, d0); - this.motionZ = MathHelper.clamp_double(this.motionZ, -d0, d0); ++ double d0 = field_70122_E ? this.func_174898_m() : getMaxSpeedAirLateral(); + this.field_70159_w = MathHelper.func_151237_a(this.field_70159_w, -d0, d0); + this.field_70179_y = MathHelper.func_151237_a(this.field_70179_y, -d0, d0); -+ double moveY = motionY; -+ if(getMaxSpeedAirVertical() > 0 && motionY > getMaxSpeedAirVertical()) ++ double moveY = field_70181_x; ++ if(getMaxSpeedAirVertical() > 0 && field_70181_x > getMaxSpeedAirVertical()) + { + moveY = getMaxSpeedAirVertical(); -+ if(Math.abs(motionX) < 0.3f && Math.abs(motionZ) < 0.3f) ++ if(Math.abs(field_70159_w) < 0.3f && Math.abs(field_70179_y) < 0.3f) + { + moveY = 0.15f; -+ motionY = moveY; ++ field_70181_x = moveY; + } + } + - if (this.onGround) + if (this.field_70122_E) { - this.motionX *= 0.5D; + this.field_70159_w *= 0.5D; @@ -392,13 +423,13 @@ - this.motionZ *= 0.5D; + this.field_70179_y *= 0.5D; } -- this.moveEntity(this.motionX, this.motionY, this.motionZ); -+ this.moveEntity(this.motionX, moveY, this.motionZ); +- this.func_70091_d(this.field_70159_w, this.field_70181_x, this.field_70179_y); ++ this.func_70091_d(this.field_70159_w, moveY, this.field_70179_y); - if (!this.onGround) + if (!this.field_70122_E) { -- this.motionX *= 0.949999988079071D; -- this.motionY *= 0.949999988079071D; -- this.motionZ *= 0.949999988079071D; -+ this.motionX *= getDragAir(); -+ this.motionY *= getDragAir(); -+ this.motionZ *= getDragAir(); +- this.field_70159_w *= 0.949999988079071D; +- this.field_70181_x *= 0.949999988079071D; +- this.field_70179_y *= 0.949999988079071D; ++ this.field_70159_w *= getDragAir(); ++ this.field_70181_x *= getDragAir(); ++ this.field_70179_y *= getDragAir(); } } @@ -118,29 +118,29 @@ - double d0 = 0.0078125D; + double slopeAdjustment = getSlopeAdjustment(); - BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_180460_2_.getValue(blockrailbase.getShapeProperty()); + BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_180460_2_.func_177229_b(blockrailbase.func_176560_l()); switch (blockrailbase$enumraildirection) { case ASCENDING_EAST: -- this.motionX -= 0.0078125D; -+ this.motionX -= slopeAdjustment; - ++this.posY; +- this.field_70159_w -= 0.0078125D; ++ this.field_70159_w -= slopeAdjustment; + ++this.field_70163_u; break; case ASCENDING_WEST: -- this.motionX += 0.0078125D; -+ this.motionX += slopeAdjustment; - ++this.posY; +- this.field_70159_w += 0.0078125D; ++ this.field_70159_w += slopeAdjustment; + ++this.field_70163_u; break; case ASCENDING_NORTH: -- this.motionZ += 0.0078125D; -+ this.motionZ += slopeAdjustment; - ++this.posY; +- this.field_70179_y += 0.0078125D; ++ this.field_70179_y += slopeAdjustment; + ++this.field_70163_u; break; case ASCENDING_SOUTH: -- this.motionZ -= 0.0078125D; -+ this.motionZ -= slopeAdjustment; - ++this.posY; +- this.field_70179_y -= 0.0078125D; ++ this.field_70179_y -= slopeAdjustment; + ++this.field_70163_u; } @@ -481,7 +512,7 @@ @@ -150,86 +150,86 @@ - if (flag1) + if (flag1 && shouldDoRailFunctions()) { - double d17 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + double d17 = Math.sqrt(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y); @@ -527,20 +558,8 @@ - this.posX = d19 + d1 * d18; - this.posZ = d20 + d2 * d18; - this.setPosition(this.posX, this.posY, this.posZ); -- double d22 = this.motionX; -- double d23 = this.motionZ; + this.field_70165_t = d19 + d1 * d18; + this.field_70161_v = d20 + d2 * d18; + this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); +- double d22 = this.field_70159_w; +- double d23 = this.field_70179_y; + this.moveMinecartOnRail(p_180460_1_); -- if (this.riddenByEntity != null) +- if (this.field_70153_n != null) - { - d22 *= 0.75D; - d23 *= 0.75D; - } - - double d13 = this.func_174898_m(); -- d22 = MathHelper.clamp_double(d22, -d13, d13); -- d23 = MathHelper.clamp_double(d23, -d13, d13); -- this.moveEntity(d22, 0.0D, d23); +- d22 = MathHelper.func_151237_a(d22, -d13, d13); +- d23 = MathHelper.func_151237_a(d23, -d13, d13); +- this.func_70091_d(d22, 0.0D, d23); - - if (aint[0][1] != 0 && MathHelper.floor_double(this.posX) - p_180460_1_.getX() == aint[0][0] && MathHelper.floor_double(this.posZ) - p_180460_1_.getZ() == aint[0][2]) + if (aint[0][1] != 0 && MathHelper.func_76128_c(this.field_70165_t) - p_180460_1_.func_177958_n() == aint[0][0] && MathHelper.func_76128_c(this.field_70161_v) - p_180460_1_.func_177952_p() == aint[0][2]) { - this.setPosition(this.posX, this.posY + (double)aint[0][1], this.posZ); + this.func_70107_b(this.field_70165_t, this.field_70163_u + (double)aint[0][1], this.field_70161_v); @@ -577,8 +596,14 @@ - this.motionZ = d5 * (double)(i - p_180460_1_.getZ()); + this.field_70179_y = d5 * (double)(i - p_180460_1_.func_177952_p()); } - if (flag) + + if(shouldDoRailFunctions()) { -+ ((BlockRailBase)p_180460_2_.getBlock()).onMinecartPass(worldObj, this, p_180460_1_); ++ ((BlockRailBase)p_180460_2_.func_177230_c()).onMinecartPass(field_70170_p, this, p_180460_1_); + } + + if (flag && shouldDoRailFunctions()) + { - double d15 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + double d15 = Math.sqrt(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y); if (d15 > 0.01D) @@ -817,13 +842,20 @@ - public void applyEntityCollision(Entity entityIn) + public void func_70108_f(Entity p_70108_1_) { + -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartCollisionEvent(this, entityIn)); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartCollisionEvent(this, p_70108_1_)); + if (getCollisionHandler() != null) + { -+ getCollisionHandler().onEntityCollision(this, entityIn); ++ getCollisionHandler().onEntityCollision(this, p_70108_1_); + return; + } - if (!this.worldObj.isRemote) + if (!this.field_70170_p.field_72995_K) { - if (!entityIn.noClip && !this.noClip) + if (!p_70108_1_.field_70145_X && !this.field_70145_X) { - if (entityIn != this.riddenByEntity) + if (p_70108_1_ != this.field_70153_n) { -- if (entityIn instanceof EntityLivingBase && !(entityIn instanceof EntityPlayer) && !(entityIn instanceof EntityIronGolem) && this.getMinecartType() == EntityMinecart.EnumMinecartType.RIDEABLE && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && entityIn.ridingEntity == null) -+ if (entityIn instanceof EntityLivingBase && !(entityIn instanceof EntityPlayer) && !(entityIn instanceof EntityIronGolem) && canBeRidden() && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && entityIn.ridingEntity == null) +- if (p_70108_1_ instanceof EntityLivingBase && !(p_70108_1_ instanceof EntityPlayer) && !(p_70108_1_ instanceof EntityIronGolem) && this.func_180456_s() == EntityMinecart.EnumMinecartType.RIDEABLE && this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y > 0.01D && this.field_70153_n == null && p_70108_1_.field_70154_o == null) ++ if (p_70108_1_ instanceof EntityLivingBase && !(p_70108_1_ instanceof EntityPlayer) && !(p_70108_1_ instanceof EntityIronGolem) && canBeRidden() && this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y > 0.01D && this.field_70153_n == null && p_70108_1_.field_70154_o == null) { - entityIn.mountEntity(this); + p_70108_1_.func_70078_a(this); } @@ -869,7 +901,7 @@ - double d7 = entityIn.motionX + this.motionX; - double d8 = entityIn.motionZ + this.motionZ; + double d7 = p_70108_1_.field_70159_w + this.field_70159_w; + double d8 = p_70108_1_.field_70179_y + this.field_70179_y; -- if (((EntityMinecart)entityIn).getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE && this.getMinecartType() != EntityMinecart.EnumMinecartType.FURNACE) -+ if (((EntityMinecart)entityIn).isPoweredCart() && !isPoweredCart()) +- if (((EntityMinecart)p_70108_1_).func_180456_s() == EntityMinecart.EnumMinecartType.FURNACE && this.func_180456_s() != EntityMinecart.EnumMinecartType.FURNACE) ++ if (((EntityMinecart)p_70108_1_).isPoweredCart() && !isPoweredCart()) { - this.motionX *= 0.20000000298023224D; - this.motionZ *= 0.20000000298023224D; + this.field_70159_w *= 0.20000000298023224D; + this.field_70179_y *= 0.20000000298023224D; @@ -877,7 +909,7 @@ - entityIn.motionX *= 0.949999988079071D; - entityIn.motionZ *= 0.949999988079071D; + p_70108_1_.field_70159_w *= 0.949999988079071D; + p_70108_1_.field_70179_y *= 0.949999988079071D; } -- else if (((EntityMinecart)entityIn).getMinecartType() != EntityMinecart.EnumMinecartType.FURNACE && this.getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE) -+ else if (((EntityMinecart)entityIn).isPoweredCart() && isPoweredCart()) +- else if (((EntityMinecart)p_70108_1_).func_180456_s() != EntityMinecart.EnumMinecartType.FURNACE && this.func_180456_s() == EntityMinecart.EnumMinecartType.FURNACE) ++ else if (((EntityMinecart)p_70108_1_).isPoweredCart() && isPoweredCart()) { - entityIn.motionX *= 0.20000000298023224D; - entityIn.motionZ *= 0.20000000298023224D; + p_70108_1_.field_70159_w *= 0.20000000298023224D; + p_70108_1_.field_70179_y *= 0.20000000298023224D; @@ -1042,6 +1074,221 @@ } } @@ -237,11 +237,11 @@ + /* =================================== FORGE START ===========================================*/ + private BlockPos getCurrentRailPosition() + { -+ int x = MathHelper.floor_double(this.posX); -+ int y = MathHelper.floor_double(this.posY); -+ int z = MathHelper.floor_double(this.posZ); ++ int x = MathHelper.func_76128_c(this.field_70165_t); ++ int y = MathHelper.func_76128_c(this.field_70163_u); ++ int z = MathHelper.func_76128_c(this.field_70161_v); + -+ if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(x, y - 1, z))) y--; ++ if (BlockRailBase.func_176562_d(this.field_70170_p, new BlockPos(x, y - 1, z))) y--; + return new BlockPos(x, y, z); + } + @@ -249,10 +249,10 @@ + { + if (!canUseRail()) return func_174898_m(); + BlockPos pos = this.getCurrentRailPosition(); -+ IBlockState state = this.worldObj.getBlockState(pos); -+ if (!BlockRailBase.isRailBlock(state)) return func_174898_m(); ++ IBlockState state = this.field_70170_p.func_180495_p(pos); ++ if (!BlockRailBase.func_176563_d(state)) return func_174898_m(); + -+ float railMaxSpeed = ((BlockRailBase)state.getBlock()).getRailMaxSpeed(worldObj, this, pos); ++ float railMaxSpeed = ((BlockRailBase)state.func_177230_c()).getRailMaxSpeed(field_70170_p, this, pos); + return Math.min(railMaxSpeed, getCurrentCartSpeedCapOnRail()); + } + @@ -262,19 +262,19 @@ + */ + public void moveMinecartOnRail(BlockPos pos) + { -+ double mX = this.motionX; -+ double mZ = this.motionZ; ++ double mX = this.field_70159_w; ++ double mZ = this.field_70179_y; + -+ if (this.riddenByEntity != null) ++ if (this.field_70153_n != null) + { + mX *= 0.75D; + mZ *= 0.75D; + } + + double max = this.getMaxSpeed(); -+ mX = MathHelper.clamp_double(mX, -max, max); -+ mZ = MathHelper.clamp_double(mZ, -max, max); -+ this.moveEntity(mX, 0.0D, mZ); ++ mX = MathHelper.func_151237_a(mX, -max, max); ++ mZ = MathHelper.func_151237_a(mZ, -max, max); ++ this.func_70091_d(mX, 0.0D, mZ); + } + + /** @@ -307,25 +307,25 @@ + { + if (this instanceof EntityMinecartFurnace) + { -+ return new ItemStack(Items.furnace_minecart); ++ return new ItemStack(Items.field_151109_aJ); + } + else if (this instanceof EntityMinecartChest) + { -+ return new ItemStack(Items.chest_minecart); ++ return new ItemStack(Items.field_151108_aI); + } + else if (this instanceof EntityMinecartTNT) + { -+ return new ItemStack(Items.tnt_minecart); ++ return new ItemStack(Items.field_151142_bV); + } + else if (this instanceof EntityMinecartHopper) + { -+ return new ItemStack(Items.hopper_minecart); ++ return new ItemStack(Items.field_151140_bW); + } + else if (this instanceof EntityMinecartCommandBlock) + { -+ return new ItemStack(Items.command_block_minecart); ++ return new ItemStack(Items.field_151095_cc); + } -+ return new ItemStack(Items.minecart); ++ return new ItemStack(Items.field_151143_au); + } + + /** @@ -363,7 +363,7 @@ + */ + public boolean isPoweredCart() + { -+ return getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE; ++ return func_180456_s() == EntityMinecart.EnumMinecartType.FURNACE; + } + + /** @@ -372,7 +372,7 @@ + */ + public boolean canBeRidden() + { -+ return this.getMinecartType() == EntityMinecart.EnumMinecartType.RIDEABLE; ++ return this.func_180456_s() == EntityMinecart.EnumMinecartType.RIDEABLE; + } + + /** diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch index fcac570fb..e9ce1fedd 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java @@ -180,6 +180,7 @@ - public boolean interactFirst(EntityPlayer playerIn) + public boolean func_130002_c(EntityPlayer p_130002_1_) { -+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, playerIn))) return true; - if (!this.worldObj.isRemote) ++ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_130002_1_))) return true; + if (!this.field_70170_p.field_72995_K) { - playerIn.displayGUIChest(this); + p_130002_1_.func_71007_a(this); diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch index e262844ee..807d5622e 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java @@ -18,6 +18,7 @@ - public boolean interactFirst(EntityPlayer playerIn) + public boolean func_130002_c(EntityPlayer p_130002_1_) { -+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, playerIn))) return true; - if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != playerIn) ++ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_130002_1_))) return true; + if (this.field_70153_n != null && this.field_70153_n instanceof EntityPlayer && this.field_70153_n != p_130002_1_) { return true; diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch index 6c351329f..a051aba6b 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java @@ -131,6 +131,7 @@ - public boolean interactFirst(EntityPlayer playerIn) + public boolean func_130002_c(EntityPlayer p_130002_1_) { -+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, playerIn))) return true; - ItemStack itemstack = playerIn.inventory.getCurrentItem(); ++ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_130002_1_))) return true; + ItemStack itemstack = p_130002_1_.field_71071_by.func_70448_g(); - if (itemstack != null && itemstack.getItem() == Items.coal) + if (itemstack != null && itemstack.func_77973_b() == Items.field_151044_h) diff --git a/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch index 79d7a4a27..7fc5668b9 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java @@ -54,6 +54,7 @@ - public boolean interactFirst(EntityPlayer playerIn) + public boolean func_130002_c(EntityPlayer p_130002_1_) { -+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, playerIn))) return true; - if (!this.worldObj.isRemote) ++ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_130002_1_))) return true; + if (!this.field_70170_p.field_72995_K) { - playerIn.displayGUIChest(this); + p_130002_1_.func_71007_a(this); diff --git a/patches/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch b/patches/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch index c10781a8d..f0c991f61 100644 --- a/patches/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch +++ b/patches/minecraft/net/minecraft/entity/item/EntityXPOrb.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/entity/item/EntityXPOrb.java @@ -199,6 +199,7 @@ { - if (this.field_70532_c == 0 && entityIn.xpCooldown == 0) + if (this.field_70532_c == 0 && p_70100_1_.field_71090_bL == 0) { -+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerPickupXpEvent(entityIn, this))) return; - entityIn.xpCooldown = 2; - this.worldObj.playSoundAtEntity(entityIn, "random.orb", 0.1F, 0.5F * ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.8F)); - entityIn.onItemPickup(this, 1); ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerPickupXpEvent(p_70100_1_, this))) return; + p_70100_1_.field_71090_bL = 2; + this.field_70170_p.func_72956_a(p_70100_1_, "random.orb", 0.1F, 0.5F * ((this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.7F + 1.8F)); + p_70100_1_.func_71001_a(this, 1); diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch index 8946e7b58..3f5db488a 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch @@ -2,21 +2,21 @@ +++ ../src-work/minecraft/net/minecraft/entity/monster/EntityEnderman.java @@ -198,12 +198,14 @@ - protected boolean teleportTo(double p_70825_1_, double p_70825_3_, double p_70825_5_) + protected boolean func_70825_j(double p_70825_1_, double p_70825_3_, double p_70825_5_) { + net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(this, p_70825_1_, p_70825_3_, p_70825_5_, 0); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return false; - double d0 = this.posX; - double d1 = this.posY; - double d2 = this.posZ; -- this.posX = p_70825_1_; -- this.posY = p_70825_3_; -- this.posZ = p_70825_5_; -+ this.posX = event.targetX; -+ this.posY = event.targetY; -+ this.posZ = event.targetZ; + double d0 = this.field_70165_t; + double d1 = this.field_70163_u; + double d2 = this.field_70161_v; +- this.field_70165_t = p_70825_1_; +- this.field_70163_u = p_70825_3_; +- this.field_70161_v = p_70825_5_; ++ this.field_70165_t = event.targetX; ++ this.field_70163_u = event.targetY; ++ this.field_70161_v = event.targetZ; boolean flag = false; - BlockPos blockpos = new BlockPos(this.posX, this.posY, this.posZ); + BlockPos blockpos = new BlockPos(this.field_70165_t, this.field_70163_u, this.field_70161_v); @@ -364,6 +366,18 @@ } @@ -25,15 +25,15 @@ + /*===================================== Forge Start ==============================*/ + public static void setCarriable(Block block, boolean canCarry) + { -+ if (canCarry) carriableBlocks.add(block); -+ else carriableBlocks.remove(block); ++ if (canCarry) field_70827_d.add(block); ++ else field_70827_d.remove(block); + } + public static boolean getCarriable(Block block) + { -+ return carriableBlocks.contains(block); ++ return field_70827_d.contains(block); + } + /*===================================== Forge End ==============================*/ + - public boolean isScreaming() + public boolean func_70823_r() { - return this.dataWatcher.getWatchableObjectByte(18) > 0; + return this.field_70180_af.func_75683_a(18) > 0; diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch index 87582d358..72690ba3f 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java.patch @@ -2,8 +2,8 @@ +++ ../src-work/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java @@ -103,6 +103,7 @@ { - this.motionY = (double)(0.42F + (float)this.getSlimeSize() * 0.1F); - this.isAirBorne = true; + this.field_70181_x = (double)(0.42F + (float)this.func_70809_q() * 0.1F); + this.field_70160_al = true; + net.minecraftforge.common.ForgeHooks.onLivingJump(this); } diff --git a/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch index bb6fe2bf7..351ba4598 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntitySlime.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/entity/monster/EntitySlime.java +++ ../src-work/minecraft/net/minecraft/entity/monster/EntitySlime.java @@ -271,7 +271,7 @@ - BlockPos blockpos = new BlockPos(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ)); - Chunk chunk = this.worldObj.getChunkFromBlockCoords(blockpos); + BlockPos blockpos = new BlockPos(MathHelper.func_76128_c(this.field_70165_t), 0, MathHelper.func_76128_c(this.field_70161_v)); + Chunk chunk = this.field_70170_p.func_175726_f(blockpos); -- if (this.worldObj.getWorldInfo().getTerrainType() == WorldType.FLAT && this.rand.nextInt(4) != 1) -+ if (this.worldObj.getWorldInfo().getTerrainType().handleSlimeSpawnReduction(rand, worldObj)) +- if (this.field_70170_p.func_72912_H().func_76067_t() == WorldType.field_77138_c && this.field_70146_Z.nextInt(4) != 1) ++ if (this.field_70170_p.func_72912_H().func_76067_t().handleSlimeSpawnReduction(field_70146_Z, field_70170_p)) { return false; } diff --git a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch index 085d75e65..5e5a32c79 100644 --- a/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch +++ b/patches/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch @@ -1,33 +1,33 @@ --- ../src-base/minecraft/net/minecraft/entity/monster/EntityZombie.java +++ ../src-work/minecraft/net/minecraft/entity/monster/EntityZombie.java @@ -87,7 +87,7 @@ - this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(35.0D); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D); -- this.getAttributeMap().registerAttribute(reinforcementChance).setBaseValue(this.rand.nextDouble() * 0.10000000149011612D); -+ this.getAttributeMap().registerAttribute(reinforcementChance).setBaseValue(this.rand.nextDouble() * net.minecraftforge.common.ForgeModContainer.zombieSummonBaseChance); + this.func_110148_a(SharedMonsterAttributes.field_111265_b).func_111128_a(35.0D); + this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a(0.23000000417232513D); + this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111128_a(3.0D); +- this.func_110140_aT().func_111150_b(field_110186_bp).func_111128_a(this.field_70146_Z.nextDouble() * 0.10000000149011612D); ++ this.func_110140_aT().func_111150_b(field_110186_bp).func_111128_a(this.field_70146_Z.nextDouble() * net.minecraftforge.common.ForgeModContainer.zombieSummonBaseChance); } - protected void entityInit() + protected void func_70088_a() @@ -229,12 +229,25 @@ - entitylivingbase = (EntityLivingBase)source.getEntity(); + entitylivingbase = (EntityLivingBase)p_70097_1_.func_76346_g(); } -- if (entitylivingbase != null && this.worldObj.getDifficulty() == EnumDifficulty.HARD && (double)this.rand.nextFloat() < this.getEntityAttribute(reinforcementChance).getAttributeValue()) -+ int i = MathHelper.floor_double(this.posX); -+ int j = MathHelper.floor_double(this.posY); -+ int k = MathHelper.floor_double(this.posZ); +- if (entitylivingbase != null && this.field_70170_p.func_175659_aa() == EnumDifficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e()) ++ int i = MathHelper.func_76128_c(this.field_70165_t); ++ int j = MathHelper.func_76128_c(this.field_70163_u); ++ int k = MathHelper.func_76128_c(this.field_70161_v); + -+ net.minecraftforge.event.entity.living.ZombieEvent.SummonAidEvent summonAid = net.minecraftforge.event.ForgeEventFactory.fireZombieSummonAid(this, worldObj, i, j, k, entitylivingbase, this.getEntityAttribute(reinforcementChance).getAttributeValue()); ++ net.minecraftforge.event.entity.living.ZombieEvent.SummonAidEvent summonAid = net.minecraftforge.event.ForgeEventFactory.fireZombieSummonAid(this, field_70170_p, i, j, k, entitylivingbase, this.func_110148_a(field_110186_bp).func_111126_e()); + if (summonAid.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return true; + + if (summonAid.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW || -+ entitylivingbase != null && this.worldObj.getDifficulty() == EnumDifficulty.HARD && (double)this.rand.nextFloat() < this.getEntityAttribute(reinforcementChance).getAttributeValue()) ++ entitylivingbase != null && this.field_70170_p.func_175659_aa() == EnumDifficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e()) { -- int i = MathHelper.floor_double(this.posX); -- int j = MathHelper.floor_double(this.posY); -- int k = MathHelper.floor_double(this.posZ); -- EntityZombie entityzombie = new EntityZombie(this.worldObj); +- int i = MathHelper.func_76128_c(this.field_70165_t); +- int j = MathHelper.func_76128_c(this.field_70163_u); +- int k = MathHelper.func_76128_c(this.field_70161_v); +- EntityZombie entityzombie = new EntityZombie(this.field_70170_p); + EntityZombie entityzombie; + if (summonAid.customSummonedAid != null && summonAid.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW) + { @@ -35,26 +35,26 @@ + } + else + { -+ entityzombie = new EntityZombie(this.worldObj); ++ entityzombie = new EntityZombie(this.field_70170_p); + } for (int l = 0; l < 50; ++l) { @@ -249,7 +262,7 @@ - if (!this.worldObj.func_175636_b((double)i1, (double)j1, (double)k1, 7.0D) && this.worldObj.checkNoEntityCollision(entityzombie.getEntityBoundingBox(), entityzombie) && this.worldObj.getCollidingBoundingBoxes(entityzombie, entityzombie.getEntityBoundingBox()).isEmpty() && !this.worldObj.isAnyLiquid(entityzombie.getEntityBoundingBox())) + if (!this.field_70170_p.func_175636_b((double)i1, (double)j1, (double)k1, 7.0D) && this.field_70170_p.func_72917_a(entityzombie.func_174813_aQ(), entityzombie) && this.field_70170_p.func_72945_a(entityzombie, entityzombie.func_174813_aQ()).isEmpty() && !this.field_70170_p.func_72953_d(entityzombie.func_174813_aQ())) { - this.worldObj.spawnEntityInWorld(entityzombie); -- entityzombie.setAttackTarget(entitylivingbase); -+ if (entitylivingbase != null) entityzombie.setAttackTarget(entitylivingbase); - entityzombie.func_180482_a(this.worldObj.getDifficultyForLocation(new BlockPos(entityzombie)), (IEntityLivingData)null); - this.getEntityAttribute(reinforcementChance).applyModifier(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, 0)); - entityzombie.getEntityAttribute(reinforcementChance).applyModifier(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, 0)); + this.field_70170_p.func_72838_d(entityzombie); +- entityzombie.func_70624_b(entitylivingbase); ++ if (entitylivingbase != null) entityzombie.func_70624_b(entitylivingbase); + entityzombie.func_180482_a(this.field_70170_p.func_175649_E(new BlockPos(entityzombie)), (IEntityLivingData)null); + this.func_110148_a(field_110186_bp).func_111121_a(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, 0)); + entityzombie.func_110148_a(field_110186_bp).func_111121_a(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, 0)); @@ -465,7 +478,7 @@ if (p_180482_2_ == null) { -- p_180482_2_ = new EntityZombie.GroupData(this.worldObj.rand.nextFloat() < 0.05F, this.worldObj.rand.nextFloat() < 0.05F); -+ p_180482_2_ = new EntityZombie.GroupData(this.worldObj.rand.nextFloat() < net.minecraftforge.common.ForgeModContainer.zombieBabyChance, this.worldObj.rand.nextFloat() < 0.05F); +- p_180482_2_ = new EntityZombie.GroupData(this.field_70170_p.field_73012_v.nextFloat() < 0.05F, this.field_70170_p.field_73012_v.nextFloat() < 0.05F); ++ p_180482_2_ = new EntityZombie.GroupData(this.field_70170_p.field_73012_v.nextFloat() < net.minecraftforge.common.ForgeModContainer.zombieBabyChance, this.field_70170_p.field_73012_v.nextFloat() < 0.05F); } if (p_180482_2_ instanceof EntityZombie.GroupData) diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch index 172f84a75..988e8b587 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityHorse.java.patch @@ -3,8 +3,8 @@ @@ -1247,6 +1247,7 @@ } - this.jumpPower = 0.0F; + this.field_110277_bt = 0.0F; + net.minecraftforge.common.ForgeHooks.onLivingJump(this); } - this.stepHeight = 1.0F; + this.field_70138_W = 1.0F; diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch index 17b3f0256..e996a2886 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch @@ -7,56 +7,56 @@ -public class EntityMooshroom extends EntityCow +public class EntityMooshroom extends EntityCow implements net.minecraftforge.common.IShearable { - public EntityMooshroom(World worldIn) + public EntityMooshroom(World p_i1687_1_) { @@ -18,6 +18,7 @@ - this.field_175506_bl = Blocks.mycelium; + this.field_175506_bl = Blocks.field_150391_bh; } + @SuppressWarnings("unused") - public boolean interact(EntityPlayer player) + public boolean func_70085_c(EntityPlayer p_70085_1_) { - ItemStack itemstack = player.inventory.getCurrentItem(); + ItemStack itemstack = p_70085_1_.field_71071_by.func_70448_g(); @@ -37,7 +38,7 @@ } } -- if (itemstack != null && itemstack.getItem() == Items.shears && this.getGrowingAge() >= 0) -+ if (false && itemstack != null && itemstack.getItem() == Items.shears && this.getGrowingAge() >= 0) //Forge Disable, Moved to onSheared +- if (itemstack != null && itemstack.func_77973_b() == Items.field_151097_aZ && this.func_70874_b() >= 0) ++ if (false && itemstack != null && itemstack.func_77973_b() == Items.field_151097_aZ && this.func_70874_b() >= 0) //Forge Disable, Moved to onSheared { - this.setDead(); - this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D, new int[0]); + this.func_70106_y(); + this.field_70170_p.func_175688_a(EnumParticleTypes.EXPLOSION_LARGE, this.field_70165_t, this.field_70163_u + (double)(this.field_70131_O / 2.0F), this.field_70161_v, 0.0D, 0.0D, 0.0D, new int[0]); @@ -77,4 +78,33 @@ { - return new EntityMooshroom(this.worldObj); + return new EntityMooshroom(this.field_70170_p); } + -+ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, net.minecraft.util.BlockPos pos){ return getGrowingAge() >= 0; } ++ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, net.minecraft.util.BlockPos pos){ return func_70874_b() >= 0; } + @Override + public java.util.List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, net.minecraft.util.BlockPos pos, int fortune) + { -+ this.setDead(); -+ this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D, new int[0]); ++ this.func_70106_y(); ++ this.field_70170_p.func_175688_a(EnumParticleTypes.EXPLOSION_LARGE, this.field_70165_t, this.field_70163_u + (double)(this.field_70131_O / 2.0F), this.field_70161_v, 0.0D, 0.0D, 0.0D, new int[0]); + -+ EntityCow entitycow = new EntityCow(this.worldObj); -+ entitycow.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); -+ entitycow.setHealth(this.getHealth()); -+ entitycow.renderYawOffset = this.renderYawOffset; ++ EntityCow entitycow = new EntityCow(this.field_70170_p); ++ entitycow.func_70012_b(this.field_70165_t, this.field_70163_u, this.field_70161_v, this.field_70177_z, this.field_70125_A); ++ entitycow.func_70606_j(this.func_110143_aJ()); ++ entitycow.field_70761_aq = this.field_70761_aq; + -+ if (this.hasCustomName()) ++ if (this.func_145818_k_()) + { -+ entitycow.setCustomNameTag(this.getCustomNameTag()); ++ entitycow.func_96094_a(this.func_95999_t()); + } + -+ this.worldObj.spawnEntityInWorld(entitycow); ++ this.field_70170_p.func_72838_d(entitycow); + + java.util.List ret = new java.util.ArrayList(); + for (int i = 0; i < 5; ++i) + { -+ ret.add(new ItemStack(Blocks.red_mushroom)); ++ ret.add(new ItemStack(Blocks.field_150337_Q)); + } + -+ this.playSound("mob.sheep.shear", 1.0F, 1.0F); ++ this.func_85030_a("mob.sheep.shear", 1.0F, 1.0F); + return ret; + } } diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch index 247ecdbad..ec6eaae58 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/entity/passive/EntityOcelot.java @@ -279,7 +279,7 @@ - Block block = this.worldObj.getBlockState(blockpos.down()).getBlock(); + Block block = this.field_70170_p.func_180495_p(blockpos.func_177977_b()).func_177230_c(); -- if (block == Blocks.grass || block.getMaterial() == Material.leaves) -+ if (block == Blocks.grass || block.isLeaves(worldObj, blockpos.down())) +- if (block == Blocks.field_150349_c || block.func_149688_o() == Material.field_151584_j) ++ if (block == Blocks.field_150349_c || block.isLeaves(field_70170_p, blockpos.func_177977_b())) { 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 5252358ed..7d9799ce8 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch @@ -7,39 +7,39 @@ -public class EntitySheep extends EntityAnimal +public class EntitySheep extends EntityAnimal implements net.minecraftforge.common.IShearable { - private final InventoryCrafting inventoryCrafting = new InventoryCrafting(new Container() + private final InventoryCrafting field_90016_e = new InventoryCrafting(new Container() { @@ -140,11 +140,12 @@ } } + @SuppressWarnings("unused") - public boolean interact(EntityPlayer player) + public boolean func_70085_c(EntityPlayer p_70085_1_) { - ItemStack itemstack = player.inventory.getCurrentItem(); + ItemStack itemstack = p_70085_1_.field_71071_by.func_70448_g(); -- if (itemstack != null && itemstack.getItem() == Items.shears && !this.getSheared() && !this.isChild()) -+ if (false && itemstack != null && itemstack.getItem() == Items.shears && !this.getSheared() && !this.isChild()) //Forge: Moved to onSheared +- if (itemstack != null && itemstack.func_77973_b() == Items.field_151097_aZ && !this.func_70892_o() && !this.func_70631_g_()) ++ if (false && itemstack != null && itemstack.func_77973_b() == Items.field_151097_aZ && !this.func_70892_o() && !this.func_70631_g_()) //Forge: Moved to onSheared { - if (!this.worldObj.isRemote) + if (!this.field_70170_p.field_72995_K) { @@ -327,4 +328,19 @@ field_175514_bm.put(EnumDyeColor.RED, new float[] {0.6F, 0.2F, 0.2F}); field_175514_bm.put(EnumDyeColor.BLACK, new float[] {0.1F, 0.1F, 0.1F}); } + -+ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos){ return !this.getSheared() && !this.isChild(); } ++ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos){ return !this.func_70892_o() && !this.func_70631_g_(); } + @Override + public java.util.List onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) + { -+ this.setSheared(true); -+ int i = 1 + this.rand.nextInt(3); ++ this.func_70893_e(true); ++ int i = 1 + this.field_70146_Z.nextInt(3); + + java.util.List ret = new java.util.ArrayList(); + for (int j = 0; j < i; ++j) -+ ret.add(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, this.getFleeceColor().getMetadata())); ++ ret.add(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, this.func_175509_cj().func_176765_a())); + -+ this.playSound("mob.sheep.shear", 1.0F, 1.0F); ++ this.func_85030_a("mob.sheep.shear", 1.0F, 1.0F); + return ret; + } } diff --git a/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch b/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch index 980be12b6..9648a8f59 100644 --- a/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch +++ b/patches/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch @@ -1,30 +1,30 @@ --- ../src-base/minecraft/net/minecraft/entity/passive/EntityVillager.java +++ ../src-work/minecraft/net/minecraft/entity/passive/EntityVillager.java @@ -81,6 +81,7 @@ - private boolean isLookingForHome; + private boolean field_82190_bM; private boolean field_175564_by; - private InventoryBasic villagerInventory; + private InventoryBasic field_175560_bz; + @Deprecated //Use VillagerRegistry - private static final EntityVillager.ITradeList[][][][] DEFAULT_TRADE_LIST_MAP = new EntityVillager.ITradeList[][][][] {{{{new EntityVillager.EmeraldForItems(Items.wheat, new EntityVillager.PriceInfo(18, 22)), new EntityVillager.EmeraldForItems(Items.potato, new EntityVillager.PriceInfo(15, 19)), new EntityVillager.EmeraldForItems(Items.carrot, new EntityVillager.PriceInfo(15, 19)), new EntityVillager.ListItemForEmeralds(Items.bread, new EntityVillager.PriceInfo(-4, -2))}, {new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.pumpkin), new EntityVillager.PriceInfo(8, 13)), new EntityVillager.ListItemForEmeralds(Items.pumpkin_pie, new EntityVillager.PriceInfo(-3, -2))}, {new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.melon_block), new EntityVillager.PriceInfo(7, 12)), new EntityVillager.ListItemForEmeralds(Items.apple, new EntityVillager.PriceInfo(-5, -7))}, {new EntityVillager.ListItemForEmeralds(Items.cookie, new EntityVillager.PriceInfo(-6, -10)), new EntityVillager.ListItemForEmeralds(Items.cake, new EntityVillager.PriceInfo(1, 1))}}, {{new EntityVillager.EmeraldForItems(Items.string, new EntityVillager.PriceInfo(15, 20)), new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ItemAndEmeraldToItem(Items.fish, new EntityVillager.PriceInfo(6, 6), Items.cooked_fish, new EntityVillager.PriceInfo(6, 6))}, {new EntityVillager.ListEnchantedItemForEmeralds(Items.fishing_rod, new EntityVillager.PriceInfo(7, 8))}}, {{new EntityVillager.EmeraldForItems(Item.getItemFromBlock(Blocks.wool), new EntityVillager.PriceInfo(16, 22)), new EntityVillager.ListItemForEmeralds(Items.shears, new EntityVillager.PriceInfo(3, 4))}, {new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 0), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 1), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 2), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 3), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 4), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 5), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 6), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 7), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 8), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 9), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 10), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 11), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 12), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 13), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 14), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 15), new EntityVillager.PriceInfo(1, 2))}}, {{new EntityVillager.EmeraldForItems(Items.string, new EntityVillager.PriceInfo(15, 20)), new EntityVillager.ListItemForEmeralds(Items.arrow, new EntityVillager.PriceInfo(-12, -8))}, {new EntityVillager.ListItemForEmeralds(Items.bow, new EntityVillager.PriceInfo(2, 3)), new EntityVillager.ItemAndEmeraldToItem(Item.getItemFromBlock(Blocks.gravel), new EntityVillager.PriceInfo(10, 10), Items.flint, new EntityVillager.PriceInfo(6, 10))}}}, {{{new EntityVillager.EmeraldForItems(Items.paper, new EntityVillager.PriceInfo(24, 36)), new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.EmeraldForItems(Items.book, new EntityVillager.PriceInfo(8, 10)), new EntityVillager.ListItemForEmeralds(Items.compass, new EntityVillager.PriceInfo(10, 12)), new EntityVillager.ListItemForEmeralds(Item.getItemFromBlock(Blocks.bookshelf), new EntityVillager.PriceInfo(3, 4))}, {new EntityVillager.EmeraldForItems(Items.written_book, new EntityVillager.PriceInfo(2, 2)), new EntityVillager.ListItemForEmeralds(Items.clock, new EntityVillager.PriceInfo(10, 12)), new EntityVillager.ListItemForEmeralds(Item.getItemFromBlock(Blocks.glass), new EntityVillager.PriceInfo(-5, -3))}, {new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.ListItemForEmeralds(Items.name_tag, new EntityVillager.PriceInfo(20, 22))}}}, {{{new EntityVillager.EmeraldForItems(Items.rotten_flesh, new EntityVillager.PriceInfo(36, 40)), new EntityVillager.EmeraldForItems(Items.gold_ingot, new EntityVillager.PriceInfo(8, 10))}, {new EntityVillager.ListItemForEmeralds(Items.redstone, new EntityVillager.PriceInfo(-4, -1)), new EntityVillager.ListItemForEmeralds(new ItemStack(Items.dye, 1, EnumDyeColor.BLUE.getDyeDamage()), new EntityVillager.PriceInfo(-2, -1))}, {new EntityVillager.ListItemForEmeralds(Items.ender_eye, new EntityVillager.PriceInfo(7, 11)), new EntityVillager.ListItemForEmeralds(Item.getItemFromBlock(Blocks.glowstone), new EntityVillager.PriceInfo(-3, -1))}, {new EntityVillager.ListItemForEmeralds(Items.experience_bottle, new EntityVillager.PriceInfo(3, 11))}}}, {{{new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.iron_helmet, new EntityVillager.PriceInfo(4, 6))}, {new EntityVillager.EmeraldForItems(Items.iron_ingot, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListItemForEmeralds(Items.iron_chestplate, new EntityVillager.PriceInfo(10, 14))}, {new EntityVillager.EmeraldForItems(Items.diamond, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_chestplate, new EntityVillager.PriceInfo(16, 19))}, {new EntityVillager.ListItemForEmeralds(Items.chainmail_boots, new EntityVillager.PriceInfo(5, 7)), new EntityVillager.ListItemForEmeralds(Items.chainmail_leggings, new EntityVillager.PriceInfo(9, 11)), new EntityVillager.ListItemForEmeralds(Items.chainmail_helmet, new EntityVillager.PriceInfo(5, 7)), new EntityVillager.ListItemForEmeralds(Items.chainmail_chestplate, new EntityVillager.PriceInfo(11, 15))}}, {{new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.iron_axe, new EntityVillager.PriceInfo(6, 8))}, {new EntityVillager.EmeraldForItems(Items.iron_ingot, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListEnchantedItemForEmeralds(Items.iron_sword, new EntityVillager.PriceInfo(9, 10))}, {new EntityVillager.EmeraldForItems(Items.diamond, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_sword, new EntityVillager.PriceInfo(12, 15)), new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_axe, new EntityVillager.PriceInfo(9, 12))}}, {{new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListEnchantedItemForEmeralds(Items.iron_shovel, new EntityVillager.PriceInfo(5, 7))}, {new EntityVillager.EmeraldForItems(Items.iron_ingot, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListEnchantedItemForEmeralds(Items.iron_pickaxe, new EntityVillager.PriceInfo(9, 11))}, {new EntityVillager.EmeraldForItems(Items.diamond, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.diamond_pickaxe, new EntityVillager.PriceInfo(12, 15))}}}, {{{new EntityVillager.EmeraldForItems(Items.porkchop, new EntityVillager.PriceInfo(14, 18)), new EntityVillager.EmeraldForItems(Items.chicken, new EntityVillager.PriceInfo(14, 18))}, {new EntityVillager.EmeraldForItems(Items.coal, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.cooked_porkchop, new EntityVillager.PriceInfo(-7, -5)), new EntityVillager.ListItemForEmeralds(Items.cooked_chicken, new EntityVillager.PriceInfo(-8, -6))}}, {{new EntityVillager.EmeraldForItems(Items.leather, new EntityVillager.PriceInfo(9, 12)), new EntityVillager.ListItemForEmeralds(Items.leather_leggings, new EntityVillager.PriceInfo(2, 4))}, {new EntityVillager.ListEnchantedItemForEmeralds(Items.leather_chestplate, new EntityVillager.PriceInfo(7, 12))}, {new EntityVillager.ListItemForEmeralds(Items.saddle, new EntityVillager.PriceInfo(8, 10))}}}}; + private static final EntityVillager.ITradeList[][][][] field_175561_bA = new EntityVillager.ITradeList[][][][] {{{{new EntityVillager.EmeraldForItems(Items.field_151015_O, new EntityVillager.PriceInfo(18, 22)), new EntityVillager.EmeraldForItems(Items.field_151174_bG, new EntityVillager.PriceInfo(15, 19)), new EntityVillager.EmeraldForItems(Items.field_151172_bF, new EntityVillager.PriceInfo(15, 19)), new EntityVillager.ListItemForEmeralds(Items.field_151025_P, new EntityVillager.PriceInfo(-4, -2))}, {new EntityVillager.EmeraldForItems(Item.func_150898_a(Blocks.field_150423_aK), new EntityVillager.PriceInfo(8, 13)), new EntityVillager.ListItemForEmeralds(Items.field_151158_bO, new EntityVillager.PriceInfo(-3, -2))}, {new EntityVillager.EmeraldForItems(Item.func_150898_a(Blocks.field_150440_ba), new EntityVillager.PriceInfo(7, 12)), new EntityVillager.ListItemForEmeralds(Items.field_151034_e, new EntityVillager.PriceInfo(-5, -7))}, {new EntityVillager.ListItemForEmeralds(Items.field_151106_aX, new EntityVillager.PriceInfo(-6, -10)), new EntityVillager.ListItemForEmeralds(Items.field_151105_aU, new EntityVillager.PriceInfo(1, 1))}}, {{new EntityVillager.EmeraldForItems(Items.field_151007_F, new EntityVillager.PriceInfo(15, 20)), new EntityVillager.EmeraldForItems(Items.field_151044_h, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ItemAndEmeraldToItem(Items.field_151115_aP, new EntityVillager.PriceInfo(6, 6), Items.field_179566_aV, new EntityVillager.PriceInfo(6, 6))}, {new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151112_aM, new EntityVillager.PriceInfo(7, 8))}}, {{new EntityVillager.EmeraldForItems(Item.func_150898_a(Blocks.field_150325_L), new EntityVillager.PriceInfo(16, 22)), new EntityVillager.ListItemForEmeralds(Items.field_151097_aZ, new EntityVillager.PriceInfo(3, 4))}, {new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 0), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 1), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 2), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 3), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 4), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 5), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 6), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 7), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 8), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 9), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 10), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 11), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 12), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 13), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 14), new EntityVillager.PriceInfo(1, 2)), new EntityVillager.ListItemForEmeralds(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, 15), new EntityVillager.PriceInfo(1, 2))}}, {{new EntityVillager.EmeraldForItems(Items.field_151007_F, new EntityVillager.PriceInfo(15, 20)), new EntityVillager.ListItemForEmeralds(Items.field_151032_g, new EntityVillager.PriceInfo(-12, -8))}, {new EntityVillager.ListItemForEmeralds(Items.field_151031_f, new EntityVillager.PriceInfo(2, 3)), new EntityVillager.ItemAndEmeraldToItem(Item.func_150898_a(Blocks.field_150351_n), new EntityVillager.PriceInfo(10, 10), Items.field_151145_ak, new EntityVillager.PriceInfo(6, 10))}}}, {{{new EntityVillager.EmeraldForItems(Items.field_151121_aF, new EntityVillager.PriceInfo(24, 36)), new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.EmeraldForItems(Items.field_151122_aG, new EntityVillager.PriceInfo(8, 10)), new EntityVillager.ListItemForEmeralds(Items.field_151111_aL, new EntityVillager.PriceInfo(10, 12)), new EntityVillager.ListItemForEmeralds(Item.func_150898_a(Blocks.field_150342_X), new EntityVillager.PriceInfo(3, 4))}, {new EntityVillager.EmeraldForItems(Items.field_151164_bB, new EntityVillager.PriceInfo(2, 2)), new EntityVillager.ListItemForEmeralds(Items.field_151113_aN, new EntityVillager.PriceInfo(10, 12)), new EntityVillager.ListItemForEmeralds(Item.func_150898_a(Blocks.field_150359_w), new EntityVillager.PriceInfo(-5, -3))}, {new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.ListEnchantedBookForEmeralds()}, {new EntityVillager.ListItemForEmeralds(Items.field_151057_cb, new EntityVillager.PriceInfo(20, 22))}}}, {{{new EntityVillager.EmeraldForItems(Items.field_151078_bh, new EntityVillager.PriceInfo(36, 40)), new EntityVillager.EmeraldForItems(Items.field_151043_k, new EntityVillager.PriceInfo(8, 10))}, {new EntityVillager.ListItemForEmeralds(Items.field_151137_ax, new EntityVillager.PriceInfo(-4, -1)), new EntityVillager.ListItemForEmeralds(new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BLUE.func_176767_b()), new EntityVillager.PriceInfo(-2, -1))}, {new EntityVillager.ListItemForEmeralds(Items.field_151061_bv, new EntityVillager.PriceInfo(7, 11)), new EntityVillager.ListItemForEmeralds(Item.func_150898_a(Blocks.field_150426_aN), new EntityVillager.PriceInfo(-3, -1))}, {new EntityVillager.ListItemForEmeralds(Items.field_151062_by, new EntityVillager.PriceInfo(3, 11))}}}, {{{new EntityVillager.EmeraldForItems(Items.field_151044_h, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.field_151028_Y, new EntityVillager.PriceInfo(4, 6))}, {new EntityVillager.EmeraldForItems(Items.field_151042_j, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListItemForEmeralds(Items.field_151030_Z, new EntityVillager.PriceInfo(10, 14))}, {new EntityVillager.EmeraldForItems(Items.field_151045_i, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151163_ad, new EntityVillager.PriceInfo(16, 19))}, {new EntityVillager.ListItemForEmeralds(Items.field_151029_X, new EntityVillager.PriceInfo(5, 7)), new EntityVillager.ListItemForEmeralds(Items.field_151022_W, new EntityVillager.PriceInfo(9, 11)), new EntityVillager.ListItemForEmeralds(Items.field_151020_U, new EntityVillager.PriceInfo(5, 7)), new EntityVillager.ListItemForEmeralds(Items.field_151023_V, new EntityVillager.PriceInfo(11, 15))}}, {{new EntityVillager.EmeraldForItems(Items.field_151044_h, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.field_151036_c, new EntityVillager.PriceInfo(6, 8))}, {new EntityVillager.EmeraldForItems(Items.field_151042_j, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151040_l, new EntityVillager.PriceInfo(9, 10))}, {new EntityVillager.EmeraldForItems(Items.field_151045_i, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151048_u, new EntityVillager.PriceInfo(12, 15)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151056_x, new EntityVillager.PriceInfo(9, 12))}}, {{new EntityVillager.EmeraldForItems(Items.field_151044_h, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151037_a, new EntityVillager.PriceInfo(5, 7))}, {new EntityVillager.EmeraldForItems(Items.field_151042_j, new EntityVillager.PriceInfo(7, 9)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151035_b, new EntityVillager.PriceInfo(9, 11))}, {new EntityVillager.EmeraldForItems(Items.field_151045_i, new EntityVillager.PriceInfo(3, 4)), new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151046_w, new EntityVillager.PriceInfo(12, 15))}}}, {{{new EntityVillager.EmeraldForItems(Items.field_151147_al, new EntityVillager.PriceInfo(14, 18)), new EntityVillager.EmeraldForItems(Items.field_151076_bf, new EntityVillager.PriceInfo(14, 18))}, {new EntityVillager.EmeraldForItems(Items.field_151044_h, new EntityVillager.PriceInfo(16, 24)), new EntityVillager.ListItemForEmeralds(Items.field_151157_am, new EntityVillager.PriceInfo(-7, -5)), new EntityVillager.ListItemForEmeralds(Items.field_151077_bg, new EntityVillager.PriceInfo(-8, -6))}}, {{new EntityVillager.EmeraldForItems(Items.field_151116_aA, new EntityVillager.PriceInfo(9, 12)), new EntityVillager.ListItemForEmeralds(Items.field_151026_S, new EntityVillager.PriceInfo(2, 4))}, {new EntityVillager.ListEnchantedItemForEmeralds(Items.field_151027_R, new EntityVillager.PriceInfo(7, 12))}, {new EntityVillager.ListItemForEmeralds(Items.field_151141_av, new EntityVillager.PriceInfo(8, 10))}}}}; - public EntityVillager(World worldIn) + public EntityVillager(World p_i1747_1_) @@ -210,7 +211,7 @@ - ItemStack itemstack = player.inventory.getCurrentItem(); - boolean flag = itemstack != null && itemstack.getItem() == Items.spawn_egg; + ItemStack itemstack = p_70085_1_.field_71071_by.func_70448_g(); + boolean flag = itemstack != null && itemstack.func_77973_b() == Items.field_151063_bx; -- if (!flag && this.isEntityAlive() && !this.isTrading() && !this.isChild()) -+ if (!flag && this.isEntityAlive() && !this.isTrading() && !this.isChild() && !player.isSneaking()) +- if (!flag && this.func_70089_S() && !this.func_70940_q() && !this.func_70631_g_()) ++ if (!flag && this.func_70089_S() && !this.func_70940_q() && !this.func_70631_g_() && !p_70085_1_.func_70093_af()) { - if (!this.worldObj.isRemote && (this.buyingList == null || this.buyingList.size() > 0)) + if (!this.field_70170_p.field_72995_K && (this.field_70963_i == null || this.field_70963_i.size() > 0)) { @@ -522,6 +523,7 @@ - private void populateBuyingList() + private void func_175554_cu() { + //TODO: Hook into VillagerRegistry - EntityVillager.ITradeList[][][] aentityvillager$itradelist = DEFAULT_TRADE_LIST_MAP[this.getProfession()]; + EntityVillager.ITradeList[][][] aentityvillager$itradelist = field_175561_bA[this.func_70946_n()]; - if (this.careerId != 0 && this.careerLevel != 0) + if (this.field_175563_bv != 0 && this.field_175562_bw != 0) @@ -635,6 +637,7 @@ } } @@ -37,8 +37,8 @@ public IEntityLivingData func_180482_a(DifficultyInstance p_180482_1_, IEntityLivingData p_180482_2_) { p_180482_2_ = super.func_180482_a(p_180482_1_, p_180482_2_); -- this.setProfession(this.worldObj.rand.nextInt(5)); -+ net.minecraftforge.fml.common.registry.VillagerRegistry.setRandomProfession(this, this.worldObj.rand); +- this.func_70938_b(this.field_70170_p.field_73012_v.nextInt(5)); ++ net.minecraftforge.fml.common.registry.VillagerRegistry.setRandomProfession(this, this.field_70170_p.field_73012_v); this.func_175552_ct(); return p_180482_2_; } diff --git a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch index c37cc423d..cdf492a0c 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch @@ -9,45 +9,45 @@ + private java.util.HashMap spawnForcedMap = new java.util.HashMap(); + public float eyeHeight = this.getDefaultEyeHeight(); + - public InventoryPlayer inventory = new InventoryPlayer(this); - private InventoryEnderChest theInventoryEnderChest = new InventoryEnderChest(); - public Container inventoryContainer; + public InventoryPlayer field_71071_by = new InventoryPlayer(this); + private InventoryEnderChest field_71078_a = new InventoryEnderChest(); + public Container field_71069_bz; @@ -175,7 +180,8 @@ { - if (this.itemInUse != null) + if (this.field_71074_e != null) { -- this.itemInUse.onPlayerStoppedUsing(this.worldObj, this, this.itemInUseCount); -+ if (!net.minecraftforge.event.ForgeEventFactory.onUseItemStop(this, itemInUse, this.itemInUseCount)) -+ this.itemInUse.onPlayerStoppedUsing(this.worldObj, this, this.itemInUseCount); +- this.field_71074_e.func_77974_b(this.field_70170_p, this, this.field_71072_f); ++ if (!net.minecraftforge.event.ForgeEventFactory.onUseItemStop(this, field_71074_e, this.field_71072_f)) ++ this.field_71074_e.func_77974_b(this.field_70170_p, this, this.field_71072_f); } - this.clearItemInUse(); + this.func_71041_bz(); @@ -199,6 +205,7 @@ - public void onUpdate() + public void func_70071_h_() { + net.minecraftforge.fml.common.FMLCommonHandler.instance().onPlayerPreTick(this); - this.noClip = this.isSpectator(); + this.field_70145_X = this.func_175149_v(); - if (this.isSpectator()) + if (this.func_175149_v()) @@ -212,6 +219,14 @@ - if (itemstack == this.itemInUse) + if (itemstack == this.field_71074_e) { -+ itemInUseCount = net.minecraftforge.event.ForgeEventFactory.onItemUseTick(this, itemInUse, itemInUseCount); -+ if (itemInUseCount <= 0) ++ field_71072_f = net.minecraftforge.event.ForgeEventFactory.onItemUseTick(this, field_71074_e, field_71072_f); ++ if (field_71072_f <= 0) + { -+ this.onItemUseFinish(); ++ this.func_71036_o(); + } + else + { // Forge Keep unindented to lower patch -+ itemInUse.getItem().onUsingTick(itemInUse, this, itemInUseCount); //Forge Added - if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) ++ field_71074_e.func_77973_b().onUsingTick(field_71074_e, this, field_71072_f); //Forge Added + if (this.field_71072_f <= 25 && this.field_71072_f % 4 == 0) { - this.updateItemUse(itemstack, 5); + this.func_71010_c(itemstack, 5); @@ -221,6 +236,7 @@ { - this.onItemUseFinish(); + this.func_71036_o(); } + } } @@ -55,106 +55,106 @@ { @@ -266,7 +282,7 @@ - super.onUpdate(); + super.func_70071_h_(); -- if (!this.worldObj.isRemote && this.openContainer != null && !this.openContainer.canInteractWith(this)) -+ if (!this.worldObj.isRemote && this.openContainer != null && !net.minecraftforge.common.ForgeHooks.canInteractWith(this, this.openContainer)) +- if (!this.field_70170_p.field_72995_K && this.field_71070_bA != null && !this.field_71070_bA.func_75145_c(this)) ++ if (!this.field_70170_p.field_72995_K && this.field_71070_bA != null && !net.minecraftforge.common.ForgeHooks.canInteractWith(this, this.field_71070_bA)) { - this.closeScreen(); - this.openContainer = this.inventoryContainer; + this.func_71053_j(); + this.field_71070_bA = this.field_71069_bz; @@ -343,6 +359,7 @@ { - this.setPosition(d3, this.posY, d4); + this.func_70107_b(d3, this.field_70163_u, d4); } + net.minecraftforge.fml.common.FMLCommonHandler.instance().onPlayerPostTick(this); } - public int getMaxInPortalTime() + public int func_82145_z() @@ -412,11 +429,12 @@ - int i = this.itemInUse.stackSize; - ItemStack itemstack = this.itemInUse.onItemUseFinish(this.worldObj, this); + int i = this.field_71074_e.field_77994_a; + ItemStack itemstack = this.field_71074_e.func_77950_b(this.field_70170_p, this); -+ itemstack = net.minecraftforge.event.ForgeEventFactory.onItemUseFinish(this, itemInUse, itemInUseCount, itemstack); - if (itemstack != this.itemInUse || itemstack != null && itemstack.stackSize != i) ++ itemstack = net.minecraftforge.event.ForgeEventFactory.onItemUseFinish(this, field_71074_e, field_71072_f, itemstack); + if (itemstack != this.field_71074_e || itemstack != null && itemstack.field_77994_a != i) { - this.inventory.mainInventory[this.inventory.currentItem] = itemstack; + this.field_71071_by.field_70462_a[this.field_71071_by.field_70461_c] = itemstack; -- if (itemstack.stackSize == 0) -+ if (itemstack != null && itemstack.stackSize == 0) +- if (itemstack.field_77994_a == 0) ++ if (itemstack != null && itemstack.field_77994_a == 0) { - this.inventory.mainInventory[this.inventory.currentItem] = null; + this.field_71071_by.field_70462_a[this.field_71071_by.field_70461_c] = null; } @@ -476,11 +494,11 @@ - this.cameraYaw = 0.0F; - this.addMountedMovementStat(this.posX - d0, this.posY - d1, this.posZ - d2); + this.field_71109_bG = 0.0F; + this.func_71015_k(this.field_70165_t - d0, this.field_70163_u - d1, this.field_70161_v - d2); -- if (this.ridingEntity instanceof EntityPig) -+ if (this.ridingEntity instanceof EntityLivingBase && ((EntityLivingBase)ridingEntity).shouldRiderFaceForward(this)) +- if (this.field_70154_o instanceof EntityPig) ++ if (this.field_70154_o instanceof EntityLivingBase && ((EntityLivingBase)field_70154_o).shouldRiderFaceForward(this)) { - this.rotationPitch = f1; - this.rotationYaw = f; -- this.renderYawOffset = ((EntityPig)this.ridingEntity).renderYawOffset; -+ this.renderYawOffset = ((EntityLivingBase)this.ridingEntity).renderYawOffset; + this.field_70125_A = f1; + this.field_70177_z = f; +- this.field_70761_aq = ((EntityPig)this.field_70154_o).field_70761_aq; ++ this.field_70761_aq = ((EntityLivingBase)this.field_70154_o).field_70761_aq; } } } @@ -610,11 +628,15 @@ - public void onDeath(DamageSource cause) + public void func_70645_a(DamageSource p_70645_1_) { -+ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, cause)) return; - super.onDeath(cause); - this.setSize(0.2F, 0.2F); - this.setPosition(this.posX, this.posY, this.posZ); - this.motionY = 0.10000000149011612D; ++ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, p_70645_1_)) return; + super.func_70645_a(p_70645_1_); + this.func_70105_a(0.2F, 0.2F); + this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); + this.field_70181_x = 0.10000000149011612D; + captureDrops = true; + capturedDrops.clear(); + - if (this.getName().equals("Notch")) + if (this.func_70005_c_().equals("Notch")) { - this.dropItem(new ItemStack(Items.apple, 1), true, false); + this.func_146097_a(new ItemStack(Items.field_151034_e, 1), true, false); @@ -625,6 +647,9 @@ - this.inventory.dropAllItems(); + this.field_71071_by.func_70436_m(); } + captureDrops = false; -+ if (!worldObj.isRemote) net.minecraftforge.event.ForgeEventFactory.onPlayerDrops(this, cause, capturedDrops, recentlyHit > 0); ++ if (!field_70170_p.field_72995_K) net.minecraftforge.event.ForgeEventFactory.onPlayerDrops(this, p_70645_1_, capturedDrops, field_70718_bc > 0); + - if (cause != null) + if (p_70645_1_ != null) { - this.motionX = (double)(-MathHelper.cos((this.attackedAtYaw + this.rotationYaw) * (float)Math.PI / 180.0F) * 0.1F); + this.field_70159_w = (double)(-MathHelper.func_76134_b((this.field_70739_aP + this.field_70177_z) * (float)Math.PI / 180.0F) * 0.1F); @@ -707,12 +732,25 @@ - public EntityItem dropOneItem(boolean p_71040_1_) + public EntityItem func_71040_bB(boolean p_71040_1_) { -- return this.dropItem(this.inventory.decrStackSize(this.inventory.currentItem, p_71040_1_ && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().stackSize : 1), false, true); -+ ItemStack stack = inventory.getCurrentItem(); +- return this.func_146097_a(this.field_71071_by.func_70298_a(this.field_71071_by.field_70461_c, p_71040_1_ && this.field_71071_by.func_70448_g() != null ? this.field_71071_by.func_70448_g().field_77994_a : 1), false, true); ++ ItemStack stack = field_71071_by.func_70448_g(); + + if (stack == null) + { + return null; + } + -+ if (stack.getItem().onDroppedByPlayer(stack, this)) ++ if (stack.func_77973_b().onDroppedByPlayer(stack, this)) + { -+ int count = p_71040_1_ && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().stackSize : 1; -+ return net.minecraftforge.common.ForgeHooks.onPlayerTossEvent(this, inventory.decrStackSize(inventory.currentItem, count), true); ++ int count = p_71040_1_ && this.field_71071_by.func_70448_g() != null ? this.field_71071_by.func_70448_g().field_77994_a : 1; ++ return net.minecraftforge.common.ForgeHooks.onPlayerTossEvent(this, field_71071_by.func_70298_a(field_71071_by.field_70461_c, count), true); + } + + return null; } - public EntityItem dropPlayerItemWithRandomChoice(ItemStack itemStackIn, boolean unused) + public EntityItem func_71019_a(ItemStack p_71019_1_, boolean p_71019_2_) { -- return this.dropItem(itemStackIn, false, false); -+ return net.minecraftforge.common.ForgeHooks.onPlayerTossEvent(this, itemStackIn, false); +- return this.func_146097_a(p_71019_1_, false, false); ++ return net.minecraftforge.common.ForgeHooks.onPlayerTossEvent(this, p_71019_1_, false); } - public EntityItem dropItem(ItemStack droppedItem, boolean dropAround, boolean traceItem) + public EntityItem func_146097_a(ItemStack p_146097_1_, boolean p_146097_2_, boolean p_146097_3_) @@ -770,13 +808,25 @@ - public void joinEntityItemWithWorld(EntityItem p_71012_1_) + public void func_71012_a(EntityItem p_71012_1_) { + if (captureDrops) + { @@ -162,23 +162,23 @@ + return; + } + - this.worldObj.spawnEntityInWorld(p_71012_1_); + this.field_70170_p.func_72838_d(p_71012_1_); } + @Deprecated //Use location sensitive version below - public float getToolDigEfficiency(Block p_180471_1_) + public float func_180471_a(Block p_180471_1_) { -- float f = this.inventory.getStrVsBlock(p_180471_1_); -+ return getBreakSpeed(p_180471_1_.getDefaultState(), new BlockPos(0, -1, 0)); +- float f = this.field_71071_by.func_146023_a(p_180471_1_); ++ return getBreakSpeed(p_180471_1_.func_176223_P(), new BlockPos(0, -1, 0)); + } + public float getBreakSpeed(IBlockState state, BlockPos pos) + { -+ ItemStack stack = inventory.getCurrentItem(); -+ float f = (stack == null ? 1.0F : stack.getItem().getDigSpeed(stack, state)); ++ ItemStack stack = field_71071_by.func_70448_g(); ++ float f = (stack == null ? 1.0F : stack.func_77973_b().getDigSpeed(stack, state)); if (f > 1.0F) { - int i = EnchantmentHelper.getEfficiencyModifier(this); + int i = EnchantmentHelper.func_77509_b(this); @@ -826,12 +876,13 @@ f /= 5.0F; } @@ -188,32 +188,32 @@ + return (f < 0 ? 0 : f); } - public boolean canHarvestBlock(Block p_146099_1_) + public boolean func_146099_a(Block p_146099_1_) { -- return this.inventory.func_146025_b(p_146099_1_); -+ return net.minecraftforge.event.ForgeEventFactory.doPlayerHarvestCheck(this, p_146099_1_, this.inventory.func_146025_b(p_146099_1_)); +- return this.field_71071_by.func_146025_b(p_146099_1_); ++ return net.minecraftforge.event.ForgeEventFactory.doPlayerHarvestCheck(this, p_146099_1_, this.field_71071_by.func_146025_b(p_146099_1_)); } - public void readEntityFromNBT(NBTTagCompound tagCompund) + public void func_70037_a(NBTTagCompound p_70037_1_) @@ -867,6 +918,16 @@ - this.spawnForced = tagCompund.getBoolean("SpawnForced"); + this.field_82248_d = p_70037_1_.func_74767_n("SpawnForced"); } + NBTTagList spawnlist = null; -+ spawnlist = tagCompund.getTagList("Spawns", 10); -+ for (int i = 0; i < spawnlist.tagCount(); i++) ++ spawnlist = p_70037_1_.func_150295_c("Spawns", 10); ++ for (int i = 0; i < spawnlist.func_74745_c(); i++) + { -+ NBTTagCompound spawndata = (NBTTagCompound)spawnlist.getCompoundTagAt(i); -+ int spawndim = spawndata.getInteger("Dim"); -+ this.spawnChunkMap.put(spawndim, new BlockPos(spawndata.getInteger("SpawnX"), spawndata.getInteger("SpawnY"), spawndata.getInteger("SpawnZ"))); -+ this.spawnForcedMap.put(spawndim, spawndata.getBoolean("SpawnForced")); ++ NBTTagCompound spawndata = (NBTTagCompound)spawnlist.func_150305_b(i); ++ int spawndim = spawndata.func_74762_e("Dim"); ++ this.spawnChunkMap.put(spawndim, new BlockPos(spawndata.func_74762_e("SpawnX"), spawndata.func_74762_e("SpawnY"), spawndata.func_74762_e("SpawnZ"))); ++ this.spawnForcedMap.put(spawndim, spawndata.func_74767_n("SpawnForced")); + } + - this.foodStats.readNBT(tagCompund); - this.capabilities.readCapabilitiesFromNBT(tagCompund); + this.field_71100_bB.func_75112_a(p_70037_1_); + this.field_71075_bZ.func_75095_b(p_70037_1_); @@ -898,6 +959,23 @@ - tagCompound.setBoolean("SpawnForced", this.spawnForced); + p_70014_1_.func_74757_a("SpawnForced", this.field_82248_d); } + NBTTagList spawnlist = new NBTTagList(); @@ -224,264 +224,264 @@ + Boolean forced = spawnForcedMap.get(entry.getKey()); + if (forced == null) forced = false; + NBTTagCompound spawndata = new NBTTagCompound(); -+ spawndata.setInteger("Dim", entry.getKey()); -+ spawndata.setInteger("SpawnX", spawn.getX()); -+ spawndata.setInteger("SpawnY", spawn.getY()); -+ spawndata.setInteger("SpawnZ", spawn.getZ()); -+ spawndata.setBoolean("SpawnForced", forced); -+ spawnlist.appendTag(spawndata); ++ spawndata.func_74768_a("Dim", entry.getKey()); ++ spawndata.func_74768_a("SpawnX", spawn.func_177958_n()); ++ spawndata.func_74768_a("SpawnY", spawn.func_177956_o()); ++ spawndata.func_74768_a("SpawnZ", spawn.func_177952_p()); ++ spawndata.func_74757_a("SpawnForced", forced); ++ spawnlist.func_74742_a(spawndata); + } -+ tagCompound.setTag("Spawns", spawnlist); ++ p_70014_1_.func_74782_a("Spawns", spawnlist); + - this.foodStats.writeNBT(tagCompound); - this.capabilities.writeCapabilitiesToNBT(tagCompound); - tagCompound.setTag("EnderItems", this.theInventoryEnderChest.saveInventoryToNBT()); + this.field_71100_bB.func_75117_b(p_70014_1_); + this.field_71075_bZ.func_75091_a(p_70014_1_); + p_70014_1_.func_74782_a("EnderItems", this.field_71078_a.func_70487_g()); @@ -911,6 +989,7 @@ - public boolean attackEntityFrom(DamageSource source, float amount) + public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { -+ if (!net.minecraftforge.common.ForgeHooks.onLivingAttack(this, source, amount)) return false; - if (this.isEntityInvulnerable(source)) ++ if (!net.minecraftforge.common.ForgeHooks.onLivingAttack(this, p_70097_1_, p_70097_2_)) return false; + if (this.func_180431_b(p_70097_1_)) { return false; @@ -1007,12 +1086,15 @@ { - if (!this.isEntityInvulnerable(damageSrc)) + if (!this.func_180431_b(p_70665_1_)) { -+ damageAmount = net.minecraftforge.common.ForgeHooks.onLivingHurt(this, damageSrc, damageAmount); -+ if (damageAmount <= 0) return; - if (!damageSrc.isUnblockable() && this.isBlocking() && damageAmount > 0.0F) ++ p_70665_2_ = net.minecraftforge.common.ForgeHooks.onLivingHurt(this, p_70665_1_, p_70665_2_); ++ if (p_70665_2_ <= 0) return; + if (!p_70665_1_.func_76363_c() && this.func_70632_aY() && p_70665_2_ > 0.0F) { - damageAmount = (1.0F + damageAmount) * 0.5F; + p_70665_2_ = (1.0F + p_70665_2_) * 0.5F; } -- damageAmount = this.applyArmorCalculations(damageSrc, damageAmount); -+ damageAmount = net.minecraftforge.common.ISpecialArmor.ArmorProperties.applyArmor(this, inventory.armorInventory, damageSrc, damageAmount); -+ if (damageAmount <= 0) return; - damageAmount = this.applyPotionDamageCalculations(damageSrc, damageAmount); - float f = damageAmount; - damageAmount = Math.max(damageAmount - this.getAbsorptionAmount(), 0.0F); +- p_70665_2_ = this.func_70655_b(p_70665_1_, p_70665_2_); ++ p_70665_2_ = net.minecraftforge.common.ISpecialArmor.ArmorProperties.applyArmor(this, field_71071_by.field_70460_b, p_70665_1_, p_70665_2_); ++ if (p_70665_2_ <= 0) return; + p_70665_2_ = this.func_70672_c(p_70665_1_, p_70665_2_); + float f = p_70665_2_; + p_70665_2_ = Math.max(p_70665_2_ - this.func_110139_bj(), 0.0F); @@ -1074,6 +1156,7 @@ } else { + if (!net.minecraftforge.event.ForgeEventFactory.canInteractWith(this, p_70998_1_)) return false; - ItemStack itemstack = this.getCurrentEquippedItem(); - ItemStack itemstack1 = itemstack != null ? itemstack.copy() : null; + ItemStack itemstack = this.func_71045_bC(); + ItemStack itemstack1 = itemstack != null ? itemstack.func_77946_l() : null; @@ -1125,7 +1208,9 @@ - public void destroyCurrentEquippedItem() + public void func_71028_bD() { -+ ItemStack orig = getCurrentEquippedItem(); - this.inventory.setInventorySlotContents(this.inventory.currentItem, (ItemStack)null); ++ ItemStack orig = func_71045_bC(); + this.field_71071_by.func_70299_a(this.field_71071_by.field_70461_c, (ItemStack)null); + net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this, orig); } - public double getYOffset() + public double func_70033_W() @@ -1135,6 +1220,7 @@ - public void attackTargetEntityWithCurrentItem(Entity targetEntity) + public void func_71059_n(Entity p_71059_1_) { -+ if (!net.minecraftforge.common.ForgeHooks.onPlayerAttackTarget(this, targetEntity)) return; - if (targetEntity.canAttackWithItem()) ++ if (!net.minecraftforge.common.ForgeHooks.onPlayerAttackTarget(this, p_71059_1_)) return; + if (p_71059_1_.func_70075_an()) { - if (!targetEntity.hitByEntity(this)) + if (!p_71059_1_.func_85031_j(this)) @@ -1311,6 +1397,8 @@ - public EntityPlayer.EnumStatus trySleep(BlockPos bedLocation) + public EntityPlayer.EnumStatus func_180469_a(BlockPos p_180469_1_) { -+ EntityPlayer.EnumStatus ret = net.minecraftforge.event.ForgeEventFactory.onPlayerSleepInBed(this, bedLocation); ++ EntityPlayer.EnumStatus ret = net.minecraftforge.event.ForgeEventFactory.onPlayerSleepInBed(this, p_180469_1_); + if (ret != null) return ret; - if (!this.worldObj.isRemote) + if (!this.field_70170_p.field_72995_K) { - if (this.isPlayerSleeping() || !this.isEntityAlive()) + if (this.func_70608_bn() || !this.func_70089_S()) @@ -1352,7 +1440,7 @@ - if (this.worldObj.isBlockLoaded(bedLocation)) + if (this.field_70170_p.func_175667_e(p_180469_1_)) { -- EnumFacing enumfacing = (EnumFacing)this.worldObj.getBlockState(bedLocation).getValue(BlockDirectional.FACING); -+ EnumFacing enumfacing = this.worldObj.getBlockState(bedLocation).getBlock().getBedDirection(worldObj, bedLocation); +- EnumFacing enumfacing = (EnumFacing)this.field_70170_p.func_180495_p(p_180469_1_).func_177229_b(BlockDirectional.field_176387_N); ++ EnumFacing enumfacing = this.field_70170_p.func_180495_p(p_180469_1_).func_177230_c().getBedDirection(field_70170_p, p_180469_1_); float f = 0.5F; float f1 = 0.5F; @@ -1415,13 +1503,14 @@ - public void wakeUpPlayer(boolean p_70999_1_, boolean updateWorldFlag, boolean setSpawn) + public void func_70999_a(boolean p_70999_1_, boolean p_70999_2_, boolean p_70999_3_) { -+ net.minecraftforge.event.ForgeEventFactory.onPlayerWakeup(this, p_70999_1_, updateWorldFlag, setSpawn); - this.setSize(0.6F, 1.8F); - IBlockState iblockstate = this.worldObj.getBlockState(this.playerLocation); ++ net.minecraftforge.event.ForgeEventFactory.onPlayerWakeup(this, p_70999_1_, p_70999_2_, p_70999_3_); + this.func_70105_a(0.6F, 1.8F); + IBlockState iblockstate = this.field_70170_p.func_180495_p(this.field_71081_bT); -- if (this.playerLocation != null && iblockstate.getBlock() == Blocks.bed) -+ if (this.playerLocation != null && iblockstate.getBlock().isBed(worldObj, playerLocation, this)) +- if (this.field_71081_bT != null && iblockstate.func_177230_c() == Blocks.field_150324_C) ++ if (this.field_71081_bT != null && iblockstate.func_177230_c().isBed(field_70170_p, field_71081_bT, this)) { -- this.worldObj.setBlockState(this.playerLocation, iblockstate.withProperty(BlockBed.OCCUPIED, Boolean.valueOf(false)), 4); -- BlockPos blockpos = BlockBed.getSafeExitLocation(this.worldObj, this.playerLocation, 0); -+ iblockstate.getBlock().setBedOccupied(worldObj, playerLocation, this, false); -+ BlockPos blockpos = iblockstate.getBlock().getBedSpawnPosition(worldObj, playerLocation, this); +- this.field_70170_p.func_180501_a(this.field_71081_bT, iblockstate.func_177226_a(BlockBed.field_176471_b, Boolean.valueOf(false)), 4); +- BlockPos blockpos = BlockBed.func_176468_a(this.field_70170_p, this.field_71081_bT, 0); ++ iblockstate.func_177230_c().setBedOccupied(field_70170_p, field_71081_bT, this, false); ++ BlockPos blockpos = iblockstate.func_177230_c().getBedSpawnPosition(field_70170_p, field_71081_bT, this); if (blockpos == null) { @@ -1448,14 +1537,14 @@ - private boolean isInBed() + private boolean func_175143_p() { -- return this.worldObj.getBlockState(this.playerLocation).getBlock() == Blocks.bed; -+ return this.worldObj.getBlockState(this.playerLocation).getBlock().isBed(worldObj, playerLocation, this); +- return this.field_70170_p.func_180495_p(this.field_71081_bT).func_177230_c() == Blocks.field_150324_C; ++ return this.field_70170_p.func_180495_p(this.field_71081_bT).func_177230_c().isBed(field_70170_p, field_71081_bT, this); } - public static BlockPos getBedSpawnLocation(World worldIn, BlockPos bedLocation, boolean forceSpawn) + public static BlockPos func_180467_a(World p_180467_0_, BlockPos p_180467_1_, boolean p_180467_2_) { - Block block = worldIn.getBlockState(bedLocation).getBlock(); + Block block = p_180467_0_.func_180495_p(p_180467_1_).func_177230_c(); -- if (block != Blocks.bed) -+ if (!block.isBed(worldIn, bedLocation, null)) +- if (block != Blocks.field_150324_C) ++ if (!block.isBed(p_180467_0_, p_180467_1_, null)) { - if (!forceSpawn) + if (!p_180467_2_) { @@ -1470,7 +1559,7 @@ } else { -- return BlockBed.getSafeExitLocation(worldIn, bedLocation, 0); -+ return worldIn.getBlockState(bedLocation).getBlock().getBedSpawnPosition(worldIn, bedLocation, null); +- return BlockBed.func_176468_a(p_180467_0_, p_180467_1_, 0); ++ return p_180467_0_.func_180495_p(p_180467_1_).func_177230_c().getBedSpawnPosition(p_180467_0_, p_180467_1_, null); } } @@ -1479,7 +1568,7 @@ { - if (this.playerLocation != null) + if (this.field_71081_bT != null) { -- EnumFacing enumfacing = (EnumFacing)this.worldObj.getBlockState(this.playerLocation).getValue(BlockDirectional.FACING); -+ EnumFacing enumfacing = this.worldObj.getBlockState(this.playerLocation).getBlock().getBedDirection(worldObj, playerLocation); +- EnumFacing enumfacing = (EnumFacing)this.field_70170_p.func_180495_p(this.field_71081_bT).func_177229_b(BlockDirectional.field_176387_N); ++ EnumFacing enumfacing = this.field_70170_p.func_180495_p(this.field_71081_bT).func_177230_c().getBedDirection(field_70170_p, field_71081_bT); switch (enumfacing) { @@ -1519,16 +1608,24 @@ - public BlockPos getBedLocation() + public BlockPos func_180470_cg() { -- return this.spawnChunk; -+ return getBedLocation(this.dimension); +- return this.field_71077_c; ++ return getBedLocation(this.field_71093_bK); } + @Deprecated // Use dimension-sensitive version. - public boolean isSpawnForced() + public boolean func_82245_bX() { -- return this.spawnForced; -+ return isSpawnForced(this.dimension); +- return this.field_82248_d; ++ return isSpawnForced(this.field_71093_bK); } - public void setSpawnPoint(BlockPos pos, boolean forced) + public void func_180473_a(BlockPos p_180473_1_, boolean p_180473_2_) { -+ if(net.minecraftforge.event.ForgeEventFactory.onPlayerSpawnSet(this, pos, forced)) return; -+ if (this.dimension != 0) ++ if(net.minecraftforge.event.ForgeEventFactory.onPlayerSpawnSet(this, p_180473_1_, p_180473_2_)) return; ++ if (this.field_71093_bK != 0) + { -+ setSpawnChunk(pos, forced, this.dimension); ++ setSpawnChunk(p_180473_1_, p_180473_2_, this.field_71093_bK); + return; + } + - if (pos != null) + if (p_180473_1_ != null) { - this.spawnChunk = pos; + this.field_71077_c = p_180473_1_; @@ -1712,6 +1809,10 @@ - super.fall(distance, damageMultiplier); + super.func_180430_e(p_180430_1_, p_180430_2_); } + else + { -+ net.minecraftforge.event.ForgeEventFactory.onPlayerFall(this, distance, damageMultiplier); ++ net.minecraftforge.event.ForgeEventFactory.onPlayerFall(this, p_180430_1_, p_180430_2_); + } } - protected void resetHeight() + protected void func_71061_d_() @@ -1735,6 +1836,7 @@ } - EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(EntityList.getEntityID(entityLivingIn))); -+ if (entitylist$entityegginfo == null) entitylist$entityegginfo = net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().get(EntityList.getEntityString(entityLivingIn)); + EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.field_75627_a.get(Integer.valueOf(EntityList.func_75619_a(p_70074_1_))); ++ if (entitylist$entityegginfo == null) entitylist$entityegginfo = net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().get(EntityList.func_75621_b(p_70074_1_)); if (entitylist$entityegginfo != null) { @@ -1847,6 +1949,8 @@ { - if (stack != this.itemInUse) + if (p_71008_1_ != this.field_71074_e) { -+ duration = net.minecraftforge.event.ForgeEventFactory.onItemUseStart(this, stack, duration); -+ if (duration <= 0) return; - this.itemInUse = stack; - this.itemInUseCount = duration; ++ p_71008_2_ = net.minecraftforge.event.ForgeEventFactory.onItemUseStart(this, p_71008_1_, p_71008_2_); ++ if (p_71008_2_ <= 0) return; + this.field_71074_e = p_71008_1_; + this.field_71072_f = p_71008_2_; @@ -1918,6 +2022,10 @@ - this.field_181016_an = oldPlayer.field_181016_an; - this.field_181017_ao = oldPlayer.field_181017_ao; - this.field_181018_ap = oldPlayer.field_181018_ap; + this.field_181016_an = p_71049_1_.field_181016_an; + this.field_181017_ao = p_71049_1_.field_181017_ao; + this.field_181018_ap = p_71049_1_.field_181018_ap; + //Copy and re-init ExtendedProperties when switching dimensions. -+ this.extendedProperties = oldPlayer.extendedProperties; ++ this.extendedProperties = p_71049_1_.extendedProperties; + for (net.minecraftforge.common.IExtendedEntityProperties p : this.extendedProperties.values()) -+ p.init(this, this.worldObj); ++ p.init(this, this.field_70170_p); } - else if (this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) + else if (this.field_70170_p.func_82736_K().func_82766_b("keepInventory")) { @@ -1931,6 +2039,18 @@ - this.xpSeed = oldPlayer.xpSeed; - this.theInventoryEnderChest = oldPlayer.theInventoryEnderChest; - this.getDataWatcher().updateObject(10, Byte.valueOf(oldPlayer.getDataWatcher().getWatchableObjectByte(10))); + this.field_175152_f = p_71049_1_.field_175152_f; + this.field_71078_a = p_71049_1_.field_71078_a; + this.func_70096_w().func_75692_b(10, Byte.valueOf(p_71049_1_.func_70096_w().func_75683_a(10))); + -+ this.spawnChunkMap = oldPlayer.spawnChunkMap; -+ this.spawnForcedMap = oldPlayer.spawnForcedMap; ++ this.spawnChunkMap = p_71049_1_.spawnChunkMap; ++ this.spawnForcedMap = p_71049_1_.spawnForcedMap; + + //Copy over a section of the Entity Data from the old player. + //Allows mods to specify data that persists after players respawn. -+ NBTTagCompound old = oldPlayer.getEntityData(); -+ if (old.hasKey(PERSISTED_NBT_TAG)) ++ NBTTagCompound old = p_71049_1_.getEntityData(); ++ if (old.func_74764_b(PERSISTED_NBT_TAG)) + { -+ getEntityData().setTag(PERSISTED_NBT_TAG, old.getCompoundTag(PERSISTED_NBT_TAG)); ++ getEntityData().func_74782_a(PERSISTED_NBT_TAG, old.func_74775_l(PERSISTED_NBT_TAG)); + } -+ net.minecraftforge.event.ForgeEventFactory.onPlayerClone(this, oldPlayer, !respawnFromEnd); ++ net.minecraftforge.event.ForgeEventFactory.onPlayerClone(this, p_71049_1_, !p_71049_2_); } - protected boolean canTriggerWalking() + protected boolean func_70041_e_() @@ -1968,7 +2088,14 @@ - public void setCurrentItemOrArmor(int slotIn, ItemStack stack) + public void func_70062_b(int p_70062_1_, ItemStack p_70062_2_) { -- this.inventory.armorInventory[slotIn] = stack; -+ if (slotIn == 0) //Forge: Fix issue in Player where it doen't take into account selected item +- this.field_71071_by.field_70460_b[p_70062_1_] = p_70062_2_; ++ if (p_70062_1_ == 0) //Forge: Fix issue in Player where it doen't take into account selected item + { -+ this.inventory.mainInventory[this.inventory.currentItem] = stack; ++ this.field_71071_by.field_70462_a[this.field_71071_by.field_70461_c] = p_70062_2_; + } + else + { -+ this.inventory.armorInventory[slotIn - 1] = stack; ++ this.field_71071_by.field_70460_b[p_70062_1_ - 1] = p_70062_2_; + } } @SideOnly(Side.CLIENT) @@ -2013,7 +2140,10 @@ - public IChatComponent getDisplayName() + public IChatComponent func_145748_c_() { -- IChatComponent ichatcomponent = new ChatComponentText(ScorePlayerTeam.formatPlayerName(this.getTeam(), this.getName())); +- IChatComponent ichatcomponent = new ChatComponentText(ScorePlayerTeam.func_96667_a(this.func_96124_cp(), this.func_70005_c_())); + IChatComponent ichatcomponent = new ChatComponentText(""); -+ if (!prefixes.isEmpty()) for (net.minecraft.util.IChatComponent prefix : prefixes) ichatcomponent.appendSibling(prefix); -+ ichatcomponent.appendSibling(new ChatComponentText(ScorePlayerTeam.formatPlayerName(this.getTeam(), this.getDisplayNameString()))); -+ if (!suffixes.isEmpty()) for (net.minecraft.util.IChatComponent suffix : suffixes) ichatcomponent.appendSibling(suffix); - ichatcomponent.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.getName() + " ")); - ichatcomponent.getChatStyle().setChatHoverEvent(this.func_174823_aP()); - ichatcomponent.getChatStyle().setInsertion(this.getName()); ++ if (!prefixes.isEmpty()) for (net.minecraft.util.IChatComponent prefix : prefixes) ichatcomponent.func_150257_a(prefix); ++ ichatcomponent.func_150257_a(new ChatComponentText(ScorePlayerTeam.func_96667_a(this.func_96124_cp(), this.getDisplayNameString()))); ++ if (!suffixes.isEmpty()) for (net.minecraft.util.IChatComponent suffix : suffixes) ichatcomponent.func_150257_a(suffix); + ichatcomponent.func_150256_b().func_150241_a(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.func_70005_c_() + " ")); + ichatcomponent.func_150256_b().func_150209_a(this.func_174823_aP()); + ichatcomponent.func_150256_b().func_179989_a(this.func_70005_c_()); @@ -2022,7 +2152,7 @@ - public float getEyeHeight() + public float func_70047_e() { - float f = 1.62F; + float f = eyeHeight; - if (this.isPlayerSleeping()) + if (this.func_70608_bn()) { @@ -2155,6 +2285,136 @@ - this.hasReducedDebug = reducedDebug; + this.field_175153_bG = p_175150_1_; } + /** @@ -509,7 +509,7 @@ + */ + public BlockPos getBedLocation(int dimension) + { -+ return dimension == 0 ? spawnChunk : spawnChunkMap.get(dimension); ++ return dimension == 0 ? field_71077_c : spawnChunkMap.get(dimension); + } + + /** @@ -521,7 +521,7 @@ + */ + public boolean isSpawnForced(int dimension) + { -+ if (dimension == 0) return this.spawnForced; ++ if (dimension == 0) return this.field_82248_d; + Boolean forced = this.spawnForcedMap.get(dimension); + return forced == null ? false : forced; + } @@ -539,13 +539,13 @@ + { + if (pos != null) + { -+ spawnChunk = pos; -+ spawnForced = forced; ++ field_71077_c = pos; ++ field_82248_d = forced; + } + else + { -+ spawnChunk = null; -+ spawnForced = false; ++ field_71077_c = null; ++ field_82248_d = false; + } + return; + } @@ -581,7 +581,7 @@ + { + if(this.displayname == null) + { -+ this.displayname = net.minecraftforge.event.ForgeEventFactory.getPlayerDisplayName(this, this.getName()); ++ this.displayname = net.minecraftforge.event.ForgeEventFactory.getPlayerDisplayName(this, this.func_70005_c_()); + } + return this.displayname; + } @@ -591,7 +591,7 @@ + */ + public void refreshDisplayName() + { -+ this.displayname = net.minecraftforge.event.ForgeEventFactory.getPlayerDisplayName(this, this.getName()); ++ this.displayname = net.minecraftforge.event.ForgeEventFactory.getPlayerDisplayName(this, this.func_70005_c_()); + } + + private final java.util.Collection prefixes = new java.util.LinkedList(); diff --git a/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch b/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch index 13520054c..91bf0b3df 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch @@ -1,38 +1,38 @@ --- ../src-base/minecraft/net/minecraft/entity/player/EntityPlayerMP.java +++ ../src-work/minecraft/net/minecraft/entity/player/EntityPlayerMP.java @@ -123,14 +123,15 @@ - public int ping; - public boolean playerConqueredTheEnd; + public int field_71138_i; + public boolean field_71136_j; + @SuppressWarnings("unused") - public EntityPlayerMP(MinecraftServer server, WorldServer worldIn, GameProfile profile, ItemInWorldManager interactionManager) + public EntityPlayerMP(MinecraftServer p_i45285_1_, WorldServer p_i45285_2_, GameProfile p_i45285_3_, ItemInWorldManager p_i45285_4_) { - super(worldIn, profile); - interactionManager.thisPlayerMP = this; - this.theItemInWorldManager = interactionManager; -- BlockPos blockpos = worldIn.getSpawnPoint(); -+ BlockPos blockpos = worldIn.provider.getRandomizedSpawnPoint(); + super(p_i45285_2_, p_i45285_3_); + p_i45285_4_.field_73090_b = this; + this.field_71134_c = p_i45285_4_; +- BlockPos blockpos = p_i45285_2_.func_175694_M(); ++ BlockPos blockpos = p_i45285_2_.field_73011_w.getRandomizedSpawnPoint(); -- if (!worldIn.provider.getHasNoSky() && worldIn.getWorldInfo().getGameType() != WorldSettings.GameType.ADVENTURE) -+ if (false && !worldIn.provider.getHasNoSky() && worldIn.getWorldInfo().getGameType() != WorldSettings.GameType.ADVENTURE) +- if (!p_i45285_2_.field_73011_w.func_177495_o() && p_i45285_2_.func_72912_H().func_76077_q() != WorldSettings.GameType.ADVENTURE) ++ if (false && !p_i45285_2_.field_73011_w.func_177495_o() && p_i45285_2_.func_72912_H().func_76077_q() != WorldSettings.GameType.ADVENTURE) { - int i = Math.max(5, server.getSpawnProtectionSize() - 6); - int j = MathHelper.floor_double(worldIn.getWorldBorder().getClosestDistance((double)blockpos.getX(), (double)blockpos.getZ())); + int i = Math.max(5, p_i45285_1_.func_82357_ak() - 6); + int j = MathHelper.func_76128_c(p_i45285_2_.func_175723_af().func_177729_b((double)blockpos.func_177958_n(), (double)blockpos.func_177952_p())); @@ -223,7 +224,7 @@ - this.openContainer.detectAndSendChanges(); + this.field_71070_bA.func_75142_b(); -- if (!this.worldObj.isRemote && !this.openContainer.canInteractWith(this)) -+ if (!this.worldObj.isRemote && !net.minecraftforge.common.ForgeHooks.canInteractWith(this, this.openContainer)) +- if (!this.field_70170_p.field_72995_K && !this.field_71070_bA.func_75145_c(this)) ++ if (!this.field_70170_p.field_72995_K && !net.minecraftforge.common.ForgeHooks.canInteractWith(this, this.field_71070_bA)) { - this.closeScreen(); - this.openContainer = this.inventoryContainer; + this.func_71053_j(); + this.field_71070_bA = this.field_71069_bz; @@ -264,7 +265,8 @@ - if (chunk.isPopulated()) + if (chunk.func_150802_k()) { list.add(chunk); -- list1.addAll(((WorldServer)this.worldObj).func_147486_a(chunkcoordintpair.chunkXPos * 16, 0, chunkcoordintpair.chunkZPos * 16, chunkcoordintpair.chunkXPos * 16 + 16, 256, chunkcoordintpair.chunkZPos * 16 + 16)); -+ list1.addAll(((WorldServer)this.worldObj).func_147486_a(chunkcoordintpair.chunkXPos * 16, 0, chunkcoordintpair.chunkZPos * 16, chunkcoordintpair.chunkXPos * 16 + 16, 256, chunkcoordintpair.chunkZPos * 16 + 15)); +- list1.addAll(((WorldServer)this.field_70170_p).func_147486_a(chunkcoordintpair.field_77276_a * 16, 0, chunkcoordintpair.field_77275_b * 16, chunkcoordintpair.field_77276_a * 16 + 16, 256, chunkcoordintpair.field_77275_b * 16 + 16)); ++ list1.addAll(((WorldServer)this.field_70170_p).func_147486_a(chunkcoordintpair.field_77276_a * 16, 0, chunkcoordintpair.field_77275_b * 16, chunkcoordintpair.field_77276_a * 16 + 16, 256, chunkcoordintpair.field_77275_b * 16 + 15)); + //BugFix: 16 makes it load an extra chunk, which isn't associated with a player, which makes it not unload unless a player walks near it. iterator1.remove(); } @@ -40,53 +40,53 @@ @@ -294,6 +296,7 @@ for (Chunk chunk1 : list) { - this.getServerForPlayer().getEntityTracker().func_85172_a(this, chunk1); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.Watch(chunk1.getChunkCoordIntPair(), this)); + this.func_71121_q().func_73039_n().func_85172_a(this, chunk1); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.Watch(chunk1.func_76632_l(), this)); } } } @@ -424,6 +427,7 @@ - public void onDeath(DamageSource cause) + public void func_70645_a(DamageSource p_70645_1_) { -+ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, cause)) return; - if (this.worldObj.getGameRules().getGameRuleBooleanValue("showDeathMessages")) ++ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, p_70645_1_)) return; + if (this.field_70170_p.func_82736_K().func_82766_b("showDeathMessages")) { - Team team = this.getTeam(); + Team team = this.func_96124_cp(); @@ -447,7 +451,20 @@ - if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) + if (!this.field_70170_p.func_82736_K().func_82766_b("keepInventory")) { + captureDrops = true; + capturedDrops.clear(); + - this.inventory.dropAllItems(); + this.field_71071_by.func_70436_m(); + + captureDrops = false; -+ net.minecraftforge.event.entity.player.PlayerDropsEvent event = new net.minecraftforge.event.entity.player.PlayerDropsEvent(this, cause, capturedDrops, recentlyHit > 0); ++ net.minecraftforge.event.entity.player.PlayerDropsEvent event = new net.minecraftforge.event.entity.player.PlayerDropsEvent(this, p_70645_1_, capturedDrops, field_70718_bc > 0); + if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) + { + for (net.minecraft.entity.item.EntityItem item : capturedDrops) + { -+ joinEntityItemWithWorld(item); ++ func_71012_a(item); + } + } } - for (ScoreObjective scoreobjective : this.worldObj.getScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.deathCount)) + for (ScoreObjective scoreobjective : this.field_70170_p.func_96441_U().func_96520_a(IScoreObjectiveCriteria.field_96642_c)) @@ -461,6 +478,7 @@ if (entitylivingbase != null) { - EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(EntityList.getEntityID(entitylivingbase))); -+ if (entitylist$entityegginfo == null) entitylist$entityegginfo = net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().get(EntityList.getEntityString(entitylivingbase)); + EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.field_75627_a.get(Integer.valueOf(EntityList.func_75619_a(entitylivingbase))); ++ if (entitylist$entityegginfo == null) entitylist$entityegginfo = net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().get(EntityList.func_75621_b(entitylivingbase)); if (entitylist$entityegginfo != null) { @@ -831,6 +849,7 @@ { - if (stat != null) + if (p_71064_1_ != null) { -+ if (stat.isAchievement() && net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.AchievementEvent(this, (net.minecraft.stats.Achievement) stat))) return; - this.statsFile.func_150871_b(this, stat, amount); ++ if (p_71064_1_.func_75967_d() && net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.AchievementEvent(this, (net.minecraft.stats.Achievement) p_71064_1_))) return; + this.field_147103_bO.func_150871_b(this, p_71064_1_, p_71064_2_); - for (ScoreObjective scoreobjective : this.getWorldScoreboard().getObjectivesFromCriteria(stat.func_150952_k())) + for (ScoreObjective scoreobjective : this.func_96123_co().func_96520_a(p_71064_1_.func_150952_k())) diff --git a/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch index 9cf5fa6e4..ed4ba1122 100644 --- a/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch @@ -1,17 +1,17 @@ --- ../src-base/minecraft/net/minecraft/entity/player/InventoryPlayer.java +++ ../src-work/minecraft/net/minecraft/entity/player/InventoryPlayer.java @@ -315,6 +315,14 @@ - this.mainInventory[i].updateAnimation(this.player.worldObj, this.player, i, this.currentItem == i); + this.field_70462_a[i].func_77945_a(this.field_70458_d.field_70170_p, this.field_70458_d, i, this.field_70461_c == i); } } + -+ for (int i = 0; i < armorInventory.length; i++) ++ for (int i = 0; i < field_70460_b.length; i++) + { -+ if (armorInventory[i] != null) ++ if (field_70460_b[i] != null) + { -+ armorInventory[i].getItem().onArmorTick(player.worldObj, player, armorInventory[i]); ++ field_70460_b[i].func_77973_b().onArmorTick(field_70458_d.field_70170_p, field_70458_d, field_70460_b[i]); + } + } } - public boolean consumeInventoryItem(Item p_146026_1_) + public boolean func_146026_a(Item p_146026_1_) diff --git a/patches/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch b/patches/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch index fa1e0f4b7..b859938da 100644 --- a/patches/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch +++ b/patches/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch @@ -5,18 +5,18 @@ } + @SuppressWarnings("unused") - private ItemStack getFishingResult() + private ItemStack func_146033_f() { - float f = this.worldObj.rand.nextFloat(); - int i = EnchantmentHelper.getLuckOfSeaModifier(this.angler); - int j = EnchantmentHelper.getLureModifier(this.angler); + float f = this.field_70170_p.field_73012_v.nextFloat(); + int i = EnchantmentHelper.func_151386_g(this.field_146042_b); + int j = EnchantmentHelper.func_151387_h(this.field_146042_b); + + if (true) + { -+ this.angler.addStat(net.minecraftforge.common.FishingHooks.getFishableCategory(f, i, j).stat, 1); -+ return net.minecraftforge.common.FishingHooks.getRandomFishable(this.rand, f, i, j); ++ this.field_146042_b.func_71064_a(net.minecraftforge.common.FishingHooks.getFishableCategory(f, i, j).stat, 1); ++ return net.minecraftforge.common.FishingHooks.getRandomFishable(this.field_70146_Z, f, i, j); + } + float f1 = 0.1F - (float)i * 0.025F - (float)j * 0.01F; float f2 = 0.05F + (float)i * 0.01F - (float)j * 0.01F; - f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); diff --git a/patches/minecraft/net/minecraft/init/Bootstrap.java.patch b/patches/minecraft/net/minecraft/init/Bootstrap.java.patch index c1ce77797..4b2ed93f3 100644 --- a/patches/minecraft/net/minecraft/init/Bootstrap.java.patch +++ b/patches/minecraft/net/minecraft/init/Bootstrap.java.patch @@ -1,19 +1,261 @@ --- ../src-base/minecraft/net/minecraft/init/Bootstrap.java +++ ../src-work/minecraft/net/minecraft/init/Bootstrap.java @@ -65,6 +65,7 @@ - return alreadyRegistered; + return field_151355_a; } + @SuppressWarnings("unused") - static void registerDispenserBehaviors() + static void func_151353_a() { - BlockDispenser.dispenseBehaviorRegistry.putObject(Items.arrow, new BehaviorProjectileDispense() -@@ -135,7 +136,7 @@ - double d0 = source.getX() + (double)enumfacing.getFrontOffsetX(); - double d1 = (double)((float)source.getBlockPos().getY() + 0.2F); - double d2 = source.getZ() + (double)enumfacing.getFrontOffsetZ(); -- Entity entity = ItemMonsterPlacer.spawnCreature(source.getWorld(), stack.getMetadata(), d0, d1, d2); -+ Entity entity = ItemMonsterPlacer.spawnCreature(source.getWorld(), ItemMonsterPlacer.getEntityName(stack), d0, d1, d2); - - if (entity instanceof EntityLivingBase && stack.hasDisplayName()) + BlockDispenser.field_149943_a.func_82595_a(Items.field_151032_g, new BehaviorProjectileDispense() +@@ -78,23 +79,23 @@ + }); + BlockDispenser.field_149943_a.func_82595_a(Items.field_151110_aK, new BehaviorProjectileDispense() + { +- protected IProjectile func_82499_a(World p_82499_1_, IPosition p_82499_2_) ++ protected IProjectile func_82499_a(World worldIn, IPosition position) + { +- return new EntityEgg(p_82499_1_, p_82499_2_.func_82615_a(), p_82499_2_.func_82617_b(), p_82499_2_.func_82616_c()); ++ return new EntityEgg(worldIn, position.func_82615_a(), position.func_82617_b(), position.func_82616_c()); + } + }); + BlockDispenser.field_149943_a.func_82595_a(Items.field_151126_ay, new BehaviorProjectileDispense() + { +- protected IProjectile func_82499_a(World p_82499_1_, IPosition p_82499_2_) ++ protected IProjectile func_82499_a(World worldIn, IPosition position) + { +- return new EntitySnowball(p_82499_1_, p_82499_2_.func_82615_a(), p_82499_2_.func_82617_b(), p_82499_2_.func_82616_c()); ++ return new EntitySnowball(worldIn, position.func_82615_a(), position.func_82617_b(), position.func_82616_c()); + } + }); + BlockDispenser.field_149943_a.func_82595_a(Items.field_151062_by, new BehaviorProjectileDispense() + { +- protected IProjectile func_82499_a(World p_82499_1_, IPosition p_82499_2_) ++ protected IProjectile func_82499_a(World worldIn, IPosition position) + { +- return new EntityExpBottle(p_82499_1_, p_82499_2_.func_82615_a(), p_82499_2_.func_82617_b(), p_82499_2_.func_82616_c()); ++ return new EntityExpBottle(worldIn, position.func_82615_a(), position.func_82617_b(), position.func_82616_c()); + } + protected float func_82498_a() + { +@@ -108,13 +109,13 @@ + BlockDispenser.field_149943_a.func_82595_a(Items.field_151068_bn, new IBehaviorDispenseItem() + { + private final BehaviorDefaultDispenseItem field_150843_b = new BehaviorDefaultDispenseItem(); +- public ItemStack func_82482_a(IBlockSource p_82482_1_, final ItemStack p_82482_2_) ++ public ItemStack func_82482_a(IBlockSource source, final ItemStack stack) + { +- return ItemPotion.func_77831_g(p_82482_2_.func_77960_j()) ? (new BehaviorProjectileDispense() ++ return ItemPotion.func_77831_g(stack.func_77960_j()) ? (new BehaviorProjectileDispense() { +- protected IProjectile func_82499_a(World p_82499_1_, IPosition p_82499_2_) ++ protected IProjectile func_82499_a(World worldIn, IPosition position) + { +- return new EntityPotion(p_82499_1_, p_82499_2_.func_82615_a(), p_82499_2_.func_82617_b(), p_82499_2_.func_82616_c(), p_82482_2_.func_77946_l()); ++ return new EntityPotion(worldIn, position.func_82615_a(), position.func_82617_b(), position.func_82616_c(), stack.func_77946_l()); + } + protected float func_82498_a() + { +@@ -124,7 +125,7 @@ + { + return super.func_82500_b() * 1.25F; + } +- }).func_82482_a(p_82482_1_, p_82482_2_): this.field_150843_b.func_82482_a(p_82482_1_, p_82482_2_); ++ }).func_82482_a(source, stack): this.field_150843_b.func_82482_a(source, stack); + } + }); + BlockDispenser.field_149943_a.func_82595_a(Items.field_151063_bx, new BehaviorDefaultDispenseItem() +@@ -135,7 +136,7 @@ + double d0 = p_82487_1_.func_82615_a() + (double)enumfacing.func_82601_c(); + double d1 = (double)((float)p_82487_1_.func_180699_d().func_177956_o() + 0.2F); + double d2 = p_82487_1_.func_82616_c() + (double)enumfacing.func_82599_e(); +- Entity entity = ItemMonsterPlacer.func_77840_a(p_82487_1_.func_82618_k(), p_82487_2_.func_77960_j(), d0, d1, d2); ++ Entity entity = ItemMonsterPlacer.spawnCreature(p_82487_1_.func_82618_k(), ItemMonsterPlacer.getEntityName(p_82487_2_), d0, d1, d2); + + if (entity instanceof EntityLivingBase && p_82487_2_.func_82837_s()) + { +@@ -190,14 +191,14 @@ + BlockDispenser.field_149943_a.func_82595_a(Items.field_151124_az, new BehaviorDefaultDispenseItem() + { + private final BehaviorDefaultDispenseItem field_150842_b = new BehaviorDefaultDispenseItem(); +- public ItemStack func_82487_b(IBlockSource p_82487_1_, ItemStack p_82487_2_) ++ public ItemStack func_82487_b(IBlockSource source, ItemStack stack) + { +- EnumFacing enumfacing = BlockDispenser.func_149937_b(p_82487_1_.func_82620_h()); +- World world = p_82487_1_.func_82618_k(); +- double d0 = p_82487_1_.func_82615_a() + (double)((float)enumfacing.func_82601_c() * 1.125F); +- double d1 = p_82487_1_.func_82617_b() + (double)((float)enumfacing.func_96559_d() * 1.125F); +- double d2 = p_82487_1_.func_82616_c() + (double)((float)enumfacing.func_82599_e() * 1.125F); +- BlockPos blockpos = p_82487_1_.func_180699_d().func_177972_a(enumfacing); ++ EnumFacing enumfacing = BlockDispenser.func_149937_b(source.func_82620_h()); ++ World world = source.func_82618_k(); ++ double d0 = source.func_82615_a() + (double)((float)enumfacing.func_82601_c() * 1.125F); ++ double d1 = source.func_82617_b() + (double)((float)enumfacing.func_96559_d() * 1.125F); ++ double d2 = source.func_82616_c() + (double)((float)enumfacing.func_82599_e() * 1.125F); ++ BlockPos blockpos = source.func_180699_d().func_177972_a(enumfacing); + Material material = world.func_180495_p(blockpos).func_177230_c().func_149688_o(); + double d3; + +@@ -209,7 +210,7 @@ + { + if (!Material.field_151579_a.equals(material) || !Material.field_151586_h.equals(world.func_180495_p(blockpos.func_177977_b()).func_177230_c().func_149688_o())) + { +- return this.field_150842_b.func_82482_a(p_82487_1_, p_82487_2_); ++ return this.field_150842_b.func_82482_a(source, stack); + } + + d3 = 0.0D; +@@ -217,31 +218,31 @@ + + EntityBoat entityboat = new EntityBoat(world, d0, d1 + d3, d2); + world.func_72838_d(entityboat); +- p_82487_2_.func_77979_a(1); +- return p_82487_2_; ++ stack.func_77979_a(1); ++ return stack; + } +- protected void func_82485_a(IBlockSource p_82485_1_) ++ protected void func_82485_a(IBlockSource source) + { +- p_82485_1_.func_82618_k().func_175718_b(1000, p_82485_1_.func_180699_d(), 0); ++ source.func_82618_k().func_175718_b(1000, source.func_180699_d(), 0); + } + }); + IBehaviorDispenseItem ibehaviordispenseitem = new BehaviorDefaultDispenseItem() + { + private final BehaviorDefaultDispenseItem field_150841_b = new BehaviorDefaultDispenseItem(); +- public ItemStack func_82487_b(IBlockSource p_82487_1_, ItemStack p_82487_2_) ++ public ItemStack func_82487_b(IBlockSource source, ItemStack stack) + { +- ItemBucket itembucket = (ItemBucket)p_82487_2_.func_77973_b(); +- BlockPos blockpos = p_82487_1_.func_180699_d().func_177972_a(BlockDispenser.func_149937_b(p_82487_1_.func_82620_h())); ++ ItemBucket itembucket = (ItemBucket)stack.func_77973_b(); ++ BlockPos blockpos = source.func_180699_d().func_177972_a(BlockDispenser.func_149937_b(source.func_82620_h())); + +- if (itembucket.func_180616_a(p_82487_1_.func_82618_k(), blockpos)) ++ if (itembucket.func_180616_a(source.func_82618_k(), blockpos)) + { +- p_82487_2_.func_150996_a(Items.field_151133_ar); +- p_82487_2_.field_77994_a = 1; +- return p_82487_2_; ++ stack.func_150996_a(Items.field_151133_ar); ++ stack.field_77994_a = 1; ++ return stack; + } + else + { +- return this.field_150841_b.func_82482_a(p_82487_1_, p_82487_2_); ++ return this.field_150841_b.func_82482_a(source, stack); + } + } + }; +@@ -250,10 +251,10 @@ + BlockDispenser.field_149943_a.func_82595_a(Items.field_151133_ar, new BehaviorDefaultDispenseItem() + { + private final BehaviorDefaultDispenseItem field_150840_b = new BehaviorDefaultDispenseItem(); +- public ItemStack func_82487_b(IBlockSource p_82487_1_, ItemStack p_82487_2_) ++ public ItemStack func_82487_b(IBlockSource source, ItemStack stack) + { +- World world = p_82487_1_.func_82618_k(); +- BlockPos blockpos = p_82487_1_.func_180699_d().func_177972_a(BlockDispenser.func_149937_b(p_82487_1_.func_82620_h())); ++ World world = source.func_82618_k(); ++ BlockPos blockpos = source.func_180699_d().func_177972_a(BlockDispenser.func_149937_b(source.func_82620_h())); + IBlockState iblockstate = world.func_180495_p(blockpos); + Block block = iblockstate.func_177230_c(); + Material material = block.func_149688_o(); +@@ -267,7 +268,7 @@ + { + if (!Material.field_151587_i.equals(material) || !(block instanceof BlockLiquid) || ((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue() != 0) + { +- return super.func_82487_b(p_82487_1_, p_82487_2_); ++ return super.func_82487_b(source, stack); + } + + item = Items.field_151129_at; +@@ -275,34 +276,34 @@ + + world.func_175698_g(blockpos); + +- if (--p_82487_2_.field_77994_a == 0) ++ if (--stack.field_77994_a == 0) + { +- p_82487_2_.func_150996_a(item); +- p_82487_2_.field_77994_a = 1; ++ stack.func_150996_a(item); ++ stack.field_77994_a = 1; + } +- else if (((TileEntityDispenser)p_82487_1_.func_150835_j()).func_146019_a(new ItemStack(item)) < 0) ++ else if (((TileEntityDispenser)source.func_150835_j()).func_146019_a(new ItemStack(item)) < 0) + { +- this.field_150840_b.func_82482_a(p_82487_1_, new ItemStack(item)); ++ this.field_150840_b.func_82482_a(source, new ItemStack(item)); + } + +- return p_82487_2_; ++ return stack; + } + }); + BlockDispenser.field_149943_a.func_82595_a(Items.field_151033_d, new BehaviorDefaultDispenseItem() + { + private boolean field_150839_b = true; +- protected ItemStack func_82487_b(IBlockSource p_82487_1_, ItemStack p_82487_2_) ++ protected ItemStack func_82487_b(IBlockSource source, ItemStack stack) + { +- World world = p_82487_1_.func_82618_k(); +- BlockPos blockpos = p_82487_1_.func_180699_d().func_177972_a(BlockDispenser.func_149937_b(p_82487_1_.func_82620_h())); ++ World world = source.func_82618_k(); ++ BlockPos blockpos = source.func_180699_d().func_177972_a(BlockDispenser.func_149937_b(source.func_82620_h())); + + if (world.func_175623_d(blockpos)) + { + world.func_175656_a(blockpos, Blocks.field_150480_ab.func_176223_P()); + +- if (p_82487_2_.func_96631_a(1, world.field_73012_v)) ++ if (stack.func_96631_a(1, world.field_73012_v)) + { +- p_82487_2_.field_77994_a = 0; ++ stack.field_77994_a = 0; + } + } + else if (world.func_180495_p(blockpos).func_177230_c() == Blocks.field_150335_W) +@@ -315,17 +316,17 @@ + this.field_150839_b = false; + } + +- return p_82487_2_; ++ return stack; + } +- protected void func_82485_a(IBlockSource p_82485_1_) ++ protected void func_82485_a(IBlockSource source) + { + if (this.field_150839_b) + { +- p_82485_1_.func_82618_k().func_175718_b(1000, p_82485_1_.func_180699_d(), 0); ++ source.func_82618_k().func_175718_b(1000, source.func_180699_d(), 0); + } + else + { +- p_82485_1_.func_82618_k().func_175718_b(1001, p_82485_1_.func_180699_d(), 0); ++ source.func_82618_k().func_175718_b(1001, source.func_180699_d(), 0); + } + } + }); +@@ -358,15 +359,15 @@ + return super.func_82487_b(p_82487_1_, p_82487_2_); + } + } +- protected void func_82485_a(IBlockSource p_82485_1_) ++ protected void func_82485_a(IBlockSource source) + { + if (this.field_150838_b) + { +- p_82485_1_.func_82618_k().func_175718_b(1000, p_82485_1_.func_180699_d(), 0); ++ source.func_82618_k().func_175718_b(1000, source.func_180699_d(), 0); + } + else + { +- p_82485_1_.func_82618_k().func_175718_b(1001, p_82485_1_.func_180699_d(), 0); ++ source.func_82618_k().func_175718_b(1001, source.func_180699_d(), 0); + } + } + }); diff --git a/patches/minecraft/net/minecraft/inventory/Container.java.patch b/patches/minecraft/net/minecraft/inventory/Container.java.patch index 84a24da4d..0fdc592c4 100644 --- a/patches/minecraft/net/minecraft/inventory/Container.java.patch +++ b/patches/minecraft/net/minecraft/inventory/Container.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/inventory/Container.java +++ ../src-work/minecraft/net/minecraft/inventory/Container.java @@ -608,7 +608,7 @@ - Slot slot1 = (Slot)this.inventorySlots.get(i); - ItemStack itemstack1 = slot1.getStack(); + Slot slot1 = (Slot)this.field_75151_b.get(i); + ItemStack itemstack1 = slot1.func_75211_c(); - if (itemstack1 == null) -+ if (itemstack1 == null && slot1.isItemValid(stack)) // Forge: Make sure to respect isItemValid in the slot. ++ if (itemstack1 == null && slot1.func_75214_a(p_75135_1_)) // Forge: Make sure to respect isItemValid in the slot. { - slot1.putStack(stack.copy()); - slot1.onSlotChanged(); + slot1.func_75215_d(p_75135_1_.func_77946_l()); + slot1.func_75218_e(); diff --git a/patches/minecraft/net/minecraft/inventory/ContainerBeacon.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerBeacon.java.patch index d8b6bd0eb..ae5dae8dd 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerBeacon.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerBeacon.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/inventory/ContainerBeacon.java @@ -143,7 +143,7 @@ - public boolean isItemValid(ItemStack stack) + public boolean func_75214_a(ItemStack p_75214_1_) { -- return stack == null ? false : stack.getItem() == Items.emerald || stack.getItem() == Items.diamond || stack.getItem() == Items.gold_ingot || stack.getItem() == Items.iron_ingot; -+ return stack == null ? false : stack.getItem().isBeaconPayment(stack); +- return p_75214_1_ == null ? false : p_75214_1_.func_77973_b() == Items.field_151166_bC || p_75214_1_.func_77973_b() == Items.field_151045_i || p_75214_1_.func_77973_b() == Items.field_151043_k || p_75214_1_.func_77973_b() == Items.field_151042_j; ++ return p_75214_1_ == null ? false : p_75214_1_.func_77973_b().isBeaconPayment(p_75214_1_); } - public int getSlotStackLimit() + public int func_75219_a() diff --git a/patches/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch index a6984df04..4e3f446a3 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch @@ -2,27 +2,27 @@ +++ ../src-work/minecraft/net/minecraft/inventory/ContainerBrewingStand.java @@ -154,7 +154,7 @@ - public boolean isItemValid(ItemStack stack) + public boolean func_75214_a(ItemStack p_75214_1_) { -- return stack != null ? stack.getItem().isPotionIngredient(stack) : false; -+ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidIngredient(stack); +- return p_75214_1_ != null ? p_75214_1_.func_77973_b().func_150892_m(p_75214_1_) : false; ++ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidIngredient(p_75214_1_); } - public int getSlotStackLimit() + public int func_75219_a() @@ -185,7 +185,7 @@ - public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack) + public void func_82870_a(EntityPlayer p_82870_1_, ItemStack p_82870_2_) { -- if (stack.getItem() == Items.potionitem && stack.getMetadata() > 0) -+ if (stack.getItem() instanceof net.minecraft.item.ItemPotion && stack.getMetadata() > 0) +- if (p_82870_2_.func_77973_b() == Items.field_151068_bn && p_82870_2_.func_77960_j() > 0) ++ if (p_82870_2_.func_77973_b() instanceof net.minecraft.item.ItemPotion && p_82870_2_.func_77960_j() > 0) { - this.player.triggerAchievement(AchievementList.potion); + this.field_75244_a.func_71029_a(AchievementList.field_76001_A); } @@ -195,7 +195,7 @@ - public static boolean canHoldPotion(ItemStack p_75243_0_) + public static boolean func_75243_a_(ItemStack p_75243_0_) { -- return p_75243_0_ != null && (p_75243_0_.getItem() == Items.potionitem || p_75243_0_.getItem() == Items.glass_bottle); +- return p_75243_0_ != null && (p_75243_0_.func_77973_b() == Items.field_151068_bn || p_75243_0_.func_77973_b() == Items.field_151069_bo); + return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidInput(p_75243_0_); } } diff --git a/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch index 292d16a78..79534c19d 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch @@ -2,20 +2,20 @@ +++ ../src-work/minecraft/net/minecraft/inventory/ContainerEnchantment.java @@ -65,9 +65,12 @@ }); - this.addSlotToContainer(new Slot(this.tableInventory, 1, 35, 47) + this.func_75146_a(new Slot(this.field_75168_e, 1, 35, 47) { + java.util.List ores = net.minecraftforge.oredict.OreDictionary.getOres("gemLapis"); - public boolean isItemValid(ItemStack stack) + public boolean func_75214_a(ItemStack p_75214_1_) { -- return stack.getItem() == Items.dye && EnumDyeColor.byDyeDamage(stack.getMetadata()) == EnumDyeColor.BLUE; +- return p_75214_1_.func_77973_b() == Items.field_151100_aR && EnumDyeColor.func_176766_a(p_75214_1_.func_77960_j()) == EnumDyeColor.BLUE; + for (ItemStack ore : ores) -+ if (net.minecraftforge.oredict.OreDictionary.itemMatches(ore, stack, false)) return true; ++ if (net.minecraftforge.oredict.OreDictionary.itemMatches(ore, p_75214_1_, false)) return true; + return false; } }); @@ -146,6 +149,7 @@ - if (!this.worldPointer.isRemote) + if (!this.field_75172_h.field_72995_K) { int l = 0; + float power = 0; @@ -24,45 +24,45 @@ { @@ -153,37 +157,14 @@ { - if ((j != 0 || k != 0) && this.worldPointer.isAirBlock(this.position.add(k, 0, j)) && this.worldPointer.isAirBlock(this.position.add(k, 1, j))) + if ((j != 0 || k != 0) && this.field_75172_h.func_175623_d(this.field_178150_j.func_177982_a(k, 0, j)) && this.field_75172_h.func_175623_d(this.field_178150_j.func_177982_a(k, 1, j))) { -- if (this.worldPointer.getBlockState(this.position.add(k * 2, 0, j * 2)).getBlock() == Blocks.bookshelf) +- if (this.field_75172_h.func_180495_p(this.field_178150_j.func_177982_a(k * 2, 0, j * 2)).func_177230_c() == Blocks.field_150342_X) - { - ++l; - } - -- if (this.worldPointer.getBlockState(this.position.add(k * 2, 1, j * 2)).getBlock() == Blocks.bookshelf) +- if (this.field_75172_h.func_180495_p(this.field_178150_j.func_177982_a(k * 2, 1, j * 2)).func_177230_c() == Blocks.field_150342_X) - { - ++l; - } - -+ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(worldPointer, position.add(k * 2, 0, j * 2)); -+ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(worldPointer, position.add(k * 2, 1, j * 2)); ++ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(field_75172_h, field_178150_j.func_177982_a(k * 2, 0, j * 2)); ++ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(field_75172_h, field_178150_j.func_177982_a(k * 2, 1, j * 2)); if (k != 0 && j != 0) { -- if (this.worldPointer.getBlockState(this.position.add(k * 2, 0, j)).getBlock() == Blocks.bookshelf) +- if (this.field_75172_h.func_180495_p(this.field_178150_j.func_177982_a(k * 2, 0, j)).func_177230_c() == Blocks.field_150342_X) - { - ++l; - } - -- if (this.worldPointer.getBlockState(this.position.add(k * 2, 1, j)).getBlock() == Blocks.bookshelf) +- if (this.field_75172_h.func_180495_p(this.field_178150_j.func_177982_a(k * 2, 1, j)).func_177230_c() == Blocks.field_150342_X) - { - ++l; - } - -- if (this.worldPointer.getBlockState(this.position.add(k, 0, j * 2)).getBlock() == Blocks.bookshelf) +- if (this.field_75172_h.func_180495_p(this.field_178150_j.func_177982_a(k, 0, j * 2)).func_177230_c() == Blocks.field_150342_X) - { - ++l; - } - -- if (this.worldPointer.getBlockState(this.position.add(k, 1, j * 2)).getBlock() == Blocks.bookshelf) +- if (this.field_75172_h.func_180495_p(this.field_178150_j.func_177982_a(k, 1, j * 2)).func_177230_c() == Blocks.field_150342_X) - { - ++l; - } -+ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(worldPointer, position.add(k * 2, 0, j)); -+ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(worldPointer, position.add(k * 2, 1, j)); -+ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(worldPointer, position.add(k, 0, j * 2)); -+ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(worldPointer, position.add(k, 1, j * 2)); ++ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(field_75172_h, field_178150_j.func_177982_a(k * 2, 0, j)); ++ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(field_75172_h, field_178150_j.func_177982_a(k * 2, 1, j)); ++ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(field_75172_h, field_178150_j.func_177982_a(k, 0, j * 2)); ++ power += net.minecraftforge.common.ForgeHooks.getEnchantPower(field_75172_h, field_178150_j.func_177982_a(k, 1, j * 2)); } } } @@ -70,8 +70,8 @@ for (int i1 = 0; i1 < 3; ++i1) { -- this.enchantLevels[i1] = EnchantmentHelper.calcItemStackEnchantability(this.rand, i1, l, itemstack); -+ this.enchantLevels[i1] = EnchantmentHelper.calcItemStackEnchantability(this.rand, i1, (int)power, itemstack); +- this.field_75167_g[i1] = EnchantmentHelper.func_77514_a(this.field_75169_l, i1, l, itemstack); ++ this.field_75167_g[i1] = EnchantmentHelper.func_77514_a(this.field_75169_l, i1, (int)power, itemstack); this.field_178151_h[i1] = -1; - if (this.enchantLevels[i1] < i1 + 1) + if (this.field_75167_g[i1] < i1 + 1) diff --git a/patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch index 2b87f8433..b34ce8231 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch @@ -2,11 +2,11 @@ +++ ../src-work/minecraft/net/minecraft/inventory/ContainerPlayer.java @@ -43,7 +43,8 @@ } - public boolean isItemValid(ItemStack stack) + public boolean func_75214_a(ItemStack p_75214_1_) { -- return stack == null ? false : (stack.getItem() instanceof ItemArmor ? ((ItemArmor)stack.getItem()).armorType == k_f : (stack.getItem() != Item.getItemFromBlock(Blocks.pumpkin) && stack.getItem() != Items.skull ? false : k_f == 0)); -+ if (stack == null) return false; -+ return stack.getItem().isValidArmor(stack, k_f, thePlayer); +- return p_75214_1_ == null ? false : (p_75214_1_.func_77973_b() instanceof ItemArmor ? ((ItemArmor)p_75214_1_.func_77973_b()).field_77881_a == k_f : (p_75214_1_.func_77973_b() != Item.func_150898_a(Blocks.field_150423_aK) && p_75214_1_.func_77973_b() != Items.field_151144_bL ? false : k_f == 0)); ++ if (p_75214_1_ == null) return false; ++ return p_75214_1_.func_77973_b().isValidArmor(p_75214_1_, k_f, field_82862_h); } @SideOnly(Side.CLIENT) - public String getSlotTexture() + public String func_178171_c() diff --git a/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch b/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch index 8ca672062..aad74b86d 100644 --- a/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch +++ b/patches/minecraft/net/minecraft/inventory/ContainerRepair.java.patch @@ -1,38 +1,38 @@ --- ../src-base/minecraft/net/minecraft/inventory/ContainerRepair.java +++ ../src-work/minecraft/net/minecraft/inventory/ContainerRepair.java @@ -70,6 +70,8 @@ - playerIn.addExperienceLevel(-ContainerRepair.this.maximumCost); + p_82870_1_.func_82242_a(-ContainerRepair.this.field_82854_e); } -+ float breakChance = net.minecraftforge.common.ForgeHooks.onAnvilRepair(playerIn, stack, ContainerRepair.this.inputSlots.getStackInSlot(0), ContainerRepair.this.inputSlots.getStackInSlot(1)); ++ float breakChance = net.minecraftforge.common.ForgeHooks.onAnvilRepair(p_82870_1_, p_82870_2_, ContainerRepair.this.field_82853_g.func_70301_a(0), ContainerRepair.this.field_82853_g.func_70301_a(1)); + - ContainerRepair.this.inputSlots.setInventorySlotContents(0, (ItemStack)null); + ContainerRepair.this.field_82853_g.func_70299_a(0, (ItemStack)null); - if (ContainerRepair.this.materialCost > 0) + if (ContainerRepair.this.field_82856_l > 0) @@ -94,7 +96,7 @@ - ContainerRepair.this.maximumCost = 0; - IBlockState iblockstate = worldIn.getBlockState(blockPosIn); + ContainerRepair.this.field_82854_e = 0; + IBlockState iblockstate = p_i45807_2_.func_180495_p(p_i45807_3_); -- if (!playerIn.capabilities.isCreativeMode && !worldIn.isRemote && iblockstate.getBlock() == Blocks.anvil && playerIn.getRNG().nextFloat() < 0.12F) -+ if (!playerIn.capabilities.isCreativeMode && !worldIn.isRemote && iblockstate.getBlock() == Blocks.anvil && playerIn.getRNG().nextFloat() < breakChance) +- if (!p_82870_1_.field_71075_bZ.field_75098_d && !p_i45807_2_.field_72995_K && iblockstate.func_177230_c() == Blocks.field_150467_bQ && p_82870_1_.func_70681_au().nextFloat() < 0.12F) ++ if (!p_82870_1_.field_71075_bZ.field_75098_d && !p_i45807_2_.field_72995_K && iblockstate.func_177230_c() == Blocks.field_150467_bQ && p_82870_1_.func_70681_au().nextFloat() < breakChance) { - int l = ((Integer)iblockstate.getValue(BlockAnvil.DAMAGE)).intValue(); + int l = ((Integer)iblockstate.func_177229_b(BlockAnvil.field_176505_b)).intValue(); ++l; @@ -172,6 +174,7 @@ if (itemstack2 != null) { -+ if (!net.minecraftforge.common.ForgeHooks.onAnvilChange(this, itemstack, itemstack2, outputSlot, repairedItemName, i2)) return; - flag = itemstack2.getItem() == Items.enchanted_book && Items.enchanted_book.getEnchantments(itemstack2).tagCount() > 0; ++ if (!net.minecraftforge.common.ForgeHooks.onAnvilChange(this, itemstack, itemstack2, field_82852_f, field_82857_m, i2)) return; + flag = itemstack2.func_77973_b() == Items.field_151134_bR && Items.field_151134_bR.func_92110_g(itemstack2).func_74745_c() > 0; - if (itemstack1.isItemStackDamageable() && itemstack1.getItem().getIsRepairable(itemstack, itemstack2)) + if (itemstack1.func_77984_f() && itemstack1.func_77973_b().func_82789_a(itemstack, itemstack2)) @@ -264,7 +267,8 @@ { int i4 = ((Integer)iterator.next()).intValue(); -- if (i4 != i5 && !enchantment.canApplyTogether(Enchantment.getEnchantmentById(i4))) -+ Enchantment e2 = Enchantment.getEnchantmentById(i4); -+ if (i4 != i5 && !(enchantment.canApplyTogether(e2) && e2.canApplyTogether(enchantment))) //Forge BugFix: Let Both enchantments veto being together +- if (i4 != i5 && !enchantment.func_77326_a(Enchantment.func_180306_c(i4))) ++ Enchantment e2 = Enchantment.func_180306_c(i4); ++ if (i4 != i5 && !(enchantment.func_77326_a(e2) && e2.func_77326_a(enchantment))) //Forge BugFix: Let Both enchantments veto being together { flag1 = false; ++l1; @@ -40,8 +40,8 @@ } } -+ if (flag && !itemstack1.getItem().isBookEnchantable(itemstack1, itemstack2)) itemstack1 = null; ++ if (flag && !itemstack1.func_77973_b().isBookEnchantable(itemstack1, itemstack2)) itemstack1 = null; + - if (StringUtils.isBlank(this.repairedItemName)) + if (StringUtils.isBlank(this.field_82857_m)) { - if (itemstack.hasDisplayName()) + if (itemstack.func_82837_s()) diff --git a/patches/minecraft/net/minecraft/inventory/Slot.java.patch b/patches/minecraft/net/minecraft/inventory/Slot.java.patch index c2d09be0f..3b5a76863 100644 --- a/patches/minecraft/net/minecraft/inventory/Slot.java.patch +++ b/patches/minecraft/net/minecraft/inventory/Slot.java.patch @@ -2,13 +2,13 @@ +++ ../src-work/minecraft/net/minecraft/inventory/Slot.java @@ -89,7 +89,7 @@ @SideOnly(Side.CLIENT) - public String getSlotTexture() + public String func_178171_c() { - return null; + return backgroundName; } - public ItemStack decrStackSize(int amount) + public ItemStack func_75209_a(int p_75209_1_) @@ -112,4 +112,64 @@ { return true; @@ -25,7 +25,7 @@ + @SideOnly(Side.CLIENT) + public net.minecraft.util.ResourceLocation getBackgroundLocation() + { -+ return (backgroundLocation == null ? net.minecraft.client.renderer.texture.TextureMap.locationBlocksTexture : backgroundLocation); ++ return (backgroundLocation == null ? net.minecraft.client.renderer.texture.TextureMap.field_110575_b : backgroundLocation); + } + + /** @@ -51,14 +51,14 @@ + @SideOnly(Side.CLIENT) + public net.minecraft.client.renderer.texture.TextureAtlasSprite getBackgroundSprite() + { -+ String name = getSlotTexture(); -+ return name == null ? null : getBackgroundMap().getAtlasSprite(name); ++ String name = func_178171_c(); ++ return name == null ? null : getBackgroundMap().func_110572_b(name); + } + + @SideOnly(Side.CLIENT) + protected net.minecraft.client.renderer.texture.TextureMap getBackgroundMap() + { -+ if (backgroundMap == null) backgroundMap = net.minecraft.client.Minecraft.getMinecraft().getTextureMapBlocks(); ++ if (backgroundMap == null) backgroundMap = net.minecraft.client.Minecraft.func_71410_x().func_147117_R(); + return (net.minecraft.client.renderer.texture.TextureMap)backgroundMap; + } + @@ -70,7 +70,7 @@ + */ + public int getSlotIndex() + { -+ return slotIndex; ++ return field_75225_a; + } + /*========================================= FORGE END =====================================*/ } diff --git a/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch b/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch index 59cf4f617..58adc5a1a 100644 --- a/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch +++ b/patches/minecraft/net/minecraft/inventory/SlotCrafting.java.patch @@ -2,12 +2,12 @@ +++ ../src-work/minecraft/net/minecraft/inventory/SlotCrafting.java @@ -112,8 +112,11 @@ - public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack) + public void func_82870_a(EntityPlayer p_82870_1_, ItemStack p_82870_2_) { -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, craftMatrix); - this.onCrafting(stack); -+ net.minecraftforge.common.ForgeHooks.setCraftingPlayer(playerIn); - ItemStack[] aitemstack = CraftingManager.getInstance().func_180303_b(this.craftMatrix, playerIn.worldObj); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerCraftingEvent(p_82870_1_, p_82870_2_, field_75239_a); + this.func_75208_c(p_82870_2_); ++ net.minecraftforge.common.ForgeHooks.setCraftingPlayer(p_82870_1_); + ItemStack[] aitemstack = CraftingManager.func_77594_a().func_180303_b(this.field_75239_a, p_82870_1_.field_70170_p); + net.minecraftforge.common.ForgeHooks.setCraftingPlayer(null); for (int i = 0; i < aitemstack.length; ++i) diff --git a/patches/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch b/patches/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch index 5de127a2d..33dcc7b7e 100644 --- a/patches/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch +++ b/patches/minecraft/net/minecraft/inventory/SlotFurnaceOutput.java.patch @@ -4,8 +4,8 @@ this.field_75228_b = 0; -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerSmeltedEvent(thePlayer, stack); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerSmeltedEvent(field_75229_a, p_75208_1_); + - if (stack.getItem() == Items.iron_ingot) + if (p_75208_1_.func_77973_b() == Items.field_151042_j) { - this.thePlayer.triggerAchievement(AchievementList.acquireIron); + this.field_75229_a.func_71029_a(AchievementList.field_76016_k); diff --git a/patches/minecraft/net/minecraft/item/Item.java.patch b/patches/minecraft/net/minecraft/item/Item.java.patch index b44a7ee96..095c78806 100644 --- a/patches/minecraft/net/minecraft/item/Item.java.patch +++ b/patches/minecraft/net/minecraft/item/Item.java.patch @@ -4,65 +4,65 @@ public class Item { -- public static final RegistryNamespaced itemRegistry = new RegistryNamespaced(); -- private static final Map BLOCK_TO_ITEM = Maps.newHashMap(); -+ public static final RegistryNamespaced itemRegistry = net.minecraftforge.fml.common.registry.GameData.getItemRegistry(); -+ private static final Map BLOCK_TO_ITEM = net.minecraftforge.fml.common.registry.GameData.getBlockItemMap(); - protected static final UUID itemModifierUUID = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); - private CreativeTabs tabToDisplayOn; - protected static Random itemRand = new Random(); +- public static final RegistryNamespaced field_150901_e = new RegistryNamespaced(); +- private static final Map field_179220_a = Maps.newHashMap(); ++ public static final RegistryNamespaced field_150901_e = net.minecraftforge.fml.common.registry.GameData.getItemRegistry(); ++ private static final Map field_179220_a = net.minecraftforge.fml.common.registry.GameData.getBlockItemMap(); + protected static final UUID field_111210_e = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); + private CreativeTabs field_77701_a; + protected static Random field_77697_d = new Random(); @@ -61,6 +61,9 @@ - private String potionEffect; - private String unlocalizedName; + private String field_77785_bY; + private String field_77774_bZ; + public final net.minecraftforge.fml.common.registry.RegistryDelegate delegate = -+ ((net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry)itemRegistry).getDelegate(this, Item.class); ++ ((net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry)field_150901_e).getDelegate(this, Item.class); + - public static int getIdFromItem(Item itemIn) + public static int func_150891_b(Item p_150891_0_) { - return itemIn == null ? 0 : itemRegistry.getIDForObject(itemIn); + return p_150891_0_ == null ? 0 : field_150901_e.func_148757_b(p_150891_0_); @@ -126,6 +129,7 @@ - return stack; + return p_77654_1_; } + @Deprecated // Use ItemStack sensitive version below. - public int getItemStackLimit() + public int func_77639_j() { - return this.maxStackSize; + return this.field_77777_bU; @@ -239,6 +243,7 @@ - return this.containerItem; + return this.field_77700_c; } + @Deprecated // Use ItemStack sensitive version below. - public boolean hasContainerItem() + public boolean func_77634_r() { - return this.containerItem != null; + return this.field_77700_c != null; @@ -316,7 +321,7 @@ - public boolean isItemTool(ItemStack stack) + public boolean func_77616_k(ItemStack p_77616_1_) { -- return this.getItemStackLimit() == 1 && this.isDamageable(); -+ return this.getItemStackLimit(stack) == 1 && this.isDamageable(); +- return this.func_77639_j() == 1 && this.func_77645_m(); ++ return this.getItemStackLimit(p_77616_1_) == 1 && this.func_77645_m(); } - protected MovingObjectPosition getMovingObjectPositionFromPlayer(World worldIn, EntityPlayer playerIn, boolean useLiquids) + protected MovingObjectPosition func_77621_a(World p_77621_1_, EntityPlayer p_77621_2_, boolean p_77621_3_) @@ -334,6 +339,10 @@ float f6 = f3 * f4; float f7 = f2 * f4; double d3 = 5.0D; -+ if (playerIn instanceof net.minecraft.entity.player.EntityPlayerMP) ++ if (p_77621_2_ instanceof net.minecraft.entity.player.EntityPlayerMP) + { -+ d3 = ((net.minecraft.entity.player.EntityPlayerMP)playerIn).theItemInWorldManager.getBlockReachDistance(); ++ d3 = ((net.minecraft.entity.player.EntityPlayerMP)p_77621_2_).field_71134_c.getBlockReachDistance(); + } - Vec3 vec31 = vec3.addVector((double)f6 * d3, (double)f5 * d3, (double)f7 * d3); - return worldIn.rayTraceBlocks(vec3, vec31, useLiquids, !useLiquids, false); + Vec3 vec31 = vec3.func_72441_c((double)f6 * d3, (double)f5 * d3, (double)f7 * d3); + return p_77621_1_.func_147447_a(vec3, vec31, p_77621_3_, !p_77621_3_, false); } @@ -371,11 +380,578 @@ return false; } + @Deprecated // Use ItemStack sensitive version below. - public Multimap getItemAttributeModifiers() + public Multimap func_111205_h() { return HashMultimap.create(); } @@ -73,7 +73,7 @@ + */ + public Multimap getAttributeModifiers(ItemStack stack) + { -+ return this.getItemAttributeModifiers(); ++ return this.func_111205_h(); + } + + /** @@ -112,7 +112,7 @@ + */ + public float getDigSpeed(ItemStack itemstack, net.minecraft.block.state.IBlockState state) + { -+ return getStrVsBlock(itemstack, state.getBlock()); ++ return func_150893_a(itemstack, state.func_177230_c()); + } + + @@ -123,7 +123,7 @@ + */ + public boolean isRepairable() + { -+ return canRepair && isDamageable(); ++ return canRepair && func_77645_m(); + } + + /** @@ -203,7 +203,7 @@ + { + return null; + } -+ return new ItemStack(getContainerItem()); ++ return new ItemStack(func_77668_q()); + } + + /** @@ -213,7 +213,7 @@ + */ + public boolean hasContainerItem(ItemStack stack) + { -+ return hasContainerItem(); ++ return func_77634_r(); + } + + /** @@ -278,7 +278,7 @@ + */ + public CreativeTabs[] getCreativeTabs() + { -+ return new CreativeTabs[]{ getCreativeTab() }; ++ return new CreativeTabs[]{ func_77640_w() }; + } + + /** @@ -321,9 +321,9 @@ + { + if (this instanceof ItemEnchantedBook) + { -+ return ((ItemEnchantedBook)this).getRandom(rnd, -+ original.theMinimumChanceToGenerateItem, -+ original.theMaximumChanceToGenerateItem, original.itemWeight); ++ return ((ItemEnchantedBook)this).func_92112_a(rnd, ++ original.field_76295_d, ++ original.field_76296_e, original.field_76292_a); + } + return original; + } @@ -359,12 +359,12 @@ + { + if (this instanceof ItemArmor) + { -+ return ((ItemArmor)this).armorType == armorType; ++ return ((ItemArmor)this).field_77881_a == armorType; + } + + if (armorType == 0) + { -+ return this == Item.getItemFromBlock(Blocks.pumpkin) || this == Items.skull; ++ return this == Item.func_150898_a(Blocks.field_150423_aK) || this == Items.field_151144_bL; + } + + return false; @@ -460,7 +460,7 @@ + */ + public int getDamage(ItemStack stack) + { -+ return stack.itemDamage; ++ return stack.field_77991_e; + } + + /** @@ -470,7 +470,7 @@ + */ + public int getMetadata(ItemStack stack) + { -+ return stack.itemDamage; ++ return stack.field_77991_e; + } + + /** @@ -483,7 +483,7 @@ + */ + public boolean showDurabilityBar(ItemStack stack) + { -+ return stack.isItemDamaged(); ++ return stack.func_77951_h(); + } + + /** @@ -494,7 +494,7 @@ + */ + public double getDurabilityForDisplay(ItemStack stack) + { -+ return (double)stack.getItemDamage() / (double)stack.getMaxDamage(); ++ return (double)stack.func_77952_i() / (double)stack.func_77958_k(); + } + + /** @@ -506,7 +506,7 @@ + */ + public int getMaxDamage(ItemStack stack) + { -+ return getMaxDamage(); ++ return func_77612_l(); + } + + /** @@ -516,7 +516,7 @@ + */ + public boolean isDamaged(ItemStack stack) + { -+ return stack.itemDamage > 0; ++ return stack.field_77991_e > 0; + } + + /** @@ -526,11 +526,11 @@ + */ + public void setDamage(ItemStack stack, int damage) + { -+ stack.itemDamage = damage; ++ stack.field_77991_e = damage; + -+ if (stack.itemDamage < 0) ++ if (stack.field_77991_e < 0) + { -+ stack.itemDamage = 0; ++ stack.field_77991_e = 0; + } + } + @@ -542,7 +542,7 @@ + */ + public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) + { -+ return canHarvestBlock(par1Block); ++ return func_150897_b(par1Block); + } + + /** @@ -554,7 +554,7 @@ + */ + public int getItemStackLimit(ItemStack stack) + { -+ return this.getItemStackLimit(); ++ return this.func_77639_j(); + } + + private java.util.Map toolClasses = new java.util.HashMap(); @@ -604,7 +604,7 @@ + */ + public int getItemEnchantability(ItemStack stack) + { -+ return getItemEnchantability(); ++ return func_77619_b(); + } + + /** @@ -614,7 +614,7 @@ + */ + public boolean isBeaconPayment(ItemStack stack) + { -+ return this == Items.emerald || this == Items.diamond || this == Items.gold_ingot || this == Items.iron_ingot; ++ return this == Items.field_151166_bC || this == Items.field_151045_i || this == Items.field_151043_k || this == Items.field_151042_j; + } + + @@ -629,39 +629,39 @@ + */ + public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) + { -+ return !ItemStack.areItemStacksEqual(oldStack, newStack); ++ return !ItemStack.func_77989_b(oldStack, newStack); + } + /* ======================================== FORGE END =====================================*/ + - public static void registerItems() + public static void func_150900_l() { - registerItemBlock(Blocks.stone, (new ItemMultiTexture(Blocks.stone, Blocks.stone, new Function() + func_179214_a(Blocks.field_150348_b, (new ItemMultiTexture(Blocks.field_150348_b, Blocks.field_150348_b, new Function() @@ -855,6 +1431,10 @@ - private final float damageVsEntity; - private final int enchantability; + private final float field_78011_i; + private final int field_78008_j; + //Added by forge for custom Tool materials. + @Deprecated public Item customCraftingMaterial = null; // Remote in 1.8.1 + private ItemStack repairMaterial = null; + - private ToolMaterial(int harvestLevel, int maxUses, float efficiency, float damageVsEntity, int enchantability) + private ToolMaterial(int p_i1874_3_, int p_i1874_4_, float p_i1874_5_, float p_i1874_6_, int p_i1874_7_) { - this.harvestLevel = harvestLevel; + this.field_78001_f = p_i1874_3_; @@ -889,9 +1469,36 @@ - return this.enchantability; + return this.field_78008_j; } + @Deprecated // Use getRepairItemStack below - public Item getRepairItem() + public Item func_150995_f() { -- 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)))); +- return this == WOOD ? Item.func_150898_a(Blocks.field_150344_f) : (this == STONE ? Item.func_150898_a(Blocks.field_150347_e) : (this == GOLD ? Items.field_151043_k : (this == IRON ? Items.field_151042_j : (this == EMERALD ? Items.field_151045_i : null)))); + switch (this) + { -+ 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; ++ case WOOD: return Item.func_150898_a(Blocks.field_150344_f); ++ case STONE: return Item.func_150898_a(Blocks.field_150347_e); ++ case GOLD: return Items.field_151043_k; ++ case IRON: return Items.field_151042_j; ++ case EMERALD: return Items.field_151045_i; + default: return customCraftingMaterial; + } } @@ -671,14 +671,14 @@ + if (this.repairMaterial != null || customCraftingMaterial != null) throw new RuntimeException("Can not change already set repair material"); + if (this == WOOD || this == STONE || this == GOLD || this == IRON || this == EMERALD) throw new RuntimeException("Can not change vanilla tool repair materials"); + this.repairMaterial = stack; -+ this.customCraftingMaterial = stack.getItem(); ++ this.customCraftingMaterial = stack.func_77973_b(); + return this; + } + + public ItemStack getRepairItemStack() + { + if (repairMaterial != null) return repairMaterial; -+ Item ret = this.getRepairItem(); ++ Item ret = this.func_150995_f(); + if (ret == null) return null; + repairMaterial = new ItemStack(ret, 1, net.minecraftforge.oredict.OreDictionary.WILDCARD_VALUE); + return repairMaterial; diff --git a/patches/minecraft/net/minecraft/item/ItemArmor.java.patch b/patches/minecraft/net/minecraft/item/ItemArmor.java.patch index de61a14ac..c81e15e77 100644 --- a/patches/minecraft/net/minecraft/item/ItemArmor.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemArmor.java.patch @@ -6,40 +6,40 @@ EntityLivingBase entitylivingbase = (EntityLivingBase)list.get(0); - int l = entitylivingbase instanceof EntityPlayer ? 1 : 0; + int l = 0;// Forge: We fix the indexes. Mojang Stop hard coding this! - int i1 = EntityLiving.getArmorPosition(stack); - ItemStack itemstack = stack.copy(); - itemstack.stackSize = 1; + int i1 = EntityLiving.func_82159_b(p_82487_2_); + ItemStack itemstack = p_82487_2_.func_77946_l(); + itemstack.field_77994_a = 1; @@ -190,7 +190,7 @@ if (itemstack == null) { -- playerIn.setCurrentItemOrArmor(i, itemStackIn.copy()); -+ playerIn.setCurrentItemOrArmor(i + 1, itemStackIn.copy()); //Forge: Vanilla bug fix associated with fixed setCurrentItemOrArmor indexs for players. - itemStackIn.stackSize = 0; +- p_77659_3_.func_70062_b(i, p_77659_1_.func_77946_l()); ++ p_77659_3_.func_70062_b(i + 1, p_77659_1_.func_77946_l()); //Forge: Vanilla bug fix associated with fixed setCurrentItemOrArmor indexs for players. + p_77659_1_.field_77994_a = 0; } @@ -210,6 +210,9 @@ - private final int[] damageReductionAmountArray; - private final int enchantability; + private final int[] field_78049_g; + private final int field_78055_h; + //Added by forge for custom Armor materials. + public Item customCraftingMaterial = null; + - private ArmorMaterial(String name, int p_i45789_4_, int[] reductionAmounts, int enchantability) + private ArmorMaterial(String p_i45789_3_, int p_i45789_4_, int[] p_i45789_5_, int p_i45789_6_) { - this.name = name; + this.field_179243_f = p_i45789_3_; @@ -235,7 +238,15 @@ - public Item getRepairItem() + public Item func_151685_b() { -- return this == LEATHER ? Items.leather : (this == CHAIN ? Items.iron_ingot : (this == GOLD ? Items.gold_ingot : (this == IRON ? Items.iron_ingot : (this == DIAMOND ? Items.diamond : null)))); +- return this == LEATHER ? Items.field_151116_aA : (this == CHAIN ? Items.field_151042_j : (this == GOLD ? Items.field_151043_k : (this == IRON ? Items.field_151042_j : (this == DIAMOND ? Items.field_151045_i : null)))); + switch (this) + { -+ case LEATHER: return Items.leather; -+ case CHAIN: return Items.iron_ingot; -+ case GOLD: return Items.gold_ingot; -+ case IRON: return Items.iron_ingot; -+ case DIAMOND: return Items.diamond; ++ case LEATHER: return Items.field_151116_aA; ++ case CHAIN: return Items.field_151042_j; ++ case GOLD: return Items.field_151043_k; ++ case IRON: return Items.field_151042_j; ++ case DIAMOND: return Items.field_151045_i; + default: return customCraftingMaterial; + } } diff --git a/patches/minecraft/net/minecraft/item/ItemBlock.java.patch b/patches/minecraft/net/minecraft/item/ItemBlock.java.patch index cf8cc6de1..88d2705ae 100644 --- a/patches/minecraft/net/minecraft/item/ItemBlock.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBlock.java.patch @@ -1,26 +1,26 @@ --- ../src-base/minecraft/net/minecraft/item/ItemBlock.java +++ ../src-work/minecraft/net/minecraft/item/ItemBlock.java @@ -54,16 +54,8 @@ - int i = this.getMetadata(stack.getMetadata()); - IBlockState iblockstate1 = this.block.onBlockPlaced(worldIn, pos, side, hitX, hitY, hitZ, i, playerIn); + int i = this.func_77647_b(p_180614_1_.func_77960_j()); + IBlockState iblockstate1 = this.field_150939_a.func_180642_a(p_180614_3_, p_180614_4_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, i, p_180614_2_); -- if (worldIn.setBlockState(pos, iblockstate1, 3)) -+ if (placeBlockAt(stack, playerIn, worldIn, pos, side, hitX, hitY, hitZ, iblockstate1)) +- if (p_180614_3_.func_180501_a(p_180614_4_, iblockstate1, 3)) ++ if (placeBlockAt(p_180614_1_, p_180614_2_, p_180614_3_, p_180614_4_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, iblockstate1)) { -- iblockstate1 = worldIn.getBlockState(pos); +- iblockstate1 = p_180614_3_.func_180495_p(p_180614_4_); - -- if (iblockstate1.getBlock() == this.block) +- if (iblockstate1.func_177230_c() == this.field_150939_a) - { -- setTileEntityNBT(worldIn, playerIn, pos, stack); -- this.block.onBlockPlacedBy(worldIn, pos, iblockstate1, playerIn, stack); +- func_179224_a(p_180614_3_, p_180614_2_, p_180614_4_, p_180614_1_); +- this.field_150939_a.func_180633_a(p_180614_3_, p_180614_4_, iblockstate1, p_180614_2_, p_180614_1_); - } - - worldIn.playSoundEffect((double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), this.block.stepSound.getPlaceSound(), (this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getFrequency() * 0.8F); - --stack.stackSize; + p_180614_3_.func_72908_a((double)((float)p_180614_4_.func_177958_n() + 0.5F), (double)((float)p_180614_4_.func_177956_o() + 0.5F), (double)((float)p_180614_4_.func_177952_p() + 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); + --p_180614_1_.field_77994_a; } @@ -162,4 +154,26 @@ { - return this.block; + return this.field_150939_a; } + + /** @@ -33,13 +33,13 @@ + */ + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState) + { -+ if (!world.setBlockState(pos, newState, 3)) return false; ++ if (!world.func_180501_a(pos, newState, 3)) return false; + -+ IBlockState state = world.getBlockState(pos); -+ if (state.getBlock() == this.block) ++ IBlockState state = world.func_180495_p(pos); ++ if (state.func_177230_c() == this.field_150939_a) + { -+ setTileEntityNBT(world, player, pos, stack); -+ this.block.onBlockPlacedBy(world, pos, state, player, stack); ++ func_179224_a(world, player, pos, stack); ++ this.field_150939_a.func_180633_a(world, pos, state, player, stack); + } + + return true; diff --git a/patches/minecraft/net/minecraft/item/ItemBow.java.patch b/patches/minecraft/net/minecraft/item/ItemBow.java.patch index 751ab8367..098450a80 100644 --- a/patches/minecraft/net/minecraft/item/ItemBow.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBow.java.patch @@ -1,10 +1,10 @@ --- ../src-base/minecraft/net/minecraft/item/ItemBow.java +++ ../src-work/minecraft/net/minecraft/item/ItemBow.java @@ -27,6 +27,9 @@ - if (flag || playerIn.inventory.hasItem(Items.arrow)) + if (flag || p_77615_3_.field_71071_by.func_146028_b(Items.field_151032_g)) { - int i = this.getMaxItemUseDuration(stack) - timeLeft; -+ net.minecraftforge.event.entity.player.ArrowLooseEvent event = new net.minecraftforge.event.entity.player.ArrowLooseEvent(playerIn, stack, i); + int i = this.func_77626_a(p_77615_1_) - p_77615_4_; ++ net.minecraftforge.event.entity.player.ArrowLooseEvent event = new net.minecraftforge.event.entity.player.ArrowLooseEvent(p_77615_3_, p_77615_1_, i); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; + i = event.charge; float f = (float)i / 20.0F; @@ -12,11 +12,11 @@ @@ -104,6 +107,9 @@ - public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + public ItemStack func_77659_a(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { -+ net.minecraftforge.event.entity.player.ArrowNockEvent event = new net.minecraftforge.event.entity.player.ArrowNockEvent(playerIn, itemStackIn); ++ net.minecraftforge.event.entity.player.ArrowNockEvent event = new net.minecraftforge.event.entity.player.ArrowNockEvent(p_77659_3_, p_77659_1_); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return event.result; + - if (playerIn.capabilities.isCreativeMode || playerIn.inventory.hasItem(Items.arrow)) + if (p_77659_3_.field_71075_bZ.field_75098_d || p_77659_3_.field_71071_by.func_146028_b(Items.field_151032_g)) { - playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); + p_77659_3_.func_71008_a(p_77659_1_, this.func_77626_a(p_77659_1_)); diff --git a/patches/minecraft/net/minecraft/item/ItemBucket.java.patch b/patches/minecraft/net/minecraft/item/ItemBucket.java.patch index 490b21677..b2f98aa45 100644 --- a/patches/minecraft/net/minecraft/item/ItemBucket.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBucket.java.patch @@ -4,9 +4,9 @@ } else { -+ ItemStack ret = net.minecraftforge.event.ForgeEventFactory.onBucketUse(playerIn, worldIn, itemStackIn, movingobjectposition); ++ ItemStack ret = net.minecraftforge.event.ForgeEventFactory.onBucketUse(p_77659_3_, p_77659_2_, p_77659_1_, movingobjectposition); + if (ret != null) return ret; + - if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + if (movingobjectposition.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK) { - BlockPos blockpos = movingobjectposition.getBlockPos(); + BlockPos blockpos = movingobjectposition.func_178782_a(); diff --git a/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch b/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch index e1b1013f4..a14a80107 100644 --- a/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemBucketMilk.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/item/ItemBucketMilk.java @@ -23,7 +23,7 @@ - if (!worldIn.isRemote) + if (!p_77654_2_.field_72995_K) { -- playerIn.clearActivePotions(); -+ playerIn.curePotionEffects(stack); +- p_77654_3_.func_70674_bp(); ++ p_77654_3_.curePotionEffects(p_77654_1_); } - playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + p_77654_3_.func_71029_a(StatList.field_75929_E[Item.func_150891_b(this)]); diff --git a/patches/minecraft/net/minecraft/item/ItemDye.java.patch b/patches/minecraft/net/minecraft/item/ItemDye.java.patch index fa9033555..a698baa69 100644 --- a/patches/minecraft/net/minecraft/item/ItemDye.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemDye.java.patch @@ -4,53 +4,53 @@ if (enumdyecolor == EnumDyeColor.WHITE) { -- if (applyBonemeal(stack, worldIn, pos)) -+ if (applyBonemeal(stack, worldIn, pos, playerIn)) +- if (func_179234_a(p_180614_1_, p_180614_3_, p_180614_4_)) ++ if (applyBonemeal(p_180614_1_, p_180614_3_, p_180614_4_, p_180614_2_)) { - if (!worldIn.isRemote) + if (!p_180614_3_.field_72995_K) { @@ -97,8 +97,18 @@ - public static boolean applyBonemeal(ItemStack stack, World worldIn, BlockPos target) + public static boolean func_179234_a(ItemStack p_179234_0_, World p_179234_1_, BlockPos p_179234_2_) { -+ if (worldIn instanceof net.minecraft.world.WorldServer) -+ return applyBonemeal(stack, worldIn, target, net.minecraftforge.common.util.FakePlayerFactory.getMinecraft((net.minecraft.world.WorldServer)worldIn)); ++ if (p_179234_1_ instanceof net.minecraft.world.WorldServer) ++ return applyBonemeal(p_179234_0_, p_179234_1_, p_179234_2_, net.minecraftforge.common.util.FakePlayerFactory.getMinecraft((net.minecraft.world.WorldServer)p_179234_1_)); + return false; + } + -+ public static boolean applyBonemeal(ItemStack stack, World worldIn, BlockPos target, EntityPlayer player) ++ public static boolean applyBonemeal(ItemStack p_179234_0_, World p_179234_1_, BlockPos p_179234_2_, EntityPlayer player) + { - IBlockState iblockstate = worldIn.getBlockState(target); + IBlockState iblockstate = p_179234_1_.func_180495_p(p_179234_2_); -+ int hook = net.minecraftforge.event.ForgeEventFactory.onApplyBonemeal(player, worldIn, target, iblockstate, stack); ++ int hook = net.minecraftforge.event.ForgeEventFactory.onApplyBonemeal(player, p_179234_1_, p_179234_2_, iblockstate, p_179234_0_); + if (hook != 0) return hook > 0; + - if (iblockstate.getBlock() instanceof IGrowable) + if (iblockstate.func_177230_c() instanceof IGrowable) { - IGrowable igrowable = (IGrowable)iblockstate.getBlock(); + IGrowable igrowable = (IGrowable)iblockstate.func_177230_c(); @@ -132,7 +142,7 @@ - Block block = worldIn.getBlockState(pos).getBlock(); + Block block = p_180617_0_.func_180495_p(p_180617_1_).func_177230_c(); -- if (block.getMaterial() != Material.air) -+ if (block.isAir(worldIn, pos)) +- if (block.func_149688_o() != Material.field_151579_a) ++ if (block.isAir(p_180617_0_, p_180617_1_)) { - block.setBlockBoundsBasedOnState(worldIn, pos); + block.func_180654_a(p_180617_0_, p_180617_1_); @@ -144,6 +154,16 @@ - worldIn.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, (double)((float)pos.getX() + itemRand.nextFloat()), (double)pos.getY() + (double)itemRand.nextFloat() * block.getBlockBoundsMaxY(), (double)((float)pos.getZ() + itemRand.nextFloat()), d0, d1, d2, new int[0]); + p_180617_0_.func_175688_a(EnumParticleTypes.VILLAGER_HAPPY, (double)((float)p_180617_1_.func_177958_n() + field_77697_d.nextFloat()), (double)p_180617_1_.func_177956_o() + (double)field_77697_d.nextFloat() * block.func_149669_A(), (double)((float)p_180617_1_.func_177952_p() + field_77697_d.nextFloat()), d0, d1, d2, new int[0]); } } + else + { -+ for (int i1 = 0; i1 < amount; ++i1) ++ for (int i1 = 0; i1 < p_180617_2_; ++i1) + { -+ double d0 = itemRand.nextGaussian() * 0.02D; -+ double d1 = itemRand.nextGaussian() * 0.02D; -+ double d2 = itemRand.nextGaussian() * 0.02D; -+ worldIn.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, (double)((float)pos.getX() + itemRand.nextFloat()), (double)pos.getY() + (double)itemRand.nextFloat() * 1.0f, (double)((float)pos.getZ() + itemRand.nextFloat()), d0, d1, d2, new int[0]); ++ double d0 = field_77697_d.nextGaussian() * 0.02D; ++ double d1 = field_77697_d.nextGaussian() * 0.02D; ++ double d2 = field_77697_d.nextGaussian() * 0.02D; ++ p_180617_0_.func_175688_a(EnumParticleTypes.VILLAGER_HAPPY, (double)((float)p_180617_1_.func_177958_n() + field_77697_d.nextFloat()), (double)p_180617_1_.func_177956_o() + (double)field_77697_d.nextFloat() * 1.0f, (double)((float)p_180617_1_.func_177952_p() + field_77697_d.nextFloat()), d0, d1, d2, new int[0]); + } + } } - public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target) + public boolean func_111207_a(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_) diff --git a/patches/minecraft/net/minecraft/item/ItemEmptyMap.java.patch b/patches/minecraft/net/minecraft/item/ItemEmptyMap.java.patch index 2707df433..aaf05d09d 100644 --- a/patches/minecraft/net/minecraft/item/ItemEmptyMap.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemEmptyMap.java.patch @@ -1,11 +1,11 @@ --- ../src-base/minecraft/net/minecraft/item/ItemEmptyMap.java +++ ../src-work/minecraft/net/minecraft/item/ItemEmptyMap.java @@ -22,7 +22,7 @@ - worldIn.setItemData(s, mapdata); - mapdata.scale = 0; - mapdata.func_176054_a(playerIn.posX, playerIn.posZ, mapdata.scale); -- mapdata.dimension = (byte)worldIn.provider.getDimensionId(); -+ mapdata.dimension = worldIn.provider.getDimensionId(); - mapdata.markDirty(); - --itemStackIn.stackSize; + p_77659_2_.func_72823_a(s, mapdata); + mapdata.field_76197_d = 0; + mapdata.func_176054_a(p_77659_3_.field_70165_t, p_77659_3_.field_70161_v, mapdata.field_76197_d); +- mapdata.field_76200_c = (byte)p_77659_2_.field_73011_w.func_177502_q(); ++ mapdata.field_76200_c = p_77659_2_.field_73011_w.func_177502_q(); + mapdata.func_76185_a(); + --p_77659_1_.field_77994_a; diff --git a/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch b/patches/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch index 17bd77146..624bf5ffc 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 (worldIn.getBlockState(pos).getBlock().getMaterial() == Material.air) -+ if (worldIn.isAirBlock(pos)) +- if (p_180614_3_.func_180495_p(p_180614_4_).func_177230_c().func_149688_o() == Material.field_151579_a) ++ if (p_180614_3_.func_175623_d(p_180614_4_)) { - worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); - worldIn.setBlockState(pos, Blocks.fire.getDefaultState()); + p_180614_3_.func_72908_a((double)p_180614_4_.func_177958_n() + 0.5D, (double)p_180614_4_.func_177956_o() + 0.5D, (double)p_180614_4_.func_177952_p() + 0.5D, "fire.ignite", 1.0F, field_77697_d.nextFloat() * 0.4F + 0.8F); + p_180614_3_.func_175656_a(p_180614_4_, Blocks.field_150480_ab.func_176223_P()); diff --git a/patches/minecraft/net/minecraft/item/ItemHoe.java.patch b/patches/minecraft/net/minecraft/item/ItemHoe.java.patch index 28920005f..3d3e201ef 100644 --- a/patches/minecraft/net/minecraft/item/ItemHoe.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemHoe.java.patch @@ -4,14 +4,14 @@ } else { -+ int hook = net.minecraftforge.event.ForgeEventFactory.onHoeUse(stack, playerIn, worldIn, pos); ++ int hook = net.minecraftforge.event.ForgeEventFactory.onHoeUse(p_180614_1_, p_180614_2_, p_180614_3_, p_180614_4_); + if (hook != 0) return hook > 0; + - IBlockState iblockstate = worldIn.getBlockState(pos); - Block block = iblockstate.getBlock(); + IBlockState iblockstate = p_180614_3_.func_180495_p(p_180614_4_); + Block block = iblockstate.func_177230_c(); -- if (side != EnumFacing.DOWN && worldIn.getBlockState(pos.up()).getBlock().getMaterial() == Material.air) -+ if (side != EnumFacing.DOWN && worldIn.isAirBlock(pos.up())) +- if (p_180614_5_ != EnumFacing.DOWN && p_180614_3_.func_180495_p(p_180614_4_.func_177984_a()).func_177230_c().func_149688_o() == Material.field_151579_a) ++ if (p_180614_5_ != EnumFacing.DOWN && p_180614_3_.func_175623_d(p_180614_4_.func_177984_a())) { - if (block == Blocks.grass) + if (block == Blocks.field_150349_c) { diff --git a/patches/minecraft/net/minecraft/item/ItemLilyPad.java.patch b/patches/minecraft/net/minecraft/item/ItemLilyPad.java.patch index 86d27a443..e0bd7c80c 100644 --- a/patches/minecraft/net/minecraft/item/ItemLilyPad.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemLilyPad.java.patch @@ -2,16 +2,16 @@ +++ ../src-work/minecraft/net/minecraft/item/ItemLilyPad.java @@ -49,7 +49,14 @@ - if (iblockstate.getBlock().getMaterial() == Material.water && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0 && worldIn.isAirBlock(blockpos1)) + if (iblockstate.func_177230_c().func_149688_o() == Material.field_151586_h && ((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue() == 0 && p_77659_2_.func_175623_d(blockpos1)) { + // special case for handling block placement with water lilies -+ net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(worldIn, blockpos1); - worldIn.setBlockState(blockpos1, Blocks.waterlily.getDefaultState()); -+ if (net.minecraftforge.event.ForgeEventFactory.onPlayerBlockPlace(playerIn, blocksnapshot, net.minecraft.util.EnumFacing.UP).isCanceled()) ++ net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(p_77659_2_, blockpos1); + p_77659_2_.func_175656_a(blockpos1, Blocks.field_150392_bi.func_176223_P()); ++ if (net.minecraftforge.event.ForgeEventFactory.onPlayerBlockPlace(p_77659_3_, blocksnapshot, net.minecraft.util.EnumFacing.UP).isCanceled()) + { + blocksnapshot.restore(true, false); -+ return itemStackIn; ++ return p_77659_1_; + } - if (!playerIn.capabilities.isCreativeMode) + if (!p_77659_3_.field_71075_bZ.field_75098_d) { diff --git a/patches/minecraft/net/minecraft/item/ItemMap.java.patch b/patches/minecraft/net/minecraft/item/ItemMap.java.patch index bd169ec19..c8f63dba2 100644 --- a/patches/minecraft/net/minecraft/item/ItemMap.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemMap.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/item/ItemMap.java @@ -57,7 +57,7 @@ mapdata = new MapData(s); - mapdata.scale = 3; - mapdata.func_176054_a((double)worldIn.getWorldInfo().getSpawnX(), (double)worldIn.getWorldInfo().getSpawnZ(), mapdata.scale); -- mapdata.dimension = (byte)worldIn.provider.getDimensionId(); -+ mapdata.dimension = worldIn.provider.getDimensionId(); - mapdata.markDirty(); - worldIn.setItemData(s, mapdata); + mapdata.field_76197_d = 3; + mapdata.func_176054_a((double)p_77873_2_.func_72912_H().func_76079_c(), (double)p_77873_2_.func_72912_H().func_76074_e(), mapdata.field_76197_d); +- mapdata.field_76200_c = (byte)p_77873_2_.field_73011_w.func_177502_q(); ++ mapdata.field_76200_c = p_77873_2_.field_73011_w.func_177502_q(); + mapdata.func_76185_a(); + p_77873_2_.func_72823_a(s, mapdata); } diff --git a/patches/minecraft/net/minecraft/item/ItemMonsterPlacer.java.patch b/patches/minecraft/net/minecraft/item/ItemMonsterPlacer.java.patch index 1af20c125..a376bad96 100644 --- a/patches/minecraft/net/minecraft/item/ItemMonsterPlacer.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemMonsterPlacer.java.patch @@ -1,47 +1,47 @@ --- ../src-base/minecraft/net/minecraft/item/ItemMonsterPlacer.java +++ ../src-work/minecraft/net/minecraft/item/ItemMonsterPlacer.java @@ -36,7 +36,7 @@ - public String getItemStackDisplayName(ItemStack stack) + public String func_77653_i(ItemStack p_77653_1_) { - String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim(); -- String s1 = EntityList.getStringFromID(stack.getMetadata()); -+ String s1 = ItemMonsterPlacer.getEntityName(stack); + String s = ("" + StatCollector.func_74838_a(this.func_77658_a() + ".name")).trim(); +- String s1 = EntityList.func_75617_a(p_77653_1_.func_77960_j()); ++ String s1 = ItemMonsterPlacer.getEntityName(p_77653_1_); if (s1 != null) { @@ -49,7 +49,7 @@ @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int renderPass) + public int func_82790_a(ItemStack p_82790_1_, int p_82790_2_) { -- EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(stack.getMetadata())); -+ EntityList.EntityEggInfo entitylist$entityegginfo = ItemMonsterPlacer.getEggInfo(stack); - return entitylist$entityegginfo != null ? (renderPass == 0 ? entitylist$entityegginfo.primaryColor : entitylist$entityegginfo.secondaryColor) : 16777215; +- EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)EntityList.field_75627_a.get(Integer.valueOf(p_82790_1_.func_77960_j())); ++ EntityList.EntityEggInfo entitylist$entityegginfo = ItemMonsterPlacer.getEggInfo(p_82790_1_); + return entitylist$entityegginfo != null ? (p_82790_2_ == 0 ? entitylist$entityegginfo.field_75611_b : entitylist$entityegginfo.field_75612_c) : 16777215; } @@ -74,7 +74,7 @@ if (tileentity instanceof TileEntityMobSpawner) { - MobSpawnerBaseLogic mobspawnerbaselogic = ((TileEntityMobSpawner)tileentity).getSpawnerBaseLogic(); -- mobspawnerbaselogic.setEntityName(EntityList.getStringFromID(stack.getMetadata())); -+ mobspawnerbaselogic.setEntityName(ItemMonsterPlacer.getEntityName(stack)); - tileentity.markDirty(); - worldIn.markBlockForUpdate(pos); + MobSpawnerBaseLogic mobspawnerbaselogic = ((TileEntityMobSpawner)tileentity).func_145881_a(); +- mobspawnerbaselogic.func_98272_a(EntityList.func_75617_a(p_180614_1_.func_77960_j())); ++ mobspawnerbaselogic.func_98272_a(ItemMonsterPlacer.getEntityName(p_180614_1_)); + tileentity.func_70296_d(); + p_180614_3_.func_175689_h(p_180614_4_); @@ -95,7 +95,7 @@ d0 = 0.5D; } -- Entity entity = spawnCreature(worldIn, stack.getMetadata(), (double)pos.getX() + 0.5D, (double)pos.getY() + d0, (double)pos.getZ() + 0.5D); -+ Entity entity = spawnCreature(worldIn, ItemMonsterPlacer.getEntityName(stack), (double)pos.getX() + 0.5D, (double)pos.getY() + d0, (double)pos.getZ() + 0.5D); +- Entity entity = func_77840_a(p_180614_3_, p_180614_1_.func_77960_j(), (double)p_180614_4_.func_177958_n() + 0.5D, (double)p_180614_4_.func_177956_o() + d0, (double)p_180614_4_.func_177952_p() + 0.5D); ++ Entity entity = spawnCreature(p_180614_3_, ItemMonsterPlacer.getEntityName(p_180614_1_), (double)p_180614_4_.func_177958_n() + 0.5D, (double)p_180614_4_.func_177956_o() + d0, (double)p_180614_4_.func_177952_p() + 0.5D); if (entity != null) { @@ -146,7 +146,7 @@ - if (worldIn.getBlockState(blockpos).getBlock() instanceof BlockLiquid) + if (p_77659_2_.func_180495_p(blockpos).func_177230_c() instanceof BlockLiquid) { -- Entity entity = spawnCreature(worldIn, itemStackIn.getMetadata(), (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D); -+ Entity entity = spawnCreature(worldIn, ItemMonsterPlacer.getEntityName(itemStackIn), (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D); +- Entity entity = func_77840_a(p_77659_2_, p_77659_1_.func_77960_j(), (double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.5D, (double)blockpos.func_177952_p() + 0.5D); ++ Entity entity = spawnCreature(p_77659_2_, ItemMonsterPlacer.getEntityName(p_77659_1_), (double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.5D, (double)blockpos.func_177952_p() + 0.5D); if (entity != null) { @@ -50,18 +50,18 @@ } + @Deprecated // Use string version below. - public static Entity spawnCreature(World worldIn, int entityID, double x, double y, double z) + public static Entity func_77840_a(World p_77840_0_, int p_77840_1_, double p_77840_2_, double p_77840_4_, double p_77840_6_) { - if (!EntityList.entityEggs.containsKey(Integer.valueOf(entityID))) + if (!EntityList.field_75627_a.containsKey(Integer.valueOf(p_77840_1_))) { return null; } -+ return spawnCreature(worldIn, EntityList.getStringFromID(entityID), x, y, z); ++ return spawnCreature(p_77840_0_, EntityList.func_75617_a(p_77840_1_), p_77840_2_, p_77840_4_, p_77840_6_); + } + -+ public static Entity spawnCreature(World worldIn, String name, double x, double y, double z) ++ public static Entity spawnCreature(World p_77840_0_, String name, double p_77840_2_, double p_77840_4_, double p_77840_6_) + { -+ if (!EntityList.stringToClassMapping.containsKey(name)) ++ if (!EntityList.field_75625_b.containsKey(name)) + { + return null; + } @@ -71,37 +71,37 @@ for (int i = 0; i < 1; ++i) { -- entity = EntityList.createEntityByID(entityID, worldIn); -+ entity = EntityList.createEntityByName(name, worldIn); +- entity = EntityList.func_75616_a(p_77840_1_, p_77840_0_); ++ entity = EntityList.func_75620_a(name, p_77840_0_); if (entity instanceof EntityLivingBase) { @@ -207,5 +217,28 @@ { - subItems.add(new ItemStack(itemIn, 1, entitylist$entityegginfo.spawnedID)); + p_150895_3_.add(new ItemStack(p_150895_1_, 1, entitylist$entityegginfo.field_75613_a)); } + + for (String name : net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().keySet()) + { -+ ItemStack stack = new ItemStack(itemIn); ++ ItemStack stack = new ItemStack(p_150895_1_); + net.minecraft.nbt.NBTTagCompound nbt = new net.minecraft.nbt.NBTTagCompound(); -+ nbt.setString("entity_name", name); -+ stack.setTagCompound(nbt); -+ subItems.add(stack); ++ nbt.func_74778_a("entity_name", name); ++ stack.func_77982_d(nbt); ++ p_150895_3_.add(stack); + } } + + public static String getEntityName(ItemStack stack) + { -+ if (stack.hasTagCompound() && stack.getTagCompound().hasKey("entity_name", 8)) -+ return stack.getTagCompound().getString("entity_name"); -+ return EntityList.getStringFromID(stack.getMetadata()); ++ if (stack.func_77942_o() && stack.func_77978_p().func_150297_b("entity_name", 8)) ++ return stack.func_77978_p().func_74779_i("entity_name"); ++ return EntityList.func_75617_a(stack.func_77960_j()); + } + + private static EntityList.EntityEggInfo getEggInfo(ItemStack stack) + { -+ if (stack.hasTagCompound() && stack.getTagCompound().hasKey("entity_name", 8)) -+ return net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().get(stack.getTagCompound().getString("entity_name")); -+ return (EntityList.EntityEggInfo)EntityList.entityEggs.get(stack.getMetadata()); ++ if (stack.func_77942_o() && stack.func_77978_p().func_150297_b("entity_name", 8)) ++ return net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().get(stack.func_77978_p().func_74779_i("entity_name")); ++ return (EntityList.EntityEggInfo)EntityList.field_75627_a.get(stack.func_77960_j()); + } } diff --git a/patches/minecraft/net/minecraft/item/ItemRecord.java.patch b/patches/minecraft/net/minecraft/item/ItemRecord.java.patch index e6bf3bf5d..dcafa7df7 100644 --- a/patches/minecraft/net/minecraft/item/ItemRecord.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemRecord.java.patch @@ -2,7 +2,7 @@ +++ ../src-work/minecraft/net/minecraft/item/ItemRecord.java @@ -76,4 +76,15 @@ { - return (ItemRecord)RECORDS.get(name); + 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 53391bf0b..1d4182528 100644 --- a/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch @@ -7,17 +7,17 @@ -public class ItemSeedFood extends ItemFood +public class ItemSeedFood extends ItemFood implements net.minecraftforge.common.IPlantable { - private Block crops; - private Block soilId; + private Block field_150908_b; + private Block field_82809_c; @@ -28,7 +28,7 @@ { return false; } -- else if (worldIn.getBlockState(pos).getBlock() == this.soilId && worldIn.isAirBlock(pos.up())) -+ else if (worldIn.getBlockState(pos).getBlock().canSustainPlant(worldIn, pos, EnumFacing.UP, this) && worldIn.isAirBlock(pos.up())) +- else if (p_180614_3_.func_180495_p(p_180614_4_).func_177230_c() == this.field_82809_c && p_180614_3_.func_175623_d(p_180614_4_.func_177984_a())) ++ else if (p_180614_3_.func_180495_p(p_180614_4_).func_177230_c().canSustainPlant(p_180614_3_, p_180614_4_, EnumFacing.UP, this) && p_180614_3_.func_175623_d(p_180614_4_.func_177984_a())) { - worldIn.setBlockState(pos.up(), this.crops.getDefaultState()); - --stack.stackSize; + p_180614_3_.func_175656_a(p_180614_4_.func_177984_a(), this.field_150908_b.func_176223_P()); + --p_180614_1_.field_77994_a; @@ -39,4 +39,16 @@ return false; } @@ -32,6 +32,6 @@ + @Override + public net.minecraft.block.state.IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos) + { -+ return this.crops.getDefaultState(); ++ return this.field_150908_b.func_176223_P(); + } } diff --git a/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch b/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch index 053649392..08fd7261b 100644 --- a/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSeeds.java.patch @@ -7,17 +7,17 @@ -public class ItemSeeds extends Item +public class ItemSeeds extends Item implements net.minecraftforge.common.IPlantable { - private Block crops; - private Block soilBlockID; + private Block field_150925_a; + private Block field_77838_b; @@ -29,7 +29,7 @@ { return false; } -- else if (worldIn.getBlockState(pos).getBlock() == this.soilBlockID && worldIn.isAirBlock(pos.up())) -+ else if (worldIn.getBlockState(pos).getBlock().canSustainPlant(worldIn, pos, EnumFacing.UP, this) && worldIn.isAirBlock(pos.up())) +- else if (p_180614_3_.func_180495_p(p_180614_4_).func_177230_c() == this.field_77838_b && p_180614_3_.func_175623_d(p_180614_4_.func_177984_a())) ++ else if (p_180614_3_.func_180495_p(p_180614_4_).func_177230_c().canSustainPlant(p_180614_3_, p_180614_4_, EnumFacing.UP, this) && p_180614_3_.func_175623_d(p_180614_4_.func_177984_a())) { - worldIn.setBlockState(pos.up(), this.crops.getDefaultState()); - --stack.stackSize; + p_180614_3_.func_175656_a(p_180614_4_.func_177984_a(), this.field_150925_a.func_176223_P()); + --p_180614_1_.field_77994_a; @@ -40,4 +40,16 @@ return false; } @@ -26,12 +26,12 @@ + @Override + public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) + { -+ return this.crops == net.minecraft.init.Blocks.nether_wart ? net.minecraftforge.common.EnumPlantType.Nether : net.minecraftforge.common.EnumPlantType.Crop; ++ return this.field_150925_a == net.minecraft.init.Blocks.field_150388_bm ? net.minecraftforge.common.EnumPlantType.Nether : net.minecraftforge.common.EnumPlantType.Crop; + } + + @Override + public net.minecraft.block.state.IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos) + { -+ return this.crops.getDefaultState(); ++ return this.field_150925_a.func_176223_P(); + } } diff --git a/patches/minecraft/net/minecraft/item/ItemShears.java.patch b/patches/minecraft/net/minecraft/item/ItemShears.java.patch index 6c0e83931..3f6119ca8 100644 --- a/patches/minecraft/net/minecraft/item/ItemShears.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemShears.java.patch @@ -2,50 +2,50 @@ +++ ../src-work/minecraft/net/minecraft/item/ItemShears.java @@ -19,13 +19,12 @@ - public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) + public boolean func_179218_a(ItemStack p_179218_1_, World p_179218_2_, Block p_179218_3_, BlockPos p_179218_4_, EntityLivingBase p_179218_5_) { -- if (blockIn.getMaterial() != Material.leaves && blockIn != Blocks.web && blockIn != Blocks.tallgrass && blockIn != Blocks.vine && blockIn != Blocks.tripwire && blockIn != Blocks.wool) -+ if (blockIn.getMaterial() != Material.leaves && blockIn != Blocks.web && blockIn != Blocks.tallgrass && blockIn != Blocks.vine && blockIn != Blocks.tripwire && blockIn != Blocks.wool && !(blockIn instanceof net.minecraftforge.common.IShearable)) +- if (p_179218_3_.func_149688_o() != Material.field_151584_j && p_179218_3_ != Blocks.field_150321_G && p_179218_3_ != Blocks.field_150329_H && p_179218_3_ != Blocks.field_150395_bd && p_179218_3_ != Blocks.field_150473_bD && p_179218_3_ != Blocks.field_150325_L) ++ if (p_179218_3_.func_149688_o() != Material.field_151584_j && p_179218_3_ != Blocks.field_150321_G && p_179218_3_ != Blocks.field_150329_H && p_179218_3_ != Blocks.field_150395_bd && p_179218_3_ != Blocks.field_150473_bD && p_179218_3_ != Blocks.field_150325_L && !(p_179218_3_ instanceof net.minecraftforge.common.IShearable)) { - return super.onBlockDestroyed(stack, worldIn, blockIn, pos, playerIn); + return super.func_179218_a(p_179218_1_, p_179218_2_, p_179218_3_, p_179218_4_, p_179218_5_); } else { -- stack.damageItem(1, playerIn); +- p_179218_1_.func_77972_a(1, p_179218_5_); return true; } } @@ -39,4 +38,71 @@ { - return block != Blocks.web && block.getMaterial() != Material.leaves ? (block == Blocks.wool ? 5.0F : super.getStrVsBlock(stack, block)) : 15.0F; + return p_150893_2_ != Blocks.field_150321_G && p_150893_2_.func_149688_o() != Material.field_151584_j ? (p_150893_2_ == Blocks.field_150325_L ? 5.0F : super.func_150893_a(p_150893_1_, p_150893_2_)) : 15.0F; } + + + @Override -+ public boolean itemInteractionForEntity(ItemStack itemstack, net.minecraft.entity.player.EntityPlayer player, EntityLivingBase entity) ++ public boolean func_111207_a(ItemStack itemstack, net.minecraft.entity.player.EntityPlayer player, EntityLivingBase entity) + { -+ if (entity.worldObj.isRemote) ++ if (entity.field_70170_p.field_72995_K) + { + return false; + } + if (entity instanceof net.minecraftforge.common.IShearable) + { + net.minecraftforge.common.IShearable target = (net.minecraftforge.common.IShearable)entity; -+ BlockPos pos = new BlockPos(entity.posX, entity.posY, entity.posZ); -+ if (target.isShearable(itemstack, entity.worldObj, pos)) ++ BlockPos pos = new BlockPos(entity.field_70165_t, entity.field_70163_u, entity.field_70161_v); ++ if (target.isShearable(itemstack, entity.field_70170_p, pos)) + { -+ java.util.List drops = target.onSheared(itemstack, entity.worldObj, pos, -+ net.minecraft.enchantment.EnchantmentHelper.getEnchantmentLevel(net.minecraft.enchantment.Enchantment.fortune.effectId, itemstack)); ++ java.util.List drops = target.onSheared(itemstack, entity.field_70170_p, pos, ++ net.minecraft.enchantment.EnchantmentHelper.func_77506_a(net.minecraft.enchantment.Enchantment.field_77346_s.field_77352_x, itemstack)); + + java.util.Random rand = new java.util.Random(); + for(ItemStack stack : drops) + { -+ net.minecraft.entity.item.EntityItem ent = entity.entityDropItem(stack, 1.0F); -+ ent.motionY += rand.nextFloat() * 0.05F; -+ ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F; -+ ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F; ++ net.minecraft.entity.item.EntityItem ent = entity.func_70099_a(stack, 1.0F); ++ ent.field_70181_x += rand.nextFloat() * 0.05F; ++ ent.field_70159_w += (rand.nextFloat() - rand.nextFloat()) * 0.1F; ++ ent.field_70179_y += (rand.nextFloat() - rand.nextFloat()) * 0.1F; + } -+ itemstack.damageItem(1, entity); ++ itemstack.func_77972_a(1, entity); + } + return true; + } @@ -55,18 +55,18 @@ + @Override + public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, net.minecraft.entity.player.EntityPlayer player) + { -+ if (player.worldObj.isRemote || player.capabilities.isCreativeMode) ++ if (player.field_70170_p.field_72995_K || player.field_71075_bZ.field_75098_d) + { + return false; + } -+ Block block = player.worldObj.getBlockState(pos).getBlock(); ++ Block block = player.field_70170_p.func_180495_p(pos).func_177230_c(); + if (block instanceof net.minecraftforge.common.IShearable) + { + net.minecraftforge.common.IShearable target = (net.minecraftforge.common.IShearable)block; -+ if (target.isShearable(itemstack, player.worldObj, pos)) ++ if (target.isShearable(itemstack, player.field_70170_p, pos)) + { -+ java.util.List drops = target.onSheared(itemstack, player.worldObj, pos, -+ net.minecraft.enchantment.EnchantmentHelper.getEnchantmentLevel(net.minecraft.enchantment.Enchantment.fortune.effectId, itemstack)); ++ java.util.List drops = target.onSheared(itemstack, player.field_70170_p, pos, ++ net.minecraft.enchantment.EnchantmentHelper.func_77506_a(net.minecraft.enchantment.Enchantment.field_77346_s.field_77352_x, itemstack)); + java.util.Random rand = new java.util.Random(); + + for(ItemStack stack : drops) @@ -75,13 +75,13 @@ + double d = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d1 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d2 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; -+ net.minecraft.entity.item.EntityItem entityitem = new net.minecraft.entity.item.EntityItem(player.worldObj, (double)pos.getX() + d, (double)pos.getY() + d1, (double)pos.getZ() + d2, stack); -+ entityitem.setDefaultPickupDelay(); -+ player.worldObj.spawnEntityInWorld(entityitem); ++ net.minecraft.entity.item.EntityItem entityitem = new net.minecraft.entity.item.EntityItem(player.field_70170_p, (double)pos.func_177958_n() + d, (double)pos.func_177956_o() + d1, (double)pos.func_177952_p() + d2, stack); ++ entityitem.func_174869_p(); ++ player.field_70170_p.func_72838_d(entityitem); + } + -+ itemstack.damageItem(1, player); -+ player.addStat(net.minecraft.stats.StatList.mineBlockStatArray[Block.getIdFromBlock(block)], 1); ++ itemstack.func_77972_a(1, player); ++ player.func_71064_a(net.minecraft.stats.StatList.field_75934_C[Block.func_149682_b(block)], 1); + } + } + return false; diff --git a/patches/minecraft/net/minecraft/item/ItemSkull.java.patch b/patches/minecraft/net/minecraft/item/ItemSkull.java.patch index 4e8acb4a5..0e97068ef 100644 --- a/patches/minecraft/net/minecraft/item/ItemSkull.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSkull.java.patch @@ -2,30 +2,30 @@ +++ ../src-work/minecraft/net/minecraft/item/ItemSkull.java @@ -34,6 +34,11 @@ - public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + public boolean func_180614_a(ItemStack p_180614_1_, EntityPlayer p_180614_2_, World p_180614_3_, BlockPos p_180614_4_, EnumFacing p_180614_5_, float p_180614_6_, float p_180614_7_, float p_180614_8_) { -+ if (worldIn.getBlockState(pos).getBlock().isReplaceable(worldIn, pos) && side != EnumFacing.DOWN) ++ if (p_180614_3_.func_180495_p(p_180614_4_).func_177230_c().func_176200_f(p_180614_3_, p_180614_4_) && p_180614_5_ != EnumFacing.DOWN) + { -+ side = EnumFacing.UP; -+ pos = pos.down(); ++ p_180614_5_ = EnumFacing.UP; ++ p_180614_4_ = p_180614_4_.func_177977_b(); + } - if (side == EnumFacing.DOWN) + if (p_180614_5_ == EnumFacing.DOWN) { return false; @@ -46,7 +51,7 @@ if (!flag) { -- if (!worldIn.getBlockState(pos).getBlock().getMaterial().isSolid()) -+ if (!worldIn.getBlockState(pos).getBlock().getMaterial().isSolid() && !worldIn.isSideSolid(pos, side, true)) +- if (!p_180614_3_.func_180495_p(p_180614_4_).func_177230_c().func_149688_o().func_76220_a()) ++ if (!p_180614_3_.func_180495_p(p_180614_4_).func_177230_c().func_149688_o().func_76220_a() && !p_180614_3_.isSideSolid(p_180614_4_, p_180614_5_, true)) { return false; } @@ -66,6 +71,7 @@ { - if (!worldIn.isRemote) + if (!p_180614_3_.field_72995_K) { -+ if (!Blocks.skull.canPlaceBlockOnSide(worldIn, pos, side)) return false; - worldIn.setBlockState(pos, Blocks.skull.getDefaultState().withProperty(BlockSkull.FACING, side), 3); ++ if (!Blocks.field_150465_bP.func_176198_a(p_180614_3_, p_180614_4_, p_180614_5_)) return false; + p_180614_3_.func_180501_a(p_180614_4_, Blocks.field_150465_bP.func_176223_P().func_177226_a(BlockSkull.field_176418_a, p_180614_5_), 3); int i = 0; diff --git a/patches/minecraft/net/minecraft/item/ItemSnow.java.patch b/patches/minecraft/net/minecraft/item/ItemSnow.java.patch index 3d986ba7b..984fba4ed 100644 --- a/patches/minecraft/net/minecraft/item/ItemSnow.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSnow.java.patch @@ -2,12 +2,12 @@ +++ ../src-work/minecraft/net/minecraft/item/ItemSnow.java @@ -67,4 +67,10 @@ { - return damage; + return p_77647_1_; } + -+ public boolean canPlaceBlockOnSide(World world, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) ++ public boolean func_179222_a(World world, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) + { -+ IBlockState state = world.getBlockState(pos); -+ return (state.getBlock() != net.minecraft.init.Blocks.snow_layer || ((Integer)state.getValue(BlockSnow.LAYERS)) > 7) ? super.canPlaceBlockOnSide(world, pos, side, player, stack) : true; ++ IBlockState state = world.func_180495_p(pos); ++ return (state.func_177230_c() != net.minecraft.init.Blocks.field_150431_aC || ((Integer)state.func_177229_b(BlockSnow.field_176315_a)) > 7) ? super.func_179222_a(world, pos, side, player, stack) : true; + } } diff --git a/patches/minecraft/net/minecraft/item/ItemStack.java.patch b/patches/minecraft/net/minecraft/item/ItemStack.java.patch index 448854d90..8dd896471 100644 --- a/patches/minecraft/net/minecraft/item/ItemStack.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemStack.java.patch @@ -1,131 +1,131 @@ --- ../src-base/minecraft/net/minecraft/item/ItemStack.java +++ ../src-work/minecraft/net/minecraft/item/ItemStack.java @@ -49,6 +49,7 @@ - private Block canPlaceOnCacheBlock; - private boolean canPlaceOnCacheResult; + private Block field_179550_j; + private boolean field_179551_k; + private net.minecraftforge.fml.common.registry.RegistryDelegate delegate; - public ItemStack(Block blockIn) + public ItemStack(Block p_i1876_1_) { - this((Block)blockIn, 1); + this((Block)p_i1876_1_, 1); @@ -80,7 +81,7 @@ - this.canDestroyCacheResult = false; - this.canPlaceOnCacheBlock = null; - this.canPlaceOnCacheResult = false; -- this.item = itemIn; -+ this.setItem(itemIn); - this.stackSize = amount; - this.itemDamage = meta; + this.field_179553_i = false; + this.field_179550_j = null; + this.field_179551_k = false; +- this.field_151002_e = p_i1881_1_; ++ this.func_150996_a(p_i1881_1_); + this.field_77994_a = p_i1881_2_; + this.field_77991_e = p_i1881_3_; @@ -120,11 +121,12 @@ - public Item getItem() + public Item func_77973_b() { -- return this.item; +- return this.field_151002_e; + return this.delegate != null ? this.delegate.get() : null; } - public boolean onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + public boolean func_179546_a(EntityPlayer p_179546_1_, World p_179546_2_, BlockPos p_179546_3_, EnumFacing p_179546_4_, float p_179546_5_, float p_179546_6_, float p_179546_7_) { -+ if (!worldIn.isRemote) return net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(this, playerIn, worldIn, pos, side, hitX, hitY, hitZ); - boolean flag = this.getItem().onItemUse(this, playerIn, worldIn, pos, side, hitX, hitY, hitZ); ++ if (!p_179546_2_.field_72995_K) return net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(this, p_179546_1_, p_179546_2_, p_179546_3_, p_179546_4_, p_179546_5_, p_179546_6_, p_179546_7_); + boolean flag = this.func_77973_b().func_180614_a(this, p_179546_1_, p_179546_2_, p_179546_3_, p_179546_4_, p_179546_5_, p_179546_6_, p_179546_7_); if (flag) @@ -169,11 +171,11 @@ { - if (nbt.hasKey("id", 8)) + if (p_77963_1_.func_150297_b("id", 8)) { -- this.item = Item.getByNameOrId(nbt.getString("id")); -+ this.setItem(Item.getByNameOrId(nbt.getString("id"))); +- this.field_151002_e = Item.func_111206_d(p_77963_1_.func_74779_i("id")); ++ this.func_150996_a(Item.func_111206_d(p_77963_1_.func_74779_i("id"))); } else { -- this.item = Item.getItemById(nbt.getShort("id")); -+ this.setItem(Item.getItemById(nbt.getShort("id"))); +- this.field_151002_e = Item.func_150899_d(p_77963_1_.func_74765_d("id")); ++ this.func_150996_a(Item.func_150899_d(p_77963_1_.func_74765_d("id"))); } - this.stackSize = nbt.getByte("Count"); + this.field_77994_a = p_77963_1_.func_74771_c("Count"); @@ -197,7 +199,7 @@ - public int getMaxStackSize() + public int func_77976_d() { -- return this.getItem().getItemStackLimit(); -+ return this.getItem().getItemStackLimit(this); +- return this.func_77973_b().func_77639_j(); ++ return this.func_77973_b().getItemStackLimit(this); } - public boolean isStackable() + public boolean func_77985_e() @@ -207,7 +209,7 @@ - public boolean isItemStackDamageable() + public boolean func_77984_f() { -- return this.item == null ? false : (this.item.getMaxDamage() <= 0 ? false : !this.hasTagCompound() || !this.getTagCompound().getBoolean("Unbreakable")); -+ return this.item == null ? false : (this.item.getMaxDamage(this) <= 0 ? false : !this.hasTagCompound() || !this.getTagCompound().getBoolean("Unbreakable")); +- return this.field_151002_e == null ? false : (this.field_151002_e.func_77612_l() <= 0 ? false : !this.func_77942_o() || !this.func_77978_p().func_74767_n("Unbreakable")); ++ return this.field_151002_e == null ? false : (this.field_151002_e.getMaxDamage(this) <= 0 ? false : !this.func_77942_o() || !this.func_77978_p().func_74767_n("Unbreakable")); } - public boolean getHasSubtypes() + public boolean func_77981_g() @@ -217,32 +219,27 @@ - public boolean isItemDamaged() + public boolean func_77951_h() { -- return this.isItemStackDamageable() && this.itemDamage > 0; -+ return this.isItemStackDamageable() && getItem().isDamaged(this); +- return this.func_77984_f() && this.field_77991_e > 0; ++ return this.func_77984_f() && func_77973_b().isDamaged(this); } - public int getItemDamage() + public int func_77952_i() { -- return this.itemDamage; -+ return getItem().getDamage(this); +- return this.field_77991_e; ++ return func_77973_b().getDamage(this); } - public int getMetadata() + public int func_77960_j() { -- return this.itemDamage; -+ return getItem().getMetadata(this); +- return this.field_77991_e; ++ return func_77973_b().getMetadata(this); } - public void setItemDamage(int meta) + public void func_77964_b(int p_77964_1_) { -- this.itemDamage = meta; +- this.field_77991_e = p_77964_1_; - -- if (this.itemDamage < 0) +- if (this.field_77991_e < 0) - { -- this.itemDamage = 0; +- this.field_77991_e = 0; - } -+ getItem().setDamage(this, meta); ++ func_77973_b().setDamage(this, p_77964_1_); } - public int getMaxDamage() + public int func_77958_k() { -- return this.item.getMaxDamage(); -+ return this.item.getMaxDamage(this); +- return this.field_151002_e.func_77612_l(); ++ return this.field_151002_e.getMaxDamage(this); } - public boolean attemptDamageItem(int amount, Random rand) + public boolean func_96631_a(int p_96631_1_, Random p_96631_2_) @@ -274,8 +271,8 @@ } } -- this.itemDamage += amount; -- return this.itemDamage > this.getMaxDamage(); -+ setItemDamage(getItemDamage() + amount); //Redirect through Item's callback if applicable. -+ return getItemDamage() > getMaxDamage(); +- this.field_77991_e += p_96631_1_; +- return this.field_77991_e > this.func_77958_k(); ++ func_77964_b(func_77952_i() + p_96631_1_); //Redirect through Item's callback if applicable. ++ return func_77952_i() > func_77958_k(); } } @@ -334,7 +331,7 @@ - public boolean canHarvestBlock(Block blockIn) + public boolean func_150998_b(Block p_150998_1_) { -- return this.item.canHarvestBlock(blockIn); -+ return getItem().canHarvestBlock(blockIn, this); +- return this.field_151002_e.func_150897_b(p_150998_1_); ++ return func_77973_b().canHarvestBlock(p_150998_1_, this); } - public boolean interactWithEntity(EntityPlayer playerIn, EntityLivingBase entityIn) + public boolean func_111282_a(EntityPlayer p_111282_1_, EntityLivingBase p_111282_2_) @@ -742,6 +739,7 @@ } } -+ net.minecraftforge.event.ForgeEventFactory.onItemTooltip(this, playerIn, list, advanced); ++ net.minecraftforge.event.ForgeEventFactory.onItemTooltip(this, p_82840_1_, list, p_82840_2_); return list; } @@ -133,16 +133,16 @@ } else { -- multimap = this.getItem().getItemAttributeModifiers(); -+ multimap = this.getItem().getAttributeModifiers(this); +- multimap = this.func_77973_b().func_111205_h(); ++ multimap = this.func_77973_b().getAttributeModifiers(this); } return multimap; @@ -860,6 +858,7 @@ - public void setItem(Item newItem) + public void func_150996_a(Item p_150996_1_) { -+ this.delegate = newItem != null ? newItem.delegate : null; - this.item = newItem; ++ this.delegate = p_150996_1_ != null ? p_150996_1_.delegate : null; + this.field_151002_e = p_150996_1_; } diff --git a/patches/minecraft/net/minecraft/item/ItemSword.java.patch b/patches/minecraft/net/minecraft/item/ItemSword.java.patch index 3b7d5e0e0..2b99d22f1 100644 --- a/patches/minecraft/net/minecraft/item/ItemSword.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemSword.java.patch @@ -2,12 +2,12 @@ +++ ../src-work/minecraft/net/minecraft/item/ItemSword.java @@ -101,7 +101,9 @@ - public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) + public boolean func_82789_a(ItemStack p_82789_1_, ItemStack p_82789_2_) { -- return this.material.getRepairItem() == repair.getItem() ? true : super.getIsRepairable(toRepair, repair); -+ ItemStack mat = this.material.getRepairItemStack(); -+ if (mat != null && net.minecraftforge.oredict.OreDictionary.itemMatches(mat, repair, false)) return true; -+ return super.getIsRepairable(toRepair, repair); +- return this.field_150933_b.func_150995_f() == p_82789_2_.func_77973_b() ? true : super.func_82789_a(p_82789_1_, p_82789_2_); ++ ItemStack mat = this.field_150933_b.getRepairItemStack(); ++ if (mat != null && net.minecraftforge.oredict.OreDictionary.itemMatches(mat, p_82789_2_, false)) return true; ++ return super.func_82789_a(p_82789_1_, p_82789_2_); } - public Multimap getItemAttributeModifiers() + public Multimap func_111205_h() diff --git a/patches/minecraft/net/minecraft/item/ItemTool.java.patch b/patches/minecraft/net/minecraft/item/ItemTool.java.patch index cb9392232..2a0e7450b 100644 --- a/patches/minecraft/net/minecraft/item/ItemTool.java.patch +++ b/patches/minecraft/net/minecraft/item/ItemTool.java.patch @@ -1,9 +1,9 @@ --- ../src-base/minecraft/net/minecraft/item/ItemTool.java +++ ../src-work/minecraft/net/minecraft/item/ItemTool.java @@ -28,6 +28,18 @@ - this.efficiencyOnProperMaterial = material.getEfficiencyOnProperMaterial(); - this.damageVsEntity = attackDamage + material.getDamageVsEntity(); - this.setCreativeTab(CreativeTabs.tabTools); + this.field_77864_a = p_i45333_2_.func_77998_b(); + this.field_77865_bY = p_i45333_1_ + p_i45333_2_.func_78000_c(); + this.func_77637_a(CreativeTabs.field_78040_i); + if (this instanceof ItemPickaxe) + { + toolClass = "pickaxe"; @@ -18,20 +18,20 @@ + } } - public float getStrVsBlock(ItemStack stack, Block block) + public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) @@ -74,7 +86,9 @@ - public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) + public boolean func_82789_a(ItemStack p_82789_1_, ItemStack p_82789_2_) { -- return this.toolMaterial.getRepairItem() == repair.getItem() ? true : super.getIsRepairable(toRepair, repair); -+ ItemStack mat = this.toolMaterial.getRepairItemStack(); -+ if (mat != null && net.minecraftforge.oredict.OreDictionary.itemMatches(mat, repair, false)) return true; -+ return super.getIsRepairable(toRepair, repair); +- return this.field_77862_b.func_150995_f() == p_82789_2_.func_77973_b() ? true : super.func_82789_a(p_82789_1_, p_82789_2_); ++ ItemStack mat = this.field_77862_b.getRepairItemStack(); ++ if (mat != null && net.minecraftforge.oredict.OreDictionary.itemMatches(mat, p_82789_2_, false)) return true; ++ return super.func_82789_a(p_82789_1_, p_82789_2_); } - public Multimap getItemAttributeModifiers() + public Multimap func_111205_h() @@ -83,4 +97,38 @@ - multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(itemModifierUUID, "Tool modifier", (double)this.damageVsEntity, 0)); + multimap.put(SharedMonsterAttributes.field_111264_e.func_111108_a(), new AttributeModifier(field_111210_e, "Tool modifier", (double)this.field_77865_bY, 0)); return multimap; } + @@ -43,7 +43,7 @@ + int level = super.getHarvestLevel(stack, toolClass); + if (level == -1 && toolClass != null && toolClass.equals(this.toolClass)) + { -+ return this.toolMaterial.getHarvestLevel(); ++ return this.field_77862_b.func_77996_d(); + } + else + { @@ -62,8 +62,8 @@ + { + for (String type : getToolClasses(stack)) + { -+ if (state.getBlock().isToolEffective(type, state)) -+ return efficiencyOnProperMaterial; ++ if (state.func_177230_c().isToolEffective(type, state)) ++ return field_77864_a; + } + return super.getDigSpeed(stack, state); + } diff --git a/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch b/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch index 727558622..cd73ea934 100644 --- a/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java.patch @@ -2,19 +2,19 @@ +++ ../src-work/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java @@ -72,6 +72,7 @@ - public void addSmeltingRecipe(ItemStack input, ItemStack stack, float experience) + public void func_151394_a(ItemStack p_151394_1_, ItemStack p_151394_2_, float p_151394_3_) { -+ if (getSmeltingResult(input) != null) { net.minecraftforge.fml.common.FMLLog.info("Ignored smelting recipe with conflicting input: " + input + " = " + stack); return; } - this.smeltingList.put(input, stack); - this.experienceList.put(stack, Float.valueOf(experience)); ++ if (func_151395_a(p_151394_1_) != null) { net.minecraftforge.fml.common.FMLLog.info("Ignored smelting recipe with conflicting input: " + p_151394_1_ + " = " + p_151394_2_); return; } + this.field_77604_b.put(p_151394_1_, p_151394_2_); + this.field_77605_c.put(p_151394_2_, Float.valueOf(p_151394_3_)); } @@ -101,6 +102,9 @@ - public float getSmeltingExperience(ItemStack stack) + public float func_151398_b(ItemStack p_151398_1_) { -+ float ret = stack.getItem().getSmeltingExperience(stack); ++ float ret = p_151398_1_.func_77973_b().getSmeltingExperience(p_151398_1_); + if (ret != -1) return ret; + - for (Entry entry : this.experienceList.entrySet()) + for (Entry entry : this.field_77605_c.entrySet()) { - if (this.compareItemStacks(stack, (ItemStack)entry.getKey())) + if (this.func_151397_a(p_151398_1_, (ItemStack)entry.getKey())) diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipeFireworks.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipeFireworks.java.patch index f35700bf9..4db989adf 100644 --- a/patches/minecraft/net/minecraft/item/crafting/RecipeFireworks.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/RecipeFireworks.java.patch @@ -2,7 +2,7 @@ +++ ../src-work/minecraft/net/minecraft/item/crafting/RecipeFireworks.java @@ -86,9 +86,9 @@ { - this.field_92102_a = new ItemStack(Items.fireworks); + this.field_92102_a = new ItemStack(Items.field_151152_bP); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); if (l > 0) @@ -12,24 +12,24 @@ NBTTagList nbttaglist = new NBTTagList(); @@ -105,9 +105,9 @@ - nbttagcompound3.setTag("Explosions", nbttaglist); - nbttagcompound3.setByte("Flight", (byte)j); - nbttagcompound1.setTag("Fireworks", nbttagcompound3); -- this.field_92102_a.setTagCompound(nbttagcompound1); + nbttagcompound3.func_74782_a("Explosions", nbttaglist); + nbttagcompound3.func_74774_a("Flight", (byte)j); + nbttagcompound1.func_74782_a("Fireworks", nbttagcompound3); +- this.field_92102_a.func_77982_d(nbttagcompound1); } -+ this.field_92102_a.setTagCompound(nbttagcompound1); //Forge BugFix: NPE Protection ++ this.field_92102_a.func_77982_d(nbttagcompound1); //Forge BugFix: NPE Protection return true; } else if (j == 1 && i == 0 && l == 0 && k > 0 && j1 <= 1) @@ -249,11 +249,7 @@ for (int i = 0; i < aitemstack.length; ++i) { - ItemStack itemstack = p_179532_1_.getStackInSlot(i); + ItemStack itemstack = p_179532_1_.func_70301_a(i); - -- if (itemstack != null && itemstack.getItem().hasContainerItem()) +- if (itemstack != null && itemstack.func_77973_b().func_77634_r()) - { -- aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); +- aitemstack[i] = new ItemStack(itemstack.func_77973_b().func_77668_q()); - } + aitemstack[i] = net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack); } diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipeRepairItem.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipeRepairItem.java.patch index cf7479b97..bda702d1b 100644 --- a/patches/minecraft/net/minecraft/item/crafting/RecipeRepairItem.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/RecipeRepairItem.java.patch @@ -4,8 +4,8 @@ { ItemStack itemstack1 = (ItemStack)list.get(0); -- if (itemstack.getItem() != itemstack1.getItem() || itemstack1.stackSize != 1 || itemstack.stackSize != 1 || !itemstack1.getItem().isDamageable()) -+ if (itemstack.getItem() != itemstack1.getItem() || itemstack1.stackSize != 1 || itemstack.stackSize != 1 || !itemstack1.getItem().isRepairable()) +- if (itemstack.func_77973_b() != itemstack1.func_77973_b() || itemstack1.field_77994_a != 1 || itemstack.field_77994_a != 1 || !itemstack1.func_77973_b().func_77645_m()) ++ if (itemstack.func_77973_b() != itemstack1.func_77973_b() || itemstack1.field_77994_a != 1 || itemstack.field_77994_a != 1 || !itemstack1.func_77973_b().isRepairable()) { return false; } @@ -13,8 +13,8 @@ { ItemStack itemstack1 = (ItemStack)list.get(0); -- if (itemstack.getItem() != itemstack1.getItem() || itemstack1.stackSize != 1 || itemstack.stackSize != 1 || !itemstack1.getItem().isDamageable()) -+ if (itemstack.getItem() != itemstack1.getItem() || itemstack1.stackSize != 1 || itemstack.stackSize != 1 || !itemstack1.getItem().isRepairable()) +- if (itemstack.func_77973_b() != itemstack1.func_77973_b() || itemstack1.field_77994_a != 1 || itemstack.field_77994_a != 1 || !itemstack1.func_77973_b().func_77645_m()) ++ if (itemstack.func_77973_b() != itemstack1.func_77973_b() || itemstack1.field_77994_a != 1 || itemstack.field_77994_a != 1 || !itemstack1.func_77973_b().isRepairable()) { return null; } @@ -22,19 +22,19 @@ ItemStack itemstack2 = (ItemStack)list.get(0); ItemStack itemstack3 = (ItemStack)list.get(1); -- if (itemstack2.getItem() == itemstack3.getItem() && itemstack2.stackSize == 1 && itemstack3.stackSize == 1 && itemstack2.getItem().isDamageable()) -+ if (itemstack2.getItem() == itemstack3.getItem() && itemstack2.stackSize == 1 && itemstack3.stackSize == 1 && itemstack2.getItem().isRepairable()) +- if (itemstack2.func_77973_b() == itemstack3.func_77973_b() && itemstack2.field_77994_a == 1 && itemstack3.field_77994_a == 1 && itemstack2.func_77973_b().func_77645_m()) ++ if (itemstack2.func_77973_b() == itemstack3.func_77973_b() && itemstack2.field_77994_a == 1 && itemstack3.field_77994_a == 1 && itemstack2.func_77973_b().isRepairable()) { - Item item = itemstack2.getItem(); - int j = item.getMaxDamage() - itemstack2.getItemDamage(); + Item item = itemstack2.func_77973_b(); + int j = item.func_77612_l() - itemstack2.func_77952_i(); @@ -102,11 +102,7 @@ for (int i = 0; i < aitemstack.length; ++i) { - ItemStack itemstack = p_179532_1_.getStackInSlot(i); + ItemStack itemstack = p_179532_1_.func_70301_a(i); - -- if (itemstack != null && itemstack.getItem().hasContainerItem()) +- if (itemstack != null && itemstack.func_77973_b().func_77634_r()) - { -- aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); +- aitemstack[i] = new ItemStack(itemstack.func_77973_b().func_77668_q()); - } + aitemstack[i] = net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack); } diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipesArmorDyes.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipesArmorDyes.java.patch index 24a99a368..15ed231ae 100644 --- a/patches/minecraft/net/minecraft/item/crafting/RecipesArmorDyes.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/RecipesArmorDyes.java.patch @@ -3,11 +3,11 @@ @@ -146,11 +146,7 @@ for (int i = 0; i < aitemstack.length; ++i) { - ItemStack itemstack = p_179532_1_.getStackInSlot(i); + ItemStack itemstack = p_179532_1_.func_70301_a(i); - -- if (itemstack != null && itemstack.getItem().hasContainerItem()) +- if (itemstack != null && itemstack.func_77973_b().func_77634_r()) - { -- aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); +- aitemstack[i] = new ItemStack(itemstack.func_77973_b().func_77668_q()); - } + aitemstack[i] = net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack); } diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipesBanners.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipesBanners.java.patch index 90f95d3d2..bddf21f35 100644 --- a/patches/minecraft/net/minecraft/item/crafting/RecipesBanners.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/RecipesBanners.java.patch @@ -3,11 +3,11 @@ @@ -135,11 +135,7 @@ for (int i = 0; i < aitemstack.length; ++i) { - ItemStack itemstack = p_179532_1_.getStackInSlot(i); + ItemStack itemstack = p_179532_1_.func_70301_a(i); - -- if (itemstack != null && itemstack.getItem().hasContainerItem()) +- if (itemstack != null && itemstack.func_77973_b().func_77634_r()) - { -- aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); +- aitemstack[i] = new ItemStack(itemstack.func_77973_b().func_77668_q()); - } + aitemstack[i] = net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack); } @@ -17,11 +17,11 @@ if (itemstack != null) { -- if (itemstack.getItem().hasContainerItem()) -+ if (itemstack.getItem().hasContainerItem(itemstack)) +- if (itemstack.func_77973_b().func_77634_r()) ++ if (itemstack.func_77973_b().hasContainerItem(itemstack)) { -- aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); +- aitemstack[i] = new ItemStack(itemstack.func_77973_b().func_77668_q()); + aitemstack[i] = net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack); } - else if (itemstack.hasTagCompound() && TileEntityBanner.getPatterns(itemstack) > 0) + else if (itemstack.func_77942_o() && TileEntityBanner.func_175113_c(itemstack) > 0) { diff --git a/patches/minecraft/net/minecraft/item/crafting/RecipesMapCloning.java.patch b/patches/minecraft/net/minecraft/item/crafting/RecipesMapCloning.java.patch index ea8e4e664..b67dc5759 100644 --- a/patches/minecraft/net/minecraft/item/crafting/RecipesMapCloning.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/RecipesMapCloning.java.patch @@ -3,11 +3,11 @@ @@ -108,11 +108,7 @@ for (int i = 0; i < aitemstack.length; ++i) { - ItemStack itemstack = p_179532_1_.getStackInSlot(i); + ItemStack itemstack = p_179532_1_.func_70301_a(i); - -- if (itemstack != null && itemstack.getItem().hasContainerItem()) +- if (itemstack != null && itemstack.func_77973_b().func_77634_r()) - { -- aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); +- aitemstack[i] = new ItemStack(itemstack.func_77973_b().func_77668_q()); - } + aitemstack[i] = net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack); } diff --git a/patches/minecraft/net/minecraft/item/crafting/ShapedRecipes.java.patch b/patches/minecraft/net/minecraft/item/crafting/ShapedRecipes.java.patch index 601a4a1cb..1db66a297 100644 --- a/patches/minecraft/net/minecraft/item/crafting/ShapedRecipes.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/ShapedRecipes.java.patch @@ -3,11 +3,11 @@ @@ -33,11 +33,7 @@ for (int i = 0; i < aitemstack.length; ++i) { - ItemStack itemstack = p_179532_1_.getStackInSlot(i); + ItemStack itemstack = p_179532_1_.func_70301_a(i); - -- if (itemstack != null && itemstack.getItem().hasContainerItem()) +- if (itemstack != null && itemstack.func_77973_b().func_77634_r()) - { -- aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); +- aitemstack[i] = new ItemStack(itemstack.func_77973_b().func_77668_q()); - } + aitemstack[i] = net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack); } diff --git a/patches/minecraft/net/minecraft/item/crafting/ShapelessRecipes.java.patch b/patches/minecraft/net/minecraft/item/crafting/ShapelessRecipes.java.patch index 640ed7648..e2155f198 100644 --- a/patches/minecraft/net/minecraft/item/crafting/ShapelessRecipes.java.patch +++ b/patches/minecraft/net/minecraft/item/crafting/ShapelessRecipes.java.patch @@ -3,11 +3,11 @@ @@ -29,11 +29,7 @@ for (int i = 0; i < aitemstack.length; ++i) { - ItemStack itemstack = p_179532_1_.getStackInSlot(i); + ItemStack itemstack = p_179532_1_.func_70301_a(i); - -- if (itemstack != null && itemstack.getItem().hasContainerItem()) +- if (itemstack != null && itemstack.func_77973_b().func_77634_r()) - { -- aitemstack[i] = new ItemStack(itemstack.getItem().getContainerItem()); +- aitemstack[i] = new ItemStack(itemstack.func_77973_b().func_77668_q()); - } + aitemstack[i] = net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack); } diff --git a/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch b/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch index 76f2e6739..400efd0fd 100644 --- a/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch +++ b/patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch @@ -14,14 +14,14 @@ } - @SideOnly(Side.CLIENT) - public static void safeWrite(NBTTagCompound p_74793_0_, File p_74793_1_) throws IOException + public static void func_74793_a(NBTTagCompound p_74793_0_, File p_74793_1_) throws IOException { File file1 = new File(p_74793_1_.getAbsolutePath() + "_tmp"); @@ -118,6 +115,7 @@ private static NBTBase func_152455_a(DataInput p_152455_0_, int p_152455_1_, NBTSizeTracker p_152455_2_) throws IOException { byte b0 = p_152455_0_.readByte(); -+ p_152455_2_.read(8); // Forge: Count everything! ++ p_152455_2_.func_152450_a(8); // Forge: Count everything! if (b0 == 0) { @@ -31,8 +31,8 @@ { - p_152455_0_.readUTF(); + NBTSizeTracker.readUTF(p_152455_2_, p_152455_0_.readUTF()); //Forge: Count this string. -+ p_152455_2_.read(32); //Forge: 4 extra bytes for the object allocation. - NBTBase nbtbase = NBTBase.createNewByType(b0); ++ p_152455_2_.func_152450_a(32); //Forge: 4 extra bytes for the object allocation. + NBTBase nbtbase = NBTBase.func_150284_a(b0); try @@ -144,7 +143,6 @@ @@ -40,7 +40,7 @@ } - @SideOnly(Side.CLIENT) - public static void write(NBTTagCompound p_74795_0_, File p_74795_1_) throws IOException + public static void func_74795_b(NBTTagCompound p_74795_0_, File p_74795_1_) throws IOException { DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(p_74795_1_)); @@ -159,7 +157,6 @@ @@ -48,6 +48,6 @@ } - @SideOnly(Side.CLIENT) - public static NBTTagCompound read(File p_74797_0_) throws IOException + public static NBTTagCompound func_74797_a(File p_74797_0_) throws IOException { if (!p_74797_0_.exists()) diff --git a/patches/minecraft/net/minecraft/nbt/NBTSizeTracker.java.patch b/patches/minecraft/net/minecraft/nbt/NBTSizeTracker.java.patch index 078cb5b16..c7720b745 100644 --- a/patches/minecraft/net/minecraft/nbt/NBTSizeTracker.java.patch +++ b/patches/minecraft/net/minecraft/nbt/NBTSizeTracker.java.patch @@ -1,7 +1,7 @@ --- ../src-base/minecraft/net/minecraft/nbt/NBTSizeTracker.java +++ ../src-work/minecraft/net/minecraft/nbt/NBTSizeTracker.java @@ -25,4 +25,34 @@ - throw new RuntimeException("Tried to read NBT tag that was too big; tried to allocate: " + this.read + "bytes where max allowed: " + this.max); + throw new RuntimeException("Tried to read NBT tag that was too big; tried to allocate: " + this.field_152453_c + "bytes where max allowed: " + this.field_152452_b); } } + @@ -18,7 +18,7 @@ + */ + public static void readUTF(NBTSizeTracker tracker, String data) + { -+ tracker.read(16); //Header length ++ tracker.func_152450_a(16); //Header length + if (data == null) + return; + @@ -32,6 +32,6 @@ + else if (c > 0x07FF) utflen += 3; + else utflen += 2; + } -+ tracker.read(8 * utflen); ++ tracker.func_152450_a(8 * utflen); + } } diff --git a/patches/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch b/patches/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch index a5014d15a..8a494fdfb 100644 --- a/patches/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch +++ b/patches/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch @@ -2,17 +2,17 @@ +++ ../src-work/minecraft/net/minecraft/nbt/NBTTagCompound.java @@ -395,6 +395,7 @@ - private static byte readType(DataInput input, NBTSizeTracker sizeTracker) throws IOException + private static byte func_152447_a(DataInput p_152447_0_, NBTSizeTracker p_152447_1_) throws IOException { -+ sizeTracker.read(8); - return input.readByte(); ++ p_152447_1_.func_152450_a(8); + return p_152447_0_.readByte(); } @@ -405,6 +406,7 @@ - static NBTBase readNBT(byte id, String key, DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + static NBTBase func_152449_a(byte p_152449_0_, String p_152449_1_, DataInput p_152449_2_, int p_152449_3_, NBTSizeTracker p_152449_4_) throws IOException { -+ sizeTracker.read(32); //Forge: 4 extra bytes for the object allocation. - NBTBase nbtbase = NBTBase.createNewByType(id); ++ p_152449_4_.func_152450_a(32); //Forge: 4 extra bytes for the object allocation. + NBTBase nbtbase = NBTBase.func_150284_a(p_152449_0_); try diff --git a/patches/minecraft/net/minecraft/nbt/NBTTagString.java.patch b/patches/minecraft/net/minecraft/nbt/NBTTagString.java.patch index c8ca6ca1a..178a0151b 100644 --- a/patches/minecraft/net/minecraft/nbt/NBTTagString.java.patch +++ b/patches/minecraft/net/minecraft/nbt/NBTTagString.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/nbt/NBTTagString.java @@ -32,7 +32,7 @@ { - sizeTracker.read(288L); - this.data = input.readUTF(); -- sizeTracker.read((long)(16 * this.data.length())); -+ NBTSizeTracker.readUTF(sizeTracker, data); // Forge: Correctly read String length including header. + p_152446_3_.func_152450_a(288L); + this.field_74751_a = p_152446_1_.readUTF(); +- p_152446_3_.func_152450_a((long)(16 * this.field_74751_a.length())); ++ NBTSizeTracker.readUTF(p_152446_3_, field_74751_a); // Forge: Correctly read String length including header. } - public byte getId() + public byte func_74732_a() diff --git a/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch b/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch index dbd27862d..111358910 100644 --- a/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch +++ b/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch @@ -1,56 +1,56 @@ --- ../src-base/minecraft/net/minecraft/network/NetHandlerPlayServer.java +++ ../src-work/minecraft/net/minecraft/network/NetHandlerPlayServer.java @@ -254,6 +254,8 @@ - this.playerEntity.ridingEntity.updateRiderPosition(); + this.field_147369_b.field_70154_o.func_70043_V(); } -+ if (!this.hasMoved) return; //Fixes teleportation kick while riding entities ++ if (!this.field_147380_r) return; //Fixes teleportation kick while riding entities + - this.serverController.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); + this.field_147367_d.func_71203_ab().func_72358_d(this.field_147369_b); - if (this.playerEntity.ridingEntity != null) + if (this.field_147369_b.field_70154_o != null) @@ -350,6 +352,8 @@ - this.playerEntity.jump(); + this.field_147369_b.func_70664_aZ(); } -+ if (!this.hasMoved) return; //Fixes "Moved Too Fast" kick when being teleported while moving ++ if (!this.field_147380_r) return; //Fixes "Moved Too Fast" kick when being teleported while moving + - this.playerEntity.moveEntity(d11, d12, d13); - this.playerEntity.onGround = packetIn.isOnGround(); - d11 = d8 - this.playerEntity.posX; + this.field_147369_b.func_70091_d(d11, d12, d13); + this.field_147369_b.field_70122_E = p_147347_1_.func_149465_i(); + d11 = d8 - this.field_147369_b.field_70165_t; @@ -370,6 +374,8 @@ - logger.warn(this.playerEntity.getName() + " moved wrongly!"); + field_147370_c.warn(this.field_147369_b.func_70005_c_() + " moved wrongly!"); } -+ if (!this.hasMoved) return; //Fixes "Moved Too Fast" kick when being teleported while moving ++ if (!this.field_147380_r) return; //Fixes "Moved Too Fast" kick when being teleported while moving + - this.playerEntity.setPositionAndRotation(d8, d9, d10, f1, f2); - this.playerEntity.addMovementStat(this.playerEntity.posX - d0, this.playerEntity.posY - d1, this.playerEntity.posZ - d2); + this.field_147369_b.func_70080_a(d8, d9, d10, f1, f2); + this.field_147369_b.func_71000_j(this.field_147369_b.field_70165_t - d0, this.field_147369_b.field_70163_u - d1, this.field_147369_b.field_70161_v - d2); @@ -377,7 +383,7 @@ { - boolean flag2 = worldserver.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.getEntityBoundingBox().contract((double)f3, (double)f3, (double)f3)).isEmpty(); + boolean flag2 = worldserver.func_72945_a(this.field_147369_b, this.field_147369_b.func_174813_aQ().func_72331_e((double)f3, (double)f3, (double)f3)).isEmpty(); -- if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping()) -+ if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.noClip) +- if (flag && (flag1 || !flag2) && !this.field_147369_b.func_70608_bn()) ++ if (flag && (flag1 || !flag2) && !this.field_147369_b.func_70608_bn() && !this.field_147369_b.field_70145_X) { - this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, f1, f2); + this.func_147364_a(this.field_147373_o, this.field_147382_p, this.field_147381_q, f1, f2); return; @@ -405,6 +411,8 @@ - this.floatingTickCount = 0; + this.field_147365_f = 0; } -+ if (!this.hasMoved) return; //Fixes "Moved Too Fast" kick when being teleported while moving ++ if (!this.field_147380_r) return; //Fixes "Moved Too Fast" kick when being teleported while moving + - this.playerEntity.onGround = packetIn.isOnGround(); - this.serverController.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); - this.playerEntity.handleFalling(this.playerEntity.posY - d7, packetIn.isOnGround()); + this.field_147369_b.field_70122_E = p_147347_1_.func_149465_i(); + this.field_147367_d.func_71203_ab().func_72358_d(this.field_147369_b); + this.field_147369_b.func_71122_b(this.field_147369_b.field_70163_u - d7, p_147347_1_.func_149465_i()); @@ -497,7 +505,10 @@ - double d2 = this.playerEntity.posZ - ((double)blockpos.getZ() + 0.5D); + double d2 = this.field_147369_b.field_70161_v - ((double)blockpos.func_177952_p() + 0.5D); double d3 = d0 * d0 + d1 * d1 + d2 * d2; - if (d3 > 36.0D) -+ double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 1; ++ double dist = field_147369_b.field_71134_c.getBlockReachDistance() + 1; + dist *= dist; + + if (d3 > dist) @@ -58,64 +58,64 @@ return; } @@ -549,6 +560,7 @@ - WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); - ItemStack itemstack = this.playerEntity.inventory.getCurrentItem(); + WorldServer worldserver = this.field_147367_d.func_71218_a(this.field_147369_b.field_71093_bK); + ItemStack itemstack = this.field_147369_b.field_71071_by.func_70448_g(); boolean flag = false; + boolean placeResult = true; - BlockPos blockpos = packetIn.getPosition(); - EnumFacing enumfacing = EnumFacing.getFront(packetIn.getPlacedBlockDirection()); - this.playerEntity.markPlayerActive(); + BlockPos blockpos = p_147346_1_.func_179724_a(); + EnumFacing enumfacing = EnumFacing.func_82600_a(p_147346_1_.func_149568_f()); + this.field_147369_b.func_143004_u(); @@ -560,13 +572,20 @@ return; } -+ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(playerEntity, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR, worldserver, new BlockPos(0, 0, 0), null); ++ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_147369_b, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR, worldserver, new BlockPos(0, 0, 0), null); + if (event.useItem != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) + { - this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, worldserver, itemstack); + this.field_147369_b.field_71134_c.func_73085_a(this.field_147369_b, worldserver, itemstack); + } } - else if (blockpos.getY() < this.serverController.getBuildLimit() - 1 || enumfacing != EnumFacing.UP && blockpos.getY() < this.serverController.getBuildLimit()) + else if (blockpos.func_177956_o() < this.field_147367_d.func_71207_Z() - 1 || enumfacing != EnumFacing.UP && blockpos.func_177956_o() < this.field_147367_d.func_71207_Z()) { -- if (this.hasMoved && this.playerEntity.getDistanceSq((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D) < 64.0D && !this.serverController.isBlockProtected(worldserver, blockpos, this.playerEntity) && worldserver.getWorldBorder().contains(blockpos)) -+ double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 3; +- if (this.field_147380_r && this.field_147369_b.func_70092_e((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.5D, (double)blockpos.func_177952_p() + 0.5D) < 64.0D && !this.field_147367_d.func_175579_a(worldserver, blockpos, this.field_147369_b) && worldserver.func_175723_af().func_177746_a(blockpos)) ++ double dist = field_147369_b.field_71134_c.getBlockReachDistance() + 3; + dist *= dist; -+ if (this.hasMoved && this.playerEntity.getDistanceSq((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D) < dist && !this.serverController.isBlockProtected(worldserver, blockpos, this.playerEntity) && worldserver.getWorldBorder().contains(blockpos)) ++ if (this.field_147380_r && this.field_147369_b.func_70092_e((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.5D, (double)blockpos.func_177952_p() + 0.5D) < dist && !this.field_147367_d.func_175579_a(worldserver, blockpos, this.field_147369_b) && worldserver.func_175723_af().func_177746_a(blockpos)) { -- this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, blockpos, enumfacing, packetIn.getPlacedBlockOffsetX(), packetIn.getPlacedBlockOffsetY(), packetIn.getPlacedBlockOffsetZ()); +- this.field_147369_b.field_71134_c.func_180236_a(this.field_147369_b, worldserver, itemstack, blockpos, enumfacing, p_147346_1_.func_149573_h(), p_147346_1_.func_149569_i(), p_147346_1_.func_149575_j()); + // record block place result so we can update client itemstack size if place event was cancelled. -+ placeResult = this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, blockpos, enumfacing, packetIn.getPlacedBlockOffsetX(), packetIn.getPlacedBlockOffsetY(), packetIn.getPlacedBlockOffsetZ()); ++ placeResult = this.field_147369_b.field_71134_c.func_180236_a(this.field_147369_b, worldserver, itemstack, blockpos, enumfacing, p_147346_1_.func_149573_h(), p_147346_1_.func_149569_i(), p_147346_1_.func_149575_j()); } flag = true; @@ -601,7 +620,7 @@ - this.playerEntity.openContainer.detectAndSendChanges(); - this.playerEntity.isChangingQuantityOnly = false; + this.field_147369_b.field_71070_bA.func_75142_b(); + this.field_147369_b.field_71137_h = false; -- if (!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), packetIn.getStack())) -+ if (!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), packetIn.getStack()) || !placeResult) // force client itemstack update if place event was cancelled +- if (!ItemStack.func_77989_b(this.field_147369_b.field_71071_by.func_70448_g(), p_147346_1_.func_149574_g())) ++ if (!ItemStack.func_77989_b(this.field_147369_b.field_71071_by.func_70448_g(), p_147346_1_.func_149574_g()) || !placeResult) // force client itemstack update if place event was cancelled { - this.sendPacket(new S2FPacketSetSlot(this.playerEntity.openContainer.windowId, slot.slotNumber, this.playerEntity.inventory.getCurrentItem())); + this.func_147359_a(new S2FPacketSetSlot(this.field_147369_b.field_71070_bA.field_75152_c, slot.field_75222_d, this.field_147369_b.field_71071_by.func_70448_g())); } @@ -770,8 +789,10 @@ } else { -- IChatComponent ichatcomponent = new ChatComponentTranslation("chat.type.text", new Object[] {this.playerEntity.getDisplayName(), s}); -- this.serverController.getConfigurationManager().sendChatMsgImpl(ichatcomponent, false); -+ ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", this.playerEntity.getDisplayName(), net.minecraftforge.common.ForgeHooks.newChatWithLinks(s)); +- IChatComponent ichatcomponent = new ChatComponentTranslation("chat.type.text", new Object[] {this.field_147369_b.func_145748_c_(), s}); +- this.field_147367_d.func_71203_ab().func_148544_a(ichatcomponent, false); ++ ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", this.field_147369_b.func_145748_c_(), net.minecraftforge.common.ForgeHooks.newChatWithLinks(s)); + IChatComponent chat = net.minecraftforge.common.ForgeHooks.onServerChatEvent(this, s, chatcomponenttranslation1); + if (chat == null) return; -+ this.serverController.getConfigurationManager().sendChatMsgImpl(chat, false); ++ this.field_147367_d.func_71203_ab().func_148544_a(chat, false); } - this.chatSpamThresholdCount += 20; + this.field_147374_l += 20; @@ -916,7 +937,7 @@ return; } -- this.playerEntity = this.serverController.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, false); -+ this.playerEntity = this.serverController.getConfigurationManager().recreatePlayerEntity(this.playerEntity, playerEntity.dimension, false); +- this.field_147369_b = this.field_147367_d.func_71203_ab().func_72368_a(this.field_147369_b, 0, false); ++ this.field_147369_b = this.field_147367_d.func_71203_ab().func_72368_a(this.field_147369_b, field_147369_b.field_71093_bK, false); } break; diff --git a/patches/minecraft/net/minecraft/network/NetworkManager.java.patch b/patches/minecraft/net/minecraft/network/NetworkManager.java.patch index 6578510e0..d86528608 100644 --- a/patches/minecraft/net/minecraft/network/NetworkManager.java.patch +++ b/patches/minecraft/net/minecraft/network/NetworkManager.java.patch @@ -1,43 +1,43 @@ --- ../src-base/minecraft/net/minecraft/network/NetworkManager.java +++ ../src-work/minecraft/net/minecraft/network/NetworkManager.java @@ -93,6 +93,11 @@ - this.direction = packetDirection; + this.field_179294_g = p_i46004_1_; } + public EnumPacketDirection getDirection() + { -+ return this.direction; ++ return this.field_179294_g; + } + public void channelActive(ChannelHandlerContext p_channelActive_1_) throws Exception { super.channelActive(p_channelActive_1_); @@ -208,7 +213,7 @@ - final EnumConnectionState enumconnectionstate = EnumConnectionState.getFromPacket(inPacket); - final EnumConnectionState enumconnectionstate1 = (EnumConnectionState)this.channel.attr(attrKeyConnectionState).get(); + final EnumConnectionState enumconnectionstate = EnumConnectionState.func_150752_a(p_150732_1_); + final EnumConnectionState enumconnectionstate1 = (EnumConnectionState)this.field_150746_k.attr(field_150739_c).get(); - if (enumconnectionstate1 != enumconnectionstate) -+ if (enumconnectionstate1 != enumconnectionstate && !( inPacket instanceof net.minecraftforge.fml.common.network.internal.FMLProxyPacket)) ++ if (enumconnectionstate1 != enumconnectionstate && !( p_150732_1_ instanceof net.minecraftforge.fml.common.network.internal.FMLProxyPacket)) { - logger.debug("Disabled auto read"); - this.channel.config().setAutoRead(false); + field_150735_g.debug("Disabled auto read"); + this.field_150746_k.config().setAutoRead(false); @@ -216,7 +221,7 @@ - if (this.channel.eventLoop().inEventLoop()) + if (this.field_150746_k.eventLoop().inEventLoop()) { - if (enumconnectionstate != enumconnectionstate1) -+ if (enumconnectionstate != enumconnectionstate1 && !( inPacket instanceof net.minecraftforge.fml.common.network.internal.FMLProxyPacket)) ++ if (enumconnectionstate != enumconnectionstate1 && !( p_150732_1_ instanceof net.minecraftforge.fml.common.network.internal.FMLProxyPacket)) { - this.setConnectionState(enumconnectionstate); + this.func_150723_a(enumconnectionstate); } @@ -236,7 +241,7 @@ { public void run() { - if (enumconnectionstate != enumconnectionstate1) -+ if (enumconnectionstate != enumconnectionstate1 && !( inPacket instanceof net.minecraftforge.fml.common.network.internal.FMLProxyPacket)) ++ if (enumconnectionstate != enumconnectionstate1 && !( p_150732_1_ instanceof net.minecraftforge.fml.common.network.internal.FMLProxyPacket)) { - NetworkManager.this.setConnectionState(enumconnectionstate); + NetworkManager.this.func_150723_a(enumconnectionstate); } @@ -455,6 +460,11 @@ } @@ -45,9 +45,9 @@ + public Channel channel() + { -+ return channel; ++ return field_150746_k; + } + static class InboundHandlerTuplePacketListener { - private final Packet packet; + private final Packet field_150774_a; diff --git a/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch b/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch index 218327728..e31f320e9 100644 --- a/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch +++ b/patches/minecraft/net/minecraft/network/NetworkSystem.java.patch @@ -7,5 +7,5 @@ - p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(30))).addLast((String)"legacy_query", (ChannelHandler)(new PingResponseHandler(NetworkSystem.this))).addLast((String)"splitter", (ChannelHandler)(new MessageDeserializer2())).addLast((String)"decoder", (ChannelHandler)(new MessageDeserializer(EnumPacketDirection.SERVERBOUND))).addLast((String)"prepender", (ChannelHandler)(new MessageSerializer2())).addLast((String)"encoder", (ChannelHandler)(new MessageSerializer(EnumPacketDirection.CLIENTBOUND))); + p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.READ_TIMEOUT))).addLast((String)"legacy_query", (ChannelHandler)(new PingResponseHandler(NetworkSystem.this))).addLast((String)"splitter", (ChannelHandler)(new MessageDeserializer2())).addLast((String)"decoder", (ChannelHandler)(new MessageDeserializer(EnumPacketDirection.SERVERBOUND))).addLast((String)"prepender", (ChannelHandler)(new MessageSerializer2())).addLast((String)"encoder", (ChannelHandler)(new MessageSerializer(EnumPacketDirection.CLIENTBOUND))); NetworkManager networkmanager = new NetworkManager(EnumPacketDirection.SERVERBOUND); - NetworkSystem.this.networkManagers.add(networkmanager); + NetworkSystem.this.field_151272_f.add(networkmanager); p_initChannel_1_.pipeline().addLast((String)"packet_handler", (ChannelHandler)networkmanager); diff --git a/patches/minecraft/net/minecraft/network/ServerStatusResponse.java.patch b/patches/minecraft/net/minecraft/network/ServerStatusResponse.java.patch index 4b12b60e0..856c5c869 100644 --- a/patches/minecraft/net/minecraft/network/ServerStatusResponse.java.patch +++ b/patches/minecraft/net/minecraft/network/ServerStatusResponse.java.patch @@ -1,37 +1,37 @@ --- ../src-base/minecraft/net/minecraft/network/ServerStatusResponse.java +++ ../src-work/minecraft/net/minecraft/network/ServerStatusResponse.java @@ -29,6 +29,7 @@ - public void setServerDescription(IChatComponent motd) + public void func_151315_a(IChatComponent p_151315_1_) { - this.serverMotd = motd; + this.field_151326_a = p_151315_1_; + invalidateJson(); } - public ServerStatusResponse.PlayerCountData getPlayerCountData() + public ServerStatusResponse.PlayerCountData func_151318_b() @@ -39,6 +40,7 @@ - public void setPlayerCountData(ServerStatusResponse.PlayerCountData countData) + public void func_151319_a(ServerStatusResponse.PlayerCountData p_151319_1_) { - this.playerCount = countData; + this.field_151324_b = p_151319_1_; + invalidateJson(); } - public ServerStatusResponse.MinecraftProtocolVersionIdentifier getProtocolVersionInfo() + public ServerStatusResponse.MinecraftProtocolVersionIdentifier func_151322_c() @@ -49,11 +51,13 @@ - public void setProtocolVersionInfo(ServerStatusResponse.MinecraftProtocolVersionIdentifier protocolVersionData) + public void func_151321_a(ServerStatusResponse.MinecraftProtocolVersionIdentifier p_151321_1_) { - this.protocolVersion = protocolVersionData; + this.field_151325_c = p_151321_1_; + invalidateJson(); } - public void setFavicon(String faviconBlob) + public void func_151320_a(String p_151320_1_) { - this.favicon = faviconBlob; + this.field_151323_d = p_151320_1_; + invalidateJson(); } - public String getFavicon() + public String func_151316_d() @@ -215,6 +219,7 @@ - serverstatusresponse.setFavicon(JsonUtils.getJsonObjectStringFieldValue(jsonobject, "favicon")); + serverstatusresponse.func_151320_a(JsonUtils.func_151200_h(jsonobject, "favicon")); } + net.minecraftforge.fml.client.FMLClientHandler.instance().captureAdditionalData(serverstatusresponse, jsonobject); @@ -39,7 +39,7 @@ } @@ -242,7 +247,47 @@ - jsonobject.addProperty("favicon", p_serialize_1_.getFavicon()); + jsonobject.addProperty("favicon", p_serialize_1_.func_151316_d()); } + net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.enhanceStatusQuery(jsonobject); @@ -69,7 +69,7 @@ + ret = this.json; + if (ret == null) + { -+ ret = net.minecraft.network.status.server.S00PacketServerInfo.GSON.toJson(this); ++ ret = net.minecraft.network.status.server.S00PacketServerInfo.field_149297_a.toJson(this); + this.json = ret; + } + mutex.release(); diff --git a/patches/minecraft/net/minecraft/network/handshake/client/C00Handshake.java.patch b/patches/minecraft/net/minecraft/network/handshake/client/C00Handshake.java.patch index dbeee89f6..4e936ed70 100644 --- a/patches/minecraft/net/minecraft/network/handshake/client/C00Handshake.java.patch +++ b/patches/minecraft/net/minecraft/network/handshake/client/C00Handshake.java.patch @@ -1,15 +1,15 @@ --- ../src-base/minecraft/net/minecraft/network/handshake/client/C00Handshake.java +++ ../src-work/minecraft/net/minecraft/network/handshake/client/C00Handshake.java @@ -14,6 +14,7 @@ - private String ip; - private int port; - private EnumConnectionState requestedState; + private String field_149598_b; + private int field_149599_c; + private EnumConnectionState field_149597_d; + private boolean hasFMLMarker = false; public C00Handshake() { @@ -28,18 +29,26 @@ - this.requestedState = requestedState; + this.field_149597_d = p_i45266_4_; } + public C00Handshake(int protocol, String address, int port, EnumConnectionState state, boolean addFMLMarker) @@ -18,27 +18,27 @@ + this.hasFMLMarker = addFMLMarker; + } + - public void readPacketData(PacketBuffer buf) throws IOException + public void func_148837_a(PacketBuffer p_148837_1_) throws IOException { - this.protocolVersion = buf.readVarIntFromBuffer(); - this.ip = buf.readStringFromBuffer(255); - this.port = buf.readUnsignedShort(); - this.requestedState = EnumConnectionState.getById(buf.readVarIntFromBuffer()); -+ this.hasFMLMarker = this.ip.contains("\0FML\0"); -+ this.ip = this.ip.split("\0")[0]; + this.field_149600_a = p_148837_1_.func_150792_a(); + this.field_149598_b = p_148837_1_.func_150789_c(255); + this.field_149599_c = p_148837_1_.readUnsignedShort(); + this.field_149597_d = EnumConnectionState.func_150760_a(p_148837_1_.func_150792_a()); ++ this.hasFMLMarker = this.field_149598_b.contains("\0FML\0"); ++ this.field_149598_b = this.field_149598_b.split("\0")[0]; } - public void writePacketData(PacketBuffer buf) throws IOException + public void func_148840_b(PacketBuffer p_148840_1_) throws IOException { - buf.writeVarIntToBuffer(this.protocolVersion); -- buf.writeString(this.ip); -+ buf.writeString(this.ip + "\0FML\0"); - buf.writeShort(this.port); - buf.writeVarIntToBuffer(this.requestedState.getId()); + p_148840_1_.func_150787_b(this.field_149600_a); +- p_148840_1_.func_180714_a(this.field_149598_b); ++ p_148840_1_.func_180714_a(this.field_149598_b + "\0FML\0"); + p_148840_1_.writeShort(this.field_149599_c); + p_148840_1_.func_150787_b(this.field_149597_d.func_150759_c()); } @@ -58,4 +67,9 @@ { - return this.protocolVersion; + return this.field_149600_a; } + + public boolean hasFMLMarker() diff --git a/patches/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch b/patches/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch index 331306c78..1345ee125 100644 --- a/patches/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch +++ b/patches/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch @@ -1,14 +1,14 @@ --- ../src-base/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java +++ ../src-work/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java @@ -47,7 +47,11 @@ - public void writePacketData(PacketBuffer buf) throws IOException + public void func_148840_b(PacketBuffer p_148840_1_) throws IOException { - buf.writeString(this.channel); -+ synchronized(this.data) { //This may be access multiple times, from multiple threads, lets be safe. -+ this.data.markReaderIndex(); - buf.writeBytes((ByteBuf)this.data); -+ this.data.resetReaderIndex(); + p_148840_1_.func_180714_a(this.field_149562_a); ++ synchronized(this.field_149561_c) { //This may be access multiple times, from multiple threads, lets be safe. ++ this.field_149561_c.markReaderIndex(); + p_148840_1_.writeBytes((ByteBuf)this.field_149561_c); ++ this.field_149561_c.resetReaderIndex(); + } } - public void processPacket(INetHandlerPlayServer handler) + public void func_148833_a(INetHandlerPlayServer p_148833_1_) diff --git a/patches/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch b/patches/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch index 8218d2cac..9604b555a 100644 --- a/patches/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch +++ b/patches/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch @@ -1,14 +1,14 @@ --- ../src-base/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java +++ ../src-work/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java @@ -46,7 +46,11 @@ - public void writePacketData(PacketBuffer buf) throws IOException + public void func_148840_b(PacketBuffer p_148840_1_) throws IOException { - buf.writeString(this.channel); -+ synchronized(this.data) { //This may be access multiple times, from multiple threads, lets be safe. -+ this.data.markReaderIndex(); - buf.writeBytes((ByteBuf)this.data); -+ this.data.resetReaderIndex(); + p_148840_1_.func_180714_a(this.field_149172_a); ++ synchronized(this.field_149171_b) { //This may be access multiple times, from multiple threads, lets be safe. ++ this.field_149171_b.markReaderIndex(); + p_148840_1_.writeBytes((ByteBuf)this.field_149171_b); ++ this.field_149171_b.resetReaderIndex(); + } } - public void processPacket(INetHandlerPlayClient handler) + public void func_148833_a(INetHandlerPlayClient p_148833_1_) diff --git a/patches/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java.patch b/patches/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java.patch index 086221d57..6e9d12a15 100644 --- a/patches/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java.patch +++ b/patches/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java @@ -34,7 +34,7 @@ - public void writePacketData(PacketBuffer buf) throws IOException + public void func_148840_b(PacketBuffer p_148840_1_) throws IOException { -- buf.writeString(GSON.toJson((Object)this.response)); -+ buf.writeString(this.response.getJson()); +- p_148840_1_.func_180714_a(field_149297_a.toJson((Object)this.field_149296_b)); ++ p_148840_1_.func_180714_a(this.field_149296_b.getJson()); } - public void processPacket(INetHandlerStatusClient handler) + public void func_148833_a(INetHandlerStatusClient p_148833_1_) diff --git a/patches/minecraft/net/minecraft/potion/Potion.java.patch b/patches/minecraft/net/minecraft/potion/Potion.java.patch index 0e3c45bb3..8b374f8a0 100644 --- a/patches/minecraft/net/minecraft/potion/Potion.java.patch +++ b/patches/minecraft/net/minecraft/potion/Potion.java.patch @@ -2,7 +2,7 @@ +++ ../src-work/minecraft/net/minecraft/potion/Potion.java @@ -310,4 +310,27 @@ { - return p_111183_2_.getAmount() * (double)(p_111183_1_ + 1); + return p_111183_2_.func_111164_d() * (double)(p_111183_1_ + 1); } + + /* ======================================== FORGE START =====================================*/ diff --git a/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch b/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch index 913aaeb06..6a272c37b 100644 --- a/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch +++ b/patches/minecraft/net/minecraft/potion/PotionEffect.java.patch @@ -2,42 +2,42 @@ +++ ../src-work/minecraft/net/minecraft/potion/PotionEffect.java @@ -18,6 +18,8 @@ @SideOnly(Side.CLIENT) - private boolean isPotionDurationMax; - private boolean showParticles; + private boolean field_100013_f; + private boolean field_180156_h; + /** List of ItemStack that can cure the potion effect **/ + private java.util.List curativeItems; - public PotionEffect(int id, int effectDuration) + public PotionEffect(int p_i1574_1_, int p_i1574_2_) { @@ -36,6 +38,8 @@ - this.amplifier = effectAmplifier; - this.isAmbient = ambient; - this.showParticles = showParticles; + this.field_76461_c = p_i45896_3_; + this.field_82724_e = p_i45896_4_; + this.field_180156_h = p_i45896_5_; + this.curativeItems = new java.util.ArrayList(); -+ this.curativeItems.add(new net.minecraft.item.ItemStack(net.minecraft.init.Items.milk_bucket)); ++ this.curativeItems.add(new net.minecraft.item.ItemStack(net.minecraft.init.Items.field_151117_aB)); } - public PotionEffect(PotionEffect other) + public PotionEffect(PotionEffect p_i1577_1_) @@ -45,6 +49,7 @@ - this.amplifier = other.amplifier; - this.isAmbient = other.isAmbient; - this.showParticles = other.showParticles; -+ this.curativeItems = other.curativeItems; + this.field_76461_c = p_i1577_1_.field_76461_c; + this.field_82724_e = p_i1577_1_.field_82724_e; + this.field_180156_h = p_i1577_1_.field_180156_h; ++ this.curativeItems = p_i1577_1_.curativeItems; } - public void combine(PotionEffect other) + public void func_76452_a(PotionEffect p_76452_1_) @@ -190,7 +195,7 @@ - public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound nbt) + public static PotionEffect func_82722_b(NBTTagCompound p_82722_0_) { -- int i = nbt.getByte("Id"); -+ int i = nbt.getByte("Id") & 0xff; +- int i = p_82722_0_.func_74771_c("Id"); ++ int i = p_82722_0_.func_74771_c("Id") & 0xff; - if (i >= 0 && i < Potion.potionTypes.length && Potion.potionTypes[i] != null) + if (i >= 0 && i < Potion.field_76425_a.length && Potion.field_76425_a[i] != null) { @@ -223,4 +228,62 @@ { - return this.isPotionDurationMax; + return this.field_100013_f; } + + /* ======================================== FORGE START =====================================*/ @@ -60,7 +60,7 @@ + boolean found = false; + for (net.minecraft.item.ItemStack curativeItem : this.curativeItems) + { -+ if (curativeItem.isItemEqual(stack)) ++ if (curativeItem.func_77969_a(stack)) + { + found = true; + } @@ -87,7 +87,7 @@ + boolean found = false; + for (net.minecraft.item.ItemStack curativeItem : this.curativeItems) + { -+ if (curativeItem.isItemEqual(stack)) ++ if (curativeItem.func_77969_a(stack)) + { + found = true; + } diff --git a/patches/minecraft/net/minecraft/realms/RealmsConnect.java.patch b/patches/minecraft/net/minecraft/realms/RealmsConnect.java.patch index 2aab40a37..485a416d0 100644 --- a/patches/minecraft/net/minecraft/realms/RealmsConnect.java.patch +++ b/patches/minecraft/net/minecraft/realms/RealmsConnect.java.patch @@ -12,8 +12,8 @@ return; } -- RealmsConnect.this.connection.sendPacket(new C00Handshake(47, p_connect_1_, p_connect_2_, EnumConnectionState.LOGIN)); -+ RealmsConnect.this.connection.sendPacket(new C00Handshake(47, p_connect_1_, p_connect_2_, EnumConnectionState.LOGIN, true)); +- RealmsConnect.this.connection.func_179290_a(new C00Handshake(47, p_connect_1_, p_connect_2_, EnumConnectionState.LOGIN)); ++ RealmsConnect.this.connection.func_179290_a(new C00Handshake(47, p_connect_1_, p_connect_2_, EnumConnectionState.LOGIN, true)); if (RealmsConnect.this.aborted) { diff --git a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch index e03c919c1..d72ce626f 100644 --- a/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ b/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch @@ -2,44 +2,44 @@ +++ ../src-work/minecraft/net/minecraft/server/MinecraftServer.java @@ -98,7 +98,7 @@ @SideOnly(Side.SERVER) - private String hostname; - private int serverPort = -1; -- public WorldServer[] worldServers; -+ public WorldServer[] worldServers = new WorldServer[0]; - private ServerConfigurationManager serverConfigManager; - private boolean serverRunning = true; - private boolean serverStopped; + private String field_71320_r; + private int field_71319_s = -1; +- public WorldServer[] field_71305_c; ++ public WorldServer[] field_71305_c = new WorldServer[0]; + private ServerConfigurationManager field_71318_t; + private boolean field_71317_u = true; + private boolean field_71316_v; @@ -115,7 +115,8 @@ - private int buildLimit; - private int maxPlayerIdleMinutes = 0; - public final long[] tickTimeArray = new long[100]; -- public long[][] timeOfLastDimensionTick; + private int field_71280_D; + private int field_143008_E = 0; + public final long[] field_71311_j = new long[100]; +- public long[][] field_71312_k; + //public long[][] timeOfLastDimensionTick; + public java.util.Hashtable worldTickTimes = new java.util.Hashtable(); - private KeyPair serverKeyPair; - private String serverOwner; - private String folderName; + private KeyPair field_71292_I; + private String field_71293_J; + private String field_71294_K; @@ -227,8 +228,6 @@ { - this.convertMapIfNeeded(p_71247_1_); - this.setUserMessage("menu.loadingLevel"); -- this.worldServers = new WorldServer[3]; -- this.timeOfLastDimensionTick = new long[this.worldServers.length][100]; - ISaveHandler isavehandler = this.anvilConverterForAnvilFile.getSaveLoader(p_71247_1_, true); - this.setResourcePackFromWorld(this.getFolderName(), isavehandler); - WorldInfo worldinfo = isavehandler.loadWorldInfo(); + this.func_71237_c(p_71247_1_); + this.func_71192_d("menu.loadingLevel"); +- this.field_71305_c = new WorldServer[3]; +- this.field_71312_k = new long[this.field_71305_c.length][100]; + ISaveHandler isavehandler = this.field_71310_m.func_75804_a(p_71247_1_, true); + this.func_175584_a(this.func_71270_I(), isavehandler); + WorldInfo worldinfo = isavehandler.func_75757_d(); @@ -259,47 +258,21 @@ worldsettings = new WorldSettings(worldinfo); } -- for (int i = 0; i < this.worldServers.length; ++i) -+ WorldServer overWorld = (WorldServer)(isDemo() ? new DemoWorldServer(this, isavehandler, worldinfo, 0, theProfiler).init() : new WorldServer(this, isavehandler, worldinfo, 0, theProfiler).init()); -+ overWorld.initialize(worldsettings); +- for (int i = 0; i < this.field_71305_c.length; ++i) ++ WorldServer overWorld = (WorldServer)(func_71242_L() ? new DemoWorldServer(this, isavehandler, worldinfo, 0, field_71304_b).func_175643_b() : new WorldServer(this, isavehandler, worldinfo, 0, field_71304_b).func_175643_b()); ++ overWorld.func_72963_a(worldsettings); + for (int dim : net.minecraftforge.common.DimensionManager.getStaticDimensionIDs()) { - int j = 0; -+ WorldServer world = (dim == 0 ? overWorld : (WorldServer)new WorldServerMulti(this, isavehandler, dim, overWorld, theProfiler).init()); -+ world.addWorldAccess(new WorldManager(this, world)); ++ WorldServer world = (dim == 0 ? overWorld : (WorldServer)new WorldServerMulti(this, isavehandler, dim, overWorld, field_71304_b).func_175643_b()); ++ world.func_72954_a(new WorldManager(this, world)); - if (i == 1) - { @@ -53,82 +53,82 @@ - - if (i == 0) - { -- if (this.isDemo()) +- if (this.func_71242_L()) - { -- this.worldServers[i] = (WorldServer)(new DemoWorldServer(this, isavehandler, worldinfo, j, this.theProfiler)).init(); +- this.field_71305_c[i] = (WorldServer)(new DemoWorldServer(this, isavehandler, worldinfo, j, this.field_71304_b)).func_175643_b(); - } - else - { -- this.worldServers[i] = (WorldServer)(new WorldServer(this, isavehandler, worldinfo, j, this.theProfiler)).init(); +- this.field_71305_c[i] = (WorldServer)(new WorldServer(this, isavehandler, worldinfo, j, this.field_71304_b)).func_175643_b(); - } - -- this.worldServers[i].initialize(worldsettings); +- this.field_71305_c[i].func_72963_a(worldsettings); - } - else - { -- this.worldServers[i] = (WorldServer)(new WorldServerMulti(this, isavehandler, j, this.worldServers[0], this.theProfiler)).init(); +- this.field_71305_c[i] = (WorldServer)(new WorldServerMulti(this, isavehandler, j, this.field_71305_c[0], this.field_71304_b)).func_175643_b(); - } - -- this.worldServers[i].addWorldAccess(new WorldManager(this, this.worldServers[i])); +- this.field_71305_c[i].func_72954_a(new WorldManager(this, this.field_71305_c[i])); - - if (!this.isSinglePlayer()) + if (!this.func_71264_H()) { -- this.worldServers[i].getWorldInfo().setGameType(this.getGameType()); -+ world.getWorldInfo().setGameType(this.getGameType()); +- this.field_71305_c[i].func_72912_H().func_76060_a(this.func_71265_f()); ++ world.func_72912_H().func_76060_a(this.func_71265_f()); } + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(world)); } -- this.serverConfigManager.setPlayerManager(this.worldServers); -+ this.serverConfigManager.setPlayerManager(new WorldServer[]{ overWorld }); - this.setDifficultyForAllWorlds(this.getDifficulty()); - this.initialWorldChunkLoad(); +- this.field_71318_t.func_72364_a(this.field_71305_c); ++ this.field_71318_t.func_72364_a(new WorldServer[]{ overWorld }); + this.func_147139_a(this.func_147135_j()); + this.func_71222_d(); } @@ -314,7 +287,7 @@ - this.setUserMessage("menu.generatingTerrain"); + this.func_71192_d("menu.generatingTerrain"); int j1 = 0; - logger.info("Preparing start region for level " + j1); -- WorldServer worldserver = this.worldServers[j1]; + field_147145_h.info("Preparing start region for level " + j1); +- WorldServer worldserver = this.field_71305_c[j1]; + WorldServer worldserver = net.minecraftforge.common.DimensionManager.getWorld(j1); - BlockPos blockpos = worldserver.getSpawnPoint(); - long k1 = getCurrentTimeMillis(); + BlockPos blockpos = worldserver.func_175694_M(); + long k1 = func_130071_aq(); @@ -403,7 +376,7 @@ - public void stopServer() + public void func_71260_j() { -- if (!this.worldIsBeingDeleted) -+ if (!this.worldIsBeingDeleted && net.minecraftforge.fml.common.Loader.instance().hasReachedState(net.minecraftforge.fml.common.LoaderState.SERVER_STARTED) && !serverStopped) // make sure the save is valid and we don't save twice +- if (!this.field_71290_O) ++ if (!this.field_71290_O && net.minecraftforge.fml.common.Loader.instance().hasReachedState(net.minecraftforge.fml.common.LoaderState.SERVER_STARTED) && !field_71316_v) // make sure the save is valid and we don't save twice { - logger.info("Stopping server"); + field_147145_h.info("Stopping server"); @@ -427,8 +400,15 @@ - for (int i = 0; i < this.worldServers.length; ++i) + for (int i = 0; i < this.field_71305_c.length; ++i) { - WorldServer worldserver = this.worldServers[i]; + WorldServer worldserver = this.field_71305_c[i]; + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(worldserver)); - worldserver.flush(); + worldserver.func_73041_k(); } + -+ WorldServer[] tmp = worldServers; ++ WorldServer[] tmp = field_71305_c; + for (WorldServer world : tmp) + { -+ net.minecraftforge.common.DimensionManager.setWorld(world.provider.getDimensionId(), null); ++ net.minecraftforge.common.DimensionManager.setWorld(world.field_73011_w.func_177502_q(), null); + } } - if (this.usageSnooper.isSnooperRunning()) + if (this.field_71307_n.func_76468_d()) @@ -460,6 +440,7 @@ { - if (this.startServer()) + if (this.func_71197_b()) { + net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerStarted(); - this.currentTime = getCurrentTimeMillis(); + this.field_175591_ab = func_130071_aq(); long i = 0L; - this.statusResponse.setServerDescription(new ChatComponentText(this.motd)); + this.field_147147_p.func_151315_a(new ChatComponentText(this.field_71286_C)); @@ -504,12 +485,20 @@ Thread.sleep(Math.max(1L, 50L - i)); - this.serverIsRunning = true; + this.field_71296_Q = true; } + net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerStopping(); + net.minecraftforge.fml.common.FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions @@ -136,7 +136,7 @@ else { + net.minecraftforge.fml.common.FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions - this.finalTick((CrashReport)null); + this.func_71228_a((CrashReport)null); } } + catch (net.minecraftforge.fml.common.StartupQuery.AbortedException e) @@ -146,13 +146,13 @@ + } catch (Throwable throwable1) { - logger.error("Encountered an unexpected exception", throwable1); + field_147145_h.error("Encountered an unexpected exception", throwable1); @@ -535,6 +524,7 @@ - logger.error("We were unable to save this crash report to disk."); + field_147145_h.error("We were unable to save this crash report to disk."); } + net.minecraftforge.fml.common.FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions - this.finalTick(crashreport); + this.func_71228_a(crashreport); } finally @@ -550,6 +540,8 @@ @@ -160,59 +160,59 @@ finally { + net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerStopped(); -+ this.serverStopped = true; - this.systemExitNow(); ++ this.field_71316_v = true; + this.func_71240_o(); } } @@ -599,6 +591,7 @@ - public void tick() + public void func_71217_p() { long i = System.nanoTime(); + net.minecraftforge.fml.common.FMLCommonHandler.instance().onPreServerTick(); - ++this.tickCounter; + ++this.field_71315_w; - if (this.startProfiling) + if (this.field_71295_T) @@ -625,6 +618,7 @@ Collections.shuffle(Arrays.asList(agameprofile)); - this.statusResponse.getPlayerCountData().setPlayers(agameprofile); -+ this.statusResponse.invalidateJson(); + this.field_147147_p.func_151318_b().func_151330_a(agameprofile); ++ this.field_147147_p.invalidateJson(); } - if (this.tickCounter % 900 == 0) + if (this.field_71315_w % 900 == 0) @@ -652,6 +646,7 @@ - this.theProfiler.endSection(); - this.theProfiler.endSection(); + this.field_71304_b.func_76319_b(); + this.field_71304_b.func_76319_b(); + net.minecraftforge.fml.common.FMLCommonHandler.instance().onPostServerTick(); } - public void updateTimeLightAndEntities() + public void func_71190_q() @@ -667,14 +662,17 @@ } - this.theProfiler.endStartSection("levels"); + this.field_71304_b.func_76318_c("levels"); + net.minecraftforge.common.chunkio.ChunkIOExecutor.tick(); -- for (int j = 0; j < this.worldServers.length; ++j) -+ Integer[] ids = net.minecraftforge.common.DimensionManager.getIDs(this.tickCounter % 200 == 0); +- for (int j = 0; j < this.field_71305_c.length; ++j) ++ Integer[] ids = net.minecraftforge.common.DimensionManager.getIDs(this.field_71315_w % 200 == 0); + for (int x = 0; x < ids.length; x++) { + int id = ids[x]; long i = System.nanoTime(); -- if (j == 0 || this.getAllowNether()) -+ if (id == 0 || this.getAllowNether()) +- if (j == 0 || this.func_71255_r()) ++ if (id == 0 || this.func_71255_r()) { -- WorldServer worldserver = this.worldServers[j]; +- WorldServer worldserver = this.field_71305_c[j]; + WorldServer worldserver = net.minecraftforge.common.DimensionManager.getWorld(id); - this.theProfiler.startSection(worldserver.getWorldInfo().getWorldName()); + this.field_71304_b.func_76320_a(worldserver.func_72912_H().func_76065_j()); - if (this.tickCounter % 20 == 0) + if (this.field_71315_w % 20 == 0) @@ -685,6 +683,7 @@ } - this.theProfiler.startSection("tick"); + this.field_71304_b.func_76320_a("tick"); + net.minecraftforge.fml.common.FMLCommonHandler.instance().onPreWorldTick(worldserver); try @@ -222,45 +222,45 @@ } + net.minecraftforge.fml.common.FMLCommonHandler.instance().onPostWorldTick(worldserver); - this.theProfiler.endSection(); - this.theProfiler.startSection("tracker"); - worldserver.getEntityTracker().updateTrackedEntities(); + this.field_71304_b.func_76319_b(); + this.field_71304_b.func_76320_a("tracker"); + worldserver.func_73039_n().func_72788_a(); @@ -715,9 +715,11 @@ - this.theProfiler.endSection(); + this.field_71304_b.func_76319_b(); } -- this.timeOfLastDimensionTick[j][this.tickCounter % 100] = System.nanoTime() - i; -+ worldTickTimes.get(id)[this.tickCounter % 100] = System.nanoTime() - i; +- this.field_71312_k[j][this.field_71315_w % 100] = System.nanoTime() - i; ++ worldTickTimes.get(id)[this.field_71315_w % 100] = System.nanoTime() - i; } -+ this.theProfiler.endStartSection("dim_unloading"); ++ this.field_71304_b.func_76318_c("dim_unloading"); + net.minecraftforge.common.DimensionManager.unloadWorlds(worldTickTimes); - this.theProfiler.endStartSection("connection"); - this.getNetworkSystem().networkTick(); - this.theProfiler.endStartSection("players"); + this.field_71304_b.func_76318_c("connection"); + this.func_147137_ag().func_151269_c(); + this.field_71304_b.func_76318_c("players"); @@ -739,6 +741,7 @@ - public void startServerThread() + public void func_71256_s() { + net.minecraftforge.fml.common.StartupQuery.reset(); - this.serverThread = new Thread(this, "Server thread"); - this.serverThread.start(); + this.field_175590_aa = new Thread(this, "Server thread"); + this.field_175590_aa.start(); } @@ -755,7 +758,13 @@ - public WorldServer worldServerForDimension(int dimension) + public WorldServer func_71218_a(int p_71218_1_) { -- return dimension == -1 ? this.worldServers[1] : (dimension == 1 ? this.worldServers[2] : this.worldServers[0]); -+ WorldServer ret = net.minecraftforge.common.DimensionManager.getWorld(dimension); +- return p_71218_1_ == -1 ? this.field_71305_c[1] : (p_71218_1_ == 1 ? this.field_71305_c[2] : this.field_71305_c[0]); ++ WorldServer ret = net.minecraftforge.common.DimensionManager.getWorld(p_71218_1_); + if (ret == null) + { -+ net.minecraftforge.common.DimensionManager.initDimension(dimension); -+ ret = net.minecraftforge.common.DimensionManager.getWorld(dimension); ++ net.minecraftforge.common.DimensionManager.initDimension(p_71218_1_); ++ ret = net.minecraftforge.common.DimensionManager.getWorld(p_71218_1_); + } + return ret; } - public String getMinecraftVersion() + public String func_71249_w() @@ -785,7 +794,7 @@ public String getServerModName() @@ -269,12 +269,12 @@ + return net.minecraftforge.fml.common.FMLCommonHandler.instance().getModName(); } - public CrashReport addServerInfoToCrashReport(CrashReport report) + public CrashReport func_71230_b(CrashReport p_71230_1_) @@ -996,6 +1005,7 @@ if (worldserver != null) { + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(worldserver)); - worldserver.flush(); + worldserver.func_73041_k(); } } diff --git a/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch b/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch index 05d5aafc1..6517ba2d2 100644 --- a/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch +++ b/patches/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch @@ -1,37 +1,37 @@ --- ../src-base/minecraft/net/minecraft/server/dedicated/DedicatedServer.java +++ ../src-work/minecraft/net/minecraft/server/dedicated/DedicatedServer.java @@ -49,6 +49,7 @@ - private boolean canSpawnStructures; - private WorldSettings.GameType gameType; - private boolean guiIsEnabled; + private boolean field_71338_p; + private WorldSettings.GameType field_71337_q; + private boolean field_71335_s; + public static boolean allowPlayerLogins = false; - public DedicatedServer(File workDir) + public DedicatedServer(File p_i1508_1_) { @@ -107,6 +108,8 @@ - logger.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); + field_155771_h.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); } + net.minecraftforge.fml.common.FMLCommonHandler.instance().onServerStart(this); + - logger.info("Loading properties"); - this.settings = new PropertyManager(new File("server.properties")); - this.eula = new ServerEula(new File("eula.txt")); + field_155771_h.info("Loading properties"); + this.field_71340_o = new PropertyManager(new File("server.properties")); + this.field_154332_n = new ServerEula(new File("eula.txt")); @@ -198,6 +201,7 @@ } else { + net.minecraftforge.fml.common.FMLCommonHandler.instance().onServerStarted(); - this.setConfigManager(new DedicatedPlayerList(this)); + this.func_152361_a(new DedicatedPlayerList(this)); long j = System.nanoTime(); @@ -244,6 +248,7 @@ - this.setBuildLimit((this.getBuildLimit() + 8) / 16 * 16); - this.setBuildLimit(MathHelper.clamp_int(this.getBuildLimit(), 64, 256)); - this.settings.setProperty("max-build-height", Integer.valueOf(this.getBuildLimit())); + this.func_71191_d((this.func_71207_Z() + 8) / 16 * 16); + this.func_71191_d(MathHelper.func_76125_a(this.func_71207_Z(), 64, 256)); + this.field_71340_o.func_73667_a("max-build-height", Integer.valueOf(this.func_71207_Z())); + if (!net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerAboutToStart(this)) return false; - logger.info("Preparing level \"" + this.getFolderName() + "\""); - this.loadAllWorlds(this.getFolderName(), this.getFolderName(), k, worldtype, s2); + field_155771_h.info("Preparing level \"" + this.func_71270_I() + "\""); + this.func_71247_a(this.func_71270_I(), this.func_71270_I(), k, worldtype, s2); long i1 = System.nanoTime() - j; @@ -272,7 +277,7 @@ thread1.start(); diff --git a/patches/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch b/patches/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch index 1aca6a5bc..06a26df6e 100644 --- a/patches/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch +++ b/patches/minecraft/net/minecraft/server/gui/MinecraftServerGui.java.patch @@ -7,7 +7,7 @@ + minecraftservergui.latch.countDown(); } - public MinecraftServerGui(DedicatedServer serverIn) + public MinecraftServerGui(DedicatedServer p_i2362_1_) @@ -162,8 +163,13 @@ return jpanel; } diff --git a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch index 6b4e353d1..7962cb7ac 100644 --- a/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch +++ b/patches/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch @@ -1,34 +1,34 @@ --- ../src-base/minecraft/net/minecraft/server/integrated/IntegratedServer.java +++ ../src-work/minecraft/net/minecraft/server/integrated/IntegratedServer.java @@ -71,8 +71,6 @@ - protected void loadAllWorlds(String p_71247_1_, String p_71247_2_, long seed, WorldType type, String p_71247_6_) + protected void func_71247_a(String p_71247_1_, String p_71247_2_, long p_71247_3_, WorldType p_71247_5_, String p_71247_6_) { - this.convertMapIfNeeded(p_71247_1_); -- this.worldServers = new WorldServer[3]; -- this.timeOfLastDimensionTick = new long[this.worldServers.length][100]; - ISaveHandler isavehandler = this.getActiveAnvilConverter().getSaveLoader(p_71247_1_, true); - this.setResourcePackFromWorld(this.getFolderName(), isavehandler); - WorldInfo worldinfo = isavehandler.loadWorldInfo(); + this.func_71237_c(p_71247_1_); +- this.field_71305_c = new WorldServer[3]; +- this.field_71312_k = new long[this.field_71305_c.length][100]; + ISaveHandler isavehandler = this.func_71254_M().func_75804_a(p_71247_1_, true); + this.func_175584_a(this.func_71270_I(), isavehandler); + WorldInfo worldinfo = isavehandler.func_75757_d(); @@ -86,44 +84,24 @@ - worldinfo.setWorldName(p_71247_2_); + worldinfo.func_76062_a(p_71247_2_); } -- for (int i = 0; i < this.worldServers.length; ++i) +- for (int i = 0; i < this.field_71305_c.length; ++i) - { - int j = 0; -+ WorldServer overWorld = (isDemo() ? (WorldServer)(new DemoWorldServer(this, isavehandler, worldinfo, 0, this.theProfiler)).init() : -+ (WorldServer)(new WorldServer(this, isavehandler, worldinfo, 0, this.theProfiler)).init()); -+ overWorld.initialize(this.theWorldSettings); ++ WorldServer overWorld = (func_71242_L() ? (WorldServer)(new DemoWorldServer(this, isavehandler, worldinfo, 0, this.field_71304_b)).func_175643_b() : ++ (WorldServer)(new WorldServer(this, isavehandler, worldinfo, 0, this.field_71304_b)).func_175643_b()); ++ overWorld.func_72963_a(this.field_71350_m); - if (i == 1) + for (int dim : net.minecraftforge.common.DimensionManager.getStaticDimensionIDs()) + { -+ WorldServer world = (dim == 0 ? overWorld : (WorldServer)(new WorldServerMulti(this, isavehandler, dim, overWorld, this.theProfiler)).init()); -+ world.addWorldAccess(new WorldManager(this, world)); -+ if (!this.isSinglePlayer()) ++ WorldServer world = (dim == 0 ? overWorld : (WorldServer)(new WorldServerMulti(this, isavehandler, dim, overWorld, this.field_71304_b)).func_175643_b()); ++ world.func_72954_a(new WorldManager(this, world)); ++ if (!this.func_71264_H()) { - j = -1; -+ world.getWorldInfo().setGameType(getGameType()); ++ world.func_72912_H().func_76060_a(func_71265_f()); } - - if (i == 2) @@ -38,51 +38,51 @@ - - if (i == 0) - { -- if (this.isDemo()) +- if (this.func_71242_L()) - { -- this.worldServers[i] = (WorldServer)(new DemoWorldServer(this, isavehandler, worldinfo, j, this.theProfiler)).init(); +- this.field_71305_c[i] = (WorldServer)(new DemoWorldServer(this, isavehandler, worldinfo, j, this.field_71304_b)).func_175643_b(); - } - else - { -- this.worldServers[i] = (WorldServer)(new WorldServer(this, isavehandler, worldinfo, j, this.theProfiler)).init(); +- this.field_71305_c[i] = (WorldServer)(new WorldServer(this, isavehandler, worldinfo, j, this.field_71304_b)).func_175643_b(); - } - -- this.worldServers[i].initialize(this.theWorldSettings); +- this.field_71305_c[i].func_72963_a(this.field_71350_m); - } - else - { -- this.worldServers[i] = (WorldServer)(new WorldServerMulti(this, isavehandler, j, this.worldServers[0], this.theProfiler)).init(); +- this.field_71305_c[i] = (WorldServer)(new WorldServerMulti(this, isavehandler, j, this.field_71305_c[0], this.field_71304_b)).func_175643_b(); - } - -- this.worldServers[i].addWorldAccess(new WorldManager(this, this.worldServers[i])); +- this.field_71305_c[i].func_72954_a(new WorldManager(this, this.field_71305_c[i])); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(world)); } -- this.getConfigurationManager().setPlayerManager(this.worldServers); -+ this.getConfigurationManager().setPlayerManager(new WorldServer[]{ overWorld }); +- this.func_71203_ab().func_72364_a(this.field_71305_c); ++ this.func_71203_ab().func_72364_a(new WorldServer[]{ overWorld }); -- if (this.worldServers[0].getWorldInfo().getDifficulty() == null) -+ if (overWorld.getWorldInfo().getDifficulty() == null) +- if (this.field_71305_c[0].func_72912_H().func_176130_y() == null) ++ if (overWorld.func_72912_H().func_176130_y() == null) { - this.setDifficultyForAllWorlds(this.mc.gameSettings.difficulty); + this.func_147139_a(this.field_71349_l.field_71474_y.field_74318_M); } @@ -141,9 +119,10 @@ - this.setAllowFlight(true); - logger.info("Generating keypair"); - this.setKeyPair(CryptManager.generateKeyPair()); + this.func_71245_h(true); + field_147148_h.info("Generating keypair"); + this.func_71253_a(CryptManager.func_75891_b()); + if (!net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerAboutToStart(this)) return false; - this.loadAllWorlds(this.getFolderName(), this.getWorldName(), this.theWorldSettings.getSeed(), this.theWorldSettings.getTerrainType(), this.theWorldSettings.getWorldName()); - this.setMOTD(this.getServerOwner() + " - " + this.worldServers[0].getWorldInfo().getWorldName()); + this.func_71247_a(this.func_71270_I(), this.func_71221_J(), this.field_71350_m.func_77160_d(), this.field_71350_m.func_77165_h(), this.field_71350_m.func_82749_j()); + this.func_71205_p(this.func_71214_G() + " - " + this.field_71305_c[0].func_72912_H().func_76065_j()); - return true; + return net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerStarting(this); } - public void tick() + public void func_71217_p() @@ -216,6 +195,7 @@ - public EnumDifficulty getDifficulty() + public EnumDifficulty func_147135_j() { -+ if (this.mc.theWorld == null) return this.mc.gameSettings.difficulty; // Fix NPE just in case. - return this.mc.theWorld.getWorldInfo().getDifficulty(); ++ if (this.field_71349_l.field_71441_e == null) return this.field_71349_l.field_71474_y.field_74318_M; // Fix NPE just in case. + return this.field_71349_l.field_71441_e.func_72912_H().func_176130_y(); } diff --git a/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch b/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch index 7ec3ff397..e9e80922d 100644 --- a/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch +++ b/patches/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch @@ -6,141 +6,141 @@ { + /** Forge reach distance */ + private double blockReachDistance = 5.0d; - public World theWorld; - public EntityPlayerMP thisPlayerMP; - private WorldSettings.GameType gameType = WorldSettings.GameType.NOT_SET; + public World field_73092_a; + public EntityPlayerMP field_73090_b; + private WorldSettings.GameType field_73091_c = WorldSettings.GameType.NOT_SET; @@ -130,6 +132,14 @@ - public void onBlockClicked(BlockPos pos, EnumFacing side) + public void func_180784_a(BlockPos p_180784_1_, EnumFacing p_180784_2_) { -+ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thisPlayerMP, -+ net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.LEFT_CLICK_BLOCK, theWorld, pos, side); ++ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_73090_b, ++ net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.LEFT_CLICK_BLOCK, field_73092_a, p_180784_1_, p_180784_2_); + if (event.isCanceled()) + { -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); ++ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(field_73092_a, p_180784_1_)); + return; + } + - if (this.isCreative()) + if (this.func_73083_d()) { - if (!this.theWorld.extinguishFire((EntityPlayer)null, pos, side)) + if (!this.field_73092_a.func_175719_a((EntityPlayer)null, p_180784_1_, p_180784_2_)) @@ -164,18 +174,35 @@ } } -- this.theWorld.extinguishFire((EntityPlayer)null, pos, side); +- this.field_73092_a.func_175719_a((EntityPlayer)null, p_180784_1_, p_180784_2_); + // - this.initialDamage = this.curblockDamage; + this.field_73089_e = this.field_73100_i; float f = 1.0F; -- if (block.getMaterial() != Material.air) -+ if (!block.isAir(theWorld, pos)) +- if (block.func_149688_o() != Material.field_151579_a) ++ if (!block.isAir(field_73092_a, p_180784_1_)) { -- block.onBlockClicked(this.theWorld, pos, this.thisPlayerMP); +- block.func_180649_a(this.field_73092_a, p_180784_1_, this.field_73090_b); + if (event.useBlock != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) + { -+ block.onBlockClicked(this.theWorld, pos, this.thisPlayerMP); -+ this.theWorld.extinguishFire((EntityPlayer)null, pos, side); ++ block.func_180649_a(this.field_73092_a, p_180784_1_, this.field_73090_b); ++ this.field_73092_a.func_175719_a((EntityPlayer)null, p_180784_1_, p_180784_2_); + } + else + { -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); ++ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(field_73092_a, p_180784_1_)); + } - f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, pos); + f = block.func_180647_a(this.field_73090_b, this.field_73090_b.field_70170_p, p_180784_1_); } -- if (block.getMaterial() != Material.air && f >= 1.0F) +- if (block.func_149688_o() != Material.field_151579_a && f >= 1.0F) + if (event.useItem == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) { + if (f >= 1.0F) + { -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); ++ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(field_73092_a, p_180784_1_)); + } + return; + } + -+ if (!block.isAir(theWorld, pos) && f >= 1.0F) ++ if (!block.isAir(field_73092_a, p_180784_1_) && f >= 1.0F) + { - this.tryHarvestBlock(pos); + this.func_180237_b(p_180784_1_); } else @@ -196,7 +223,7 @@ - int i = this.curblockDamage - this.initialDamage; - Block block = this.theWorld.getBlockState(pos).getBlock(); + int i = this.field_73100_i - this.field_73089_e; + Block block = this.field_73092_a.func_180495_p(p_180785_1_).func_177230_c(); -- if (block.getMaterial() != Material.air) -+ if (!block.isAir(theWorld, pos)) +- if (block.func_149688_o() != Material.field_151579_a) ++ if (!block.isAir(field_73092_a, p_180785_1_)) { - float f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, pos) * (float)(i + 1); + float f = block.func_180647_a(this.field_73090_b, this.field_73090_b.field_70170_p, p_180785_1_) * (float)(i + 1); @@ -225,9 +252,13 @@ - private boolean removeBlock(BlockPos pos) + private boolean func_180235_c(BlockPos p_180235_1_) { -+ return removeBlock(pos, false); ++ return removeBlock(p_180235_1_, false); + } -+ private boolean removeBlock(BlockPos pos, boolean canHarvest) ++ private boolean removeBlock(BlockPos p_180235_1_, boolean canHarvest) + { - IBlockState iblockstate = this.theWorld.getBlockState(pos); - iblockstate.getBlock().onBlockHarvested(this.theWorld, pos, iblockstate, this.thisPlayerMP); -- boolean flag = this.theWorld.setBlockToAir(pos); -+ boolean flag = iblockstate.getBlock().removedByPlayer(theWorld, pos, thisPlayerMP, canHarvest); + IBlockState iblockstate = this.field_73092_a.func_180495_p(p_180235_1_); + iblockstate.func_177230_c().func_176208_a(this.field_73092_a, p_180235_1_, iblockstate, this.field_73090_b); +- boolean flag = this.field_73092_a.func_175698_g(p_180235_1_); ++ boolean flag = iblockstate.func_177230_c().removedByPlayer(field_73092_a, p_180235_1_, field_73090_b, canHarvest); if (flag) { @@ -239,7 +270,8 @@ - public boolean tryHarvestBlock(BlockPos pos) + public boolean func_180237_b(BlockPos p_180237_1_) { -- if (this.gameType.isCreative() && this.thisPlayerMP.getHeldItem() != null && this.thisPlayerMP.getHeldItem().getItem() instanceof ItemSword) -+ int exp = net.minecraftforge.common.ForgeHooks.onBlockBreakEvent(theWorld, gameType, thisPlayerMP, pos); +- if (this.field_73091_c.func_77145_d() && this.field_73090_b.func_70694_bm() != null && this.field_73090_b.func_70694_bm().func_77973_b() instanceof ItemSword) ++ int exp = net.minecraftforge.common.ForgeHooks.onBlockBreakEvent(field_73092_a, field_73091_c, field_73090_b, p_180237_1_); + if (exp == -1) { return false; } @@ -248,40 +280,21 @@ - IBlockState iblockstate = this.theWorld.getBlockState(pos); - TileEntity tileentity = this.theWorld.getTileEntity(pos); + IBlockState iblockstate = this.field_73092_a.func_180495_p(p_180237_1_); + TileEntity tileentity = this.field_73092_a.func_175625_s(p_180237_1_); -- if (this.gameType.isAdventure()) +- if (this.field_73091_c.func_82752_c()) - { -- if (this.gameType == WorldSettings.GameType.SPECTATOR) +- if (this.field_73091_c == WorldSettings.GameType.SPECTATOR) - { - return false; - } -+ ItemStack stack = thisPlayerMP.getCurrentEquippedItem(); -+ if (stack != null && stack.getItem().onBlockStartBreak(stack, pos, thisPlayerMP)) return false; ++ ItemStack stack = field_73090_b.func_71045_bC(); ++ if (stack != null && stack.func_77973_b().onBlockStartBreak(stack, p_180237_1_, field_73090_b)) return false; -- if (!this.thisPlayerMP.isAllowEdit()) +- if (!this.field_73090_b.func_175142_cm()) - { -- ItemStack itemstack = this.thisPlayerMP.getCurrentEquippedItem(); +- ItemStack itemstack = this.field_73090_b.func_71045_bC(); - - if (itemstack == null) - { - return false; - } - -- if (!itemstack.canDestroy(iblockstate.getBlock())) +- if (!itemstack.func_179544_c(iblockstate.func_177230_c())) - { - return false; - } - } - } - - this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, pos, Block.getStateId(iblockstate)); -- boolean flag1 = this.removeBlock(pos); + this.field_73092_a.func_180498_a(this.field_73090_b, 2001, p_180237_1_, Block.func_176210_f(iblockstate)); +- boolean flag1 = this.func_180235_c(p_180237_1_); + boolean flag1 = false; - if (this.isCreative()) + if (this.func_73083_d()) { -+ flag1 = this.removeBlock(pos); - this.thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(this.theWorld, pos)); ++ flag1 = this.func_180235_c(p_180237_1_); + this.field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(this.field_73092_a, p_180237_1_)); } else { - ItemStack itemstack1 = this.thisPlayerMP.getCurrentEquippedItem(); -- boolean flag = this.thisPlayerMP.canHarvestBlock(iblockstate.getBlock()); -+ boolean flag = iblockstate.getBlock().canHarvestBlock(theWorld, pos, thisPlayerMP); + ItemStack itemstack1 = this.field_73090_b.func_71045_bC(); +- boolean flag = this.field_73090_b.func_146099_a(iblockstate.func_177230_c()); ++ boolean flag = iblockstate.func_177230_c().canHarvestBlock(field_73092_a, p_180237_1_, field_73090_b); if (itemstack1 != null) { @@ -148,94 +148,94 @@ } } -+ flag1 = this.removeBlock(pos, flag); ++ flag1 = this.removeBlock(p_180237_1_, flag); if (flag1 && flag) { - iblockstate.getBlock().harvestBlock(this.theWorld, this.thisPlayerMP, pos, iblockstate, tileentity); + iblockstate.func_177230_c().func_180657_a(this.field_73092_a, this.field_73090_b, p_180237_1_, iblockstate, tileentity); } } + // Drop experiance -+ if (!this.isCreative() && flag1 && exp > 0) ++ if (!this.func_73083_d() && flag1 && exp > 0) + { -+ iblockstate.getBlock().dropXpOnBlockBreak(theWorld, pos, exp); ++ iblockstate.func_177230_c().func_180637_b(field_73092_a, p_180237_1_, exp); + } return flag1; } } @@ -332,6 +351,7 @@ - if (itemstack.stackSize == 0) + if (itemstack.field_77994_a == 0) { - player.inventory.mainInventory[player.inventory.currentItem] = null; -+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(player, itemstack); + p_73085_1_.field_71071_by.field_70462_a[p_73085_1_.field_71071_by.field_70461_c] = null; ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_73085_1_, itemstack); } - if (!player.isUsingItem()) + if (!p_73085_1_.func_71039_bw()) @@ -380,33 +400,51 @@ } else { -- if (!player.isSneaking() || player.getHeldItem() == null) -+ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(player, -+ net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, worldIn, pos, side); +- if (!p_180236_1_.func_70093_af() || p_180236_1_.func_70694_bm() == null) ++ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(p_180236_1_, ++ net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, p_180236_2_, p_180236_4_, p_180236_5_); + if (event.isCanceled()) { -- IBlockState iblockstate = worldIn.getBlockState(pos); +- IBlockState iblockstate = p_180236_2_.func_180495_p(p_180236_4_); - -- if (iblockstate.getBlock().onBlockActivated(worldIn, pos, iblockstate, player, side, p_180236_6_, p_180236_7_, p_180236_8_)) +- if (iblockstate.func_177230_c().func_180639_a(p_180236_2_, p_180236_4_, iblockstate, p_180236_1_, p_180236_5_, p_180236_6_, p_180236_7_, p_180236_8_)) - { - return true; - } -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); ++ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(field_73092_a, p_180236_4_)); + return false; } -- if (stack == null) -+ if (stack != null && stack.getItem().onItemUseFirst(stack, player, worldIn, pos, side, p_180236_6_, p_180236_7_, p_180236_8_)) +- if (p_180236_3_ == null) ++ if (p_180236_3_ != null && p_180236_3_.func_77973_b().onItemUseFirst(p_180236_3_, p_180236_1_, p_180236_2_, p_180236_4_, p_180236_5_, p_180236_6_, p_180236_7_, p_180236_8_)) { - return false; -+ if (stack.stackSize <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(thisPlayerMP, stack); ++ if (p_180236_3_.field_77994_a <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(field_73090_b, p_180236_3_); + return true; } -- else if (this.isCreative()) +- else if (this.func_73083_d()) + -+ IBlockState iblockstate = worldIn.getBlockState(pos); -+ boolean isAir = worldIn.isAirBlock(pos); -+ boolean useBlock = !player.isSneaking() || player.getHeldItem() == null; -+ if (!useBlock) useBlock = player.getHeldItem().getItem().doesSneakBypassUse(worldIn, pos, player); ++ IBlockState iblockstate = p_180236_2_.func_180495_p(p_180236_4_); ++ boolean isAir = p_180236_2_.func_175623_d(p_180236_4_); ++ boolean useBlock = !p_180236_1_.func_70093_af() || p_180236_1_.func_70694_bm() == null; ++ if (!useBlock) useBlock = p_180236_1_.func_70694_bm().func_77973_b().doesSneakBypassUse(p_180236_2_, p_180236_4_, p_180236_1_); + boolean result = false; + + if (useBlock) { -- int j = stack.getMetadata(); -- int i = stack.stackSize; -- boolean flag = stack.onItemUse(player, worldIn, pos, side, p_180236_6_, p_180236_7_, p_180236_8_); -- stack.setItemDamage(j); -- stack.stackSize = i; +- int j = p_180236_3_.func_77960_j(); +- int i = p_180236_3_.field_77994_a; +- boolean flag = p_180236_3_.func_179546_a(p_180236_1_, p_180236_2_, p_180236_4_, p_180236_5_, p_180236_6_, p_180236_7_, p_180236_8_); +- p_180236_3_.func_77964_b(j); +- p_180236_3_.field_77994_a = i; - return flag; + if (event.useBlock != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) + { -+ result = iblockstate.getBlock().onBlockActivated(worldIn, pos, iblockstate, player, side, p_180236_6_, p_180236_7_, p_180236_8_); ++ result = iblockstate.func_177230_c().func_180639_a(p_180236_2_, p_180236_4_, iblockstate, p_180236_1_, p_180236_5_, p_180236_6_, p_180236_7_, p_180236_8_); + } + else + { -+ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); ++ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(field_73092_a, p_180236_4_)); + result = event.useItem != net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW; + } } - else -+ if (stack != null && !result && event.useItem != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) ++ if (p_180236_3_ != null && !result && event.useItem != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) { -- return stack.onItemUse(player, worldIn, pos, side, p_180236_6_, p_180236_7_, p_180236_8_); -+ int meta = stack.getMetadata(); -+ int size = stack.stackSize; -+ result = stack.onItemUse(player, worldIn, pos, side, p_180236_6_, p_180236_7_, p_180236_8_); -+ if (isCreative()) +- return p_180236_3_.func_179546_a(p_180236_1_, p_180236_2_, p_180236_4_, p_180236_5_, p_180236_6_, p_180236_7_, p_180236_8_); ++ int meta = p_180236_3_.func_77960_j(); ++ int size = p_180236_3_.field_77994_a; ++ result = p_180236_3_.func_179546_a(p_180236_1_, p_180236_2_, p_180236_4_, p_180236_5_, p_180236_6_, p_180236_7_, p_180236_8_); ++ if (func_73083_d()) + { -+ stack.setItemDamage(meta); -+ stack.stackSize = size; ++ p_180236_3_.func_77964_b(meta); ++ p_180236_3_.field_77994_a = size; + } -+ if (stack.stackSize <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(thisPlayerMP, stack); ++ if (p_180236_3_.field_77994_a <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(field_73090_b, p_180236_3_); } + return result; } @@ -243,7 +243,7 @@ @@ -414,4 +452,13 @@ { - this.theWorld = serverWorld; + this.field_73092_a = p_73080_1_; } + + public double getBlockReachDistance() diff --git a/patches/minecraft/net/minecraft/server/management/PlayerManager.java.patch b/patches/minecraft/net/minecraft/server/management/PlayerManager.java.patch index 87dfd5295..e0c026df7 100644 --- a/patches/minecraft/net/minecraft/server/management/PlayerManager.java.patch +++ b/patches/minecraft/net/minecraft/server/management/PlayerManager.java.patch @@ -1,17 +1,17 @@ --- ../src-base/minecraft/net/minecraft/server/management/PlayerManager.java +++ ../src-work/minecraft/net/minecraft/server/management/PlayerManager.java @@ -117,15 +117,24 @@ - int j = (int)p_72683_1_.posZ >> 4; - p_72683_1_.managedPosX = p_72683_1_.posX; - p_72683_1_.managedPosZ = p_72683_1_.posZ; + int j = (int)p_72683_1_.field_70161_v >> 4; + p_72683_1_.field_71131_d = p_72683_1_.field_70165_t; + p_72683_1_.field_71132_e = p_72683_1_.field_70161_v; + // Load nearby chunks first + List chunkList = Lists.newArrayList(); - for (int k = i - this.playerViewRadius; k <= i + this.playerViewRadius; ++k) + for (int k = i - this.field_72698_e; k <= i + this.field_72698_e; ++k) { - for (int l = j - this.playerViewRadius; l <= j + this.playerViewRadius; ++l) + for (int l = j - this.field_72698_e; l <= j + this.field_72698_e; ++l) { -- this.getPlayerInstance(k, l, true).addPlayer(p_72683_1_); +- this.func_72690_a(k, l, true).func_73255_a(p_72683_1_); + chunkList.add(new ChunkCoordIntPair(k, l)); } } @@ -20,14 +20,14 @@ + + for (ChunkCoordIntPair pair : chunkList) + { -+ this.getPlayerInstance(pair.chunkXPos, pair.chunkZPos, true).addPlayer(p_72683_1_); ++ this.func_72690_a(pair.field_77276_a, pair.field_77275_b, true).func_73255_a(p_72683_1_); + } + - this.players.add(p_72683_1_); - this.filterChunkLoadQueue(p_72683_1_); + this.field_72699_b.add(p_72683_1_); + this.func_72691_b(p_72683_1_); } @@ -225,6 +234,7 @@ - int i1 = this.playerViewRadius; + int i1 = this.field_72698_e; int j1 = i - k; int k1 = j - l; + List chunksToLoad = Lists.newArrayList(); @@ -36,36 +36,36 @@ { @@ -234,7 +244,7 @@ { - if (!this.overlaps(l1, i2, k, l, i1)) + if (!this.func_72684_a(l1, i2, k, l, i1)) { -- this.getPlayerInstance(l1, i2, true).addPlayer(p_72685_1_); +- this.func_72690_a(l1, i2, true).func_73255_a(p_72685_1_); + chunksToLoad.add(new ChunkCoordIntPair(l1, i2)); } - if (!this.overlaps(l1 - j1, i2 - k1, i, j, i1)) + if (!this.func_72684_a(l1 - j1, i2 - k1, i, j, i1)) @@ -252,6 +262,18 @@ - this.filterChunkLoadQueue(p_72685_1_); - p_72685_1_.managedPosX = p_72685_1_.posX; - p_72685_1_.managedPosZ = p_72685_1_.posZ; + this.func_72691_b(p_72685_1_); + p_72685_1_.field_71131_d = p_72685_1_.field_70165_t; + p_72685_1_.field_71132_e = p_72685_1_.field_70161_v; + // send nearest chunks first + java.util.Collections.sort(chunksToLoad, new net.minecraftforge.common.util.ChunkCoordComparator(p_72685_1_)); + + for (ChunkCoordIntPair pair : chunksToLoad) + { -+ this.getPlayerInstance(pair.chunkXPos, pair.chunkZPos, true).addPlayer(p_72685_1_); ++ this.func_72690_a(pair.field_77276_a, pair.field_77275_b, true).func_73255_a(p_72685_1_); + } + + if (i1 > 1 || i1 < -1 || j1 > 1 || j1 < -1) + { -+ java.util.Collections.sort(p_72685_1_.loadedChunks, new net.minecraftforge.common.util.ChunkCoordComparator(p_72685_1_)); ++ java.util.Collections.sort(p_72685_1_.field_71129_f, new net.minecraftforge.common.util.ChunkCoordComparator(p_72685_1_)); + } } } } @@ -322,11 +344,20 @@ - private int numBlocksToUpdate; - private int flagsYAreasToUpdate; - private long previousWorldTime; + private int field_73262_e; + private int field_73260_f; + private long field_111198_g; + private final java.util.HashMap players = new java.util.HashMap(); + private boolean loaded = false; + private Runnable loadedRunnable = new Runnable() @@ -78,20 +78,20 @@ public PlayerInstance(int p_i1518_2_, int p_i1518_3_) { - this.chunkCoords = new ChunkCoordIntPair(p_i1518_2_, p_i1518_3_); -- PlayerManager.this.getMinecraftServer().theChunkProviderServer.loadChunk(p_i1518_2_, p_i1518_3_); -+ PlayerManager.this.getMinecraftServer().theChunkProviderServer.loadChunk(p_i1518_2_, p_i1518_3_, this.loadedRunnable); + this.field_73264_c = new ChunkCoordIntPair(p_i1518_2_, p_i1518_3_); +- PlayerManager.this.func_72688_a().field_73059_b.func_73158_c(p_i1518_2_, p_i1518_3_); ++ PlayerManager.this.func_72688_a().field_73059_b.loadChunk(p_i1518_2_, p_i1518_3_, this.loadedRunnable); } - public void addPlayer(EntityPlayerMP p_73255_1_) + public void func_73255_a(EntityPlayerMP p_73255_1_) @@ -343,7 +374,24 @@ } - this.playersWatchingChunk.add(p_73255_1_); + this.field_73263_b.add(p_73255_1_); + Runnable playerRunnable = null; + if (this.loaded) + { - p_73255_1_.loadedChunks.add(this.chunkCoords); + p_73255_1_.field_71129_f.add(this.field_73264_c); + } + else + { @@ -100,10 +100,10 @@ + { + public void run() + { -+ tmp.loadedChunks.add(PlayerInstance.this.chunkCoords); ++ tmp.field_71129_f.add(PlayerInstance.this.field_73264_c); + } + }; -+ PlayerManager.this.getMinecraftServer().theChunkProviderServer.loadChunk(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos, playerRunnable); ++ PlayerManager.this.func_72688_a().field_73059_b.loadChunk(this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b, playerRunnable); + } + this.players.put(p_73255_1_, playerRunnable); } @@ -111,47 +111,47 @@ @@ -351,6 +399,24 @@ { - if (this.playersWatchingChunk.contains(p_73252_1_)) + if (this.field_73263_b.contains(p_73252_1_)) { + // If we haven't loaded yet don't load the chunk just so we can clean it up + if (!this.loaded) + { -+ net.minecraftforge.common.chunkio.ChunkIOExecutor.dropQueuedChunkLoad(PlayerManager.this.getMinecraftServer(), this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos, this.players.get(p_73252_1_)); -+ this.playersWatchingChunk.remove(p_73252_1_); ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.dropQueuedChunkLoad(PlayerManager.this.func_72688_a(), this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b, this.players.get(p_73252_1_)); ++ this.field_73263_b.remove(p_73252_1_); + this.players.remove(p_73252_1_); + -+ if (this.playersWatchingChunk.isEmpty()) ++ if (this.field_73263_b.isEmpty()) + { -+ net.minecraftforge.common.chunkio.ChunkIOExecutor.dropQueuedChunkLoad(PlayerManager.this.getMinecraftServer(), this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos, this.loadedRunnable); -+ long i = (long) this.chunkCoords.chunkXPos + 2147483647L | (long) this.chunkCoords.chunkZPos + 2147483647L << 32; -+ PlayerManager.this.playerInstances.remove(i); -+ PlayerManager.this.playerInstanceList.remove(this); ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.dropQueuedChunkLoad(PlayerManager.this.func_72688_a(), this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b, this.loadedRunnable); ++ long i = (long) this.field_73264_c.field_77276_a + 2147483647L | (long) this.field_73264_c.field_77275_b + 2147483647L << 32; ++ PlayerManager.this.field_72700_c.func_76159_d(i); ++ PlayerManager.this.field_111193_e.remove(this); + } + + return; + } + - Chunk chunk = PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos); + Chunk chunk = PlayerManager.this.field_72701_a.func_72964_e(this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b); - if (chunk.isPopulated()) + if (chunk.func_150802_k()) @@ -358,9 +424,12 @@ - p_73252_1_.playerNetServerHandler.sendPacket(new S21PacketChunkData(chunk, true, 0)); + p_73252_1_.field_71135_a.func_147359_a(new S21PacketChunkData(chunk, true, 0)); } + this.players.remove(p_73252_1_); - this.playersWatchingChunk.remove(p_73252_1_); - p_73252_1_.loadedChunks.remove(this.chunkCoords); + this.field_73263_b.remove(p_73252_1_); + p_73252_1_.field_71129_f.remove(this.field_73264_c); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.UnWatch(chunkCoords, p_73252_1_)); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.UnWatch(field_73264_c, p_73252_1_)); + - if (this.playersWatchingChunk.isEmpty()) + if (this.field_73263_b.isEmpty()) { - long i = (long)this.chunkCoords.chunkXPos + 2147483647L | (long)this.chunkCoords.chunkZPos + 2147483647L << 32; + long i = (long)this.field_73264_c.field_77276_a + 2147483647L | (long)this.field_73264_c.field_77275_b + 2147483647L << 32; @@ -398,7 +467,7 @@ - this.flagsYAreasToUpdate |= 1 << (p_151253_2_ >> 4); + this.field_73260_f |= 1 << (p_151253_2_ >> 4); -- if (this.numBlocksToUpdate < 64) +- if (this.field_73262_e < 64) + //Forge; Cache everything, so always run { short short1 = (short)(p_151253_1_ << 12 | p_151253_3_ << 8 | p_151253_2_); @@ -160,11 +160,11 @@ } } -+ if (numBlocksToUpdate == locationOfBlockChange.length) ++ if (field_73262_e == field_151254_d.length) + { -+ locationOfBlockChange = java.util.Arrays.copyOf(locationOfBlockChange, locationOfBlockChange.length << 1); ++ field_151254_d = java.util.Arrays.copyOf(field_151254_d, field_151254_d.length << 1); + } - this.locationOfBlockChange[this.numBlocksToUpdate++] = short1; + this.field_151254_d[this.field_73262_e++] = short1; } } @@ -427,6 +500,7 @@ @@ -172,49 +172,49 @@ } + @SuppressWarnings("unused") - public void onUpdate() + public void func_73254_a() { - if (this.numBlocksToUpdate != 0) + if (this.field_73262_e != 0) @@ -439,18 +513,19 @@ BlockPos blockpos = new BlockPos(i, j, k); - this.sendToAllPlayersWatchingChunk(new S23PacketBlockChange(PlayerManager.this.theWorldServer, blockpos)); + this.func_151251_a(new S23PacketBlockChange(PlayerManager.this.field_72701_a, blockpos)); -- if (PlayerManager.this.theWorldServer.getBlockState(blockpos).getBlock().hasTileEntity()) -+ if (PlayerManager.this.theWorldServer.getBlockState(blockpos).getBlock().hasTileEntity(PlayerManager.this.theWorldServer.getBlockState(blockpos))) +- if (PlayerManager.this.field_72701_a.func_180495_p(blockpos).func_177230_c().func_149716_u()) ++ if (PlayerManager.this.field_72701_a.func_180495_p(blockpos).func_177230_c().hasTileEntity(PlayerManager.this.field_72701_a.func_180495_p(blockpos))) { - this.sendTileToAllPlayersWatchingChunk(PlayerManager.this.theWorldServer.getTileEntity(blockpos)); + this.func_151252_a(PlayerManager.this.field_72701_a.func_175625_s(blockpos)); } } -- else if (this.numBlocksToUpdate == 64) -+ else if (this.numBlocksToUpdate >= net.minecraftforge.common.ForgeModContainer.clumpingThreshold) +- else if (this.field_73262_e == 64) ++ else if (this.field_73262_e >= net.minecraftforge.common.ForgeModContainer.clumpingThreshold) { - int i1 = this.chunkCoords.chunkXPos * 16; - int k1 = this.chunkCoords.chunkZPos * 16; - this.sendToAllPlayersWatchingChunk(new S21PacketChunkData(PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos), false, this.flagsYAreasToUpdate)); + int i1 = this.field_73264_c.field_77276_a * 16; + int k1 = this.field_73264_c.field_77275_b * 16; + this.func_151251_a(new S21PacketChunkData(PlayerManager.this.field_72701_a.func_72964_e(this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b), false, this.field_73260_f)); - for (int i2 = 0; i2 < 16; ++i2) + // Forge: Grabs ALL tile entities is costly on a modded server, only send needed ones + for (int i2 = 0; false && i2 < 16; ++i2) { - if ((this.flagsYAreasToUpdate & 1 << i2) != 0) + if ((this.field_73260_f & 1 << i2) != 0) { @@ -467,7 +542,9 @@ else { - this.sendToAllPlayersWatchingChunk(new S22PacketMultiBlockChange(this.numBlocksToUpdate, this.locationOfBlockChange, PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos))); + this.func_151251_a(new S22PacketMultiBlockChange(this.field_73262_e, this.field_151254_d, PlayerManager.this.field_72701_a.func_72964_e(this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b))); - + } + { // Forge: Send only the tile entities that are updated, Adding this brace lets us keep the indent and the patch small -+ WorldServer world = PlayerManager.this.theWorldServer; - for (int j1 = 0; j1 < this.numBlocksToUpdate; ++j1) ++ WorldServer world = PlayerManager.this.field_72701_a; + for (int j1 = 0; j1 < this.field_73262_e; ++j1) { - int l1 = (this.locationOfBlockChange[j1] >> 12 & 15) + this.chunkCoords.chunkXPos * 16; + int l1 = (this.field_151254_d[j1] >> 12 & 15) + this.field_73264_c.field_77276_a * 16; @@ -475,7 +552,7 @@ - int l2 = (this.locationOfBlockChange[j1] >> 8 & 15) + this.chunkCoords.chunkZPos * 16; + int l2 = (this.field_151254_d[j1] >> 8 & 15) + this.field_73264_c.field_77275_b * 16; BlockPos blockpos1 = new BlockPos(l1, j2, l2); -- if (PlayerManager.this.theWorldServer.getBlockState(blockpos1).getBlock().hasTileEntity()) -+ if (world.getBlockState(blockpos1).getBlock().hasTileEntity(world.getBlockState(blockpos1))) +- if (PlayerManager.this.field_72701_a.func_180495_p(blockpos1).func_177230_c().func_149716_u()) ++ if (world.func_180495_p(blockpos1).func_177230_c().hasTileEntity(world.func_180495_p(blockpos1))) { - this.sendTileToAllPlayersWatchingChunk(PlayerManager.this.theWorldServer.getTileEntity(blockpos1)); + this.func_151252_a(PlayerManager.this.field_72701_a.func_175625_s(blockpos1)); } diff --git a/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch b/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch index 49fa524a5..2f7ace96d 100644 --- a/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch +++ b/patches/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch @@ -1,54 +1,54 @@ --- ../src-base/minecraft/net/minecraft/server/management/ServerConfigurationManager.java +++ ../src-work/minecraft/net/minecraft/server/management/ServerConfigurationManager.java @@ -99,7 +99,7 @@ - this.maxPlayers = 8; + this.field_72405_c = 8; } -- public void initializeConnectionToPlayer(NetworkManager netManager, EntityPlayerMP playerIn) -+ public void initializeConnectionToPlayer(NetworkManager netManager, EntityPlayerMP playerIn, NetHandlerPlayServer nethandlerplayserver) +- public void func_72355_a(NetworkManager p_72355_1_, EntityPlayerMP p_72355_2_) ++ public void func_72355_a(NetworkManager p_72355_1_, EntityPlayerMP p_72355_2_, NetHandlerPlayServer nethandlerplayserver) { - GameProfile gameprofile = playerIn.getGameProfile(); - PlayerProfileCache playerprofilecache = this.mcServer.getPlayerProfileCache(); + GameProfile gameprofile = p_72355_2_.func_146103_bH(); + PlayerProfileCache playerprofilecache = this.field_72400_f.func_152358_ax(); @@ -108,6 +108,17 @@ playerprofilecache.func_152649_a(gameprofile); - NBTTagCompound nbttagcompound = this.readPlayerDataFromFile(playerIn); - playerIn.setWorld(this.mcServer.worldServerForDimension(playerIn.dimension)); + NBTTagCompound nbttagcompound = this.func_72380_a(p_72355_2_); + p_72355_2_.func_70029_a(this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK)); + -+ World playerWorld = this.mcServer.worldServerForDimension(playerIn.dimension); ++ World playerWorld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK); + if (playerWorld == null) + { -+ playerIn.dimension=0; -+ playerWorld=this.mcServer.worldServerForDimension(0); -+ BlockPos spawnPoint = playerWorld.provider.getRandomizedSpawnPoint(); -+ playerIn.setPosition(spawnPoint.getX(), spawnPoint.getY(), spawnPoint.getZ()); ++ p_72355_2_.field_71093_bK=0; ++ playerWorld=this.field_72400_f.func_71218_a(0); ++ BlockPos spawnPoint = playerWorld.field_73011_w.getRandomizedSpawnPoint(); ++ p_72355_2_.func_70107_b(spawnPoint.func_177958_n(), spawnPoint.func_177956_o(), spawnPoint.func_177952_p()); + } + -+ playerIn.setWorld(playerWorld); - playerIn.theItemInWorldManager.setWorld((WorldServer)playerIn.worldObj); ++ p_72355_2_.func_70029_a(playerWorld); + p_72355_2_.field_71134_c.func_73080_a((WorldServer)p_72355_2_.field_70170_p); String s1 = "local"; @@ -121,7 +132,7 @@ - WorldInfo worldinfo = worldserver.getWorldInfo(); - BlockPos blockpos = worldserver.getSpawnPoint(); - this.func_72381_a(playerIn, (EntityPlayerMP)null, worldserver); -- NetHandlerPlayServer nethandlerplayserver = new NetHandlerPlayServer(this.mcServer, netManager, playerIn); -+ playerIn.playerNetServerHandler = nethandlerplayserver; - nethandlerplayserver.sendPacket(new S01PacketJoinGame(playerIn.getEntityId(), playerIn.theItemInWorldManager.getGameType(), worldinfo.isHardcoreModeEnabled(), worldserver.provider.getDimensionId(), worldserver.getDifficulty(), this.getMaxPlayers(), worldinfo.getTerrainType(), worldserver.getGameRules().getGameRuleBooleanValue("reducedDebugInfo"))); - nethandlerplayserver.sendPacket(new S3FPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(this.getServerInstance().getServerModName()))); - nethandlerplayserver.sendPacket(new S41PacketServerDifficulty(worldinfo.getDifficulty(), worldinfo.isDifficultyLocked())); + WorldInfo worldinfo = worldserver.func_72912_H(); + BlockPos blockpos = worldserver.func_175694_M(); + this.func_72381_a(p_72355_2_, (EntityPlayerMP)null, worldserver); +- NetHandlerPlayServer nethandlerplayserver = new NetHandlerPlayServer(this.field_72400_f, p_72355_1_, p_72355_2_); ++ p_72355_2_.field_71135_a = nethandlerplayserver; + nethandlerplayserver.func_147359_a(new S01PacketJoinGame(p_72355_2_.func_145782_y(), p_72355_2_.field_71134_c.func_73081_b(), worldinfo.func_76093_s(), worldserver.field_73011_w.func_177502_q(), worldserver.func_175659_aa(), this.func_72352_l(), worldinfo.func_76067_t(), worldserver.func_82736_K().func_82766_b("reducedDebugInfo"))); + nethandlerplayserver.func_147359_a(new S3FPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).func_180714_a(this.func_72365_p().getServerModName()))); + nethandlerplayserver.func_147359_a(new S41PacketServerDifficulty(worldinfo.func_176130_y(), worldinfo.func_176123_z())); @@ -161,6 +172,7 @@ - playerIn.addSelfToInternalCraftingInventory(); + p_72355_2_.func_71116_b(); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerLoggedIn(playerIn); - if (nbttagcompound != null && nbttagcompound.hasKey("Riding", 10)) ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerLoggedIn(p_72355_2_); + if (nbttagcompound != null && nbttagcompound.func_150297_b("Riding", 10)) { - Entity entity = EntityList.createEntityFromNBT(nbttagcompound.getCompoundTag("Riding"), worldserver); + Entity entity = EntityList.func_75615_a(nbttagcompound.func_74775_l("Riding"), worldserver); @@ -262,6 +274,7 @@ - playerIn.readFromNBT(nbttagcompound); + p_72380_1_.func_70020_e(nbttagcompound); nbttagcompound1 = nbttagcompound; - logger.debug("loading single player"); -+ net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(playerIn, this.playerNBTManagerObj, playerIn.getUniqueID().toString()); + field_148546_d.debug("loading single player"); ++ net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(p_72380_1_, this.field_72412_k, p_72380_1_.func_110124_au().toString()); } else { @@ -59,165 +59,165 @@ + public NBTTagCompound getPlayerNBT(EntityPlayerMP player) + { + // Hacky method to allow loading the NBT for a player prior to login -+ NBTTagCompound nbttagcompound = this.mcServer.worldServers[0].getWorldInfo().getPlayerNBTTagCompound(); -+ if (player.getName().equals(this.mcServer.getServerOwner()) && nbttagcompound != null) ++ NBTTagCompound nbttagcompound = this.field_72400_f.field_71305_c[0].func_72912_H().func_76072_h(); ++ if (player.func_70005_c_().equals(this.field_72400_f.func_71214_G()) && nbttagcompound != null) + { + return nbttagcompound; + } + else + { -+ return ((net.minecraft.world.storage.SaveHandler)this.playerNBTManagerObj).getPlayerNBT(player); ++ return ((net.minecraft.world.storage.SaveHandler)this.field_72412_k).getPlayerNBT(player); + } + } - protected void writePlayerData(EntityPlayerMP playerIn) + protected void func_72391_b(EntityPlayerMP p_72391_1_) { -+ if (playerIn.playerNetServerHandler == null) return; ++ if (p_72391_1_.field_71135_a == null) return; + - this.playerNBTManagerObj.writePlayerData(playerIn); - StatisticsFile statisticsfile = (StatisticsFile)this.playerStatFiles.get(playerIn.getUniqueID()); + this.field_72412_k.func_75753_a(p_72391_1_); + StatisticsFile statisticsfile = (StatisticsFile)this.field_148547_k.get(p_72391_1_.func_110124_au()); @@ -288,6 +316,7 @@ - this.uuidToPlayerMap.put(playerIn.getUniqueID(), playerIn); - this.sendPacketToAllPlayers(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.ADD_PLAYER, new EntityPlayerMP[] {playerIn})); - WorldServer worldserver = this.mcServer.worldServerForDimension(playerIn.dimension); -+ net.minecraftforge.common.chunkio.ChunkIOExecutor.adjustPoolSize(this.getCurrentPlayerCount()); - worldserver.spawnEntityInWorld(playerIn); - this.func_72375_a(playerIn, (WorldServer)null); + this.field_177454_f.put(p_72377_1_.func_110124_au(), p_72377_1_); + this.func_148540_a(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.ADD_PLAYER, new EntityPlayerMP[] {p_72377_1_})); + WorldServer worldserver = this.field_72400_f.func_71218_a(p_72377_1_.field_71093_bK); ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.adjustPoolSize(this.func_72394_k()); + worldserver.func_72838_d(p_72377_1_); + this.func_72375_a(p_72377_1_, (WorldServer)null); @@ -305,6 +334,7 @@ - public void playerLoggedOut(EntityPlayerMP playerIn) + public void func_72367_e(EntityPlayerMP p_72367_1_) { -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerLoggedOut(playerIn); - playerIn.triggerAchievement(StatList.leaveGameStat); - this.writePlayerData(playerIn); - WorldServer worldserver = playerIn.getServerForPlayer(); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerLoggedOut(p_72367_1_); + p_72367_1_.func_71029_a(StatList.field_75947_j); + this.func_72391_b(p_72367_1_); + WorldServer worldserver = p_72367_1_.func_71121_q(); @@ -326,6 +356,7 @@ - this.uuidToPlayerMap.remove(uuid); - this.playerStatFiles.remove(uuid); + this.field_177454_f.remove(uuid); + this.field_148547_k.remove(uuid); } -+ net.minecraftforge.common.chunkio.ChunkIOExecutor.adjustPoolSize(this.getCurrentPlayerCount()); ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.adjustPoolSize(this.func_72394_k()); - this.sendPacketToAllPlayers(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.REMOVE_PLAYER, new EntityPlayerMP[] {playerIn})); + this.func_148540_a(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.REMOVE_PLAYER, new EntityPlayerMP[] {p_72367_1_})); } @@ -409,13 +440,23 @@ - public EntityPlayerMP recreatePlayerEntity(EntityPlayerMP playerIn, int dimension, boolean conqueredEnd) + public EntityPlayerMP func_72368_a(EntityPlayerMP p_72368_1_, int p_72368_2_, boolean p_72368_3_) { -+ World world = mcServer.worldServerForDimension(dimension); ++ World world = field_72400_f.func_71218_a(p_72368_2_); + if (world == null) + { -+ dimension = 0; ++ p_72368_2_ = 0; + } -+ else if (!world.provider.canRespawnHere()) ++ else if (!world.field_73011_w.func_76567_e()) + { -+ dimension = world.provider.getRespawnDimension(playerIn); ++ p_72368_2_ = world.field_73011_w.getRespawnDimension(p_72368_1_); + } + - playerIn.getServerForPlayer().getEntityTracker().removePlayerFromTrackers(playerIn); - playerIn.getServerForPlayer().getEntityTracker().untrackEntity(playerIn); - playerIn.getServerForPlayer().getPlayerManager().removePlayer(playerIn); - this.playerEntityList.remove(playerIn); - this.mcServer.worldServerForDimension(playerIn.dimension).removePlayerEntityDangerously(playerIn); -- BlockPos blockpos = playerIn.getBedLocation(); -- boolean flag = playerIn.isSpawnForced(); -+ BlockPos blockpos = playerIn.getBedLocation(dimension); -+ boolean flag = playerIn.isSpawnForced(dimension); - playerIn.dimension = dimension; + p_72368_1_.func_71121_q().func_73039_n().func_72787_a(p_72368_1_); + p_72368_1_.func_71121_q().func_73039_n().func_72790_b(p_72368_1_); + p_72368_1_.func_71121_q().func_73040_p().func_72695_c(p_72368_1_); + this.field_72404_b.remove(p_72368_1_); + this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK).func_72973_f(p_72368_1_); +- BlockPos blockpos = p_72368_1_.func_180470_cg(); +- boolean flag = p_72368_1_.func_82245_bX(); ++ BlockPos blockpos = p_72368_1_.getBedLocation(p_72368_2_); ++ boolean flag = p_72368_1_.isSpawnForced(p_72368_2_); + p_72368_1_.field_71093_bK = p_72368_2_; ItemInWorldManager iteminworldmanager; @@ -431,6 +472,7 @@ - EntityPlayerMP entityplayermp = new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(playerIn.dimension), playerIn.getGameProfile(), iteminworldmanager); - entityplayermp.playerNetServerHandler = playerIn.playerNetServerHandler; - entityplayermp.clonePlayer(playerIn, conqueredEnd); -+ entityplayermp.dimension = dimension; - entityplayermp.setEntityId(playerIn.getEntityId()); - entityplayermp.func_174817_o(playerIn); - WorldServer worldserver = this.mcServer.worldServerForDimension(playerIn.dimension); + EntityPlayerMP entityplayermp = new EntityPlayerMP(this.field_72400_f, this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK), p_72368_1_.func_146103_bH(), iteminworldmanager); + entityplayermp.field_71135_a = p_72368_1_.field_71135_a; + entityplayermp.func_71049_a(p_72368_1_, p_72368_3_); ++ entityplayermp.field_71093_bK = p_72368_2_; + entityplayermp.func_145769_d(p_72368_1_.func_145782_y()); + entityplayermp.func_174817_o(p_72368_1_); + WorldServer worldserver = this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK); @@ -470,19 +512,25 @@ - this.uuidToPlayerMap.put(entityplayermp.getUniqueID(), entityplayermp); - entityplayermp.addSelfToInternalCraftingInventory(); - entityplayermp.setHealth(entityplayermp.getHealth()); + this.field_177454_f.put(entityplayermp.func_110124_au(), entityplayermp); + entityplayermp.func_71116_b(); + entityplayermp.func_70606_j(entityplayermp.func_110143_aJ()); + net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerRespawnEvent(entityplayermp); return entityplayermp; } - public void transferPlayerToDimension(EntityPlayerMP playerIn, int dimension) + public void func_72356_a(EntityPlayerMP p_72356_1_, int p_72356_2_) { -+ transferPlayerToDimension(playerIn, dimension, mcServer.worldServerForDimension(dimension).getDefaultTeleporter()); ++ transferPlayerToDimension(p_72356_1_, p_72356_2_, field_72400_f.func_71218_a(p_72356_2_).func_85176_s()); + } + -+ public void transferPlayerToDimension(EntityPlayerMP playerIn, int dimension, net.minecraft.world.Teleporter teleporter) ++ public void transferPlayerToDimension(EntityPlayerMP p_72356_1_, int p_72356_2_, net.minecraft.world.Teleporter teleporter) + { - int i = playerIn.dimension; - WorldServer worldserver = this.mcServer.worldServerForDimension(playerIn.dimension); - playerIn.dimension = dimension; - WorldServer worldserver1 = this.mcServer.worldServerForDimension(playerIn.dimension); -- playerIn.playerNetServerHandler.sendPacket(new S07PacketRespawn(playerIn.dimension, playerIn.worldObj.getDifficulty(), playerIn.worldObj.getWorldInfo().getTerrainType(), playerIn.theItemInWorldManager.getGameType())); -+ playerIn.playerNetServerHandler.sendPacket(new S07PacketRespawn(playerIn.dimension, worldserver1.getDifficulty(), worldserver1.getWorldInfo().getTerrainType(), playerIn.theItemInWorldManager.getGameType())); - worldserver.removePlayerEntityDangerously(playerIn); - playerIn.isDead = false; -- this.transferEntityToWorld(playerIn, i, worldserver, worldserver1); -+ this.transferEntityToWorld(playerIn, i, worldserver, worldserver1, teleporter); - this.func_72375_a(playerIn, worldserver); - playerIn.playerNetServerHandler.setPlayerLocation(playerIn.posX, playerIn.posY, playerIn.posZ, playerIn.rotationYaw, playerIn.rotationPitch); - playerIn.theItemInWorldManager.setWorld(worldserver1); + int i = p_72356_1_.field_71093_bK; + WorldServer worldserver = this.field_72400_f.func_71218_a(p_72356_1_.field_71093_bK); + p_72356_1_.field_71093_bK = p_72356_2_; + WorldServer worldserver1 = this.field_72400_f.func_71218_a(p_72356_1_.field_71093_bK); +- p_72356_1_.field_71135_a.func_147359_a(new S07PacketRespawn(p_72356_1_.field_71093_bK, p_72356_1_.field_70170_p.func_175659_aa(), p_72356_1_.field_70170_p.func_72912_H().func_76067_t(), p_72356_1_.field_71134_c.func_73081_b())); ++ p_72356_1_.field_71135_a.func_147359_a(new S07PacketRespawn(p_72356_1_.field_71093_bK, worldserver1.func_175659_aa(), worldserver1.func_72912_H().func_76067_t(), p_72356_1_.field_71134_c.func_73081_b())); + worldserver.func_72973_f(p_72356_1_); + p_72356_1_.field_70128_L = false; +- this.func_82448_a(p_72356_1_, i, worldserver, worldserver1); ++ this.transferEntityToWorld(p_72356_1_, i, worldserver, worldserver1, teleporter); + this.func_72375_a(p_72356_1_, worldserver); + p_72356_1_.field_71135_a.func_147364_a(p_72356_1_.field_70165_t, p_72356_1_.field_70163_u, p_72356_1_.field_70161_v, p_72356_1_.field_70177_z, p_72356_1_.field_70125_A); + p_72356_1_.field_71134_c.func_73080_a(worldserver1); @@ -493,17 +541,27 @@ { - playerIn.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(playerIn.getEntityId(), potioneffect)); + p_72356_1_.field_71135_a.func_147359_a(new S1DPacketEntityEffect(p_72356_1_.func_145782_y(), potioneffect)); } -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerChangedDimensionEvent(playerIn, i, dimension); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerChangedDimensionEvent(p_72356_1_, i, p_72356_2_); } - public void transferEntityToWorld(Entity entityIn, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_) + public void func_82448_a(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_) { -- double d0 = entityIn.posX; -- double d1 = entityIn.posZ; -+ transferEntityToWorld(entityIn, p_82448_2_, p_82448_3_, p_82448_4_, p_82448_4_.getDefaultTeleporter()); +- double d0 = p_82448_1_.field_70165_t; +- double d1 = p_82448_1_.field_70161_v; ++ transferEntityToWorld(p_82448_1_, p_82448_2_, p_82448_3_, p_82448_4_, p_82448_4_.func_85176_s()); + } + + @SuppressWarnings("unused") -+ public void transferEntityToWorld(Entity entityIn, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_, net.minecraft.world.Teleporter teleporter) ++ public void transferEntityToWorld(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_, net.minecraft.world.Teleporter teleporter) + { -+ net.minecraft.world.WorldProvider pOld = p_82448_3_.provider; -+ net.minecraft.world.WorldProvider pNew = p_82448_4_.provider; ++ net.minecraft.world.WorldProvider pOld = p_82448_3_.field_73011_w; ++ net.minecraft.world.WorldProvider pNew = p_82448_4_.field_73011_w; + double moveFactor = pOld.getMovementFactor() / pNew.getMovementFactor(); -+ double d0 = entityIn.posX * moveFactor; -+ double d1 = entityIn.posZ * moveFactor; ++ double d0 = p_82448_1_.field_70165_t * moveFactor; ++ double d1 = p_82448_1_.field_70161_v * moveFactor; double d2 = 8.0D; - float f = entityIn.rotationYaw; - p_82448_3_.theProfiler.startSection("moving"); + float f = p_82448_1_.field_70177_z; + p_82448_3_.field_72984_F.func_76320_a("moving"); -- if (entityIn.dimension == -1) -+ if (false && entityIn.dimension == -1) //Forge Kill it but dont comment out so we can rename it. +- if (p_82448_1_.field_71093_bK == -1) ++ if (false && p_82448_1_.field_71093_bK == -1) //Forge Kill it but dont comment out so we can rename it. { - d0 = MathHelper.clamp_double(d0 / d2, p_82448_4_.getWorldBorder().minX() + 16.0D, p_82448_4_.getWorldBorder().maxX() - 16.0D); - d1 = MathHelper.clamp_double(d1 / d2, p_82448_4_.getWorldBorder().minZ() + 16.0D, p_82448_4_.getWorldBorder().maxZ() - 16.0D); + d0 = MathHelper.func_151237_a(d0 / d2, p_82448_4_.func_175723_af().func_177726_b() + 16.0D, p_82448_4_.func_175723_af().func_177728_d() - 16.0D); + d1 = MathHelper.func_151237_a(d1 / d2, p_82448_4_.func_175723_af().func_177736_c() + 16.0D, p_82448_4_.func_175723_af().func_177733_e() - 16.0D); @@ -514,7 +572,7 @@ - p_82448_3_.updateEntityWithOptionalForce(entityIn, false); + p_82448_3_.func_72866_a(p_82448_1_, false); } } -- else if (entityIn.dimension == 0) -+ else if (false && entityIn.dimension == 0) //Forge Kill it but dont comment out so we can rename it. +- else if (p_82448_1_.field_71093_bK == 0) ++ else if (false && p_82448_1_.field_71093_bK == 0) //Forge Kill it but dont comment out so we can rename it. { - d0 = MathHelper.clamp_double(d0 * d2, p_82448_4_.getWorldBorder().minX() + 16.0D, p_82448_4_.getWorldBorder().maxX() - 16.0D); - d1 = MathHelper.clamp_double(d1 * d2, p_82448_4_.getWorldBorder().minZ() + 16.0D, p_82448_4_.getWorldBorder().maxZ() - 16.0D); + d0 = MathHelper.func_151237_a(d0 * d2, p_82448_4_.func_175723_af().func_177726_b() + 16.0D, p_82448_4_.func_175723_af().func_177728_d() - 16.0D); + d1 = MathHelper.func_151237_a(d1 * d2, p_82448_4_.func_175723_af().func_177736_c() + 16.0D, p_82448_4_.func_175723_af().func_177733_e() - 16.0D); @@ -525,7 +583,8 @@ - p_82448_3_.updateEntityWithOptionalForce(entityIn, false); + p_82448_3_.func_72866_a(p_82448_1_, false); } } - else + -+ if (entityIn.dimension == 1) ++ if (p_82448_1_.field_71093_bK == 1) { BlockPos blockpos; @@ -560,7 +619,7 @@ - if (entityIn.isEntityAlive()) + if (p_82448_1_.func_70089_S()) { - entityIn.setLocationAndAngles(d0, entityIn.posY, d1, entityIn.rotationYaw, entityIn.rotationPitch); -- p_82448_4_.getDefaultTeleporter().placeInPortal(entityIn, f); -+ teleporter.placeInPortal(entityIn, f); - p_82448_4_.spawnEntityInWorld(entityIn); - p_82448_4_.updateEntityWithOptionalForce(entityIn, false); + p_82448_1_.func_70012_b(d0, p_82448_1_.field_70163_u, d1, p_82448_1_.field_70177_z, p_82448_1_.field_70125_A); +- p_82448_4_.func_85176_s().func_180266_a(p_82448_1_, f); ++ teleporter.func_180266_a(p_82448_1_, f); + p_82448_4_.func_72838_d(p_82448_1_); + p_82448_4_.func_72866_a(p_82448_1_, false); } diff --git a/patches/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch b/patches/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch index 6c4b46942..876f48a73 100644 --- a/patches/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch +++ b/patches/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java @@ -22,6 +22,8 @@ - public void processHandshake(C00Handshake packetIn) + public void func_147383_a(C00Handshake p_147383_1_) { -+ if (!net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerHandshake(packetIn, this.networkManager)) return; ++ if (!net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerHandshake(p_147383_1_, this.field_147386_b)) return; + - switch (packetIn.getRequestedState()) + switch (p_147383_1_.func_149594_c()) { case LOGIN: diff --git a/patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch b/patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch index 207663b90..ad1cf3005 100644 --- a/patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch +++ b/patches/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch @@ -3,24 +3,24 @@ @@ -66,12 +66,12 @@ if (entityplayermp == null) { - this.currentLoginState = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; -- this.server.getConfigurationManager().initializeConnectionToPlayer(this.networkManager, this.field_181025_l); -+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.server.getConfigurationManager(), this.networkManager, this.field_181025_l); + this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; +- this.field_147327_f.func_71203_ab().func_72355_a(this.field_147333_a, this.field_181025_l); ++ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.field_147327_f.func_71203_ab(), this.field_147333_a, this.field_181025_l); this.field_181025_l = null; } } -- if (this.connectionTimer++ == 600) -+ if (this.connectionTimer++ == net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.LOGIN_TIMEOUT) +- if (this.field_147336_h++ == 600) ++ if (this.field_147336_h++ == net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.LOGIN_TIMEOUT) { - this.closeConnection("Took too long to log in"); + this.func_147322_a("Took too long to log in"); } @@ -130,7 +130,7 @@ } else { -- this.server.getConfigurationManager().initializeConnectionToPlayer(this.networkManager, this.server.getConfigurationManager().createPlayerForUser(this.loginGameProfile)); -+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.server.getConfigurationManager(), this.networkManager, this.server.getConfigurationManager().createPlayerForUser(this.loginGameProfile)); +- this.field_147327_f.func_71203_ab().func_72355_a(this.field_147333_a, this.field_147327_f.func_71203_ab().func_148545_a(this.field_147337_i)); ++ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.field_147327_f.func_71203_ab(), this.field_147333_a, this.field_147327_f.func_71203_ab().func_148545_a(this.field_147337_i)); } } } diff --git a/patches/minecraft/net/minecraft/stats/StatList.java.patch b/patches/minecraft/net/minecraft/stats/StatList.java.patch index 1ebd7b50f..08c48aaf6 100644 --- a/patches/minecraft/net/minecraft/stats/StatList.java.patch +++ b/patches/minecraft/net/minecraft/stats/StatList.java.patch @@ -4,35 +4,35 @@ } } -- replaceAllSimilarBlocks(objectCraftStats); -+ replaceAllSimilarBlocks(objectCraftStats, true); +- func_75924_a(field_75928_D); ++ replaceAllSimilarBlocks(field_75928_D, true); } - private static void initMiningStats() + private static void func_151181_c() @@ -141,7 +141,7 @@ } } -- replaceAllSimilarBlocks(mineBlockStatArray); -+ replaceAllSimilarBlocks(mineBlockStatArray, false); +- func_75924_a(field_75934_C); ++ replaceAllSimilarBlocks(field_75934_C, false); } - private static void initStats() + private static void func_75925_c() @@ -165,7 +165,7 @@ } } -- replaceAllSimilarBlocks(objectUseStats); -+ replaceAllSimilarBlocks(objectUseStats, true); +- func_75924_a(field_75929_E); ++ replaceAllSimilarBlocks(field_75929_E, true); } - private static void initItemDepleteStats() + private static void func_151179_e() @@ -184,7 +184,7 @@ } } -- replaceAllSimilarBlocks(objectBreakStats); -+ replaceAllSimilarBlocks(objectBreakStats, true); +- func_75924_a(field_75930_F); ++ replaceAllSimilarBlocks(field_75930_F, true); } private static String func_180204_a(Item p_180204_0_) @@ -40,52 +40,52 @@ return resourcelocation != null ? resourcelocation.toString().replace(':', '.') : null; } -- private static void replaceAllSimilarBlocks(StatBase[] p_75924_0_) +- private static void func_75924_a(StatBase[] p_75924_0_) + private static void replaceAllSimilarBlocks(StatBase[] p_75924_0_, boolean useItemIds) { -- func_151180_a(p_75924_0_, Blocks.water, Blocks.flowing_water); -- func_151180_a(p_75924_0_, Blocks.lava, Blocks.flowing_lava); -- func_151180_a(p_75924_0_, Blocks.lit_pumpkin, Blocks.pumpkin); -- func_151180_a(p_75924_0_, Blocks.lit_furnace, Blocks.furnace); -- func_151180_a(p_75924_0_, Blocks.lit_redstone_ore, Blocks.redstone_ore); -- func_151180_a(p_75924_0_, Blocks.powered_repeater, Blocks.unpowered_repeater); -- func_151180_a(p_75924_0_, Blocks.powered_comparator, Blocks.unpowered_comparator); -- func_151180_a(p_75924_0_, Blocks.redstone_torch, Blocks.unlit_redstone_torch); -- func_151180_a(p_75924_0_, Blocks.lit_redstone_lamp, Blocks.redstone_lamp); -- func_151180_a(p_75924_0_, Blocks.double_stone_slab, Blocks.stone_slab); -- func_151180_a(p_75924_0_, Blocks.double_wooden_slab, Blocks.wooden_slab); -- func_151180_a(p_75924_0_, Blocks.double_stone_slab2, Blocks.stone_slab2); -- func_151180_a(p_75924_0_, Blocks.grass, Blocks.dirt); -- func_151180_a(p_75924_0_, Blocks.farmland, Blocks.dirt); -+ func_151180_a(p_75924_0_, Blocks.water, Blocks.flowing_water, useItemIds); -+ func_151180_a(p_75924_0_, Blocks.lava, Blocks.flowing_lava, useItemIds); -+ func_151180_a(p_75924_0_, Blocks.lit_pumpkin, Blocks.pumpkin, useItemIds); -+ func_151180_a(p_75924_0_, Blocks.lit_furnace, Blocks.furnace, useItemIds); -+ func_151180_a(p_75924_0_, Blocks.lit_redstone_ore, Blocks.redstone_ore, useItemIds); -+ func_151180_a(p_75924_0_, Blocks.powered_repeater, Blocks.unpowered_repeater, useItemIds); -+ func_151180_a(p_75924_0_, Blocks.powered_comparator, Blocks.unpowered_comparator, useItemIds); -+ func_151180_a(p_75924_0_, Blocks.redstone_torch, Blocks.unlit_redstone_torch, useItemIds); -+ func_151180_a(p_75924_0_, Blocks.lit_redstone_lamp, Blocks.redstone_lamp, useItemIds); -+ func_151180_a(p_75924_0_, Blocks.double_stone_slab, Blocks.stone_slab, useItemIds); -+ func_151180_a(p_75924_0_, Blocks.double_wooden_slab, Blocks.wooden_slab, useItemIds); -+ func_151180_a(p_75924_0_, Blocks.double_stone_slab2, Blocks.stone_slab2, useItemIds); -+ func_151180_a(p_75924_0_, Blocks.grass, Blocks.dirt, useItemIds); -+ func_151180_a(p_75924_0_, Blocks.farmland, Blocks.dirt, useItemIds); +- func_151180_a(p_75924_0_, Blocks.field_150355_j, Blocks.field_150358_i); +- func_151180_a(p_75924_0_, Blocks.field_150353_l, Blocks.field_150356_k); +- func_151180_a(p_75924_0_, Blocks.field_150428_aP, Blocks.field_150423_aK); +- func_151180_a(p_75924_0_, Blocks.field_150470_am, Blocks.field_150460_al); +- func_151180_a(p_75924_0_, Blocks.field_150439_ay, Blocks.field_150450_ax); +- func_151180_a(p_75924_0_, Blocks.field_150416_aS, Blocks.field_150413_aR); +- func_151180_a(p_75924_0_, Blocks.field_150455_bV, Blocks.field_150441_bU); +- func_151180_a(p_75924_0_, Blocks.field_150429_aA, Blocks.field_150437_az); +- func_151180_a(p_75924_0_, Blocks.field_150374_bv, Blocks.field_150379_bu); +- func_151180_a(p_75924_0_, Blocks.field_150334_T, Blocks.field_150333_U); +- func_151180_a(p_75924_0_, Blocks.field_150373_bw, Blocks.field_150376_bx); +- func_151180_a(p_75924_0_, Blocks.field_180388_cO, Blocks.field_180389_cP); +- func_151180_a(p_75924_0_, Blocks.field_150349_c, Blocks.field_150346_d); +- func_151180_a(p_75924_0_, Blocks.field_150458_ak, Blocks.field_150346_d); ++ func_151180_a(p_75924_0_, Blocks.field_150355_j, Blocks.field_150358_i, useItemIds); ++ func_151180_a(p_75924_0_, Blocks.field_150353_l, Blocks.field_150356_k, useItemIds); ++ func_151180_a(p_75924_0_, Blocks.field_150428_aP, Blocks.field_150423_aK, useItemIds); ++ func_151180_a(p_75924_0_, Blocks.field_150470_am, Blocks.field_150460_al, useItemIds); ++ func_151180_a(p_75924_0_, Blocks.field_150439_ay, Blocks.field_150450_ax, useItemIds); ++ func_151180_a(p_75924_0_, Blocks.field_150416_aS, Blocks.field_150413_aR, useItemIds); ++ func_151180_a(p_75924_0_, Blocks.field_150455_bV, Blocks.field_150441_bU, useItemIds); ++ func_151180_a(p_75924_0_, Blocks.field_150429_aA, Blocks.field_150437_az, useItemIds); ++ func_151180_a(p_75924_0_, Blocks.field_150374_bv, Blocks.field_150379_bu, useItemIds); ++ func_151180_a(p_75924_0_, Blocks.field_150334_T, Blocks.field_150333_U, useItemIds); ++ func_151180_a(p_75924_0_, Blocks.field_150373_bw, Blocks.field_150376_bx, useItemIds); ++ func_151180_a(p_75924_0_, Blocks.field_180388_cO, Blocks.field_180389_cP, useItemIds); ++ func_151180_a(p_75924_0_, Blocks.field_150349_c, Blocks.field_150346_d, useItemIds); ++ func_151180_a(p_75924_0_, Blocks.field_150458_ak, Blocks.field_150346_d, useItemIds); } - private static void func_151180_a(StatBase[] p_151180_0_, Block p_151180_1_, Block p_151180_2_) + private static void func_151180_a(StatBase[] p_151180_0_, Block p_151180_1_, Block p_151180_2_, boolean useItemIds) { -- int i = Block.getIdFromBlock(p_151180_1_); -- int j = Block.getIdFromBlock(p_151180_2_); +- int i = Block.func_149682_b(p_151180_1_); +- int j = Block.func_149682_b(p_151180_2_); + int i; + int j; + if (useItemIds) { -+ i = Item.getIdFromItem(Item.getItemFromBlock(p_151180_1_)); -+ j = Item.getIdFromItem(Item.getItemFromBlock(p_151180_2_)); ++ i = Item.func_150891_b(Item.func_150898_a(p_151180_1_)); ++ j = Item.func_150891_b(Item.func_150898_a(p_151180_2_)); + } else { -+ i = Block.getIdFromBlock(p_151180_1_); -+ j = Block.getIdFromBlock(p_151180_2_); ++ i = Block.func_149682_b(p_151180_1_); ++ j = Block.func_149682_b(p_151180_2_); + } if (p_151180_0_[i] != null && p_151180_0_[j] == null) diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch index 1c1448fa8..5e2a3c357 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch @@ -1,18 +1,18 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntity.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntity.java @@ -59,6 +59,7 @@ - public void readFromNBT(NBTTagCompound compound) + public void func_145839_a(NBTTagCompound p_145839_1_) { - this.pos = new BlockPos(compound.getInteger("x"), compound.getInteger("y"), compound.getInteger("z")); -+ if (compound.hasKey("ForgeData")) this.customTileData = compound.getCompoundTag("ForgeData"); + this.field_174879_c = new BlockPos(p_145839_1_.func_74762_e("x"), p_145839_1_.func_74762_e("y"), p_145839_1_.func_74762_e("z")); ++ if (p_145839_1_.func_74764_b("ForgeData")) this.customTileData = p_145839_1_.func_74775_l("ForgeData"); } - public void writeToNBT(NBTTagCompound compound) + public void func_145841_b(NBTTagCompound p_145841_1_) @@ -75,6 +76,7 @@ - compound.setInteger("x", this.pos.getX()); - compound.setInteger("y", this.pos.getY()); - compound.setInteger("z", this.pos.getZ()); -+ if (this.customTileData != null) compound.setTag("ForgeData", this.customTileData); + p_145841_1_.func_74768_a("x", this.field_174879_c.func_177958_n()); + p_145841_1_.func_74768_a("y", this.field_174879_c.func_177956_o()); + p_145841_1_.func_74768_a("z", this.field_174879_c.func_177952_p()); ++ if (this.customTileData != null) p_145841_1_.func_74782_a("ForgeData", this.customTileData); } } @@ -23,8 +23,8 @@ + Class oclass = null; try { -- Class oclass = (Class)nameToClassMap.get(nbt.getString("id")); -+ oclass = (Class)nameToClassMap.get(nbt.getString("id")); +- Class oclass = (Class)field_145855_i.get(p_145827_0_.func_74779_i("id")); ++ oclass = (Class)field_145855_i.get(p_145827_0_.func_74779_i("id")); if (oclass != null) { @@ -34,13 +34,13 @@ { + try + { - logger.warn("Skipping BlockEntity with id " + nbt.getString("id")); + field_145852_a.warn("Skipping BlockEntity with id " + p_145827_0_.func_74779_i("id")); + } + catch (Exception ex) + { + net.minecraftforge.fml.common.FMLLog.log(org.apache.logging.log4j.Level.ERROR, ex, + "A TileEntity %s(%s) has thrown an exception during loading, its state cannot be restored. Report this to the mod author", -+ nbt.getString("id"), oclass.getName()); ++ p_145827_0_.func_74779_i("id"), oclass.getName()); + tileentity = null; + } } @@ -51,12 +51,12 @@ } - @SideOnly(Side.CLIENT) - public double getDistanceSq(double x, double y, double z) + public double func_145835_a(double p_145835_1_, double p_145835_3_, double p_145835_5_) { - double d0 = (double)this.pos.getX() + 0.5D - x; + double d0 = (double)this.field_174879_c.func_177958_n() + 0.5D - p_145835_1_; @@ -279,4 +291,135 @@ - addMapping(TileEntityFlowerPot.class, "FlowerPot"); - addMapping(TileEntityBanner.class, "Banner"); + func_145826_a(TileEntityFlowerPot.class, "FlowerPot"); + func_145826_a(TileEntityBanner.class, "Banner"); } + + // -- BEGIN FORGE PATCHES -- @@ -93,7 +93,7 @@ + */ + public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate) + { -+ return !isVanilla || (oldState.getBlock() != newSate.getBlock()); ++ return !isVanilla || (oldState.func_177230_c() != newSate.func_177230_c()); + } + + public boolean shouldRenderInPass(int pass) @@ -116,21 +116,21 @@ + public net.minecraft.util.AxisAlignedBB getRenderBoundingBox() + { + net.minecraft.util.AxisAlignedBB bb = INFINITE_EXTENT_AABB; -+ Block type = getBlockType(); -+ if (type == Blocks.enchanting_table) ++ Block type = func_145838_q(); ++ if (type == Blocks.field_150381_bn) + { -+ bb = new net.minecraft.util.AxisAlignedBB(getPos(), getPos().add(1, 1, 1)); ++ bb = new net.minecraft.util.AxisAlignedBB(func_174877_v(), func_174877_v().func_177982_a(1, 1, 1)); + } -+ else if (type == Blocks.chest || type == Blocks.trapped_chest) ++ else if (type == Blocks.field_150486_ae || type == Blocks.field_150447_bR) + { -+ bb = new net.minecraft.util.AxisAlignedBB(getPos().add(-1, 0, -1), getPos().add(2, 2, 2)); ++ bb = new net.minecraft.util.AxisAlignedBB(func_174877_v().func_177982_a(-1, 0, -1), func_174877_v().func_177982_a(2, 2, 2)); + } -+ else if (type != null && type != Blocks.beacon) ++ else if (type != null && type != Blocks.field_150461_bJ) + { + net.minecraft.util.AxisAlignedBB cbb = null; + try + { -+ cbb = type.getCollisionBoundingBox(worldObj, getPos(), worldObj.getBlockState(getPos())); ++ cbb = type.func_180640_a(field_145850_b, func_174877_v(), field_145850_b.func_180495_p(func_174877_v())); + } + catch (Exception e) + { @@ -140,7 +140,7 @@ + // So, once again in the long line of US having to accommodate BUKKIT breaking things, + // here it is, assume that the TE is only 1 cubic block. Problem with this is that it may + // cause the TileEntity renderer to error further down the line! But alas, nothing we can do. -+ cbb = new net.minecraft.util.AxisAlignedBB(getPos().add(-1, 0, -1), getPos().add(1, 1, 1)); ++ cbb = new net.minecraft.util.AxisAlignedBB(func_174877_v().func_177982_a(-1, 0, -1), func_174877_v().func_177982_a(1, 1, 1)); + } + if (cbb != null) bb = cbb; + } @@ -154,7 +154,7 @@ + */ + public boolean canRenderBreaking() + { -+ Block block = this.getBlockType(); ++ Block block = this.func_145838_q(); + return (block instanceof net.minecraft.block.BlockChest || + block instanceof net.minecraft.block.BlockEnderChest || + block instanceof net.minecraft.block.BlockSign || diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch index 0f930a555..ad9881182 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityBeacon.java.patch @@ -2,19 +2,19 @@ +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBeacon.java @@ -169,7 +169,7 @@ { - Block block = this.worldObj.getBlockState(new BlockPos(j1, i2, k1)).getBlock(); + Block block = this.field_145850_b.func_180495_p(new BlockPos(j1, i2, k1)).func_177230_c(); -- if (block != Blocks.emerald_block && block != Blocks.gold_block && block != Blocks.diamond_block && block != Blocks.iron_block) -+ if (!block.isBeaconBase(this.worldObj, new BlockPos(l1, k1, j1), getPos())) +- if (block != Blocks.field_150475_bE && block != Blocks.field_150340_R && block != Blocks.field_150484_ah && block != Blocks.field_150339_S) ++ if (!block.isBeaconBase(this.field_145850_b, new BlockPos(l1, k1, j1), func_174877_v())) { flag1 = false; break; @@ -368,7 +368,7 @@ - public boolean isItemValidForSlot(int index, ItemStack stack) + public boolean func_94041_b(int p_94041_1_, ItemStack p_94041_2_) { -- return stack.getItem() == Items.emerald || stack.getItem() == Items.diamond || stack.getItem() == Items.gold_ingot || stack.getItem() == Items.iron_ingot; -+ return stack.getItem() != null && stack.getItem().isBeaconPayment(stack); +- return p_94041_2_.func_77973_b() == Items.field_151166_bC || p_94041_2_.func_77973_b() == Items.field_151045_i || p_94041_2_.func_77973_b() == Items.field_151043_k || p_94041_2_.func_77973_b() == Items.field_151042_j; ++ return p_94041_2_.func_77973_b() != null && p_94041_2_.func_77973_b().isBeaconPayment(p_94041_2_); } - public String getGuiID() + public String func_174875_k() diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch index caa7e492f..2dc57eff9 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch @@ -2,46 +2,46 @@ +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java @@ -104,7 +104,7 @@ - private boolean canBrew() + private boolean func_145934_k() { -- if (this.brewingItemStacks[3] != null && this.brewingItemStacks[3].stackSize > 0) -+ if (this.brewingItemStacks[3] != null && this.brewingItemStacks[3].stackSize > 0 && false) // Code moved to net.minecraftforge.common.brewing.VanillaBrewingRecipe +- if (this.field_145945_j[3] != null && this.field_145945_j[3].field_77994_a > 0) ++ if (this.field_145945_j[3] != null && this.field_145945_j[3].field_77994_a > 0 && false) // Code moved to net.minecraftforge.common.brewing.VanillaBrewingRecipe { - ItemStack itemstack = this.brewingItemStacks[3]; + ItemStack itemstack = this.field_145945_j[3]; @@ -118,7 +118,7 @@ for (int i = 0; i < 3; ++i) { -- if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() == Items.potionitem) -+ if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() instanceof ItemPotion) +- if (this.field_145945_j[i] != null && this.field_145945_j[i].func_77973_b() == Items.field_151068_bn) ++ if (this.field_145945_j[i] != null && this.field_145945_j[i].func_77973_b() instanceof ItemPotion) { - int j = this.brewingItemStacks[i].getMetadata(); + int j = this.field_145945_j[i].func_77960_j(); int k = this.func_145936_c(j, itemstack); @@ -145,19 +145,22 @@ } else { - return false; -+ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.canBrew(brewingItemStacks, brewingItemStacks[3], outputSlots); ++ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.canBrew(field_145945_j, field_145945_j[3], field_145947_i); } } - private void brewPotions() + private void func_145940_l() { -+ if (net.minecraftforge.event.ForgeEventFactory.onPotionAttemptBreaw(brewingItemStacks)) return; - if (this.canBrew()) ++ if (net.minecraftforge.event.ForgeEventFactory.onPotionAttemptBreaw(field_145945_j)) return; + if (this.func_145934_k()) { -+ net.minecraftforge.common.brewing.BrewingRecipeRegistry.brewPotions(brewingItemStacks, brewingItemStacks[3], outputSlots); - ItemStack itemstack = this.brewingItemStacks[3]; ++ net.minecraftforge.common.brewing.BrewingRecipeRegistry.brewPotions(field_145945_j, field_145945_j[3], field_145947_i); + ItemStack itemstack = this.field_145945_j[3]; + if (false) { // Code moved to net.minecraftforge.common.brewing.VanillaBrewingRecipe for (int i = 0; i < 3; ++i) { -- if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() == Items.potionitem) -+ if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() instanceof ItemPotion) +- if (this.field_145945_j[i] != null && this.field_145945_j[i].func_77973_b() == Items.field_151068_bn) ++ if (this.field_145945_j[i] != null && this.field_145945_j[i].func_77973_b() instanceof ItemPotion) { - int j = this.brewingItemStacks[i].getMetadata(); + int j = this.field_145945_j[i].func_77960_j(); int k = this.func_145936_c(j, itemstack); @@ -177,10 +180,11 @@ } @@ -49,29 +49,29 @@ } + } -- if (itemstack.getItem().hasContainerItem()) -+ if (itemstack.getItem().hasContainerItem(itemstack)) +- if (itemstack.func_77973_b().func_77634_r()) ++ if (itemstack.func_77973_b().hasContainerItem(itemstack)) { -- this.brewingItemStacks[3] = new ItemStack(itemstack.getItem().getContainerItem()); -+ this.brewingItemStacks[3] = itemstack.getItem().getContainerItem(itemstack); +- this.field_145945_j[3] = new ItemStack(itemstack.func_77973_b().func_77668_q()); ++ this.field_145945_j[3] = itemstack.func_77973_b().getContainerItem(itemstack); } else { @@ -191,6 +195,7 @@ - this.brewingItemStacks[3] = null; + this.field_145945_j[3] = null; } } -+ net.minecraftforge.event.ForgeEventFactory.onPotionBrewed(brewingItemStacks); ++ net.minecraftforge.event.ForgeEventFactory.onPotionBrewed(field_145945_j); } } @@ -310,7 +315,9 @@ - public boolean isItemValidForSlot(int index, ItemStack stack) + public boolean func_94041_b(int p_94041_1_, ItemStack p_94041_2_) { -- return index == 3 ? stack.getItem().isPotionIngredient(stack) : stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle; -+ if (index == 3 && net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidIngredient(stack)) return true; -+ else if (index != 3 && net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidInput(stack)) return true; +- return p_94041_1_ == 3 ? p_94041_2_.func_77973_b().func_150892_m(p_94041_2_) : p_94041_2_.func_77973_b() == Items.field_151068_bn || p_94041_2_.func_77973_b() == Items.field_151069_bo; ++ if (p_94041_1_ == 3 && net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidIngredient(p_94041_2_)) return true; ++ else if (p_94041_1_ != 3 && net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidInput(p_94041_2_)) return true; + return false; } diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch index 72def73ca..4966ed5e8 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch @@ -2,49 +2,49 @@ +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityFurnace.java @@ -223,8 +223,7 @@ - if (this.furnaceItemStacks[1].stackSize == 0) + if (this.field_145957_n[1].field_77994_a == 0) { -- 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]); +- Item item = this.field_145957_n[1].func_77973_b().func_77668_q(); +- this.field_145957_n[1] = item != null ? new ItemStack(item) : null; ++ this.field_145957_n[1] = field_145957_n[1].func_77973_b().getContainerItem(field_145957_n[1]); } } } @@ -279,7 +278,11 @@ else { - ItemStack itemstack = FurnaceRecipes.instance().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()))); + ItemStack itemstack = FurnaceRecipes.func_77602_a().func_151395_a(this.field_145957_n[0]); +- return itemstack == null ? false : (this.field_145957_n[2] == null ? true : (!this.field_145957_n[2].func_77969_a(itemstack) ? false : (this.field_145957_n[2].field_77994_a < this.func_70297_j_() && this.field_145957_n[2].field_77994_a < this.field_145957_n[2].func_77976_d() ? true : this.field_145957_n[2].field_77994_a < itemstack.func_77976_d()))); + if (itemstack == null) return false; -+ 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. ++ if (this.field_145957_n[2] == null) return true; ++ if (!this.field_145957_n[2].func_77969_a(itemstack)) return false; ++ int result = field_145957_n[2].field_77994_a + itemstack.field_77994_a; ++ return result <= func_70297_j_() && result <= this.field_145957_n[2].func_77976_d(); //Forge BugFix: Make it respect stack sizes properly. } } @@ -295,7 +298,7 @@ } - else if (this.furnaceItemStacks[2].getItem() == itemstack.getItem()) + else if (this.field_145957_n[2].func_77973_b() == itemstack.func_77973_b()) { -- ++this.furnaceItemStacks[2].stackSize; -+ this.furnaceItemStacks[2].stackSize += itemstack.stackSize; // Forge BugFix: Results may have multiple items +- ++this.field_145957_n[2].field_77994_a; ++ this.field_145957_n[2].field_77994_a += itemstack.field_77994_a; // Forge BugFix: Results may have multiple items } - if (this.furnaceItemStacks[0].getItem() == Item.getItemFromBlock(Blocks.sponge) && this.furnaceItemStacks[0].getMetadata() == 1 && this.furnaceItemStacks[1] != null && this.furnaceItemStacks[1].getItem() == Items.bucket) + if (this.field_145957_n[0].func_77973_b() == Item.func_150898_a(Blocks.field_150360_v) && this.field_145957_n[0].func_77960_j() == 1 && this.field_145957_n[1] != null && this.field_145957_n[1].func_77973_b() == Items.field_151133_ar) @@ -342,7 +345,15 @@ } } -- return item instanceof ItemTool && ((ItemTool)item).getToolMaterialName().equals("WOOD") ? 200 : (item instanceof ItemSword && ((ItemSword)item).getToolMaterialName().equals("WOOD") ? 200 : (item instanceof ItemHoe && ((ItemHoe)item).getMaterialName().equals("WOOD") ? 200 : (item == Items.stick ? 100 : (item == Items.coal ? 1600 : (item == Items.lava_bucket ? 20000 : (item == Item.getItemFromBlock(Blocks.sapling) ? 100 : (item == Items.blaze_rod ? 2400 : 0))))))); -+ if (item instanceof ItemTool && ((ItemTool)item).getToolMaterialName().equals("WOOD")) return 200; -+ if (item instanceof ItemSword && ((ItemSword)item).getToolMaterialName().equals("WOOD")) return 200; -+ if (item instanceof ItemHoe && ((ItemHoe)item).getMaterialName().equals("WOOD")) return 200; -+ if (item == Items.stick) return 100; -+ if (item == Items.coal) return 1600; -+ if (item == Items.lava_bucket) return 20000; -+ if (item == Item.getItemFromBlock(Blocks.sapling)) return 100; -+ if (item == Items.blaze_rod) return 2400; +- return item instanceof ItemTool && ((ItemTool)item).func_77861_e().equals("WOOD") ? 200 : (item instanceof ItemSword && ((ItemSword)item).func_150932_j().equals("WOOD") ? 200 : (item instanceof ItemHoe && ((ItemHoe)item).func_77842_f().equals("WOOD") ? 200 : (item == Items.field_151055_y ? 100 : (item == Items.field_151044_h ? 1600 : (item == Items.field_151129_at ? 20000 : (item == Item.func_150898_a(Blocks.field_150345_g) ? 100 : (item == Items.field_151072_bj ? 2400 : 0))))))); ++ if (item instanceof ItemTool && ((ItemTool)item).func_77861_e().equals("WOOD")) return 200; ++ if (item instanceof ItemSword && ((ItemSword)item).func_150932_j().equals("WOOD")) return 200; ++ if (item instanceof ItemHoe && ((ItemHoe)item).func_77842_f().equals("WOOD")) return 200; ++ if (item == Items.field_151055_y) return 100; ++ if (item == Items.field_151044_h) return 1600; ++ if (item == Items.field_151129_at) return 20000; ++ if (item == Item.func_150898_a(Blocks.field_150345_g)) return 100; ++ if (item == Items.field_151072_bj) return 2400; + return net.minecraftforge.fml.common.registry.GameRegistry.getFuelValue(p_145952_0_); } } diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch index a5cd00655..0f5f3b348 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityHopper.java.patch @@ -5,29 +5,29 @@ if (itemstack == null) { + //Forge: BUGFIX: Again, make things respect max stack sizes. -+ int max = Math.min(p_174916_1_.getMaxStackSize(), p_174916_0_.getInventoryStackLimit()); -+ if (max >= p_174916_1_.stackSize) ++ int max = Math.min(p_174916_1_.func_77976_d(), p_174916_0_.func_70297_j_()); ++ if (max >= p_174916_1_.field_77994_a) + { - p_174916_0_.setInventorySlotContents(p_174916_2_, p_174916_1_); + p_174916_0_.func_70299_a(p_174916_2_, p_174916_1_); p_174916_1_ = null; + } + else + { -+ p_174916_0_.setInventorySlotContents(p_174916_2_, p_174916_1_.splitStack(max)); ++ p_174916_0_.func_70299_a(p_174916_2_, p_174916_1_.func_77979_a(max)); + } flag = true; } - else if (canCombine(itemstack, p_174916_1_)) + else if (func_145894_a(itemstack, p_174916_1_)) { -- int i = p_174916_1_.getMaxStackSize() - itemstack.stackSize; +- int i = p_174916_1_.func_77976_d() - itemstack.field_77994_a; + //Forge: BUGFIX: Again, make things respect max stack sizes. -+ int max = Math.min(p_174916_1_.getMaxStackSize(), p_174916_0_.getInventoryStackLimit()); -+ if (max > itemstack.stackSize) ++ int max = Math.min(p_174916_1_.func_77976_d(), p_174916_0_.func_70297_j_()); ++ if (max > itemstack.field_77994_a) + { -+ int i = max - itemstack.stackSize; - int j = Math.min(p_174916_1_.stackSize, i); - p_174916_1_.stackSize -= j; - itemstack.stackSize += j; ++ int i = max - itemstack.field_77994_a; + int j = Math.min(p_174916_1_.field_77994_a, i); + p_174916_1_.field_77994_a -= j; + itemstack.field_77994_a += j; flag = j > 0; + } } diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch index 01099d450..e3fef4d68 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityNote.java.patch @@ -2,11 +2,11 @@ +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityNote.java @@ -27,7 +27,9 @@ - public void changePitch() + public void func_145877_a() { -+ byte old = note; - this.note = (byte)((this.note + 1) % 25); ++ byte old = field_145879_a; + this.field_145879_a = (byte)((this.field_145879_a + 1) % 25); + if (!net.minecraftforge.common.ForgeHooks.onNoteChange(this, old)) return; - this.markDirty(); + this.func_70296_d(); } diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch index 4595567a7..a1d1cc237 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntityPiston.java.patch @@ -1,22 +1,22 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityPiston.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityPiston.java @@ -148,7 +148,8 @@ - if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension) + if (this.field_145850_b.func_180495_p(this.field_174879_c).func_177230_c() == Blocks.field_180384_M) { - this.worldObj.setBlockState(this.pos, this.pistonState, 3); -- this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock()); -+ if(!net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(worldObj, pos, worldObj.getBlockState(pos), java.util.EnumSet.noneOf(EnumFacing.class)).isCanceled()) -+ this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock()); + this.field_145850_b.func_180501_a(this.field_174879_c, this.field_174932_a, 3); +- this.field_145850_b.func_180496_d(this.field_174879_c, this.field_174932_a.func_177230_c()); ++ if(!net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(field_145850_b, field_174879_c, field_145850_b.func_180495_p(field_174879_c), java.util.EnumSet.noneOf(EnumFacing.class)).isCanceled()) ++ this.field_145850_b.func_180496_d(this.field_174879_c, this.field_174932_a.func_177230_c()); } } } @@ -166,7 +167,8 @@ - if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension) + if (this.field_145850_b.func_180495_p(this.field_174879_c).func_177230_c() == Blocks.field_180384_M) { - this.worldObj.setBlockState(this.pos, this.pistonState, 3); -- this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock()); -+ if(!net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(worldObj, pos, worldObj.getBlockState(pos), java.util.EnumSet.noneOf(EnumFacing.class)).isCanceled()) -+ this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock()); + this.field_145850_b.func_180501_a(this.field_174879_c, this.field_174932_a, 3); +- this.field_145850_b.func_180496_d(this.field_174879_c, this.field_174932_a.func_177230_c()); ++ if(!net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(field_145850_b, field_174879_c, field_145850_b.func_180495_p(field_174879_c), java.util.EnumSet.noneOf(EnumFacing.class)).isCanceled()) ++ this.field_145850_b.func_180496_d(this.field_174879_c, this.field_174932_a.func_177230_c()); } } else diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch index ee33a8d35..6b66af8ce 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntitySign.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntitySign.java @@ -61,7 +61,7 @@ } - public boolean canUseCommand(int permLevel, String commandName) + public boolean func_70003_b(int p_70003_1_, String p_70003_2_) { - return true; -+ return permLevel <= 2; //Forge: Fixes MC-75630 - Exploit with signs and command blocks ++ return p_70003_1_ <= 2; //Forge: Fixes MC-75630 - Exploit with signs and command blocks } - public BlockPos getPosition() + public BlockPos func_180425_c() { diff --git a/patches/minecraft/net/minecraft/util/EnumFacing.java.patch b/patches/minecraft/net/minecraft/util/EnumFacing.java.patch index 5f5717bf9..a0fbc640d 100644 --- a/patches/minecraft/net/minecraft/util/EnumFacing.java.patch +++ b/patches/minecraft/net/minecraft/util/EnumFacing.java.patch @@ -10,19 +10,19 @@ public enum EnumFacing implements IStringSerializable { @@ -60,7 +58,6 @@ - return getFront(this.opposite); + return func_82600_a(this.field_176759_h); } - @SideOnly(Side.CLIENT) - public EnumFacing rotateAround(EnumFacing.Axis axis) + public EnumFacing func_176732_a(EnumFacing.Axis p_176732_1_) { - switch (axis) + switch (p_176732_1_) @@ -111,7 +108,6 @@ } } - @SideOnly(Side.CLIENT) - private EnumFacing rotateX() + private EnumFacing func_176744_n() { switch (this) @@ -131,7 +127,6 @@ @@ -30,23 +30,23 @@ } - @SideOnly(Side.CLIENT) - private EnumFacing rotateZ() + private EnumFacing func_176738_p() { switch (this) @@ -192,7 +187,6 @@ - return this.axis; + return this.field_176758_k; } - @SideOnly(Side.CLIENT) - public static EnumFacing byName(String name) + public static EnumFacing func_176739_a(String p_176739_0_) { - return name == null ? null : (EnumFacing)NAME_LOOKUP.get(name.toLowerCase()); + return p_176739_0_ == null ? null : (EnumFacing)field_176761_p.get(p_176739_0_.toLowerCase()); @@ -218,7 +212,6 @@ - return values()[rand.nextInt(values().length)]; + return values()[p_176741_0_.nextInt(values().length)]; } - @SideOnly(Side.CLIENT) - public static EnumFacing getFacingFromVector(float p_176737_0_, float p_176737_1_, float p_176737_2_) + public static EnumFacing func_176737_a(float p_176737_0_, float p_176737_1_, float p_176737_2_) { EnumFacing enumfacing = NORTH; @@ -261,7 +254,6 @@ @@ -54,14 +54,14 @@ } - @SideOnly(Side.CLIENT) - public Vec3i getDirectionVec() + public Vec3i func_176730_m() { - return this.directionVec; + return this.field_176756_m; @@ -297,7 +289,6 @@ - this.plane = plane; + this.field_176723_f = p_i46015_4_; } - @SideOnly(Side.CLIENT) - public static EnumFacing.Axis byName(String name) + public static EnumFacing.Axis func_176717_a(String p_176717_0_) { - return name == null ? null : (EnumFacing.Axis)NAME_LOOKUP.get(name.toLowerCase()); + return p_176717_0_ == null ? null : (EnumFacing.Axis)field_176725_d.get(p_176717_0_.toLowerCase()); diff --git a/patches/minecraft/net/minecraft/util/MouseHelper.java.patch b/patches/minecraft/net/minecraft/util/MouseHelper.java.patch index 7c04c7919..9a1be0ea4 100644 --- a/patches/minecraft/net/minecraft/util/MouseHelper.java.patch +++ b/patches/minecraft/net/minecraft/util/MouseHelper.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/util/MouseHelper.java @@ -13,6 +13,7 @@ - public void grabMouseCursor() + public void func_74372_a() { + if (Boolean.parseBoolean(System.getProperty("fml.noGrab","false"))) return; Mouse.setGrabbed(true); - this.deltaX = 0; - this.deltaY = 0; + this.field_74377_a = 0; + this.field_74375_b = 0; diff --git a/patches/minecraft/net/minecraft/util/MovingObjectPosition.java.patch b/patches/minecraft/net/minecraft/util/MovingObjectPosition.java.patch index 4de3bec00..f717cac15 100644 --- a/patches/minecraft/net/minecraft/util/MovingObjectPosition.java.patch +++ b/patches/minecraft/net/minecraft/util/MovingObjectPosition.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/util/MovingObjectPosition.java +++ ../src-work/minecraft/net/minecraft/util/MovingObjectPosition.java @@ -10,6 +10,12 @@ - public Vec3 hitVec; - public Entity entityHit; + public Vec3 field_72307_f; + public Entity field_72308_g; + /** Used to determine what sub-segment is hit */ + public int subHit = -1; diff --git a/patches/minecraft/net/minecraft/util/ResourceLocation.java.patch b/patches/minecraft/net/minecraft/util/ResourceLocation.java.patch index be604e68e..bef0586ad 100644 --- a/patches/minecraft/net/minecraft/util/ResourceLocation.java.patch +++ b/patches/minecraft/net/minecraft/util/ResourceLocation.java.patch @@ -17,10 +17,10 @@ { this(0, new String[] {p_i1292_1_, p_i1292_2_}); @@ -50,7 +47,6 @@ - return this.resourcePath; + return this.field_110625_b; } - @SideOnly(Side.CLIENT) - public String getResourceDomain() + public String func_110624_b() { - return this.resourceDomain; + return this.field_110626_a; diff --git a/patches/minecraft/net/minecraft/util/Session.java.patch b/patches/minecraft/net/minecraft/util/Session.java.patch index 48492d58d..19d55db7e 100644 --- a/patches/minecraft/net/minecraft/util/Session.java.patch +++ b/patches/minecraft/net/minecraft/util/Session.java.patch @@ -10,18 +10,18 @@ import net.minecraftforge.fml.relauncher.SideOnly; @@ -15,9 +17,24 @@ - private final String playerID; - private final String token; - private final Session.Type sessionType; + private final String field_148257_b; + private final String field_148258_c; + private final Session.Type field_152429_d; + /** Forge: Cache of the local session's GameProfile properties. */ + private com.mojang.authlib.properties.PropertyMap properties; - public Session(String usernameIn, String playerIDIn, String tokenIn, String sessionTypeIn) + public Session(String p_i1098_1_, String p_i1098_2_, String p_i1098_3_, String p_i1098_4_) { -+ if (usernameIn == null || usernameIn.isEmpty()) ++ if (p_i1098_1_ == null || p_i1098_1_.isEmpty()) + { -+ usernameIn = "MissingName"; -+ playerIDIn = tokenIn = "NotValid"; ++ p_i1098_1_ = "MissingName"; ++ p_i1098_2_ = p_i1098_3_ = "NotValid"; + FMLLog.getLogger().log(org.apache.logging.log4j.Level.WARN, "========================================================="); + FMLLog.getLogger().log(org.apache.logging.log4j.Level.WARN, "WARNING!! the username was not set for this session, typically"); + FMLLog.getLogger().log(org.apache.logging.log4j.Level.WARN, "this means you installed Forge incorrectly. We have set your"); @@ -31,27 +31,27 @@ + FMLLog.getLogger().log(org.apache.logging.log4j.Level.WARN, "========================================================="); + } + - this.username = usernameIn; - this.playerID = playerIDIn; - this.token = tokenIn; + this.field_74286_b = p_i1098_1_; + this.field_148257_b = p_i1098_2_; + this.field_148258_c = p_i1098_3_; @@ -49,11 +66,13 @@ try { - UUID uuid = UUIDTypeAdapter.fromString(this.getPlayerID()); -- return new GameProfile(uuid, this.getUsername()); -+ GameProfile ret = new GameProfile(uuid, this.getUsername()); //Forge: Adds cached GameProfile properties to returned GameProfile. + UUID uuid = UUIDTypeAdapter.fromString(this.func_148255_b()); +- return new GameProfile(uuid, this.func_111285_a()); ++ GameProfile ret = new GameProfile(uuid, this.func_111285_a()); //Forge: Adds cached GameProfile properties to returned GameProfile. + if (properties != null) ret.getProperties().putAll(properties); // Helps to cut down on calls to the session service, + return ret; // which helps to fix MC-52974. } catch (IllegalArgumentException var2) { -- return new GameProfile((UUID)null, this.getUsername()); -+ return new GameProfile(net.minecraft.entity.player.EntityPlayer.getUUID(new GameProfile((UUID)null, this.getUsername())), this.getUsername()); +- return new GameProfile((UUID)null, this.func_111285_a()); ++ return new GameProfile(net.minecraft.entity.player.EntityPlayer.func_146094_a(new GameProfile((UUID)null, this.func_111285_a())), this.func_111285_a()); } } @@ -62,6 +81,19 @@ - return this.sessionType; + return this.field_152429_d; } + /* ======================================== FORGE START ===================================== */ diff --git a/patches/minecraft/net/minecraft/util/StringTranslate.java.patch b/patches/minecraft/net/minecraft/util/StringTranslate.java.patch index f6d51a843..be6f42827 100644 --- a/patches/minecraft/net/minecraft/util/StringTranslate.java.patch +++ b/patches/minecraft/net/minecraft/util/StringTranslate.java.patch @@ -10,14 +10,14 @@ + + public static void inject(InputStream inputstream) + { -+ inject(instance, inputstream); ++ inject(field_74817_a, inputstream); + } + + private static void inject(StringTranslate inst, InputStream inputstream) + { + java.util.HashMap map = parseLangFile(inputstream); -+ inst.languageList.putAll(map); -+ inst.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); ++ inst.field_74816_c.putAll(map); ++ inst.field_150511_e = System.currentTimeMillis(); + } + + public static java.util.HashMap parseLangFile(InputStream inputstream) @@ -34,14 +34,14 @@ @@ -37,17 +57,17 @@ { String s1 = astring[0]; - String s2 = numericVariablePattern.matcher(astring[1]).replaceAll("%$1s"); -- this.languageList.put(s1, s2); + String s2 = field_111053_a.matcher(astring[1]).replaceAll("%$1s"); +- this.field_74816_c.put(s1, s2); + table.put(s1, s2); } } } -- this.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); +- this.field_150511_e = System.currentTimeMillis(); } - catch (IOException var7) + catch (Exception var7) @@ -51,4 +51,4 @@ + return table; } - static StringTranslate getInstance() + static StringTranslate func_74808_a() diff --git a/patches/minecraft/net/minecraft/util/Vec3.java.patch b/patches/minecraft/net/minecraft/util/Vec3.java.patch index 43a23f3c8..2cc1ac518 100644 --- a/patches/minecraft/net/minecraft/util/Vec3.java.patch +++ b/patches/minecraft/net/minecraft/util/Vec3.java.patch @@ -8,28 +8,28 @@ - public class Vec3 { - public final double xCoord; + public final double field_72450_a; @@ -36,7 +33,6 @@ - this((double)p_i46377_1_.getX(), (double)p_i46377_1_.getY(), (double)p_i46377_1_.getZ()); + this((double)p_i46377_1_.func_177958_n(), (double)p_i46377_1_.func_177956_o(), (double)p_i46377_1_.func_177952_p()); } - @SideOnly(Side.CLIENT) - public Vec3 subtractReverse(Vec3 vec) + public Vec3 func_72444_a(Vec3 p_72444_1_) { - return new Vec3(vec.xCoord - this.xCoord, vec.yCoord - this.yCoord, vec.zCoord - this.zCoord); + return new Vec3(p_72444_1_.field_72450_a - this.field_72450_a, p_72444_1_.field_72448_b - this.field_72448_b, p_72444_1_.field_72449_c - this.field_72449_c); @@ -53,7 +49,6 @@ - return this.xCoord * vec.xCoord + this.yCoord * vec.yCoord + this.zCoord * vec.zCoord; + return this.field_72450_a * p_72430_1_.field_72450_a + this.field_72448_b * p_72430_1_.field_72448_b + this.field_72449_c * p_72430_1_.field_72449_c; } - @SideOnly(Side.CLIENT) - public Vec3 crossProduct(Vec3 vec) + public Vec3 func_72431_c(Vec3 p_72431_1_) { - return new Vec3(this.yCoord * vec.zCoord - this.zCoord * vec.yCoord, this.zCoord * vec.xCoord - this.xCoord * vec.zCoord, this.xCoord * vec.yCoord - this.yCoord * vec.xCoord); + return new Vec3(this.field_72448_b * p_72431_1_.field_72449_c - this.field_72449_c * p_72431_1_.field_72448_b, this.field_72449_c * p_72431_1_.field_72450_a - this.field_72450_a * p_72431_1_.field_72449_c, this.field_72450_a * p_72431_1_.field_72448_b - this.field_72448_b * p_72431_1_.field_72450_a); @@ -79,7 +74,6 @@ - return new Vec3(this.xCoord + x, this.yCoord + y, this.zCoord + z); + return new Vec3(this.field_72450_a + p_72441_1_, this.field_72448_b + p_72441_3_, this.field_72449_c + p_72441_5_); } - @SideOnly(Side.CLIENT) - public double distanceTo(Vec3 vec) + public double func_72438_d(Vec3 p_72438_1_) { - double d0 = vec.xCoord - this.xCoord; + double d0 = p_72438_1_.field_72450_a - this.field_72450_a; diff --git a/patches/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch b/patches/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch index 8ddd08aa9..b8f7e3aa4 100644 --- a/patches/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch +++ b/patches/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch @@ -3,24 +3,24 @@ @@ -36,48 +36,39 @@ for (int i = 0; i < p_177630_3_; ++i) { - WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(random, p_177630_1_); -- int j = weightedrandomchestcontent.theMinimumChanceToGenerateItem + random.nextInt(weightedrandomchestcontent.theMaximumChanceToGenerateItem - weightedrandomchestcontent.theMinimumChanceToGenerateItem + 1); -+ ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(random, p_177630_2_); + WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.func_76271_a(p_177630_0_, p_177630_1_); +- int j = weightedrandomchestcontent.field_76295_d + p_177630_0_.nextInt(weightedrandomchestcontent.field_76296_e - weightedrandomchestcontent.field_76295_d + 1); ++ ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(p_177630_0_, p_177630_2_); -- if (weightedrandomchestcontent.theItemId.getMaxStackSize() >= j) +- if (weightedrandomchestcontent.field_76297_b.func_77976_d() >= j) + for (ItemStack itemstack1 : stacks) { -- ItemStack itemstack1 = weightedrandomchestcontent.theItemId.copy(); -- itemstack1.stackSize = j; - p_177630_2_.setInventorySlotContents(random.nextInt(p_177630_2_.getSizeInventory()), itemstack1); +- ItemStack itemstack1 = weightedrandomchestcontent.field_76297_b.func_77946_l(); +- itemstack1.field_77994_a = j; + p_177630_2_.func_70299_a(p_177630_0_.nextInt(p_177630_2_.func_70302_i_()), itemstack1); } - else - { - for (int k = 0; k < j; ++k) - { -- ItemStack itemstack = weightedrandomchestcontent.theItemId.copy(); -- itemstack.stackSize = 1; -- p_177630_2_.setInventorySlotContents(random.nextInt(p_177630_2_.getSizeInventory()), itemstack); +- ItemStack itemstack = weightedrandomchestcontent.field_76297_b.func_77946_l(); +- itemstack.field_77994_a = 1; +- p_177630_2_.func_70299_a(p_177630_0_.nextInt(p_177630_2_.func_70302_i_()), itemstack); - } - } } @@ -36,31 +36,31 @@ + */ + protected ItemStack[] generateChestContent(Random random, IInventory newInventory) + { -+ return net.minecraftforge.common.ChestGenHooks.generateStacks(random, theItemId, theMinimumChanceToGenerateItem, theMaximumChanceToGenerateItem); ++ return net.minecraftforge.common.ChestGenHooks.generateStacks(random, field_76297_b, field_76295_d, field_76296_e); + } + - public static void generateDispenserContents(Random random, List p_177631_1_, TileEntityDispenser dispenser, int p_177631_3_) + public static void func_177631_a(Random p_177631_0_, List p_177631_1_, TileEntityDispenser p_177631_2_, int p_177631_3_) { for (int i = 0; i < p_177631_3_; ++i) { - WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(random, p_177631_1_); -- int j = weightedrandomchestcontent.theMinimumChanceToGenerateItem + random.nextInt(weightedrandomchestcontent.theMaximumChanceToGenerateItem - weightedrandomchestcontent.theMinimumChanceToGenerateItem + 1); -+ ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(random, dispenser); + WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.func_76271_a(p_177631_0_, p_177631_1_); +- int j = weightedrandomchestcontent.field_76295_d + p_177631_0_.nextInt(weightedrandomchestcontent.field_76296_e - weightedrandomchestcontent.field_76295_d + 1); ++ ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(p_177631_0_, p_177631_2_); -- if (weightedrandomchestcontent.theItemId.getMaxStackSize() >= j) +- if (weightedrandomchestcontent.field_76297_b.func_77976_d() >= j) + for (ItemStack itemstack1 : stacks) { -- ItemStack itemstack1 = weightedrandomchestcontent.theItemId.copy(); -- itemstack1.stackSize = j; - dispenser.setInventorySlotContents(random.nextInt(dispenser.getSizeInventory()), itemstack1); +- ItemStack itemstack1 = weightedrandomchestcontent.field_76297_b.func_77946_l(); +- itemstack1.field_77994_a = j; + p_177631_2_.func_70299_a(p_177631_0_.nextInt(p_177631_2_.func_70302_i_()), itemstack1); } - else - { - for (int k = 0; k < j; ++k) - { -- ItemStack itemstack = weightedrandomchestcontent.theItemId.copy(); -- itemstack.stackSize = 1; -- dispenser.setInventorySlotContents(random.nextInt(dispenser.getSizeInventory()), itemstack); +- ItemStack itemstack = weightedrandomchestcontent.field_76297_b.func_77946_l(); +- itemstack.field_77994_a = 1; +- p_177631_2_.func_70299_a(p_177631_0_.nextInt(p_177631_2_.func_70302_i_()), itemstack); - } - } } diff --git a/patches/minecraft/net/minecraft/world/ChunkCache.java.patch b/patches/minecraft/net/minecraft/world/ChunkCache.java.patch index 34f859075..27f632f83 100644 --- a/patches/minecraft/net/minecraft/world/ChunkCache.java.patch +++ b/patches/minecraft/net/minecraft/world/ChunkCache.java.patch @@ -2,60 +2,60 @@ +++ ../src-work/minecraft/net/minecraft/world/ChunkCache.java @@ -61,6 +61,8 @@ { - int i = (pos.getX() >> 4) - this.chunkX; - int j = (pos.getZ() >> 4) - this.chunkZ; -+ if (i < 0 || i >= chunkArray.length || j < 0 || j >= chunkArray[i].length) return null; -+ if (chunkArray[i][j] == null) return null; - return this.chunkArray[i][j].getTileEntity(pos, Chunk.EnumCreateEntityType.IMMEDIATE); + int i = (p_175625_1_.func_177958_n() >> 4) - this.field_72818_a; + int j = (p_175625_1_.func_177952_p() >> 4) - this.field_72816_b; ++ if (i < 0 || i >= field_72817_c.length || j < 0 || j >= field_72817_c[i].length) return null; ++ if (field_72817_c[i][j] == null) return null; + return this.field_72817_c[i][j].func_177424_a(p_175625_1_, Chunk.EnumCreateEntityType.IMMEDIATE); } @@ -84,6 +86,7 @@ { - int i = (pos.getX() >> 4) - this.chunkX; - int j = (pos.getZ() >> 4) - this.chunkZ; -+ if (i < 0 || i >= chunkArray.length || j < 0 || i >= chunkArray[i].length) return Blocks.air.getDefaultState(); + int i = (p_180495_1_.func_177958_n() >> 4) - this.field_72818_a; + int j = (p_180495_1_.func_177952_p() >> 4) - this.field_72816_b; ++ if (i < 0 || i >= field_72817_c.length || j < 0 || i >= field_72817_c[i].length) return Blocks.field_150350_a.func_176223_P(); - if (i >= 0 && i < this.chunkArray.length && j >= 0 && j < this.chunkArray[i].length) + if (i >= 0 && i < this.field_72817_c.length && j >= 0 && j < this.field_72817_c[i].length) { @@ -139,6 +142,8 @@ { - int i = (pos.getX() >> 4) - this.chunkX; - int j = (pos.getZ() >> 4) - this.chunkZ; -+ if (i < 0 || i >= chunkArray.length || j < 0 || j >= chunkArray[i].length) return p_175629_1_.defaultLightValue; -+ if (chunkArray[i][j] == null) return p_175629_1_.defaultLightValue; - return this.chunkArray[i][j].getLightFor(p_175629_1_, pos); + int i = (p_175629_2_.func_177958_n() >> 4) - this.field_72818_a; + int j = (p_175629_2_.func_177952_p() >> 4) - this.field_72816_b; ++ if (i < 0 || i >= field_72817_c.length || j < 0 || j >= field_72817_c[i].length) return p_175629_1_.field_77198_c; ++ if (field_72817_c[i][j] == null) return p_175629_1_.field_77198_c; + return this.field_72817_c[i][j].func_177413_a(p_175629_1_, p_175629_2_); } } @@ -150,7 +155,7 @@ - public boolean isAirBlock(BlockPos pos) + public boolean func_175623_d(BlockPos p_175623_1_) { -- return this.getBlockState(pos).getBlock().getMaterial() == Material.air; -+ return this.getBlockState(pos).getBlock().isAir(this, pos); +- return this.func_180495_p(p_175623_1_).func_177230_c().func_149688_o() == Material.field_151579_a; ++ return this.func_180495_p(p_175623_1_).func_177230_c().isAir(this, p_175623_1_); } @SideOnly(Side.CLIENT) @@ -160,6 +165,7 @@ { - int i = (pos.getX() >> 4) - this.chunkX; - int j = (pos.getZ() >> 4) - this.chunkZ; -+ if (i < 0 || i >= chunkArray.length || j < 0 || i >= chunkArray[i].length) return p_175628_1_.defaultLightValue; - return this.chunkArray[i][j].getLightFor(p_175628_1_, pos); + int i = (p_175628_2_.func_177958_n() >> 4) - this.field_72818_a; + int j = (p_175628_2_.func_177952_p() >> 4) - this.field_72816_b; ++ if (i < 0 || i >= field_72817_c.length || j < 0 || i >= field_72817_c[i].length) return p_175628_1_.field_77198_c; + return this.field_72817_c[i][j].func_177413_a(p_175628_1_, p_175628_2_); } else @@ -179,4 +185,15 @@ { - return this.worldObj.getWorldType(); + return this.field_72815_e.func_175624_G(); } + + @Override + public boolean isSideSolid(BlockPos pos, EnumFacing side, boolean _default) + { -+ int x = (pos.getX() >> 4) - this.chunkX; -+ int z = (pos.getZ() >> 4) - this.chunkZ; -+ if (pos.getY() >= 0 && pos.getY() < 256) return _default; -+ if (x < 0 || x >= chunkArray.length || z < 0 || x >= chunkArray[x].length) return _default; ++ int x = (pos.func_177958_n() >> 4) - this.field_72818_a; ++ int z = (pos.func_177952_p() >> 4) - this.field_72816_b; ++ if (pos.func_177956_o() >= 0 && pos.func_177956_o() < 256) return _default; ++ if (x < 0 || x >= field_72817_c.length || z < 0 || x >= field_72817_c[x].length) return _default; + -+ return getBlockState(pos).getBlock().isSideSolid(this, pos, side); ++ return func_180495_p(pos).func_177230_c().isSideSolid(this, pos, side); + } } diff --git a/patches/minecraft/net/minecraft/world/Explosion.java.patch b/patches/minecraft/net/minecraft/world/Explosion.java.patch index 71627e229..a7cbd02cf 100644 --- a/patches/minecraft/net/minecraft/world/Explosion.java.patch +++ b/patches/minecraft/net/minecraft/world/Explosion.java.patch @@ -1,51 +1,51 @@ --- ../src-base/minecraft/net/minecraft/world/Explosion.java +++ ../src-work/minecraft/net/minecraft/world/Explosion.java @@ -38,6 +38,7 @@ - private final float explosionSize; - private final List affectedBlockPositions; + private final float field_77280_f; + private final List field_77281_g; private final Map field_77288_k; + private final Vec3 position; @SideOnly(Side.CLIENT) - public Explosion(World worldIn, Entity p_i45752_2_, double p_i45752_3_, double p_i45752_5_, double p_i45752_7_, float p_i45752_9_, List p_i45752_10_) + public Explosion(World p_i45752_1_, Entity p_i45752_2_, double p_i45752_3_, double p_i45752_5_, double p_i45752_7_, float p_i45752_9_, List p_i45752_10_) @@ -65,6 +66,7 @@ - this.explosionZ = p_i45754_7_; - this.isFlaming = p_i45754_10_; - this.isSmoking = p_i45754_11_; -+ this.position = new Vec3(explosionX, explosionY, explosionZ); + this.field_77282_d = p_i45754_7_; + this.field_77286_a = p_i45754_10_; + this.field_82755_b = p_i45754_11_; ++ this.position = new Vec3(field_77284_b, field_77285_c, field_77282_d); } - public void doExplosionA() + public void func_77278_a() @@ -99,7 +101,7 @@ - if (iblockstate.getBlock().getMaterial() != Material.air) + if (iblockstate.func_177230_c().func_149688_o() != Material.field_151579_a) { -- float f2 = this.exploder != null ? this.exploder.getExplosionResistance(this, this.worldObj, blockpos, iblockstate) : iblockstate.getBlock().getExplosionResistance((Entity)null); -+ float f2 = this.exploder != null ? this.exploder.getExplosionResistance(this, this.worldObj, blockpos, iblockstate) : iblockstate.getBlock().getExplosionResistance(worldObj, blockpos, (Entity)null, this); +- float f2 = this.field_77283_e != null ? this.field_77283_e.func_180428_a(this, this.field_77287_j, blockpos, iblockstate) : iblockstate.func_177230_c().func_149638_a((Entity)null); ++ float f2 = this.field_77283_e != null ? this.field_77283_e.func_180428_a(this, this.field_77287_j, blockpos, iblockstate) : iblockstate.func_177230_c().getExplosionResistance(field_77287_j, blockpos, (Entity)null, this); f -= (f2 + 0.3F) * 0.3F; } @@ -126,6 +128,7 @@ - int j2 = MathHelper.floor_double(this.explosionZ - (double)f3 - 1.0D); - int j1 = MathHelper.floor_double(this.explosionZ + (double)f3 + 1.0D); - List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this.exploder, new AxisAlignedBB((double)k1, (double)i2, (double)j2, (double)l1, (double)i1, (double)j1)); -+ net.minecraftforge.event.ForgeEventFactory.onExplosionDetonate(this.worldObj, this, list, f3); - Vec3 vec3 = new Vec3(this.explosionX, this.explosionY, this.explosionZ); + int j2 = MathHelper.func_76128_c(this.field_77282_d - (double)f3 - 1.0D); + int j1 = MathHelper.func_76128_c(this.field_77282_d + (double)f3 + 1.0D); + List list = this.field_77287_j.func_72839_b(this.field_77283_e, new AxisAlignedBB((double)k1, (double)i2, (double)j2, (double)l1, (double)i1, (double)j1)); ++ net.minecraftforge.event.ForgeEventFactory.onExplosionDetonate(this.field_77287_j, this, list, f3); + Vec3 vec3 = new Vec3(this.field_77284_b, this.field_77285_c, this.field_77282_d); for (int k2 = 0; k2 < list.size(); ++k2) @@ -213,8 +216,7 @@ - block.dropBlockAsItemWithChance(this.worldObj, blockpos, this.worldObj.getBlockState(blockpos), 1.0F / this.explosionSize, 0); + block.func_180653_a(this.field_77287_j, blockpos, this.field_77287_j.func_180495_p(blockpos), 1.0F / this.field_77280_f, 0); } -- this.worldObj.setBlockState(blockpos, Blocks.air.getDefaultState(), 3); -- block.onBlockDestroyedByExplosion(this.worldObj, blockpos, this); -+ block.onBlockExploded(this.worldObj, blockpos, this); +- this.field_77287_j.func_180501_a(blockpos, Blocks.field_150350_a.func_176223_P(), 3); +- block.func_180652_a(this.field_77287_j, blockpos, this); ++ block.onBlockExploded(this.field_77287_j, blockpos, this); } } } @@ -250,4 +252,6 @@ { - return this.affectedBlockPositions; + return this.field_77281_g; } + + public Vec3 getPosition(){ return this.position; } diff --git a/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch b/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch index 7fb64f305..e6b7d331d 100644 --- a/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch +++ b/patches/minecraft/net/minecraft/world/IBlockAccess.java.patch @@ -3,7 +3,7 @@ @@ -29,4 +29,14 @@ @SideOnly(Side.CLIENT) - WorldType getWorldType(); + WorldType func_175624_G(); + + /** + * FORGE: isSideSolid, pulled up from {@link World} diff --git a/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch b/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch index 01632c7d2..12456a583 100644 --- a/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch +++ b/patches/minecraft/net/minecraft/world/SpawnerAnimals.java.patch @@ -2,50 +2,50 @@ +++ ../src-work/minecraft/net/minecraft/world/SpawnerAnimals.java @@ -69,14 +69,15 @@ { - if ((!enumcreaturetype.getPeacefulCreature() || p_77192_3_) && (enumcreaturetype.getPeacefulCreature() || p_77192_2_) && (!enumcreaturetype.getAnimal() || p_77192_4_)) + if ((!enumcreaturetype.func_75599_d() || p_77192_3_) && (enumcreaturetype.func_75599_d() || p_77192_2_) && (!enumcreaturetype.func_82705_e() || p_77192_4_)) { -- int j4 = p_77192_1_.countEntities(enumcreaturetype.getCreatureClass()); +- int j4 = p_77192_1_.func_72907_a(enumcreaturetype.func_75598_a()); + int j4 = p_77192_1_.countEntities(enumcreaturetype, true); - int k4 = enumcreaturetype.getMaxNumberOfCreature() * i / MOB_COUNT_DIV; + int k4 = enumcreaturetype.func_75601_b() * i / field_180268_a; if (j4 <= k4) { -+ java.util.ArrayList shuffled = com.google.common.collect.Lists.newArrayList(this.eligibleChunksForSpawning); ++ java.util.ArrayList shuffled = com.google.common.collect.Lists.newArrayList(this.field_77193_b); + java.util.Collections.shuffle(shuffled); label374: - -- for (ChunkCoordIntPair chunkcoordintpair1 : this.eligibleChunksForSpawning) +- for (ChunkCoordIntPair chunkcoordintpair1 : this.field_77193_b) + for (ChunkCoordIntPair chunkcoordintpair1 : shuffled) { - BlockPos blockpos = getRandomChunkPosition(p_77192_1_, chunkcoordintpair1.chunkXPos, chunkcoordintpair1.chunkZPos); - int k1 = blockpos.getX(); + BlockPos blockpos = func_180621_a(p_77192_1_, chunkcoordintpair1.field_77276_a, chunkcoordintpair1.field_77275_b); + int k1 = blockpos.func_177958_n(); @@ -134,8 +135,10 @@ - entityliving.setLocationAndAngles((double)f, (double)i3, (double)f1, p_77192_1_.rand.nextFloat() * 360.0F, 0.0F); + entityliving.func_70012_b((double)f, (double)i3, (double)f1, p_77192_1_.field_73012_v.nextFloat() * 360.0F, 0.0F); -- if (entityliving.getCanSpawnHere() && entityliving.handleLavaMovement()) +- if (entityliving.func_70601_bi() && entityliving.func_70058_J()) + net.minecraftforge.fml.common.eventhandler.Event.Result canSpawn = net.minecraftforge.event.ForgeEventFactory.canEntitySpawn(entityliving, p_77192_1_, f, l2, f1); -+ if (canSpawn == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW || (canSpawn == net.minecraftforge.fml.common.eventhandler.Event.Result.DEFAULT && (entityliving.getCanSpawnHere() && entityliving.handleLavaMovement()))) ++ if (canSpawn == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW || (canSpawn == net.minecraftforge.fml.common.eventhandler.Event.Result.DEFAULT && (entityliving.func_70601_bi() && entityliving.func_70058_J()))) { + if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(entityliving, p_77192_1_, f1, l2, f1)) - ientitylivingdata = entityliving.func_180482_a(p_77192_1_.getDifficultyForLocation(new BlockPos(entityliving)), ientitylivingdata); + ientitylivingdata = entityliving.func_180482_a(p_77192_1_.func_175649_E(new BlockPos(entityliving)), ientitylivingdata); - if (entityliving.handleLavaMovement()) + if (entityliving.func_70058_J()) @@ -144,7 +147,7 @@ - p_77192_1_.spawnEntityInWorld(entityliving); + p_77192_1_.func_72838_d(entityliving); } -- if (j2 >= entityliving.getMaxSpawnedInChunk()) +- if (j2 >= entityliving.func_70641_bl()) + if (i2 >= net.minecraftforge.event.ForgeEventFactory.getMaxSpawnPackSize(entityliving)) { continue label374; } @@ -193,7 +196,7 @@ { - BlockPos blockpos = pos.down(); + BlockPos blockpos = p_180267_2_.func_177977_b(); -- if (!World.doesBlockHaveSolidTopSurface(worldIn, blockpos)) -+ if (!worldIn.getBlockState(blockpos).getBlock().canCreatureSpawn(worldIn, blockpos, p_180267_0_)) +- if (!World.func_175683_a(p_180267_1_, blockpos)) ++ if (!p_180267_1_.func_180495_p(blockpos).func_177230_c().canCreatureSpawn(p_180267_1_, blockpos, p_180267_0_)) { return false; } diff --git a/patches/minecraft/net/minecraft/world/World.java.patch b/patches/minecraft/net/minecraft/world/World.java.patch index 56d15eeac..14bdc4683 100644 --- a/patches/minecraft/net/minecraft/world/World.java.patch +++ b/patches/minecraft/net/minecraft/world/World.java.patch @@ -12,62 +12,90 @@ + public static double MAX_ENTITY_RADIUS = 2.0D; + private int field_181546_a = 63; - protected boolean scheduledUpdatesAreImmediate; - public final List loadedEntityList = Lists.newArrayList(); + protected boolean field_72999_e; + public final List field_72996_f = Lists.newArrayList(); @@ -98,6 +105,10 @@ - private final WorldBorder worldBorder; - int[] lightUpdateBlockList; + private final WorldBorder field_175728_M; + int[] field_72994_J; + public boolean restoringBlockSnapshots = false; + public boolean captureBlockSnapshots = false; + public java.util.ArrayList capturedBlockSnapshots = new java.util.ArrayList(); + - protected World(ISaveHandler saveHandlerIn, WorldInfo info, WorldProvider providerIn, Profiler profilerIn, boolean client) + protected World(ISaveHandler p_i45749_1_, WorldInfo p_i45749_2_, WorldProvider p_i45749_3_, Profiler p_i45749_4_, boolean p_i45749_5_) { - this.ambientTickCountdown = this.rand.nextInt(12000); + this.field_72990_M = this.field_73012_v.nextInt(12000); @@ -110,6 +121,7 @@ - this.provider = providerIn; - this.isRemote = client; - this.worldBorder = providerIn.getWorldBorder(); + this.field_73011_w = p_i45749_3_; + this.field_72995_K = p_i45749_5_; + this.field_175728_M = p_i45749_3_.func_177501_r(); + perWorldStorage = new MapStorage((ISaveHandler)null); } - public World init() -@@ -119,6 +131,11 @@ + public World func_175643_b() +@@ -119,13 +131,18 @@ - public BiomeGenBase getBiomeGenForCoords(final BlockPos pos) + public BiomeGenBase func_180494_b(final BlockPos p_180494_1_) { -+ return this.provider.getBiomeGenForCoords(pos); +- if (this.func_175667_e(p_180494_1_)) ++ return this.field_73011_w.getBiomeGenForCoords(p_180494_1_); + } + + public BiomeGenBase getBiomeGenForCoordsBody(final BlockPos pos) + { - if (this.isBlockLoaded(pos)) ++ if (this.func_175667_e(pos)) { - Chunk chunk = this.getChunkFromBlockCoords(pos); -@@ -184,7 +201,7 @@ +- Chunk chunk = this.func_175726_f(p_180494_1_); ++ Chunk chunk = this.func_175726_f(pos); - public boolean isAirBlock(BlockPos pos) - { -- return this.getBlockState(pos).getBlock().getMaterial() == Material.air; -+ return this.getBlockState(pos).getBlock().isAir(this, pos); + try + { +- return chunk.func_177411_a(p_180494_1_, this.field_73011_w.func_177499_m()); ++ return chunk.func_177411_a(pos, this.field_73011_w.func_177499_m()); + } + catch (Throwable throwable) + { +@@ -135,7 +152,7 @@ + { + public String call() throws Exception + { +- return CrashReportCategory.func_180522_a(p_180494_1_); ++ return CrashReportCategory.func_180522_a(pos); + } + }); + throw new ReportedException(crashreport); +@@ -143,7 +160,7 @@ + } + else + { +- return this.field_73011_w.func_177499_m().func_180300_a(p_180494_1_, BiomeGenBase.field_76772_c); ++ return this.field_73011_w.func_177499_m().func_180300_a(pos, BiomeGenBase.field_76772_c); + } } - public boolean isBlockLoaded(BlockPos pos) +@@ -184,7 +201,7 @@ + + public boolean func_175623_d(BlockPos p_175623_1_) + { +- return this.func_180495_p(p_175623_1_).func_177230_c().func_149688_o() == Material.field_151579_a; ++ return this.func_180495_p(p_175623_1_).func_177230_c().isAir(this, p_175623_1_); + } + + public boolean func_175667_e(BlockPos p_175667_1_) @@ -284,39 +301,61 @@ { - Chunk chunk = this.getChunkFromBlockCoords(pos); - Block block = newState.getBlock(); + Chunk chunk = this.func_175726_f(p_180501_1_); + Block block = p_180501_2_.func_177230_c(); + + net.minecraftforge.common.util.BlockSnapshot blockSnapshot = null; -+ if (this.captureBlockSnapshots && !this.isRemote) ++ if (this.captureBlockSnapshots && !this.field_72995_K) + { -+ blockSnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(this, pos, flags); ++ blockSnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(this, p_180501_1_, p_180501_3_); + this.capturedBlockSnapshots.add(blockSnapshot); + } -+ int oldLight = getBlockState(pos).getBlock().getLightValue(this, pos); ++ int oldLight = func_180495_p(p_180501_1_).func_177230_c().getLightValue(this, p_180501_1_); + - IBlockState iblockstate = chunk.setBlockState(pos, newState); + IBlockState iblockstate = chunk.func_177436_a(p_180501_1_, p_180501_2_); if (iblockstate == null) { @@ -76,23 +104,24 @@ } else { - Block block1 = iblockstate.getBlock(); + Block block1 = iblockstate.func_177230_c(); -- if (block.getLightOpacity() != block1.getLightOpacity() || block.getLightValue() != block1.getLightValue()) -+ if (block.getLightOpacity() != block1.getLightOpacity() || block.getLightValue(this, pos) != block1.getLightValue()) +- if (block.func_149717_k() != block1.func_149717_k() || block.func_149750_m() != block1.func_149750_m()) ++ if (block.func_149717_k() != block1.func_149717_k() || block.getLightValue(this, p_180501_1_) != block1.func_149750_m()) { - this.theProfiler.startSection("checkLight"); - this.checkLight(pos); - this.theProfiler.endSection(); + this.field_72984_F.func_76320_a("checkLight"); + this.func_175664_x(p_180501_1_); + this.field_72984_F.func_76319_b(); } -- if ((flags & 2) != 0 && (!this.isRemote || (flags & 4) == 0) && chunk.isPopulated()) +- if ((p_180501_3_ & 2) != 0 && (!this.field_72995_K || (p_180501_3_ & 4) == 0) && chunk.func_150802_k()) + if (blockSnapshot == null) // Don't notify clients or update physics while capturing blockstates { -- this.markBlockForUpdate(pos); -+ this.markAndNotifyBlock(pos, chunk, iblockstate, newState, flags); // Modularize client and physic updates +- this.func_175689_h(p_180501_1_); ++ this.markAndNotifyBlock(p_180501_1_, chunk, iblockstate, p_180501_2_, p_180501_3_); // Modularize client and physic updates } +- if (!this.field_72995_K && (p_180501_3_ & 1) != 0) + return true; + } + } @@ -101,22 +130,22 @@ + // Split off from original setBlockState(BlockPos, IBlockState Block p_147465_4_, int) method in order to directly send client and physic updates + public void markAndNotifyBlock(BlockPos pos, Chunk chunk, IBlockState old, IBlockState new_, int flags) + { -+ if ((flags & 2) != 0 && (!this.isRemote || (flags & 4) == 0) && (chunk == null || chunk.isPopulated())) ++ if ((flags & 2) != 0 && (!this.field_72995_K || (flags & 4) == 0) && (chunk == null || chunk.func_150802_k())) + { -+ this.markBlockForUpdate(pos); ++ this.func_175689_h(pos); + } + { + { - if (!this.isRemote && (flags & 1) != 0) ++ if (!this.field_72995_K && (flags & 1) != 0) { -- this.notifyNeighborsRespectDebug(pos, iblockstate.getBlock()); -+ this.notifyNeighborsRespectDebug(pos, new_.getBlock()); +- this.func_175722_b(p_180501_1_, iblockstate.func_177230_c()); ++ this.func_175722_b(pos, new_.func_177230_c()); -- if (block.hasComparatorInputOverride()) -+ if (new_.getBlock().hasComparatorInputOverride()) +- if (block.func_149740_M()) ++ if (new_.func_177230_c().func_149740_M()) { -- this.updateComparatorOutputLevel(pos, block); -+ this.updateComparatorOutputLevel(pos, new_.getBlock()); +- this.func_175666_e(p_180501_1_, block); ++ this.func_175666_e(pos, new_.func_177230_c()); } } - @@ -126,38 +155,38 @@ } @@ -404,6 +443,9 @@ - public void notifyNeighborsOfStateChange(BlockPos pos, Block blockType) + public void func_175685_c(BlockPos p_175685_1_, Block p_175685_2_) { -+ if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(this, pos, this.getBlockState(pos), java.util.EnumSet.allOf(EnumFacing.class)).isCanceled()) ++ if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(this, p_175685_1_, this.func_180495_p(p_175685_1_), java.util.EnumSet.allOf(EnumFacing.class)).isCanceled()) + return; + - this.notifyBlockOfStateChange(pos.west(), blockType); - this.notifyBlockOfStateChange(pos.east(), blockType); - this.notifyBlockOfStateChange(pos.down(), blockType); + this.func_180496_d(p_175685_1_.func_177976_e(), p_175685_2_); + this.func_180496_d(p_175685_1_.func_177974_f(), p_175685_2_); + this.func_180496_d(p_175685_1_.func_177977_b(), p_175685_2_); @@ -414,6 +456,11 @@ - public void notifyNeighborsOfStateExcept(BlockPos pos, Block blockType, EnumFacing skipSide) + public void func_175695_a(BlockPos p_175695_1_, Block p_175695_2_, EnumFacing p_175695_3_) { + java.util.EnumSet directions = java.util.EnumSet.allOf(EnumFacing.class); -+ directions.remove(skipSide); -+ if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(this, pos, this.getBlockState(pos), directions).isCanceled()) ++ directions.remove(p_175695_3_); ++ if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(this, p_175695_1_, this.func_180495_p(p_175695_1_), directions).isCanceled()) + return; + - if (skipSide != EnumFacing.WEST) + if (p_175695_3_ != EnumFacing.WEST) { - this.notifyBlockOfStateChange(pos.west(), blockType); + this.func_180496_d(p_175695_1_.func_177976_e(), p_175695_2_); @@ -777,7 +824,7 @@ - public boolean isDaytime() + public boolean func_72935_r() { -- return this.skylightSubtracted < 4; -+ return this.provider.isDaytime(); +- return this.field_73008_k < 4; ++ return this.field_73011_w.isDaytime(); } - public MovingObjectPosition rayTraceBlocks(Vec3 p_72933_1_, Vec3 p_72933_2_) + public MovingObjectPosition func_72933_a(Vec3 p_72933_1_, Vec3 p_72933_2_) @@ -972,6 +1019,12 @@ - public void playSoundAtEntity(Entity p_72956_1_, String p_72956_2_, float p_72956_3_, float p_72956_4_) + public void func_72956_a(Entity p_72956_1_, String p_72956_2_, float p_72956_3_, float p_72956_4_) { + net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(p_72956_1_, p_72956_2_, p_72956_3_, p_72956_4_); + if (event.isCanceled() || event.name == null) return; @@ -165,12 +194,12 @@ + p_72956_3_ = event.newVolume; + p_72956_4_ = event.newPitch; + - for (int i = 0; i < this.worldAccesses.size(); ++i) + for (int i = 0; i < this.field_73021_x.size(); ++i) { - ((IWorldAccess)this.worldAccesses.get(i)).playSound(p_72956_2_, p_72956_1_.posX, p_72956_1_.posY, p_72956_1_.posZ, p_72956_3_, p_72956_4_); + ((IWorldAccess)this.field_73021_x.get(i)).func_72704_a(p_72956_2_, p_72956_1_.field_70165_t, p_72956_1_.field_70163_u, p_72956_1_.field_70161_v, p_72956_3_, p_72956_4_); @@ -980,6 +1033,12 @@ - public void playSoundToNearExcept(EntityPlayer p_85173_1_, String p_85173_2_, float p_85173_3_, float p_85173_4_) + public void func_85173_a(EntityPlayer p_85173_1_, String p_85173_2_, float p_85173_3_, float p_85173_4_) { + net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(p_85173_1_, p_85173_2_, p_85173_3_, p_85173_4_); + if (event.isCanceled() || event.name == null) return; @@ -178,33 +207,33 @@ + p_85173_3_ = event.newVolume; + p_85173_4_ = event.newPitch; + - for (int i = 0; i < this.worldAccesses.size(); ++i) + for (int i = 0; i < this.field_73021_x.size(); ++i) { - ((IWorldAccess)this.worldAccesses.get(i)).playSoundToNearExcept(p_85173_1_, p_85173_2_, p_85173_1_.posX, p_85173_1_.posY, p_85173_1_.posZ, p_85173_3_, p_85173_4_); + ((IWorldAccess)this.field_73021_x.get(i)).func_85102_a(p_85173_1_, p_85173_2_, p_85173_1_.field_70165_t, p_85173_1_.field_70163_u, p_85173_1_.field_70161_v, p_85173_3_, p_85173_4_); @@ -1033,6 +1092,9 @@ - public boolean spawnEntityInWorld(Entity p_72838_1_) + public boolean func_72838_d(Entity p_72838_1_) { + // do not drop any items while restoring blocksnapshots. Prevents dupes -+ if (!this.isRemote && (p_72838_1_ == null || (p_72838_1_ instanceof net.minecraft.entity.item.EntityItem && this.restoringBlockSnapshots))) return false; ++ if (!this.field_72995_K && (p_72838_1_ == null || (p_72838_1_ instanceof net.minecraft.entity.item.EntityItem && this.restoringBlockSnapshots))) return false; + - int i = MathHelper.floor_double(p_72838_1_.posX / 16.0D); - int j = MathHelper.floor_double(p_72838_1_.posZ / 16.0D); - boolean flag = p_72838_1_.forceSpawn; + int i = MathHelper.func_76128_c(p_72838_1_.field_70165_t / 16.0D); + int j = MathHelper.func_76128_c(p_72838_1_.field_70161_v / 16.0D); + boolean flag = p_72838_1_.field_98038_p; @@ -1055,6 +1117,8 @@ - this.updateAllPlayersSleepingFlag(); + this.func_72854_c(); } + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityJoinWorldEvent(p_72838_1_, this)) && !flag) return false; + - this.getChunkFromChunkCoords(i, j).addEntity(p_72838_1_); - this.loadedEntityList.add(p_72838_1_); - this.onEntityAdded(p_72838_1_); + this.func_72964_e(i, j).func_76612_a(p_72838_1_); + this.field_72996_f.add(p_72838_1_); + this.func_72923_a(p_72838_1_); @@ -1267,17 +1331,29 @@ - public int calculateSkylightSubtracted(float p_72967_1_) + public int func_72967_a(float p_72967_1_) { -+ float f = provider.getSunBrightnessFactor(p_72967_1_); ++ float f = field_73011_w.getSunBrightnessFactor(p_72967_1_); + f = 1 - f; + return (int)(f * 11); + } @@ -218,117 +247,117 @@ + * */ + public float getSunBrightnessFactor(float p_72967_1_) + { - float f = this.getCelestialAngle(p_72967_1_); - float f1 = 1.0F - (MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F); - f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + float f = this.func_72826_c(p_72967_1_); + float f1 = 1.0F - (MathHelper.func_76134_b(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F); + f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); f1 = 1.0F - f1; - f1 = (float)((double)f1 * (1.0D - (double)(this.getRainStrength(p_72967_1_) * 5.0F) / 16.0D)); - f1 = (float)((double)f1 * (1.0D - (double)(this.getThunderStrength(p_72967_1_) * 5.0F) / 16.0D)); + f1 = (float)((double)f1 * (1.0D - (double)(this.func_72867_j(p_72967_1_) * 5.0F) / 16.0D)); + f1 = (float)((double)f1 * (1.0D - (double)(this.func_72819_i(p_72967_1_) * 5.0F) / 16.0D)); - f1 = 1.0F - f1; - return (int)(f1 * 11.0F); + return f1; } - @SideOnly(Side.CLIENT) - public void removeWorldAccess(IWorldAccess p_72848_1_) + public void func_72848_b(IWorldAccess p_72848_1_) { - this.worldAccesses.remove(p_72848_1_); + this.field_73021_x.remove(p_72848_1_); @@ -1286,6 +1362,12 @@ @SideOnly(Side.CLIENT) - public float getSunBrightness(float p_72971_1_) + public float func_72971_b(float p_72971_1_) { -+ return this.provider.getSunBrightness(p_72971_1_); ++ return this.field_73011_w.getSunBrightness(p_72971_1_); + } + + @SideOnly(Side.CLIENT) + public float getSunBrightnessBody(float p_72971_1_) + { - float f = this.getCelestialAngle(p_72971_1_); - float f1 = 1.0F - (MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.2F); - f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + float f = this.func_72826_c(p_72971_1_); + float f1 = 1.0F - (MathHelper.func_76134_b(f * (float)Math.PI * 2.0F) * 2.0F + 0.2F); + f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); @@ -1298,6 +1380,12 @@ @SideOnly(Side.CLIENT) - public Vec3 getSkyColor(Entity p_72833_1_, float p_72833_2_) + public Vec3 func_72833_a(Entity p_72833_1_, float p_72833_2_) { -+ return this.provider.getSkyColor(p_72833_1_, p_72833_2_); ++ return this.field_73011_w.getSkyColor(p_72833_1_, p_72833_2_); + } + + @SideOnly(Side.CLIENT) + public Vec3 getSkyColorBody(Entity p_72833_1_, float p_72833_2_) + { - float f = this.getCelestialAngle(p_72833_2_); - float f1 = MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F; - f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + float f = this.func_72826_c(p_72833_2_); + float f1 = MathHelper.func_76134_b(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); @@ -1305,9 +1393,7 @@ - int j = MathHelper.floor_double(p_72833_1_.posY); - int k = MathHelper.floor_double(p_72833_1_.posZ); + int j = MathHelper.func_76128_c(p_72833_1_.field_70163_u); + int k = MathHelper.func_76128_c(p_72833_1_.field_70161_v); BlockPos blockpos = new BlockPos(i, j, k); -- BiomeGenBase biomegenbase = this.getBiomeGenForCoords(blockpos); -- float f2 = biomegenbase.getFloatTemperature(blockpos); -- int l = biomegenbase.getSkyColorByTemp(f2); +- BiomeGenBase biomegenbase = this.func_180494_b(blockpos); +- float f2 = biomegenbase.func_180626_a(blockpos); +- int l = biomegenbase.func_76731_a(f2); + int l = net.minecraftforge.client.ForgeHooksClient.getSkyBlendColour(this, blockpos); float f3 = (float)(l >> 16 & 255) / 255.0F; float f4 = (float)(l >> 8 & 255) / 255.0F; float f5 = (float)(l & 255) / 255.0F; @@ -1367,6 +1453,11 @@ - public float getCurrentMoonPhaseFactor() + public float func_130001_d() { -+ return provider.getCurrentMoonPhaseFactor(); ++ return field_73011_w.getCurrentMoonPhaseFactor(); + } + + public float getCurrentMoonPhaseFactorBody() + { - return WorldProvider.moonPhaseFactors[this.provider.getMoonPhase(this.worldInfo.getWorldTime())]; + return WorldProvider.field_111203_a[this.field_73011_w.func_76559_b(this.field_72986_A.func_76073_f())]; } @@ -1379,6 +1470,12 @@ @SideOnly(Side.CLIENT) - public Vec3 getCloudColour(float p_72824_1_) + public Vec3 func_72824_f(float p_72824_1_) { -+ return this.provider.drawClouds(p_72824_1_); ++ return this.field_73011_w.drawClouds(p_72824_1_); + } + + @SideOnly(Side.CLIENT) + public Vec3 drawCloudsBody(float p_72824_1_) + { - float f = this.getCelestialAngle(p_72824_1_); - float f1 = MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F; - f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + float f = this.func_72826_c(p_72824_1_); + float f1 = MathHelper.func_76134_b(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); @@ -1434,9 +1531,9 @@ - for (blockpos = new BlockPos(pos.getX(), chunk.getTopFilledSegment() + 16, pos.getZ()); blockpos.getY() >= 0; blockpos = blockpos1) + for (blockpos = new BlockPos(p_175672_1_.func_177958_n(), chunk.func_76625_h() + 16, p_175672_1_.func_177952_p()); blockpos.func_177956_o() >= 0; blockpos = blockpos1) { - blockpos1 = blockpos.down(); -- Material material = chunk.getBlock(blockpos1).getMaterial(); -+ Block block = chunk.getBlock(blockpos1); + blockpos1 = blockpos.func_177977_b(); +- Material material = chunk.func_177428_a(blockpos1).func_149688_o(); ++ Block block = chunk.func_177428_a(blockpos1); -- if (material.blocksMovement() && material != Material.leaves) -+ if (block.getMaterial().blocksMovement() && !block.isLeaves(this, blockpos1) && !block.isFoliage(this, blockpos1)) +- if (material.func_76230_c() && material != Material.field_151584_j) ++ if (block.func_149688_o().func_76230_c() && !block.isLeaves(this, blockpos1) && !block.isFoliage(this, blockpos1)) { break; } @@ -1448,6 +1545,12 @@ @SideOnly(Side.CLIENT) - public float getStarBrightness(float p_72880_1_) + public float func_72880_h(float p_72880_1_) { -+ return this.provider.getStarBrightness(p_72880_1_); ++ return this.field_73011_w.getStarBrightness(p_72880_1_); + } + + @SideOnly(Side.CLIENT) + public float getStarBrightnessBody(float p_72880_1_) + { - float f = this.getCelestialAngle(p_72880_1_); - float f1 = 1.0F - (MathHelper.cos(f * (float)Math.PI * 2.0F) * 2.0F + 0.25F); - f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + float f = this.func_72826_c(p_72880_1_); + float f1 = 1.0F - (MathHelper.func_76134_b(f * (float)Math.PI * 2.0F) * 2.0F + 0.25F); + f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); @@ -1494,7 +1597,15 @@ - entity.addEntityCrashInfo(crashreportcategory); + entity.func_85029_a(crashreportcategory); } - throw new ReportedException(crashreport); + if (net.minecraftforge.common.ForgeModContainer.removeErroringEntities) + { -+ net.minecraftforge.fml.common.FMLLog.severe(crashreport.getCompleteReport()); -+ removeEntity(entity); ++ net.minecraftforge.fml.common.FMLLog.severe(crashreport.func_71502_e()); ++ func_72900_e(entity); + } + else + { @@ -336,16 +365,16 @@ + } } - if (entity.isDead) + if (entity.field_70128_L) @@ -1554,7 +1665,15 @@ - CrashReport crashreport1 = CrashReport.makeCrashReport(throwable1, "Ticking entity"); - CrashReportCategory crashreportcategory2 = crashreport1.makeCategory("Entity being ticked"); - entity2.addEntityCrashInfo(crashreportcategory2); + CrashReport crashreport1 = CrashReport.func_85055_a(throwable1, "Ticking entity"); + CrashReportCategory crashreportcategory2 = crashreport1.func_85058_a("Entity being ticked"); + entity2.func_85029_a(crashreportcategory2); - throw new ReportedException(crashreport1); + if (net.minecraftforge.common.ForgeModContainer.removeErroringEntities) + { -+ net.minecraftforge.fml.common.FMLLog.severe(crashreport1.getCompleteReport()); -+ removeEntity(entity2); ++ net.minecraftforge.fml.common.FMLLog.severe(crashreport1.func_71502_e()); ++ func_72900_e(entity2); + } + else + { @@ -355,15 +384,15 @@ } @@ -1601,7 +1720,16 @@ - CrashReport crashreport2 = CrashReport.makeCrashReport(throwable, "Ticking block entity"); - CrashReportCategory crashreportcategory1 = crashreport2.makeCategory("Block entity being ticked"); - tileentity.addInfoToCrashReport(crashreportcategory1); + CrashReport crashreport2 = CrashReport.func_85055_a(throwable, "Ticking block entity"); + CrashReportCategory crashreportcategory1 = crashreport2.func_85058_a("Block entity being ticked"); + tileentity.func_145828_a(crashreportcategory1); - throw new ReportedException(crashreport2); + if (net.minecraftforge.common.ForgeModContainer.removeErroringTileEntities) + { -+ net.minecraftforge.fml.common.FMLLog.severe(crashreport2.getCompleteReport()); -+ tileentity.invalidate(); -+ this.removeTileEntity(tileentity.getPos()); ++ net.minecraftforge.fml.common.FMLLog.severe(crashreport2.func_71502_e()); ++ tileentity.func_145843_s(); ++ this.func_175713_t(tileentity.func_174877_v()); + } + else + { @@ -376,56 +405,56 @@ } } -- this.processingLoadedTiles = false; +- this.field_147481_N = false; - - if (!this.tileEntitiesToBeRemoved.isEmpty()) + if (!this.field_147483_b.isEmpty()) { -+ for (Object tile : tileEntitiesToBeRemoved) ++ for (Object tile : field_147483_b) + { + ((TileEntity)tile).onChunkUnload(); + } + - this.tickableTileEntities.removeAll(this.tileEntitiesToBeRemoved); - this.loadedTileEntityList.removeAll(this.tileEntitiesToBeRemoved); - this.tileEntitiesToBeRemoved.clear(); + this.field_175730_i.removeAll(this.field_147483_b); + this.field_147482_g.removeAll(this.field_147483_b); + this.field_147483_b.clear(); } -+ this.processingLoadedTiles = false; //FML Move below remove to prevent CMEs ++ this.field_147481_N = false; //FML Move below remove to prevent CMEs + - this.theProfiler.endStartSection("pendingBlockEntities"); + this.field_72984_F.func_76318_c("pendingBlockEntities"); - if (!this.addedTileEntityList.isEmpty()) + if (!this.field_147484_a.isEmpty()) @@ -1660,7 +1793,8 @@ - public boolean addTileEntity(TileEntity tile) + public boolean func_175700_a(TileEntity p_175700_1_) { -- boolean flag = this.loadedTileEntityList.add(tile); -+ List dest = processingLoadedTiles ? addedTileEntityList : loadedTileEntityList; -+ boolean flag = dest.add(tile); +- boolean flag = this.field_147482_g.add(p_175700_1_); ++ List dest = field_147481_N ? field_147484_a : field_147482_g; ++ boolean flag = dest.add(p_175700_1_); - if (flag && tile instanceof ITickable) + if (flag && p_175700_1_ instanceof ITickable) { @@ -1699,9 +1833,13 @@ { - int i = MathHelper.floor_double(p_72866_1_.posX); - int j = MathHelper.floor_double(p_72866_1_.posZ); + int i = MathHelper.func_76128_c(p_72866_1_.field_70165_t); + int j = MathHelper.func_76128_c(p_72866_1_.field_70161_v); - int k = 32; + boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(i >> 4, j >> 4)); + int k = isForced ? 0 : 32; -+ boolean canUpdate = !p_72866_2_ || this.isAreaLoaded(i - k, 0, j - k, i + k, 0, j + k, true); ++ boolean canUpdate = !p_72866_2_ || this.func_175663_a(i - k, 0, j - k, i + k, 0, j + k, true); -- if (!p_72866_2_ || this.isAreaLoaded(i - k, 0, j - k, i + k, 0, j + k, true)) +- if (!p_72866_2_ || this.func_175663_a(i - k, 0, j - k, i + k, 0, j + k, true)) + if (!canUpdate) canUpdate = net.minecraftforge.event.ForgeEventFactory.canEntityUpdate(p_72866_1_); + + if (canUpdate) { - p_72866_1_.lastTickPosX = p_72866_1_.posX; - p_72866_1_.lastTickPosY = p_72866_1_.posY; + p_72866_1_.field_70142_S = p_72866_1_.field_70165_t; + p_72866_1_.field_70137_T = p_72866_1_.field_70163_u; @@ -1829,7 +1967,7 @@ { - Block block = this.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, l1, i2)).getBlock(); + Block block = this.func_180495_p(blockpos$mutableblockpos.func_181079_c(k1, l1, i2)).func_177230_c(); -- if (block.getMaterial() != Material.air) +- if (block.func_149688_o() != Material.field_151579_a) + if (!block.isAir(this, new BlockPos(k1, l1, i2))) { return true; @@ -442,346 +471,346 @@ } } @@ -2034,6 +2176,7 @@ - public Explosion newExplosion(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) + public Explosion func_72885_a(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) { Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, p_72885_9_, p_72885_10_); + if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion; - explosion.doExplosionA(); - explosion.doExplosionB(true); + explosion.func_77278_a(); + explosion.func_77279_a(true); return explosion; @@ -2180,19 +2323,27 @@ else { - this.addTileEntity(tileEntityIn); -- this.getChunkFromBlockCoords(pos).addTileEntity(pos, tileEntityIn); -+ Chunk chunk = this.getChunkFromBlockCoords(pos); //Forge add NPE protection -+ if (chunk != null) chunk.addTileEntity(pos, tileEntityIn); + this.func_175700_a(p_175690_2_); +- this.func_175726_f(p_175690_1_).func_177426_a(p_175690_1_, p_175690_2_); ++ Chunk chunk = this.func_175726_f(p_175690_1_); //Forge add NPE protection ++ if (chunk != null) chunk.func_177426_a(p_175690_1_, p_175690_2_); } -+ this.updateComparatorOutputLevel(pos, getBlockState(pos).getBlock()); //Notify neighbors of changes ++ this.func_175666_e(p_175690_1_, func_180495_p(p_175690_1_).func_177230_c()); //Notify neighbors of changes } } - public void removeTileEntity(BlockPos pos) + public void func_175713_t(BlockPos p_175713_1_) { + //Chunk chunk = this.getChunkFromBlockCoords(pos); + //if (chunk != null) chunk.removeTileEntity(pos); + //Forge ToDO: Are these patches needed anymore? + - TileEntity tileentity = this.getTileEntity(pos); + TileEntity tileentity = this.func_175625_s(p_175713_1_); - if (tileentity != null && this.processingLoadedTiles) + if (tileentity != null && this.field_147481_N) { - tileentity.invalidate(); - this.addedTileEntityList.remove(tileentity); + tileentity.func_145843_s(); + this.field_147484_a.remove(tileentity); + if (!(tileentity instanceof ITickable)) //Forge: If they are not tickable they wont be removed in the update loop. -+ this.loadedTileEntityList.remove(tileentity); ++ this.field_147482_g.remove(tileentity); } else { @@ -2205,6 +2356,7 @@ - this.getChunkFromBlockCoords(pos).removeTileEntity(pos); + this.func_175726_f(p_175713_1_).func_177425_e(p_175713_1_); } -+ this.updateComparatorOutputLevel(pos, getBlockState(pos).getBlock()); //Notify neighbors of changes ++ this.func_175666_e(p_175713_1_, func_180495_p(p_175713_1_).func_177230_c()); //Notify neighbors of changes } - public void markTileEntityForRemoval(TileEntity tileEntityIn) + public void func_147457_a(TileEntity p_147457_1_) @@ -2223,7 +2375,7 @@ { - IBlockState iblockstate = p_175683_0_.getBlockState(p_175683_1_); - Block block = iblockstate.getBlock(); -- return block.getMaterial().isOpaque() && block.isFullCube() ? true : (block instanceof BlockStairs ? iblockstate.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP : (block instanceof BlockSlab ? iblockstate.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP : (block instanceof BlockHopper ? true : (block instanceof BlockSnow ? ((Integer)iblockstate.getValue(BlockSnow.LAYERS)).intValue() == 7 : false)))); + IBlockState iblockstate = p_175683_0_.func_180495_p(p_175683_1_); + Block block = iblockstate.func_177230_c(); +- return block.func_149688_o().func_76218_k() && block.func_149686_d() ? true : (block instanceof BlockStairs ? iblockstate.func_177229_b(BlockStairs.field_176308_b) == BlockStairs.EnumHalf.TOP : (block instanceof BlockSlab ? iblockstate.func_177229_b(BlockSlab.field_176554_a) == BlockSlab.EnumBlockHalf.TOP : (block instanceof BlockHopper ? true : (block instanceof BlockSnow ? ((Integer)iblockstate.func_177229_b(BlockSnow.field_176315_a)).intValue() == 7 : false)))); + return block.isSideSolid(p_175683_0_, p_175683_1_, EnumFacing.UP); } - public boolean isBlockNormalCube(BlockPos p_175677_1_, boolean p_175677_2_) + public boolean func_175677_d(BlockPos p_175677_1_, boolean p_175677_2_) @@ -2243,7 +2395,7 @@ else { - Block block = this.getBlockState(p_175677_1_).getBlock(); -- return block.getMaterial().isOpaque() && block.isFullCube(); + Block block = this.func_180495_p(p_175677_1_).func_177230_c(); +- return block.func_149688_o().func_76218_k() && block.func_149686_d(); + return block.isNormalCube(this, p_175677_1_); } } } @@ -2262,6 +2414,7 @@ { - this.spawnHostileMobs = hostile; - this.spawnPeacefulMobs = peaceful; -+ this.provider.setAllowedSpawnTypes(hostile, peaceful); + this.field_72985_G = p_72891_1_; + this.field_72992_H = p_72891_2_; ++ this.field_73011_w.setAllowedSpawnTypes(p_72891_1_, p_72891_2_); } - public void tick() + public void func_72835_b() @@ -2271,6 +2424,11 @@ - protected void calculateInitialWeather() + protected void func_72947_a() { -+ this.provider.calculateInitialWeather(); ++ this.field_73011_w.calculateInitialWeather(); + } + + public void calculateInitialWeatherBody() + { - if (this.worldInfo.isRaining()) + if (this.field_72986_A.func_76059_o()) { - this.rainingStrength = 1.0F; + this.field_73004_o = 1.0F; @@ -2284,6 +2442,11 @@ - protected void updateWeather() + protected void func_72979_l() { -+ this.provider.updateWeather(); ++ this.field_73011_w.updateWeather(); + } + + public void updateWeatherBody() + { - if (!this.provider.getHasNoSky()) + if (!this.field_73011_w.func_177495_o()) { - if (!this.isRemote) + if (!this.field_72995_K) @@ -2378,6 +2541,7 @@ { - this.activeChunkSet.clear(); - this.theProfiler.startSection("buildList"); -+ this.activeChunkSet.addAll(getPersistentChunks().keySet()); + this.field_72993_I.clear(); + this.field_72984_F.func_76320_a("buildList"); ++ this.field_72993_I.addAll(getPersistentChunks().keySet()); - for (int i = 0; i < this.playerEntities.size(); ++i) + for (int i = 0; i < this.field_73010_i.size(); ++i) { @@ -2435,7 +2599,7 @@ j = j + p_147467_1_; k = k + p_147467_2_; -- if (block.getMaterial() == Material.air && this.getLight(blockpos) <= this.rand.nextInt(8) && this.getLightFor(EnumSkyBlock.SKY, blockpos) <= 0) -+ if (block.isAir(this, blockpos) && this.getLight(blockpos) <= this.rand.nextInt(8) && this.getLightFor(EnumSkyBlock.SKY, blockpos) <= 0) +- if (block.func_149688_o() == Material.field_151579_a && this.func_175699_k(blockpos) <= this.field_73012_v.nextInt(8) && this.func_175642_b(EnumSkyBlock.SKY, blockpos) <= 0) ++ if (block.isAir(this, blockpos) && this.func_175699_k(blockpos) <= this.field_73012_v.nextInt(8) && this.func_175642_b(EnumSkyBlock.SKY, blockpos) <= 0) { - EntityPlayer entityplayer = this.getClosestPlayer((double)j + 0.5D, (double)l + 0.5D, (double)k + 0.5D, 8.0D); + EntityPlayer entityplayer = this.func_72977_a((double)j + 0.5D, (double)l + 0.5D, (double)k + 0.5D, 8.0D); @@ -2475,6 +2639,11 @@ - public boolean canBlockFreeze(BlockPos pos, boolean noWaterAdj) + public boolean func_175670_e(BlockPos p_175670_1_, boolean p_175670_2_) { -+ return this.provider.canBlockFreeze(pos, noWaterAdj); ++ return this.field_73011_w.canBlockFreeze(p_175670_1_, p_175670_2_); + } + -+ public boolean canBlockFreezeBody(BlockPos pos, boolean noWaterAdj) ++ public boolean canBlockFreezeBody(BlockPos p_175670_1_, boolean p_175670_2_) + { - BiomeGenBase biomegenbase = this.getBiomeGenForCoords(pos); - float f = biomegenbase.getFloatTemperature(pos); + BiomeGenBase biomegenbase = this.func_180494_b(p_175670_1_); + float f = biomegenbase.func_180626_a(p_175670_1_); @@ -2516,6 +2685,11 @@ - public boolean canSnowAt(BlockPos pos, boolean checkLight) + public boolean func_175708_f(BlockPos p_175708_1_, boolean p_175708_2_) { -+ return this.provider.canSnowAt(pos, checkLight); ++ return this.field_73011_w.canSnowAt(p_175708_1_, p_175708_2_); + } + -+ public boolean canSnowAtBody(BlockPos pos, boolean checkLight) ++ public boolean canSnowAtBody(BlockPos p_175708_1_, boolean p_175708_2_) + { - BiomeGenBase biomegenbase = this.getBiomeGenForCoords(pos); - float f = biomegenbase.getFloatTemperature(pos); + BiomeGenBase biomegenbase = this.func_180494_b(p_175708_1_); + float f = biomegenbase.func_180626_a(p_175708_1_); @@ -2533,7 +2707,7 @@ { - Block block = this.getBlockState(pos).getBlock(); + Block block = this.func_180495_p(p_175708_1_).func_177230_c(); -- if (block.getMaterial() == Material.air && Blocks.snow_layer.canPlaceBlockAt(this, pos)) -+ if (block.isAir(this, pos) && Blocks.snow_layer.canPlaceBlockAt(this, pos)) +- if (block.func_149688_o() == Material.field_151579_a && Blocks.field_150431_aC.func_176196_c(this, p_175708_1_)) ++ if (block.isAir(this, p_175708_1_) && Blocks.field_150431_aC.func_176196_c(this, p_175708_1_)) { return true; } @@ -2565,10 +2739,11 @@ else { - Block block = this.getBlockState(pos).getBlock(); -- int i = lightType == EnumSkyBlock.SKY ? 0 : block.getLightValue(); -- int j = block.getLightOpacity(); -+ int blockLight = block.getLightValue(this, pos); -+ int i = lightType == EnumSkyBlock.SKY ? 0 : blockLight; -+ int j = block.getLightOpacity(this, pos); + Block block = this.func_180495_p(p_175638_1_).func_177230_c(); +- int i = p_175638_2_ == EnumSkyBlock.SKY ? 0 : block.func_149750_m(); +- int j = block.func_149717_k(); ++ int blockLight = block.getLightValue(this, p_175638_1_); ++ int i = p_175638_2_ == EnumSkyBlock.SKY ? 0 : blockLight; ++ int j = block.getLightOpacity(this, p_175638_1_); -- if (j >= 15 && block.getLightValue() > 0) +- if (j >= 15 && block.func_149750_m() > 0) + if (j >= 15 && blockLight > 0) { j = 1; } @@ -2768,10 +2943,10 @@ - public List func_175674_a(Entity entityIn, AxisAlignedBB p_175674_2_, Predicate p_175674_3_) + public List func_175674_a(Entity p_175674_1_, AxisAlignedBB p_175674_2_, Predicate p_175674_3_) { List list = Lists.newArrayList(); -- int i = MathHelper.floor_double((p_175674_2_.minX - 2.0D) / 16.0D); -- int j = MathHelper.floor_double((p_175674_2_.maxX + 2.0D) / 16.0D); -- int k = MathHelper.floor_double((p_175674_2_.minZ - 2.0D) / 16.0D); -- int l = MathHelper.floor_double((p_175674_2_.maxZ + 2.0D) / 16.0D); -+ int i = MathHelper.floor_double((p_175674_2_.minX - MAX_ENTITY_RADIUS) / 16.0D); -+ int j = MathHelper.floor_double((p_175674_2_.maxX + MAX_ENTITY_RADIUS) / 16.0D); -+ int k = MathHelper.floor_double((p_175674_2_.minZ - MAX_ENTITY_RADIUS) / 16.0D); -+ int l = MathHelper.floor_double((p_175674_2_.maxZ + MAX_ENTITY_RADIUS) / 16.0D); +- int i = MathHelper.func_76128_c((p_175674_2_.field_72340_a - 2.0D) / 16.0D); +- int j = MathHelper.func_76128_c((p_175674_2_.field_72336_d + 2.0D) / 16.0D); +- int k = MathHelper.func_76128_c((p_175674_2_.field_72339_c - 2.0D) / 16.0D); +- int l = MathHelper.func_76128_c((p_175674_2_.field_72334_f + 2.0D) / 16.0D); ++ int i = MathHelper.func_76128_c((p_175674_2_.field_72340_a - MAX_ENTITY_RADIUS) / 16.0D); ++ int j = MathHelper.func_76128_c((p_175674_2_.field_72336_d + MAX_ENTITY_RADIUS) / 16.0D); ++ int k = MathHelper.func_76128_c((p_175674_2_.field_72339_c - MAX_ENTITY_RADIUS) / 16.0D); ++ int l = MathHelper.func_76128_c((p_175674_2_.field_72334_f + MAX_ENTITY_RADIUS) / 16.0D); for (int i1 = i; i1 <= j; ++i1) { @@ -2824,10 +2999,10 @@ - public List getEntitiesWithinAABB(Class clazz, AxisAlignedBB aabb, Predicate filter) + public List func_175647_a(Class p_175647_1_, AxisAlignedBB p_175647_2_, Predicate p_175647_3_) { -- int i = MathHelper.floor_double((aabb.minX - 2.0D) / 16.0D); -- int j = MathHelper.floor_double((aabb.maxX + 2.0D) / 16.0D); -- int k = MathHelper.floor_double((aabb.minZ - 2.0D) / 16.0D); -- int l = MathHelper.floor_double((aabb.maxZ + 2.0D) / 16.0D); -+ int i = MathHelper.floor_double((aabb.minX - MAX_ENTITY_RADIUS) / 16.0D); -+ int j = MathHelper.floor_double((aabb.maxX + MAX_ENTITY_RADIUS) / 16.0D); -+ int k = MathHelper.floor_double((aabb.minZ - MAX_ENTITY_RADIUS) / 16.0D); -+ int l = MathHelper.floor_double((aabb.maxZ + MAX_ENTITY_RADIUS) / 16.0D); +- int i = MathHelper.func_76128_c((p_175647_2_.field_72340_a - 2.0D) / 16.0D); +- int j = MathHelper.func_76128_c((p_175647_2_.field_72336_d + 2.0D) / 16.0D); +- int k = MathHelper.func_76128_c((p_175647_2_.field_72339_c - 2.0D) / 16.0D); +- int l = MathHelper.func_76128_c((p_175647_2_.field_72334_f + 2.0D) / 16.0D); ++ int i = MathHelper.func_76128_c((p_175647_2_.field_72340_a - MAX_ENTITY_RADIUS) / 16.0D); ++ int j = MathHelper.func_76128_c((p_175647_2_.field_72336_d + MAX_ENTITY_RADIUS) / 16.0D); ++ int k = MathHelper.func_76128_c((p_175647_2_.field_72339_c - MAX_ENTITY_RADIUS) / 16.0D); ++ int l = MathHelper.func_76128_c((p_175647_2_.field_72334_f + MAX_ENTITY_RADIUS) / 16.0D); List list = Lists.newArrayList(); for (int i1 = i; i1 <= j; ++i1) @@ -2905,11 +3080,13 @@ - public void loadEntities(Collection entityCollection) + public void func_175650_b(Collection p_175650_1_) { -- this.loadedEntityList.addAll(entityCollection); +- this.field_72996_f.addAll(p_175650_1_); - - for (Entity entity : entityCollection) + for (Entity entity : p_175650_1_) { -- this.onEntityAdded(entity); +- this.func_72923_a(entity); + if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityJoinWorldEvent(entity, this))) + { -+ loadedEntityList.add(entity); -+ this.onEntityAdded(entity); ++ field_72996_f.add(entity); ++ this.func_72923_a(entity); + } } } @@ -2922,7 +3099,9 @@ { - Block block = this.getBlockState(p_175716_2_).getBlock(); - AxisAlignedBB axisalignedbb = p_175716_3_ ? null : p_175716_1_.getCollisionBoundingBox(this, p_175716_2_, p_175716_1_.getDefaultState()); -- return axisalignedbb != null && !this.checkNoEntityCollision(axisalignedbb, p_175716_5_) ? false : (block.getMaterial() == Material.circuits && p_175716_1_ == Blocks.anvil ? true : block.getMaterial().isReplaceable() && p_175716_1_.canReplace(this, p_175716_2_, p_175716_4_, p_175716_6_)); -+ if (axisalignedbb != null && !this.checkNoEntityCollision(axisalignedbb, p_175716_5_)) return false; -+ if (block.getMaterial() == Material.circuits && p_175716_1_ == Blocks.anvil) return true; -+ return block.isReplaceable(this, p_175716_2_) && p_175716_1_.canReplace(this, p_175716_2_, p_175716_4_, p_175716_6_); + Block block = this.func_180495_p(p_175716_2_).func_177230_c(); + AxisAlignedBB axisalignedbb = p_175716_3_ ? null : p_175716_1_.func_180640_a(this, p_175716_2_, p_175716_1_.func_176223_P()); +- return axisalignedbb != null && !this.func_72917_a(axisalignedbb, p_175716_5_) ? false : (block.func_149688_o() == Material.field_151594_q && p_175716_1_ == Blocks.field_150467_bQ ? true : block.func_149688_o().func_76222_j() && p_175716_1_.func_176193_a(this, p_175716_2_, p_175716_4_, p_175716_6_)); ++ if (axisalignedbb != null && !this.func_72917_a(axisalignedbb, p_175716_5_)) return false; ++ if (block.func_149688_o() == Material.field_151594_q && p_175716_1_ == Blocks.field_150467_bQ) return true; ++ return block.func_176200_f(this, p_175716_2_) && p_175716_1_.func_176193_a(this, p_175716_2_, p_175716_4_, p_175716_6_); } public int func_181545_F() @@ -3007,7 +3186,7 @@ { - IBlockState iblockstate = this.getBlockState(pos); - Block block = iblockstate.getBlock(); -- return block.isNormalCube() ? this.getStrongPower(pos) : block.isProvidingWeakPower(this, pos, iblockstate, facing); -+ return block.shouldCheckWeakPower(this, pos, facing) ? this.getStrongPower(pos) : block.isProvidingWeakPower(this, pos, iblockstate, facing); + IBlockState iblockstate = this.func_180495_p(p_175651_1_); + Block block = iblockstate.func_177230_c(); +- return block.func_149721_r() ? this.func_175676_y(p_175651_1_) : block.func_180656_a(this, p_175651_1_, iblockstate, p_175651_2_); ++ return block.shouldCheckWeakPower(this, p_175651_1_, p_175651_2_) ? this.func_175676_y(p_175651_1_) : block.func_180656_a(this, p_175651_1_, iblockstate, p_175651_2_); } - public boolean isBlockPowered(BlockPos pos) + public boolean func_175640_z(BlockPos p_175640_1_) @@ -3134,7 +3313,7 @@ - public long getSeed() + public long func_72905_C() { -- return this.worldInfo.getSeed(); -+ return this.provider.getSeed(); +- return this.field_72986_A.func_76063_b(); ++ return this.field_73011_w.getSeed(); } - public long getTotalWorldTime() + public long func_82737_E() @@ -3144,17 +3323,17 @@ - public long getWorldTime() + public long func_72820_D() { -- return this.worldInfo.getWorldTime(); -+ return this.provider.getWorldTime(); +- return this.field_72986_A.func_76073_f(); ++ return this.field_73011_w.getWorldTime(); } - public void setWorldTime(long time) + public void func_72877_b(long p_72877_1_) { -- this.worldInfo.setWorldTime(time); -+ this.provider.setWorldTime(time); +- this.field_72986_A.func_76068_b(p_72877_1_); ++ this.field_73011_w.setWorldTime(p_72877_1_); } - public BlockPos getSpawnPoint() + public BlockPos func_175694_M() { -- BlockPos blockpos = new BlockPos(this.worldInfo.getSpawnX(), this.worldInfo.getSpawnY(), this.worldInfo.getSpawnZ()); -+ BlockPos blockpos = this.provider.getSpawnPoint(); +- BlockPos blockpos = new BlockPos(this.field_72986_A.func_76079_c(), this.field_72986_A.func_76075_d(), this.field_72986_A.func_76074_e()); ++ BlockPos blockpos = this.field_73011_w.getSpawnPoint(); - if (!this.getWorldBorder().contains(blockpos)) + if (!this.func_175723_af().func_177746_a(blockpos)) { @@ -3166,7 +3345,7 @@ - public void setSpawnPoint(BlockPos pos) + public void func_175652_B(BlockPos p_175652_1_) { -- this.worldInfo.setSpawn(pos); -+ this.provider.setSpawnPoint(pos); +- this.field_72986_A.func_176143_a(p_175652_1_); ++ this.field_73011_w.setSpawnPoint(p_175652_1_); } @SideOnly(Side.CLIENT) @@ -3186,12 +3365,18 @@ - if (!this.loadedEntityList.contains(entityIn)) + if (!this.field_72996_f.contains(p_72897_1_)) { -+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityJoinWorldEvent(entityIn, this))) - this.loadedEntityList.add(entityIn); ++ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityJoinWorldEvent(p_72897_1_, this))) + this.field_72996_f.add(p_72897_1_); } } - public boolean isBlockModifiable(EntityPlayer player, BlockPos pos) + public boolean func_175660_a(EntityPlayer p_175660_1_, BlockPos p_175660_2_) { -+ return this.provider.canMineBlock(player, pos); ++ return this.field_73011_w.canMineBlock(p_175660_1_, p_175660_2_); + } + -+ public boolean canMineBlockBody(EntityPlayer player, BlockPos pos) ++ public boolean canMineBlockBody(EntityPlayer p_175660_1_, BlockPos p_175660_2_) + { return true; } @@ -3285,8 +3470,7 @@ - public boolean isBlockinHighHumidity(BlockPos pos) + public boolean func_180502_D(BlockPos p_180502_1_) { -- BiomeGenBase biomegenbase = this.getBiomeGenForCoords(pos); -- return biomegenbase.isHighHumidity(); -+ return this.provider.isBlockHighHumidity(pos); +- BiomeGenBase biomegenbase = this.func_180494_b(p_180502_1_); +- return biomegenbase.func_76736_e(); ++ return this.field_73011_w.isBlockHighHumidity(p_180502_1_); } - public MapStorage getMapStorage() + public MapStorage func_175693_T() @@ -3345,12 +3529,12 @@ - public int getHeight() + public int func_72800_K() { - return 256; -+ return this.provider.getHeight(); ++ return this.field_73011_w.getHeight(); } - public int getActualHeight() + public int func_72940_L() { -- return this.provider.getHasNoSky() ? 128 : 256; -+ return this.provider.getActualHeight(); +- return this.field_73011_w.func_177495_o() ? 128 : 256; ++ return this.field_73011_w.getActualHeight(); } - public Random setRandomSeed(int p_72843_1_, int p_72843_2_, int p_72843_3_) + public Random func_72843_D(int p_72843_1_, int p_72843_2_, int p_72843_3_) @@ -3405,7 +3589,7 @@ @SideOnly(Side.CLIENT) - public double getHorizon() + public double func_72919_O() { -- return this.worldInfo.getTerrainType() == WorldType.FLAT ? 0.0D : 63.0D; -+ return provider.getHorizon(); +- return this.field_72986_A.func_76067_t() == WorldType.field_77138_c ? 0.0D : 63.0D; ++ return field_73011_w.getHorizon(); } - public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress) + public void func_175715_c(int p_175715_1_, BlockPos p_175715_2_, int p_175715_3_) @@ -3447,18 +3631,14 @@ { - IBlockState iblockstate = this.getBlockState(blockpos); + IBlockState iblockstate = this.func_180495_p(blockpos); -- if (Blocks.unpowered_comparator.isAssociated(iblockstate.getBlock())) -+ iblockstate.getBlock().onNeighborChange(this, blockpos, pos); -+ if (iblockstate.getBlock().isNormalCube(this, blockpos)) +- if (Blocks.field_150441_bU.func_149907_e(iblockstate.func_177230_c())) ++ iblockstate.func_177230_c().onNeighborChange(this, blockpos, p_175666_1_); ++ if (iblockstate.func_177230_c().isNormalCube(this, blockpos)) { -- iblockstate.getBlock().onNeighborBlockChange(this, blockpos, iblockstate, blockIn); +- iblockstate.func_177230_c().func_176204_a(this, blockpos, iblockstate, p_175666_2_); - } -- else if (iblockstate.getBlock().isNormalCube()) +- else if (iblockstate.func_177230_c().func_149721_r()) - { -- blockpos = blockpos.offset(enumfacing); -- iblockstate = this.getBlockState(blockpos); +- blockpos = blockpos.func_177972_a(enumfacing); +- iblockstate = this.func_180495_p(blockpos); - -- if (Blocks.unpowered_comparator.isAssociated(iblockstate.getBlock())) -+ BlockPos posOther = blockpos.offset(enumfacing); -+ Block other = getBlockState(posOther).getBlock(); +- if (Blocks.field_150441_bU.func_149907_e(iblockstate.func_177230_c())) ++ BlockPos posOther = blockpos.func_177972_a(enumfacing); ++ Block other = func_180495_p(posOther).func_177230_c(); + if (other.getWeakChanges(this, posOther)) { -- iblockstate.getBlock().onNeighborBlockChange(this, blockpos, iblockstate, blockIn); -+ other.onNeighborChange(this, posOther, pos); +- iblockstate.func_177230_c().func_176204_a(this, blockpos, iblockstate, p_175666_2_); ++ other.onNeighborChange(this, posOther, p_175666_1_); } } } @@ -816,11 +845,11 @@ + @Override + public boolean isSideSolid(BlockPos pos, EnumFacing side, boolean _default) + { -+ if (!this.isValid(pos)) return _default; ++ if (!this.func_175701_a(pos)) return _default; + -+ Chunk chunk = getChunkFromBlockCoords(pos); -+ if (chunk == null || chunk.isEmpty()) return _default; -+ return getBlockState(pos).getBlock().isSideSolid(this, pos, side); ++ Chunk chunk = func_175726_f(pos); ++ if (chunk == null || chunk.func_76621_g()) return _default; ++ return func_180495_p(pos).func_177230_c().isSideSolid(this, pos, side); + } + + /** @@ -841,8 +870,8 @@ + */ + public int getBlockLightOpacity(BlockPos pos) + { -+ if (!this.isValid(pos)) return 0; -+ return getChunkFromBlockCoords(pos).getBlockLightOpacity(pos); ++ if (!this.func_175701_a(pos)) return 0; ++ return func_175726_f(pos).func_177437_b(pos); + } + + /** @@ -851,9 +880,9 @@ + public int countEntities(net.minecraft.entity.EnumCreatureType type, boolean forSpawnCount) + { + int count = 0; -+ for (int x = 0; x < loadedEntityList.size(); x++) ++ for (int x = 0; x < field_72996_f.size(); x++) + { -+ if (((Entity)loadedEntityList.get(x)).isCreatureType(type, forSpawnCount)) ++ if (((Entity)field_72996_f.get(x)).isCreatureType(type, forSpawnCount)) + { + count++; + } diff --git a/patches/minecraft/net/minecraft/world/WorldProvider.java.patch b/patches/minecraft/net/minecraft/world/WorldProvider.java.patch index e87006bf0..1bfabc7e5 100644 --- a/patches/minecraft/net/minecraft/world/WorldProvider.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldProvider.java.patch @@ -2,62 +2,62 @@ +++ ../src-work/minecraft/net/minecraft/world/WorldProvider.java @@ -51,26 +51,12 @@ - protected void registerWorldChunkManager() + protected void func_76572_b() { -- WorldType worldtype = this.worldObj.getWorldInfo().getTerrainType(); +- WorldType worldtype = this.field_76579_a.func_72912_H().func_76067_t(); - -- if (worldtype == WorldType.FLAT) +- if (worldtype == WorldType.field_77138_c) - { -- FlatGeneratorInfo flatgeneratorinfo = FlatGeneratorInfo.createFlatGeneratorFromString(this.worldObj.getWorldInfo().getGeneratorOptions()); -- this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.getBiomeFromBiomeList(flatgeneratorinfo.getBiome(), BiomeGenBase.field_180279_ad), 0.5F); +- FlatGeneratorInfo flatgeneratorinfo = FlatGeneratorInfo.func_82651_a(this.field_76579_a.func_72912_H().func_82571_y()); +- this.field_76578_c = new WorldChunkManagerHell(BiomeGenBase.func_180276_a(flatgeneratorinfo.func_82648_a(), BiomeGenBase.field_180279_ad), 0.5F); - } -- else if (worldtype == WorldType.DEBUG_WORLD) +- else if (worldtype == WorldType.field_180272_g) - { -- this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.plains, 0.0F); +- this.field_76578_c = new WorldChunkManagerHell(BiomeGenBase.field_76772_c, 0.0F); - } - else - { -- this.worldChunkMgr = new WorldChunkManager(this.worldObj); +- this.field_76578_c = new WorldChunkManager(this.field_76579_a); - } -+ this.worldChunkMgr = terrainType.getChunkManager(worldObj); ++ this.field_76578_c = field_76577_b.getChunkManager(field_76579_a); } - public IChunkProvider createChunkGenerator() + public IChunkProvider func_76555_c() { -- return (IChunkProvider)(this.terrainType == WorldType.FLAT ? new ChunkProviderFlat(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings) : (this.terrainType == WorldType.DEBUG_WORLD ? new ChunkProviderDebug(this.worldObj) : (this.terrainType == WorldType.CUSTOMIZED ? new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings) : new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.generatorSettings)))); -+ return terrainType.getChunkGenerator(worldObj, generatorSettings); +- return (IChunkProvider)(this.field_76577_b == WorldType.field_77138_c ? new ChunkProviderFlat(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r(), this.field_82913_c) : (this.field_76577_b == WorldType.field_180272_g ? new ChunkProviderDebug(this.field_76579_a) : (this.field_76577_b == WorldType.field_180271_f ? new ChunkProviderGenerate(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r(), this.field_82913_c) : new ChunkProviderGenerate(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r(), this.field_82913_c)))); ++ return field_76577_b.getChunkGenerator(field_76579_a, field_82913_c); } - public boolean canCoordinateBeSpawn(int x, int z) + public boolean func_76566_a(int p_76566_1_, int p_76566_2_) @@ -153,13 +139,13 @@ - public static WorldProvider getProviderForDimension(int dimension) + public static WorldProvider func_76570_a(int p_76570_0_) { -- return (WorldProvider)(dimension == -1 ? new WorldProviderHell() : (dimension == 0 ? new WorldProviderSurface() : (dimension == 1 ? new WorldProviderEnd() : null))); -+ return net.minecraftforge.common.DimensionManager.createProviderFor(dimension); +- return (WorldProvider)(p_76570_0_ == -1 ? new WorldProviderHell() : (p_76570_0_ == 0 ? new WorldProviderSurface() : (p_76570_0_ == 1 ? new WorldProviderEnd() : null))); ++ return net.minecraftforge.common.DimensionManager.createProviderFor(p_76570_0_); } @SideOnly(Side.CLIENT) - public float getCloudHeight() + public float func_76571_f() { - return 128.0F; -+ return this.terrainType.getCloudHeight(); ++ return this.field_76577_b.getCloudHeight(); } @SideOnly(Side.CLIENT) @@ -175,13 +161,13 @@ - public int getAverageGroundLevel() + public int func_76557_i() { -- return this.terrainType == WorldType.FLAT ? 4 : this.worldObj.func_181545_F() + 1; -+ return this.terrainType.getMinimumSpawnHeight(this.worldObj); +- return this.field_76577_b == WorldType.field_77138_c ? 4 : this.field_76579_a.func_181545_F() + 1; ++ return this.field_76577_b.getMinimumSpawnHeight(this.field_76579_a); } @SideOnly(Side.CLIENT) - public double getVoidFogYFactor() + public double func_76565_k() { -- return this.terrainType == WorldType.FLAT ? 1.0D : 0.03125D; -+ return this.terrainType.voidFadeMagnitude(); +- return this.field_76577_b == WorldType.field_77138_c ? 1.0D : 0.03125D; ++ return this.field_76577_b.voidFadeMagnitude(); } @SideOnly(Side.CLIENT) @@ -79,7 +79,7 @@ + */ + public void setDimension(int dim) + { -+ this.dimensionId = dim; ++ this.field_76574_g = dim; + } + + /** @@ -89,7 +89,7 @@ + */ + public String getSaveFolder() + { -+ return (dimensionId == 0 ? null : "DIM" + dimensionId); ++ return (field_76574_g == 0 ? null : "DIM" + field_76574_g); + } + + /** @@ -181,18 +181,18 @@ + + public BlockPos getRandomizedSpawnPoint() + { -+ BlockPos ret = this.worldObj.getSpawnPoint(); ++ BlockPos ret = this.field_76579_a.func_175694_M(); + -+ boolean isAdventure = worldObj.getWorldInfo().getGameType() == WorldSettings.GameType.ADVENTURE; -+ int spawnFuzz = terrainType.getSpawnFuzz(); -+ int border = MathHelper.floor_double(worldObj.getWorldBorder().getClosestDistance(ret.getX(), ret.getZ())); ++ boolean isAdventure = field_76579_a.func_72912_H().func_76077_q() == WorldSettings.GameType.ADVENTURE; ++ int spawnFuzz = field_76577_b.getSpawnFuzz(); ++ int border = MathHelper.func_76128_c(field_76579_a.func_175723_af().func_177729_b(ret.func_177958_n(), ret.func_177952_p())); + if (border < spawnFuzz) spawnFuzz = border; + if (spawnFuzz < 1) spawnFuzz = 1; + int spawnFuzzHalf = spawnFuzz / 2; + -+ if (!getHasNoSky() && !isAdventure) ++ if (!func_177495_o() && !isAdventure) + { -+ ret = worldObj.getTopSolidOrLiquidBlock(ret.add(worldObj.rand.nextInt(spawnFuzzHalf) - spawnFuzz, 0, worldObj.rand.nextInt(spawnFuzzHalf) - spawnFuzz)); ++ ret = field_76579_a.func_175672_r(ret.func_177982_a(field_76579_a.field_73012_v.nextInt(spawnFuzzHalf) - spawnFuzz, 0, field_76579_a.field_73012_v.nextInt(spawnFuzzHalf) - spawnFuzz)); + } + + return ret; @@ -208,7 +208,7 @@ + */ + public boolean shouldMapSpin(String entity, double x, double y, double z) + { -+ return dimensionId < 0; ++ return field_76574_g < 0; + } + + /** @@ -226,12 +226,12 @@ + + public BiomeGenBase getBiomeGenForCoords(BlockPos pos) + { -+ return worldObj.getBiomeGenForCoordsBody(pos); ++ return field_76579_a.getBiomeGenForCoordsBody(pos); + } + + public boolean isDaytime() + { -+ return worldObj.getSkylightSubtracted() < 4; ++ return field_76579_a.func_175657_ab() < 4; + } + + /** @@ -244,7 +244,7 @@ + * */ + public float getSunBrightnessFactor(float par1) + { -+ return worldObj.getSunBrightnessFactor(par1); ++ return field_76579_a.getSunBrightnessFactor(par1); + } + + /** @@ -254,19 +254,19 @@ + * */ + public float getCurrentMoonPhaseFactor() + { -+ return worldObj.getCurrentMoonPhaseFactorBody(); ++ return field_76579_a.getCurrentMoonPhaseFactorBody(); + } + + @SideOnly(Side.CLIENT) + public Vec3 getSkyColor(net.minecraft.entity.Entity cameraEntity, float partialTicks) + { -+ return worldObj.getSkyColorBody(cameraEntity, partialTicks); ++ return field_76579_a.getSkyColorBody(cameraEntity, partialTicks); + } + + @SideOnly(Side.CLIENT) + public Vec3 drawClouds(float partialTicks) + { -+ return worldObj.drawCloudsBody(partialTicks); ++ return field_76579_a.drawCloudsBody(partialTicks); + } + + /** @@ -275,7 +275,7 @@ + @SideOnly(Side.CLIENT) + public float getSunBrightness(float par1) + { -+ return worldObj.getSunBrightnessBody(par1); ++ return field_76579_a.getSunBrightnessBody(par1); + } + + /** @@ -284,68 +284,68 @@ + @SideOnly(Side.CLIENT) + public float getStarBrightness(float par1) + { -+ return worldObj.getStarBrightnessBody(par1); ++ return field_76579_a.getStarBrightnessBody(par1); + } + + public void setAllowedSpawnTypes(boolean allowHostile, boolean allowPeaceful) + { -+ worldObj.spawnHostileMobs = allowHostile; -+ worldObj.spawnPeacefulMobs = allowPeaceful; ++ field_76579_a.field_72985_G = allowHostile; ++ field_76579_a.field_72992_H = allowPeaceful; + } + + public void calculateInitialWeather() + { -+ worldObj.calculateInitialWeatherBody(); ++ field_76579_a.calculateInitialWeatherBody(); + } + + public void updateWeather() + { -+ worldObj.updateWeatherBody(); ++ field_76579_a.updateWeatherBody(); + } + + public boolean canBlockFreeze(BlockPos pos, boolean byWater) + { -+ return worldObj.canBlockFreezeBody(pos, byWater); ++ return field_76579_a.canBlockFreezeBody(pos, byWater); + } + + public boolean canSnowAt(BlockPos pos, boolean checkLight) + { -+ return worldObj.canSnowAtBody(pos, checkLight); ++ return field_76579_a.canSnowAtBody(pos, checkLight); + } + public void setWorldTime(long time) + { -+ worldObj.worldInfo.setWorldTime(time); ++ field_76579_a.field_72986_A.func_76068_b(time); + } + + public long getSeed() + { -+ return worldObj.worldInfo.getSeed(); ++ return field_76579_a.field_72986_A.func_76063_b(); + } + + public long getWorldTime() + { -+ return worldObj.worldInfo.getWorldTime(); ++ return field_76579_a.field_72986_A.func_76073_f(); + } + + public BlockPos getSpawnPoint() + { -+ net.minecraft.world.storage.WorldInfo info = worldObj.worldInfo; -+ return new BlockPos(info.getSpawnX(), info.getSpawnY(), info.getSpawnZ()); ++ net.minecraft.world.storage.WorldInfo info = field_76579_a.field_72986_A; ++ return new BlockPos(info.func_76079_c(), info.func_76075_d(), info.func_76074_e()); + } + + public void setSpawnPoint(BlockPos pos) + { -+ worldObj.worldInfo.setSpawn(pos); ++ field_76579_a.field_72986_A.func_176143_a(pos); + } + + public boolean canMineBlock(net.minecraft.entity.player.EntityPlayer player, BlockPos pos) + { -+ return worldObj.canMineBlockBody(player, pos); ++ return field_76579_a.canMineBlockBody(player, pos); + } + + public boolean isBlockHighHumidity(BlockPos pos) + { -+ return worldObj.getBiomeGenForCoords(pos).isHighHumidity(); ++ return field_76579_a.func_180494_b(pos).func_76736_e(); + } + + public int getHeight() @@ -355,20 +355,20 @@ + + public int getActualHeight() + { -+ return hasNoSky ? 128 : 256; ++ return field_76576_e ? 128 : 256; + } + + public double getHorizon() + { -+ return worldObj.worldInfo.getTerrainType().getHorizon(worldObj); ++ return field_76579_a.field_72986_A.func_76067_t().getHorizon(field_76579_a); + } + + public void resetRainAndThunder() + { -+ worldObj.worldInfo.setRainTime(0); -+ worldObj.worldInfo.setRaining(false); -+ worldObj.worldInfo.setThunderTime(0); -+ worldObj.worldInfo.setThundering(false); ++ field_76579_a.field_72986_A.func_76080_g(0); ++ field_76579_a.field_72986_A.func_76084_b(false); ++ field_76579_a.field_72986_A.func_76090_f(0); ++ field_76579_a.field_72986_A.func_76069_a(false); + } + + public boolean canDoLightning(net.minecraft.world.chunk.Chunk chunk) diff --git a/patches/minecraft/net/minecraft/world/WorldServer.java.patch b/patches/minecraft/net/minecraft/world/WorldServer.java.patch index 200079885..b8e52a8fc 100644 --- a/patches/minecraft/net/minecraft/world/WorldServer.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldServer.java.patch @@ -1,8 +1,8 @@ --- ../src-base/minecraft/net/minecraft/world/WorldServer.java +++ ../src-work/minecraft/net/minecraft/world/WorldServer.java @@ -94,30 +94,46 @@ - private static final List bonusChestContent = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.stick, 0, 1, 3, 10), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.planks), 0, 1, 3, 10), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.log), 0, 1, 3, 10), new WeightedRandomChestContent(Items.stone_axe, 0, 1, 1, 3), new WeightedRandomChestContent(Items.wooden_axe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.stone_pickaxe, 0, 1, 1, 3), new WeightedRandomChestContent(Items.wooden_pickaxe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.apple, 0, 2, 3, 5), new WeightedRandomChestContent(Items.bread, 0, 2, 3, 3), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.log2), 0, 1, 3, 10)}); - private List pendingTickListEntriesThisTick = Lists.newArrayList(); + private static final List field_73069_S = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.field_151055_y, 0, 1, 3, 10), new WeightedRandomChestContent(Item.func_150898_a(Blocks.field_150344_f), 0, 1, 3, 10), new WeightedRandomChestContent(Item.func_150898_a(Blocks.field_150364_r), 0, 1, 3, 10), new WeightedRandomChestContent(Items.field_151049_t, 0, 1, 1, 3), new WeightedRandomChestContent(Items.field_151053_p, 0, 1, 1, 5), new WeightedRandomChestContent(Items.field_151050_s, 0, 1, 1, 3), new WeightedRandomChestContent(Items.field_151039_o, 0, 1, 1, 5), new WeightedRandomChestContent(Items.field_151034_e, 0, 2, 3, 5), new WeightedRandomChestContent(Items.field_151025_P, 0, 2, 3, 3), new WeightedRandomChestContent(Item.func_150898_a(Blocks.field_150363_s), 0, 1, 3, 10)}); + private List field_94579_S = Lists.newArrayList(); + /** Stores the recently processed (lighting) chunks */ + protected Set doneChunks = new java.util.HashSet(); @@ -11,111 +11,111 @@ + public static void fillChestHook() + { + if (!initChest) -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.BONUS_CHEST, bonusChestContent, 10, 10); ++ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.BONUS_CHEST, field_73069_S, 10, 10); + initChest = true; + } + - public WorldServer(MinecraftServer server, ISaveHandler saveHandlerIn, WorldInfo info, int dimensionId, Profiler profilerIn) + public WorldServer(MinecraftServer p_i45921_1_, ISaveHandler p_i45921_2_, WorldInfo p_i45921_3_, int p_i45921_4_, Profiler p_i45921_5_) { - super(saveHandlerIn, info, WorldProvider.getProviderForDimension(dimensionId), profilerIn, false); - this.mcServer = server; - this.theEntityTracker = new EntityTracker(this); - this.thePlayerManager = new PlayerManager(this); + super(p_i45921_2_, p_i45921_3_, WorldProvider.func_76570_a(p_i45921_4_), p_i45921_5_, false); + this.field_73061_a = p_i45921_1_; + this.field_73062_L = new EntityTracker(this); + this.field_73063_M = new PlayerManager(this); + // Guarantee the dimension ID was not reset by the provider -+ int providerDim = this.provider.dimensionId; - this.provider.registerWorld(this); -+ this.provider.dimensionId = providerDim; - this.chunkProvider = this.createChunkProvider(); -+ perWorldStorage = new MapStorage(new net.minecraftforge.common.WorldSpecificSaveHandler((WorldServer)this, saveHandlerIn)); - this.worldTeleporter = new Teleporter(this); - this.calculateInitialSkylight(); - this.calculateInitialWeather(); - this.getWorldBorder().setSize(server.getMaxWorldSize()); -+ net.minecraftforge.common.DimensionManager.setWorld(dimensionId, this); ++ int providerDim = this.field_73011_w.field_76574_g; + this.field_73011_w.func_76558_a(this); ++ this.field_73011_w.field_76574_g = providerDim; + this.field_73020_y = this.func_72970_h(); ++ perWorldStorage = new MapStorage(new net.minecraftforge.common.WorldSpecificSaveHandler((WorldServer)this, p_i45921_2_)); + this.field_85177_Q = new Teleporter(this); + this.func_72966_v(); + this.func_72947_a(); + this.func_175723_af().func_177725_a(p_i45921_1_.func_175580_aG()); ++ net.minecraftforge.common.DimensionManager.setWorld(p_i45921_4_, this); } - public World init() + public World func_175643_b() { - this.mapStorage = new MapStorage(this.saveHandler); - String s = VillageCollection.fileNameForProvider(this.provider); -- VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, s); -+ VillageCollection villagecollection = (VillageCollection)this.perWorldStorage.loadData(VillageCollection.class, s); + this.field_72988_C = new MapStorage(this.field_73019_z); + String s = VillageCollection.func_176062_a(this.field_73011_w); +- VillageCollection villagecollection = (VillageCollection)this.field_72988_C.func_75742_a(VillageCollection.class, s); ++ VillageCollection villagecollection = (VillageCollection)this.perWorldStorage.func_75742_a(VillageCollection.class, s); if (villagecollection == null) { - this.villageCollectionObj = new VillageCollection(this); -- this.mapStorage.setData(s, this.villageCollectionObj); -+ this.perWorldStorage.setData(s, this.villageCollectionObj); + this.field_72982_D = new VillageCollection(this); +- this.field_72988_C.func_75745_a(s, this.field_72982_D); ++ this.perWorldStorage.func_75745_a(s, this.field_72982_D); } else { @@ -210,6 +226,10 @@ - this.villageSiege.tick(); - this.theProfiler.endStartSection("portalForcer"); - this.worldTeleporter.removeStalePortalLocations(this.getTotalWorldTime()); + this.field_175740_d.func_75528_a(); + this.field_72984_F.func_76318_c("portalForcer"); + this.field_85177_Q.func_85189_a(this.func_82737_E()); + for (Teleporter tele : customTeleporters) + { -+ tele.removeStalePortalLocations(getTotalWorldTime()); ++ tele.func_85189_a(func_82737_E()); + } - this.theProfiler.endSection(); - this.sendQueuedBlockEvents(); + this.field_72984_F.func_76319_b(); + this.func_147488_Z(); } @@ -217,6 +237,7 @@ public BiomeGenBase.SpawnListEntry func_175734_a(EnumCreatureType p_175734_1_, BlockPos p_175734_2_) { - List list = this.getChunkProvider().func_177458_a(p_175734_1_, p_175734_2_); + List list = this.func_72863_F().func_177458_a(p_175734_1_, p_175734_2_); + list = net.minecraftforge.event.ForgeEventFactory.getPotentialSpawns(this, p_175734_1_, p_175734_2_, list); - return list != null && !list.isEmpty() ? (BiomeGenBase.SpawnListEntry)WeightedRandom.getRandomItem(this.rand, list) : null; + return list != null && !list.isEmpty() ? (BiomeGenBase.SpawnListEntry)WeightedRandom.func_76271_a(this.field_73012_v, list) : null; } @@ -268,10 +289,7 @@ - private void resetRainAndThunder() + private void func_73051_P() { -- this.worldInfo.setRainTime(0); -- this.worldInfo.setRaining(false); -- this.worldInfo.setThunderTime(0); -- this.worldInfo.setThundering(false); -+ this.provider.resetRainAndThunder(); +- this.field_72986_A.func_76080_g(0); +- this.field_72986_A.func_76084_b(false); +- this.field_72986_A.func_76090_f(0); +- this.field_72986_A.func_76069_a(false); ++ this.field_73011_w.resetRainAndThunder(); } - public boolean areAllPlayersAsleep() + public boolean func_73056_e() @@ -349,7 +367,7 @@ chunk.func_150804_b(false); - this.theProfiler.endStartSection("thunder"); + this.field_72984_F.func_76318_c("thunder"); -- if (this.rand.nextInt(100000) == 0 && this.isRaining() && this.isThundering()) -+ if (this.provider.canDoLightning(chunk) && this.rand.nextInt(100000) == 0 && this.isRaining() && this.isThundering()) +- if (this.field_73012_v.nextInt(100000) == 0 && this.func_72896_J() && this.func_72911_I()) ++ if (this.field_73011_w.canDoLightning(chunk) && this.field_73012_v.nextInt(100000) == 0 && this.func_72896_J() && this.func_72911_I()) { - this.updateLCG = this.updateLCG * 3 + 1013904223; - int i1 = this.updateLCG >> 2; + this.field_73005_l = this.field_73005_l * 3 + 1013904223; + int i1 = this.field_73005_l >> 2; @@ -363,7 +381,7 @@ - this.theProfiler.endStartSection("iceandsnow"); + this.field_72984_F.func_76318_c("iceandsnow"); -- if (this.rand.nextInt(16) == 0) -+ if (this.provider.canDoRainSnowIce(chunk) && this.rand.nextInt(16) == 0) +- if (this.field_73012_v.nextInt(16) == 0) ++ if (this.field_73011_w.canDoRainSnowIce(chunk) && this.field_73012_v.nextInt(16) == 0) { - this.updateLCG = this.updateLCG * 3 + 1013904223; - int k2 = this.updateLCG >> 2; + this.field_73005_l = this.field_73005_l * 3 + 1013904223; + int k2 = this.field_73005_l >> 2; @@ -456,6 +474,9 @@ - if (p_175654_2_.requiresUpdates()) + if (p_175654_2_.func_149698_L()) { i = 8; + //Keeping here as a note for future when it may be restored. -+ boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(nextticklistentry.position.getX() >> 4, nextticklistentry.position.getZ() >> 4)); ++ boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(nextticklistentry.field_180282_a.func_177958_n() >> 4, nextticklistentry.field_180282_a.func_177952_p() >> 4)); + i = isForced ? 0 : 8; - if (this.isAreaLoaded(nextticklistentry.position.add(-i, -i, -i), nextticklistentry.position.add(i, i, i))) + if (this.func_175707_a(nextticklistentry.field_180282_a.func_177982_a(-i, -i, -i), nextticklistentry.field_180282_a.func_177982_a(i, i, i))) { @@ -508,7 +529,7 @@ - public void updateEntities() + public void func_72939_s() { -- if (this.playerEntities.isEmpty()) -+ if (this.playerEntities.isEmpty() && getPersistentChunks().isEmpty()) +- if (this.field_73010_i.isEmpty()) ++ if (this.field_73010_i.isEmpty() && getPersistentChunks().isEmpty()) { - if (this.updateEntityTick++ >= 1200) + if (this.field_80004_Q++ >= 1200) { @@ -573,6 +594,9 @@ { @@ -126,32 +126,32 @@ + //byte b0 = isForced ? 0 : 8; int k = 0; - if (this.isAreaLoaded(nextticklistentry1.position.add(-k, -k, -k), nextticklistentry1.position.add(k, k, k))) + if (this.func_175707_a(nextticklistentry1.field_180282_a.func_177982_a(-k, -k, -k), nextticklistentry1.field_180282_a.func_177982_a(k, k, k))) @@ -696,22 +720,39 @@ { List list = Lists.newArrayList(); -- for (int i = 0; i < this.loadedTileEntityList.size(); ++i) +- for (int i = 0; i < this.field_147482_g.size(); ++i) + //Forge: Optomize this loop to only grab from the chunks it needs + for (int x = (p_147486_1_ >> 4); x <= (p_147486_4_ >> 4); x++) { -- TileEntity tileentity = (TileEntity)this.loadedTileEntityList.get(i); -- BlockPos blockpos = tileentity.getPos(); +- TileEntity tileentity = (TileEntity)this.field_147482_g.get(i); +- BlockPos blockpos = tileentity.func_174877_v(); - -- if (blockpos.getX() >= p_147486_1_ && blockpos.getY() >= p_147486_2_ && blockpos.getZ() >= p_147486_3_ && blockpos.getX() < p_147486_4_ && blockpos.getY() < p_147486_5_ && blockpos.getZ() < p_147486_6_) +- if (blockpos.func_177958_n() >= p_147486_1_ && blockpos.func_177956_o() >= p_147486_2_ && blockpos.func_177952_p() >= p_147486_3_ && blockpos.func_177958_n() < p_147486_4_ && blockpos.func_177956_o() < p_147486_5_ && blockpos.func_177952_p() < p_147486_6_) + for (int z = (p_147486_3_ >> 4); z <= (p_147486_6_ >> 4); z++) { - list.add(tileentity); -+ Chunk chunk = this.getChunkFromChunkCoords(x, z); ++ Chunk chunk = this.func_72964_e(x, z); + if (chunk != null) + { -+ for (TileEntity entity : chunk.getTileEntityMap().values()) ++ for (TileEntity entity : chunk.func_177434_r().values()) + { -+ if (!entity.isInvalid()) ++ if (!entity.func_145837_r()) + { -+ BlockPos pos = entity.getPos(); -+ if (pos.getX() >= p_147486_1_ && pos.getY() >= p_147486_2_ && pos.getZ() >= p_147486_3_ && -+ pos.getX() <= p_147486_4_ && pos.getY() <= p_147486_5_ && pos.getZ() <= p_147486_6_) ++ BlockPos pos = entity.func_174877_v(); ++ if (pos.func_177958_n() >= p_147486_1_ && pos.func_177956_o() >= p_147486_2_ && pos.func_177952_p() >= p_147486_3_ && ++ pos.func_177958_n() <= p_147486_4_ && pos.func_177956_o() <= p_147486_5_ && pos.func_177952_p() <= p_147486_6_) + { + list.add(entity); + } @@ -165,13 +165,13 @@ return list; } - public boolean isBlockModifiable(EntityPlayer player, BlockPos pos) + public boolean func_175660_a(EntityPlayer p_175660_1_, BlockPos p_175660_2_) { -+ return super.isBlockModifiable(player, pos); ++ return super.func_175660_a(p_175660_1_, p_175660_2_); + } -+ public boolean canMineBlockBody(EntityPlayer player, BlockPos pos) ++ public boolean canMineBlockBody(EntityPlayer p_175660_1_, BlockPos p_175660_2_) + { - return !this.mcServer.isBlockProtected(this, pos, player) && this.getWorldBorder().contains(pos); + return !this.field_73061_a.func_175579_a(this, p_175660_2_, p_175660_1_) && this.func_175723_af().func_177746_a(p_175660_2_); } @@ -777,6 +818,7 @@ @@ -179,77 +179,77 @@ else { + if (net.minecraftforge.event.ForgeEventFactory.onCreateWorldSpawn(this, p_73052_1_)) return; - this.findingSpawnPoint = true; - WorldChunkManager worldchunkmanager = this.provider.getWorldChunkManager(); - List list = worldchunkmanager.getBiomesToSpawnIn(); + this.field_72987_B = true; + WorldChunkManager worldchunkmanager = this.field_73011_w.func_177499_m(); + List list = worldchunkmanager.func_76932_a(); @@ -822,7 +864,7 @@ - protected void createBonusChest() + protected void func_73047_i() { -- WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(bonusChestContent, 10); -+ WorldGeneratorBonusChest worldgeneratorbonuschest = net.minecraftforge.common.ForgeHooks.getBonusChest(rand); +- WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(field_73069_S, 10); ++ WorldGeneratorBonusChest worldgeneratorbonuschest = net.minecraftforge.common.ForgeHooks.getBonusChest(field_73012_v); for (int i = 0; i < 10; ++i) { @@ -859,6 +901,7 @@ } - this.chunkProvider.saveChunks(p_73044_1_, p_73044_2_); + this.field_73020_y.func_73151_a(p_73044_1_, p_73044_2_); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Save(this)); - for (Chunk chunk : Lists.newArrayList(this.theChunkProviderServer.func_152380_a())) + for (Chunk chunk : Lists.newArrayList(this.field_73059_b.func_152380_a())) { @@ -892,6 +935,7 @@ - this.worldInfo.setBorderLerpTime(this.getWorldBorder().getTimeUntilTarget()); - this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.mcServer.getConfigurationManager().getHostPlayerData()); - this.mapStorage.saveAllData(); -+ this.perWorldStorage.saveAllData(); + this.field_72986_A.func_176135_e(this.func_175723_af().func_177732_i()); + this.field_73019_z.func_75755_a(this.field_72986_A, this.field_73061_a.func_71203_ab().func_72378_q()); + this.field_72988_C.func_75744_a(); ++ this.perWorldStorage.func_75744_a(); } - public void onEntityAdded(Entity p_72923_1_) + public void func_72923_a(Entity p_72923_1_) @@ -947,6 +991,7 @@ - public Explosion newExplosion(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) + public Explosion func_72885_a(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) { Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, p_72885_9_, p_72885_10_); + if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion; - explosion.doExplosionA(); - explosion.doExplosionB(false); + explosion.func_77278_a(); + explosion.func_77279_a(false); @@ -1026,19 +1071,23 @@ - this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(8, this.thunderingStrength), this.provider.getDimensionId()); + this.field_73061_a.func_71203_ab().func_148537_a(new S2BPacketChangeGameState(8, this.field_73017_q), this.field_73011_w.func_177502_q()); } + /* The function in use here has been replaced in order to only send the weather info to players in the correct dimension, + * rather than to all players on the server. This is what causes the client-side rain, as the + * client believes that it has started raining locally, rather than in another dimension. + */ - if (flag != this.isRaining()) + if (flag != this.func_72896_J()) { if (flag) { -- this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(2, 0.0F)); -+ this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(2, 0.0F), this.provider.dimensionId); +- this.field_73061_a.func_71203_ab().func_148540_a(new S2BPacketChangeGameState(2, 0.0F)); ++ this.field_73061_a.func_71203_ab().func_148537_a(new S2BPacketChangeGameState(2, 0.0F), this.field_73011_w.field_76574_g); } else { -- this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(1, 0.0F)); -+ this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(1, 0.0F), this.provider.dimensionId); +- this.field_73061_a.func_71203_ab().func_148540_a(new S2BPacketChangeGameState(1, 0.0F)); ++ this.field_73061_a.func_71203_ab().func_148537_a(new S2BPacketChangeGameState(1, 0.0F), this.field_73011_w.field_76574_g); } -- this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(7, this.rainingStrength)); -- this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(8, this.thunderingStrength)); -+ this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(7, this.rainingStrength), this.provider.dimensionId); -+ this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(8, this.thunderingStrength), this.provider.dimensionId); +- this.field_73061_a.func_71203_ab().func_148540_a(new S2BPacketChangeGameState(7, this.field_73004_o)); +- this.field_73061_a.func_71203_ab().func_148540_a(new S2BPacketChangeGameState(8, this.field_73017_q)); ++ this.field_73061_a.func_71203_ab().func_148537_a(new S2BPacketChangeGameState(7, this.field_73004_o), this.field_73011_w.field_76574_g); ++ this.field_73061_a.func_71203_ab().func_148537_a(new S2BPacketChangeGameState(8, this.field_73017_q), this.field_73011_w.field_76574_g); } } @@ -1104,6 +1153,11 @@ - return this.mcServer.isCallingFromMinecraftThread(); + return this.field_73061_a.func_152345_ab(); } + public java.io.File getChunkSaveLocation() + { -+ return ((net.minecraft.world.chunk.storage.AnvilChunkLoader)theChunkProviderServer.chunkLoader).chunkSaveLocation; ++ return ((net.minecraft.world.chunk.storage.AnvilChunkLoader)field_73059_b.field_73247_e).field_75825_d; + } + static class ServerBlockEventList extends ArrayList diff --git a/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch b/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch index 92ad1ae53..dc61a1c4d 100644 --- a/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldServerMulti.java.patch @@ -3,45 +3,45 @@ @@ -11,12 +11,13 @@ public class WorldServerMulti extends WorldServer { - private WorldServer delegate; + private WorldServer field_175743_a; + private IBorderListener borderListener; - public WorldServerMulti(MinecraftServer server, ISaveHandler saveHandlerIn, int dimensionId, WorldServer delegate, Profiler profilerIn) + public WorldServerMulti(MinecraftServer p_i45923_1_, ISaveHandler p_i45923_2_, int p_i45923_3_, WorldServer p_i45923_4_, Profiler p_i45923_5_) { - super(server, saveHandlerIn, new DerivedWorldInfo(delegate.getWorldInfo()), dimensionId, profilerIn); - this.delegate = delegate; -- delegate.getWorldBorder().addListener(new IBorderListener() + super(p_i45923_1_, p_i45923_2_, new DerivedWorldInfo(p_i45923_4_.func_72912_H()), p_i45923_3_, p_i45923_5_); + this.field_175743_a = p_i45923_4_; +- p_i45923_4_.func_175723_af().func_177737_a(new IBorderListener() + this.borderListener = new IBorderListener() { - public void onSizeChanged(WorldBorder border, double newSize) + public void func_177694_a(WorldBorder p_177694_1_, double p_177694_2_) { @@ -46,11 +47,13 @@ { - WorldServerMulti.this.getWorldBorder().setDamageBuffer(newSize); + WorldServerMulti.this.func_175723_af().func_177724_b(p_177695_2_); } - }); + }; -+ this.delegate.getWorldBorder().addListener(this.borderListener); ++ this.field_175743_a.func_175723_af().func_177737_a(this.borderListener); } - protected void saveLevel() throws MinecraftException + protected void func_73042_a() throws MinecraftException { -+ this.perWorldStorage.saveAllData(); ++ this.perWorldStorage.func_75744_a(); } - public World init() + public World func_175643_b() @@ -58,12 +61,12 @@ - this.mapStorage = this.delegate.getMapStorage(); - this.worldScoreboard = this.delegate.getScoreboard(); - String s = VillageCollection.fileNameForProvider(this.provider); -- VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, s); -+ VillageCollection villagecollection = (VillageCollection)this.perWorldStorage.loadData(VillageCollection.class, s); + this.field_72988_C = this.field_175743_a.func_175693_T(); + this.field_96442_D = this.field_175743_a.func_96441_U(); + String s = VillageCollection.func_176062_a(this.field_73011_w); +- VillageCollection villagecollection = (VillageCollection)this.field_72988_C.func_75742_a(VillageCollection.class, s); ++ VillageCollection villagecollection = (VillageCollection)this.perWorldStorage.func_75742_a(VillageCollection.class, s); if (villagecollection == null) { - this.villageCollectionObj = new VillageCollection(this); -- this.mapStorage.setData(s, this.villageCollectionObj); -+ this.perWorldStorage.setData(s, this.villageCollectionObj); + this.field_72982_D = new VillageCollection(this); +- this.field_72988_C.func_75745_a(s, this.field_72982_D); ++ this.perWorldStorage.func_75745_a(s, this.field_72982_D); } else { @@ -52,9 +52,9 @@ + + + @Override -+ public void flush() ++ public void func_73041_k() + { -+ super.flush(); -+ this.delegate.getWorldBorder().removeListener(this.borderListener); // Unlink ourselves, to prevent world leak. ++ super.func_73041_k(); ++ this.field_175743_a.func_175723_af().removeListener(this.borderListener); // Unlink ourselves, to prevent world leak. + } } diff --git a/patches/minecraft/net/minecraft/world/WorldType.java.patch b/patches/minecraft/net/minecraft/world/WorldType.java.patch index 39573c29f..1f7e26efa 100644 --- a/patches/minecraft/net/minecraft/world/WorldType.java.patch +++ b/patches/minecraft/net/minecraft/world/WorldType.java.patch @@ -2,27 +2,27 @@ +++ ../src-work/minecraft/net/minecraft/world/WorldType.java @@ -27,6 +27,7 @@ - private WorldType(int id, String name, int version) + private WorldType(int p_i1960_1_, String p_i1960_2_, int p_i1960_3_) { -+ if (name.length() > 16 && DEBUG_WORLD != null) throw new IllegalArgumentException("World type names must not be longer then 16: " + name); - this.worldType = name; - this.generatorVersion = version; - this.canBeCreated = true; ++ if (p_i1960_2_.length() > 16 && field_180272_g != null) throw new IllegalArgumentException("World type names must not be longer then 16: " + p_i1960_2_); + this.field_77133_f = p_i1960_2_; + this.field_77134_g = p_i1960_3_; + this.field_77140_h = true; @@ -113,4 +114,144 @@ - this.hasNotificationData = true; + this.field_151361_l = true; return this; } + + public net.minecraft.world.biome.WorldChunkManager getChunkManager(World world) + { -+ if (this == FLAT) ++ if (this == field_77138_c) + { -+ net.minecraft.world.gen.FlatGeneratorInfo flatgeneratorinfo = net.minecraft.world.gen.FlatGeneratorInfo.createFlatGeneratorFromString(world.getWorldInfo().getGeneratorOptions()); -+ return new net.minecraft.world.biome.WorldChunkManagerHell(net.minecraft.world.biome.BiomeGenBase.getBiomeFromBiomeList(flatgeneratorinfo.getBiome(), net.minecraft.world.biome.BiomeGenBase.field_180279_ad), 0.5F); ++ net.minecraft.world.gen.FlatGeneratorInfo flatgeneratorinfo = net.minecraft.world.gen.FlatGeneratorInfo.func_82651_a(world.func_72912_H().func_82571_y()); ++ return new net.minecraft.world.biome.WorldChunkManagerHell(net.minecraft.world.biome.BiomeGenBase.func_180276_a(flatgeneratorinfo.func_82648_a(), net.minecraft.world.biome.BiomeGenBase.field_180279_ad), 0.5F); + } -+ else if (this == DEBUG_WORLD) ++ else if (this == field_180272_g) + { -+ return new net.minecraft.world.biome.WorldChunkManagerHell(net.minecraft.world.biome.BiomeGenBase.plains, 0.0F); ++ return new net.minecraft.world.biome.WorldChunkManagerHell(net.minecraft.world.biome.BiomeGenBase.field_76772_c, 0.0F); + } + else + { @@ -32,44 +32,44 @@ + + public net.minecraft.world.chunk.IChunkProvider getChunkGenerator(World world, String generatorOptions) + { -+ if (this == FLAT) return new net.minecraft.world.gen.ChunkProviderFlat(world, world.getSeed(), world.getWorldInfo().isMapFeaturesEnabled(), generatorOptions); -+ if (this == DEBUG_WORLD) return new net.minecraft.world.gen.ChunkProviderDebug(world); -+ return new net.minecraft.world.gen.ChunkProviderGenerate(world, world.getSeed(), world.getWorldInfo().isMapFeaturesEnabled(), generatorOptions); ++ if (this == field_77138_c) return new net.minecraft.world.gen.ChunkProviderFlat(world, world.func_72905_C(), world.func_72912_H().func_76089_r(), generatorOptions); ++ if (this == field_180272_g) return new net.minecraft.world.gen.ChunkProviderDebug(world); ++ return new net.minecraft.world.gen.ChunkProviderGenerate(world, world.func_72905_C(), world.func_72912_H().func_76089_r(), generatorOptions); + } + + public int getMinimumSpawnHeight(World world) + { -+ return this == FLAT ? 4 : 64; ++ return this == field_77138_c ? 4 : 64; + } + + public double getHorizon(World world) + { -+ return this == FLAT ? 0.0D : 63.0D; ++ return this == field_77138_c ? 0.0D : 63.0D; + } + + public double voidFadeMagnitude() + { -+ return this == FLAT ? 1.0D : 0.03125D; ++ return this == field_77138_c ? 1.0D : 0.03125D; + } + + public boolean handleSlimeSpawnReduction(java.util.Random random, World world) + { -+ return this == FLAT ? random.nextInt(4) != 1 : false; ++ return this == field_77138_c ? random.nextInt(4) != 1 : false; + } + + /*=================================================== FORGE START ======================================*/ + private static int getNextID() + { -+ for (int x = 0; x < worldTypes.length; x++) ++ for (int x = 0; x < field_77139_a.length; x++) + { -+ if (worldTypes[x] == null) ++ if (field_77139_a[x] == null) + { + return x; + } + } + -+ int oldLen = worldTypes.length; -+ worldTypes = java.util.Arrays.copyOf(worldTypes, oldLen + 16); ++ int oldLen = field_77139_a.length; ++ field_77139_a = java.util.Arrays.copyOf(field_77139_a, oldLen + 16); + return oldLen; + } + @@ -95,7 +95,7 @@ + */ + public int getSpawnFuzz() + { -+ return Math.max(5, net.minecraft.server.MinecraftServer.getServer().getSpawnProtectionSize() - 6); ++ return Math.max(5, net.minecraft.server.MinecraftServer.func_71276_C().func_82357_ak() - 6); + } + + /** @@ -106,13 +106,13 @@ + @SideOnly(Side.CLIENT) + public void onCustomizeButton(net.minecraft.client.Minecraft mc, net.minecraft.client.gui.GuiCreateWorld guiCreateWorld) + { -+ if (this == WorldType.FLAT) ++ if (this == WorldType.field_77138_c) + { -+ mc.displayGuiScreen(new net.minecraft.client.gui.GuiCreateFlatWorld(guiCreateWorld, guiCreateWorld.chunkProviderSettingsJson)); ++ mc.func_147108_a(new net.minecraft.client.gui.GuiCreateFlatWorld(guiCreateWorld, guiCreateWorld.field_146334_a)); + } -+ else if (this == WorldType.CUSTOMIZED) ++ else if (this == WorldType.field_180271_f) + { -+ mc.displayGuiScreen(new net.minecraft.client.gui.GuiCustomizeWorldScreen(guiCreateWorld, guiCreateWorld.chunkProviderSettingsJson)); ++ mc.func_147108_a(new net.minecraft.client.gui.GuiCustomizeWorldScreen(guiCreateWorld, guiCreateWorld.field_146334_a)); + } + } + @@ -122,7 +122,7 @@ + */ + public boolean isCustomizable() + { -+ return this == FLAT || this == WorldType.CUSTOMIZED; ++ return this == field_77138_c || this == WorldType.field_180271_f; + } + + @@ -148,7 +148,7 @@ + public net.minecraft.world.gen.layer.GenLayer getBiomeLayer(long worldSeed, net.minecraft.world.gen.layer.GenLayer parentLayer, String chunkProviderSettingsJson) + { + net.minecraft.world.gen.layer.GenLayer ret = new net.minecraft.world.gen.layer.GenLayerBiome(200L, parentLayer, this, chunkProviderSettingsJson); -+ ret = net.minecraft.world.gen.layer.GenLayerZoom.magnify(1000L, ret, 2); ++ ret = net.minecraft.world.gen.layer.GenLayerZoom.func_75915_a(1000L, ret, 2); + ret = new net.minecraft.world.gen.layer.GenLayerBiomeEdge(1000L, ret); + return ret; + } diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeColorHelper.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeColorHelper.java.patch index 87ff307bc..4c72cae17 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeColorHelper.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeColorHelper.java.patch @@ -2,9 +2,9 @@ +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeColorHelper.java @@ -26,7 +26,7 @@ { - public int getColorAtPos(BiomeGenBase p_180283_1_, BlockPos blockPosition) + public int func_180283_a(BiomeGenBase p_180283_1_, BlockPos p_180283_2_) { -- return p_180283_1_.waterColorMultiplier; +- return p_180283_1_.field_76759_H; + return p_180283_1_.getWaterColorMultiplier(); } }; diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch index dcb280f9b..c18d05315 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch @@ -2,168 +2,168 @@ +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeDecorator.java @@ -105,8 +105,10 @@ - protected void genDecorations(BiomeGenBase p_150513_1_) + protected void func_150513_a(BiomeGenBase p_150513_1_) { -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(currentWorld, randomGenerator, field_180294_c)); - this.generateOres(); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(field_76815_a, field_76813_b, field_180294_c)); + this.func_76797_b(); -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND)) - for (int i = 0; i < this.sandPerChunk2; ++i) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND)) + for (int i = 0; i < this.field_76805_H; ++i) { - int j = this.randomGenerator.nextInt(16) + 8; + int j = this.field_76813_b.nextInt(16) + 8; @@ -114,6 +116,7 @@ - this.sandGen.generate(this.currentWorld, this.randomGenerator, this.currentWorld.getTopSolidOrLiquidBlock(this.field_180294_c.add(j, 0, k))); + this.field_76810_g.func_180709_b(this.field_76815_a, this.field_76813_b, this.field_76815_a.func_175672_r(this.field_180294_c.func_177982_a(j, 0, k))); } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CLAY)) - for (int i1 = 0; i1 < this.clayPerChunk; ++i1) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CLAY)) + for (int i1 = 0; i1 < this.field_76806_I; ++i1) { - int l1 = this.randomGenerator.nextInt(16) + 8; + int l1 = this.field_76813_b.nextInt(16) + 8; @@ -121,6 +124,7 @@ - this.clayGen.generate(this.currentWorld, this.randomGenerator, this.currentWorld.getTopSolidOrLiquidBlock(this.field_180294_c.add(l1, 0, i6))); + this.field_76809_f.func_180709_b(this.field_76815_a, this.field_76813_b, this.field_76815_a.func_175672_r(this.field_180294_c.func_177982_a(l1, 0, i6))); } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND_PASS2)) - for (int j1 = 0; j1 < this.sandPerChunk; ++j1) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND_PASS2)) + for (int j1 = 0; j1 < this.field_76801_G; ++j1) { - int i2 = this.randomGenerator.nextInt(16) + 8; + int i2 = this.field_76813_b.nextInt(16) + 8; @@ -135,6 +139,7 @@ ++k1; } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE)) for (int j2 = 0; j2 < k1; ++j2) { - int k6 = this.randomGenerator.nextInt(16) + 8; + int k6 = this.field_76813_b.nextInt(16) + 8; @@ -149,6 +154,7 @@ } } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.BIG_SHROOM)) - for (int k2 = 0; k2 < this.bigMushroomsPerChunk; ++k2) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.BIG_SHROOM)) + for (int k2 = 0; k2 < this.field_76807_J; ++k2) { - int l6 = this.randomGenerator.nextInt(16) + 8; + int l6 = this.field_76813_b.nextInt(16) + 8; @@ -156,6 +162,7 @@ - this.bigMushroomGen.generate(this.currentWorld, this.randomGenerator, this.currentWorld.getHorizon(this.field_180294_c.add(l6, 0, k10))); + this.field_76826_u.func_180709_b(this.field_76815_a, this.field_76813_b, this.field_76815_a.func_175645_m(this.field_180294_c.func_177982_a(l6, 0, k10))); } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS)) - for (int l2 = 0; l2 < this.flowersPerChunk; ++l2) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS)) + for (int l2 = 0; l2 < this.field_76802_A; ++l2) { - int i7 = this.randomGenerator.nextInt(16) + 8; + int i7 = this.field_76813_b.nextInt(16) + 8; @@ -177,6 +184,7 @@ } } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS)) - for (int i3 = 0; i3 < this.grassPerChunk; ++i3) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS)) + for (int i3 = 0; i3 < this.field_76803_B; ++i3) { - int j7 = this.randomGenerator.nextInt(16) + 8; + int j7 = this.field_76813_b.nextInt(16) + 8; @@ -190,6 +198,7 @@ } } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.DEAD_BUSH)) - for (int j3 = 0; j3 < this.deadBushPerChunk; ++j3) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.DEAD_BUSH)) + for (int j3 = 0; j3 < this.field_76804_C; ++j3) { - int k7 = this.randomGenerator.nextInt(16) + 8; + int k7 = this.field_76813_b.nextInt(16) + 8; @@ -203,6 +212,7 @@ } } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LILYPAD)) - for (int k3 = 0; k3 < this.waterlilyPerChunk; ++k3) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LILYPAD)) + for (int k3 = 0; k3 < this.field_76833_y; ++k3) { - int l7 = this.randomGenerator.nextInt(16) + 8; + int l7 = this.field_76813_b.nextInt(16) + 8; @@ -229,6 +239,8 @@ } } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM)) + { - for (int l3 = 0; l3 < this.mushroomsPerChunk; ++l3) + for (int l3 = 0; l3 < this.field_76798_D; ++l3) { - if (this.randomGenerator.nextInt(4) == 0) + if (this.field_76813_b.nextInt(4) == 0) @@ -279,7 +291,9 @@ - this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, this.field_180294_c.add(j4, l15, l8)); + this.field_76827_t.func_180709_b(this.field_76815_a, this.field_76813_b, this.field_180294_c.func_177982_a(j4, l15, l8)); } } - + } // End of Mushroom generation -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.REED)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.REED)) + { - for (int k4 = 0; k4 < this.reedsPerChunk; ++k4) + for (int k4 = 0; k4 < this.field_76799_E; ++k4) { - int i9 = this.randomGenerator.nextInt(16) + 8; + int i9 = this.field_76813_b.nextInt(16) + 8; @@ -305,7 +319,8 @@ - this.reedGen.generate(this.currentWorld, this.randomGenerator, this.field_180294_c.add(j9, i19, i13)); + this.field_76825_v.func_180709_b(this.field_76815_a, this.field_76813_b, this.field_180294_c.func_177982_a(j9, i19, i13)); } } - + } // End of Reed generation -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.PUMPKIN)) - if (this.randomGenerator.nextInt(32) == 0) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.PUMPKIN)) + if (this.field_76813_b.nextInt(32) == 0) { - int i5 = this.randomGenerator.nextInt(16) + 8; + int i5 = this.field_76813_b.nextInt(16) + 8; @@ -319,6 +334,7 @@ } } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CACTUS)) - for (int j5 = 0; j5 < this.cactiPerChunk; ++j5) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CACTUS)) + for (int j5 = 0; j5 < this.field_76800_F; ++j5) { - int l9 = this.randomGenerator.nextInt(16) + 8; + int l9 = this.field_76813_b.nextInt(16) + 8; @@ -334,6 +350,7 @@ - if (this.generateLakes) + if (this.field_76808_K) { -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE_WATER)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE_WATER)) for (int k5 = 0; k5 < 50; ++k5) { - int i10 = this.randomGenerator.nextInt(16) + 8; + int i10 = this.field_76813_b.nextInt(16) + 8; @@ -348,6 +365,7 @@ } } -+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(currentWorld, randomGenerator, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE_LAVA)) ++ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(field_76815_a, field_76813_b, field_180294_c, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE_LAVA)) for (int l5 = 0; l5 < 20; ++l5) { - int j10 = this.randomGenerator.nextInt(16) + 8; + int j10 = this.field_76813_b.nextInt(16) + 8; @@ -357,6 +375,7 @@ - (new WorldGenLiquids(Blocks.flowing_lava)).generate(this.currentWorld, this.randomGenerator, blockpos3); + (new WorldGenLiquids(Blocks.field_150356_k)).func_180709_b(this.field_76815_a, this.field_76813_b, blockpos3); } } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Post(currentWorld, randomGenerator, field_180294_c)); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Post(field_76815_a, field_76813_b, field_180294_c)); } - protected void genStandardOre1(int p_76795_1_, WorldGenerator p_76795_2_, int p_76795_3_, int p_76795_4_) + protected void func_76795_a(int p_76795_1_, WorldGenerator p_76795_2_, int p_76795_3_, int p_76795_4_) @@ -397,16 +416,29 @@ - protected void generateOres() + protected void func_76797_b() { -+ net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS.post(new net.minecraftforge.event.terraingen.OreGenEvent.Pre(currentWorld, randomGenerator, field_180294_c)); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, dirtGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIRT)) - this.genStandardOre1(this.chunkProviderSettings.dirtCount, this.dirtGen, this.chunkProviderSettings.dirtMinHeight, this.chunkProviderSettings.dirtMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, gravelGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRAVEL)) - this.genStandardOre1(this.chunkProviderSettings.gravelCount, this.gravelGen, this.chunkProviderSettings.gravelMinHeight, this.chunkProviderSettings.gravelMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, dioriteGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIORITE)) - this.genStandardOre1(this.chunkProviderSettings.dioriteCount, this.dioriteGen, this.chunkProviderSettings.dioriteMinHeight, this.chunkProviderSettings.dioriteMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, graniteGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRANITE)) - this.genStandardOre1(this.chunkProviderSettings.graniteCount, this.graniteGen, this.chunkProviderSettings.graniteMinHeight, this.chunkProviderSettings.graniteMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, andesiteGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.ANDESITE)) - this.genStandardOre1(this.chunkProviderSettings.andesiteCount, this.andesiteGen, this.chunkProviderSettings.andesiteMinHeight, this.chunkProviderSettings.andesiteMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, coalGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.COAL)) - this.genStandardOre1(this.chunkProviderSettings.coalCount, this.coalGen, this.chunkProviderSettings.coalMinHeight, this.chunkProviderSettings.coalMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, ironGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.IRON)) - this.genStandardOre1(this.chunkProviderSettings.ironCount, this.ironGen, this.chunkProviderSettings.ironMinHeight, this.chunkProviderSettings.ironMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, goldGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GOLD)) - this.genStandardOre1(this.chunkProviderSettings.goldCount, this.goldGen, this.chunkProviderSettings.goldMinHeight, this.chunkProviderSettings.goldMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, redstoneGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.REDSTONE)) - this.genStandardOre1(this.chunkProviderSettings.redstoneCount, this.redstoneGen, this.chunkProviderSettings.redstoneMinHeight, this.chunkProviderSettings.redstoneMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, diamondGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIAMOND)) - this.genStandardOre1(this.chunkProviderSettings.diamondCount, this.diamondGen, this.chunkProviderSettings.diamondMinHeight, this.chunkProviderSettings.diamondMaxHeight); -+ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(currentWorld, randomGenerator, lapisGen, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.LAPIS)) - this.genStandardOre2(this.chunkProviderSettings.lapisCount, this.lapisGen, this.chunkProviderSettings.lapisCenterHeight, this.chunkProviderSettings.lapisSpread); -+ net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS.post(new net.minecraftforge.event.terraingen.OreGenEvent.Post(currentWorld, randomGenerator, field_180294_c)); ++ net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS.post(new net.minecraftforge.event.terraingen.OreGenEvent.Pre(field_76815_a, field_76813_b, field_180294_c)); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_76823_i, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIRT)) + this.func_76795_a(this.field_180293_d.field_177790_J, this.field_76823_i, this.field_180293_d.field_177791_K, this.field_180293_d.field_177784_L); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_76820_j, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRAVEL)) + this.func_76795_a(this.field_180293_d.field_177786_N, this.field_76820_j, this.field_180293_d.field_177787_O, this.field_180293_d.field_177797_P); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_180297_k, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIORITE)) + this.func_76795_a(this.field_180293_d.field_177795_V, this.field_180297_k, this.field_180293_d.field_177794_W, this.field_180293_d.field_177801_X); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_180296_j, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRANITE)) + this.func_76795_a(this.field_180293_d.field_177799_R, this.field_180296_j, this.field_180293_d.field_177798_S, this.field_180293_d.field_177793_T); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_180295_l, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.ANDESITE)) + this.func_76795_a(this.field_180293_d.field_177802_Z, this.field_180295_l, this.field_180293_d.field_177846_aa, this.field_180293_d.field_177847_ab); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_76821_k, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.COAL)) + this.func_76795_a(this.field_180293_d.field_177845_ad, this.field_76821_k, this.field_180293_d.field_177851_ae, this.field_180293_d.field_177853_af); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_76818_l, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.IRON)) + this.func_76795_a(this.field_180293_d.field_177849_ah, this.field_76818_l, this.field_180293_d.field_177832_ai, this.field_180293_d.field_177834_aj); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_76819_m, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GOLD)) + this.func_76795_a(this.field_180293_d.field_177830_al, this.field_76819_m, this.field_180293_d.field_177840_am, this.field_180293_d.field_177842_an); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_180299_p, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.REDSTONE)) + this.func_76795_a(this.field_180293_d.field_177838_ap, this.field_180299_p, this.field_180293_d.field_177818_aq, this.field_180293_d.field_177816_ar); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_180298_q, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIAMOND)) + this.func_76795_a(this.field_180293_d.field_177812_at, this.field_180298_q, this.field_180293_d.field_177826_au, this.field_180293_d.field_177824_av); ++ if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_76815_a, field_76813_b, field_76831_p, field_180294_c, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.LAPIS)) + this.func_76793_b(this.field_180293_d.field_177820_ax, this.field_76831_p, this.field_180293_d.field_177807_ay, this.field_180293_d.field_177805_az); ++ net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS.post(new net.minecraftforge.event.terraingen.OreGenEvent.Post(field_76815_a, field_76813_b, field_180294_c)); } } diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch index 5eb0e6287..032589894 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch @@ -8,49 +8,49 @@ + } + public BiomeGenBase(int p_i1971_1_, boolean register) + { - this.minHeight = height_Default.rootHeight; - this.maxHeight = height_Default.variation; - this.temperature = 0.5F; + this.field_76748_D = field_150596_a.field_150777_a; + this.field_76749_E = field_150596_a.field_150776_b; + this.field_76750_F = 0.5F; @@ -152,6 +156,7 @@ - this.worldGeneratorBigTree = new WorldGenBigTree(false); - this.worldGeneratorSwamp = new WorldGenSwamp(); - this.biomeID = p_i1971_1_; + this.field_76758_O = new WorldGenBigTree(false); + this.field_76763_Q = new WorldGenSwamp(); + this.field_76756_M = p_i1971_1_; + if (register) - biomeList[p_i1971_1_] = this; - this.theBiomeDecorator = this.createBiomeDecorator(); - this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4)); + field_76773_a[p_i1971_1_] = this; + this.field_76760_I = this.func_76729_a(); + this.field_76762_K.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4)); @@ -168,11 +173,12 @@ - this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1)); - this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4)); - this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8)); + this.field_76761_J.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1)); + this.field_76755_L.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4)); + this.field_82914_M.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8)); + this.addDefaultFlowers(); } - public BiomeDecorator createBiomeDecorator() + public BiomeDecorator func_76729_a() { - return new BiomeDecorator(); + return getModdedBiomeDecorator(new BiomeDecorator()); } - public BiomeGenBase setTemperatureRainfall(float p_76732_1_, float p_76732_2_) + public BiomeGenBase func_76732_a(float p_76732_1_, float p_76732_2_) @@ -342,7 +348,7 @@ { - double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(p_180627_1_), 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)); + double d0 = (double)MathHelper.func_76131_a(this.func_180626_a(p_180627_1_), 0.0F, 1.0F); + double d1 = (double)MathHelper.func_76131_a(this.func_76727_i(), 0.0F, 1.0F); +- return ColorizerGrass.func_77480_a(d0, d1); ++ return getModdedBiomeGrassColor(ColorizerGrass.func_77480_a(d0, d1)); } @SideOnly(Side.CLIENT) @@ -350,7 +356,7 @@ { - double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(p_180625_1_), 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)); + double d0 = (double)MathHelper.func_76131_a(this.func_180626_a(p_180625_1_), 0.0F, 1.0F); + double d1 = (double)MathHelper.func_76131_a(this.func_76727_i(), 0.0F, 1.0F); +- return ColorizerFoliage.func_77470_a(d0, d1); ++ return getModdedBiomeFoliageColor(ColorizerFoliage.func_77470_a(d0, d1)); } - public boolean isSnowyBiome() + public boolean func_150559_j() @@ -497,6 +503,84 @@ } } @@ -65,7 +65,7 @@ + + public int getWaterColorMultiplier() + { -+ net.minecraftforge.event.terraingen.BiomeEvent.GetWaterColor event = new net.minecraftforge.event.terraingen.BiomeEvent.GetWaterColor(this, waterColorMultiplier); ++ net.minecraftforge.event.terraingen.BiomeEvent.GetWaterColor event = new net.minecraftforge.event.terraingen.BiomeEvent.GetWaterColor(this, field_76759_H); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); + return event.newColor; + } @@ -103,8 +103,8 @@ + */ + public void addDefaultFlowers() + { -+ addFlower(Blocks.yellow_flower.getDefaultState().withProperty(Blocks.yellow_flower.getTypeProperty(), BlockFlower.EnumFlowerType.DANDELION), 20); -+ addFlower(Blocks.red_flower.getDefaultState().withProperty(Blocks.red_flower.getTypeProperty(), BlockFlower.EnumFlowerType.POPPY), 20); ++ addFlower(Blocks.field_150327_N.func_176223_P().func_177226_a(Blocks.field_150327_N.func_176494_l(), BlockFlower.EnumFlowerType.DANDELION), 20); ++ addFlower(Blocks.field_150328_O.func_176223_P().func_177226_a(Blocks.field_150328_O.func_176494_l(), BlockFlower.EnumFlowerType.POPPY), 20); + } + + /** Register a new plant to be planted when bonemeal is used on grass. @@ -119,15 +119,15 @@ + + public void plantFlower(World world, Random rand, BlockPos pos) + { -+ FlowerEntry flower = (FlowerEntry)WeightedRandom.getRandomItem(rand, flowers); ++ FlowerEntry flower = (FlowerEntry)WeightedRandom.func_76271_a(rand, flowers); + if (flower == null || flower.state == null || -+ (flower.state.getBlock() instanceof net.minecraft.block.BlockBush && -+ !((net.minecraft.block.BlockBush)flower.state.getBlock()).canBlockStay(world, pos, flower.state))) ++ (flower.state.func_177230_c() instanceof net.minecraft.block.BlockBush && ++ !((net.minecraft.block.BlockBush)flower.state.func_177230_c()).func_180671_f(world, pos, flower.state))) + { + return; + } + -+ world.setBlockState(pos, flower.state, 3); ++ world.func_180501_a(pos, flower.state, 3); + } + + @@ -135,4 +135,4 @@ + static { - plains.createMutation(); + field_76772_c.func_150566_k(); diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenForest.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenForest.java.patch index 4ec3410dc..9a2aa4c10 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenForest.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenForest.java.patch @@ -1,5 +1,17 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenForest.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenForest.java +@@ -188,9 +188,9 @@ + { + return this.field_76756_M != BiomeGenBase.field_150583_P.field_76756_M && this.field_76756_M != BiomeGenBase.field_150582_Q.field_76756_M ? new BiomeGenMutated(p_180277_1_, this) + { +- public void func_180624_a(World p_180624_1_, Random p_180624_2_, BlockPos p_180624_3_) ++ public void func_180624_a(World worldIn, Random p_180624_2_, BlockPos p_180624_3_) + { +- this.field_150611_aD.func_180624_a(p_180624_1_, p_180624_2_, p_180624_3_); ++ this.field_150611_aD.func_180624_a(worldIn, p_180624_2_, p_180624_3_); + } + }: new BiomeGenMutated(p_180277_1_, this) + { @@ -201,4 +201,20 @@ }; } @@ -15,9 +27,9 @@ + } + for (BlockFlower.EnumFlowerType type : BlockFlower.EnumFlowerType.values()) + { -+ if (type.getBlockType() == BlockFlower.EnumFlowerColor.YELLOW) continue; ++ if (type.func_176964_a() == BlockFlower.EnumFlowerColor.YELLOW) continue; + if (type == BlockFlower.EnumFlowerType.BLUE_ORCHID) type = BlockFlower.EnumFlowerType.POPPY; -+ addFlower(net.minecraft.init.Blocks.red_flower.getDefaultState().withProperty(net.minecraft.init.Blocks.red_flower.getTypeProperty(), type), 10); ++ addFlower(net.minecraft.init.Blocks.field_150328_O.func_176223_P().func_177226_a(net.minecraft.init.Blocks.field_150328_O.func_176494_l(), type), 10); + } + } } diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenHills.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenHills.java.patch index 43bbe8c36..5d652e427 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenHills.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenHills.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenHills.java @@ -49,7 +49,7 @@ int i1 = p_180624_2_.nextInt(16); - BlockPos blockpos = p_180624_3_.add(k, l, i1); + BlockPos blockpos = p_180624_3_.func_177982_a(k, l, i1); -- if (worldIn.getBlockState(blockpos).getBlock() == Blocks.stone) -+ if (worldIn.getBlockState(blockpos).getBlock().isReplaceableOreGen(worldIn, blockpos, net.minecraft.block.state.pattern.BlockHelper.forBlock(Blocks.stone))) +- if (p_180624_1_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150348_b) ++ if (p_180624_1_.func_180495_p(blockpos).func_177230_c().isReplaceableOreGen(p_180624_1_, blockpos, net.minecraft.block.state.pattern.BlockHelper.func_177642_a(Blocks.field_150348_b))) { - worldIn.setBlockState(blockpos, Blocks.emerald_ore.getDefaultState(), 2); + p_180624_1_.func_180501_a(blockpos, Blocks.field_150412_bA.func_176223_P(), 2); } diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenJungle.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenJungle.java.patch index 0b3e60e87..3c559c56a 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenJungle.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenJungle.java.patch @@ -1,13 +1,13 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenJungle.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenJungle.java @@ -68,7 +68,9 @@ - super.decorate(worldIn, p_180624_2_, p_180624_3_); + super.func_180624_a(p_180624_1_, p_180624_2_, p_180624_3_); int i = p_180624_2_.nextInt(16) + 8; int j = p_180624_2_.nextInt(16) + 8; -- int k = p_180624_2_.nextInt(worldIn.getHorizon(p_180624_3_.add(i, 0, j)).getY() * 2); -+ int height = worldIn.getHorizon(p_180624_3_.add(i, 0, j)).getY() * 2; // could == 0, which crashes nextInt +- int k = p_180624_2_.nextInt(p_180624_1_.func_175645_m(p_180624_3_.func_177982_a(i, 0, j)).func_177956_o() * 2); ++ int height = p_180624_1_.func_175645_m(p_180624_3_.func_177982_a(i, 0, j)).func_177956_o() * 2; // could == 0, which crashes nextInt + if (height < 1) height = 1; + int k = p_180624_2_.nextInt(height); - (new WorldGenMelon()).generate(worldIn, p_180624_2_, p_180624_3_.add(i, k, j)); + (new WorldGenMelon()).func_180709_b(p_180624_1_, p_180624_2_, p_180624_3_.func_177982_a(i, k, j)); WorldGenVines worldgenvines = new WorldGenVines(); diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenPlains.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenPlains.java.patch index db3f9dfa0..275d4491a 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenPlains.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenPlains.java.patch @@ -8,15 +8,15 @@ + @Override + public void addDefaultFlowers() + { -+ BlockFlower red = net.minecraft.init.Blocks.red_flower; -+ BlockFlower yel = net.minecraft.init.Blocks.yellow_flower; -+ addFlower(red.getDefaultState().withProperty(red.getTypeProperty(), BlockFlower.EnumFlowerType.ORANGE_TULIP), 3); -+ addFlower(red.getDefaultState().withProperty(red.getTypeProperty(), BlockFlower.EnumFlowerType.RED_TULIP), 3); -+ addFlower(red.getDefaultState().withProperty(red.getTypeProperty(), BlockFlower.EnumFlowerType.PINK_TULIP), 3); -+ addFlower(red.getDefaultState().withProperty(red.getTypeProperty(), BlockFlower.EnumFlowerType.WHITE_TULIP), 3); -+ addFlower(red.getDefaultState().withProperty(red.getTypeProperty(), BlockFlower.EnumFlowerType.POPPY), 20); -+ addFlower(red.getDefaultState().withProperty(red.getTypeProperty(), BlockFlower.EnumFlowerType.HOUSTONIA), 20); -+ addFlower(red.getDefaultState().withProperty(red.getTypeProperty(), BlockFlower.EnumFlowerType.OXEYE_DAISY), 20); -+ addFlower(yel.getDefaultState().withProperty(yel.getTypeProperty(), BlockFlower.EnumFlowerType.DANDELION), 30); ++ BlockFlower red = net.minecraft.init.Blocks.field_150328_O; ++ BlockFlower yel = net.minecraft.init.Blocks.field_150327_N; ++ addFlower(red.func_176223_P().func_177226_a(red.func_176494_l(), BlockFlower.EnumFlowerType.ORANGE_TULIP), 3); ++ addFlower(red.func_176223_P().func_177226_a(red.func_176494_l(), BlockFlower.EnumFlowerType.RED_TULIP), 3); ++ addFlower(red.func_176223_P().func_177226_a(red.func_176494_l(), BlockFlower.EnumFlowerType.PINK_TULIP), 3); ++ addFlower(red.func_176223_P().func_177226_a(red.func_176494_l(), BlockFlower.EnumFlowerType.WHITE_TULIP), 3); ++ addFlower(red.func_176223_P().func_177226_a(red.func_176494_l(), BlockFlower.EnumFlowerType.POPPY), 20); ++ addFlower(red.func_176223_P().func_177226_a(red.func_176494_l(), BlockFlower.EnumFlowerType.HOUSTONIA), 20); ++ addFlower(red.func_176223_P().func_177226_a(red.func_176494_l(), BlockFlower.EnumFlowerType.OXEYE_DAISY), 20); ++ addFlower(yel.func_176223_P().func_177226_a(yel.func_176494_l(), BlockFlower.EnumFlowerType.DANDELION), 30); + } } diff --git a/patches/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java.patch b/patches/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java.patch index 298d372c2..2df358347 100644 --- a/patches/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java.patch @@ -8,6 +8,6 @@ + @Override + public void addDefaultFlowers() + { -+ addFlower(Blocks.red_flower.getDefaultState().withProperty(Blocks.red_flower.getTypeProperty(), BlockFlower.EnumFlowerType.BLUE_ORCHID), 10); ++ addFlower(Blocks.field_150328_O.func_176223_P().func_177226_a(Blocks.field_150328_O.func_176494_l(), BlockFlower.EnumFlowerType.BLUE_ORCHID), 10); + } } diff --git a/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch b/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch index 1eeff6ed9..5378a0e20 100644 --- a/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch +++ b/patches/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch @@ -4,36 +4,36 @@ public class WorldChunkManager { -+ public static List allowedBiomes = Lists.newArrayList(BiomeGenBase.forest, BiomeGenBase.plains, BiomeGenBase.taiga, BiomeGenBase.taigaHills, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills); - private GenLayer genBiomes; - private GenLayer biomeIndexLayer; - private BiomeCache biomeCache; ++ public static List allowedBiomes = Lists.newArrayList(BiomeGenBase.field_76767_f, BiomeGenBase.field_76772_c, BiomeGenBase.field_76768_g, BiomeGenBase.field_76784_u, BiomeGenBase.field_76785_t, BiomeGenBase.field_76782_w, BiomeGenBase.field_76792_x); + private GenLayer field_76944_d; + private GenLayer field_76945_e; + private BiomeCache field_76942_f; @@ -27,13 +28,7 @@ - this.biomeCache = new BiomeCache(this); + this.field_76942_f = new BiomeCache(this); this.field_180301_f = ""; - this.biomesToSpawnIn = Lists.newArrayList(); -- this.biomesToSpawnIn.add(BiomeGenBase.forest); -- this.biomesToSpawnIn.add(BiomeGenBase.plains); -- this.biomesToSpawnIn.add(BiomeGenBase.taiga); -- this.biomesToSpawnIn.add(BiomeGenBase.taigaHills); -- this.biomesToSpawnIn.add(BiomeGenBase.forestHills); -- this.biomesToSpawnIn.add(BiomeGenBase.jungle); -- this.biomesToSpawnIn.add(BiomeGenBase.jungleHills); -+ this.biomesToSpawnIn.addAll(allowedBiomes); + this.field_76943_g = Lists.newArrayList(); +- this.field_76943_g.add(BiomeGenBase.field_76767_f); +- this.field_76943_g.add(BiomeGenBase.field_76772_c); +- this.field_76943_g.add(BiomeGenBase.field_76768_g); +- this.field_76943_g.add(BiomeGenBase.field_76784_u); +- this.field_76943_g.add(BiomeGenBase.field_76785_t); +- this.field_76943_g.add(BiomeGenBase.field_76782_w); +- this.field_76943_g.add(BiomeGenBase.field_76792_x); ++ this.field_76943_g.addAll(allowedBiomes); } public WorldChunkManager(long p_i45744_1_, WorldType p_i45744_3_, String p_i45744_4_) @@ -41,6 +36,7 @@ this(); this.field_180301_f = p_i45744_4_; - GenLayer[] agenlayer = GenLayer.initializeAllBiomeGenerators(p_i45744_1_, p_i45744_3_, p_i45744_4_); + GenLayer[] agenlayer = GenLayer.func_180781_a(p_i45744_1_, p_i45744_3_, p_i45744_4_); + agenlayer = getModdedBiomeGenerators(p_i45744_3_, p_i45744_1_, agenlayer); - this.genBiomes = agenlayer[0]; - this.biomeIndexLayer = agenlayer[1]; + this.field_76944_d = agenlayer[0]; + this.field_76945_e = agenlayer[1]; } @@ -249,4 +245,11 @@ { - this.biomeCache.cleanupCache(); + this.field_76942_f.func_76838_a(); } + + public GenLayer[] getModdedBiomeGenerators(WorldType worldType, long seed, GenLayer[] original) diff --git a/patches/minecraft/net/minecraft/world/border/WorldBorder.java.patch b/patches/minecraft/net/minecraft/world/border/WorldBorder.java.patch index 154d87191..6c9214f8e 100644 --- a/patches/minecraft/net/minecraft/world/border/WorldBorder.java.patch +++ b/patches/minecraft/net/minecraft/world/border/WorldBorder.java.patch @@ -1,12 +1,12 @@ --- ../src-base/minecraft/net/minecraft/world/border/WorldBorder.java +++ ../src-work/minecraft/net/minecraft/world/border/WorldBorder.java @@ -277,4 +277,9 @@ - iborderlistener.onWarningDistanceChanged(this, warningDistance); + iborderlistener.func_177690_b(this, p_177747_1_); } } + + public void removeListener(IBorderListener listener) + { -+ this.listeners.remove(listener); ++ this.field_177758_a.remove(listener); + } } diff --git a/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch b/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch index 4c6fe00bf..2c8ef5224 100644 --- a/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch @@ -2,58 +2,58 @@ +++ ../src-work/minecraft/net/minecraft/world/chunk/Chunk.java @@ -167,7 +167,7 @@ { - Block block = this.getBlock0(j, l - 1, k); + Block block = this.func_150810_a(j, l - 1, k); -- if (block.getLightOpacity() != 0) -+ if (getBlockLightOpacity(j, l - 1, k) != 0) +- if (block.func_149717_k() != 0) ++ if (func_150808_b(j, l - 1, k) != 0) { - this.heightMap[k << 4 | j] = l; + this.field_76634_f[k << 4 | j] = l; @@ -440,12 +440,12 @@ - public int getBlockLightOpacity(BlockPos pos) + public int func_177437_b(BlockPos p_177437_1_) { -- return this.getBlock(pos).getLightOpacity(); -+ return this.getBlock(pos).getLightOpacity(worldObj, pos); +- return this.func_177428_a(p_177437_1_).func_149717_k(); ++ return this.func_177428_a(p_177437_1_).getLightOpacity(field_76637_e, p_177437_1_); } - private int getBlockLightOpacity(int x, int y, int z) + private int func_150808_b(int p_150808_1_, int p_150808_2_, int p_150808_3_) { -- return this.getBlock0(x, y, z).getLightOpacity(); -+ return getBlockLightOpacity(new BlockPos((xPosition << 4) + x, y, (zPosition << 4) + z)); +- return this.func_150810_a(p_150808_1_, p_150808_2_, p_150808_3_).func_149717_k(); ++ return func_177437_b(new BlockPos((field_76635_g << 4) + p_150808_1_, p_150808_2_, (field_76647_h << 4) + p_150808_3_)); } - private Block getBlock0(int x, int y, int z) + private Block func_150810_a(int p_150810_1_, int p_150810_2_, int p_150810_3_) @@ -623,14 +623,19 @@ - extendedblockstorage.set(i, j & 15, k, state); + extendedblockstorage.func_177484_a(i, j & 15, k, p_177436_2_); - if (block1 != block) + //if (block1 != block) { - if (!this.worldObj.isRemote) + if (!this.field_76637_e.field_72995_K) { + if (block1 != block) //Only fire block breaks when the block changes. - block1.breakBlock(this.worldObj, pos, iblockstate); -+ TileEntity te = this.getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK); -+ if (te != null && te.shouldRefresh(this.worldObj, pos, iblockstate, state)) this.worldObj.removeTileEntity(pos); + block1.func_180663_b(this.field_76637_e, p_177436_1_, iblockstate); ++ TileEntity te = this.func_177424_a(p_177436_1_, Chunk.EnumCreateEntityType.CHECK); ++ if (te != null && te.shouldRefresh(this.field_76637_e, p_177436_1_, iblockstate, p_177436_2_)) this.field_76637_e.func_175713_t(p_177436_1_); } - else if (block1 instanceof ITileEntityProvider) + else if (block1.hasTileEntity(iblockstate)) { -+ TileEntity te = this.getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK); -+ if (te != null && te.shouldRefresh(this.worldObj, pos, iblockstate, state)) - this.worldObj.removeTileEntity(pos); ++ TileEntity te = this.func_177424_a(p_177436_1_, Chunk.EnumCreateEntityType.CHECK); ++ if (te != null && te.shouldRefresh(this.field_76637_e, p_177436_1_, iblockstate, p_177436_2_)) + this.field_76637_e.func_175713_t(p_177436_1_); } } @@ -647,8 +652,8 @@ } else { -- int j1 = block.getLightOpacity(); -- int k1 = block1.getLightOpacity(); -+ int j1 = block.getLightOpacity(this.worldObj, pos); -+ int k1 = block1.getLightOpacity(this.worldObj, pos); +- int j1 = block.func_149717_k(); +- int k1 = block1.func_149717_k(); ++ int j1 = block.getLightOpacity(this.field_76637_e, p_177436_1_); ++ int k1 = block1.getLightOpacity(this.field_76637_e, p_177436_1_); if (j1 > 0) { @@ -63,55 +63,55 @@ - if (block1 instanceof ITileEntityProvider) - { -- TileEntity tileentity = this.getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK); +- TileEntity tileentity = this.func_177424_a(p_177436_1_, Chunk.EnumCreateEntityType.CHECK); - - if (tileentity != null) - { -- tileentity.updateContainingBlockInfo(); +- tileentity.func_145836_u(); - } - } - - if (!this.worldObj.isRemote && block1 != block) + if (!this.field_76637_e.field_72995_K && block1 != block) { - block.onBlockAdded(this.worldObj, pos, state); + block.func_176213_c(this.field_76637_e, p_177436_1_, p_177436_2_); } - if (block instanceof ITileEntityProvider) -+ if (block.hasTileEntity(state)) ++ if (block.hasTileEntity(p_177436_2_)) { - TileEntity tileentity1 = this.getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK); + TileEntity tileentity1 = this.func_177424_a(p_177436_1_, Chunk.EnumCreateEntityType.CHECK); if (tileentity1 == null) { -- tileentity1 = ((ITileEntityProvider)block).createNewTileEntity(this.worldObj, block.getMetaFromState(state)); -+ tileentity1 = block.createTileEntity(this.worldObj, state); - this.worldObj.setTileEntity(pos, tileentity1); +- tileentity1 = ((ITileEntityProvider)block).func_149915_a(this.field_76637_e, block.func_176201_c(p_177436_2_)); ++ tileentity1 = block.createTileEntity(this.field_76637_e, p_177436_2_); + this.field_76637_e.func_175690_a(p_177436_1_, tileentity1); } @@ -792,6 +787,7 @@ - k = this.entityLists.length - 1; + k = this.field_76645_j.length - 1; } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityEvent.EnteringChunk(entityIn, this.xPosition, this.zPosition, entityIn.chunkCoordX, entityIn.chunkCoordZ)); - entityIn.addedToChunk = true; - entityIn.chunkCoordX = this.xPosition; - entityIn.chunkCoordY = k; ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityEvent.EnteringChunk(p_76612_1_, this.field_76635_g, this.field_76647_h, p_76612_1_.field_70176_ah, p_76612_1_.field_70164_aj)); + p_76612_1_.field_70175_ag = true; + p_76612_1_.field_70176_ah = this.field_76635_g; + p_76612_1_.field_70162_ai = k; @@ -830,13 +826,20 @@ - private TileEntity createNewTileEntity(BlockPos pos) + private TileEntity func_177422_i(BlockPos p_177422_1_) { - Block block = this.getBlock(pos); -- return !block.hasTileEntity() ? null : ((ITileEntityProvider)block).createNewTileEntity(this.worldObj, this.getBlockMetadata(pos)); -+ IBlockState state = block.getStateFromMeta(this.getBlockMetadata(pos)); -+ return !block.hasTileEntity(state) ? null : block.createTileEntity(this.worldObj, state); + Block block = this.func_177428_a(p_177422_1_); +- return !block.func_149716_u() ? null : ((ITileEntityProvider)block).func_149915_a(this.field_76637_e, this.func_177418_c(p_177422_1_)); ++ IBlockState state = block.func_176203_a(this.func_177418_c(p_177422_1_)); ++ return !block.hasTileEntity(state) ? null : block.createTileEntity(this.field_76637_e, state); } - public TileEntity getTileEntity(BlockPos pos, Chunk.EnumCreateEntityType p_177424_2_) + public TileEntity func_177424_a(BlockPos p_177424_1_, Chunk.EnumCreateEntityType p_177424_2_) { - TileEntity tileentity = (TileEntity)this.chunkTileEntityMap.get(pos); + TileEntity tileentity = (TileEntity)this.field_150816_i.get(p_177424_1_); -+ if (tileentity != null && tileentity.isInvalid()) ++ if (tileentity != null && tileentity.func_145837_r()) + { -+ chunkTileEntityMap.remove(pos); ++ field_150816_i.remove(p_177424_1_); + tileentity = null; + } + @@ -119,110 +119,110 @@ { if (p_177424_2_ == Chunk.EnumCreateEntityType.IMMEDIATE) @@ -849,11 +852,6 @@ - this.field_177447_w.add(pos); + this.field_177447_w.add(p_177424_1_); } } -- else if (tileentity.isInvalid()) +- else if (tileentity.func_145837_r()) - { -- this.chunkTileEntityMap.remove(pos); +- this.field_150816_i.remove(p_177424_1_); - return null; - } return tileentity; } @@ -873,7 +871,7 @@ - tileEntityIn.setWorldObj(this.worldObj); - tileEntityIn.setPos(pos); + p_177426_2_.func_145834_a(this.field_76637_e); + p_177426_2_.func_174878_a(p_177426_1_); -- if (this.getBlock(pos) instanceof ITileEntityProvider) -+ if (this.getBlock(pos).hasTileEntity(getBlock(pos).getStateFromMeta(this.getBlockMetadata(pos)))) +- if (this.func_177428_a(p_177426_1_) instanceof ITileEntityProvider) ++ if (this.func_177428_a(p_177426_1_).hasTileEntity(func_177428_a(p_177426_1_).func_176203_a(this.func_177418_c(p_177426_1_)))) { - if (this.chunkTileEntityMap.containsKey(pos)) + if (this.field_150816_i.containsKey(p_177426_1_)) { @@ -910,8 +908,9 @@ - entity.onChunkLoad(); + entity.func_110123_P(); } -- this.worldObj.loadEntities(this.entityLists[i]); -+ this.worldObj.loadEntities(com.google.common.collect.ImmutableList.copyOf(this.entityLists[i])); +- this.field_76637_e.func_175650_b(this.field_76645_j[i]); ++ this.field_76637_e.func_175650_b(com.google.common.collect.ImmutableList.copyOf(this.field_76645_j[i])); } + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(this)); } - public void onChunkUnload() + public void func_76623_d() @@ -927,6 +926,7 @@ { - this.worldObj.unloadEntities(this.entityLists[i]); + this.field_76637_e.func_175681_c(this.field_76645_j[i]); } + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Unload(this)); } - public void setChunkModified() + public void func_76630_e() @@ -936,8 +936,8 @@ - public void getEntitiesWithinAABBForEntity(Entity entityIn, AxisAlignedBB aabb, List listToFill, Predicate p_177414_4_) + public void func_177414_a(Entity p_177414_1_, AxisAlignedBB p_177414_2_, List p_177414_3_, Predicate p_177414_4_) { -- int i = MathHelper.floor_double((aabb.minY - 2.0D) / 16.0D); -- int j = MathHelper.floor_double((aabb.maxY + 2.0D) / 16.0D); -+ int i = MathHelper.floor_double((aabb.minY - World.MAX_ENTITY_RADIUS) / 16.0D); -+ int j = MathHelper.floor_double((aabb.maxY + World.MAX_ENTITY_RADIUS) / 16.0D); - i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1); - j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1); +- int i = MathHelper.func_76128_c((p_177414_2_.field_72338_b - 2.0D) / 16.0D); +- int j = MathHelper.func_76128_c((p_177414_2_.field_72337_e + 2.0D) / 16.0D); ++ int i = MathHelper.func_76128_c((p_177414_2_.field_72338_b - World.MAX_ENTITY_RADIUS) / 16.0D); ++ int j = MathHelper.func_76128_c((p_177414_2_.field_72337_e + World.MAX_ENTITY_RADIUS) / 16.0D); + i = MathHelper.func_76125_a(i, 0, this.field_76645_j.length - 1); + j = MathHelper.func_76125_a(j, 0, this.field_76645_j.length - 1); @@ -976,8 +976,8 @@ - public void getEntitiesOfTypeWithinAAAB(Class entityClass, AxisAlignedBB aabb, List listToFill, Predicate p_177430_4_) + public void func_177430_a(Class p_177430_1_, AxisAlignedBB p_177430_2_, List p_177430_3_, Predicate p_177430_4_) { -- int i = MathHelper.floor_double((aabb.minY - 2.0D) / 16.0D); -- int j = MathHelper.floor_double((aabb.maxY + 2.0D) / 16.0D); -+ int i = MathHelper.floor_double((aabb.minY - World.MAX_ENTITY_RADIUS) / 16.0D); -+ int j = MathHelper.floor_double((aabb.maxY + World.MAX_ENTITY_RADIUS) / 16.0D); - i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1); - j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1); +- int i = MathHelper.func_76128_c((p_177430_2_.field_72338_b - 2.0D) / 16.0D); +- int j = MathHelper.func_76128_c((p_177430_2_.field_72337_e + 2.0D) / 16.0D); ++ int i = MathHelper.func_76128_c((p_177430_2_.field_72338_b - World.MAX_ENTITY_RADIUS) / 16.0D); ++ int j = MathHelper.func_76128_c((p_177430_2_.field_72337_e + World.MAX_ENTITY_RADIUS) / 16.0D); + i = MathHelper.func_76125_a(i, 0, this.field_76645_j.length - 1); + j = MathHelper.func_76125_a(j, 0, this.field_76645_j.length - 1); @@ -1137,8 +1137,10 @@ while (!this.field_177447_w.isEmpty()) { BlockPos blockpos = (BlockPos)this.field_177447_w.poll(); -+ Block block = this.getBlock(blockpos); -+ IBlockState state = block.getStateFromMeta(this.getBlockMetadata(blockpos)); ++ Block block = this.func_177428_a(blockpos); ++ IBlockState state = block.func_176203_a(this.func_177418_c(blockpos)); -- if (this.getTileEntity(blockpos, Chunk.EnumCreateEntityType.CHECK) == null && this.getBlock(blockpos).hasTileEntity()) -+ if (this.getTileEntity(blockpos, Chunk.EnumCreateEntityType.CHECK) == null && block.hasTileEntity(state)) +- if (this.func_177424_a(blockpos, Chunk.EnumCreateEntityType.CHECK) == null && this.func_177428_a(blockpos).func_149716_u()) ++ if (this.func_177424_a(blockpos, Chunk.EnumCreateEntityType.CHECK) == null && block.hasTileEntity(state)) { - TileEntity tileentity = this.createNewTileEntity(blockpos); - this.worldObj.setTileEntity(blockpos, tileentity); + TileEntity tileentity = this.func_177422_i(blockpos); + this.field_76637_e.func_175690_a(blockpos, tileentity); @@ -1200,6 +1202,13 @@ @SideOnly(Side.CLIENT) - public void fillChunk(byte[] p_177439_1_, int p_177439_2_, boolean p_177439_3_) + public void func_177439_a(byte[] p_177439_1_, int p_177439_2_, boolean p_177439_3_) { -+ for(TileEntity tileEntity : chunkTileEntityMap.values()) ++ for(TileEntity tileEntity : field_150816_i.values()) + { -+ tileEntity.updateContainingBlockInfo(); -+ tileEntity.getBlockMetadata(); -+ tileEntity.getBlockType(); ++ tileEntity.func_145836_u(); ++ tileEntity.func_145832_p(); ++ tileEntity.func_145838_q(); + } + int i = 0; - boolean flag = !this.worldObj.provider.getHasNoSky(); + boolean flag = !this.field_76637_e.field_73011_w.func_177495_o(); @@ -1267,10 +1276,16 @@ - this.isTerrainPopulated = true; - this.generateHeightMap(); + this.field_76646_k = true; + this.func_76590_a(); + List invalidList = new java.util.ArrayList(); + - for (TileEntity tileentity : this.chunkTileEntityMap.values()) + for (TileEntity tileentity : this.field_150816_i.values()) { -+ if (tileentity.shouldRefresh(this.worldObj, tileentity.getPos(), tileentity.getBlockType().getStateFromMeta(tileentity.getBlockMetadata()), getBlockState(tileentity.getPos()))) ++ if (tileentity.shouldRefresh(this.field_76637_e, tileentity.func_174877_v(), tileentity.func_145838_q().func_176203_a(tileentity.func_145832_p()), func_177435_g(tileentity.func_174877_v()))) + invalidList.add(tileentity); - tileentity.updateContainingBlockInfo(); + tileentity.func_145836_u(); } + -+ for (TileEntity te : invalidList) te.invalidate(); ++ for (TileEntity te : invalidList) te.func_145843_s(); } - public BiomeGenBase getBiome(BlockPos pos, WorldChunkManager chunkManager) + public BiomeGenBase func_177411_a(BlockPos p_177411_1_, WorldChunkManager p_177411_2_) @@ -1583,4 +1598,20 @@ QUEUED, CHECK; @@ -234,12 +234,12 @@ + */ + public void removeInvalidTileEntity(BlockPos pos) + { -+ if (isChunkLoaded) ++ if (field_76636_d) + { -+ TileEntity entity = (TileEntity)chunkTileEntityMap.get(pos); -+ if (entity != null && entity.isInvalid()) ++ TileEntity entity = (TileEntity)field_150816_i.get(pos); ++ if (entity != null && entity.func_145837_r()) + { -+ chunkTileEntityMap.remove(pos); ++ field_150816_i.remove(pos); + } + } + } diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch index 2be4b4a6a..cd92eee57 100644 --- a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch @@ -1,16 +1,16 @@ --- ../src-base/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java +++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java @@ -42,8 +42,41 @@ - this.chunkSaveLocation = chunkSaveLocationIn; + this.field_75825_d = p_i2003_1_; } + public boolean chunkExists(World world, int x, int z) + { + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(x, z); + -+ if (this.pendingAnvilChunksCoordinates.contains(chunkcoordintpair)) ++ if (this.field_75826_b.contains(chunkcoordintpair)) + { -+ for(ChunkCoordIntPair pendingChunkCoord : this.chunksToRemove.keySet()) ++ for(ChunkCoordIntPair pendingChunkCoord : this.field_75828_a.keySet()) + { + if (pendingChunkCoord.equals(chunkcoordintpair)) + { @@ -19,67 +19,67 @@ + } + } + -+ return RegionFileCache.createOrLoadRegionFile(this.chunkSaveLocation, x, z).chunkExists(x & 31, z & 31); ++ return RegionFileCache.func_76550_a(this.field_75825_d, x, z).chunkExists(x & 31, z & 31); + } + - public Chunk loadChunk(World worldIn, int x, int z) throws IOException + public Chunk func_75815_a(World p_75815_1_, int p_75815_2_, int p_75815_3_) throws IOException { -+ Object[] data = this.loadChunk__Async(worldIn, x, z); ++ Object[] data = this.loadChunk__Async(p_75815_1_, p_75815_2_, p_75815_3_); + + if (data != null) + { + Chunk chunk = (Chunk) data[0]; + NBTTagCompound nbttagcompound = (NBTTagCompound) data[1]; -+ this.loadEntities(worldIn, nbttagcompound.getCompoundTag("Level"), chunk); ++ this.loadEntities(p_75815_1_, nbttagcompound.func_74775_l("Level"), chunk); + return chunk; + } + + return null; + } + -+ public Object[] loadChunk__Async(World worldIn, int x, int z) throws IOException ++ public Object[] loadChunk__Async(World p_75815_1_, int p_75815_2_, int p_75815_3_) throws IOException + { - ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(x, z); - NBTTagCompound nbttagcompound = (NBTTagCompound)this.chunksToRemove.get(chunkcoordintpair); + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(p_75815_2_, p_75815_3_); + NBTTagCompound nbttagcompound = (NBTTagCompound)this.field_75828_a.get(chunkcoordintpair); @@ -59,11 +92,17 @@ - nbttagcompound = CompressedStreamTools.read(datainputstream); + nbttagcompound = CompressedStreamTools.func_74794_a(datainputstream); } -- return this.checkedReadChunkFromNBT(worldIn, x, z, nbttagcompound); -+ return this.checkedReadChunkFromNBT__Async(worldIn, x, z, nbttagcompound); +- return this.func_75822_a(p_75815_1_, p_75815_2_, p_75815_3_, nbttagcompound); ++ return this.checkedReadChunkFromNBT__Async(p_75815_1_, p_75815_2_, p_75815_3_, nbttagcompound); } - protected Chunk checkedReadChunkFromNBT(World worldIn, int x, int z, NBTTagCompound p_75822_4_) + protected Chunk func_75822_a(World p_75822_1_, int p_75822_2_, int p_75822_3_, NBTTagCompound p_75822_4_) { -+ Object[] data = this.checkedReadChunkFromNBT__Async(worldIn, x, z, p_75822_4_); ++ Object[] data = this.checkedReadChunkFromNBT__Async(p_75822_1_, p_75822_2_, p_75822_3_, p_75822_4_); + return data != null ? (Chunk)data[0] : null; + } + -+ protected Object[] checkedReadChunkFromNBT__Async(World worldIn, int x, int z, NBTTagCompound p_75822_4_) ++ protected Object[] checkedReadChunkFromNBT__Async(World p_75822_1_, int p_75822_2_, int p_75822_3_, NBTTagCompound p_75822_4_) + { - if (!p_75822_4_.hasKey("Level", 10)) + if (!p_75822_4_.func_150297_b("Level", 10)) { - logger.error("Chunk file at " + x + "," + z + " is missing level data, skipping"); + field_151505_a.error("Chunk file at " + p_75822_2_ + "," + p_75822_3_ + " is missing level data, skipping"); @@ -87,10 +126,29 @@ - logger.error("Chunk file at " + x + "," + z + " is in the wrong location; relocating. (Expected " + x + ", " + z + ", got " + chunk.xPosition + ", " + chunk.zPosition + ")"); - nbttagcompound.setInteger("xPos", x); - nbttagcompound.setInteger("zPos", z); + field_151505_a.error("Chunk file at " + p_75822_2_ + "," + p_75822_3_ + " is in the wrong location; relocating. (Expected " + p_75822_2_ + ", " + p_75822_3_ + ", got " + chunk.field_76635_g + ", " + chunk.field_76647_h + ")"); + nbttagcompound.func_74768_a("xPos", p_75822_2_); + nbttagcompound.func_74768_a("zPos", p_75822_3_); + + // Have to move tile entities since we don't load them at this stage -+ NBTTagList _tileEntities = nbttagcompound.getTagList("TileEntities", 10); ++ NBTTagList _tileEntities = nbttagcompound.func_150295_c("TileEntities", 10); + + if (_tileEntities != null) + { -+ for (int te = 0; te < _tileEntities.tagCount(); te++) ++ for (int te = 0; te < _tileEntities.func_74745_c(); te++) + { -+ NBTTagCompound _nbt = (NBTTagCompound) _tileEntities.getCompoundTagAt(te); -+ _nbt.setInteger("x", x * 16 + (_nbt.getInteger("x") - chunk.xPosition * 16)); -+ _nbt.setInteger("z", z * 16 + (_nbt.getInteger("z") - chunk.zPosition * 16)); ++ NBTTagCompound _nbt = (NBTTagCompound) _tileEntities.func_150305_b(te); ++ _nbt.func_74768_a("x", p_75822_2_ * 16 + (_nbt.func_74762_e("x") - chunk.field_76635_g * 16)); ++ _nbt.func_74768_a("z", p_75822_3_ * 16 + (_nbt.func_74762_e("z") - chunk.field_76647_h * 16)); + } + } + - chunk = this.readChunkFromNBT(worldIn, nbttagcompound); + chunk = this.func_75823_a(p_75822_1_, nbttagcompound); } - return chunk; @@ -94,10 +94,10 @@ } @@ -105,6 +163,7 @@ NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound.setTag("Level", nbttagcompound1); - this.writeChunkToNBT(chunkIn, worldIn, nbttagcompound1); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkDataEvent.Save(chunkIn, nbttagcompound)); - this.addChunkToPending(chunkIn.getChunkCoordIntPair(), nbttagcompound); + nbttagcompound.func_74782_a("Level", nbttagcompound1); + this.func_75820_a(p_75816_2_, p_75816_1_, nbttagcompound1); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkDataEvent.Save(p_75816_2_, nbttagcompound)); + this.func_75824_a(p_75816_2_.func_76632_l(), nbttagcompound); } catch (Exception exception) @@ -281,11 +340,20 @@ @@ -106,10 +106,10 @@ + try + { - if (entity.writeToNBTOptional(nbttagcompound1)) + if (entity.func_70039_c(nbttagcompound1)) { - chunkIn.setHasEntities(true); - nbttaglist1.appendTag(nbttagcompound1); + p_75820_1_.func_177409_g(true); + nbttaglist1.func_74742_a(nbttagcompound1); } + } + catch (Exception e) @@ -122,13 +122,13 @@ } @@ -295,8 +363,17 @@ - for (TileEntity tileentity : chunkIn.getTileEntityMap().values()) + for (TileEntity tileentity : p_75820_1_.func_177434_r().values()) { NBTTagCompound nbttagcompound2 = new NBTTagCompound(); + try + { - tileentity.writeToNBT(nbttagcompound2); - nbttaglist2.appendTag(nbttagcompound2); + tileentity.func_145841_b(nbttagcompound2); + nbttaglist2.func_74742_a(nbttagcompound2); + } + catch (Exception e) + { @@ -138,18 +138,18 @@ + } } - p_75820_3_.setTag("TileEntities", nbttaglist2); + p_75820_3_.func_74782_a("TileEntities", nbttaglist2); @@ -376,6 +453,12 @@ - chunk.setBiomeArray(p_75823_2_.getByteArray("Biomes")); + chunk.func_76616_a(p_75823_2_.func_74770_j("Biomes")); } + // End this method here and split off entity loading to another method + return chunk; + } + -+ public void loadEntities(World worldIn, NBTTagCompound p_75823_2_, Chunk chunk) ++ public void loadEntities(World p_75823_1_, NBTTagCompound p_75823_2_, Chunk chunk) + { - NBTTagList nbttaglist1 = p_75823_2_.getTagList("Entities", 10); + NBTTagList nbttaglist1 = p_75823_2_.func_150295_c("Entities", 10); if (nbttaglist1 != null) @@ -447,7 +530,5 @@ diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch index 8252f4549..9e563a70b 100644 --- a/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch @@ -2,17 +2,17 @@ +++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java @@ -20,18 +20,12 @@ { - File file1 = this.getWorldDirectory(); + File file1 = this.func_75765_b(); -- if (provider instanceof WorldProviderHell) -+ if (provider.getSaveFolder() != null) +- if (p_75763_1_ instanceof WorldProviderHell) ++ if (p_75763_1_.getSaveFolder() != null) { - File file3 = new File(file1, "DIM-1"); -+ File file3 = new File(file1, provider.getSaveFolder()); ++ File file3 = new File(file1, p_75763_1_.getSaveFolder()); file3.mkdirs(); return new AnvilChunkLoader(file3); } -- else if (provider instanceof WorldProviderEnd) +- else if (p_75763_1_ instanceof WorldProviderEnd) - { - File file2 = new File(file1, "DIM1"); - file2.mkdirs(); diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java.patch index 62b0bdc26..945276017 100644 --- a/patches/minecraft/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java @@ -34,6 +34,8 @@ - public void set(int x, int y, int z, IBlockState state) + public void func_177484_a(int p_177484_1_, int p_177484_2_, int p_177484_3_, IBlockState p_177484_4_) { -+ if (state instanceof net.minecraftforge.common.property.IExtendedBlockState) -+ state = ((net.minecraftforge.common.property.IExtendedBlockState) state).getClean(); - IBlockState iblockstate = this.get(x, y, z); - Block block = iblockstate.getBlock(); - Block block1 = state.getBlock(); ++ if (p_177484_4_ instanceof net.minecraftforge.common.property.IExtendedBlockState) ++ p_177484_4_ = ((net.minecraftforge.common.property.IExtendedBlockState) p_177484_4_).getClean(); + IBlockState iblockstate = this.func_177485_a(p_177484_1_, p_177484_2_, p_177484_3_); + Block block = iblockstate.func_177230_c(); + Block block1 = p_177484_4_.func_177230_c(); diff --git a/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch b/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch index 01c861ed3..1992d6dad 100644 --- a/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch +++ b/patches/minecraft/net/minecraft/world/chunk/storage/RegionFile.java.patch @@ -7,25 +7,25 @@ + // This is a copy (sort of) of the method below it, make sure they stay in sync + public synchronized boolean chunkExists(int x, int z) + { -+ if (this.outOfBounds(x, z)) return false; ++ if (this.func_76705_d(x, z)) return false; + + try + { -+ int offset = this.getOffset(x, z); ++ int offset = this.func_76707_e(x, z); + + if (offset == 0) return false; + + int sectorNumber = offset >> 8; + int numSectors = offset & 255; + -+ if (sectorNumber + numSectors > this.sectorFree.size()) return false; ++ if (sectorNumber + numSectors > this.field_76714_f.size()) return false; + -+ this.dataFile.seek((long)(sectorNumber * 4096)); -+ int length = this.dataFile.readInt(); ++ this.field_76719_c.seek((long)(sectorNumber * 4096)); ++ int length = this.field_76719_c.readInt(); + + if (length > 4096 * numSectors || length <= 0) return false; + -+ byte version = this.dataFile.readByte(); ++ byte version = this.field_76719_c.readByte(); + + if (version == 1 || version == 2) return true; + } @@ -37,6 +37,6 @@ + return false; + } + - public synchronized DataInputStream getChunkDataInputStream(int x, int z) + public synchronized DataInputStream func_76704_a(int p_76704_1_, int p_76704_2_) { - if (this.outOfBounds(x, z)) + if (this.func_76705_d(p_76704_1_, p_76704_2_)) diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch index 45b2a8d71..f4cec46a7 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch @@ -1,27 +1,27 @@ --- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java +++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java @@ -32,6 +32,9 @@ - double[] noiseData3; - double[] noiseData4; - double[] noiseData5; + double[] field_73193_e; + double[] field_73190_f; + double[] field_73191_g; + // temporary variables used during event handling + private int chunkX = 0; + private int chunkZ = 0; - public ChunkProviderEnd(World worldIn, long p_i2007_2_) + public ChunkProviderEnd(World p_i2007_1_, long p_i2007_2_) { @@ -42,6 +45,14 @@ - this.noiseGen3 = new NoiseGeneratorOctaves(this.endRNG, 8); - this.noiseGen4 = new NoiseGeneratorOctaves(this.endRNG, 10); - this.noiseGen5 = new NoiseGeneratorOctaves(this.endRNG, 16); + this.field_73199_l = new NoiseGeneratorOctaves(this.field_73204_i, 8); + this.field_73196_a = new NoiseGeneratorOctaves(this.field_73204_i, 10); + this.field_73194_b = new NoiseGeneratorOctaves(this.field_73204_i, 16); + -+ NoiseGenerator[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5}; -+ noiseGens = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(worldIn, this.endRNG, noiseGens); -+ this.noiseGen1 = (NoiseGeneratorOctaves)noiseGens[0]; -+ this.noiseGen2 = (NoiseGeneratorOctaves)noiseGens[1]; -+ this.noiseGen3 = (NoiseGeneratorOctaves)noiseGens[2]; -+ this.noiseGen4 = (NoiseGeneratorOctaves)noiseGens[3]; -+ this.noiseGen5 = (NoiseGeneratorOctaves)noiseGens[4]; ++ NoiseGenerator[] noiseGens = {field_73201_j, field_73202_k, field_73199_l, field_73196_a, field_73194_b}; ++ noiseGens = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(p_i2007_1_, this.field_73204_i, noiseGens); ++ this.field_73201_j = (NoiseGeneratorOctaves)noiseGens[0]; ++ this.field_73202_k = (NoiseGeneratorOctaves)noiseGens[1]; ++ this.field_73199_l = (NoiseGeneratorOctaves)noiseGens[2]; ++ this.field_73196_a = (NoiseGeneratorOctaves)noiseGens[3]; ++ this.field_73194_b = (NoiseGeneratorOctaves)noiseGens[4]; } public void func_180520_a(int p_180520_1_, int p_180520_2_, ChunkPrimer p_180520_3_) @@ -29,7 +29,7 @@ public void func_180519_a(ChunkPrimer p_180519_1_) { -+ net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks(this, chunkX, chunkZ, p_180519_1_, this.endWorld); ++ net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks(this, chunkX, chunkZ, p_180519_1_, this.field_73200_m); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); + if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return; for (int i = 0; i < 16; ++i) @@ -37,15 +37,15 @@ for (int j = 0; j < 16; ++j) @@ -165,6 +179,7 @@ - public Chunk provideChunk(int x, int z) + public Chunk func_73154_d(int p_73154_1_, int p_73154_2_) { -+ chunkX = x; chunkZ = z; - this.endRNG.setSeed((long)x * 341873128712L + (long)z * 132897987541L); ++ chunkX = p_73154_1_; chunkZ = p_73154_2_; + this.field_73204_i.setSeed((long)p_73154_1_ * 341873128712L + (long)p_73154_2_ * 132897987541L); ChunkPrimer chunkprimer = new ChunkPrimer(); - this.biomesForGeneration = this.endWorld.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16, 16); + this.field_73198_o = this.field_73200_m.func_72959_q().func_76933_b(this.field_73198_o, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); @@ -184,6 +199,10 @@ - private double[] initializeNoiseField(double[] p_73187_1_, int p_73187_2_, int p_73187_3_, int p_73187_4_, int p_73187_5_, int p_73187_6_, int p_73187_7_) + private double[] func_73187_a(double[] p_73187_1_, int p_73187_2_, int p_73187_3_, int p_73187_4_, int p_73187_5_, int p_73187_6_, int p_73187_7_) { + net.minecraftforge.event.terraingen.ChunkProviderEvent.InitNoiseField event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.InitNoiseField(this, p_73187_1_, p_73187_2_, p_73187_3_, p_73187_4_, p_73187_5_, p_73187_6_, p_73187_7_); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); @@ -55,13 +55,13 @@ { p_73187_1_ = new double[p_73187_5_ * p_73187_6_ * p_73187_7_]; @@ -273,8 +292,10 @@ - public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) + public void func_73153_a(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) { - BlockFalling.fallInstantly = true; -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Pre(p_73153_1_, endWorld, endWorld.rand, p_73153_2_, p_73153_3_, false)); + BlockFalling.field_149832_M = true; ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Pre(p_73153_1_, field_73200_m, field_73200_m.field_73012_v, p_73153_2_, p_73153_3_, false)); BlockPos blockpos = new BlockPos(p_73153_2_ * 16, 0, p_73153_3_ * 16); - this.endWorld.getBiomeGenForCoords(blockpos.add(16, 0, 16)).decorate(this.endWorld, this.endWorld.rand, blockpos); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Post(p_73153_1_, endWorld, endWorld.rand, p_73153_2_, p_73153_3_, false)); - BlockFalling.fallInstantly = false; + this.field_73200_m.func_180494_b(blockpos.func_177982_a(16, 0, 16)).func_180624_a(this.field_73200_m, this.field_73200_m.field_73012_v, blockpos); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Post(p_73153_1_, field_73200_m, field_73200_m.field_73012_v, p_73153_2_, p_73153_3_, false)); + BlockFalling.field_149832_M = false; } diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch index 12ffaf777..e147f9431 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch @@ -2,99 +2,99 @@ +++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java @@ -58,6 +58,15 @@ - public ChunkProviderGenerate(World worldIn, long p_i45636_2_, boolean p_i45636_4_, String p_i45636_5_) + public ChunkProviderGenerate(World p_i45636_1_, long p_i45636_2_, boolean p_i45636_4_, String p_i45636_5_) { + { -+ caveGenerator = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(caveGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE); -+ strongholdGenerator = (MapGenStronghold)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(strongholdGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.STRONGHOLD); -+ villageGenerator = (MapGenVillage)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(villageGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.VILLAGE); -+ mineshaftGenerator = (MapGenMineshaft)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(mineshaftGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.MINESHAFT); -+ scatteredFeatureGenerator = (MapGenScatteredFeature)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(scatteredFeatureGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.SCATTERED_FEATURE); -+ ravineGenerator = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(ravineGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.RAVINE); -+ oceanMonumentGenerator = (StructureOceanMonument)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(oceanMonumentGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.OCEAN_MONUMENT); ++ field_73226_t = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_73226_t, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE); ++ field_73225_u = (MapGenStronghold)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_73225_u, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.STRONGHOLD); ++ field_73224_v = (MapGenVillage)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_73224_v, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.VILLAGE); ++ field_73223_w = (MapGenMineshaft)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_73223_w, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.MINESHAFT); ++ field_73233_x = (MapGenScatteredFeature)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_73233_x, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.SCATTERED_FEATURE); ++ field_73232_y = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_73232_y, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.RAVINE); ++ field_177474_A = (StructureOceanMonument)net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(field_177474_A, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.OCEAN_MONUMENT); + } - this.worldObj = worldIn; - this.mapFeaturesEnabled = p_i45636_4_; - this.field_177475_o = worldIn.getWorldInfo().getTerrainType(); + this.field_73230_p = p_i45636_1_; + this.field_73229_q = p_i45636_4_; + this.field_177475_o = p_i45636_1_.func_72912_H().func_76067_t(); @@ -87,6 +96,16 @@ - this.field_177476_s = this.settings.useLavaOceans ? Blocks.lava : Blocks.water; - worldIn.func_181544_b(this.settings.seaLevel); + this.field_177476_s = this.field_177477_r.field_177778_E ? Blocks.field_150353_l : Blocks.field_150355_j; + p_i45636_1_.func_181544_b(this.field_177477_r.field_177841_q); } + -+ NoiseGenerator[] noiseGens = {field_147431_j, field_147432_k, field_147429_l, field_147430_m, noiseGen5, noiseGen6, mobSpawnerNoise}; -+ noiseGens = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(worldIn, this.rand, noiseGens); ++ NoiseGenerator[] noiseGens = {field_147431_j, field_147432_k, field_147429_l, field_147430_m, field_73214_a, field_73212_b, field_73213_c}; ++ noiseGens = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(p_i45636_1_, this.field_73220_k, noiseGens); + this.field_147431_j = (NoiseGeneratorOctaves)noiseGens[0]; + this.field_147432_k = (NoiseGeneratorOctaves)noiseGens[1]; + this.field_147429_l = (NoiseGeneratorOctaves)noiseGens[2]; + this.field_147430_m = (NoiseGeneratorPerlin)noiseGens[3]; -+ this.noiseGen5 = (NoiseGeneratorOctaves)noiseGens[4]; -+ this.noiseGen6 = (NoiseGeneratorOctaves)noiseGens[5]; -+ this.mobSpawnerNoise = (NoiseGeneratorOctaves)noiseGens[6]; ++ this.field_73214_a = (NoiseGeneratorOctaves)noiseGens[4]; ++ this.field_73212_b = (NoiseGeneratorOctaves)noiseGens[5]; ++ this.field_73213_c = (NoiseGeneratorOctaves)noiseGens[6]; } - public void setBlocksInChunk(int p_180518_1_, int p_180518_2_, ChunkPrimer p_180518_3_) + public void func_180518_a(int p_180518_1_, int p_180518_2_, ChunkPrimer p_180518_3_) @@ -160,6 +179,10 @@ public void func_180517_a(int p_180517_1_, int p_180517_2_, ChunkPrimer p_180517_3_, BiomeGenBase[] p_180517_4_) { -+ net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks(this, p_180517_1_, p_180517_2_, p_180517_3_, this.worldObj); ++ net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks(this, p_180517_1_, p_180517_2_, p_180517_3_, this.field_73230_p); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); + if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return; + double d0 = 0.03125D; - this.stoneNoise = this.field_147430_m.func_151599_a(this.stoneNoise, (double)(p_180517_1_ * 16), (double)(p_180517_2_ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D); + this.field_73227_s = this.field_147430_m.func_151599_a(this.field_73227_s, (double)(p_180517_1_ * 16), (double)(p_180517_2_ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D); @@ -366,6 +389,8 @@ boolean flag = false; ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(p_73153_2_, p_73153_3_); -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Pre(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag)); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Pre(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag)); + - if (this.settings.useMineShafts && this.mapFeaturesEnabled) + if (this.field_177477_r.field_177829_w && this.field_73229_q) { - this.mineshaftGenerator.func_175794_a(this.worldObj, this.rand, chunkcoordintpair); + this.field_73223_w.func_175794_a(this.field_73230_p, this.field_73220_k, chunkcoordintpair); @@ -391,7 +416,8 @@ - this.oceanMonumentGenerator.func_175794_a(this.worldObj, this.rand, chunkcoordintpair); + this.field_177474_A.func_175794_a(this.field_73230_p, this.field_73220_k, chunkcoordintpair); } -- if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && this.settings.useWaterLakes && !flag && this.rand.nextInt(this.settings.waterLakeChance) == 0) -+ if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && this.settings.useWaterLakes && !flag && this.rand.nextInt(this.settings.waterLakeChance) == 0 -+ && net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE)) +- if (biomegenbase != BiomeGenBase.field_76769_d && biomegenbase != BiomeGenBase.field_76786_s && this.field_177477_r.field_177781_A && !flag && this.field_73220_k.nextInt(this.field_177477_r.field_177782_B) == 0) ++ if (biomegenbase != BiomeGenBase.field_76769_d && biomegenbase != BiomeGenBase.field_76786_s && this.field_177477_r.field_177781_A && !flag && this.field_73220_k.nextInt(this.field_177477_r.field_177782_B) == 0 ++ && net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE)) { - int i1 = this.rand.nextInt(16) + 8; - int j1 = this.rand.nextInt(256); + int i1 = this.field_73220_k.nextInt(16) + 8; + int j1 = this.field_73220_k.nextInt(256); @@ -399,7 +425,8 @@ - (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, blockpos.add(i1, j1, k1)); + (new WorldGenLakes(Blocks.field_150355_j)).func_180709_b(this.field_73230_p, this.field_73220_k, blockpos.func_177982_a(i1, j1, k1)); } -- if (!flag && this.rand.nextInt(this.settings.lavaLakeChance / 10) == 0 && this.settings.useLavaLakes) -+ if (!flag && this.rand.nextInt(this.settings.lavaLakeChance / 10) == 0 && this.settings.useLavaLakes -+ && net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA)) +- if (!flag && this.field_73220_k.nextInt(this.field_177477_r.field_177777_D / 10) == 0 && this.field_177477_r.field_177783_C) ++ if (!flag && this.field_73220_k.nextInt(this.field_177477_r.field_177777_D / 10) == 0 && this.field_177477_r.field_177783_C ++ && net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA)) { - int i2 = this.rand.nextInt(16) + 8; - int l2 = this.rand.nextInt(this.rand.nextInt(248) + 8); + int i2 = this.field_73220_k.nextInt(16) + 8; + int l2 = this.field_73220_k.nextInt(this.field_73220_k.nextInt(248) + 8); @@ -413,7 +440,8 @@ - if (this.settings.useDungeons) + if (this.field_177477_r.field_177837_s) { -- for (int j2 = 0; j2 < this.settings.dungeonChance; ++j2) -+ boolean doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.DUNGEON); -+ for (int j2 = 0; doGen && j2 < this.settings.dungeonChance; ++j2) +- for (int j2 = 0; j2 < this.field_177477_r.field_177835_t; ++j2) ++ boolean doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.DUNGEON); ++ for (int j2 = 0; doGen && j2 < this.field_177477_r.field_177835_t; ++j2) { - int i3 = this.rand.nextInt(16) + 8; - int l3 = this.rand.nextInt(256); + int i3 = this.field_73220_k.nextInt(16) + 8; + int l3 = this.field_73220_k.nextInt(256); @@ -423,10 +451,14 @@ } - biomegenbase.decorate(this.worldObj, this.rand, new BlockPos(i, 0, j)); -+ if (net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ANIMALS)) + biomegenbase.func_180624_a(this.field_73230_p, this.field_73220_k, new BlockPos(i, 0, j)); ++ if (net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ANIMALS)) + { - SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, i + 8, j + 8, 16, 16, this.rand); + SpawnerAnimals.func_77191_a(this.field_73230_p, biomegenbase, i + 8, j + 8, 16, 16, this.field_73220_k); + } - blockpos = blockpos.add(8, 0, 8); + blockpos = blockpos.func_177982_a(8, 0, 8); - for (int k2 = 0; k2 < 16; ++k2) -+ boolean doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE); ++ boolean doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE); + for (int k2 = 0; doGen && k2 < 16; ++k2) { for (int j3 = 0; j3 < 16; ++j3) @@ -103,8 +103,8 @@ } } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Post(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag)); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Post(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag)); + - BlockFalling.fallInstantly = false; + BlockFalling.field_149832_M = false; } diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch index a1e6412b4..216df8267 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch @@ -1,67 +1,67 @@ --- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderHell.java +++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderHell.java @@ -49,8 +49,8 @@ - private final WorldGenHellLava field_177472_y = new WorldGenHellLava(Blocks.flowing_lava, false); - private final GeneratorBushFeature field_177471_z = new GeneratorBushFeature(Blocks.brown_mushroom); - private final GeneratorBushFeature field_177465_A = new GeneratorBushFeature(Blocks.red_mushroom); -- private final MapGenNetherBridge genNetherBridge = new MapGenNetherBridge(); -- private final MapGenBase netherCaveGenerator = new MapGenCavesHell(); -+ private final MapGenNetherBridge genNetherBridge; -+ private final MapGenBase netherCaveGenerator; - double[] noiseData1; - double[] noiseData2; - double[] noiseData3; + private final WorldGenHellLava field_177472_y = new WorldGenHellLava(Blocks.field_150356_k, false); + private final GeneratorBushFeature field_177471_z = new GeneratorBushFeature(Blocks.field_150338_P); + private final GeneratorBushFeature field_177465_A = new GeneratorBushFeature(Blocks.field_150337_Q); +- private final MapGenNetherBridge field_73172_c = new MapGenNetherBridge(); +- private final MapGenBase field_73182_t = new MapGenCavesHell(); ++ private final MapGenNetherBridge field_73172_c; ++ private final MapGenBase field_73182_t; + double[] field_73169_d; + double[] field_73170_e; + double[] field_73167_f; @@ -59,16 +59,29 @@ - public ChunkProviderHell(World worldIn, boolean p_i45637_2_, long p_i45637_3_) + public ChunkProviderHell(World p_i45637_1_, boolean p_i45637_2_, long p_i45637_3_) { -+ this.genNetherBridge = (MapGenNetherBridge) net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(new MapGenNetherBridge(), net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.NETHER_BRIDGE); -+ this.netherCaveGenerator = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(new MapGenCavesHell(), net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.NETHER_CAVE); - this.worldObj = worldIn; ++ this.field_73172_c = (MapGenNetherBridge) net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(new MapGenNetherBridge(), net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.NETHER_BRIDGE); ++ this.field_73182_t = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(new MapGenCavesHell(), net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.NETHER_CAVE); + this.field_73175_o = p_i45637_1_; this.field_177466_i = p_i45637_2_; - this.hellRNG = new Random(p_i45637_3_); -- this.netherNoiseGen1 = new NoiseGeneratorOctaves(this.hellRNG, 16); -- this.netherNoiseGen2 = new NoiseGeneratorOctaves(this.hellRNG, 16); -- this.netherNoiseGen3 = new NoiseGeneratorOctaves(this.hellRNG, 8); -- this.slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); -- this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); -- this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.hellRNG, 10); -- this.netherNoiseGen7 = new NoiseGeneratorOctaves(this.hellRNG, 16); -+ NoiseGeneratorOctaves netherNoiseGen1 = new NoiseGeneratorOctaves(this.hellRNG, 16); -+ NoiseGeneratorOctaves netherNoiseGen2 = new NoiseGeneratorOctaves(this.hellRNG, 16); -+ NoiseGeneratorOctaves netherNoiseGen3 = new NoiseGeneratorOctaves(this.hellRNG, 8); -+ NoiseGeneratorOctaves slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); -+ NoiseGeneratorOctaves netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); -+ NoiseGeneratorOctaves netherNoiseGen6 = new NoiseGeneratorOctaves(this.hellRNG, 10); -+ NoiseGeneratorOctaves netherNoiseGen7 = new NoiseGeneratorOctaves(this.hellRNG, 16); + this.field_73181_i = new Random(p_i45637_3_); +- this.field_73178_j = new NoiseGeneratorOctaves(this.field_73181_i, 16); +- this.field_73179_k = new NoiseGeneratorOctaves(this.field_73181_i, 16); +- this.field_73176_l = new NoiseGeneratorOctaves(this.field_73181_i, 8); +- this.field_73177_m = new NoiseGeneratorOctaves(this.field_73181_i, 4); +- this.field_73174_n = new NoiseGeneratorOctaves(this.field_73181_i, 4); +- this.field_73173_a = new NoiseGeneratorOctaves(this.field_73181_i, 10); +- this.field_73171_b = new NoiseGeneratorOctaves(this.field_73181_i, 16); ++ NoiseGeneratorOctaves netherNoiseGen1 = new NoiseGeneratorOctaves(this.field_73181_i, 16); ++ NoiseGeneratorOctaves netherNoiseGen2 = new NoiseGeneratorOctaves(this.field_73181_i, 16); ++ NoiseGeneratorOctaves netherNoiseGen3 = new NoiseGeneratorOctaves(this.field_73181_i, 8); ++ NoiseGeneratorOctaves slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.field_73181_i, 4); ++ NoiseGeneratorOctaves netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.field_73181_i, 4); ++ NoiseGeneratorOctaves netherNoiseGen6 = new NoiseGeneratorOctaves(this.field_73181_i, 10); ++ NoiseGeneratorOctaves netherNoiseGen7 = new NoiseGeneratorOctaves(this.field_73181_i, 16); + NoiseGenerator[] noiseGens = new NoiseGenerator[] { + netherNoiseGen1, netherNoiseGen2, netherNoiseGen3, slowsandGravelNoiseGen, netherrackExculsivityNoiseGen, netherNoiseGen6, netherNoiseGen7 + }; -+ noiseGens = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(worldIn, this.hellRNG, noiseGens); -+ this.netherNoiseGen1 = (NoiseGeneratorOctaves)noiseGens[0]; -+ this.netherNoiseGen2 = (NoiseGeneratorOctaves)noiseGens[1]; -+ this.netherNoiseGen3 = (NoiseGeneratorOctaves)noiseGens[2]; -+ this.slowsandGravelNoiseGen = (NoiseGeneratorOctaves)noiseGens[3]; -+ this.netherrackExculsivityNoiseGen = (NoiseGeneratorOctaves)noiseGens[4]; -+ this.netherNoiseGen6 = (NoiseGeneratorOctaves)noiseGens[5]; -+ this.netherNoiseGen7 = (NoiseGeneratorOctaves)noiseGens[6]; - worldIn.func_181544_b(63); ++ noiseGens = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(p_i45637_1_, this.field_73181_i, noiseGens); ++ this.field_73178_j = (NoiseGeneratorOctaves)noiseGens[0]; ++ this.field_73179_k = (NoiseGeneratorOctaves)noiseGens[1]; ++ this.field_73176_l = (NoiseGeneratorOctaves)noiseGens[2]; ++ this.field_73177_m = (NoiseGeneratorOctaves)noiseGens[3]; ++ this.field_73174_n = (NoiseGeneratorOctaves)noiseGens[4]; ++ this.field_73173_a = (NoiseGeneratorOctaves)noiseGens[5]; ++ this.field_73171_b = (NoiseGeneratorOctaves)noiseGens[6]; + p_i45637_1_.func_181544_b(63); } @@ -148,6 +161,10 @@ public void func_180516_b(int p_180516_1_, int p_180516_2_, ChunkPrimer p_180516_3_) { -+ net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks(this, p_180516_1_, p_180516_2_, p_180516_3_, this.worldObj); ++ net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks(this, p_180516_1_, p_180516_2_, p_180516_3_, this.field_73175_o); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); + if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return; + - int i = this.worldObj.func_181545_F() + 1; + int i = this.field_73175_o.func_181545_F() + 1; double d0 = 0.03125D; - this.slowsandNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.slowsandNoise, p_180516_1_ * 16, p_180516_2_ * 16, 0, 16, 16, 1, d0, d0, 1.0D); + this.field_73185_q = this.field_73177_m.func_76304_a(this.field_73185_q, p_180516_1_ * 16, p_180516_2_ * 16, 0, 16, 16, 1, d0, d0, 1.0D); @@ -265,6 +282,10 @@ - private double[] initializeNoiseField(double[] p_73164_1_, int p_73164_2_, int p_73164_3_, int p_73164_4_, int p_73164_5_, int p_73164_6_, int p_73164_7_) + private double[] func_73164_a(double[] p_73164_1_, int p_73164_2_, int p_73164_3_, int p_73164_4_, int p_73164_5_, int p_73164_6_, int p_73164_7_) { + net.minecraftforge.event.terraingen.ChunkProviderEvent.InitNoiseField event = new net.minecraftforge.event.terraingen.ChunkProviderEvent.InitNoiseField(this, p_73164_1_, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); @@ -71,71 +71,71 @@ { p_73164_1_ = new double[p_73164_5_ * p_73164_6_ * p_73164_7_]; @@ -356,50 +377,60 @@ - public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) + public void func_73153_a(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) { - BlockFalling.fallInstantly = true; -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Pre(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false)); + BlockFalling.field_149832_M = true; ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Pre(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false)); BlockPos blockpos = new BlockPos(p_73153_2_ * 16, 0, p_73153_3_ * 16); ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(p_73153_2_, p_73153_3_); - this.genNetherBridge.func_175794_a(this.worldObj, this.hellRNG, chunkcoordintpair); + this.field_73172_c.func_175794_a(this.field_73175_o, this.field_73181_i, chunkcoordintpair); - for (int i = 0; i < 8; ++i) -+ boolean doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.NETHER_LAVA); ++ boolean doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.NETHER_LAVA); + for (int i = 0; doGen && i < 8; ++i) { - this.field_177472_y.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(120) + 4, this.hellRNG.nextInt(16) + 8)); + this.field_177472_y.func_180709_b(this.field_73175_o, this.field_73181_i, blockpos.func_177982_a(this.field_73181_i.nextInt(16) + 8, this.field_73181_i.nextInt(120) + 4, this.field_73181_i.nextInt(16) + 8)); } -- for (int j = 0; j < this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1) + 1; ++j) -+ doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.FIRE); -+ for (int j = 0; doGen && j < this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1) + 1; ++j) +- for (int j = 0; j < this.field_73181_i.nextInt(this.field_73181_i.nextInt(10) + 1) + 1; ++j) ++ doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.FIRE); ++ for (int j = 0; doGen && j < this.field_73181_i.nextInt(this.field_73181_i.nextInt(10) + 1) + 1; ++j) { - this.field_177470_t.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(120) + 4, this.hellRNG.nextInt(16) + 8)); + this.field_177470_t.func_180709_b(this.field_73175_o, this.field_73181_i, blockpos.func_177982_a(this.field_73181_i.nextInt(16) + 8, this.field_73181_i.nextInt(120) + 4, this.field_73181_i.nextInt(16) + 8)); } -- for (int k = 0; k < this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1); ++k) -+ doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.GLOWSTONE); -+ for (int k = 0; doGen && k < this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1); ++k) +- for (int k = 0; k < this.field_73181_i.nextInt(this.field_73181_i.nextInt(10) + 1); ++k) ++ doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.GLOWSTONE); ++ for (int k = 0; doGen && k < this.field_73181_i.nextInt(this.field_73181_i.nextInt(10) + 1); ++k) { - this.field_177469_u.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(120) + 4, this.hellRNG.nextInt(16) + 8)); + this.field_177469_u.func_180709_b(this.field_73175_o, this.field_73181_i, blockpos.func_177982_a(this.field_73181_i.nextInt(16) + 8, this.field_73181_i.nextInt(120) + 4, this.field_73181_i.nextInt(16) + 8)); } - for (int l = 0; l < 10; ++l) + for (int l = 0; doGen && l < 10; ++l) { - this.field_177468_v.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(128), this.hellRNG.nextInt(16) + 8)); + this.field_177468_v.func_180709_b(this.field_73175_o, this.field_73181_i, blockpos.func_177982_a(this.field_73181_i.nextInt(16) + 8, this.field_73181_i.nextInt(128), this.field_73181_i.nextInt(16) + 8)); } -- if (this.hellRNG.nextBoolean()) -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(worldObj, hellRNG, blockpos)); +- if (this.field_73181_i.nextBoolean()) ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(field_73175_o, field_73181_i, blockpos)); + -+ doGen = net.minecraftforge.event.terraingen.TerrainGen.decorate(worldObj, hellRNG, blockpos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM); -+ if (doGen && this.hellRNG.nextBoolean()) ++ doGen = net.minecraftforge.event.terraingen.TerrainGen.decorate(field_73175_o, field_73181_i, blockpos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM); ++ if (doGen && this.field_73181_i.nextBoolean()) { - this.field_177471_z.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(128), this.hellRNG.nextInt(16) + 8)); + this.field_177471_z.func_180709_b(this.field_73175_o, this.field_73181_i, blockpos.func_177982_a(this.field_73181_i.nextInt(16) + 8, this.field_73181_i.nextInt(128), this.field_73181_i.nextInt(16) + 8)); } -- if (this.hellRNG.nextBoolean()) -+ if (doGen && this.hellRNG.nextBoolean()) +- if (this.field_73181_i.nextBoolean()) ++ if (doGen && this.field_73181_i.nextBoolean()) { - this.field_177465_A.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16) + 8, this.hellRNG.nextInt(128), this.hellRNG.nextInt(16) + 8)); + this.field_177465_A.func_180709_b(this.field_73175_o, this.field_73181_i, blockpos.func_177982_a(this.field_73181_i.nextInt(16) + 8, this.field_73181_i.nextInt(128), this.field_73181_i.nextInt(16) + 8)); } - for (int i1 = 0; i1 < 16; ++i1) -+ doGen = net.minecraftforge.event.terraingen.TerrainGen.generateOre(worldObj, hellRNG, field_177467_w, blockpos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.QUARTZ); ++ doGen = net.minecraftforge.event.terraingen.TerrainGen.generateOre(field_73175_o, field_73181_i, field_177467_w, blockpos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.QUARTZ); + for (int i1 = 0; doGen && i1 < 16; ++i1) { - this.field_177467_w.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16), this.hellRNG.nextInt(108) + 10, this.hellRNG.nextInt(16))); + this.field_177467_w.func_180709_b(this.field_73175_o, this.field_73181_i, blockpos.func_177982_a(this.field_73181_i.nextInt(16), this.field_73181_i.nextInt(108) + 10, this.field_73181_i.nextInt(16))); } - for (int j1 = 0; j1 < 16; ++j1) -+ doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.NETHER_LAVA2); ++ doGen = net.minecraftforge.event.terraingen.TerrainGen.populate(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.NETHER_LAVA2); + for (int j1 = 0; doGen && j1 < 16; ++j1) { - this.field_177473_x.generate(this.worldObj, this.hellRNG, blockpos.add(this.hellRNG.nextInt(16), this.hellRNG.nextInt(108) + 10, this.hellRNG.nextInt(16))); + this.field_177473_x.func_180709_b(this.field_73175_o, this.field_73181_i, blockpos.func_177982_a(this.field_73181_i.nextInt(16), this.field_73181_i.nextInt(108) + 10, this.field_73181_i.nextInt(16))); } -+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Post(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false)); - BlockFalling.fallInstantly = false; ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.PopulateChunkEvent.Post(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false)); + BlockFalling.field_149832_M = false; } diff --git a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch index a26c456fc..cd28c7ec7 100644 --- a/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch @@ -1,52 +1,52 @@ --- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderServer.java +++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderServer.java @@ -36,6 +36,7 @@ - public LongHashMap id2ChunkMap = new LongHashMap(); - public List loadedChunks = Lists.newArrayList(); - public WorldServer worldObj; + public LongHashMap field_73244_f = new LongHashMap(); + public List field_73245_g = Lists.newArrayList(); + public WorldServer field_73251_h; + private Set loadingChunks = com.google.common.collect.Sets.newHashSet(); public ChunkProviderServer(WorldServer p_i1520_1_, IChunkLoader p_i1520_2_, IChunkProvider p_i1520_3_) { @@ -57,7 +58,7 @@ - public void dropChunk(int p_73241_1_, int p_73241_2_) + public void func_73241_b(int p_73241_1_, int p_73241_2_) { -- if (this.worldObj.provider.canRespawnHere()) -+ if (this.worldObj.provider.canRespawnHere() && net.minecraftforge.common.DimensionManager.shouldLoadSpawn(this.worldObj.provider.getDimensionId())) +- if (this.field_73251_h.field_73011_w.func_76567_e()) ++ if (this.field_73251_h.field_73011_w.func_76567_e() && net.minecraftforge.common.DimensionManager.shouldLoadSpawn(this.field_73251_h.field_73011_w.func_177502_q())) { - if (!this.worldObj.isSpawnChunk(p_73241_1_, p_73241_2_)) + if (!this.field_73251_h.func_72916_c(p_73241_1_, p_73241_2_)) { @@ -80,12 +81,64 @@ - public Chunk loadChunk(int p_73158_1_, int p_73158_2_) + public Chunk func_73158_c(int p_73158_1_, int p_73158_2_) { + return loadChunk(p_73158_1_, p_73158_2_, null); + } + + public Chunk loadChunk(int par1, int par2, Runnable runnable) + { -+ long k = ChunkCoordIntPair.chunkXZ2Int(par1, par2); -+ this.droppedChunksSet.remove(Long.valueOf(k)); -+ Chunk chunk = (Chunk)this.id2ChunkMap.getValueByKey(k); ++ long k = ChunkCoordIntPair.func_77272_a(par1, par2); ++ this.field_73248_b.remove(Long.valueOf(k)); ++ Chunk chunk = (Chunk)this.field_73244_f.func_76164_a(k); + net.minecraft.world.chunk.storage.AnvilChunkLoader loader = null; + -+ if (this.chunkLoader instanceof net.minecraft.world.chunk.storage.AnvilChunkLoader) ++ if (this.field_73247_e instanceof net.minecraft.world.chunk.storage.AnvilChunkLoader) + { -+ loader = (net.minecraft.world.chunk.storage.AnvilChunkLoader) this.chunkLoader; ++ loader = (net.minecraft.world.chunk.storage.AnvilChunkLoader) this.field_73247_e; + } + + // We can only use the queue for already generated chunks -+ if (chunk == null && loader != null && loader.chunkExists(this.worldObj, par1, par2)) ++ if (chunk == null && loader != null && loader.chunkExists(this.field_73251_h, par1, par2)) + { + if (runnable != null) + { -+ net.minecraftforge.common.chunkio.ChunkIOExecutor.queueChunkLoad(this.worldObj, loader, this, par1, par2, runnable); ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.queueChunkLoad(this.field_73251_h, loader, this, par1, par2, runnable); + return null; + } + else + { -+ chunk = net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(this.worldObj, loader, this, par1, par2); ++ chunk = net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(this.field_73251_h, loader, this, par1, par2); + } + } + else if (chunk == null) @@ -65,61 +65,61 @@ + + public Chunk originalLoadChunk(int p_73158_1_, int p_73158_2_) + { - long i = ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_); - this.droppedChunksSet.remove(Long.valueOf(i)); - Chunk chunk = (Chunk)this.id2ChunkMap.getValueByKey(i); + long i = ChunkCoordIntPair.func_77272_a(p_73158_1_, p_73158_2_); + this.field_73248_b.remove(Long.valueOf(i)); + Chunk chunk = (Chunk)this.field_73244_f.func_76164_a(i); if (chunk == null) { + boolean added = loadingChunks.add(i); + if (!added) + { -+ net.minecraftforge.fml.common.FMLLog.bigWarning("There is an attempt to load a chunk (%d,%d) in di >mension %d that is already being loaded. This will cause weird chunk breakages.", p_73158_1_, p_73158_2_, worldObj.provider.getDimensionId()); ++ net.minecraftforge.fml.common.FMLLog.bigWarning("There is an attempt to load a chunk (%d,%d) in di >mension %d that is already being loaded. This will cause weird chunk breakages.", p_73158_1_, p_73158_2_, field_73251_h.field_73011_w.func_177502_q()); + } -+ chunk = net.minecraftforge.common.ForgeChunkManager.fetchDormantChunk(i, this.worldObj); ++ chunk = net.minecraftforge.common.ForgeChunkManager.fetchDormantChunk(i, this.field_73251_h); + + if (chunk == null) - chunk = this.loadChunkFromFile(p_73158_1_, p_73158_2_); + chunk = this.func_73239_e(p_73158_1_, p_73158_2_); if (chunk == null) @@ -114,6 +167,7 @@ - this.id2ChunkMap.add(i, chunk); - this.loadedChunks.add(chunk); + this.field_73244_f.func_76163_a(i, chunk); + this.field_73245_g.add(chunk); + loadingChunks.remove(i); - chunk.onChunkLoad(); - chunk.populateChunk(this, this, p_73158_1_, p_73158_2_); + chunk.func_76631_c(); + chunk.func_76624_a(this, this, p_73158_1_, p_73158_2_); } @@ -205,6 +259,7 @@ - if (this.serverChunkGenerator != null) + if (this.field_73246_d != null) { - this.serverChunkGenerator.populate(p_73153_1_, p_73153_2_, p_73153_3_); -+ net.minecraftforge.fml.common.registry.GameRegistry.generateWorld(p_73153_2_, p_73153_3_, worldObj, serverChunkGenerator, p_73153_1_); - chunk.setChunkModified(); + this.field_73246_d.func_73153_a(p_73153_1_, p_73153_2_, p_73153_3_); ++ net.minecraftforge.fml.common.registry.GameRegistry.generateWorld(p_73153_2_, p_73153_3_, field_73251_h, field_73246_d, p_73153_1_); + chunk.func_76630_e(); } } @@ -266,6 +321,11 @@ { - if (!this.worldObj.disableLevelSaving) + if (!this.field_73251_h.field_73058_d) { -+ for (ChunkCoordIntPair forced : this.worldObj.getPersistentChunks().keySet()) ++ for (ChunkCoordIntPair forced : this.field_73251_h.getPersistentChunks().keySet()) + { -+ this.droppedChunksSet.remove(ChunkCoordIntPair.chunkXZ2Int(forced.chunkXPos, forced.chunkZPos)); ++ this.field_73248_b.remove(ChunkCoordIntPair.func_77272_a(forced.field_77276_a, forced.field_77275_b)); + } + for (int i = 0; i < 100; ++i) { - if (!this.droppedChunksSet.isEmpty()) + if (!this.field_73248_b.isEmpty()) @@ -280,6 +340,12 @@ - this.saveChunkExtraData(chunk); - this.id2ChunkMap.remove(olong.longValue()); - this.loadedChunks.remove(chunk); -+ net.minecraftforge.common.ForgeChunkManager.putDormantChunk(ChunkCoordIntPair.chunkXZ2Int(chunk.xPosition, chunk.zPosition), chunk); -+ if(loadedChunks.size() == 0 && net.minecraftforge.common.ForgeChunkManager.getPersistentChunksFor(this.worldObj).size() == 0 && !net.minecraftforge.common.DimensionManager.shouldLoadSpawn(this.worldObj.provider.getDimensionId())){ -+ net.minecraftforge.common.DimensionManager.unloadWorld(this.worldObj.provider.getDimensionId()); -+ return serverChunkGenerator.unloadQueuedChunks(); + this.func_73243_a(chunk); + this.field_73244_f.func_76159_d(olong.longValue()); + this.field_73245_g.remove(chunk); ++ net.minecraftforge.common.ForgeChunkManager.putDormantChunk(ChunkCoordIntPair.func_77272_a(chunk.field_76635_g, chunk.field_76647_h), chunk); ++ if(field_73245_g.size() == 0 && net.minecraftforge.common.ForgeChunkManager.getPersistentChunksFor(this.field_73251_h).size() == 0 && !net.minecraftforge.common.DimensionManager.shouldLoadSpawn(this.field_73251_h.field_73011_w.func_177502_q())){ ++ net.minecraftforge.common.DimensionManager.unloadWorld(this.field_73251_h.field_73011_w.func_177502_q()); ++ return field_73246_d.func_73156_b(); + } + } - this.droppedChunksSet.remove(olong); + this.field_73248_b.remove(olong); diff --git a/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch b/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch index 8d6cd118c..63fe3a7bb 100644 --- a/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch @@ -2,18 +2,18 @@ +++ ../src-work/minecraft/net/minecraft/world/gen/MapGenCaves.java @@ -138,7 +138,7 @@ { - IBlockState iblockstate = p_180702_5_.getBlockState(j1, l1, k1); + IBlockState iblockstate = p_180702_5_.func_177856_a(j1, l1, k1); -- if (iblockstate.getBlock() == Blocks.flowing_water || iblockstate.getBlock() == Blocks.water) +- if (iblockstate.func_177230_c() == Blocks.field_150358_i || iblockstate.func_177230_c() == Blocks.field_150355_j) + if (isOceanBlock(p_180702_5_, j1, l1, k1, p_180702_3_, p_180702_4_)) { flag3 = true; } @@ -176,33 +176,12 @@ - IBlockState iblockstate1 = p_180702_5_.getBlockState(j3, j2, i2); - IBlockState iblockstate2 = (IBlockState)Objects.firstNonNull(p_180702_5_.getBlockState(j3, j2 + 1, i2), Blocks.air.getDefaultState()); + IBlockState iblockstate1 = p_180702_5_.func_177856_a(j3, j2, i2); + IBlockState iblockstate2 = (IBlockState)Objects.firstNonNull(p_180702_5_.func_177856_a(j3, j2 + 1, i2), Blocks.field_150350_a.func_176223_P()); -- if (iblockstate1.getBlock() == Blocks.grass || iblockstate1.getBlock() == Blocks.mycelium) +- if (iblockstate1.func_177230_c() == Blocks.field_150349_c || iblockstate1.func_177230_c() == Blocks.field_150391_bh) + if (isTopBlock(p_180702_5_, j3, j2, i2, p_180702_3_, p_180702_4_)) { flag1 = true; @@ -23,21 +23,21 @@ - { - if (j2 - 1 < 10) - { -- p_180702_5_.setBlockState(j3, j2, i2, Blocks.lava.getDefaultState()); +- p_180702_5_.func_177855_a(j3, j2, i2, Blocks.field_150353_l.func_176223_P()); - } - else - { -- p_180702_5_.setBlockState(j3, j2, i2, Blocks.air.getDefaultState()); +- p_180702_5_.func_177855_a(j3, j2, i2, Blocks.field_150350_a.func_176223_P()); - -- if (iblockstate2.getBlock() == Blocks.sand) +- if (iblockstate2.func_177230_c() == Blocks.field_150354_m) - { -- p_180702_5_.setBlockState(j3, j2 + 1, i2, iblockstate2.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND ? Blocks.red_sandstone.getDefaultState() : Blocks.sandstone.getDefaultState()); +- p_180702_5_.func_177855_a(j3, j2 + 1, i2, iblockstate2.func_177229_b(BlockSand.field_176504_a) == BlockSand.EnumType.RED_SAND ? Blocks.field_180395_cM.func_176223_P() : Blocks.field_150322_A.func_176223_P()); - } - -- if (flag1 && p_180702_5_.getBlockState(j3, j2 - 1, i2).getBlock() == Blocks.dirt) +- if (flag1 && p_180702_5_.func_177856_a(j3, j2 - 1, i2).func_177230_c() == Blocks.field_150346_d) - { - blockpos$mutableblockpos.func_181079_c(j3 + p_180702_3_ * 16, 0, i2 + p_180702_4_ * 16); -- p_180702_5_.setBlockState(j3, j2 - 1, i2, this.worldObj.getBiomeGenForCoords(blockpos$mutableblockpos).topBlock.getBlock().getDefaultState()); +- p_180702_5_.func_177855_a(j3, j2 - 1, i2, this.field_75039_c.func_180494_b(blockpos$mutableblockpos).field_76752_A.func_177230_c().func_176223_P()); - } - } - } @@ -52,15 +52,15 @@ + + protected boolean isOceanBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ) + { -+ net.minecraft.block.Block block = data.getBlockState(x, y, z).getBlock(); -+ return block== Blocks.flowing_water || block == Blocks.water; ++ net.minecraft.block.Block block = data.func_177856_a(x, y, z).func_177230_c(); ++ return block== Blocks.field_150358_i || block == Blocks.field_150355_j; + } + + //Exception biomes to make sure we generate like vanilla + private boolean isExceptionBiome(net.minecraft.world.biome.BiomeGenBase biome) + { -+ if (biome == net.minecraft.world.biome.BiomeGenBase.beach) return true; -+ if (biome == net.minecraft.world.biome.BiomeGenBase.desert) return true; ++ if (biome == net.minecraft.world.biome.BiomeGenBase.field_76787_r) return true; ++ if (biome == net.minecraft.world.biome.BiomeGenBase.field_76769_d) return true; + return false; + } + @@ -68,9 +68,9 @@ + //Vanilla bugs to make sure that we generate the map the same way vanilla does. + private boolean isTopBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ) + { -+ net.minecraft.world.biome.BiomeGenBase biome = worldObj.getBiomeGenForCoords(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16)); -+ IBlockState state = data.getBlockState(x, y, z); -+ return (isExceptionBiome(biome) ? state.getBlock() == Blocks.grass : state.getBlock() == biome.topBlock); ++ net.minecraft.world.biome.BiomeGenBase biome = field_75039_c.func_180494_b(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16)); ++ IBlockState state = data.func_177856_a(x, y, z); ++ return (isExceptionBiome(biome) ? state.func_177230_c() == Blocks.field_150349_c : state.func_177230_c() == biome.field_76752_A); + } + + /** @@ -90,28 +90,28 @@ + */ + protected void digBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop, IBlockState state, IBlockState up) + { -+ net.minecraft.world.biome.BiomeGenBase biome = worldObj.getBiomeGenForCoords(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16)); -+ IBlockState top = biome.topBlock; -+ IBlockState filler = biome.fillerBlock; ++ net.minecraft.world.biome.BiomeGenBase biome = field_75039_c.func_180494_b(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16)); ++ IBlockState top = biome.field_76752_A; ++ IBlockState filler = biome.field_76753_B; + -+ if (this.func_175793_a(state, up) || state.getBlock() == top.getBlock() || state.getBlock() == filler.getBlock()) ++ if (this.func_175793_a(state, up) || state.func_177230_c() == top.func_177230_c() || state.func_177230_c() == filler.func_177230_c()) + { + if (y < 10) + { -+ data.setBlockState(x, y, z, Blocks.lava.getDefaultState()); ++ data.func_177855_a(x, y, z, Blocks.field_150353_l.func_176223_P()); + } + else + { -+ data.setBlockState(x, y, z, Blocks.air.getDefaultState()); ++ data.func_177855_a(x, y, z, Blocks.field_150350_a.func_176223_P()); + -+ if (up.getBlock() == Blocks.sand) ++ if (up.func_177230_c() == Blocks.field_150354_m) + { -+ data.setBlockState(x, y + 1, z, up.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND ? Blocks.red_sandstone.getDefaultState() : Blocks.sandstone.getDefaultState()); ++ data.func_177855_a(x, y + 1, z, up.func_177229_b(BlockSand.field_176504_a) == BlockSand.EnumType.RED_SAND ? Blocks.field_180395_cM.func_176223_P() : Blocks.field_150322_A.func_176223_P()); + } + -+ if (foundTop && data.getBlockState(x, y - 1, z).getBlock() == filler.getBlock()) ++ if (foundTop && data.func_177856_a(x, y - 1, z).func_177230_c() == filler.func_177230_c()) + { -+ data.setBlockState(x, y - 1, z, top.getBlock().getDefaultState()); ++ data.func_177855_a(x, y - 1, z, top.func_177230_c().func_176223_P()); + } + } + } diff --git a/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch b/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch index 9c89eb5b3..b5fc50da7 100644 --- a/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch @@ -2,37 +2,37 @@ +++ ../src-work/minecraft/net/minecraft/world/gen/MapGenRavine.java @@ -128,7 +128,7 @@ { - IBlockState iblockstate = p_180707_5_.getBlockState(j1, l1, k1); + IBlockState iblockstate = p_180707_5_.func_177856_a(j1, l1, k1); -- if (iblockstate.getBlock() == Blocks.flowing_water || iblockstate.getBlock() == Blocks.water) +- if (iblockstate.func_177230_c() == Blocks.field_150358_i || iblockstate.func_177230_c() == Blocks.field_150355_j) + if (isOceanBlock(p_180707_5_, j1, l1, k1, p_180707_3_, p_180707_4_)) { flag2 = true; } @@ -165,28 +165,12 @@ { - IBlockState iblockstate1 = p_180707_5_.getBlockState(j3, j2, i2); + IBlockState iblockstate1 = p_180707_5_.func_177856_a(j3, j2, i2); -- if (iblockstate1.getBlock() == Blocks.grass) +- if (iblockstate1.func_177230_c() == Blocks.field_150349_c) + if (isTopBlock(p_180707_5_, j3, j2, i2, p_180707_3_, p_180707_4_)) { flag = true; } -- if (iblockstate1.getBlock() == Blocks.stone || iblockstate1.getBlock() == Blocks.dirt || iblockstate1.getBlock() == Blocks.grass) +- if (iblockstate1.func_177230_c() == Blocks.field_150348_b || iblockstate1.func_177230_c() == Blocks.field_150346_d || iblockstate1.func_177230_c() == Blocks.field_150349_c) - { - if (j2 - 1 < 10) - { -- p_180707_5_.setBlockState(j3, j2, i2, Blocks.flowing_lava.getDefaultState()); +- p_180707_5_.func_177855_a(j3, j2, i2, Blocks.field_150356_k.func_176223_P()); - } - else - { -- p_180707_5_.setBlockState(j3, j2, i2, Blocks.air.getDefaultState()); +- p_180707_5_.func_177855_a(j3, j2, i2, Blocks.field_150350_a.func_176223_P()); - -- if (flag && p_180707_5_.getBlockState(j3, j2 - 1, i2).getBlock() == Blocks.dirt) +- if (flag && p_180707_5_.func_177856_a(j3, j2 - 1, i2).func_177230_c() == Blocks.field_150346_d) - { - blockpos$mutableblockpos.func_181079_c(j3 + p_180707_3_ * 16, 0, i2 + p_180707_4_ * 16); -- p_180707_5_.setBlockState(j3, j2 - 1, i2, this.worldObj.getBiomeGenForCoords(blockpos$mutableblockpos).topBlock); +- p_180707_5_.func_177855_a(j3, j2 - 1, i2, this.field_75039_c.func_180494_b(blockpos$mutableblockpos).field_76752_A); - } - } - } @@ -46,17 +46,17 @@ } + protected boolean isOceanBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ) + { -+ net.minecraft.block.Block block = data.getBlockState(x, y, z).getBlock(); -+ return block== Blocks.flowing_water || block == Blocks.water; ++ net.minecraft.block.Block block = data.func_177856_a(x, y, z).func_177230_c(); ++ return block== Blocks.field_150358_i || block == Blocks.field_150355_j; + } + + //Exception biomes to make sure we generate like vanilla + private boolean isExceptionBiome(net.minecraft.world.biome.BiomeGenBase biome) + { -+ if (biome == net.minecraft.world.biome.BiomeGenBase.beach) return true; -+ if (biome == net.minecraft.world.biome.BiomeGenBase.desert) return true; -+ if (biome == net.minecraft.world.biome.BiomeGenBase.mushroomIsland) return true; -+ if (biome == net.minecraft.world.biome.BiomeGenBase.mushroomIslandShore) return true; ++ if (biome == net.minecraft.world.biome.BiomeGenBase.field_76787_r) return true; ++ if (biome == net.minecraft.world.biome.BiomeGenBase.field_76769_d) return true; ++ if (biome == net.minecraft.world.biome.BiomeGenBase.field_76789_p) return true; ++ if (biome == net.minecraft.world.biome.BiomeGenBase.field_76788_q) return true; + return false; + } + @@ -64,9 +64,9 @@ + //Vanilla bugs to make sure that we generate the map the same way vanilla does. + private boolean isTopBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ) + { -+ net.minecraft.world.biome.BiomeGenBase biome = worldObj.getBiomeGenForCoords(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16)); -+ IBlockState state = data.getBlockState(x, y, z); -+ return (isExceptionBiome(biome) ? state.getBlock() == Blocks.grass : state.getBlock() == biome.topBlock); ++ net.minecraft.world.biome.BiomeGenBase biome = field_75039_c.func_180494_b(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16)); ++ IBlockState state = data.func_177856_a(x, y, z); ++ return (isExceptionBiome(biome) ? state.func_177230_c() == Blocks.field_150349_c : state.func_177230_c() == biome.field_76752_A); + } + + /** @@ -86,24 +86,24 @@ + */ + protected void digBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop) + { -+ net.minecraft.world.biome.BiomeGenBase biome = worldObj.getBiomeGenForCoords(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16)); -+ IBlockState state = data.getBlockState(x, y, z); -+ IBlockState top = isExceptionBiome(biome) ? Blocks.grass.getDefaultState() : biome.topBlock; -+ IBlockState filler = isExceptionBiome(biome) ? Blocks.dirt.getDefaultState() : biome.fillerBlock; ++ net.minecraft.world.biome.BiomeGenBase biome = field_75039_c.func_180494_b(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16)); ++ IBlockState state = data.func_177856_a(x, y, z); ++ IBlockState top = isExceptionBiome(biome) ? Blocks.field_150349_c.func_176223_P() : biome.field_76752_A; ++ IBlockState filler = isExceptionBiome(biome) ? Blocks.field_150346_d.func_176223_P() : biome.field_76753_B; + -+ if (state.getBlock() == Blocks.stone || state.getBlock() == top.getBlock() || state.getBlock() == filler.getBlock()) ++ if (state.func_177230_c() == Blocks.field_150348_b || state.func_177230_c() == top.func_177230_c() || state.func_177230_c() == filler.func_177230_c()) + { + if (y < 10) + { -+ data.setBlockState(x, y, z, Blocks.lava.getDefaultState()); ++ data.func_177855_a(x, y, z, Blocks.field_150353_l.func_176223_P()); + } + else + { -+ data.setBlockState(x, y, z, Blocks.air.getDefaultState()); ++ data.func_177855_a(x, y, z, Blocks.field_150350_a.func_176223_P()); + -+ if (foundTop && data.getBlockState(x, y - 1, z).getBlock() == filler.getBlock()) ++ if (foundTop && data.func_177856_a(x, y - 1, z).func_177230_c() == filler.func_177230_c()) + { -+ data.setBlockState(x, y - 1, z, top.getBlock().getDefaultState()); ++ data.func_177855_a(x, y - 1, z, top.func_177230_c().func_176223_P()); + } + } + } 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 1b9ac00c1..f23e6f318 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch @@ -1,13 +1,13 @@ --- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java @@ -31,4 +31,10 @@ - this.func_175903_a(worldIn, p_175921_2_, Blocks.dirt.getDefaultState()); + this.func_175903_a(p_175921_1_, p_175921_2_, Blocks.field_150346_d.func_176223_P()); } } + + public boolean isReplaceable(World world, BlockPos pos) + { -+ net.minecraft.block.state.IBlockState state = world.getBlockState(pos); -+ return state.getBlock().isAir(world, pos) || state.getBlock().isLeaves(world, pos) || state.getBlock().isWood(world, pos) || func_150523_a(state.getBlock()); ++ net.minecraft.block.state.IBlockState state = world.func_180495_p(pos); ++ return state.func_177230_c().isAir(world, pos) || state.func_177230_c().isLeaves(world, pos) || state.func_177230_c().isWood(world, pos) || func_150523_a(state.func_177230_c()); + } } 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 a7d6dc424..0aba92cfd 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java @@ -54,7 +54,7 @@ { - Block block = worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(l, j, i1)).getBlock(); + Block block = p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)).func_177230_c(); -- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) -+ if (!block.isAir(worldIn,blockpos$mutableblockpos) && !block.isLeaves(worldIn,blockpos$mutableblockpos)) +- if (block.func_149688_o() != Material.field_151579_a && block.func_149688_o() != Material.field_151584_j) ++ if (!block.isAir(p_180709_1_,blockpos$mutableblockpos) && !block.isLeaves(p_180709_1_,blockpos$mutableblockpos)) { flag = false; } @@ -13,21 +13,21 @@ { BlockPos blockpos = new BlockPos(l1, l2, i2); -- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) -+ if (!worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos)) +- if (!p_180709_1_.func_180495_p(blockpos).func_177230_c().func_149730_j()) ++ if (!p_180709_1_.func_180495_p(blockpos).func_177230_c().canBeReplacedByLeaves(p_180709_1_, blockpos)) { - this.func_175903_a(worldIn, blockpos, this.mushroomType.getDefaultState().withProperty(BlockHugeMushroom.VARIANT, blockhugemushroom$enumtype)); + this.func_175903_a(p_180709_1_, blockpos, this.field_76523_a.func_176223_P().func_177226_a(BlockHugeMushroom.field_176380_a, blockhugemushroom$enumtype)); } @@ -201,9 +201,10 @@ for (int i3 = 0; i3 < i; ++i3) { -- Block block2 = worldIn.getBlockState(p_180709_3_.up(i3)).getBlock(); -+ BlockPos upN = p_180709_3_.up(i3); -+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(upN); +- Block block2 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(i3)).func_177230_c(); ++ BlockPos upN = p_180709_3_.func_177981_b(i3); ++ net.minecraft.block.state.IBlockState state = p_180709_1_.func_180495_p(upN); -- if (!block2.isFullBlock()) -+ if (state.getBlock().canBeReplacedByLeaves(worldIn, upN)) +- if (!block2.func_149730_j()) ++ if (state.func_177230_c().canBeReplacedByLeaves(p_180709_1_, upN)) { - this.func_175903_a(worldIn, p_180709_3_.up(i3), this.mushroomType.getDefaultState().withProperty(BlockHugeMushroom.VARIANT, BlockHugeMushroom.EnumType.STEM)); + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(i3), this.field_76523_a.func_176223_P().func_177226_a(BlockHugeMushroom.field_176380_a, BlockHugeMushroom.EnumType.STEM)); } 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 e4bc6f945..7fb88e1b7 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch @@ -3,29 +3,29 @@ @@ -99,9 +99,9 @@ if (Math.pow((double)Math.abs(j) + 0.5D, 2.0D) + Math.pow((double)Math.abs(k) + 0.5D, 2.0D) <= (double)(p_181631_2_ * p_181631_2_)) { - BlockPos blockpos = p_181631_1_.add(j, 0, k); -- Material material = this.world.getBlockState(blockpos).getBlock().getMaterial(); -+ net.minecraft.block.state.IBlockState state = this.world.getBlockState(blockpos); + BlockPos blockpos = p_181631_1_.func_177982_a(j, 0, k); +- Material material = this.field_175946_l.func_180495_p(blockpos).func_177230_c().func_149688_o(); ++ net.minecraft.block.state.IBlockState state = this.field_175946_l.func_180495_p(blockpos); -- if (material == Material.air || material == Material.leaves) -+ if (state.getBlock().isAir(this.world, blockpos) || state.getBlock().isLeaves(this.world, blockpos)) +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (state.func_177230_c().isAir(this.field_175946_l, blockpos) || state.func_177230_c().isLeaves(this.field_175946_l, blockpos)) { - this.func_175903_a(this.world, blockpos, p_181631_3_); + this.func_175903_a(this.field_175946_l, blockpos, p_181631_3_); } @@ -254,7 +254,7 @@ { - BlockPos blockpos1 = p_175936_1_.add((double)(0.5F + (float)j * f), (double)(0.5F + (float)j * f1), (double)(0.5F + (float)j * f2)); + BlockPos blockpos1 = p_175936_1_.func_177963_a((double)(0.5F + (float)j * f), (double)(0.5F + (float)j * f1), (double)(0.5F + (float)j * f2)); -- if (!this.func_150523_a(this.world.getBlockState(blockpos1).getBlock())) -+ if (!this.isReplaceable(world, blockpos1)) +- if (!this.func_150523_a(this.field_175946_l.func_180495_p(blockpos1).func_177230_c())) ++ if (!this.isReplaceable(field_175946_l, blockpos1)) { return j; } @@ -282,6 +282,7 @@ - if (!this.validTreeLocation()) + if (!this.func_76497_e()) { -+ this.world = null; //Fix vanilla Mem leak, holds latest world ++ this.field_175946_l = null; //Fix vanilla Mem leak, holds latest world return false; } else @@ -33,19 +33,19 @@ this.func_175941_b(); this.func_175942_c(); this.func_175939_d(); -+ this.world = null; //Fix vanilla Mem leak, holds latest world ++ this.field_175946_l = null; //Fix vanilla Mem leak, holds latest world return true; } } - private boolean validTreeLocation() + private boolean func_76497_e() { -- Block block = this.world.getBlockState(this.field_175947_m.down()).getBlock(); -+ BlockPos down = this.field_175947_m.down(); -+ net.minecraft.block.state.IBlockState state = this.world.getBlockState(down); -+ boolean isSoil = state.getBlock().canSustainPlant(this.world, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling)); +- Block block = this.field_175946_l.func_180495_p(this.field_175947_m.func_177977_b()).func_177230_c(); ++ BlockPos down = this.field_175947_m.func_177977_b(); ++ net.minecraft.block.state.IBlockState state = this.field_175946_l.func_180495_p(down); ++ boolean isSoil = state.func_177230_c().canSustainPlant(this.field_175946_l, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); -- if (block != Blocks.dirt && block != Blocks.grass && block != Blocks.farmland) +- if (block != Blocks.field_150346_d && block != Blocks.field_150349_c && block != Blocks.field_150458_ak) + if (!isSoil) { return false; 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 c471dd264..6bc3eb814 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch @@ -3,13 +3,13 @@ @@ -33,9 +33,10 @@ if (k >= 1 && k + i + 1 < 256) { - BlockPos blockpos = p_180709_3_.down(); -- Block block = worldIn.getBlockState(blockpos).getBlock(); -+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(blockpos); -+ boolean isSoil = state.getBlock().canSustainPlant(worldIn, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling)); + BlockPos blockpos = p_180709_3_.func_177977_b(); +- Block block = p_180709_1_.func_180495_p(blockpos).func_177230_c(); ++ net.minecraft.block.state.IBlockState state = p_180709_1_.func_180495_p(blockpos); ++ boolean isSoil = state.func_177230_c().canSustainPlant(p_180709_1_, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); -- if (block != Blocks.grass && block != Blocks.dirt) -+ if (!(isSoil && p_180709_3_.getY() < 256 - i - 1)) +- if (block != Blocks.field_150349_c && block != Blocks.field_150346_d) ++ if (!(isSoil && p_180709_3_.func_177956_o() < 256 - i - 1)) { return false; } @@ -17,55 +17,55 @@ } else { -- this.func_175921_a(worldIn, blockpos); -- this.func_175921_a(worldIn, blockpos.east()); -- this.func_175921_a(worldIn, blockpos.south()); -- this.func_175921_a(worldIn, blockpos.south().east()); -+ this.onPlantGrow(worldIn, blockpos, p_180709_3_); -+ this.onPlantGrow(worldIn, blockpos.east(), p_180709_3_); -+ this.onPlantGrow(worldIn, blockpos.south(), p_180709_3_); -+ this.onPlantGrow(worldIn, blockpos.south().east(), p_180709_3_); - EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.random(p_180709_2_); +- this.func_175921_a(p_180709_1_, blockpos); +- this.func_175921_a(p_180709_1_, blockpos.func_177974_f()); +- this.func_175921_a(p_180709_1_, blockpos.func_177968_d()); +- this.func_175921_a(p_180709_1_, blockpos.func_177968_d().func_177974_f()); ++ this.onPlantGrow(p_180709_1_, blockpos, p_180709_3_); ++ this.onPlantGrow(p_180709_1_, blockpos.func_177974_f(), p_180709_3_); ++ this.onPlantGrow(p_180709_1_, blockpos.func_177968_d(), p_180709_3_); ++ this.onPlantGrow(p_180709_1_, blockpos.func_177968_d().func_177974_f(), p_180709_3_); + EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.func_179518_a(p_180709_2_); int i1 = i - p_180709_2_.nextInt(4); int j1 = 2 - p_180709_2_.nextInt(3); @@ -67,9 +68,9 @@ int k2 = k + j2; BlockPos blockpos1 = new BlockPos(k1, k2, l1); -- Material material = worldIn.getBlockState(blockpos1).getBlock().getMaterial(); -+ state = worldIn.getBlockState(blockpos1); +- Material material = p_180709_1_.func_180495_p(blockpos1).func_177230_c().func_149688_o(); ++ state = p_180709_1_.func_180495_p(blockpos1); -- if (material == Material.air || material == Material.leaves) -+ if (state.getBlock().isAir(worldIn, blockpos1) || state.getBlock().isLeaves(worldIn, blockpos1)) +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (state.func_177230_c().isAir(p_180709_1_, blockpos1) || state.func_177230_c().isLeaves(p_180709_1_, blockpos1)) { - this.func_181639_b(worldIn, blockpos1); - this.func_181639_b(worldIn, blockpos1.east()); + this.func_181639_b(p_180709_1_, blockpos1); + this.func_181639_b(p_180709_1_, blockpos1.func_177974_f()); @@ -187,7 +188,7 @@ { for (int k1 = -i1; k1 <= i1; ++k1) { -- if (!this.func_150523_a(p_181638_1_.getBlockState(blockpos$mutableblockpos.func_181079_c(i + j1, j + l, k + k1)).getBlock())) +- if (!this.func_150523_a(p_181638_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(i + j1, j + l, k + k1)).func_177230_c())) + if (!this.isReplaceable(p_181638_1_, blockpos$mutableblockpos.func_181079_c(i + j1, j + l, k + k1))) { return false; } @@ -209,11 +210,17 @@ - private void func_150526_a(World worldIn, int p_150526_2_, int p_150526_3_, int p_150526_4_) + private void func_150526_a(World p_150526_1_, int p_150526_2_, int p_150526_3_, int p_150526_4_) { BlockPos blockpos = new BlockPos(p_150526_2_, p_150526_3_, p_150526_4_); -- Block block = worldIn.getBlockState(blockpos).getBlock(); -+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(blockpos); +- Block block = p_150526_1_.func_180495_p(blockpos).func_177230_c(); ++ net.minecraft.block.state.IBlockState state = p_150526_1_.func_180495_p(blockpos); -- if (block.getMaterial() == Material.air) -+ if (state.getBlock().isAir(worldIn, blockpos)) +- if (block.func_149688_o() == Material.field_151579_a) ++ if (state.func_177230_c().isAir(p_150526_1_, blockpos)) { - this.func_175903_a(worldIn, blockpos, field_181641_b); + this.func_175903_a(p_150526_1_, blockpos, field_181641_b); } } + + //Just a helper macro + private void onPlantGrow(World world, BlockPos pos, BlockPos source) + { -+ world.getBlockState(pos).getBlock().onPlantGrow(world, pos, source); ++ world.func_180495_p(pos).func_177230_c().onPlantGrow(world, pos, source); + } } 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 7a7cd9a52..61253bc64 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch @@ -4,14 +4,14 @@ { Block block; -- while (((block = worldIn.getBlockState(p_180709_3_).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && p_180709_3_.getY() > 0) +- while (((block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c()).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && p_180709_3_.func_177956_o() > 0) + do { -+ block = worldIn.getBlockState(p_180709_3_).getBlock(); -+ if (!block.isLeaves(worldIn, p_180709_3_) && !block.isLeaves(worldIn, p_180709_3_)) break; - p_180709_3_ = p_180709_3_.down(); ++ block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c(); ++ if (!block.isLeaves(p_180709_1_, p_180709_3_) && !block.isLeaves(p_180709_1_, p_180709_3_)) break; + p_180709_3_ = p_180709_3_.func_177977_b(); - } -+ } while (p_180709_3_.getY() > 0); ++ } while (p_180709_3_.func_177956_o() > 0); for (int i = 0; i < 4; ++i) { 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 fe5d8f922..dd91af336 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch @@ -3,28 +3,28 @@ @@ -123,12 +123,11 @@ if (j3 == 1) { - worldIn.setBlockState(blockpos2, Blocks.chest.correctFacing(worldIn, blockpos2, Blocks.chest.getDefaultState()), 2); -- List list = WeightedRandomChestContent.func_177629_a(CHESTCONTENT, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(p_180709_2_)}); - TileEntity tileentity1 = worldIn.getTileEntity(blockpos2); + p_180709_1_.func_180501_a(blockpos2, Blocks.field_150486_ae.func_176458_f(p_180709_1_, blockpos2, Blocks.field_150486_ae.func_176223_P()), 2); +- List list = WeightedRandomChestContent.func_177629_a(field_175917_c, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_180709_2_)}); + TileEntity tileentity1 = p_180709_1_.func_175625_s(blockpos2); if (tileentity1 instanceof TileEntityChest) { -- WeightedRandomChestContent.generateChestContents(p_180709_2_, list, (TileEntityChest)tileentity1, 8); -+ WeightedRandomChestContent.generateChestContents(p_180709_2_, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST, p_180709_2_), (TileEntityChest)tileentity1, 8); +- WeightedRandomChestContent.func_177630_a(p_180709_2_, list, (TileEntityChest)tileentity1, 8); ++ WeightedRandomChestContent.func_177630_a(p_180709_2_, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST, p_180709_2_), (TileEntityChest)tileentity1, 8); } break; @@ -159,6 +158,12 @@ - private String pickMobSpawner(Random p_76543_1_) + private String func_76543_b(Random p_76543_1_) { -- return SPAWNERTYPES[p_76543_1_.nextInt(SPAWNERTYPES.length)]; +- return field_175916_b[p_76543_1_.nextInt(field_175916_b.length)]; + return net.minecraftforge.common.DungeonHooks.getRandomDungeonMob(p_76543_1_); } + + static + { -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST, CHESTCONTENT, 8, 8); -+ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.enchanted_book, 1, 0), 1, 1, 1)); ++ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST, field_175917_c, 8, 8); ++ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.field_151134_bR, 1, 0), 1, 1, 1)); + } } 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 af707653c..9eca24df4 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch @@ -4,8 +4,8 @@ { if (j >= 0 && j < 256) { -- if (!this.func_150523_a(worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(l, j, i1)).getBlock())) -+ if (!this.isReplaceable(worldIn, blockpos$mutableblockpos.func_181079_c(l, j, i1))) +- if (!this.func_150523_a(p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)).func_177230_c())) ++ if (!this.isReplaceable(p_180709_1_, blockpos$mutableblockpos.func_181079_c(l, j, i1))) { flag = false; } @@ -13,38 +13,38 @@ } else { -- Block block1 = worldIn.getBlockState(p_180709_3_.down()).getBlock(); -+ BlockPos down = p_180709_3_.down(); -+ Block block1 = worldIn.getBlockState(down).getBlock(); -+ boolean isSoil = block1.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling)); +- Block block1 = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); ++ BlockPos down = p_180709_3_.func_177977_b(); ++ Block block1 = p_180709_1_.func_180495_p(down).func_177230_c(); ++ boolean isSoil = block1.canSustainPlant(p_180709_1_, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); -- if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && p_180709_3_.getY() < 256 - i - 1) -+ if (isSoil && p_180709_3_.getY() < 256 - i - 1) +- if ((block1 == Blocks.field_150349_c || block1 == Blocks.field_150346_d || block1 == Blocks.field_150458_ak) && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (isSoil && p_180709_3_.func_177956_o() < 256 - i - 1) { -- this.func_175921_a(worldIn, p_180709_3_.down()); -+ block1.onPlantGrow(worldIn, down, p_180709_3_); +- this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); ++ block1.onPlantGrow(p_180709_1_, down, p_180709_3_); - for (int i2 = p_180709_3_.getY() - 3 + i; i2 <= p_180709_3_.getY() + i; ++i2) + for (int i2 = p_180709_3_.func_177956_o() - 3 + i; i2 <= p_180709_3_.func_177956_o() + i; ++i2) { @@ -101,7 +103,7 @@ BlockPos blockpos = new BlockPos(i3, i2, k1); - Block block = worldIn.getBlockState(blockpos).getBlock(); + Block block = p_180709_1_.func_180495_p(blockpos).func_177230_c(); -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (block.isAir(worldIn, blockpos) || block.isLeaves(worldIn, blockpos)) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_180709_1_, blockpos) || block.isLeaves(p_180709_1_, blockpos)) { - this.func_175903_a(worldIn, blockpos, field_181630_b); + this.func_175903_a(p_180709_1_, blockpos, field_181630_b); } @@ -112,9 +114,9 @@ for (int j2 = 0; j2 < i; ++j2) { -- Block block2 = worldIn.getBlockState(p_180709_3_.up(j2)).getBlock(); +- Block block2 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(j2)).func_177230_c(); - -- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves) -+ BlockPos upN = p_180709_3_.up(j2); -+ Block block2 = worldIn.getBlockState(upN).getBlock(); -+ if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN)) +- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j) ++ BlockPos upN = p_180709_3_.func_177981_b(j2); ++ Block block2 = p_180709_1_.func_180495_p(upN).func_177230_c(); ++ if (block2.isAir(p_180709_1_, upN) || block2.isLeaves(p_180709_1_, upN)) { - this.func_175903_a(worldIn, p_180709_3_.up(j2), field_181629_a); + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(j2), field_181629_a); } 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 4cfafd4f6..16ea524eb 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch @@ -4,54 +4,54 @@ { for (int l = -j; l <= j && flag; ++l) { -- if (p_175926_2_.getY() + i < 0 || p_175926_2_.getY() + i >= 256 || !this.func_150523_a(worldIn.getBlockState(p_175926_2_.add(k, i, l)).getBlock())) -+ if (p_175926_2_.getY() + i < 0 || p_175926_2_.getY() + i >= 256 || !this.isReplaceable(worldIn,p_175926_2_.add(k, i, l))) +- if (p_175926_2_.func_177956_o() + i < 0 || p_175926_2_.func_177956_o() + i >= 256 || !this.func_150523_a(p_175926_1_.func_180495_p(p_175926_2_.func_177982_a(k, i, l)).func_177230_c())) ++ if (p_175926_2_.func_177956_o() + i < 0 || p_175926_2_.func_177956_o() + i >= 256 || !this.isReplaceable(p_175926_1_,p_175926_2_.func_177982_a(k, i, l))) { flag = false; } @@ -79,13 +79,14 @@ { - BlockPos blockpos = p_175927_1_.down(); - Block block = worldIn.getBlockState(blockpos).getBlock(); -+ boolean isSoil = block.canSustainPlant(worldIn, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling)); + BlockPos blockpos = p_175927_1_.func_177977_b(); + Block block = p_175927_2_.func_180495_p(blockpos).func_177230_c(); ++ boolean isSoil = block.canSustainPlant(p_175927_2_, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); -- if ((block == Blocks.grass || block == Blocks.dirt) && p_175927_1_.getY() >= 2) -+ if (isSoil && p_175927_1_.getY() >= 2) +- if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d) && p_175927_1_.func_177956_o() >= 2) ++ if (isSoil && p_175927_1_.func_177956_o() >= 2) { -- this.func_175921_a(worldIn, blockpos); -- this.func_175921_a(worldIn, blockpos.east()); -- this.func_175921_a(worldIn, blockpos.south()); -- this.func_175921_a(worldIn, blockpos.south().east()); -+ this.onPlantGrow(worldIn, blockpos, p_175927_1_); -+ this.onPlantGrow(worldIn, blockpos.east(), p_175927_1_); -+ this.onPlantGrow(worldIn, blockpos.south(), p_175927_1_); -+ this.onPlantGrow(worldIn, blockpos.south().east(), p_175927_1_); +- this.func_175921_a(p_175927_2_, blockpos); +- this.func_175921_a(p_175927_2_, blockpos.func_177974_f()); +- this.func_175921_a(p_175927_2_, blockpos.func_177968_d()); +- this.func_175921_a(p_175927_2_, blockpos.func_177968_d().func_177974_f()); ++ this.onPlantGrow(p_175927_2_, blockpos, p_175927_1_); ++ this.onPlantGrow(p_175927_2_, blockpos.func_177974_f(), p_175927_1_); ++ this.onPlantGrow(p_175927_2_, blockpos.func_177968_d(), p_175927_1_); ++ this.onPlantGrow(p_175927_2_, blockpos.func_177968_d().func_177974_f(), p_175927_1_); return true; } else @@ -113,9 +114,9 @@ if (j * j + k * k <= i || l * l + i1 * i1 <= i || j * j + i1 * i1 <= i || l * l + k * k <= i) { - BlockPos blockpos = p_175925_2_.add(j, 0, k); -- Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial(); -+ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(blockpos); + BlockPos blockpos = p_175925_2_.func_177982_a(j, 0, k); +- Material material = p_175925_1_.func_180495_p(blockpos).func_177230_c().func_149688_o(); ++ net.minecraft.block.state.IBlockState state = p_175925_1_.func_180495_p(blockpos); -- if (material == Material.air || material == Material.leaves) -+ if (state.getBlock().isAir(worldIn, blockpos) || state.getBlock().isLeaves(worldIn, blockpos)) +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (state.func_177230_c().isAir(p_175925_1_, blockpos) || state.func_177230_c().isLeaves(p_175925_1_, blockpos)) { - this.func_175903_a(worldIn, blockpos, this.leavesMetadata); + this.func_175903_a(p_175925_1_, blockpos, this.field_76521_c); } @@ -135,9 +136,9 @@ if (j * j + k * k <= i) { - BlockPos blockpos = p_175928_2_.add(j, 0, k); -- Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial(); -+ Block block = worldIn.getBlockState(blockpos).getBlock(); + BlockPos blockpos = p_175928_2_.func_177982_a(j, 0, k); +- Material material = p_175928_1_.func_180495_p(blockpos).func_177230_c().func_149688_o(); ++ Block block = p_175928_1_.func_180495_p(blockpos).func_177230_c(); -- if (material == Material.air || material == Material.leaves) -+ if (block.isAir(worldIn, blockpos) || block.isLeaves(worldIn, blockpos)) +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (block.isAir(p_175928_1_, blockpos) || block.isLeaves(p_175928_1_, blockpos)) { - this.func_175903_a(worldIn, blockpos, this.leavesMetadata); + this.func_175903_a(p_175928_1_, blockpos, this.field_76521_c); } @@ -145,4 +146,10 @@ } @@ -61,6 +61,6 @@ + //Just a helper macro + private void onPlantGrow(World world, BlockPos pos, BlockPos source) + { -+ world.getBlockState(pos).getBlock().onPlantGrow(world, pos, source); ++ world.func_180495_p(pos).func_177230_c().onPlantGrow(world, pos, source); + } } 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 4857ef044..6856a6cfc 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch @@ -2,49 +2,49 @@ +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java @@ -55,7 +55,7 @@ { - BlockPos blockpos = p_180709_3_.up(i2); + BlockPos blockpos = p_180709_3_.func_177981_b(i2); -- if (this.func_150523_a(worldIn.getBlockState(blockpos).getBlock())) -+ if (this.isAirLeaves(worldIn,blockpos)) +- if (this.func_150523_a(p_180709_1_.func_180495_p(blockpos).func_177230_c())) ++ if (this.isAirLeaves(p_180709_1_,blockpos)) { - this.func_175903_a(worldIn, blockpos, this.woodMetadata); + this.func_175903_a(p_180709_1_, blockpos, this.field_76520_b); @@ -70,7 +70,7 @@ { - BlockPos blockpos1 = blockpos.east(); + BlockPos blockpos1 = blockpos.func_177974_f(); -- if (this.func_150523_a(worldIn.getBlockState(blockpos1).getBlock())) -+ if (this.isAirLeaves(worldIn,blockpos1)) +- if (this.func_150523_a(p_180709_1_.func_180495_p(blockpos1).func_177230_c())) ++ if (this.isAirLeaves(p_180709_1_,blockpos1)) { - this.func_175903_a(worldIn, blockpos1, this.woodMetadata); + this.func_175903_a(p_180709_1_, blockpos1, this.field_76520_b); @@ -83,7 +83,7 @@ - BlockPos blockpos2 = blockpos.south().east(); + BlockPos blockpos2 = blockpos.func_177968_d().func_177974_f(); -- if (this.func_150523_a(worldIn.getBlockState(blockpos2).getBlock())) -+ if (this.isAirLeaves(worldIn,blockpos2)) +- if (this.func_150523_a(p_180709_1_.func_180495_p(blockpos2).func_177230_c())) ++ if (this.isAirLeaves(p_180709_1_,blockpos2)) { - this.func_175903_a(worldIn, blockpos2, this.woodMetadata); + this.func_175903_a(p_180709_1_, blockpos2, this.field_76520_b); @@ -96,7 +96,7 @@ - BlockPos blockpos3 = blockpos.south(); + BlockPos blockpos3 = blockpos.func_177968_d(); -- if (this.func_150523_a(worldIn.getBlockState(blockpos3).getBlock())) -+ if (this.isAirLeaves(worldIn,blockpos3)) +- if (this.func_150523_a(p_180709_1_.func_180495_p(blockpos3).func_177230_c())) ++ if (this.isAirLeaves(p_180709_1_,blockpos3)) { - this.func_175903_a(worldIn, blockpos3, this.woodMetadata); + this.func_175903_a(p_180709_1_, blockpos3, this.field_76520_b); @@ -130,4 +130,11 @@ - this.func_175925_a(worldIn, p_175930_2_.up(j), p_175930_3_ + 1 - j); + this.func_175925_a(p_175930_1_, p_175930_2_.func_177981_b(j), p_175930_3_ + 1 - j); } } + + //Helper macro + private boolean isAirLeaves(World world, BlockPos pos) + { -+ net.minecraft.block.Block block = world.getBlockState(pos).getBlock(); ++ net.minecraft.block.Block block = world.func_180495_p(pos).func_177230_c(); + return block.isAir(world, pos) || block.isLeaves(world, pos); + } } 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 e4b20bc16..f658ebfe6 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch @@ -2,52 +2,52 @@ +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java @@ -43,30 +43,24 @@ { - Block block = worldIn.getBlockState(p_180709_3_.up(j)).getBlock(); + Block block = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(j)).func_177230_c(); -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (isAirLeaves(worldIn,p_180709_3_.up(j))) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (isAirLeaves(p_180709_1_,p_180709_3_.func_177981_b(j))) { - this.func_175903_a(worldIn, p_180709_3_.up(j), this.woodMetadata); + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(j), this.field_76520_b); } if (j < i - 1) { -- block = worldIn.getBlockState(p_180709_3_.add(1, j, 0)).getBlock(); +- block = p_180709_1_.func_180495_p(p_180709_3_.func_177982_a(1, j, 0)).func_177230_c(); - -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (isAirLeaves(worldIn,p_180709_3_.add(1, j, 0))) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (isAirLeaves(p_180709_1_,p_180709_3_.func_177982_a(1, j, 0))) { - this.func_175903_a(worldIn, p_180709_3_.add(1, j, 0), this.woodMetadata); + this.func_175903_a(p_180709_1_, p_180709_3_.func_177982_a(1, j, 0), this.field_76520_b); } -- block = worldIn.getBlockState(p_180709_3_.add(1, j, 1)).getBlock(); +- block = p_180709_1_.func_180495_p(p_180709_3_.func_177982_a(1, j, 1)).func_177230_c(); - -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (isAirLeaves(worldIn,p_180709_3_.add(1, j, 1))) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (isAirLeaves(p_180709_1_,p_180709_3_.func_177982_a(1, j, 1))) { - this.func_175903_a(worldIn, p_180709_3_.add(1, j, 1), this.woodMetadata); + this.func_175903_a(p_180709_1_, p_180709_3_.func_177982_a(1, j, 1), this.field_76520_b); } -- block = worldIn.getBlockState(p_180709_3_.add(0, j, 1)).getBlock(); +- block = p_180709_1_.func_180495_p(p_180709_3_.func_177982_a(0, j, 1)).func_177230_c(); - -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) -+ if (isAirLeaves(worldIn,p_180709_3_.add(0, j, 1))) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (isAirLeaves(p_180709_1_,p_180709_3_.func_177982_a(0, j, 1))) { - this.func_175903_a(worldIn, p_180709_3_.add(0, j, 1), this.woodMetadata); + this.func_175903_a(p_180709_1_, p_180709_3_.func_177982_a(0, j, 1), this.field_76520_b); } @@ -132,16 +126,23 @@ - BlockPos blockpos = p_175934_2_.up(i); - Block block = worldIn.getBlockState(blockpos).getBlock(); + BlockPos blockpos = p_175934_2_.func_177981_b(i); + Block block = p_175934_1_.func_180495_p(blockpos).func_177230_c(); -- if (block == Blocks.grass || block == Blocks.dirt) -+ if (block.canSustainPlant(worldIn, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling))) +- if (block == Blocks.field_150349_c || block == Blocks.field_150346_d) ++ if (block.canSustainPlant(p_175934_1_, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g))) { - this.func_175903_a(worldIn, blockpos, field_181635_g); + this.func_175903_a(p_175934_1_, blockpos, field_181635_g); break; } -- if (block.getMaterial() != Material.air && i < 0) -+ if (!block.isAir(worldIn, blockpos) && i < 0) +- if (block.func_149688_o() != Material.field_151579_a && i < 0) ++ if (!block.isAir(p_175934_1_, blockpos) && i < 0) { break; } @@ -57,7 +57,7 @@ + //Helper macro + private boolean isAirLeaves(World world, BlockPos pos) + { -+ net.minecraft.block.Block block = world.getBlockState(pos).getBlock(); ++ net.minecraft.block.Block block = world.func_180495_p(pos).func_177230_c(); + return block.isAir(world, pos) || block.isLeaves(world, pos); + } } 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 dd22281dd..b3aef2aae 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java.patch @@ -4,8 +4,8 @@ { BlockPos blockpos = new BlockPos(l1, i2, j2); -- if (this.field_175919_c.apply(worldIn.getBlockState(blockpos))) -+ if (worldIn.getBlockState(blockpos).getBlock().isReplaceableOreGen(worldIn, blockpos, this.field_175919_c)) +- if (this.field_175919_c.apply(p_180709_1_.func_180495_p(blockpos))) ++ if (p_180709_1_.func_180495_p(blockpos).func_177230_c().isReplaceableOreGen(p_180709_1_, blockpos, this.field_175919_c)) { - worldIn.setBlockState(blockpos, this.oreBlock, 2); + p_180709_1_.func_180501_a(blockpos, this.field_175920_a, 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 2e8a83dcd..105b15ca4 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch @@ -4,8 +4,8 @@ { if (j >= 0 && j < 256) { -- if (!this.func_150523_a(worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(l, j, i1)).getBlock())) -+ if (!this.isReplaceable(worldIn,blockpos$mutableblockpos.func_181079_c(l, j, i1))) +- if (!this.func_150523_a(p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)).func_177230_c())) ++ if (!this.isReplaceable(p_180709_1_,blockpos$mutableblockpos.func_181079_c(l, j, i1))) { flag = false; } @@ -13,52 +13,52 @@ } else { -- Block block = worldIn.getBlockState(p_180709_3_.down()).getBlock(); -+ BlockPos down = p_180709_3_.down(); -+ Block block = worldIn.getBlockState(down).getBlock(); -+ boolean isSoil = block.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling)); +- Block block = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); ++ BlockPos down = p_180709_3_.func_177977_b(); ++ Block block = p_180709_1_.func_180495_p(down).func_177230_c(); ++ boolean isSoil = block.canSustainPlant(p_180709_1_, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); -- if ((block == Blocks.grass || block == Blocks.dirt) && p_180709_3_.getY() < 256 - i - 1) -+ if (isSoil && p_180709_3_.getY() < 256 - i - 1) +- if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d) && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (isSoil && p_180709_3_.func_177956_o() < 256 - i - 1) { -- this.func_175921_a(worldIn, p_180709_3_.down()); -+ block.onPlantGrow(worldIn, down, p_180709_3_); - EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.random(p_180709_2_); +- this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); ++ block.onPlantGrow(p_180709_1_, down, p_180709_3_); + EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.func_179518_a(p_180709_2_); int k2 = i - p_180709_2_.nextInt(4) - 1; int l2 = 3 - p_180709_2_.nextInt(3); @@ -95,9 +97,9 @@ } BlockPos blockpos = new BlockPos(i3, i2, j1); -- Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial(); -+ block = worldIn.getBlockState(blockpos).getBlock(); +- Material material = p_180709_1_.func_180495_p(blockpos).func_177230_c().func_149688_o(); ++ block = p_180709_1_.func_180495_p(blockpos).func_177230_c(); -- if (material == Material.air || material == Material.leaves) -+ if (block.isAir(worldIn, blockpos) || block.isLeaves(worldIn, blockpos)) +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (block.isAir(p_180709_1_, blockpos) || block.isLeaves(p_180709_1_, blockpos)) { - this.func_181642_b(worldIn, blockpos); + this.func_181642_b(p_180709_1_, blockpos); k1 = i2; @@ -149,9 +151,9 @@ - i3 += enumfacing1.getFrontOffsetX(); - j1 += enumfacing1.getFrontOffsetZ(); + i3 += enumfacing1.func_82601_c(); + j1 += enumfacing1.func_82599_e(); BlockPos blockpos1 = new BlockPos(i3, j2, j1); -- Material material1 = worldIn.getBlockState(blockpos1).getBlock().getMaterial(); -+ block = worldIn.getBlockState(blockpos1).getBlock(); +- Material material1 = p_180709_1_.func_180495_p(blockpos1).func_177230_c().func_149688_o(); ++ block = p_180709_1_.func_180495_p(blockpos1).func_177230_c(); -- if (material1 == Material.air || material1 == Material.leaves) -+ if (block.isAir(worldIn, blockpos2) || block.isLeaves(worldIn, blockpos2)) +- if (material1 == Material.field_151579_a || material1 == Material.field_151584_j) ++ if (block.isAir(p_180709_1_, blockpos2) || block.isLeaves(p_180709_1_, blockpos2)) { - this.func_181642_b(worldIn, blockpos1); + this.func_181642_b(p_180709_1_, blockpos1); k1 = j2; @@ -209,9 +211,9 @@ - private void func_175924_b(World worldIn, BlockPos p_175924_2_) + private void func_175924_b(World p_175924_1_, BlockPos p_175924_2_) { -- Material material = worldIn.getBlockState(p_175924_2_).getBlock().getMaterial(); -+ Block block = worldIn.getBlockState(p_175924_2_).getBlock(); +- Material material = p_175924_1_.func_180495_p(p_175924_2_).func_177230_c().func_149688_o(); ++ Block block = p_175924_1_.func_180495_p(p_175924_2_).func_177230_c(); -- if (material == Material.air || material == Material.leaves) -+ if (block.isAir(worldIn, p_175924_2_) || block.isLeaves(worldIn, p_175924_2_)) +- if (material == Material.field_151579_a || material == Material.field_151584_j) ++ if (block.isAir(p_175924_1_, p_175924_2_) || block.isLeaves(p_175924_1_, p_175924_2_)) { - this.func_175903_a(worldIn, p_175924_2_, field_181644_b); + this.func_175903_a(p_175924_1_, p_175924_2_, field_181644_b); } 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 30cd89004..70f640f5f 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch @@ -4,28 +4,28 @@ { Block block; -- while (((block = worldIn.getBlockState(p_180709_3_).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && p_180709_3_.getY() > 0) +- while (((block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c()).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && p_180709_3_.func_177956_o() > 0) + do { -+ block = worldIn.getBlockState(p_180709_3_).getBlock(); -+ if (!block.isAir(worldIn, p_180709_3_) && !block.isLeaves(worldIn, p_180709_3_)) break; - p_180709_3_ = p_180709_3_.down(); ++ block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c(); ++ if (!block.isAir(p_180709_1_, p_180709_3_) && !block.isLeaves(p_180709_1_, p_180709_3_)) break; + p_180709_3_ = p_180709_3_.func_177977_b(); - } -+ } while (p_180709_3_.getY() > 0); ++ } while (p_180709_3_.func_177956_o() > 0); - Block block1 = worldIn.getBlockState(p_180709_3_).getBlock(); + Block block1 = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c(); -- if (block1 == Blocks.dirt || block1 == Blocks.grass) -+ if (block1.canSustainPlant(worldIn, p_180709_3_, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling))) +- if (block1 == Blocks.field_150346_d || block1 == Blocks.field_150349_c) ++ if (block1.canSustainPlant(p_180709_1_, p_180709_3_, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g))) { - p_180709_3_ = p_180709_3_.up(); - this.func_175903_a(worldIn, p_180709_3_, this.field_150527_b); + p_180709_3_ = p_180709_3_.func_177984_a(); + this.func_175903_a(p_180709_1_, p_180709_3_, this.field_150527_b); @@ -53,7 +55,7 @@ { BlockPos blockpos = new BlockPos(l, i, j1); -- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) -+ if (worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos)) +- if (!p_180709_1_.func_180495_p(blockpos).func_177230_c().func_149730_j()) ++ if (p_180709_1_.func_180495_p(blockpos).func_177230_c().canBeReplacedByLeaves(p_180709_1_, blockpos)) { - this.func_175903_a(worldIn, blockpos, this.field_150528_a); + this.func_175903_a(p_180709_1_, blockpos, 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 746094c2a..03b98a6c0 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch @@ -2,93 +2,93 @@ +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java @@ -60,7 +60,7 @@ { - Block block = worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(l, j, i1)).getBlock(); + Block block = p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)).func_177230_c(); -- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) -+ if (!block.isAir(worldIn, blockpos$mutableblockpos.func_181079_c(l, j, i1)) && !block.isLeaves(worldIn, blockpos$mutableblockpos.func_181079_c(l, j, i1))) +- if (block.func_149688_o() != Material.field_151579_a && block.func_149688_o() != Material.field_151584_j) ++ if (!block.isAir(p_180709_1_, blockpos$mutableblockpos.func_181079_c(l, j, i1)) && !block.isLeaves(p_180709_1_, blockpos$mutableblockpos.func_181079_c(l, j, i1))) { - if (block != Blocks.water && block != Blocks.flowing_water) + if (block != Blocks.field_150355_j && block != Blocks.field_150358_i) { @@ -86,11 +86,13 @@ } else { -- Block block1 = worldIn.getBlockState(p_180709_3_.down()).getBlock(); -+ BlockPos down = p_180709_3_.down(); -+ Block block1 = worldIn.getBlockState(down).getBlock(); -+ boolean isSoil = block1.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling)); +- Block block1 = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); ++ BlockPos down = p_180709_3_.func_177977_b(); ++ Block block1 = p_180709_1_.func_180495_p(down).func_177230_c(); ++ boolean isSoil = block1.canSustainPlant(p_180709_1_, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.field_150345_g)); -- if ((block1 == Blocks.grass || block1 == Blocks.dirt) && p_180709_3_.getY() < 256 - i - 1) -+ if (isSoil && p_180709_3_.getY() < 256 - i - 1) +- if ((block1 == Blocks.field_150349_c || block1 == Blocks.field_150346_d) && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (isSoil && p_180709_3_.func_177956_o() < 256 - i - 1) { -- this.func_175921_a(worldIn, p_180709_3_.down()); -+ block1.onPlantGrow(worldIn, p_180709_3_.down(),p_180709_3_); +- this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); ++ block1.onPlantGrow(p_180709_1_, p_180709_3_.func_177977_b(),p_180709_3_); - for (int l1 = p_180709_3_.getY() - 3 + i; l1 <= p_180709_3_.getY() + i; ++l1) + for (int l1 = p_180709_3_.func_177956_o() - 3 + i; l1 <= p_180709_3_.func_177956_o() + i; ++l1) { @@ -109,7 +111,7 @@ { BlockPos blockpos = new BlockPos(k3, l1, j1); -- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) -+ if (worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos)) +- if (!p_180709_1_.func_180495_p(blockpos).func_177230_c().func_149730_j()) ++ if (p_180709_1_.func_180495_p(blockpos).func_177230_c().canBeReplacedByLeaves(p_180709_1_, blockpos)) { - this.func_175903_a(worldIn, blockpos, field_181649_b); + this.func_175903_a(p_180709_1_, blockpos, field_181649_b); } @@ -120,9 +122,10 @@ for (int i2 = 0; i2 < i; ++i2) { -- Block block2 = worldIn.getBlockState(p_180709_3_.up(i2)).getBlock(); -+ BlockPos upN = p_180709_3_.up(i2); -+ Block block2 = worldIn.getBlockState(upN).getBlock(); +- Block block2 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(i2)).func_177230_c(); ++ BlockPos upN = p_180709_3_.func_177981_b(i2); ++ Block block2 = p_180709_1_.func_180495_p(upN).func_177230_c(); -- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves || block2 == Blocks.flowing_water || block2 == Blocks.water) -+ if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN) || block2 == Blocks.flowing_water || block2 == Blocks.water) +- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j || block2 == Blocks.field_150358_i || block2 == Blocks.field_150355_j) ++ if (block2.isAir(p_180709_1_, upN) || block2.isLeaves(p_180709_1_, upN) || block2 == Blocks.field_150358_i || block2 == Blocks.field_150355_j) { - this.func_175903_a(worldIn, p_180709_3_.up(i2), field_181648_a); + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(i2), field_181648_a); } @@ -140,29 +143,29 @@ { blockpos$mutableblockpos1.func_181079_c(i4, j2, j4); -- if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().getMaterial() == Material.leaves) -+ if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().isLeaves(worldIn, blockpos$mutableblockpos1)) +- if (p_180709_1_.func_180495_p(blockpos$mutableblockpos1).func_177230_c().func_149688_o() == Material.field_151584_j) ++ if (p_180709_1_.func_180495_p(blockpos$mutableblockpos1).func_177230_c().isLeaves(p_180709_1_, blockpos$mutableblockpos1)) { - BlockPos blockpos3 = blockpos$mutableblockpos1.west(); - BlockPos blockpos4 = blockpos$mutableblockpos1.east(); - BlockPos blockpos1 = blockpos$mutableblockpos1.north(); - BlockPos blockpos2 = blockpos$mutableblockpos1.south(); + BlockPos blockpos3 = blockpos$mutableblockpos1.func_177976_e(); + BlockPos blockpos4 = blockpos$mutableblockpos1.func_177974_f(); + BlockPos blockpos1 = blockpos$mutableblockpos1.func_177978_c(); + BlockPos blockpos2 = blockpos$mutableblockpos1.func_177968_d(); -- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().getMaterial() == Material.air) -+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().isAir(worldIn,blockpos3)) +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos3).func_177230_c().func_149688_o() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos3).func_177230_c().isAir(p_180709_1_,blockpos3)) { - this.func_181647_a(worldIn, blockpos3, BlockVine.EAST); + this.func_181647_a(p_180709_1_, blockpos3, BlockVine.field_176278_M); } -- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().getMaterial() == Material.air) -+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().isAir(worldIn,blockpos4)) +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos4).func_177230_c().func_149688_o() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos4).func_177230_c().isAir(p_180709_1_,blockpos4)) { - this.func_181647_a(worldIn, blockpos4, BlockVine.WEST); + this.func_181647_a(p_180709_1_, blockpos4, BlockVine.field_176280_O); } -- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().getMaterial() == Material.air) -+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().isAir(worldIn,blockpos1)) +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos1).func_177230_c().func_149688_o() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos1).func_177230_c().isAir(p_180709_1_,blockpos1)) { - this.func_181647_a(worldIn, blockpos1, BlockVine.SOUTH); + this.func_181647_a(p_180709_1_, blockpos1, BlockVine.field_176279_N); } -- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().getMaterial() == Material.air) -+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().isAir(worldIn,blockpos2)) +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos2).func_177230_c().func_149688_o() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos2).func_177230_c().isAir(p_180709_1_,blockpos2)) { - this.func_181647_a(worldIn, blockpos2, BlockVine.NORTH); + this.func_181647_a(p_180709_1_, blockpos2, BlockVine.field_176273_b); } @@ -191,7 +194,7 @@ this.func_175903_a(p_181647_1_, p_181647_2_, iblockstate); int i = 4; -- for (p_181647_2_ = p_181647_2_.down(); p_181647_1_.getBlockState(p_181647_2_).getBlock().getMaterial() == Material.air && i > 0; --i) -+ for (p_181647_2_ = p_181647_2_.down(); p_181647_1_.getBlockState(p_181647_2_).getBlock().isAir(p_181647_1_,p_181647_2_) && i > 0; --i) +- for (p_181647_2_ = p_181647_2_.func_177977_b(); p_181647_1_.func_180495_p(p_181647_2_).func_177230_c().func_149688_o() == Material.field_151579_a && i > 0; --i) ++ for (p_181647_2_ = p_181647_2_.func_177977_b(); p_181647_1_.func_180495_p(p_181647_2_).func_177230_c().isAir(p_181647_1_,p_181647_2_) && i > 0; --i) { this.func_175903_a(p_181647_1_, p_181647_2_, iblockstate); - p_181647_2_ = p_181647_2_.down(); + p_181647_2_ = p_181647_2_.func_177977_b(); 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 22900fea0..0303f2295 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch @@ -4,8 +4,8 @@ { if (i1 >= 0 && i1 < 256) { -- if (!this.func_150523_a(worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, i1, l1)).getBlock())) -+ if (!this.isReplaceable(worldIn,blockpos$mutableblockpos.func_181079_c(k1, i1, l1))) +- if (!this.func_150523_a(p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k1, i1, l1)).func_177230_c())) ++ if (!this.isReplaceable(p_180709_1_,blockpos$mutableblockpos.func_181079_c(k1, i1, l1))) { flag = false; } @@ -13,38 +13,38 @@ } else { -- Block block = worldIn.getBlockState(p_180709_3_.down()).getBlock(); -+ BlockPos down = p_180709_3_.down(); -+ Block block = worldIn.getBlockState(down).getBlock(); -+ boolean isSoil = block.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.sapling); +- Block block = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); ++ BlockPos down = p_180709_3_.func_177977_b(); ++ Block block = p_180709_1_.func_180495_p(down).func_177230_c(); ++ boolean isSoil = block.canSustainPlant(p_180709_1_, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.field_150345_g); -- if ((block == Blocks.grass || block == Blocks.dirt) && p_180709_3_.getY() < 256 - i - 1) -+ if (isSoil && p_180709_3_.getY() < 256 - i - 1) +- if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d) && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (isSoil && p_180709_3_.func_177956_o() < 256 - i - 1) { -- this.func_175921_a(worldIn, p_180709_3_.down()); -+ block.onPlantGrow(worldIn, down, p_180709_3_); +- this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); ++ block.onPlantGrow(p_180709_1_, down, p_180709_3_); int k2 = 0; - for (int l2 = p_180709_3_.getY() + i; l2 >= p_180709_3_.getY() + j; --l2) + for (int l2 = p_180709_3_.func_177956_o() + i; l2 >= p_180709_3_.func_177956_o() + j; --l2) @@ -93,7 +95,7 @@ { BlockPos blockpos = new BlockPos(j3, l2, i2); -- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) -+ if (!worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos)) +- if (!p_180709_1_.func_180495_p(blockpos).func_177230_c().func_149730_j()) ++ if (!p_180709_1_.func_180495_p(blockpos).func_177230_c().canBeReplacedByLeaves(p_180709_1_, blockpos)) { - this.func_175903_a(worldIn, blockpos, field_181637_b); + this.func_175903_a(p_180709_1_, blockpos, field_181637_b); } @@ -113,9 +115,10 @@ for (int i3 = 0; i3 < i - 1; ++i3) { -- Block block1 = worldIn.getBlockState(p_180709_3_.up(i3)).getBlock(); -+ BlockPos upN = p_180709_3_.up(i3); -+ Block block1 = worldIn.getBlockState(upN).getBlock(); +- Block block1 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(i3)).func_177230_c(); ++ BlockPos upN = p_180709_3_.func_177981_b(i3); ++ Block block1 = p_180709_1_.func_180495_p(upN).func_177230_c(); -- if (block1.getMaterial() == Material.air || block1.getMaterial() == Material.leaves) -+ if (block1.isAir(worldIn, upN) || block1.isLeaves(worldIn, upN)) +- if (block1.func_149688_o() == Material.field_151579_a || block1.func_149688_o() == Material.field_151584_j) ++ if (block1.isAir(p_180709_1_, upN) || block1.isLeaves(p_180709_1_, upN)) { - this.func_175903_a(worldIn, p_180709_3_.up(i3), field_181636_a); + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(i3), field_181636_a); } 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 d52f8a4e0..322b90715 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java @@ -55,7 +55,7 @@ { - Block block = worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, i1, l1)).getBlock(); + Block block = p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k1, i1, l1)).func_177230_c(); -- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) -+ if (block.isAir(worldIn, blockpos$mutableblockpos) && !block.isLeaves(worldIn, blockpos$mutableblockpos)) +- if (block.func_149688_o() != Material.field_151579_a && block.func_149688_o() != Material.field_151584_j) ++ if (block.isAir(p_180709_1_, blockpos$mutableblockpos) && !block.isLeaves(p_180709_1_, blockpos$mutableblockpos)) { flag = false; } @@ -13,16 +13,16 @@ } else { -- Block block1 = worldIn.getBlockState(p_180709_3_.down()).getBlock(); -+ BlockPos down = p_180709_3_.down(); -+ Block block1 = worldIn.getBlockState(down).getBlock(); -+ boolean isSoil = block1.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.sapling); +- Block block1 = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); ++ BlockPos down = p_180709_3_.func_177977_b(); ++ Block block1 = p_180709_1_.func_180495_p(down).func_177230_c(); ++ boolean isSoil = block1.canSustainPlant(p_180709_1_, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.field_150345_g); -- if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && p_180709_3_.getY() < 256 - i - 1) -+ if (isSoil && p_180709_3_.getY() < 256 - i - 1) +- if ((block1 == Blocks.field_150349_c || block1 == Blocks.field_150346_d || block1 == Blocks.field_150458_ak) && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (isSoil && p_180709_3_.func_177956_o() < 256 - i - 1) { -- this.func_175921_a(worldIn, p_180709_3_.down()); -+ block1.onPlantGrow(worldIn, down, p_180709_3_); +- this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); ++ block1.onPlantGrow(p_180709_1_, down, p_180709_3_); int i3 = p_180709_2_.nextInt(2); int j3 = 1; int k3 = 0; @@ -30,21 +30,21 @@ { BlockPos blockpos = new BlockPos(i2, j4, k2); -- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) -+ if (worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos)) +- if (!p_180709_1_.func_180495_p(blockpos).func_177230_c().func_149730_j()) ++ if (p_180709_1_.func_180495_p(blockpos).func_177230_c().canBeReplacedByLeaves(p_180709_1_, blockpos)) { - this.func_175903_a(worldIn, blockpos, field_181646_b); + this.func_175903_a(p_180709_1_, blockpos, field_181646_b); } @@ -128,9 +130,10 @@ for (int k4 = 0; k4 < i - i4; ++k4) { -- Block block2 = worldIn.getBlockState(p_180709_3_.up(k4)).getBlock(); -+ BlockPos upN = p_180709_3_.up(k4); -+ Block block2 = worldIn.getBlockState(upN).getBlock(); +- Block block2 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(k4)).func_177230_c(); ++ BlockPos upN = p_180709_3_.func_177981_b(k4); ++ Block block2 = p_180709_1_.func_180495_p(upN).func_177230_c(); -- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves) -+ if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN)) +- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j) ++ if (block2.isAir(p_180709_1_, upN) || block2.isLeaves(p_180709_1_, upN)) { - this.func_175903_a(worldIn, p_180709_3_.up(k4), field_181645_a); + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(k4), field_181645_a); } 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 11a61b3ab..40233c4b2 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch @@ -4,14 +4,14 @@ { Block block; -- while (((block = worldIn.getBlockState(p_180709_3_).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && p_180709_3_.getY() > 0) +- while (((block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c()).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && p_180709_3_.func_177956_o() > 0) + do { -+ block = worldIn.getBlockState(p_180709_3_).getBlock(); -+ if (!block.isAir(worldIn, p_180709_3_) && !block.isLeaves(worldIn, p_180709_3_)) break; - p_180709_3_ = p_180709_3_.down(); ++ block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c(); ++ if (!block.isAir(p_180709_1_, p_180709_3_) && !block.isLeaves(p_180709_1_, p_180709_3_)) break; + p_180709_3_ = p_180709_3_.func_177977_b(); - } -+ } while (p_180709_3_.getY() > 0); ++ } while (p_180709_3_.func_177956_o() > 0); for (int i = 0; i < 128; ++i) { 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 50df160cc..74c9c1445 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch @@ -4,8 +4,8 @@ { if (j >= 0 && j < 256) { -- if (!this.func_150523_a(worldIn.getBlockState(blockpos$mutableblockpos.func_181079_c(l, j, i1)).getBlock())) -+ if (!this.isReplaceable(worldIn,blockpos$mutableblockpos.func_181079_c(l, j, i1))) +- if (!this.func_150523_a(p_180709_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(l, j, i1)).func_177230_c())) ++ if (!this.isReplaceable(p_180709_1_,blockpos$mutableblockpos.func_181079_c(l, j, i1))) { flag = false; } @@ -13,82 +13,82 @@ } else { -- Block block1 = worldIn.getBlockState(p_180709_3_.down()).getBlock(); -+ BlockPos down = p_180709_3_.down(); -+ Block block1 = worldIn.getBlockState(down).getBlock(); -+ boolean isSoil = block1.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.sapling); +- Block block1 = p_180709_1_.func_180495_p(p_180709_3_.func_177977_b()).func_177230_c(); ++ BlockPos down = p_180709_3_.func_177977_b(); ++ Block block1 = p_180709_1_.func_180495_p(down).func_177230_c(); ++ boolean isSoil = block1.canSustainPlant(p_180709_1_, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.field_150345_g); -- if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && p_180709_3_.getY() < 256 - i - 1) -+ if (isSoil && p_180709_3_.getY() < 256 - i - 1) +- if ((block1 == Blocks.field_150349_c || block1 == Blocks.field_150346_d || block1 == Blocks.field_150458_ak) && p_180709_3_.func_177956_o() < 256 - i - 1) ++ if (isSoil && p_180709_3_.func_177956_o() < 256 - i - 1) { -- this.func_175921_a(worldIn, p_180709_3_.down()); -+ block1.onPlantGrow(worldIn, down, p_180709_3_); +- this.func_175921_a(p_180709_1_, p_180709_3_.func_177977_b()); ++ block1.onPlantGrow(p_180709_1_, down, p_180709_3_); int k2 = 3; int l2 = 0; @@ -113,7 +115,7 @@ BlockPos blockpos = new BlockPos(k1, i3, i2); - Block block = worldIn.getBlockState(blockpos).getBlock(); + Block block = p_180709_1_.func_180495_p(blockpos).func_177230_c(); -- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves || block.getMaterial() == Material.vine) -+ if (block.isAir(worldIn, blockpos) || block.isLeaves(worldIn, blockpos) || block.getMaterial() == Material.vine) +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j || block.func_149688_o() == Material.field_151582_l) ++ if (block.isAir(p_180709_1_, blockpos) || block.isLeaves(p_180709_1_, blockpos) || block.func_149688_o() == Material.field_151582_l) { - this.func_175903_a(worldIn, blockpos, this.metaLeaves); + this.func_175903_a(p_180709_1_, blockpos, this.field_76530_d); } @@ -124,9 +126,10 @@ for (int j3 = 0; j3 < i; ++j3) { -- Block block2 = worldIn.getBlockState(p_180709_3_.up(j3)).getBlock(); -+ BlockPos upN = p_180709_3_.up(j3); -+ Block block2 = worldIn.getBlockState(upN).getBlock(); +- Block block2 = p_180709_1_.func_180495_p(p_180709_3_.func_177981_b(j3)).func_177230_c(); ++ BlockPos upN = p_180709_3_.func_177981_b(j3); ++ Block block2 = p_180709_1_.func_180495_p(upN).func_177230_c(); -- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves || block2.getMaterial() == Material.vine) -+ if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN) || block2.getMaterial() == Material.vine) +- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j || block2.func_149688_o() == Material.field_151582_l) ++ if (block2.isAir(p_180709_1_, upN) || block2.isLeaves(p_180709_1_, upN) || block2.func_149688_o() == Material.field_151582_l) { - this.func_175903_a(worldIn, p_180709_3_.up(j3), this.metaWood); + this.func_175903_a(p_180709_1_, p_180709_3_.func_177981_b(j3), this.field_76532_c); @@ -169,29 +172,29 @@ { blockpos$mutableblockpos1.func_181079_c(l4, k3, i5); -- if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().getMaterial() == Material.leaves) -+ if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().isLeaves(worldIn,blockpos$mutableblockpos1)) +- if (p_180709_1_.func_180495_p(blockpos$mutableblockpos1).func_177230_c().func_149688_o() == Material.field_151584_j) ++ if (p_180709_1_.func_180495_p(blockpos$mutableblockpos1).func_177230_c().isLeaves(p_180709_1_,blockpos$mutableblockpos1)) { - BlockPos blockpos2 = blockpos$mutableblockpos1.west(); - BlockPos blockpos3 = blockpos$mutableblockpos1.east(); - BlockPos blockpos4 = blockpos$mutableblockpos1.north(); - BlockPos blockpos1 = blockpos$mutableblockpos1.south(); + BlockPos blockpos2 = blockpos$mutableblockpos1.func_177976_e(); + BlockPos blockpos3 = blockpos$mutableblockpos1.func_177974_f(); + BlockPos blockpos4 = blockpos$mutableblockpos1.func_177978_c(); + BlockPos blockpos1 = blockpos$mutableblockpos1.func_177968_d(); -- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().getMaterial() == Material.air) -+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().isAir(worldIn,blockpos2)) +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos2).func_177230_c().func_149688_o() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos2).func_177230_c().isAir(p_180709_1_,blockpos2)) { - this.func_181650_b(worldIn, blockpos2, BlockVine.EAST); + this.func_181650_b(p_180709_1_, blockpos2, BlockVine.field_176278_M); } -- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().getMaterial() == Material.air) -+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().isAir(worldIn,blockpos3)) +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos3).func_177230_c().func_149688_o() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos3).func_177230_c().isAir(p_180709_1_,blockpos3)) { - this.func_181650_b(worldIn, blockpos3, BlockVine.WEST); + this.func_181650_b(p_180709_1_, blockpos3, BlockVine.field_176280_O); } -- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().getMaterial() == Material.air) -+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().isAir(worldIn,blockpos4)) +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos4).func_177230_c().func_149688_o() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos4).func_177230_c().isAir(p_180709_1_,blockpos4)) { - this.func_181650_b(worldIn, blockpos4, BlockVine.SOUTH); + this.func_181650_b(p_180709_1_, blockpos4, BlockVine.field_176279_N); } -- if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().getMaterial() == Material.air) -+ if (p_180709_2_.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().isAir(worldIn,blockpos1)) +- if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos1).func_177230_c().func_149688_o() == Material.field_151579_a) ++ if (p_180709_2_.nextInt(4) == 0 && p_180709_1_.func_180495_p(blockpos1).func_177230_c().isAir(p_180709_1_,blockpos1)) { - this.func_181650_b(worldIn, blockpos1, BlockVine.NORTH); + this.func_181650_b(p_180709_1_, blockpos1, BlockVine.field_176273_b); } @@ -245,7 +248,7 @@ this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_); int i = 4; -- for (p_181650_2_ = p_181650_2_.down(); p_181650_1_.getBlockState(p_181650_2_).getBlock().getMaterial() == Material.air && i > 0; --i) -+ for (p_181650_2_ = p_181650_2_.down(); p_181650_1_.getBlockState(p_181650_2_).getBlock().isAir(p_181650_1_,p_181650_2_) && i > 0; --i) +- for (p_181650_2_ = p_181650_2_.func_177977_b(); p_181650_1_.func_180495_p(p_181650_2_).func_177230_c().func_149688_o() == Material.field_151579_a && i > 0; --i) ++ for (p_181650_2_ = p_181650_2_.func_177977_b(); p_181650_1_.func_180495_p(p_181650_2_).func_177230_c().isAir(p_181650_1_,p_181650_2_) && i > 0; --i) { this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_); - p_181650_2_ = p_181650_2_.down(); + p_181650_2_ = p_181650_2_.func_177977_b(); 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 3eba1fe80..79027d1db 100644 --- a/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch @@ -4,14 +4,14 @@ { Block block; -- while (((block = worldIn.getBlockState(p_180709_3_).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && p_180709_3_.getY() > 1) +- while (((block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c()).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && p_180709_3_.func_177956_o() > 1) + do { -+ block = worldIn.getBlockState(p_180709_3_).getBlock(); -+ if (!block.isAir(worldIn, p_180709_3_) && !block.isLeaves(worldIn, p_180709_3_)) break; - p_180709_3_ = p_180709_3_.down(); ++ block = p_180709_1_.func_180495_p(p_180709_3_).func_177230_c(); ++ if (!block.isAir(p_180709_1_, p_180709_3_) && !block.isLeaves(p_180709_1_, p_180709_3_)) break; + p_180709_3_ = p_180709_3_.func_177977_b(); - } -+ } while (p_180709_3_.getY() > 0); ++ } while (p_180709_3_.func_177956_o() > 0); - if (p_180709_3_.getY() < 1) + if (p_180709_3_.func_177956_o() < 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 e3a76dd0b..39466c0ff 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch @@ -6,42 +6,42 @@ + i = getModdedBiomeSize(p_180781_2_, j); + - GenLayer lvt_8_1_ = GenLayerZoom.magnify(1000L, genlayer4, 0); + GenLayer lvt_8_1_ = GenLayerZoom.func_75915_a(1000L, genlayer4, 0); GenLayerRiverInit genlayerriverinit = new GenLayerRiverInit(100L, lvt_8_1_); - GenLayerBiome lvt_9_1_ = new GenLayerBiome(200L, genlayer4, p_180781_2_, p_180781_3_); -- GenLayer genlayer6 = GenLayerZoom.magnify(1000L, lvt_9_1_, 2); +- GenLayer genlayer6 = GenLayerZoom.func_75915_a(1000L, lvt_9_1_, 2); - GenLayerBiomeEdge genlayerbiomeedge = new GenLayerBiomeEdge(1000L, genlayer6); - GenLayer lvt_10_1_ = GenLayerZoom.magnify(1000L, genlayerriverinit, 2); + GenLayer lvt_10_1_ = GenLayerZoom.func_75915_a(1000L, genlayerriverinit, 2); + GenLayer genlayerbiomeedge = p_180781_2_.getBiomeLayer(p_180781_0_, genlayer4, p_180781_3_); GenLayer genlayerhills = new GenLayerHills(1000L, genlayerbiomeedge, lvt_10_1_); - GenLayer genlayer5 = GenLayerZoom.magnify(1000L, genlayerriverinit, 2); - genlayer5 = GenLayerZoom.magnify(1000L, genlayer5, j); + GenLayer genlayer5 = GenLayerZoom.func_75915_a(1000L, genlayerriverinit, 2); + genlayer5 = GenLayerZoom.func_75915_a(1000L, genlayer5, j); @@ -191,7 +191,7 @@ - protected static boolean isBiomeOceanic(int p_151618_0_) + protected static boolean func_151618_b(int p_151618_0_) { -- return p_151618_0_ == BiomeGenBase.ocean.biomeID || p_151618_0_ == BiomeGenBase.deepOcean.biomeID || p_151618_0_ == BiomeGenBase.frozenOcean.biomeID; -+ return net.minecraftforge.common.BiomeManager.oceanBiomes.contains(BiomeGenBase.getBiome(p_151618_0_)); +- return p_151618_0_ == BiomeGenBase.field_76771_b.field_76756_M || p_151618_0_ == BiomeGenBase.field_150575_M.field_76756_M || p_151618_0_ == BiomeGenBase.field_76776_l.field_76756_M; ++ return net.minecraftforge.common.BiomeManager.oceanBiomes.contains(BiomeGenBase.func_150568_d(p_151618_0_)); } - protected int selectRandom(int... p_151619_1_) + protected int func_151619_a(int... p_151619_1_) @@ -203,4 +203,27 @@ { - 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_})))))))))); + 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_})))))))))); } + + /* ======================================== FORGE START =====================================*/ + protected long nextLong(long par1) + { -+ long j = (this.chunkSeed >> 24) % par1; ++ long j = (this.field_75908_c >> 24) % par1; + + if (j < 0) + { + j += par1; + } + -+ this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; -+ this.chunkSeed += this.worldGenSeed; ++ this.field_75908_c *= this.field_75908_c * 6364136223846793005L + 1442695040888963407L; ++ this.field_75908_c += this.field_75907_b; + return j; + } + diff --git a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch index 28a968bdd..5e2daee96 100644 --- a/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch @@ -4,10 +4,10 @@ public class GenLayerBiome extends GenLayer { -- private BiomeGenBase[] field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.desert, BiomeGenBase.desert, BiomeGenBase.savanna, BiomeGenBase.savanna, BiomeGenBase.plains}; -- private BiomeGenBase[] field_151621_d = new BiomeGenBase[] {BiomeGenBase.forest, BiomeGenBase.roofedForest, BiomeGenBase.extremeHills, BiomeGenBase.plains, BiomeGenBase.birchForest, BiomeGenBase.swampland}; -- private BiomeGenBase[] field_151622_e = new BiomeGenBase[] {BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.taiga, BiomeGenBase.plains}; -- private BiomeGenBase[] field_151620_f = new BiomeGenBase[] {BiomeGenBase.icePlains, BiomeGenBase.icePlains, BiomeGenBase.icePlains, BiomeGenBase.coldTaiga}; +- private BiomeGenBase[] field_151623_c = new BiomeGenBase[] {BiomeGenBase.field_76769_d, BiomeGenBase.field_76769_d, BiomeGenBase.field_76769_d, BiomeGenBase.field_150588_X, BiomeGenBase.field_150588_X, BiomeGenBase.field_76772_c}; +- private BiomeGenBase[] field_151621_d = new BiomeGenBase[] {BiomeGenBase.field_76767_f, BiomeGenBase.field_150585_R, BiomeGenBase.field_76770_e, BiomeGenBase.field_76772_c, BiomeGenBase.field_150583_P, BiomeGenBase.field_76780_h}; +- private BiomeGenBase[] field_151622_e = new BiomeGenBase[] {BiomeGenBase.field_76767_f, BiomeGenBase.field_76770_e, BiomeGenBase.field_76768_g, BiomeGenBase.field_76772_c}; +- private BiomeGenBase[] field_151620_f = new BiomeGenBase[] {BiomeGenBase.field_76774_n, BiomeGenBase.field_76774_n, BiomeGenBase.field_76774_n, BiomeGenBase.field_150584_S}; + @SuppressWarnings("unchecked") + private java.util.List[] biomes = new java.util.ArrayList[net.minecraftforge.common.BiomeManager.BiomeType.values().length]; + @@ -16,7 +16,7 @@ public GenLayerBiome(long p_i45560_1_, GenLayer p_i45560_3_, WorldType p_i45560_4_, String p_i45560_5_) @@ -17,9 +16,30 @@ super(p_i45560_1_); - this.parent = p_i45560_3_; + this.field_75909_a = p_i45560_3_; + for (net.minecraftforge.common.BiomeManager.BiomeType type : net.minecraftforge.common.BiomeManager.BiomeType.values()) + { @@ -29,29 +29,29 @@ + + int desertIdx = net.minecraftforge.common.BiomeManager.BiomeType.DESERT.ordinal(); + -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.desert, 30)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.savanna, 20)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.plains, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_76769_d, 30)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_150588_X, 20)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_76772_c, 10)); + - if (p_i45560_4_ == WorldType.DEFAULT_1_1) + if (p_i45560_4_ == WorldType.field_77136_e) { -- this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga}; +- this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.field_76769_d, BiomeGenBase.field_76767_f, BiomeGenBase.field_76770_e, BiomeGenBase.field_76780_h, BiomeGenBase.field_76772_c, BiomeGenBase.field_76768_g}; + biomes[desertIdx].clear(); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.desert, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.forest, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.extremeHills, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.swampland, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.plains, 10)); -+ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.taiga, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_76769_d, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_76767_f, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_76770_e, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_76780_h, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_76772_c, 10)); ++ biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(BiomeGenBase.field_76768_g, 10)); this.field_175973_g = null; } - else if (p_i45560_4_ == WorldType.CUSTOMIZED) + else if (p_i45560_4_ == WorldType.field_180271_f) @@ -73,7 +93,7 @@ } else { -- aint1[j + i * areaWidth] = this.field_151623_c[this.nextInt(this.field_151623_c.length)].biomeID; -+ aint1[j + i * areaWidth] = getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.DESERT).biome.biomeID; +- aint1[j + i * p_75904_3_] = this.field_151623_c[this.func_75902_a(this.field_151623_c.length)].field_76756_M; ++ aint1[j + i * p_75904_3_] = getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.DESERT).biome.field_76756_M; } } else if (k == 2) @@ -59,8 +59,8 @@ } else { -- aint1[j + i * areaWidth] = this.field_151621_d[this.nextInt(this.field_151621_d.length)].biomeID; -+ aint1[j + i * areaWidth] = getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.WARM).biome.biomeID; +- aint1[j + i * p_75904_3_] = this.field_151621_d[this.func_75902_a(this.field_151621_d.length)].field_76756_M; ++ aint1[j + i * p_75904_3_] = getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.WARM).biome.field_76756_M; } } else if (k == 3) @@ -68,14 +68,14 @@ } else { -- aint1[j + i * areaWidth] = this.field_151622_e[this.nextInt(this.field_151622_e.length)].biomeID; -+ aint1[j + i * areaWidth] = getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.COOL).biome.biomeID; +- aint1[j + i * p_75904_3_] = this.field_151622_e[this.func_75902_a(this.field_151622_e.length)].field_76756_M; ++ aint1[j + i * p_75904_3_] = getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.COOL).biome.field_76756_M; } } else if (k == 4) { -- aint1[j + i * areaWidth] = this.field_151620_f[this.nextInt(this.field_151620_f.length)].biomeID; -+ aint1[j + i * areaWidth] = getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.ICY).biome.biomeID; +- aint1[j + i * p_75904_3_] = this.field_151620_f[this.func_75902_a(this.field_151620_f.length)].field_76756_M; ++ aint1[j + i * p_75904_3_] = getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.ICY).biome.field_76756_M; } else { @@ -87,8 +87,8 @@ + protected net.minecraftforge.common.BiomeManager.BiomeEntry getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType type) + { + java.util.List biomeList = biomes[type.ordinal()]; -+ int totalWeight = net.minecraft.util.WeightedRandom.getTotalWeight(biomeList); -+ int weight = net.minecraftforge.common.BiomeManager.isTypeListModded(type)?nextInt(totalWeight):nextInt(totalWeight / 10) * 10; -+ return (net.minecraftforge.common.BiomeManager.BiomeEntry)net.minecraft.util.WeightedRandom.getRandomItem(biomeList, weight); ++ int totalWeight = net.minecraft.util.WeightedRandom.func_76272_a(biomeList); ++ int weight = net.minecraftforge.common.BiomeManager.isTypeListModded(type)?func_75902_a(totalWeight):func_75902_a(totalWeight / 10) * 10; ++ return (net.minecraftforge.common.BiomeManager.BiomeEntry)net.minecraft.util.WeightedRandom.func_180166_a(biomeList, weight); + } } 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 8d5ce18f2..a1ba80289 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch @@ -6,8 +6,8 @@ + static + { -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST, itemsToGenerateInTemple, 2, 7); -+ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.enchanted_book, 1, 0), 1, 1, 1)); ++ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST, field_74941_i, 2, 7); ++ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.field_151134_bR, 1, 0), 1, 1, 1)); + } + public DesertPyramid(Random p_i2062_1_, int p_i2062_2_, int p_i2062_3_) @@ -15,65 +15,65 @@ super(p_i2062_1_, p_i2062_2_, 64, p_i2062_3_, 21, 15, 21); @@ -258,7 +264,7 @@ { - int l1 = enumfacing.getFrontOffsetX() * 2; - int i2 = enumfacing.getFrontOffsetZ() * 2; -- this.field_74940_h[enumfacing.getHorizontalIndex()] = this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 10 + l1, -11, 10 + i2, WeightedRandomChestContent.func_177629_a(itemsToGenerateInTemple, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(p_74875_2_)}), 2 + p_74875_2_.nextInt(5)); -+ this.field_74940_h[enumfacing.getHorizontalIndex()] = this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 10 + l1, -11, 10 + i2, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST, p_74875_2_)); + int l1 = enumfacing.func_82601_c() * 2; + int i2 = enumfacing.func_82599_e() * 2; +- this.field_74940_h[enumfacing.func_176736_b()] = this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 10 + l1, -11, 10 + i2, WeightedRandomChestContent.func_177629_a(field_74941_i, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 2 + p_74875_2_.nextInt(5)); ++ this.field_74940_h[enumfacing.func_176736_b()] = this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 10 + l1, -11, 10 + i2, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST, p_74875_2_)); } } @@ -362,6 +368,13 @@ - private static final List field_175815_j = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.arrow, 0, 2, 7, 30)}); - private static ComponentScatteredFeaturePieces.JunglePyramid.Stones junglePyramidsRandomScatteredStones = new ComponentScatteredFeaturePieces.JunglePyramid.Stones(); + private static final List field_175815_j = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.field_151032_g, 0, 2, 7, 30)}); + private static ComponentScatteredFeaturePieces.JunglePyramid.Stones field_74942_n = new ComponentScatteredFeaturePieces.JunglePyramid.Stones(); + static + { + net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_DISPENSER, field_175815_j, 2, 2); + net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST, field_175816_i, 2, 7); -+ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.enchanted_book, 1, 0), 1, 1, 1)); ++ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.field_151134_bR, 1, 0), 1, 1, 1)); + } + public JunglePyramid() { } @@ -518,9 +531,12 @@ - this.func_175811_a(worldIn, Blocks.redstone_wire.getDefaultState(), 4, -3, 1, p_74875_3_); - this.func_175811_a(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 3, -3, 1, p_74875_3_); + this.func_175811_a(p_74875_1_, Blocks.field_150488_af.func_176223_P(), 4, -3, 1, p_74875_3_); + this.func_175811_a(p_74875_1_, Blocks.field_150341_Y.func_176223_P(), 3, -3, 1, p_74875_3_); + net.minecraftforge.common.ChestGenHooks dispenser = net.minecraftforge.common.ChestGenHooks.getInfo(net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_DISPENSER); + net.minecraftforge.common.ChestGenHooks chest = net.minecraftforge.common.ChestGenHooks.getInfo(net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST); + if (!this.field_74945_j) { -- this.field_74945_j = this.func_175806_a(worldIn, p_74875_3_, p_74875_2_, 3, -2, 1, EnumFacing.NORTH.getIndex(), field_175815_j, 2); -+ this.field_74945_j = this.func_175806_a(worldIn, p_74875_3_, p_74875_2_, 3, -2, 1, EnumFacing.NORTH.getIndex(), dispenser.getItems(p_74875_2_), dispenser.getCount(p_74875_2_)); +- this.field_74945_j = this.func_175806_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, -2, 1, EnumFacing.NORTH.func_176745_a(), field_175815_j, 2); ++ this.field_74945_j = this.func_175806_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, -2, 1, EnumFacing.NORTH.func_176745_a(), dispenser.getItems(p_74875_2_), dispenser.getCount(p_74875_2_)); } - this.func_175811_a(worldIn, Blocks.vine.getStateFromMeta(15), 3, -2, 2, p_74875_3_); + this.func_175811_a(p_74875_1_, Blocks.field_150395_bd.func_176203_a(15), 3, -2, 2, p_74875_3_); @@ -537,7 +553,7 @@ if (!this.field_74946_k) { -- this.field_74946_k = this.func_175806_a(worldIn, p_74875_3_, p_74875_2_, 9, -2, 3, EnumFacing.WEST.getIndex(), field_175815_j, 2); -+ this.field_74946_k = this.func_175806_a(worldIn, p_74875_3_, p_74875_2_, 9, -2, 3, EnumFacing.WEST.getIndex(), dispenser.getItems(p_74875_2_), dispenser.getCount(p_74875_2_)); +- this.field_74946_k = this.func_175806_a(p_74875_1_, p_74875_3_, p_74875_2_, 9, -2, 3, EnumFacing.WEST.func_176745_a(), field_175815_j, 2); ++ this.field_74946_k = this.func_175806_a(p_74875_1_, p_74875_3_, p_74875_2_, 9, -2, 3, EnumFacing.WEST.func_176745_a(), dispenser.getItems(p_74875_2_), dispenser.getCount(p_74875_2_)); } - this.func_175811_a(worldIn, Blocks.vine.getStateFromMeta(15), 8, -1, 3, p_74875_3_); + this.func_175811_a(p_74875_1_, Blocks.field_150395_bd.func_176203_a(15), 8, -1, 3, p_74875_3_); @@ -545,7 +561,7 @@ if (!this.field_74947_h) { -- this.field_74947_h = this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 8, -3, 3, WeightedRandomChestContent.func_177629_a(field_175816_i, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(p_74875_2_)}), 2 + p_74875_2_.nextInt(5)); -+ this.field_74947_h = this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 8, -3, 3, chest.getItems(p_74875_2_), chest.getCount(p_74875_2_)); +- this.field_74947_h = this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 8, -3, 3, WeightedRandomChestContent.func_177629_a(field_175816_i, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 2 + p_74875_2_.nextInt(5)); ++ this.field_74947_h = this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 8, -3, 3, chest.getItems(p_74875_2_), chest.getCount(p_74875_2_)); } - this.func_175811_a(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 9, -3, 2, p_74875_3_); + this.func_175811_a(p_74875_1_, Blocks.field_150341_Y.func_176223_P(), 9, -3, 2, p_74875_3_); @@ -578,7 +594,7 @@ if (!this.field_74948_i) { -- this.field_74948_i = this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 9, -3, 10, WeightedRandomChestContent.func_177629_a(field_175816_i, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(p_74875_2_)}), 2 + p_74875_2_.nextInt(5)); -+ this.field_74948_i = this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 9, -3, 10, chest.getItems(p_74875_2_), chest.getCount(p_74875_2_)); +- this.field_74948_i = this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 9, -3, 10, WeightedRandomChestContent.func_177629_a(field_175816_i, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 2 + p_74875_2_.nextInt(5)); ++ this.field_74948_i = this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 9, -3, 10, chest.getItems(p_74875_2_), chest.getCount(p_74875_2_)); } return true; 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 d64cd4400..a296c5436 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch @@ -2,10 +2,10 @@ +++ ../src-work/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java @@ -28,11 +28,18 @@ - for (BiomeGenBase biomegenbase : BiomeGenBase.getBiomeGenArray()) + for (BiomeGenBase biomegenbase : BiomeGenBase.func_150565_n()) { -- if (biomegenbase != null && biomegenbase.minHeight > 0.0F) -+ if (biomegenbase != null && biomegenbase.minHeight > 0.0F && !net.minecraftforge.common.BiomeManager.strongHoldBiomesBlackList.contains(biomegenbase)) +- if (biomegenbase != null && biomegenbase.field_76748_D > 0.0F) ++ if (biomegenbase != null && biomegenbase.field_76748_D > 0.0F && !net.minecraftforge.common.BiomeManager.strongHoldBiomesBlackList.contains(biomegenbase)) { this.field_151546_e.add(biomegenbase); } diff --git a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch index c2d5ed167..f97b0ccc3 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java.patch @@ -4,14 +4,14 @@ { if (this.field_143029_e == null) { -- this.field_143029_e = (MapGenStructureData)worldIn.loadItemData(MapGenStructureData.class, this.getStructureName()); -+ this.field_143029_e = (MapGenStructureData)worldIn.getPerWorldStorage().loadData(MapGenStructureData.class, this.getStructureName()); +- this.field_143029_e = (MapGenStructureData)p_143027_1_.func_72943_a(MapGenStructureData.class, this.func_143025_a()); ++ this.field_143029_e = (MapGenStructureData)p_143027_1_.getPerWorldStorage().func_75742_a(MapGenStructureData.class, this.func_143025_a()); if (this.field_143029_e == null) { - this.field_143029_e = new MapGenStructureData(this.getStructureName()); -- worldIn.setItemData(this.getStructureName(), this.field_143029_e); -+ worldIn.getPerWorldStorage().setData(this.getStructureName(), this.field_143029_e); + this.field_143029_e = new MapGenStructureData(this.func_143025_a()); +- p_143027_1_.func_72823_a(this.func_143025_a(), this.field_143029_e); ++ p_143027_1_.getPerWorldStorage().func_75745_a(this.func_143025_a(), this.field_143029_e); } else { diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch index 9f41e1cad..8c525a612 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureComponent.java.patch @@ -9,5 +9,5 @@ + throw new RuntimeException("StructureComponent \"" + this.getClass().getName() + "\" missing ID Mapping, Modder see MapGenStructureIO"); + } NBTTagCompound nbttagcompound = new NBTTagCompound(); - nbttagcompound.setString("id", MapGenStructureIO.func_143036_a(this)); - nbttagcompound.setTag("BB", this.boundingBox.func_151535_h()); + nbttagcompound.func_74778_a("id", MapGenStructureIO.func_143036_a(this)); + nbttagcompound.func_74782_a("BB", this.field_74887_e.func_151535_h()); diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch index 0c563bb50..3a37d8b4c 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch @@ -1,33 +1,33 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java @@ -32,6 +32,12 @@ - MapGenStructureIO.registerStructureComponent(StructureMineshaftPieces.Stairs.class, "MSStairs"); + MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Stairs.class, "MSStairs"); } + static + { + net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.MINESHAFT_CORRIDOR, field_175893_a, 8, 8); -+ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.MINESHAFT_CORRIDOR, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.enchanted_book, 1, 0), 1, 1, 1)); ++ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.MINESHAFT_CORRIDOR, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.field_151134_bR, 1, 0), 1, 1, 1)); + } + private static StructureComponent func_175892_a(List p_175892_0_, Random p_175892_1_, int p_175892_2_, int p_175892_3_, int p_175892_4_, EnumFacing p_175892_5_, int p_175892_6_) { int i = p_175892_1_.nextInt(100); @@ -351,14 +357,15 @@ - this.func_175809_a(worldIn, p_74875_3_, p_74875_2_, 0.05F, 1, 2, k1 - 1, Blocks.torch.getStateFromMeta(EnumFacing.UP.getIndex())); - this.func_175809_a(worldIn, p_74875_3_, p_74875_2_, 0.05F, 1, 2, k1 + 1, Blocks.torch.getStateFromMeta(EnumFacing.UP.getIndex())); + this.func_175809_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 1, 2, k1 - 1, Blocks.field_150478_aa.func_176203_a(EnumFacing.UP.func_176745_a())); + this.func_175809_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 1, 2, k1 + 1, Blocks.field_150478_aa.func_176203_a(EnumFacing.UP.func_176745_a())); + net.minecraftforge.common.ChestGenHooks info = net.minecraftforge.common.ChestGenHooks.getInfo(net.minecraftforge.common.ChestGenHooks.MINESHAFT_CORRIDOR); if (p_74875_2_.nextInt(100) == 0) { -- this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 2, 0, k1 - 1, WeightedRandomChestContent.func_177629_a(StructureMineshaftPieces.field_175893_a, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(p_74875_2_)}), 3 + p_74875_2_.nextInt(4)); -+ this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 2, 0, k1 - 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); +- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 2, 0, k1 - 1, WeightedRandomChestContent.func_177629_a(StructureMineshaftPieces.field_175893_a, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 3 + p_74875_2_.nextInt(4)); ++ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 2, 0, k1 - 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); } if (p_74875_2_.nextInt(100) == 0) { -- this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 0, 0, k1 + 1, WeightedRandomChestContent.func_177629_a(StructureMineshaftPieces.field_175893_a, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(p_74875_2_)}), 3 + p_74875_2_.nextInt(4)); -+ this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 0, 0, k1 + 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); +- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 0, 0, k1 + 1, WeightedRandomChestContent.func_177629_a(StructureMineshaftPieces.field_175893_a, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 3 + p_74875_2_.nextInt(4)); ++ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 0, 0, k1 + 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); } - if (this.hasSpiders && !this.spawnerPlaced) + if (this.field_74956_b && !this.field_74957_c) diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch index b4b94753a..8d9ab3d84 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch @@ -1,27 +1,27 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java @@ -154,7 +154,7 @@ - if (this.field_111021_b && p_74875_3_.func_175898_b(new BlockPos(this.getXWithOffset(3, 3), this.getYWithOffset(2), this.getZWithOffset(3, 3)))) + if (this.field_111021_b && p_74875_3_.func_175898_b(new BlockPos(this.func_74865_a(3, 3), this.func_74862_a(2), this.func_74873_b(3, 3)))) { this.field_111021_b = false; -- this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 3, 2, 3, field_111019_a, 2 + p_74875_2_.nextInt(4)); -+ this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 3, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, p_74875_2_)); +- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, field_111019_a, 2 + p_74875_2_.nextInt(4)); ++ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, p_74875_2_)); } - this.func_175804_a(worldIn, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.func_175804_a(p_74875_1_, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.field_150385_bj.func_176223_P(), Blocks.field_150385_bj.func_176223_P(), false); @@ -225,7 +225,7 @@ - if (this.field_111020_b && p_74875_3_.func_175898_b(new BlockPos(this.getXWithOffset(1, 3), this.getYWithOffset(2), this.getZWithOffset(1, 3)))) + if (this.field_111020_b && p_74875_3_.func_175898_b(new BlockPos(this.func_74865_a(1, 3), this.func_74862_a(2), this.func_74873_b(1, 3)))) { this.field_111020_b = false; -- this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 1, 2, 3, field_111019_a, 2 + p_74875_2_.nextInt(4)); -+ this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 1, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, p_74875_2_)); +- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 1, 2, 3, field_111019_a, 2 + p_74875_2_.nextInt(4)); ++ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 1, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, p_74875_2_)); } - this.func_175804_a(worldIn, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); + this.func_175804_a(p_74875_1_, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.field_150385_bj.func_176223_P(), Blocks.field_150385_bj.func_176223_P(), false); @@ -943,6 +943,7 @@ abstract static class Piece extends StructureComponent { - protected static final List field_111019_a = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 5), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 5), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 15), new WeightedRandomChestContent(Items.golden_sword, 0, 1, 1, 5), new WeightedRandomChestContent(Items.golden_chestplate, 0, 1, 1, 5), new WeightedRandomChestContent(Items.flint_and_steel, 0, 1, 1, 5), new WeightedRandomChestContent(Items.nether_wart, 0, 3, 7, 5), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 10), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 8), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 5), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 3), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.obsidian), 0, 2, 4, 2)}); + protected static final List field_111019_a = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.field_151045_i, 0, 1, 3, 5), new WeightedRandomChestContent(Items.field_151042_j, 0, 1, 5, 5), new WeightedRandomChestContent(Items.field_151043_k, 0, 1, 3, 15), new WeightedRandomChestContent(Items.field_151010_B, 0, 1, 1, 5), new WeightedRandomChestContent(Items.field_151171_ah, 0, 1, 1, 5), new WeightedRandomChestContent(Items.field_151033_d, 0, 1, 1, 5), new WeightedRandomChestContent(Items.field_151075_bm, 0, 3, 7, 5), new WeightedRandomChestContent(Items.field_151141_av, 0, 1, 1, 10), new WeightedRandomChestContent(Items.field_151136_bY, 0, 1, 1, 8), new WeightedRandomChestContent(Items.field_151138_bX, 0, 1, 1, 5), new WeightedRandomChestContent(Items.field_151125_bZ, 0, 1, 1, 3), new WeightedRandomChestContent(Item.func_150898_a(Blocks.field_150343_Z), 0, 2, 4, 2)}); + static { net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, field_111019_a, 2, 5); } public Piece() diff --git a/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch b/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch index da767fef7..7ff46ea18 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureStart.java.patch @@ -9,15 +9,15 @@ + throw new RuntimeException("StructureStart \"" + this.getClass().getName() + "\" missing ID Mapping, Modder see MapGenStructureIO"); + } NBTTagCompound nbttagcompound = new NBTTagCompound(); - nbttagcompound.setString("id", MapGenStructureIO.func_143033_a(this)); - nbttagcompound.setInteger("ChunkX", p_143021_1_); + nbttagcompound.func_74778_a("id", MapGenStructureIO.func_143033_a(this)); + nbttagcompound.func_74768_a("ChunkX", p_143021_1_); @@ -97,7 +101,8 @@ - for (int i = 0; i < nbttaglist.tagCount(); ++i) + for (int i = 0; i < nbttaglist.func_74745_c(); ++i) { -- this.components.add(MapGenStructureIO.func_143032_b(nbttaglist.getCompoundTagAt(i), worldIn)); -+ StructureComponent tmp = MapGenStructureIO.func_143032_b(nbttaglist.getCompoundTagAt(i), worldIn); -+ if (tmp != null) this.components.add(tmp); //Forge: Prevent NPEs further down the line when a componenet can't be loaded. +- this.field_75075_a.add(MapGenStructureIO.func_143032_b(nbttaglist.func_150305_b(i), p_143020_1_)); ++ StructureComponent tmp = MapGenStructureIO.func_143032_b(nbttaglist.func_150305_b(i), p_143020_1_); ++ if (tmp != null) this.field_75075_a.add(tmp); //Forge: Prevent NPEs further down the line when a componenet can't be loaded. } this.func_143017_b(p_143020_2_); 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 83e88c9b3..0d5ebc0bb 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch @@ -6,70 +6,70 @@ + static + { -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR, strongholdChestContents, 2, 4); -+ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.enchanted_book, 1, 0), 1, 1, 1)); ++ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR, field_75003_a, 2, 4); ++ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.field_151134_bR, 1, 0), 1, 1, 1)); + } + public ChestCorridor(int p_i45582_1_, Random p_i45582_2_, StructureBoundingBox p_i45582_3_, EnumFacing p_i45582_4_) { super(p_i45582_1_); @@ -296,7 +302,7 @@ - if (!this.hasMadeChest && p_74875_3_.func_175898_b(new BlockPos(this.getXWithOffset(3, 3), this.getYWithOffset(2), this.getZWithOffset(3, 3)))) + if (!this.field_75002_c && p_74875_3_.func_175898_b(new BlockPos(this.func_74865_a(3, 3), this.func_74862_a(2), this.func_74873_b(3, 3)))) { - this.hasMadeChest = true; -- this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 3, 2, 3, WeightedRandomChestContent.func_177629_a(strongholdChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(p_74875_2_)}), 2 + p_74875_2_.nextInt(2)); -+ this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 3, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR, p_74875_2_)); + this.field_75002_c = true; +- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, WeightedRandomChestContent.func_177629_a(field_75003_a, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 2 + p_74875_2_.nextInt(2)); ++ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR, p_74875_2_)); } return true; @@ -592,6 +598,12 @@ - private static final List strongholdLibraryChestContents = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.book, 0, 1, 3, 20), new WeightedRandomChestContent(Items.paper, 0, 2, 7, 20), new WeightedRandomChestContent(Items.map, 0, 1, 1, 1), new WeightedRandomChestContent(Items.compass, 0, 1, 1, 1)}); - private boolean isLargeRoom; + private static final List field_75007_b = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.field_151122_aG, 0, 1, 3, 20), new WeightedRandomChestContent(Items.field_151121_aF, 0, 2, 7, 20), new WeightedRandomChestContent(Items.field_151148_bJ, 0, 1, 1, 1), new WeightedRandomChestContent(Items.field_151111_aL, 0, 1, 1, 1)}); + private boolean field_75008_c; + static + { -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_LIBRARY, strongholdLibraryChestContents, 1, 5); -+ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_LIBRARY, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.enchanted_book, 1, 0), 1, 5, 2)); ++ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_LIBRARY, field_75007_b, 1, 5); ++ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_LIBRARY, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.field_151134_bR, 1, 0), 1, 5, 2)); + } + public Library() { } @@ -736,12 +748,13 @@ - this.func_175811_a(worldIn, Blocks.torch.getDefaultState(), i1, 8, j1 + 1, p_74875_3_); + this.func_175811_a(p_74875_1_, Blocks.field_150478_aa.func_176223_P(), i1, 8, j1 + 1, p_74875_3_); } -- this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 3, 3, 5, WeightedRandomChestContent.func_177629_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(p_74875_2_, 1, 5, 2)}), 1 + p_74875_2_.nextInt(4)); +- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 3, 5, WeightedRandomChestContent.func_177629_a(field_75007_b, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92112_a(p_74875_2_, 1, 5, 2)}), 1 + p_74875_2_.nextInt(4)); + net.minecraftforge.common.ChestGenHooks info = net.minecraftforge.common.ChestGenHooks.getInfo(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_LIBRARY); -+ this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 3, 3, 5, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); ++ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 3, 5, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); - if (this.isLargeRoom) + if (this.field_75008_c) { - this.func_175811_a(worldIn, Blocks.air.getDefaultState(), 12, 9, 1, p_74875_3_); -- this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 12, 8, 1, WeightedRandomChestContent.func_177629_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(p_74875_2_, 1, 5, 2)}), 1 + p_74875_2_.nextInt(4)); -+ this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 12, 8, 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); + this.func_175811_a(p_74875_1_, Blocks.field_150350_a.func_176223_P(), 12, 9, 1, p_74875_3_); +- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 12, 8, 1, WeightedRandomChestContent.func_177629_a(field_75007_b, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92112_a(p_74875_2_, 1, 5, 2)}), 1 + p_74875_2_.nextInt(4)); ++ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 12, 8, 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); } return true; @@ -1013,6 +1026,12 @@ - private static final List strongholdRoomCrossingChestContents = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5), new WeightedRandomChestContent(Items.coal, 0, 3, 8, 10), new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 1)}); - protected int roomType; + private static final List field_75014_c = Lists.newArrayList(new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.field_151042_j, 0, 1, 5, 10), new WeightedRandomChestContent(Items.field_151043_k, 0, 1, 3, 5), new WeightedRandomChestContent(Items.field_151137_ax, 0, 4, 9, 5), new WeightedRandomChestContent(Items.field_151044_h, 0, 3, 8, 10), new WeightedRandomChestContent(Items.field_151025_P, 0, 1, 3, 15), new WeightedRandomChestContent(Items.field_151034_e, 0, 1, 3, 15), new WeightedRandomChestContent(Items.field_151035_b, 0, 1, 1, 1)}); + protected int field_75013_b; + static + { -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CROSSING, strongholdRoomCrossingChestContents, 1, 5); -+ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CROSSING, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.enchanted_book, 1, 0), 1, 1, 1)); ++ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CROSSING, field_75014_c, 1, 5); ++ net.minecraftforge.common.ChestGenHooks.addItem(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CROSSING, new WeightedRandomChestContent(new net.minecraft.item.ItemStack(Items.field_151134_bR, 1, 0), 1, 1, 1)); + } + public RoomCrossing() { } @@ -1151,7 +1170,7 @@ - this.func_175811_a(worldIn, Blocks.ladder.getStateFromMeta(this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), 9, 1, 3, p_74875_3_); - this.func_175811_a(worldIn, Blocks.ladder.getStateFromMeta(this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), 9, 2, 3, p_74875_3_); - this.func_175811_a(worldIn, Blocks.ladder.getStateFromMeta(this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), 9, 3, 3, p_74875_3_); -- this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 3, 4, 8, WeightedRandomChestContent.func_177629_a(strongholdRoomCrossingChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(p_74875_2_)}), 1 + p_74875_2_.nextInt(4)); -+ this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 3, 4, 8, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CROSSING, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CROSSING, p_74875_2_)); + this.func_175811_a(p_74875_1_, Blocks.field_150468_ap.func_176203_a(this.func_151555_a(Blocks.field_150468_ap, EnumFacing.WEST.func_176745_a())), 9, 1, 3, p_74875_3_); + this.func_175811_a(p_74875_1_, Blocks.field_150468_ap.func_176203_a(this.func_151555_a(Blocks.field_150468_ap, EnumFacing.WEST.func_176745_a())), 9, 2, 3, p_74875_3_); + this.func_175811_a(p_74875_1_, Blocks.field_150468_ap.func_176203_a(this.func_151555_a(Blocks.field_150468_ap, EnumFacing.WEST.func_176745_a())), 9, 3, 3, p_74875_3_); +- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 4, 8, WeightedRandomChestContent.func_177629_a(field_75014_c, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 1 + p_74875_2_.nextInt(4)); ++ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 4, 8, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CROSSING, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CROSSING, p_74875_2_)); } return true; 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 7e6bfd221..43cc68cb1 100644 --- a/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch +++ b/patches/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch @@ -1,9 +1,9 @@ --- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java +++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java @@ -57,6 +57,7 @@ - list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Field2.class, 3, MathHelper.getRandomIntegerInRange(p_75084_0_, 2 + p_75084_1_, 4 + p_75084_1_ * 2))); - list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House2.class, 15, MathHelper.getRandomIntegerInRange(p_75084_0_, 0, 1 + p_75084_1_))); - list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House3.class, 8, MathHelper.getRandomIntegerInRange(p_75084_0_, 0 + p_75084_1_, 3 + p_75084_1_ * 2))); + list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Field2.class, 3, MathHelper.func_76136_a(p_75084_0_, 2 + p_75084_1_, 4 + p_75084_1_ * 2))); + list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House2.class, 15, MathHelper.func_76136_a(p_75084_0_, 0, 1 + p_75084_1_))); + list.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House3.class, 8, MathHelper.func_76136_a(p_75084_0_, 0 + p_75084_1_, 3 + p_75084_1_ * 2))); + net.minecraftforge.fml.common.registry.VillagerRegistry.addExtraVillageComponents(list, p_75084_0_, p_75084_1_); Iterator iterator = list.iterator(); @@ -25,23 +25,23 @@ + static + { -+ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.VILLAGE_BLACKSMITH, villageBlacksmithChestContents, 3, 8); ++ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.VILLAGE_BLACKSMITH, field_74918_a, 3, 8); + } + public House2(StructureVillagePieces.Start p_i45563_1_, int p_i45563_2_, Random p_i45563_3_, StructureBoundingBox p_i45563_4_, EnumFacing p_i45563_5_) { super(p_i45563_1_, p_i45563_2_); @@ -911,7 +921,7 @@ - if (!this.hasMadeChest && p_74875_3_.func_175898_b(new BlockPos(this.getXWithOffset(5, 5), this.getYWithOffset(1), this.getZWithOffset(5, 5)))) + if (!this.field_74917_c && p_74875_3_.func_175898_b(new BlockPos(this.func_74865_a(5, 5), this.func_74862_a(1), this.func_74873_b(5, 5)))) { - this.hasMadeChest = true; -- this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 5, 1, 5, villageBlacksmithChestContents, 3 + p_74875_2_.nextInt(6)); -+ this.func_180778_a(worldIn, p_74875_3_, p_74875_2_, 5, 1, 5, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.VILLAGE_BLACKSMITH, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.VILLAGE_BLACKSMITH, p_74875_2_)); + this.field_74917_c = true; +- this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 5, 1, 5, field_74918_a, 3 + p_74875_2_.nextInt(6)); ++ this.func_180778_a(p_74875_1_, p_74875_3_, p_74875_2_, 5, 1, 5, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.VILLAGE_BLACKSMITH, p_74875_2_), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.VILLAGE_BLACKSMITH, p_74875_2_)); } for (int i = 6; i <= 8; ++i) @@ -1403,6 +1413,7 @@ - public List structureVillageWeightedPieceList; + public List field_74931_h; public List field_74932_i = Lists.newArrayList(); public List field_74930_j = Lists.newArrayList(); + public BiomeGenBase biome; @@ -49,16 +49,16 @@ public Start() { @@ -1416,6 +1427,7 @@ - this.terrainType = p_i2104_7_; + this.field_74928_c = p_i2104_7_; BiomeGenBase biomegenbase = p_i2104_1_.func_180300_a(new BlockPos(p_i2104_4_, 0, p_i2104_5_), BiomeGenBase.field_180279_ad); - this.inDesert = biomegenbase == BiomeGenBase.desert || biomegenbase == BiomeGenBase.desertHills; + this.field_74927_b = biomegenbase == BiomeGenBase.field_76769_d || biomegenbase == BiomeGenBase.field_76786_s; + this.biome = biomegenbase; - this.func_175846_a(this.inDesert); + this.func_175846_a(this.field_74927_b); } @@ -1477,6 +1489,7 @@ protected int field_143015_k = -1; - private int villagersSpawned; + private int field_74896_a; private boolean field_143014_b; + private StructureVillagePieces.Start startPiece; @@ -67,7 +67,7 @@ @@ -1489,6 +1502,7 @@ if (p_i2107_1_ != null) { - this.field_143014_b = p_i2107_1_.inDesert; + this.field_143014_b = p_i2107_1_.field_74927_b; + startPiece = p_i2107_1_; } } @@ -81,4 +81,4 @@ + if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.replacement; if (this.field_143014_b) { - if (p_175847_1_.getBlock() == Blocks.log || p_175847_1_.getBlock() == Blocks.log2) + if (p_175847_1_.func_177230_c() == Blocks.field_150364_r || p_175847_1_.func_177230_c() == Blocks.field_150363_s) diff --git a/patches/minecraft/net/minecraft/world/storage/MapData.java.patch b/patches/minecraft/net/minecraft/world/storage/MapData.java.patch index ab579d3d1..4bddcf6da 100644 --- a/patches/minecraft/net/minecraft/world/storage/MapData.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/MapData.java.patch @@ -2,47 +2,47 @@ +++ ../src-work/minecraft/net/minecraft/world/storage/MapData.java @@ -21,7 +21,7 @@ { - public int xCenter; - public int zCenter; -- public byte dimension; -+ public int dimension; //FML byte -> int - public byte scale; - public byte[] colors = new byte[16384]; - public List playersArrayList = Lists.newArrayList(); + public int field_76201_a; + public int field_76199_b; +- public byte field_76200_c; ++ public int field_76200_c; //FML byte -> int + public byte field_76197_d; + public byte[] field_76198_e = new byte[16384]; + public List field_76196_g = Lists.newArrayList(); @@ -44,7 +44,17 @@ - public void readFromNBT(NBTTagCompound nbt) + public void func_76184_a(NBTTagCompound p_76184_1_) { -- this.dimension = nbt.getByte("dimension"); -+ net.minecraft.nbt.NBTBase dimension = nbt.getTag("dimension"); +- this.field_76200_c = p_76184_1_.func_74771_c("dimension"); ++ net.minecraft.nbt.NBTBase dimension = p_76184_1_.func_74781_a("dimension"); + + if (dimension instanceof net.minecraft.nbt.NBTTagByte) + { -+ this.dimension = ((net.minecraft.nbt.NBTTagByte)dimension).getByte(); ++ this.field_76200_c = ((net.minecraft.nbt.NBTTagByte)dimension).func_150290_f(); + } + else + { -+ this.dimension = ((net.minecraft.nbt.NBTTagInt)dimension).getInt(); ++ this.field_76200_c = ((net.minecraft.nbt.NBTTagInt)dimension).func_150287_d(); + } + - this.xCenter = nbt.getInteger("xCenter"); - this.zCenter = nbt.getInteger("zCenter"); - this.scale = nbt.getByte("scale"); + this.field_76201_a = p_76184_1_.func_74762_e("xCenter"); + this.field_76199_b = p_76184_1_.func_74762_e("zCenter"); + this.field_76197_d = p_76184_1_.func_74771_c("scale"); @@ -85,7 +95,7 @@ - public void writeToNBT(NBTTagCompound nbt) + public void func_76187_b(NBTTagCompound p_76187_1_) { -- nbt.setByte("dimension", this.dimension); -+ nbt.setInteger("dimension", this.dimension); - nbt.setInteger("xCenter", this.xCenter); - nbt.setInteger("zCenter", this.zCenter); - nbt.setByte("scale", this.scale); +- p_76187_1_.func_74774_a("dimension", this.field_76200_c); ++ p_76187_1_.func_74768_a("dimension", this.field_76200_c); + p_76187_1_.func_74768_a("xCenter", this.field_76201_a); + p_76187_1_.func_74768_a("zCenter", this.field_76199_b); + p_76187_1_.func_74774_a("scale", this.field_76197_d); @@ -164,7 +174,7 @@ p_82567_8_ = p_82567_8_ + (p_82567_8_ < 0.0D ? -8.0D : 8.0D); b2 = (byte)((int)(p_82567_8_ * 16.0D / 360.0D)); -- if (this.dimension < 0) -+ if (worldIn.provider.shouldMapSpin(p_82567_3_, p_82567_4_, p_82567_6_, p_82567_8_)) +- if (this.field_76200_c < 0) ++ if (p_82567_2_.field_73011_w.shouldMapSpin(p_82567_3_, p_82567_4_, p_82567_6_, p_82567_8_)) { - int k = (int)(worldIn.getWorldInfo().getWorldTime() / 10L); + int k = (int)(p_82567_2_.func_72912_H().func_76073_f() / 10L); b2 = (byte)(k * k * 34187121 + k * 121 >> 15 & 15); diff --git a/patches/minecraft/net/minecraft/world/storage/SaveHandler.java.patch b/patches/minecraft/net/minecraft/world/storage/SaveHandler.java.patch index e8fb0c830..f3f48d646 100644 --- a/patches/minecraft/net/minecraft/world/storage/SaveHandler.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/SaveHandler.java.patch @@ -2,7 +2,7 @@ +++ ../src-work/minecraft/net/minecraft/world/storage/SaveHandler.java @@ -104,13 +104,17 @@ { - File file1 = new File(this.worldDirectory, "level.dat"); + File file1 = new File(this.field_75770_b, "level.dat"); + WorldInfo worldInfo = null; + @@ -10,8 +10,8 @@ { try { - NBTTagCompound nbttagcompound2 = CompressedStreamTools.readCompressed(new FileInputStream(file1)); - NBTTagCompound nbttagcompound3 = nbttagcompound2.getCompoundTag("Data"); + NBTTagCompound nbttagcompound2 = CompressedStreamTools.func_74796_a(new FileInputStream(file1)); + NBTTagCompound nbttagcompound3 = nbttagcompound2.func_74775_l("Data"); - return new WorldInfo(nbttagcompound3); + worldInfo = new WorldInfo(nbttagcompound3); + net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataLoad(this, worldInfo, nbttagcompound2); @@ -24,13 +24,13 @@ } + net.minecraftforge.fml.common.FMLCommonHandler.instance().confirmBackupLevelDatUse(this); - file1 = new File(this.worldDirectory, "level.dat_old"); + file1 = new File(this.field_75770_b, "level.dat_old"); if (file1.exists()) @@ -126,7 +131,13 @@ { - NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file1)); - NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data"); + NBTTagCompound nbttagcompound = CompressedStreamTools.func_74796_a(new FileInputStream(file1)); + NBTTagCompound nbttagcompound1 = nbttagcompound.func_74775_l("Data"); - return new WorldInfo(nbttagcompound1); + worldInfo = new WorldInfo(nbttagcompound1); + net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataLoad(this, worldInfo, nbttagcompound); @@ -44,57 +44,57 @@ { @@ -143,6 +154,8 @@ NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setTag("Data", nbttagcompound); + nbttagcompound1.func_74782_a("Data", nbttagcompound); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataSave(this, worldInformation, nbttagcompound1); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataSave(this, p_75755_1_, nbttagcompound1); + try { - File file1 = new File(this.worldDirectory, "level.dat_new"); + File file1 = new File(this.field_75770_b, "level.dat_new"); @@ -181,6 +194,8 @@ NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setTag("Data", nbttagcompound); + nbttagcompound1.func_74782_a("Data", nbttagcompound); -+ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataSave(this, worldInformation, nbttagcompound1); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataSave(this, p_75761_1_, nbttagcompound1); + try { - File file1 = new File(this.worldDirectory, "level.dat_new"); + File file1 = new File(this.field_75770_b, "level.dat_new"); @@ -229,6 +244,7 @@ } file1.renameTo(file2); -+ net.minecraftforge.event.ForgeEventFactory.firePlayerSavingEvent(p_75753_1_, this.playersDirectory, p_75753_1_.getUniqueID().toString()); ++ net.minecraftforge.event.ForgeEventFactory.firePlayerSavingEvent(p_75753_1_, this.field_75771_c, p_75753_1_.func_110124_au().toString()); } catch (Exception var5) { @@ -259,6 +275,7 @@ - p_75752_1_.readFromNBT(nbttagcompound); + p_75752_1_.func_70020_e(nbttagcompound); } -+ net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(p_75752_1_, playersDirectory, p_75752_1_.getUniqueID().toString()); ++ net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(p_75752_1_, field_75771_c, p_75752_1_.func_110124_au().toString()); return nbttagcompound; } @@ -300,4 +317,22 @@ { - return this.saveDirectoryName; + return this.field_75767_f; } + + public NBTTagCompound getPlayerNBT(net.minecraft.entity.player.EntityPlayerMP player) + { + try + { -+ File file1 = new File(this.playersDirectory, player.getUniqueID().toString() + ".dat"); ++ File file1 = new File(this.field_75771_c, player.func_110124_au().toString() + ".dat"); + + if (file1.exists() && file1.isFile()) + { -+ return CompressedStreamTools.readCompressed(new FileInputStream(file1)); ++ return CompressedStreamTools.func_74796_a(new FileInputStream(file1)); + } + } + catch (Exception exception) + { -+ logger.warn("Failed to load player data for " + player.getName()); ++ field_151478_a.warn("Failed to load player data for " + player.func_70005_c_()); + } + return null; + } diff --git a/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch b/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch index a95b7f74e..808536451 100644 --- a/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch +++ b/patches/minecraft/net/minecraft/world/storage/WorldInfo.java.patch @@ -1,9 +1,9 @@ --- ../src-base/minecraft/net/minecraft/world/storage/WorldInfo.java +++ ../src-work/minecraft/net/minecraft/world/storage/WorldInfo.java @@ -51,6 +51,7 @@ - private int borderWarningDistance = 5; - private int borderWarningTime = 15; - private GameRules theGameRules = new GameRules(); + private int field_176154_I = 5; + private int field_176155_J = 15; + private GameRules field_82577_x = new GameRules(); + private java.util.Map additionalProperties; protected WorldInfo()