diff --git a/patches.mcp/minecraft/net/minecraft/block/Block.java.patch b/patches.mcp/minecraft/net/minecraft/block/Block.java.patch index e7e3d5218a..a5c568e361 100644 --- a/patches.mcp/minecraft/net/minecraft/block/Block.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/Block.java.patch @@ -1,14 +1,6 @@ --- ../src-base/minecraft/net/minecraft/block/Block.java +++ ../src-work/minecraft/net/minecraft/block/Block.java -@@ -17,6 +17,7 @@ - import net.minecraft.entity.item.EntityItem; - import net.minecraft.entity.item.EntityXPOrb; - import net.minecraft.entity.player.EntityPlayer; -+import net.minecraft.init.Blocks; - import net.minecraft.init.Enchantments; - import net.minecraft.item.Item; - import net.minecraft.item.ItemBlock; -@@ -46,8 +47,9 @@ +@@ -46,8 +46,9 @@ public class Block { private static final ResourceLocation AIR_ID = new ResourceLocation("air"); @@ -20,7 +12,7 @@ public static final AxisAlignedBB field_185505_j = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); public static final AxisAlignedBB field_185506_k = null; private CreativeTabs displayOnCreativeTab; -@@ -70,6 +72,9 @@ +@@ -70,6 +71,9 @@ private IBlockState defaultBlockState; private String unlocalizedName; @@ -30,7 +22,7 @@ public static int getIdFromBlock(Block blockIn) { return blockRegistry.getIDForObject(blockIn); -@@ -83,7 +88,8 @@ +@@ -83,7 +87,8 @@ public static Block getBlockById(int id) { @@ -40,7 +32,7 @@ } public static IBlockState getStateById(int id) -@@ -268,7 +274,7 @@ +@@ -268,7 +273,7 @@ public boolean isReplaceable(IBlockAccess worldIn, BlockPos pos) { @@ -49,7 +41,7 @@ } public Block setHardness(float hardness) -@@ -305,9 +311,10 @@ +@@ -305,9 +310,10 @@ return this.needsRandomTick; } @@ -61,7 +53,7 @@ } public AxisAlignedBB func_185496_a(IBlockState p_185496_1_, IBlockAccess p_185496_2_, BlockPos p_185496_3_) -@@ -346,13 +353,13 @@ +@@ -346,13 +352,13 @@ @SideOnly(Side.CLIENT) public int func_185484_c(IBlockState p_185484_1_, IBlockAccess p_185484_2_, BlockPos p_185484_3_) { @@ -77,7 +69,7 @@ } else { -@@ -415,7 +422,7 @@ +@@ -415,7 +421,7 @@ } } @@ -86,7 +78,7 @@ } @SideOnly(Side.CLIENT) -@@ -472,6 +479,10 @@ +@@ -472,6 +478,10 @@ public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { @@ -97,7 +89,7 @@ } public int quantityDropped(Random random) -@@ -486,8 +497,7 @@ +@@ -486,8 +496,7 @@ public float getPlayerRelativeBlockHardness(IBlockState playerIn, EntityPlayer worldIn, World pos, BlockPos p_180647_4_) { @@ -107,7 +99,7 @@ } public final void dropBlockAsItem(World worldIn, BlockPos pos, IBlockState state, int forture) -@@ -497,20 +507,16 @@ +@@ -497,20 +506,16 @@ public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) { @@ -133,7 +125,7 @@ } } } -@@ -518,8 +524,13 @@ +@@ -518,8 +523,13 @@ public static void spawnAsEntity(World worldIn, BlockPos pos, ItemStack stack) { @@ -148,7 +140,7 @@ 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; -@@ -588,7 +599,7 @@ +@@ -588,7 +598,7 @@ public boolean canPlaceBlockAt(World worldIn, BlockPos pos) { @@ -157,7 +149,7 @@ } public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand side, ItemStack hitX, EnumFacing hitY, float hitZ, float p_180639_9_, float p_180639_10_) -@@ -638,25 +649,35 @@ +@@ -638,25 +648,35 @@ player.triggerAchievement(StatList.func_188055_a(this)); player.addExhaustion(0.025F); @@ -196,7 +188,7 @@ } protected ItemStack createStackedBlock(IBlockState state) -@@ -747,6 +768,7 @@ +@@ -747,6 +767,7 @@ entityIn.motionY = 0.0D; } @@ -204,7 +196,7 @@ public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) { return new ItemStack(Item.getItemFromBlock(this), 1, this.damageDropped(p_185473_3_)); -@@ -844,6 +866,1165 @@ +@@ -844,6 +865,1167 @@ return "Block{" + blockRegistry.getNameForObject(this) + "}"; } @@ -234,12 +226,13 @@ + /** + * Checks if a player or entity can use this block to 'climb' like a ladder. + * ++ * @param state The current state + * @param world The current world + * @param pos Block position in world + * @param entity The entity trying to use the ladder, CAN be null. + * @return True if the block should act like a ladder + */ -+ public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return false; } ++ public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return false; } + + /** + * Return true if the block is a normal, solid cube. This @@ -396,7 +389,7 @@ + public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) + { + this.onBlockHarvested(world, pos, state, player); -+ return world.setBlockState(pos, Blocks.air.getDefaultState(), world.isRemote ? 11 : 3); ++ return world.setBlockState(pos, net.minecraft.init.Blocks.air.getDefaultState(), world.isRemote ? 11 : 3); + } + + /** @@ -834,7 +827,7 @@ + * @param numberOfParticles that vanilla would have spawned. + * @return True to prevent vanilla landing particles form spawning. + */ -+ public boolean addLandingEffects(net.minecraft.world.WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles ) ++ public boolean addLandingEffects(IBlockState state, net.minecraft.world.WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles ) + { + return false; + } @@ -897,12 +890,12 @@ + IBlockState plant = plantable.getPlant(world, pos.offset(direction)); + net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction)); + -+ if (plant.getBlock() == Blocks.cactus && this == Blocks.cactus) ++ if (plant.getBlock() == net.minecraft.init.Blocks.cactus && this == net.minecraft.init.Blocks.cactus) + { + return true; + } + -+ if (plant.getBlock() == Blocks.reeds && this == Blocks.reeds) ++ if (plant.getBlock() == net.minecraft.init.Blocks.reeds && this == net.minecraft.init.Blocks.reeds) + { + return true; + } @@ -914,14 +907,14 @@ + + switch (plantType) + { -+ case Desert: return this == Blocks.sand || this == Blocks.hardened_clay || this == Blocks.stained_hardened_clay || this == Blocks.dirt; -+ case Nether: return this == Blocks.soul_sand; -+ case Crop: return this == Blocks.farmland; ++ 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 Cave: return state.isSideSolid(world, pos, EnumFacing.UP); -+ case Plains: return this == Blocks.grass || this == Blocks.dirt || this == Blocks.farmland; ++ case Plains: return this == net.minecraft.init.Blocks.grass || this == net.minecraft.init.Blocks.dirt || this == net.minecraft.init.Blocks.farmland; + case Water: return state.func_185904_a() == Material.water && state.getValue(BlockLiquid.LEVEL) == 0; + case Beach: -+ boolean isBeach = this == Blocks.grass || this == Blocks.dirt || this == Blocks.sand; ++ 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()).func_185904_a() == Material.water || + world.getBlockState(pos.west()).func_185904_a() == Material.water || + world.getBlockState(pos.north()).func_185904_a() == Material.water || @@ -1255,6 +1248,7 @@ + * Called when the entity is inside this block, may be used to determined if the entity can breathing, + * display material overlays, or if the entity can swim inside a block. + * ++ * @param state The current block state + * @param world that is being tested. + * @param blockpos position thats being tested. + * @param iblockstate state at world/blockpos @@ -1264,7 +1258,7 @@ + * @param testingHead when true, its testing the entities head for vision, breathing ect... otherwise its testing the body, for swimming and movement adjustment. + * @return null for default behavior, true if the entity is within the material, false if it was not. + */ -+ public Boolean isEntityInsideMaterial(World world, BlockPos blockpos, IBlockState iblockstate, Entity entity, double yToTest, Material materialIn, boolean testingHead) ++ public Boolean isEntityInsideMaterial(IBlockState state, IBlockAccess world, BlockPos blockpos, IBlockState iblockstate, Entity entity, double yToTest, Material materialIn, boolean testingHead) + { + return null; + } diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockFlowerPot.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockFlowerPot.java.patch index f5dff58105..0e6bf83a5b 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockFlowerPot.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockFlowerPot.java.patch @@ -30,10 +30,10 @@ + return ret; + } + @Override -+ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest) ++ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) + { + if (willHarvest) return true; //If it will harvest, delay deletion of the block until after getDrops -+ return super.removedByPlayer(world, pos, player, willHarvest); ++ return super.removedByPlayer(state, world, pos, player, willHarvest); + } + @Override + public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te, ItemStack tool) diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockLadder.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockLadder.java.patch index ee66a27545..ce3dc11ddd 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockLadder.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockLadder.java.patch @@ -26,5 +26,5 @@ return new BlockStateContainer(this, new IProperty[] {FACING}); } + -+ @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; } ++ @Override public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; } } diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockTrapDoor.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockTrapDoor.java.patch new file mode 100644 index 0000000000..e2af917e9c --- /dev/null +++ b/patches.mcp/minecraft/net/minecraft/block/BlockTrapDoor.java.patch @@ -0,0 +1,21 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockTrapDoor.java ++++ ../src-work/minecraft/net/minecraft/block/BlockTrapDoor.java +@@ -241,6 +241,18 @@ + return new BlockStateContainer(this, new IProperty[] {FACING, OPEN, HALF}); + } + ++ @Override ++ public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) ++ { ++ if (state.getValue(OPEN)) ++ { ++ IBlockState down = world.getBlockState(pos.down()); ++ if (down.getBlock() == net.minecraft.init.Blocks.ladder) ++ return down.getValue(BlockLadder.FACING) == state.getValue(FACING); ++ } ++ return false; ++ } ++ + public static enum DoorHalf implements IStringSerializable + { + TOP("top"), diff --git a/patches.mcp/minecraft/net/minecraft/block/BlockVine.java.patch b/patches.mcp/minecraft/net/minecraft/block/BlockVine.java.patch index e939dca263..d2eff4f1ea 100644 --- a/patches.mcp/minecraft/net/minecraft/block/BlockVine.java.patch +++ b/patches.mcp/minecraft/net/minecraft/block/BlockVine.java.patch @@ -23,7 +23,7 @@ return i; } + /*************************FORGE START***********************************/ -+ @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity){ return true; } ++ @Override public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity){ return true; } + @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; } + @Override + public java.util.List onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/GuiIngame.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/GuiIngame.java.patch new file mode 100644 index 0000000000..2b9853f16a --- /dev/null +++ b/patches.mcp/minecraft/net/minecraft/client/gui/GuiIngame.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiIngame.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiIngame.java +@@ -360,7 +360,8 @@ + + BlockPos blockpos = raytraceresult.getBlockPos(); + +- if (!this.mc.theWorld.getBlockState(blockpos).getBlock().hasTileEntity() || !(this.mc.theWorld.getTileEntity(blockpos) instanceof IInventory)) ++ net.minecraft.block.state.IBlockState state = this.mc.theWorld.getBlockState(blockpos); ++ if (!state.getBlock().hasTileEntity(state) || !(this.mc.theWorld.getTileEntity(blockpos) instanceof IInventory)) + { + return; + } diff --git a/patches.mcp/minecraft/net/minecraft/entity/Entity.java.patch b/patches.mcp/minecraft/net/minecraft/entity/Entity.java.patch index 3b2451cc9d..7518d29e80 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/Entity.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/Entity.java.patch @@ -9,12 +9,11 @@ { private static final Logger field_184243_a = LogManager.getLogger(); private static final AxisAlignedBB ZERO_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); -@@ -195,8 +195,20 @@ +@@ -195,8 +195,16 @@ this.dataWatcher.func_187214_a(field_184242_az, ""); this.dataWatcher.func_187214_a(field_184234_aB, Boolean.valueOf(false)); this.entityInit(); + 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); + capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this); } @@ -22,39 +21,49 @@ + private NBTTagCompound customEntityData; + public boolean captureDrops = false; + public java.util.ArrayList capturedDrops = new java.util.ArrayList(); -+ -+ @Deprecated //ToDo: Move to Capabilities? -+ protected java.util.HashMap extendedProperties = new java.util.HashMap(); + private net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities; + public int getEntityId() { return this.entityId; -@@ -1534,6 +1546,23 @@ +@@ -1134,12 +1142,12 @@ + BlockPos blockpos = new BlockPos(this.posX, d0, this.posZ); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos); + ++ Boolean result = iblockstate.getBlock().isEntityInsideMaterial(iblockstate, this.worldObj, blockpos, iblockstate, this, d0, materialIn, true); ++ if (result != null) return result; ++ + if (iblockstate.func_185904_a() == materialIn) + { +- float f = BlockLiquid.getLiquidHeightPercent(iblockstate.getBlock().getMetaFromState(iblockstate)) - 0.11111111F; +- float f1 = (float)(blockpos.getY() + 1) - f; +- boolean flag = d0 < (double)f1; +- return !flag && this instanceof EntityPlayer ? false : flag; ++ return net.minecraftforge.common.ForgeHooks.isInsideOfMaterial(materialIn, this, blockpos); + } + else + { +@@ -1534,6 +1542,9 @@ tagCompund.setTag("Tags", nbttaglist); } + if (customEntityData != null) tagCompund.setTag("ForgeData", customEntityData); -+ for (String identifier : this.extendedProperties.keySet()) -+ { -+ try -+ { -+ net.minecraftforge.common.IExtendedEntityProperties props = this.extendedProperties.get(identifier); -+ props.saveNBTData(tagCompund); -+ } -+ catch (Throwable t) -+ { -+ net.minecraftforge.fml.common.FMLLog.severe("Failed to save extended properties for %s. This is a mod issue.", identifier); -+ t.printStackTrace(); -+ } -+ } -+ + if (this.capabilities != null) tagCompund.setTag("ForgeCaps", this.capabilities.serializeNBT()); + this.writeEntityToNBT(tagCompund); if (this.func_184207_aI()) -@@ -1715,7 +1744,10 @@ +@@ -1629,6 +1640,9 @@ + this.setSilent(tagCompund.getBoolean("Silent")); + this.func_184195_f(tagCompund.getBoolean("Glowing")); + ++ if (tagCompund.hasKey("ForgeData")) customEntityData = tagCompund.getCompoundTag("ForgeData"); ++ if (this.capabilities != null && tagCompund.hasKey("ForgeCaps")) this.capabilities.deserializeNBT(tagCompund.getCompoundTag("ForgeCaps")); ++ + if (tagCompund.hasKey("Tags", 9)) + { + this.field_184236_aF.clear(); +@@ -1715,7 +1729,10 @@ { EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double)offsetY, this.posZ, itemStackIn); entityitem.setDefaultPickupDelay(); @@ -66,7 +75,15 @@ return entityitem; } else -@@ -2279,6 +2311,7 @@ +@@ -1824,6 +1841,7 @@ + + public boolean func_184205_a(Entity p_184205_1_, boolean p_184205_2_) + { ++ if (!net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, p_184205_1_, true)) return false; + if (p_184205_2_ || this.func_184228_n(p_184205_1_) && p_184205_1_.func_184219_q(this)) + { + if (this.func_184218_aH()) +@@ -2279,6 +2297,7 @@ { if (!this.worldObj.isRemote && !this.isDead) { @@ -74,7 +91,7 @@ this.worldObj.theProfiler.startSection("changeDimension"); MinecraftServer minecraftserver = this.func_184102_h(); int i = this.dimension; -@@ -2372,7 +2405,7 @@ +@@ -2372,7 +2391,7 @@ public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) { @@ -83,7 +100,7 @@ } public boolean verifyExplosion(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn, float p_174816_5_) -@@ -2662,6 +2695,210 @@ +@@ -2662,6 +2681,165 @@ EnchantmentHelper.applyArthropodEnchantments(entityLivingBaseIn, entityIn); } @@ -199,51 +216,6 @@ + } + + /** -+ * Register the instance of IExtendedProperties into the entity's collection. -+ * @param identifier The identifier which you can use to retrieve these properties for the entity. -+ * @param properties The instanceof IExtendedProperties to register -+ * @return The identifier that was used to register the extended properties. Empty String indicates an error. If your requested key already existed, this will return a modified one that is unique. -+ */ -+ public String registerExtendedProperties(String identifier, net.minecraftforge.common.IExtendedEntityProperties properties) -+ { -+ if (identifier == null) -+ { -+ net.minecraftforge.fml.common.FMLLog.warning("Someone is attempting to register extended properties using a null identifier. This is not allowed. Aborting. This may have caused instability."); -+ return ""; -+ } -+ if (properties == null) -+ { -+ net.minecraftforge.fml.common.FMLLog.warning("Someone is attempting to register null extended properties. This is not allowed. Aborting. This may have caused instability."); -+ return ""; -+ } -+ -+ String baseIdentifier = identifier; -+ int identifierModCount = 1; -+ while (this.extendedProperties.containsKey(identifier)) -+ { -+ identifier = String.format("%s%d", baseIdentifier, identifierModCount++); -+ } -+ -+ if (baseIdentifier != identifier) -+ { -+ net.minecraftforge.fml.common.FMLLog.info("An attempt was made to register exended properties using an existing key. The duplicate identifier (%s) has been remapped to %s.", baseIdentifier, identifier); -+ } -+ -+ this.extendedProperties.put(identifier, properties); -+ return identifier; -+ } -+ -+ /** -+ * Gets the extended properties identified by the passed in key -+ * @param identifier The key that identifies the extended properties. -+ * @return The instance of IExtendedProperties that was found, or null. -+ */ -+ public net.minecraftforge.common.IExtendedEntityProperties getExtendedProperties(String identifier) -+ { -+ return this.extendedProperties.get(identifier); -+ } -+ -+ /** + * If a rider of this entity can interact with this entity. Should return true on the + * ridden entity if so. + * diff --git a/patches.mcp/minecraft/net/minecraft/entity/EntityHanging.java.patch b/patches.mcp/minecraft/net/minecraft/entity/EntityHanging.java.patch new file mode 100644 index 0000000000..e92e37ef7e --- /dev/null +++ b/patches.mcp/minecraft/net/minecraft/entity/EntityHanging.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityHanging.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityHanging.java +@@ -139,6 +139,9 @@ + BlockPos blockpos1 = blockpos.offset(enumfacing, k + i1).up(l + j1); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos1); + ++ if (iblockstate.isSideSolid(this.worldObj, blockpos1, this.facingDirection)) ++ continue; ++ + if (!iblockstate.func_185904_a().isSolid() && !BlockRedstoneDiode.func_185546_B(iblockstate)) + { + return false; diff --git a/patches.mcp/minecraft/net/minecraft/entity/EntityLivingBase.java.patch b/patches.mcp/minecraft/net/minecraft/entity/EntityLivingBase.java.patch index d267a16705..6db21f1932 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/EntityLivingBase.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/EntityLivingBase.java.patch @@ -1,6 +1,27 @@ --- ../src-base/minecraft/net/minecraft/entity/EntityLivingBase.java +++ ../src-work/minecraft/net/minecraft/entity/EntityLivingBase.java -@@ -363,7 +363,7 @@ +@@ -190,9 +190,11 @@ + float f = (float)MathHelper.ceiling_float_int(this.fallDistance - 3.0F); + + if (p_184231_4_.func_185904_a() != Material.air) ++ if (p_184231_4_.getBlock().isAir(p_184231_4_, worldObj, p_184231_5_)) + { + double d0 = Math.min((double)(0.2F + f / 15.0F), 2.5D); + int i = (int)(150.0D * d0); ++ if (!p_184231_4_.getBlock().addLandingEffects(p_184231_4_, (WorldServer)this.worldObj, p_184231_5_, p_184231_4_, this, i)) + ((WorldServer)this.worldObj).spawnParticle(EnumParticleTypes.BLOCK_DUST, this.posX, this.posY, this.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, new int[] {Block.getStateId(p_184231_4_)}); + } + } +@@ -264,7 +266,7 @@ + } + } + +- if (!this.worldObj.isRemote && this.func_184218_aH() && this.func_184187_bx() instanceof EntityLivingBase) ++ if (!this.worldObj.isRemote && this.func_184218_aH() && this.func_184187_bx() != null && this.func_184187_bx().shouldDismountInWater(this)) + { + this.func_184210_p(); + } +@@ -363,7 +365,7 @@ if (!this.worldObj.isRemote && (this.isPlayer() || this.recentlyHit > 0 && this.canDropLoot() && this.worldObj.getGameRules().getBoolean("doMobLoot"))) { int i = this.getExperiencePoints(this.attackingPlayer); @@ -9,7 +30,7 @@ while (i > 0) { int j = EntityXPOrb.getXPSplit(i); -@@ -424,6 +424,7 @@ +@@ -424,6 +426,7 @@ { this.entityLivingToAttack = livingBase; this.revengeTimer = this.ticksExisted; @@ -17,7 +38,7 @@ } public EntityLivingBase getLastAttacker() -@@ -775,6 +776,8 @@ +@@ -775,6 +778,8 @@ public void heal(float healAmount) { @@ -26,7 +47,7 @@ float f = this.getHealth(); if (f > 0.0F) -@@ -795,6 +798,7 @@ +@@ -795,6 +800,7 @@ public boolean attackEntityFrom(DamageSource source, float amount) { @@ -34,7 +55,7 @@ if (this.isEntityInvulnerable(source)) { return false; -@@ -883,9 +887,9 @@ +@@ -883,9 +889,9 @@ this.recentlyHit = 100; this.attackingPlayer = (EntityPlayer)entity; } @@ -46,24 +67,49 @@ if (entitywolf.isTamed()) { -@@ -982,6 +986,16 @@ - return true; - } - } -+ -+ captureDrops = false; -+ -+ if (!net.minecraftforge.common.ForgeHooks.onLivingDrops(this, cause, capturedDrops, i, recentlyHit > 0)) -+ { -+ for (EntityItem item : capturedDrops) -+ { -+ worldObj.spawnEntityInWorld(item); -+ } -+ } - } +@@ -1007,6 +1013,7 @@ - return false; -@@ -1139,6 +1153,9 @@ + public void onDeath(DamageSource cause) + { ++ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, cause)) return; + if (!this.dead) + { + Entity entity = cause.getEntity(); +@@ -1034,11 +1041,24 @@ + i = EnchantmentHelper.func_185283_h((EntityLivingBase)entity); + } + ++ captureDrops = true; ++ capturedDrops.clear(); ++ + if (this.canDropLoot() && this.worldObj.getGameRules().getBoolean("doMobLoot")) + { + boolean flag = this.recentlyHit > 0; + this.func_184610_a(flag, i, cause); + } ++ ++ captureDrops = false; ++ ++ if (!net.minecraftforge.common.ForgeHooks.onLivingDrops(this, cause, capturedDrops, i, recentlyHit > 0)) ++ { ++ for (EntityItem item : capturedDrops) ++ { ++ worldObj.spawnEntityInWorld(item); ++ } ++ } + } + + this.worldObj.setEntityState(this, (byte)3); +@@ -1113,7 +1133,7 @@ + BlockPos blockpos = new BlockPos(i, j, k); + IBlockState iblockstate = this.worldObj.getBlockState(blockpos); + Block block = iblockstate.getBlock(); +- return block != Blocks.ladder && block != Blocks.vine ? block instanceof BlockTrapDoor && this.func_184604_a(blockpos, iblockstate) : true; ++ return net.minecraftforge.common.ForgeHooks.isLivingOnLadder(iblockstate, worldObj, new BlockPos(i, j, k), this); + } + } + +@@ -1139,6 +1159,9 @@ public void fall(float distance, float damageMultiplier) { @@ -73,7 +119,7 @@ super.fall(distance, damageMultiplier); PotionEffect potioneffect = this.getActivePotionEffect(MobEffects.jump); float f = potioneffect == null ? 0.0F : (float)(potioneffect.getAmplifier() + 1); -@@ -1231,6 +1248,8 @@ +@@ -1231,6 +1254,8 @@ { if (!this.isEntityInvulnerable(damageSrc)) { @@ -82,7 +128,7 @@ damageAmount = this.applyArmorCalculations(damageSrc, damageAmount); damageAmount = this.applyPotionDamageCalculations(damageSrc, damageAmount); float f = damageAmount; -@@ -1279,6 +1298,11 @@ +@@ -1279,6 +1304,11 @@ public void func_184609_a(EnumHand p_184609_1_) { @@ -94,7 +140,41 @@ if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0) { this.swingProgressInt = -1; -@@ -1586,6 +1610,7 @@ +@@ -1476,6 +1506,7 @@ + + public void dismountEntity(Entity p_110145_1_) + { ++ if (!net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, p_110145_1_, false)) return; + if (!(p_110145_1_ instanceof EntityBoat) && !(p_110145_1_ instanceof EntityHorse)) + { + double d1 = p_110145_1_.posX; +@@ -1500,7 +1531,7 @@ + + if (!this.worldObj.func_184143_b(axisalignedbb1)) + { +- if (this.worldObj.getBlockState(new BlockPos(d11, this.posY, d12)).func_185896_q()) ++ if (this.worldObj.getBlockState(new BlockPos(d11, this.posY, d12)).isSideSolid(worldObj, new BlockPos(d11, this.posY, d12), EnumFacing.UP)) + { + this.setPositionAndUpdate(d11, this.posY + 1.0D, d12); + return; +@@ -1508,14 +1539,14 @@ + + BlockPos blockpos = new BlockPos(d11, this.posY - 1.0D, d12); + +- if (this.worldObj.getBlockState(blockpos).func_185896_q() || this.worldObj.getBlockState(blockpos).func_185904_a() == Material.water) ++ if (this.worldObj.getBlockState(blockpos).isSideSolid(worldObj, blockpos, EnumFacing.UP) || this.worldObj.getBlockState(blockpos).func_185904_a() == Material.water) + { + d1 = d11; + d13 = this.posY + 1.0D; + d14 = d12; + } + } +- else if (!this.worldObj.func_184143_b(axisalignedbb1.offset(0.0D, 1.0D, 0.0D)) && this.worldObj.getBlockState(new BlockPos(d11, this.posY + 1.0D, d12)).func_185896_q()) ++ else if (!this.worldObj.func_184143_b(axisalignedbb1.offset(0.0D, 1.0D, 0.0D)) && this.worldObj.getBlockState(new BlockPos(d11, this.posY + 1.0D, d12)).isSideSolid(worldObj, new BlockPos(d11, this.posY + 1.0D, d12), EnumFacing.UP)) + { + d1 = d11; + d13 = this.posY + 2.0D; +@@ -1586,6 +1617,7 @@ } this.isAirBorne = true; @@ -102,7 +182,7 @@ } protected void updateAITick() -@@ -1845,6 +1870,7 @@ +@@ -1845,6 +1877,7 @@ public void onUpdate() { @@ -110,7 +190,7 @@ super.onUpdate(); this.func_184608_ct(); -@@ -2351,6 +2377,41 @@ +@@ -2351,6 +2384,41 @@ this.potionsNeedUpdate = true; } @@ -152,7 +232,7 @@ public abstract EnumHandSide func_184591_cq(); public boolean func_184587_cr() -@@ -2371,6 +2432,14 @@ +@@ -2371,6 +2439,14 @@ if (itemstack == this.field_184627_bm) { @@ -167,7 +247,7 @@ if (this.func_184605_cv() <= 25 && this.func_184605_cv() % 4 == 0) { this.func_184584_a(this.field_184627_bm, 5); -@@ -2380,6 +2449,7 @@ +@@ -2380,6 +2456,7 @@ { this.onItemUseFinish(); } @@ -175,7 +255,7 @@ } else { -@@ -2394,8 +2464,10 @@ +@@ -2394,8 +2471,10 @@ if (itemstack != null && !this.func_184587_cr()) { @@ -187,7 +267,7 @@ if (!this.worldObj.isRemote) { -@@ -2478,6 +2550,8 @@ +@@ -2478,6 +2557,8 @@ this.func_184584_a(this.field_184627_bm, 16); ItemStack itemstack = this.field_184627_bm.onItemUseFinish(this.worldObj, this); @@ -196,7 +276,7 @@ if (itemstack != null && itemstack.stackSize == 0) { itemstack = null; -@@ -2508,6 +2582,8 @@ +@@ -2508,6 +2589,8 @@ if (this.field_184627_bm != null) { this.field_184627_bm.onPlayerStoppedUsing(this.worldObj, this, this.func_184605_cv()); diff --git a/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch b/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch index 1e93f3997c..a9e284240d 100644 --- a/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch +++ b/patches.mcp/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch @@ -215,18 +215,17 @@ { entityIn.motionX *= 0.20000000298023224D; entityIn.motionZ *= 0.20000000298023224D; -@@ -981,7 +1025,222 @@ - { +@@ -982,6 +1026,221 @@ this.func_184212_Q().func_187227_b(field_184270_f, Boolean.valueOf(p_94096_1_)); } -+ + + /* =================================== 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); - ++ + if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(x, y - 1, z))) y--; + return new BlockPos(x, y, z); + } @@ -251,7 +250,7 @@ + double mX = this.motionX; + double mZ = this.motionZ; + -+ if (this.riddenByEntity != null) ++ if (this.func_184187_bx() != null) + { + mX *= 0.75D; + mZ *= 0.75D; @@ -349,7 +348,7 @@ + */ + public boolean isPoweredCart() + { -+ return getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE; ++ return func_184264_v() == EntityMinecart.Type.FURNACE; + } + + /** @@ -358,7 +357,7 @@ + */ + public boolean canBeRidden() + { -+ return this.getMinecartType() == EntityMinecart.EnumMinecartType.RIDEABLE; ++ return this.func_184264_v() == EntityMinecart.Type.RIDEABLE; + } + + /** diff --git a/patches.mcp/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch b/patches.mcp/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch new file mode 100644 index 0000000000..2ff5ecea87 --- /dev/null +++ b/patches.mcp/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch @@ -0,0 +1,21 @@ +--- ../src-base/minecraft/net/minecraft/inventory/ContainerBrewingStand.java ++++ ../src-work/minecraft/net/minecraft/inventory/ContainerBrewingStand.java +@@ -196,7 +196,7 @@ + + public boolean isItemValid(ItemStack stack) + { +- return stack != null && PotionHelper.func_185205_a(stack); ++ return stack != null && net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidIngredient(stack); + } + + public int getSlotStackLimit() +@@ -243,8 +243,7 @@ + } + else + { +- Item item = stack.getItem(); +- return item == Items.potionitem || item == Items.glass_bottle || item == Items.field_185155_bH || item == Items.field_185156_bI; ++ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidInput(stack); + } + } + } diff --git a/patches.mcp/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch b/patches.mcp/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch new file mode 100644 index 0000000000..729349b46f --- /dev/null +++ b/patches.mcp/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/inventory/ContainerPlayer.java ++++ ../src-work/minecraft/net/minecraft/inventory/ContainerPlayer.java +@@ -48,8 +48,7 @@ + } + else + { +- EntityEquipmentSlot entityequipmentslot1 = EntityLiving.func_184640_d(stack); +- return entityequipmentslot1 == entityequipmentslot; ++ return stack.getItem().isValidArmor(stack, entityequipmentslot, thePlayer); + } + } + @SideOnly(Side.CLIENT) diff --git a/patches.mcp/minecraft/net/minecraft/inventory/ContainerRepair.java.patch b/patches.mcp/minecraft/net/minecraft/inventory/ContainerRepair.java.patch index 3d5e67896d..4fe5a03f09 100644 --- a/patches.mcp/minecraft/net/minecraft/inventory/ContainerRepair.java.patch +++ b/patches.mcp/minecraft/net/minecraft/inventory/ContainerRepair.java.patch @@ -18,15 +18,21 @@ { int l = ((Integer)iblockstate.getValue(BlockAnvil.DAMAGE)).intValue(); ++l; -@@ -163,6 +165,7 @@ +@@ -160,10 +162,12 @@ + Map map = EnchantmentHelper.getEnchantments(itemstack1); + j = j + itemstack.getRepairCost() + (itemstack2 == null ? 0 : itemstack2.getRepairCost()); + this.materialCost = 0; ++ boolean flag = false; if (itemstack2 != null) { +- boolean flag = itemstack2.getItem() == Items.enchanted_book && !Items.enchanted_book.getEnchantments(itemstack2).hasNoTags(); + if (!net.minecraftforge.common.ForgeHooks.onAnvilChange(this, itemstack, itemstack2, outputSlot, repairedItemName, j)) return; - boolean flag = itemstack2.getItem() == Items.enchanted_book && !Items.enchanted_book.getEnchantments(itemstack2).hasNoTags(); ++ flag = itemstack2.getItem() == Items.enchanted_book && !Items.enchanted_book.getEnchantments(itemstack2).hasNoTags(); if (itemstack1.isItemStackDamageable() && itemstack1.getItem().getIsRepairable(itemstack, itemstack2)) -@@ -235,7 +238,7 @@ + { +@@ -235,7 +239,7 @@ for (Enchantment enchantment : map.keySet()) { @@ -35,7 +41,7 @@ { flag1 = false; ++i; -@@ -279,6 +282,8 @@ +@@ -279,6 +283,8 @@ } } diff --git a/patches.mcp/minecraft/net/minecraft/item/Item.java.patch b/patches.mcp/minecraft/net/minecraft/item/Item.java.patch index cd28b89f8f..4b6c4ddc57 100644 --- a/patches.mcp/minecraft/net/minecraft/item/Item.java.patch +++ b/patches.mcp/minecraft/net/minecraft/item/Item.java.patch @@ -57,7 +57,7 @@ Vec3d vec3d1 = vec3d.addVector((double)f6 * d3, (double)f5 * d3, (double)f7 * d3); return worldIn.rayTraceBlocks(vec3d, vec3d1, useLiquids, !useLiquids, false); } -@@ -422,11 +431,619 @@ +@@ -422,11 +431,609 @@ return false; } @@ -330,19 +330,9 @@ + * @param entity The entity trying to equip the armor + * @return True if the given ItemStack can be inserted in the slot + */ -+ public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) ++ public boolean isValidArmor(ItemStack stack, EntityEquipmentSlot armorType, Entity entity) + { -+ if (this instanceof ItemArmor) -+ { -+ return ((ItemArmor)this).armorType == armorType; -+ } -+ -+ if (armorType == 0) -+ { -+ return this == Item.getItemFromBlock(Blocks.pumpkin) || this == Items.skull; -+ } -+ -+ return false; ++ return net.minecraft.entity.EntityLiving.func_184640_d(stack) == armorType; + } + + /** @@ -677,7 +667,7 @@ public static void registerItems() { registerItemBlock(Blocks.stone, (new ItemMultiTexture(Blocks.stone, Blocks.stone, new Function() -@@ -935,6 +1552,10 @@ +@@ -935,6 +1542,10 @@ private final float damageVsEntity; private final int enchantability; @@ -688,7 +678,7 @@ private ToolMaterial(int harvestLevel, int maxUses, float efficiency, float damageVsEntity, int enchantability) { this.harvestLevel = harvestLevel; -@@ -969,9 +1590,36 @@ +@@ -969,9 +1580,36 @@ return this.enchantability; } diff --git a/patches.mcp/minecraft/net/minecraft/server/MinecraftServer.java.patch b/patches.mcp/minecraft/net/minecraft/server/MinecraftServer.java.patch index 00b9ef570d..25a020376c 100644 --- a/patches.mcp/minecraft/net/minecraft/server/MinecraftServer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/server/MinecraftServer.java.patch @@ -105,7 +105,7 @@ + WorldServer[] tmp = worldServers; + for (WorldServer world : tmp) + { -+ net.minecraftforge.common.DimensionManager.setWorld(world.provider.getDimensionId(), null); ++ net.minecraftforge.common.DimensionManager.setWorld(world.provider.getDimension(), null, this); + } } diff --git a/patches.mcp/minecraft/net/minecraft/world/World.java.patch b/patches.mcp/minecraft/net/minecraft/world/World.java.patch index 4b28a89dfe..98bb2042f6 100644 --- a/patches.mcp/minecraft/net/minecraft/world/World.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/World.java.patch @@ -271,11 +271,10 @@ } } } -@@ -2021,6 +2112,16 @@ - blockpos$pooledmutableblockpos.func_185343_d(k1, l1, i2); +@@ -2022,6 +2113,16 @@ IBlockState iblockstate = this.getBlockState(blockpos$pooledmutableblockpos); Block block = iblockstate.getBlock(); -+ + + Boolean result = block.isEntityInsideMaterial(this, blockpos$mutableblockpos, iblockstate, entityIn, (double)l, materialIn, false); + if (result != null && result == true) + { @@ -285,9 +284,10 @@ + continue; + } + else if (result != null && result == false) continue; - ++ if (iblockstate.func_185904_a() == materialIn) { + double d0 = (double)((float)(l1 + 1) - BlockLiquid.getLiquidHeightPercent(((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue())); @@ -2130,6 +2231,7 @@ public Explosion newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking) { @@ -556,7 +556,7 @@ + + Chunk chunk = getChunkFromBlockCoords(pos); + if (chunk == null || chunk.isEmpty()) return _default; -+ return getBlockState(pos).getBlock().isSideSolid(this, pos, side); ++ return getBlockState(pos).isSideSolid(this, pos, side); + } + + /** diff --git a/patches.mcp/minecraft/net/minecraft/world/WorldServer.java.patch b/patches.mcp/minecraft/net/minecraft/world/WorldServer.java.patch index 606ef18568..5a29810983 100644 --- a/patches.mcp/minecraft/net/minecraft/world/WorldServer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/WorldServer.java.patch @@ -15,16 +15,16 @@ this.theEntityTracker = new EntityTracker(this); this.thePlayerManager = new PlayerManager(this); + // Guarantee the dimension ID was not reset by the provider -+ int providerDim = this.provider.dimensionId; ++ int providerDim = this.provider.getDimension(); this.provider.registerWorld(this); -+ this.provider.dimensionId = providerDim; ++ this.provider.setDimension(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); ++ net.minecraftforge.common.DimensionManager.setWorld(dimensionId, this, mcServer); } public World init() @@ -220,18 +220,18 @@ if (flag) { - this.mcServer.func_184103_al().sendPacketToAllPlayers(new SPacketChangeGameState(2, 0.0F)); -+ this.mcServer.func_184103_al().sendPacketToAllPlayersInDimension(new SPacketChangeGameState(2, 0.0F), this.provider.dimensionId); ++ this.mcServer.func_184103_al().sendPacketToAllPlayersInDimension(new SPacketChangeGameState(2, 0.0F), this.provider.getDimension()); } else { - this.mcServer.func_184103_al().sendPacketToAllPlayers(new SPacketChangeGameState(1, 0.0F)); -+ this.mcServer.func_184103_al().sendPacketToAllPlayersInDimension(new SPacketChangeGameState(1, 0.0F), this.provider.dimensionId); ++ this.mcServer.func_184103_al().sendPacketToAllPlayersInDimension(new SPacketChangeGameState(1, 0.0F), this.provider.getDimension()); } - this.mcServer.func_184103_al().sendPacketToAllPlayers(new SPacketChangeGameState(7, this.rainingStrength)); - this.mcServer.func_184103_al().sendPacketToAllPlayers(new SPacketChangeGameState(8, this.thunderingStrength)); -+ this.mcServer.func_184103_al().sendPacketToAllPlayersInDimension(new SPacketChangeGameState(7, this.rainingStrength), this.provider.dimensionId); -+ this.mcServer.func_184103_al().sendPacketToAllPlayersInDimension(new SPacketChangeGameState(8, this.thunderingStrength), this.provider.dimensionId); ++ this.mcServer.func_184103_al().sendPacketToAllPlayersInDimension(new SPacketChangeGameState(7, this.rainingStrength), this.provider.getDimension()); ++ this.mcServer.func_184103_al().sendPacketToAllPlayersInDimension(new SPacketChangeGameState(8, this.thunderingStrength), this.provider.getDimension()); } } diff --git a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenHills.java.patch b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenHills.java.patch index e3803d3ac6..031f46cf68 100644 --- a/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenHills.java.patch +++ b/patches.mcp/minecraft/net/minecraft/world/biome/BiomeGenHills.java.patch @@ -1,14 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenHills.java +++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenHills.java -@@ -2,6 +2,7 @@ - - import java.util.Random; - import net.minecraft.block.BlockSilverfish; -+import net.minecraft.block.state.IBlockState; - import net.minecraft.init.Blocks; - import net.minecraft.util.math.BlockPos; - import net.minecraft.world.World; -@@ -37,28 +38,20 @@ +@@ -37,28 +37,20 @@ public void decorate(World worldIn, Random rand, BlockPos pos) { super.decorate(worldIn, rand, pos); @@ -44,7 +36,7 @@ } public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int p_180622_4_, int p_180622_5_, double p_180622_6_) -@@ -86,4 +79,24 @@ +@@ -86,4 +78,24 @@ EXTRA_TREES, MUTATED; } @@ -59,7 +51,7 @@ + { + BlockPos blockpos = pos.add(rand.nextInt(16), rand.nextInt(28) + 4, rand.nextInt(16)); + -+ IBlockState state = worldIn.getBlockState(blockpos); ++ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(blockpos); + if (state.getBlock().isReplaceableOreGen(state, worldIn, blockpos, net.minecraft.block.state.pattern.BlockMatcher.forBlock(Blocks.stone))) + { + worldIn.setBlockState(blockpos, Blocks.emerald_ore.getDefaultState(), 2); diff --git a/rejects/minecraft/net/minecraft/entity/Entity.java.patch.rej b/rejects/minecraft/net/minecraft/entity/Entity.java.patch.rej deleted file mode 100644 index ed53bc9e4e..0000000000 --- a/rejects/minecraft/net/minecraft/entity/Entity.java.patch.rej +++ /dev/null @@ -1,59 +0,0 @@ -++++ REJECTED PATCH 4 - IBlockState iblockstate = this.worldObj.getBlockState(blockpos); - Block block = iblockstate.getBlock(); - -+ Boolean result = block.isEntityInsideMaterial(this.worldObj, blockpos, iblockstate, this, d0, materialIn, true); -+ if (result != null) return result; -+ - if (block.getMaterial() == materialIn) - { -- float f = BlockLiquid.getLiquidHeightPercent(iblockstate.getBlock().getMetaFromState(iblockstate)) - 0.11111111F; -- float f1 = (float)(blockpos.getY() + 1) - f; -- boolean flag = d0 < (double)f1; -- return !flag && this instanceof EntityPlayer ? false : flag; -+ return net.minecraftforge.common.ForgeHooks.isInsideOfMaterial(materialIn, this, blockpos); - } - else - { -++++ END PATCH -++++ REJECTED PATCH 6 - this.setAlwaysRenderNameTag(tagCompund.getBoolean("CustomNameVisible")); - this.cmdResultStats.readStatsFromNBT(tagCompund); - this.setSilent(tagCompund.getBoolean("Silent")); -+ -+ if (tagCompund.hasKey("ForgeData")) customEntityData = tagCompund.getCompoundTag("ForgeData"); -+ for (String identifier : this.extendedProperties.keySet()) -+ { -+ try -+ { -+ net.minecraftforge.common.IExtendedEntityProperties props = this.extendedProperties.get(identifier); -+ props.loadNBTData(tagCompund); -+ } -+ catch (Throwable t) -+ { -+ net.minecraftforge.fml.common.FMLLog.severe("Failed to load extended properties for %s. This is a mod issue.", identifier); -+ t.printStackTrace(); -+ } -+ } -+ -+ //Rawr, legacy code, Vanilla added a UUID, keep this so older maps will convert properly TODO: Remove in 1.9 -+ if (tagCompund.hasKey("PersistentIDMSB") && tagCompund.hasKey("PersistentIDLSB")) -+ { -+ this.entityUniqueID = new UUID(tagCompund.getLong("PersistentIDMSB"), tagCompund.getLong("PersistentIDLSB")); -+ } -+ -+ if (this.capabilities != null && tagCompund.hasKey("ForgeCaps")) this.capabilities.deserializeNBT(tagCompund.getCompoundTag("ForgeCaps")); -+ - this.readEntityFromNBT(tagCompund); - - if (this.shouldSetPosAfterLoading()) -++++ END PATCH -++++ REJECTED PATCH 8 - - public void mountEntity(Entity entityIn) - { -+ if(!(this instanceof EntityLivingBase) && !net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, entityIn, true)){ return; } - this.entityRiderPitchDelta = 0.0D; - this.entityRiderYawDelta = 0.0D; - -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/EntityHanging.java.patch.rej b/rejects/minecraft/net/minecraft/entity/EntityHanging.java.patch.rej deleted file mode 100644 index 9b9b6da9a0..0000000000 --- a/rejects/minecraft/net/minecraft/entity/EntityHanging.java.patch.rej +++ /dev/null @@ -1,11 +0,0 @@ -++++ REJECTED PATCH 1 - { - BlockPos blockpos1 = blockpos.offset(enumfacing, k).up(l); - Block block = this.worldObj.getBlockState(blockpos1).getBlock(); -+ -+ if ( block.isSideSolid( this.worldObj, blockpos1, this.facingDirection )) -+ continue; - - if (!block.getMaterial().isSolid() && !BlockRedstoneDiode.isRedstoneRepeaterBlockID(block)) - { -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/EntityLivingBase.java.patch.rej b/rejects/minecraft/net/minecraft/entity/EntityLivingBase.java.patch.rej deleted file mode 100644 index 66499b8a99..0000000000 --- a/rejects/minecraft/net/minecraft/entity/EntityLivingBase.java.patch.rej +++ /dev/null @@ -1,76 +0,0 @@ -++++ REJECTED PATCH 1 - } - - int i = (int)(150.0D * d0); -+ if ( !block.addLandingEffects( (WorldServer)this.worldObj, pos, iblockstate, this, i ) ) - ((WorldServer)this.worldObj).spawnParticle(EnumParticleTypes.BLOCK_DUST, this.posX, this.posY, this.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, new int[] {Block.getStateId(iblockstate)}); - } - } -++++ END PATCH -++++ REJECTED PATCH 2 - } - } - -- if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity instanceof EntityLivingBase) -+ if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity != null && ridingEntity.shouldDismountInWater(this)) - { - this.mountEntity((Entity)null); - } -++++ END PATCH -++++ REJECTED PATCH 5 - return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD; - } - -- @SideOnly(Side.CLIENT) - public void removePotionEffectClient(int potionId) - { - this.activePotionsMap.remove(Integer.valueOf(potionId)); -++++ END PATCH -++++ REJECTED PATCH 9 - - public void onDeath(DamageSource cause) - { -+ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, cause)) return; - Entity entity = cause.getEntity(); - EntityLivingBase entitylivingbase = this.func_94060_bK(); - -++++ END PATCH -++++ REJECTED PATCH 10 - i = EnchantmentHelper.getLootingModifier((EntityLivingBase)entity); - } - -+ captureDrops = true; -+ capturedDrops.clear(); -+ - if (this.canDropLoot() && this.worldObj.getGameRules().getBoolean("doMobLoot")) - { - this.dropFewItems(this.recentlyHit > 0, i); -++++ END PATCH -++++ REJECTED PATCH 12 - 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); - } - - public boolean isEntityAlive() -++++ END PATCH -++++ REJECTED PATCH 16 - - public void dismountEntity(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; -++++ END PATCH -++++ REJECTED PATCH 19 - - public void mountEntity(Entity entityIn) - { -+ if(!net.minecraftforge.event.ForgeEventFactory.canMountEntity(this, entityIn, true)){ return; } - if (this.ridingEntity != null && entityIn == null) - { - if (!this.worldObj.isRemote) -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch.rej b/rejects/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch.rej deleted file mode 100644 index 663f1630b4..0000000000 --- a/rejects/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch.rej +++ /dev/null @@ -1,30 +0,0 @@ -++++ REJECTED PATCH 1 - - public boolean isItemValid(ItemStack stack) - { -- return stack != null ? stack.getItem().isPotionIngredient(stack) : false; -+ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidIngredient(stack); - } - - public int getSlotStackLimit() -++++ END PATCH -++++ REJECTED PATCH 2 - - public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack) - { -- if (stack.getItem() == Items.potionitem && stack.getMetadata() > 0) -+ if (stack.getItem() instanceof net.minecraft.item.ItemPotion && stack.getMetadata() > 0) - { - this.player.triggerAchievement(AchievementList.potion); - } -++++ END PATCH -++++ REJECTED PATCH 3 - - public static boolean canHoldPotion(ItemStack stack) - { -- return stack != null && (stack.getItem() == Items.potionitem || stack.getItem() == Items.glass_bottle); -+ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.isValidInput(stack); - } - } - } -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch.rej b/rejects/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch.rej deleted file mode 100644 index 9b89b48f7a..0000000000 --- a/rejects/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch.rej +++ /dev/null @@ -1,11 +0,0 @@ -++++ REJECTED PATCH 1 - } - public boolean isItemValid(ItemStack stack) - { -- 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); - } - @SideOnly(Side.CLIENT) - public String getSlotTexture() -++++ END PATCH diff --git a/src/main/java/net/minecraftforge/client/ClientCommandHandler.java b/src/main/java/net/minecraftforge/client/ClientCommandHandler.java index 1b8b994326..968b944829 100644 --- a/src/main/java/net/minecraftforge/client/ClientCommandHandler.java +++ b/src/main/java/net/minecraftforge/client/ClientCommandHandler.java @@ -103,7 +103,7 @@ public class ClientCommandHandler extends CommandHandler return ret; } - public void autoComplete(String leftOfCursor, String full) + public void autoComplete(String leftOfCursor) { latestAutoComplete = null; @@ -142,4 +142,4 @@ public class ClientCommandHandler extends CommandHandler protected MinecraftServer func_184879_a() { return Minecraft.getMinecraft().getIntegratedServer(); } -} \ No newline at end of file +} diff --git a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java index 106a8e7699..c98196d543 100644 --- a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java +++ b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java @@ -113,9 +113,9 @@ public class ForgeHooksClient { Block block = state.getBlock(); - if (block != null && block.isBed(world, pos, entity)) + if (block != null && block.isBed(state, world, pos, entity)) { - glRotatef((float)(block.getBedDirection(world, pos).getHorizontalIndex() * 90), 0.0F, 1.0F, 0.0F); + glRotatef((float)(block.getBedDirection(state, world, pos).getHorizontalIndex() * 90), 0.0F, 1.0F, 0.0F); } } @@ -297,8 +297,7 @@ public class ForgeHooksClient public static ISound playSound(SoundManager manager, ISound sound) { - SoundEventAccessorComposite accessor = manager.sndHandler.getSound(sound.getSoundLocation()); - PlaySoundEvent e = new PlaySoundEvent(manager, sound, (accessor == null ? null : accessor.getSoundCategory())); + PlaySoundEvent e = new PlaySoundEvent(manager, sound); MinecraftForge.EVENT_BUS.post(e); return e.result; } @@ -361,7 +360,7 @@ public class ForgeHooksClient modelLoader.onPostBakeEvent(modelRegistry); } - public static Matrix4f getMatrix(ItemTransformVec3f transform) + public static Matrix4f getMatrix(ItemTransformVec3f transform) { javax.vecmath.Matrix4f m = new javax.vecmath.Matrix4f(), t = new javax.vecmath.Matrix4f(); m.setIdentity(); @@ -383,7 +382,7 @@ public class ForgeHooksClient return m; } - public static IBakedModel handleCameraTransforms(IBakedModel model, ItemCameraTransforms.TransformType cameraTransformType) + public static IBakedModel handleCameraTransforms(IBakedModel model, ItemCameraTransforms.TransformType cameraTransformType) { if(model instanceof IPerspectiveAwareModel) { @@ -598,20 +597,20 @@ public class ForgeHooksClient } } - public static IBakedModel getDamageModel(IBakedModel ibakedmodel, TextureAtlasSprite texture, IBlockState state, IBlockAccess world, BlockPos pos) - { - // TODO custom damage models - // state = state.block.getExtendedState(state, world, pos); - return (new SimpleBakedModel.Builder(state, ibakedmodel, texture, pos)).makeBakedModel(); - } + public static IBakedModel getDamageModel(IBakedModel ibakedmodel, TextureAtlasSprite texture, IBlockState state, IBlockAccess world, BlockPos pos) + { + // TODO custom damage models + // state = state.block.getExtendedState(state, world, pos); + return (new SimpleBakedModel.Builder(state, ibakedmodel, texture, pos)).makeBakedModel(); + } - public static boolean shouldCauseReequipAnimation(ItemStack from, ItemStack to) - { - if(!Objects.equal(from, to) || from == null) - { - return false; - } - // FIXME: 3rd argument? - return from.getItem().shouldCauseReequipAnimation(from, to); - } + public static boolean shouldCauseReequipAnimation(ItemStack from, ItemStack to) + { + if(!Objects.equal(from, to) || from == null) + { + return false; + } + // FIXME: 3rd argument? + return from.getItem().shouldCauseReequipAnimation(from, to); + } } diff --git a/src/main/java/net/minecraftforge/client/GuiIngameForge.java b/src/main/java/net/minecraftforge/client/GuiIngameForge.java index 9e43403110..9e607658fd 100644 --- a/src/main/java/net/minecraftforge/client/GuiIngameForge.java +++ b/src/main/java/net/minecraftforge/client/GuiIngameForge.java @@ -23,9 +23,9 @@ import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.IAttributeInstance; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.init.MobEffects; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.scoreboard.ScorePlayerTeam; import net.minecraft.scoreboard.Scoreboard; @@ -88,8 +88,8 @@ public class GuiIngameForge extends GuiIngame eventParent = new RenderGameOverlayEvent(partialTicks, res); int width = res.getScaledWidth(); int height = res.getScaledHeight(); - renderHealthMount = mc.thePlayer.ridingEntity instanceof EntityLivingBase; - renderFood = mc.thePlayer.ridingEntity == null; + renderHealthMount = mc.thePlayer.func_184187_bx() instanceof EntityLivingBase; + renderFood = mc.thePlayer.func_184187_bx() == null; renderJumpBar = mc.thePlayer.isRidingHorse(); right_height = 39; @@ -107,12 +107,13 @@ public class GuiIngameForge extends GuiIngame } else { - GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + GlStateManager.enableDepth(); + GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); } if (renderHelmet) renderHelmet(res, partialTicks); - if (renderPortal && !mc.thePlayer.isPotionActive(Potion.confusion)) + if (renderPortal && !mc.thePlayer.isPotionActive(MobEffects.confusion)) { renderPortal(res, partialTicks); } @@ -123,9 +124,10 @@ public class GuiIngameForge extends GuiIngame zLevel = -90.0F; rand.setSeed((long)(updateCounter * 312871)); - if (renderCrosshairs) renderCrosshairs(width, height); + if (renderCrosshairs) renderCrosshairs(partialTicks); if (renderBossHealth) renderBossHealth(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); if (this.mc.playerController.shouldDrawHUD() && this.mc.getRenderViewEntity() instanceof EntityPlayer) { if (renderHealth) renderHealth(width, height); @@ -134,6 +136,7 @@ public class GuiIngameForge extends GuiIngame if (renderHealthMount) renderHealthMount(width, height); if (renderAir) renderAir(width, height); } + renderSleepFade(width, height); if (renderJumpBar) @@ -147,7 +150,9 @@ public class GuiIngameForge extends GuiIngame renderToolHightlight(res); renderHUDText(width, height); + renderPotionIcons(res); renderRecordOverlay(width, height, partialTicks); + renderSubtitles(res); renderTitle(width, height, partialTicks); @@ -185,31 +190,37 @@ public class GuiIngameForge extends GuiIngame return res; } - protected void renderCrosshairs(int width, int height) + protected void renderCrosshairs(float partialTicks) { if (pre(CROSSHAIRS)) return; - if (this.showCrosshair()) - { - bind(Gui.icons); - GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0); - GlStateManager.enableAlpha(); - drawTexturedModalRect(width / 2 - 7, height / 2 - 7, 0, 0, 16, 16); - GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); - GlStateManager.disableBlend(); - } + bind(Gui.icons); + super.func_184045_a(partialTicks, res); post(CROSSHAIRS); } - @Override + protected void renderPotionIcons(ScaledResolution resolution) + { + if (pre(POTION_ICONS)) return; + super.func_184048_a(resolution); + post(POTION_ICONS); + } + + protected void renderSubtitles(ScaledResolution resolution) + { + if (pre(SUBTITLES)) return; + this.field_184049_t.func_184068_a(res); + post(SUBTITLES); + } + + //@Override protected void renderBossHealth() { if (pre(BOSSHEALTH)) return; bind(Gui.icons); - GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); mc.mcProfiler.startSection("bossHealth"); GlStateManager.enableBlend(); - super.renderBossHealth(); + this.field_184050_w.func_184051_a(); GlStateManager.disableBlend(); mc.mcProfiler.endSection(); post(BOSSHEALTH); @@ -361,7 +372,7 @@ public class GuiIngameForge extends GuiIngame IAttributeInstance attrMaxHealth = player.getEntityAttribute(SharedMonsterAttributes.maxHealth); float healthMax = (float)attrMaxHealth.getAttributeValue(); - float absorb = player.getAbsorptionAmount(); + float absorb = MathHelper.ceiling_float_int(player.getAbsorptionAmount()); int healthRows = MathHelper.ceiling_float_int((healthMax + absorb) / 2.0F / 10.0F); int rowHeight = Math.max(10 - (healthRows - 2), 3); @@ -374,7 +385,7 @@ public class GuiIngameForge extends GuiIngame if (rowHeight != 10) left_height += 10 - rowHeight; int regen = -1; - if (player.isPotionActive(Potion.regeneration)) + if (player.isPotionActive(MobEffects.regeneration)) { regen = updateCounter % 25; } @@ -382,8 +393,8 @@ public class GuiIngameForge extends GuiIngame final int TOP = 9 * (mc.theWorld.getWorldInfo().isHardcoreModeEnabled() ? 5 : 0); final int BACKGROUND = (highlight ? 25 : 16); int MARGIN = 16; - if (player.isPotionActive(Potion.poison)) MARGIN += 36; - else if (player.isPotionActive(Potion.wither)) MARGIN += 72; + if (player.isPotionActive(MobEffects.poison)) MARGIN += 36; + else if (player.isPotionActive(MobEffects.wither)) MARGIN += 72; float absorbRemaining = absorb; for (int i = MathHelper.ceiling_float_int((healthMax + absorb) / 2.0F) - 1; i >= 0; --i) @@ -409,10 +420,15 @@ public class GuiIngameForge extends GuiIngame if (absorbRemaining > 0.0F) { if (absorbRemaining == absorb && absorb % 2.0F == 1.0F) + { drawTexturedModalRect(x, y, MARGIN + 153, TOP, 9, 9); //17 + absorbRemaining -= 1.0F; + } else + { drawTexturedModalRect(x, y, MARGIN + 144, TOP, 9, 9); //16 - absorbRemaining -= 2.0F; + absorbRemaining -= 2.0F; + } } else { @@ -452,7 +468,7 @@ public class GuiIngameForge extends GuiIngame int icon = 16; byte backgound = 0; - if (mc.thePlayer.isPotionActive(Potion.hunger)) + if (mc.thePlayer.isPotionActive(MobEffects.hunger)) { icon += 36; backgound = 13; @@ -610,7 +626,7 @@ public class GuiIngameForge extends GuiIngame GlStateManager.pushMatrix(); GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); FontRenderer font = highlightingItemStack.getItem().getFontRenderer(highlightingItemStack); if (font != null) { @@ -704,7 +720,7 @@ public class GuiIngameForge extends GuiIngame GlStateManager.pushMatrix(); GlStateManager.translate((float)(width / 2), (float)(height - 68), 0.0F); GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); int color = (recordIsPlaying ? Color.HSBtoRGB(hue / 50.0F, 0.7F, 0.6F) & WHITE : WHITE); fontrenderer.drawString(recordPlaying, -fontrenderer.getStringWidth(recordPlaying) / 2, -4, color | (opacity << 24)); GlStateManager.disableBlend(); @@ -737,7 +753,7 @@ public class GuiIngameForge extends GuiIngame GlStateManager.pushMatrix(); GlStateManager.translate((float)(width / 2), (float)(height / 2), 0.0F); GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.pushMatrix(); GlStateManager.scale(4.0F, 4.0F, 4.0F); int l = opacity << 24 & -16777216; @@ -793,7 +809,7 @@ public class GuiIngameForge extends GuiIngame protected void renderHealthMount(int width, int height) { EntityPlayer player = (EntityPlayer)mc.getRenderViewEntity(); - Entity tmp = player.ridingEntity; + Entity tmp = player.func_184187_bx(); if (!(tmp instanceof EntityLivingBase)) return; bind(icons); diff --git a/src/main/java/net/minecraftforge/client/event/DrawBlockHighlightEvent.java b/src/main/java/net/minecraftforge/client/event/DrawBlockHighlightEvent.java index b962071ebd..0108901947 100644 --- a/src/main/java/net/minecraftforge/client/event/DrawBlockHighlightEvent.java +++ b/src/main/java/net/minecraftforge/client/event/DrawBlockHighlightEvent.java @@ -3,7 +3,6 @@ package net.minecraftforge.client.event; import net.minecraftforge.fml.common.eventhandler.Cancelable; import net.minecraftforge.fml.common.eventhandler.Event; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; import net.minecraft.util.math.RayTraceResult; import net.minecraft.client.renderer.RenderGlobal; @@ -16,7 +15,7 @@ public class DrawBlockHighlightEvent extends Event public final int subID; public final float partialTicks; - public DrawBlockHighlightEvent(RenderGlobal context, EntityPlayer player, RayTraceResult target, int subID, ItemStack currentItem, float partialTicks) + public DrawBlockHighlightEvent(RenderGlobal context, EntityPlayer player, RayTraceResult target, int subID, float partialTicks) { this.context = context; this.player = player; diff --git a/src/main/java/net/minecraftforge/client/event/RenderGameOverlayEvent.java b/src/main/java/net/minecraftforge/client/event/RenderGameOverlayEvent.java index 0a7671a29e..f70b0f577d 100644 --- a/src/main/java/net/minecraftforge/client/event/RenderGameOverlayEvent.java +++ b/src/main/java/net/minecraftforge/client/event/RenderGameOverlayEvent.java @@ -28,7 +28,9 @@ public class RenderGameOverlayEvent extends Event JUMPBAR, CHAT, PLAYER_LIST, - DEBUG + DEBUG, + POTION_ICONS, + SUBTITLES } public final float partialTicks; diff --git a/src/main/java/net/minecraftforge/client/event/sound/PlayBackgroundMusicEvent.java b/src/main/java/net/minecraftforge/client/event/sound/PlayBackgroundMusicEvent.java deleted file mode 100644 index 77a2ad8dd0..0000000000 --- a/src/main/java/net/minecraftforge/client/event/sound/PlayBackgroundMusicEvent.java +++ /dev/null @@ -1,16 +0,0 @@ -package net.minecraftforge.client.event.sound; - -import net.minecraft.client.audio.SoundManager; -import net.minecraft.client.audio.SoundPoolEntry; - -/** - * Raised when the SoundManager tries to play a Background Music file, - * If you return null from this function it will prevent the sound from being played, - * you can return a different entry if you want to change the sound being played. - */ -@Deprecated // Remove in 1.8 -public class PlayBackgroundMusicEvent extends SoundResultEvent -{ - public PlayBackgroundMusicEvent(SoundManager manager, SoundPoolEntry entry) - { super(manager, entry, null, 0.0f, 0.0f); } -} \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/client/event/sound/PlaySoundEffectEvent.java b/src/main/java/net/minecraftforge/client/event/sound/PlaySoundEffectEvent.java deleted file mode 100644 index 7c7268fcc2..0000000000 --- a/src/main/java/net/minecraftforge/client/event/sound/PlaySoundEffectEvent.java +++ /dev/null @@ -1,11 +0,0 @@ -package net.minecraftforge.client.event.sound; - -import net.minecraft.client.audio.SoundManager; -import net.minecraft.client.audio.SoundPoolEntry; - -@Deprecated //Remove in 1.8 -public class PlaySoundEffectEvent extends SoundResultEvent -{ - public PlaySoundEffectEvent(SoundManager manager, SoundPoolEntry source, String name, float volume, float pitch) - { super(manager, source, name, volume, pitch); } -} diff --git a/src/main/java/net/minecraftforge/client/event/sound/PlaySoundEffectSourceEvent.java b/src/main/java/net/minecraftforge/client/event/sound/PlaySoundEffectSourceEvent.java deleted file mode 100644 index 82b2600862..0000000000 --- a/src/main/java/net/minecraftforge/client/event/sound/PlaySoundEffectSourceEvent.java +++ /dev/null @@ -1,16 +0,0 @@ -package net.minecraftforge.client.event.sound; - -import net.minecraft.client.audio.SoundManager; - -@Deprecated //Remove in 1.8 -public class PlaySoundEffectSourceEvent extends SoundEvent -{ - public final SoundManager manager; - public final String name; - public PlaySoundEffectSourceEvent(SoundManager manager, String name) - { - super(manager); - this.manager = manager; - this.name = name; - } -} diff --git a/src/main/java/net/minecraftforge/client/event/sound/PlaySoundEvent.java b/src/main/java/net/minecraftforge/client/event/sound/PlaySoundEvent.java index d3ae0382fb..b7fa7d7c4c 100644 --- a/src/main/java/net/minecraftforge/client/event/sound/PlaySoundEvent.java +++ b/src/main/java/net/minecraftforge/client/event/sound/PlaySoundEvent.java @@ -1,7 +1,6 @@ package net.minecraftforge.client.event.sound; import net.minecraft.client.audio.ISound; -import net.minecraft.client.audio.SoundCategory; import net.minecraft.client.audio.SoundManager; /*** @@ -14,14 +13,12 @@ public class PlaySoundEvent extends SoundEvent { public final String name; public final ISound sound; - public final SoundCategory category; public ISound result; - public PlaySoundEvent(SoundManager manager, ISound sound, SoundCategory category) + public PlaySoundEvent(SoundManager manager, ISound sound) { super(manager); this.sound = sound; - this.category = category; this.name = sound.getSoundLocation().getResourcePath(); this.result = sound; } diff --git a/src/main/java/net/minecraftforge/client/event/sound/PlayStreamingEvent.java b/src/main/java/net/minecraftforge/client/event/sound/PlayStreamingEvent.java deleted file mode 100644 index 9dda41e81e..0000000000 --- a/src/main/java/net/minecraftforge/client/event/sound/PlayStreamingEvent.java +++ /dev/null @@ -1,27 +0,0 @@ -package net.minecraftforge.client.event.sound; - -import net.minecraft.client.audio.SoundManager; -import net.minecraft.client.audio.SoundPoolEntry; - -/** - * Raised when the SoundManager tries to play a 'Streaming' file, - * in vanilla it is only the Jukebox that uses this function. - * - * If you return null from this function it will prevent the sound from being played, - * you can return a different entry if you want to change the sound being played. - * - */ -@Deprecated -public class PlayStreamingEvent extends SoundResultEvent -{ - public final float x; - public final float y; - public final float z; - public PlayStreamingEvent(SoundManager manager, SoundPoolEntry source, String name, float x, float y, float z) - { - super(manager, source, name, 0.0f, 0.0f); - this.x = x; - this.y = y; - this.z = z; - } -} \ No newline at end of file diff --git a/src/main/java/net/minecraftforge/client/event/sound/SoundEvent.java b/src/main/java/net/minecraftforge/client/event/sound/SoundEvent.java index c13d55b4b4..dbfecd03a7 100644 --- a/src/main/java/net/minecraftforge/client/event/sound/SoundEvent.java +++ b/src/main/java/net/minecraftforge/client/event/sound/SoundEvent.java @@ -3,8 +3,6 @@ package net.minecraftforge.client.event.sound; import net.minecraftforge.fml.common.eventhandler.Event; import net.minecraft.client.audio.ISound; import net.minecraft.client.audio.SoundManager; -import net.minecraft.client.audio.SoundPoolEntry; -import net.minecraftforge.common.MinecraftForge; public class SoundEvent extends Event { @@ -14,13 +12,6 @@ public class SoundEvent extends Event this.manager = manager; } - @Deprecated - public static SoundPoolEntry getResult(SoundResultEvent event) - { - MinecraftForge.EVENT_BUS.post(event); - return event.result; - } - public static class SoundSourceEvent extends SoundEvent { public final ISound sound; @@ -35,4 +26,4 @@ public class SoundEvent extends Event this.uuid = uuid; } } -} \ No newline at end of file +} diff --git a/src/main/java/net/minecraftforge/client/event/sound/SoundLoadEvent.java b/src/main/java/net/minecraftforge/client/event/sound/SoundLoadEvent.java index eaff83becb..bcede8ad9f 100644 --- a/src/main/java/net/minecraftforge/client/event/sound/SoundLoadEvent.java +++ b/src/main/java/net/minecraftforge/client/event/sound/SoundLoadEvent.java @@ -3,16 +3,13 @@ package net.minecraftforge.client.event.sound; import net.minecraft.client.audio.SoundManager; /** - * Raised by the SoundManager.loadSoundSettings, this would be a good place for + * Raised by the SoundManager.loadSoundSettings, this would be a good place for * adding your custom sounds to the SoundPool. */ public class SoundLoadEvent extends SoundEvent { - @Deprecated - public final SoundManager manager; public SoundLoadEvent(SoundManager manager) { super(manager); - this.manager = manager; } } diff --git a/src/main/java/net/minecraftforge/client/event/sound/SoundResultEvent.java b/src/main/java/net/minecraftforge/client/event/sound/SoundResultEvent.java deleted file mode 100644 index c3d431b640..0000000000 --- a/src/main/java/net/minecraftforge/client/event/sound/SoundResultEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -package net.minecraftforge.client.event.sound; - -import net.minecraft.client.audio.SoundManager; -import net.minecraft.client.audio.SoundPoolEntry; - -@Deprecated //Remove in 1.8 -public abstract class SoundResultEvent extends SoundEvent -{ - public final SoundManager manager; - public final SoundPoolEntry source; - public final String name; - public final float volume; - public final float pitch; - public SoundPoolEntry result; - - public SoundResultEvent(SoundManager manager, SoundPoolEntry source, String name, float volume, float pitch) - { - super(manager); - this.manager = manager; - this.source = source; - this.name = name; - this.volume = volume; - this.pitch = pitch; - this.result = source; - } -} diff --git a/src/main/java/net/minecraftforge/client/event/sound/SoundSetupEvent.java b/src/main/java/net/minecraftforge/client/event/sound/SoundSetupEvent.java index 2c6b454125..ef5cb37ed5 100644 --- a/src/main/java/net/minecraftforge/client/event/sound/SoundSetupEvent.java +++ b/src/main/java/net/minecraftforge/client/event/sound/SoundSetupEvent.java @@ -3,16 +3,13 @@ package net.minecraftforge.client.event.sound; import net.minecraft.client.audio.SoundManager; /** - * This event is raised by the SoundManager when it does its first setup of the + * This event is raised by the SoundManager when it does its first setup of the * SoundSystemConfig's codecs, use this function to add your own codecs. */ public class SoundSetupEvent extends SoundEvent { - @Deprecated - public final SoundManager manager; public SoundSetupEvent(SoundManager manager) { super(manager); - this.manager = manager; } } diff --git a/src/main/java/net/minecraftforge/common/DimensionManager.java b/src/main/java/net/minecraftforge/common/DimensionManager.java index 096457fc31..246ce6c9a6 100644 --- a/src/main/java/net/minecraftforge/common/DimensionManager.java +++ b/src/main/java/net/minecraftforge/common/DimensionManager.java @@ -186,19 +186,19 @@ public class DimensionManager return worlds.keySet().toArray(new Integer[worlds.size()]); //Only loaded dims, since usually used to cycle through loaded worlds } - public static void setWorld(int id, WorldServer world) + public static void setWorld(int id, WorldServer world, MinecraftServer server) { if (world != null) { worlds.put(id, world); weakWorldMap.put(world, world); - MinecraftServer.getServer().worldTickTimes.put(id, new long[100]); + server.worldTickTimes.put(id, new long[100]); FMLLog.info("Loading dimension %d (%s) (%s)", id, world.getWorldInfo().getWorldName(), world.getMinecraftServer()); } else { worlds.remove(id); - MinecraftServer.getServer().worldTickTimes.remove(id); + server.worldTickTimes.remove(id); FMLLog.info("Unloading dimension %d", id); } @@ -220,7 +220,7 @@ public class DimensionManager tmp.add(entry.getValue()); } - MinecraftServer.getServer().worldServers = tmp.toArray(new WorldServer[tmp.size()]); + server.worldServers = tmp.toArray(new WorldServer[tmp.size()]); } public static void initDimension(int dim) @@ -334,7 +334,7 @@ public class DimensionManager { MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(w)); w.flush(); - setWorld(id, null); + setWorld(id, null, w.getMinecraftServer()); } } } @@ -414,16 +414,16 @@ public class DimensionManager if (DimensionManager.getWorld(0) != null) { return ((SaveHandler)DimensionManager.getWorld(0).getSaveHandler()).getWorldDirectory(); - } + }/* else if (MinecraftServer.getServer() != null) { MinecraftServer srv = MinecraftServer.getServer(); SaveHandler saveHandler = (SaveHandler) srv.getActiveAnvilConverter().getSaveLoader(srv.getFolderName(), false); return saveHandler.getWorldDirectory(); - } + }*/ else { return null; } } -} \ No newline at end of file +} diff --git a/src/main/java/net/minecraftforge/common/ForgeHooks.java b/src/main/java/net/minecraftforge/common/ForgeHooks.java index c2d747ab1c..052d76944d 100644 --- a/src/main/java/net/minecraftforge/common/ForgeHooks.java +++ b/src/main/java/net/minecraftforge/common/ForgeHooks.java @@ -20,6 +20,7 @@ import java.util.regex.Pattern; import net.minecraft.block.Block; import net.minecraft.block.BlockLiquid; +import net.minecraft.block.BlockTrapDoor; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; @@ -73,6 +74,7 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextFormatting; @@ -487,13 +489,13 @@ public class ForgeHooks return (MinecraftForge.EVENT_BUS.post(event) ? null : new float[]{event.distance, event.damageMultiplier}); } - public static boolean isLivingOnLadder(Block block, World world, BlockPos pos, EntityLivingBase entity) + public static boolean isLivingOnLadder(IBlockState state, World world, BlockPos pos, EntityLivingBase entity) { boolean isSpectator = (entity instanceof EntityPlayer && ((EntityPlayer)entity).isSpectator()); if (isSpectator) return false; if (!ForgeModContainer.fullBoundingBoxLadders) { - return block != null && block.isLadder(world, pos, entity); + return state != null && state.getBlock().isLadder(state, world, pos, entity); } else { @@ -508,7 +510,8 @@ public class ForgeHooks for (int z2 = mZ; z2 < bb.maxZ; z2++) { BlockPos tmp = new BlockPos(x2, y2, z2); - if (world.getBlockState(tmp).getBlock().isLadder(world, tmp, entity)) + state = world.getBlockState(tmp); + if (state.getBlock().isLadder(state, world, tmp, entity)) { return true; } @@ -542,7 +545,7 @@ public class ForgeHooks return null; } - player.joinEntityItemWithWorld(event.entityItem); + player.getEntityWorld().spawnEntityInWorld(event.entityItem); return event.entityItem; } @@ -870,11 +873,6 @@ public class ForgeHooks return null; } - public static WorldGeneratorBonusChest getBonusChest(Random rand) - { - return new WorldGeneratorBonusChest(ChestGenHooks.getItems(ChestGenHooks.BONUS_CHEST, rand), ChestGenHooks.getCount(ChestGenHooks.BONUS_CHEST, rand)); - } - public static boolean isInsideOfMaterial(Material material, Entity entity, BlockPos pos) { IBlockState state = entity.worldObj.getBlockState(pos); @@ -926,16 +924,16 @@ public class ForgeHooks return !event.isCanceled(); } - public static MovingObjectPosition rayTraceEyes(EntityLivingBase entity, double length) + public static RayTraceResult rayTraceEyes(EntityLivingBase entity, double length) { - Vec3 startPos = new Vec3(entity.posX, entity.posY + entity.getEyeHeight(), entity.posZ); - Vec3 endPos = startPos.add(new Vec3(entity.getLookVec().xCoord * length, entity.getLookVec().yCoord * length, entity.getLookVec().zCoord * length)); + Vec3d startPos = new Vec3d(entity.posX, entity.posY + entity.getEyeHeight(), entity.posZ); + Vec3d endPos = startPos.add(new Vec3d(entity.getLookVec().xCoord * length, entity.getLookVec().yCoord * length, entity.getLookVec().zCoord * length)); return entity.worldObj.rayTraceBlocks(startPos, endPos); } - public static Vec3 rayTraceEyeHitVec(EntityLivingBase entity, double length) + public static Vec3d rayTraceEyeHitVec(EntityLivingBase entity, double length) { - MovingObjectPosition movingObjectPosition = rayTraceEyes(entity, length); - return movingObjectPosition == null ? null : movingObjectPosition.hitVec; + RayTraceResult git = rayTraceEyes(entity, length); + return git == null ? null : git.hitVec; } } diff --git a/src/main/java/net/minecraftforge/common/brewing/BrewingRecipeRegistry.java b/src/main/java/net/minecraftforge/common/brewing/BrewingRecipeRegistry.java index 07ea61ce77..af55434bc0 100644 --- a/src/main/java/net/minecraftforge/common/brewing/BrewingRecipeRegistry.java +++ b/src/main/java/net/minecraftforge/common/brewing/BrewingRecipeRegistry.java @@ -17,7 +17,7 @@ public class BrewingRecipeRegistry { /** * Adds a recipe to the registry. Due to the nature of the brewing stand * inputs that stack (a.k.a max stack size > 1) are not allowed. - * + * * @param input * The ItemStack that goes in same slots as the water bottles * would. @@ -36,7 +36,7 @@ public class BrewingRecipeRegistry { /** * Adds a recipe to the registry. Due to the nature of the brewing stand * inputs that stack (a.k.a max stack size > 1) are not allowed. - * + * * @param input * The ItemStack that goes in same slots as the water bottles * would. @@ -168,4 +168,4 @@ public class BrewingRecipeRegistry { { return Collections.unmodifiableList(recipes); } -} \ No newline at end of file +}