diff --git a/rejects/minecraft/net/minecraft/block/Block.java.patch.rej b/rejects/minecraft/net/minecraft/block/Block.java.patch.rej new file mode 100644 index 000000000..d61ccd936 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/Block.java.patch.rej @@ -0,0 +1,91 @@ +++++ REJECTED PATCH 1 + 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(); ++ @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); +++++ END PATCH +++++ REJECTED PATCH 6 + public int getMixedBrightnessForBlock(IBlockAccess worldIn, BlockPos pos) + { + Block block = worldIn.getBlockState(pos).getBlock(); +- int i = worldIn.getCombinedLight(pos, block.getLightValue()); ++ int i = worldIn.getCombinedLight(pos, block.getLightValue(worldIn, pos)); + + 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)); + } + else + { +++++ END PATCH +++++ REJECTED PATCH 7 + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { +- return side == EnumFacing.DOWN && this.minY > 0.0D ? true : (side == EnumFacing.UP && this.maxY < 1.0D ? true : (side == EnumFacing.NORTH && this.minZ > 0.0D ? true : (side == EnumFacing.SOUTH && this.maxZ < 1.0D ? true : (side == EnumFacing.WEST && this.minX > 0.0D ? true : (side == EnumFacing.EAST && this.maxX < 1.0D ? true : !worldIn.getBlockState(pos).getBlock().isOpaqueCube()))))); ++ return side == EnumFacing.DOWN && this.minY > 0.0D ? true : (side == EnumFacing.UP && this.maxY < 1.0D ? true : (side == EnumFacing.NORTH && this.minZ > 0.0D ? true : (side == EnumFacing.SOUTH && this.maxZ < 1.0D ? true : (side == EnumFacing.WEST && this.minX > 0.0D ? true : (side == EnumFacing.EAST && this.maxX < 1.0D ? true : !worldIn.getBlockState(pos).getBlock().doesSideBlockRendering(worldIn, pos, side)))))); + } + + public boolean isBlockSolid(IBlockAccess worldIn, BlockPos pos, EnumFacing side) +++++ END PATCH +++++ REJECTED PATCH 9 + + public float getPlayerRelativeBlockHardness(EntityPlayer playerIn, World worldIn, BlockPos pos) + { +- 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); + } + + public final void dropBlockAsItem(World worldIn, BlockPos pos, IBlockState state, int forture) +++++ END PATCH +++++ REJECTED PATCH 13 + player.triggerAchievement(StatList.mineBlockStatArray[getIdFromBlock(this)]); + player.addExhaustion(0.025F); + +- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(player)) ++ if (this.canSilkHarvest(worldIn, pos, worldIn.getBlockState(pos), player) && EnchantmentHelper.getSilkTouchModifier(player)) + { ++ java.util.ArrayList items = new java.util.ArrayList(); + ItemStack itemstack = this.createStackedBlock(state); + + if (itemstack != null) + { +- spawnAsEntity(worldIn, pos, itemstack); ++ items.add(itemstack); + } ++ ++ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, worldIn, pos, worldIn.getBlockState(pos), 0, 1.0f, true, player); ++ for (ItemStack stack : items) ++ { ++ spawnAsEntity(worldIn, pos, stack); ++ } + } + else + { ++ harvesters.set(player); + int i = EnchantmentHelper.getFortuneModifier(player); + this.dropBlockAsItem(worldIn, pos, state, i); ++ harvesters.set(null); + } + } + ++ @Deprecated //Forge: State sensitive version + protected boolean canSilkHarvest() + { +- return this.isFullCube() && !this.isBlockContainer; ++ return this.isFullCube() && !this.hasTileEntity(silk_check_state.get()); + } + + protected ItemStack createStackedBlock(IBlockState state) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockBanner.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockBanner.java.patch.rej new file mode 100644 index 000000000..f9e04393a --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockBanner.java.patch.rej @@ -0,0 +1,24 @@ +++++ REJECTED PATCH 1 + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { +- TileEntity tileentity = worldIn.getTileEntity(pos); +- +- if (tileentity instanceof TileEntityBanner) + { +- ItemStack itemstack = new ItemStack(Items.banner, 1, ((TileEntityBanner)tileentity).getBaseColor()); +- NBTTagCompound nbttagcompound = new NBTTagCompound(); +- tileentity.writeToNBT(nbttagcompound); +- nbttagcompound.removeTag("x"); +- nbttagcompound.removeTag("y"); +- nbttagcompound.removeTag("z"); +- nbttagcompound.removeTag("id"); +- itemstack.setTagInfo("BlockEntityTag", nbttagcompound); +- spawnAsEntity(worldIn, pos, itemstack); +- } +- else +- { + super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockBush.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockBush.java.patch.rej new file mode 100644 index 000000000..486e8a9c0 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockBush.java.patch.rej @@ -0,0 +1,23 @@ +++++ REJECTED PATCH 2 + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { +- 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); + } + + protected boolean canPlaceBlockOn(Block ground) +++++ END PATCH +++++ REJECTED PATCH 3 + + public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + { +- 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); + } + + public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockButton.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockButton.java.patch.rej new file mode 100644 index 000000000..c5be66b87 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockButton.java.patch.rej @@ -0,0 +1,11 @@ +++++ REJECTED PATCH 1 + + 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.DOWN && World.doesBlockHaveSolidTopSurface(p_181088_0_, p_181088_1_.down()) ? true : p_181088_0_.isSideSolid(p_181088_1_.offset(p_181088_2_), p_181088_2_.getOpposite()); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockCactus.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockCactus.java.patch.rej new file mode 100644 index 000000000..1ee2a7d58 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockCactus.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 2 + } + + Block block = worldIn.getBlockState(pos.down()).getBlock(); +- return block == Blocks.cactus || block == Blocks.sand; ++ return block.canSustainPlant(worldIn, pos.down(), EnumFacing.UP, this); + } + + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockChest.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockChest.java.patch.rej new file mode 100644 index 000000000..04c3b7337 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockChest.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + + private boolean isBelowSolidBlock(World worldIn, BlockPos pos) + { +- return worldIn.getBlockState(pos.up()).getBlock().isNormalCube(); ++ return worldIn.isSideSolid(pos.up(), EnumFacing.DOWN, false); + } + + private boolean isOcelotSittingOnChest(World worldIn, BlockPos pos) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockCrops.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockCrops.java.patch.rej new file mode 100644 index 000000000..a7266477b --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockCrops.java.patch.rej @@ -0,0 +1,36 @@ +++++ REJECTED PATCH 2 + + public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + { +- 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); + } + + protected Item getSeed() +++++ END PATCH +++++ REJECTED PATCH 3 + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, pos, state, chance, 0); +- +- if (!worldIn.isRemote) +- { +- int i = ((Integer)state.getValue(AGE)).intValue(); +- +- if (i >= 7) +- { +- int j = 3 + fortune; +- +- for (int k = 0; k < j; ++k) +- { +- if (worldIn.rand.nextInt(15) <= i) +- { +- spawnAsEntity(worldIn, pos, new ItemStack(this.getSeed(), 1, 0)); +- } +- } +- } +- } + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockDeadBush.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockDeadBush.java.patch.rej new file mode 100644 index 000000000..4f374066a --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockDeadBush.java.patch.rej @@ -0,0 +1,23 @@ +++++ REJECTED PATCH 2 + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { +- if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) + { +- player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); +- spawnAsEntity(worldIn, pos, new ItemStack(Blocks.deadbush, 1, 0)); +- } +- else +- { + super.harvestBlock(worldIn, player, pos, state, te); + } + } ++ ++ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; } ++ @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))); ++ } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockDoor.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockDoor.java.patch.rej new file mode 100644 index 000000000..52398567d --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockDoor.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 2 + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { +- 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()); + } + + public int getMobilityFlag() +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockDoublePlant.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockDoublePlant.java.patch.rej new file mode 100644 index 000000000..3ee051366 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockDoublePlant.java.patch.rej @@ -0,0 +1,19 @@ +++++ REJECTED PATCH 4 + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { +- if (worldIn.isRemote || player.getCurrentEquippedItem() == null || player.getCurrentEquippedItem().getItem() != Items.shears || state.getValue(HALF) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.onHarvest(worldIn, pos, state, player)) + { + super.harvestBlock(worldIn, player, pos, state, te); + } +++++ END PATCH +++++ REJECTED PATCH 5 + 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)); + return true; + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockFalling.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockFalling.java.patch.rej new file mode 100644 index 000000000..1e3ea5ded --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockFalling.java.patch.rej @@ -0,0 +1,9 @@ +++++ REJECTED PATCH 1 + + public static boolean canFallInto(World worldIn, BlockPos pos) + { ++ 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; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockFire.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockFire.java.patch.rej new file mode 100644 index 000000000..f7a3c601f --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockFire.java.patch.rej @@ -0,0 +1,98 @@ +++++ REJECTED PATCH 1 + int j = pos.getY(); + int k = pos.getZ(); + +- 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)) + { + 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)) + { + 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)); + } + else + { +++++ END PATCH +++++ REJECTED PATCH 3 + } + + Block block = worldIn.getBlockState(pos.down()).getBlock(); +- boolean flag = block == Blocks.netherrack; ++ boolean flag = block.isFireSource(worldIn, pos.down(), EnumFacing.UP); + +- if (worldIn.provider instanceof WorldProviderEnd && block == Blocks.bedrock) +- { +- flag = true; +- } +- + if (!flag && worldIn.isRaining() && this.canDie(worldIn, pos)) + { + worldIn.setBlockToAir(pos); +++++ END PATCH +++++ REJECTED PATCH 10 + 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); + } + +- 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 (Blocks.fire.canCatchFire(worldIn, pos.west())) ++ if (Blocks.fire.canCatchFire(worldIn, pos.west(), EnumFacing.EAST)) + { + for (int j = 0; j < 2; ++j) + { +++++ END PATCH +++++ REJECTED PATCH 11 + } + } + +- if (Blocks.fire.canCatchFire(worldIn, pos.east())) ++ if (Blocks.fire.canCatchFire(worldIn, pos.east(), EnumFacing.WEST)) + { + for (int k = 0; k < 2; ++k) + { +++++ END PATCH +++++ REJECTED PATCH 12 + } + } + +- if (Blocks.fire.canCatchFire(worldIn, pos.north())) ++ if (Blocks.fire.canCatchFire(worldIn, pos.north(), EnumFacing.SOUTH)) + { + for (int l = 0; l < 2; ++l) + { +++++ END PATCH +++++ REJECTED PATCH 13 + } + } + +- if (Blocks.fire.canCatchFire(worldIn, pos.south())) ++ if (Blocks.fire.canCatchFire(worldIn, pos.south(), EnumFacing.NORTH)) + { + for (int i1 = 0; i1 < 2; ++i1) + { +++++ END PATCH +++++ REJECTED PATCH 14 + } + } + +- if (Blocks.fire.canCatchFire(worldIn, pos.up())) ++ if (Blocks.fire.canCatchFire(worldIn, pos.up(), EnumFacing.DOWN)) + { + for (int j1 = 0; j1 < 2; ++j1) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockGrass.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockGrass.java.patch.rej new file mode 100644 index 000000000..279e147ef --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockGrass.java.patch.rej @@ -0,0 +1,20 @@ +++++ REJECTED PATCH 1 + { + if (!worldIn.isRemote) + { +- 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) + { + worldIn.setBlockState(pos, Blocks.dirt.getDefaultState()); + } +++++ END PATCH +++++ REJECTED PATCH 2 + Block block = worldIn.getBlockState(blockpos.up()).getBlock(); + IBlockState iblockstate = worldIn.getBlockState(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) + { + worldIn.setBlockState(blockpos, Blocks.grass.getDefaultState()); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockIce.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockIce.java.patch.rej new file mode 100644 index 000000000..f817b3e8d --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockIce.java.patch.rej @@ -0,0 +1,35 @@ +++++ REJECTED PATCH 1 + player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + player.addExhaustion(0.025F); + +- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(player)) ++ if (this.canSilkHarvest(worldIn, pos, worldIn.getBlockState(pos), player) && EnchantmentHelper.getSilkTouchModifier(player)) + { ++ java.util.List items = new java.util.ArrayList(); + ItemStack itemstack = this.createStackedBlock(state); + +- if (itemstack != null) +- { +- spawnAsEntity(worldIn, pos, itemstack); +- } ++ if (itemstack != null) items.add(itemstack); ++ ++ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, worldIn, pos, worldIn.getBlockState(pos), 0, 1.0f, true, player); ++ ++ for (ItemStack is : items) ++ spawnAsEntity(worldIn, pos, is); + } + else + { +++++ END PATCH +++++ REJECTED PATCH 2 + } + + int i = EnchantmentHelper.getFortuneModifier(player); ++ harvesters.set(player); + this.dropBlockAsItem(worldIn, pos, state, i); ++ harvesters.set(null); + Material material = worldIn.getBlockState(pos.down()).getBlock().getMaterial(); + + if (material.blocksMovement() || material.isLiquid()) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockLadder.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockLadder.java.patch.rej new file mode 100644 index 000000000..505d3e36f --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockLadder.java.patch.rej @@ -0,0 +1,23 @@ +++++ REJECTED PATCH 1 + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { +- 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); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) +++++ END PATCH +++++ REJECTED PATCH 2 + + protected boolean canBlockStay(World worldIn, BlockPos pos, EnumFacing facing) + { +- return worldIn.getBlockState(pos.offset(facing.getOpposite())).getBlock().isNormalCube(); ++ return worldIn.isSideSolid(pos.offset(facing.getOpposite()), facing, true); + } + + public IBlockState getStateFromMeta(int meta) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockLeaves.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockLeaves.java.patch.rej new file mode 100644 index 000000000..a5f1a72c8 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockLeaves.java.patch.rej @@ -0,0 +1,36 @@ +++++ REJECTED PATCH 1 + import net.minecraftforge.fml.relauncher.Side; + import net.minecraftforge.fml.relauncher.SideOnly; + +-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"); +++++ END PATCH +++++ REJECTED PATCH 2 + BlockPos blockpos = pos.add(j1, k1, l1); + IBlockState iblockstate = worldIn.getBlockState(blockpos); + +- if (iblockstate.getBlock().getMaterial() == Material.leaves && !((Boolean)iblockstate.getValue(CHECK_DECAY)).booleanValue()) ++ if (iblockstate.getBlock().isLeaves(worldIn, blockpos)) + { +- worldIn.setBlockState(blockpos, iblockstate.withProperty(CHECK_DECAY, Boolean.valueOf(true)), 4); ++ iblockstate.getBlock().beginLeavesDecay(worldIn, blockpos); + } + } + } +++++ END PATCH +++++ REJECTED PATCH 3 + { + Block block = worldIn.getBlockState(blockpos$mutableblockpos.set(k + i2, l + j2, i1 + k2)).getBlock(); + +- if (block != Blocks.log && block != Blocks.log2) ++ if (!block.canSustainLeaves(worldIn, blockpos$mutableblockpos.set(k + i2, l + j2, i1 + k2))) + { +- if (block.getMaterial() == Material.leaves) ++ if (block.isLeaves(worldIn, blockpos$mutableblockpos.set(k + i2, l + j2, i1 + k2))) + { + this.surroundings[(i2 + l1) * k1 + (j2 + l1) * j1 + k2 + l1] = -2; + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockLog.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockLog.java.patch.rej new file mode 100644 index 000000000..b6f0ea738 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockLog.java.patch.rej @@ -0,0 +1,13 @@ +++++ REJECTED PATCH 1 + { + IBlockState iblockstate = worldIn.getBlockState(blockpos); + +- if (iblockstate.getBlock().getMaterial() == Material.leaves && !((Boolean)iblockstate.getValue(BlockLeaves.CHECK_DECAY)).booleanValue()) ++ if (iblockstate.getBlock().isLeaves(worldIn, blockpos)) + { +- worldIn.setBlockState(blockpos, iblockstate.withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(true)), 4); ++ iblockstate.getBlock().beginLeavesDecay(worldIn, blockpos); + } + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockMobSpawner.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockMobSpawner.java.patch.rej new file mode 100644 index 000000000..4d2b2a44d --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockMobSpawner.java.patch.rej @@ -0,0 +1,18 @@ +++++ REJECTED PATCH 1 + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); +- int i = 15 + worldIn.rand.nextInt(15) + worldIn.rand.nextInt(15); +- this.dropXpOnBlockBreak(worldIn, pos, i); + } + ++ @Override ++ public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune) ++ { ++ return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15); ++ } ++ + public boolean isOpaqueCube() + { + return false; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockMushroom.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockMushroom.java.patch.rej new file mode 100644 index 000000000..3f22ed398 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockMushroom.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + if (pos.getY() >= 0 && pos.getY() < 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)); + } + else + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockMycelium.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockMycelium.java.patch.rej new file mode 100644 index 000000000..0124ec07f --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockMycelium.java.patch.rej @@ -0,0 +1,20 @@ +++++ REJECTED PATCH 1 + { + if (!worldIn.isRemote) + { +- 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) + { + worldIn.setBlockState(pos, Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT)); + } +++++ END PATCH +++++ REJECTED PATCH 2 + IBlockState iblockstate = worldIn.getBlockState(blockpos); + Block block = worldIn.getBlockState(blockpos.up()).getBlock(); + +- 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) + { + worldIn.setBlockState(blockpos, this.getDefaultState()); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockNetherWart.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockNetherWart.java.patch.rej new file mode 100644 index 000000000..21e6728f2 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockNetherWart.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + + public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + { +- return this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); ++ return super.canBlockStay(worldIn, pos, state); + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockNewLeaf.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockNewLeaf.java.patch.rej new file mode 100644 index 000000000..5718e98e1 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockNewLeaf.java.patch.rej @@ -0,0 +1,23 @@ +++++ REJECTED PATCH 1 + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { +- if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) + { +- player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); +- spawnAsEntity(worldIn, pos, new ItemStack(Item.getItemFromBlock(this), 1, ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata() - 4)); +- } +- else +- { + super.harvestBlock(worldIn, player, pos, state, te); + } + } ++ ++ @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))); ++ } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockOldLeaf.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockOldLeaf.java.patch.rej new file mode 100644 index 000000000..3b338ffd4 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockOldLeaf.java.patch.rej @@ -0,0 +1,20 @@ +++++ REJECTED PATCH 1 + if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) + { + player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); +- spawnAsEntity(worldIn, pos, new ItemStack(Item.getItemFromBlock(this), 1, ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata())); + } + else + { + super.harvestBlock(worldIn, player, pos, state, te); + } + } ++ ++ @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()))); ++ } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockPane.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockPane.java.patch.rej new file mode 100644 index 000000000..d8053e475 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockPane.java.patch.rej @@ -0,0 +1,16 @@ +++++ REJECTED PATCH 2 + + public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) + { +- 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); + + if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockPistonBase.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockPistonBase.java.patch.rej new file mode 100644 index 000000000..fa4f50663 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockPistonBase.java.patch.rej @@ -0,0 +1,32 @@ +++++ REJECTED PATCH 1 + } + } + +- 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)) + { + this.doMove(worldIn, pos, enumfacing, false); + } +++++ END PATCH +++++ REJECTED PATCH 2 + return false; + } + +- return !(blockIn instanceof ITileEntityProvider); ++ return !(blockIn.hasTileEntity(worldIn.getBlockState(pos))); + } + else + { +++++ END PATCH +++++ REJECTED PATCH 3 + { + BlockPos blockpos = (BlockPos)list1.get(j); + Block block = worldIn.getBlockState(blockpos).getBlock(); +- block.dropBlockAsItem(worldIn, blockpos, worldIn.getBlockState(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); + --i; + ablock[i] = block; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockPistonMoving.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockPistonMoving.java.patch.rej new file mode 100644 index 000000000..7d2e63e43 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockPistonMoving.java.patch.rej @@ -0,0 +1,19 @@ +++++ REJECTED PATCH 1 + + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { +- if (!worldIn.isRemote) +- { +- TileEntityPiston tileentitypiston = this.getTileEntity(worldIn, pos); +- +- if (tileentitypiston != null) +- { +- IBlockState iblockstate = tileentitypiston.getPistonState(); +- iblockstate.getBlock().dropBlockAsItem(worldIn, pos, iblockstate, 0); +- } +- } ++ super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); + } + + public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockPotato.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockPotato.java.patch.rej new file mode 100644 index 000000000..2296b2add --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockPotato.java.patch.rej @@ -0,0 +1,24 @@ +++++ REJECTED PATCH 1 + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); +- +- if (!worldIn.isRemote) +- { +- if (((Integer)state.getValue(AGE)).intValue() >= 7 && worldIn.rand.nextInt(50) == 0) +- { +- spawnAsEntity(worldIn, pos, new ItemStack(Items.poisonous_potato)); +- } +- } + } ++ @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); ++ 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)); ++ return ret; ++ } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockPumpkin.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockPumpkin.java.patch.rej new file mode 100644 index 000000000..8680c643d --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockPumpkin.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { +- 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()); + } + + public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockRailBase.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockRailBase.java.patch.rej new file mode 100644 index 000000000..3163ebffd --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockRailBase.java.patch.rej @@ -0,0 +1,11 @@ +++++ REJECTED PATCH 4 + 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.func_180360_a(blockrailbase$enumraildirection); + } + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch.rej new file mode 100644 index 000000000..e415ab709 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockRedstoneWire.java.patch.rej @@ -0,0 +1,59 @@ +++++ REJECTED PATCH 1 + BlockPos blockpos = pos.offset(direction); + Block block = worldIn.getBlockState(pos.offset(direction)).getBlock(); + +- if (!canConnectTo(worldIn.getBlockState(blockpos), direction) && (block.isBlockNormalCube() || !canConnectUpwardsTo(worldIn.getBlockState(blockpos.down())))) ++ if (!canRestoneConnect(worldIn, blockpos, direction) && (block.isBlockNormalCube() || !canRestoneConnect(worldIn, blockpos.down(), null))) + { + Block block1 = worldIn.getBlockState(pos.up()).getBlock(); +- return !block1.isBlockNormalCube() && block.isBlockNormalCube() && canConnectUpwardsTo(worldIn.getBlockState(blockpos.up())) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE; ++ return !block1.isBlockNormalCube() && block.isBlockNormalCube() && canRestoneConnect(worldIn, blockpos.up(), null) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE; + } + else + { +++++ END PATCH +++++ REJECTED PATCH 2 + 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))); + } + +- protected static boolean canConnectUpwardsTo(IBlockAccess worldIn, BlockPos pos) ++ protected static boolean canRestoneConnect(IBlockAccess world, BlockPos pos, EnumFacing side) + { +- return canConnectUpwardsTo(worldIn.getBlockState(pos)); +- } +- +- protected static boolean canConnectUpwardsTo(IBlockState state) +- { +- return canConnectTo(state, (EnumFacing)null); +- } +- +- protected static boolean canConnectTo(IBlockState blockState, EnumFacing side) +- { +- Block block = blockState.getBlock(); +- +- if (block == Blocks.redstone_wire) ++ IBlockState state = world.getBlockState(pos); ++ if (state.getBlock() == Blocks.redstone_wire) + { + return true; + } +- else if (Blocks.unpowered_repeater.isAssociated(block)) ++ else if (Blocks.unpowered_repeater.isAssociated(state.getBlock())) + { +- 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; + } + else + { +- return block.canProvidePower() && side != null; ++ return state.getBlock().canConnectRedstone(world, pos, side); + } + } + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockSkull.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockSkull.java.patch.rej new file mode 100644 index 000000000..25769e9b8 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockSkull.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 3 + 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()); + + if (tileentityskull.getSkullType() == 3 && tileentityskull.getPlayerProfile() != null) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockSlab.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockSlab.java.patch.rej new file mode 100644 index 000000000..bd8488f6d --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockSlab.java.patch.rej @@ -0,0 +1,19 @@ +++++ REJECTED PATCH 2 + { + return false; + } +- else +- { +- BlockPos blockpos = pos.offset(side.getOpposite()); +- IBlockState iblockstate = worldIn.getBlockState(pos); +- IBlockState iblockstate1 = worldIn.getBlockState(blockpos); +- boolean flag = isSlab(iblockstate.getBlock()) && iblockstate.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP; +- boolean flag1 = isSlab(iblockstate1.getBlock()) && iblockstate1.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP; +- return flag1 ? (side == EnumFacing.DOWN ? true : (side == EnumFacing.UP && super.shouldSideBeRendered(worldIn, pos, side) ? true : !isSlab(iblockstate.getBlock()) || !flag)) : (side == EnumFacing.UP ? true : (side == EnumFacing.DOWN && super.shouldSideBeRendered(worldIn, pos, side) ? true : !isSlab(iblockstate.getBlock()) || flag)); +- } ++ // additional logic breaks doesSideBlockRendering and is no longer useful. ++ return super.shouldSideBeRendered(worldIn, pos, side); + } + + @SideOnly(Side.CLIENT) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockSnow.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockSnow.java.patch.rej new file mode 100644 index 000000000..d0fbe7d50 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockSnow.java.patch.rej @@ -0,0 +1,22 @@ +++++ REJECTED PATCH 1 + { + 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; + } + + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) +++++ END PATCH +++++ REJECTED PATCH 3 + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { +- 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)]); + } + + public Item getItemDropped(IBlockState state, Random rand, int fortune) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockStairs.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockStairs.java.patch.rej new file mode 100644 index 000000000..22661f610 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockStairs.java.patch.rej @@ -0,0 +1,21 @@ +++++ REJECTED PATCH 1 + return false; + } + ++ @Override ++ public boolean doesSideBlockRendering(IBlockAccess world, BlockPos pos, EnumFacing face) ++ { ++ if ( isOpaqueCube() ) ++ return true; ++ ++ // face is on the block being rendered, not this block. ++ IBlockState iblockstate = world.getBlockState(pos); ++ EnumHalf half = iblockstate.getValue(HALF); ++ EnumFacing side = iblockstate.getValue(FACING); ++ return side == face.getOpposite() || (half == EnumHalf.TOP && face == EnumFacing.DOWN) || (half == EnumHalf.BOTTOM && face == EnumFacing.UP); ++ } ++ + public boolean isFullCube() + { + return false; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockTallGrass.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockTallGrass.java.patch.rej new file mode 100644 index 000000000..cd154744a --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockTallGrass.java.patch.rej @@ -0,0 +1,25 @@ +++++ REJECTED PATCH 2 + + public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) + { +- return this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock()); ++ return super.canBlockStay(worldIn, pos, state); + } + + public boolean isReplaceable(World worldIn, BlockPos pos) +++++ END PATCH +++++ REJECTED PATCH 4 + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { +- if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) + { +- player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); +- spawnAsEntity(worldIn, pos, new ItemStack(Blocks.tallgrass, 1, ((BlockTallGrass.EnumType)state.getValue(TYPE)).getMeta())); +- } +- else +- { + super.harvestBlock(worldIn, player, pos, state, te); + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockTrapDoor.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockTrapDoor.java.patch.rej new file mode 100644 index 000000000..1039e160f --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockTrapDoor.java.patch.rej @@ -0,0 +1,45 @@ +++++ REJECTED PATCH 1 + + public class BlockTrapDoor extends Block + { ++ /** 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); +++++ END PATCH +++++ REJECTED PATCH 2 + { + if (!worldIn.isRemote) + { ++ EnumFacing direction = (EnumFacing)state.getValue(FACING); + BlockPos blockpos = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite()); + +- if (!isValidSupportBlock(worldIn.getBlockState(blockpos).getBlock())) ++ if (!(isValidSupportBlock(worldIn.getBlockState(blockpos).getBlock()) || worldIn.isSideSolid(blockpos, direction, true))) + { + worldIn.setBlockToAir(pos); + this.dropBlockAsItem(worldIn, pos, state, 0); +++++ END PATCH +++++ REJECTED PATCH 3 + + public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) + { +- return !side.getAxis().isVertical() && isValidSupportBlock(worldIn.getBlockState(pos.offset(side.getOpposite())).getBlock()); ++ 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)); + } + + protected static EnumFacing getFacing(int meta) +++++ END PATCH +++++ REJECTED PATCH 4 + + private static boolean isValidSupportBlock(Block blockIn) + { ++ if (disableValidation) return true; + return blockIn.blockMaterial.isOpaque() && blockIn.isFullCube() || blockIn == Blocks.glowstone || blockIn instanceof BlockSlab || blockIn instanceof BlockStairs; + } + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockTripWireHook.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockTripWireHook.java.patch.rej new file mode 100644 index 000000000..1b124a147 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockTripWireHook.java.patch.rej @@ -0,0 +1,28 @@ +++++ REJECTED PATCH 1 + + public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side) + { +- return side.getAxis().isHorizontal() && worldIn.getBlockState(pos.offset(side.getOpposite())).getBlock().isNormalCube(); ++ return side.getAxis().isHorizontal() && worldIn.isSideSolid(pos.offset(side.getOpposite()), side, true); + } + + public boolean canPlaceBlockAt(World worldIn, BlockPos pos) + { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { +- if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock().isNormalCube()) ++ if (worldIn.isSideSolid(pos.offset(enumfacing), enumfacing.getOpposite(), true)) + { + return true; + } +++++ END PATCH +++++ REJECTED PATCH 2 + { + EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); + +- if (!worldIn.getBlockState(pos.offset(enumfacing.getOpposite())).getBlock().isNormalCube()) ++ if (!worldIn.isSideSolid(pos.offset(enumfacing.getOpposite()), enumfacing, true)) + { + this.dropBlockAsItem(worldIn, pos, state, 0); + worldIn.setBlockToAir(pos); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/BlockVine.java.patch.rej b/rejects/minecraft/net/minecraft/block/BlockVine.java.patch.rej new file mode 100644 index 000000000..64904484b --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/BlockVine.java.patch.rej @@ -0,0 +1,15 @@ +++++ REJECTED PATCH 2 + + public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te) + { +- if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) + { +- player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); +- spawnAsEntity(worldIn, pos, new ItemStack(Blocks.vine, 1, 0)); +- } +- else +- { + super.harvestBlock(worldIn, player, pos, state, te); + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch.rej b/rejects/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch.rej new file mode 100644 index 000000000..2d1af6e92 --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java.patch.rej @@ -0,0 +1,30 @@ +++++ REJECTED PATCH 1 + { + Block block = this.world.getBlockState(origin).getBlock(); + +- if (block.getMaterial() == Material.air) ++ if (block.isAir(world, origin)) + { + return true; + } +++++ END PATCH +++++ REJECTED PATCH 2 + BlockPos blockpos = origin.offset(this.moveDirection.getOpposite(), i); + block = this.world.getBlockState(blockpos).getBlock(); + +- 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)) + { + break; + } +++++ END PATCH +++++ REJECTED PATCH 3 + + block = this.world.getBlockState(blockpos1).getBlock(); + +- if (block.getMaterial() == Material.air) ++ if (block.isAir(world, blockpos1)) + { + return true; + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/block/state/BlockState.java.patch.rej b/rejects/minecraft/net/minecraft/block/state/BlockState.java.patch.rej new file mode 100644 index 000000000..ae09ac8ee --- /dev/null +++ b/rejects/minecraft/net/minecraft/block/state/BlockState.java.patch.rej @@ -0,0 +1,55 @@ +++++ REJECTED PATCH 1 + + public BlockState(Block blockIn, IProperty... properties) + { ++ this(blockIn, properties, null); ++ } ++ ++ protected StateImplementation createState(Block block, ImmutableMap properties, ImmutableMap, com.google.common.base.Optional> unlistedProperties) ++ { ++ return new StateImplementation(block, properties); ++ } ++ ++ protected BlockState(Block blockIn, IProperty[] properties, ImmutableMap, com.google.common.base.Optional> unlistedProperties) ++ { + this.block = blockIn; + Arrays.sort(properties, new Comparator() + { +++++ END PATCH +++++ REJECTED PATCH 2 + for (List list1 : Cartesian.cartesianProduct(this.getAllowedValues())) + { + 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.put(map1, blockstate$stateimplementation); + list.add(blockstate$stateimplementation); + } +++++ END PATCH +++++ REJECTED PATCH 3 + } + } + ++ protected StateImplementation(Block blockIn, ImmutableMap propertiesIn, ImmutableTable propertyValueTable) ++ { ++ this.block = blockIn; ++ this.properties = propertiesIn; ++ this.propertyValueTable = propertyValueTable; ++ } ++ + public , V extends T> IBlockState withProperty(IProperty property, V value) + { + if (!this.properties.containsKey(property)) +++++ END PATCH +++++ REJECTED PATCH 4 + map.put(property, value); + return map; + } ++ ++ public ImmutableTable getPropertyValueTable() ++ { ++ return propertyValueTable; ++ } + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/Minecraft.java.patch.rej b/rejects/minecraft/net/minecraft/client/Minecraft.java.patch.rej new file mode 100644 index 000000000..398b89ce8 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/Minecraft.java.patch.rej @@ -0,0 +1,347 @@ +++++ REJECTED PATCH 2 + 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")); +++++ END PATCH +++++ REJECTED PATCH 4 + GlStateManager.loadIdentity(); + GlStateManager.matrixMode(5888); + this.checkGLError("Startup"); +- this.textureMapBlocks = 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); ++ bar.step("Loading Model Manager"); + this.modelManager = new ModelManager(this.textureMapBlocks); + this.mcResourceManager.registerReloadListener(this.modelManager); ++ 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); ++ 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); +++++ END PATCH +++++ REJECTED PATCH 5 + this.guiAchievement = new GuiAchievement(this); + GlStateManager.viewport(0, 0, this.displayWidth, this.displayHeight); + this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine); ++ 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); + + if (this.serverName != null) + { +- this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort)); ++ net.minecraftforge.fml.client.FMLClientHandler.instance().connectToServerAtStartup(this.serverName, this.serverPort); + } + else + { + this.displayGuiScreen(new GuiMainMenu()); + } + +- this.renderEngine.deleteTexture(this.mojangLogo); ++ net.minecraftforge.fml.client.SplashProgress.clearVanillaResources(renderEngine, mojangLogo); + this.mojangLogo = null; + this.loadingScreen = new LoadingScreenRenderer(this); + ++ net.minecraftforge.fml.client.FMLClientHandler.instance().onInitializationComplete(); + if (this.gameSettings.fullScreen && !this.fullscreen) + { + this.toggleFullscreen(); +++++ END PATCH +++++ REJECTED PATCH 8 + guiScreenIn = new GuiGameOver(); + } + ++ GuiScreen old = this.currentScreen; ++ net.minecraftforge.client.event.GuiOpenEvent event = new net.minecraftforge.client.event.GuiOpenEvent(guiScreenIn); ++ ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; ++ ++ guiScreenIn = event.gui; ++ if (old != null && guiScreenIn != old) ++ { ++ old.onGuiClosed(); ++ } ++ + if (guiScreenIn instanceof GuiMainMenu) + { + this.gameSettings.showDebugInfo = false; +++++ END PATCH +++++ REJECTED PATCH 10 + + if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air && this.playerController.onPlayerDamageBlock(blockpos, this.objectMouseOver.sideHit)) + { +- this.effectRenderer.addBlockHitEffects(blockpos, this.objectMouseOver.sideHit); ++ this.effectRenderer.addBlockHitEffects(blockpos, this.objectMouseOver); + this.thePlayer.swingItem(); + } + } +++++ END PATCH +++++ REJECTED PATCH 11 + case BLOCK: + BlockPos blockpos = this.objectMouseOver.getBlockPos(); + +- if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air) ++ if (!this.theWorld.isAirBlock(blockpos)) + { + int i = itemstack != null ? itemstack.stackSize : 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, this.objectMouseOver.hitVec).isCanceled(); ++ if (result) { //Forge: Kept separate to simplify patch + if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, itemstack, blockpos, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec)) + { + flag = false; + this.thePlayer.swingItem(); + } ++ } + + if (itemstack == null) + { +++++ END PATCH +++++ REJECTED PATCH 12 + { + ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem(); + +- 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, null).isCanceled(); ++ if (result && itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1)) + { + this.entityRenderer.itemRenderer.resetEquippedProgress2(); + } +++++ END PATCH +++++ REJECTED PATCH 14 + + while (Mouse.next()) + { ++ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue; ++ + int i = Mouse.getEventButton(); + KeyBinding.setKeyBindState(i - 100, Mouse.getEventButtonState()); + +++++ END PATCH +++++ REJECTED PATCH 17 + this.myNetworkManager.processReceivedPackets(); + } + ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().onPostClientTick(); ++ + this.mcProfiler.endSection(); + this.systemTime = getSystemTime(); + } + + public void launchIntegratedServer(String folderName, String worldName, WorldSettings worldSettingsIn) + { ++ net.minecraftforge.fml.client.FMLClientHandler.instance().startIntegratedServer(folderName, worldName, worldSettingsIn); + this.loadWorld((WorldClient)null); + System.gc(); + ISaveHandler isavehandler = this.saveLoader.getSaveLoader(folderName, false); +++++ END PATCH +++++ REJECTED PATCH 19 + 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()) ++ { ++ gameProfile = sessionService.fillProfileProperties(gameProfile, true); //Forge: Fill profile properties upon game load. Fixes MC-52974. ++ this.getSession().setProperties(gameProfile.getProperties()); ++ } ++ networkmanager.sendPacket(new C00PacketLoginStart(gameProfile)); + this.myNetworkManager = networkmanager; + } + +++++ END PATCH +++++ REJECTED PATCH 21 + { + this.theIntegratedServer.initiateShutdown(); + this.theIntegratedServer.setStaticInstance(); ++ if (loadingScreen != null) ++ { ++ this.loadingScreen.displayLoadingString(I18n.format("forge.client.shutdown.internal")); ++ } ++ while (!theIntegratedServer.isServerStopped()) ++ { ++ try ++ { ++ Thread.sleep(10); ++ } ++ catch (InterruptedException ie) {} ++ } + } + + this.theIntegratedServer = null; +++++ END PATCH +++++ REJECTED PATCH 23 + if (this.objectMouseOver != null) + { + boolean flag = this.thePlayer.capabilities.isCreativeMode; +- int i = 0; +- boolean flag1 = false; +- TileEntity tileentity = null; +- Item item; +- +- if (this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) +- { +- BlockPos blockpos = this.objectMouseOver.getBlockPos(); +- Block block = this.theWorld.getBlockState(blockpos).getBlock(); +- +- if (block.getMaterial() == Material.air) +- { +- return; +- } +- +- item = block.getItem(this.theWorld, blockpos); +- +- if (item == null) +- { +- return; +- } +- +- if (flag && GuiScreen.isCtrlKeyDown()) +- { +- tileentity = this.theWorld.getTileEntity(blockpos); +- } +- +- Block block1 = item instanceof ItemBlock && !block.isFlowerPot() ? Block.getBlockFromItem(item) : block; +- i = block1.getDamageValue(this.theWorld, blockpos); +- flag1 = item.getHasSubtypes(); +- } +- else +- { +- if (this.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !flag) +- { +- return; +- } +- +- if (this.objectMouseOver.entityHit instanceof EntityPainting) +- { +- item = Items.painting; +- } +- else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot) +- { +- item = Items.lead; +- } +- else if (this.objectMouseOver.entityHit instanceof EntityItemFrame) +- { +- EntityItemFrame entityitemframe = (EntityItemFrame)this.objectMouseOver.entityHit; +- ItemStack itemstack = entityitemframe.getDisplayedItem(); +- +- if (itemstack == null) +- { +- item = Items.item_frame; +- } +- else +- { +- item = itemstack.getItem(); +- i = itemstack.getMetadata(); +- flag1 = true; +- } +- } +- else if (this.objectMouseOver.entityHit instanceof EntityMinecart) +- { +- EntityMinecart entityminecart = (EntityMinecart)this.objectMouseOver.entityHit; +- +- switch (entityminecart.getMinecartType()) +- { +- case FURNACE: +- item = Items.furnace_minecart; +- break; +- case CHEST: +- item = Items.chest_minecart; +- break; +- case TNT: +- item = Items.tnt_minecart; +- break; +- case HOPPER: +- item = Items.hopper_minecart; +- break; +- case COMMAND_BLOCK: +- item = Items.command_block_minecart; +- break; +- default: +- item = Items.minecart; +- } +- } +- else if (this.objectMouseOver.entityHit instanceof EntityBoat) +- { +- item = Items.boat; +- } +- else if (this.objectMouseOver.entityHit instanceof EntityArmorStand) +- { +- item = Items.armor_stand; +- } +- else +- { +- item = Items.spawn_egg; +- i = EntityList.getEntityID(this.objectMouseOver.entityHit); +- flag1 = true; +- +- if (!EntityList.entityEggs.containsKey(Integer.valueOf(i))) +- { +- return; +- } +- } +- } +- + InventoryPlayer inventoryplayer = this.thePlayer.inventory; + +- if (tileentity == null) +- { +- inventoryplayer.setCurrentItem(item, i, flag1, flag); +- } +- else +- { +- ItemStack itemstack1 = this.func_181036_a(item, i, tileentity); +- inventoryplayer.setInventorySlotContents(inventoryplayer.currentItem, itemstack1); +- } +- ++ if (!net.minecraftforge.common.ForgeHooks.onPickBlock(this.objectMouseOver, this.thePlayer, this.theWorld)) 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; +++++ END PATCH +++++ REJECTED PATCH 24 + + public static int getGLMaximumTextureSize() + { +- for (int i = 16384; i > 0; i >>= 1) +- { +- GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, i, i, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)((ByteBuffer)null)); +- int j = GL11.glGetTexLevelParameteri(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH); +- +- if (j != 0) +- { +- return i; +- } +- } +- +- return -1; ++ //Forge we redirect this to our code which caches the value before any splash screen stuff is done. ++ return net.minecraftforge.fml.client.SplashProgress.getMaxTextureSize(); + } + + public boolean isSnooperEnabled() +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/audio/SoundManager.java.patch.rej b/rejects/minecraft/net/minecraft/client/audio/SoundManager.java.patch.rej new file mode 100644 index 000000000..40bbf0f88 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/audio/SoundManager.java.patch.rej @@ -0,0 +1,25 @@ +++++ REJECTED PATCH 3 + } + else + { ++ sound = net.minecraftforge.client.ForgeHooksClient.playSound(this, sound); ++ if (sound == null) return; ++ + SoundEventAccessorComposite soundeventaccessorcomposite = this.sndHandler.getSound(sound.getSoundLocation()); + + if (soundeventaccessorcomposite == null) +++++ END PATCH +++++ REJECTED PATCH 4 + if (soundpoolentry.isStreamingSound()) + { + 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)); + } + 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)); + } + + logger.debug(LOG_MARKER, "Playing sound {} for event {} as channel {}", new Object[] {soundpoolentry.getSoundPoolEntryLocation(), soundeventaccessorcomposite.getSoundEventLocation(), s}); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch.rej b/rejects/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch.rej new file mode 100644 index 000000000..18c2281ff --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/entity/EntityPlayerSP.java.patch.rej @@ -0,0 +1,14 @@ +++++ REJECTED PATCH 3 + + public void playSound(String name, float volume, float pitch) + { ++ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(this, name, volume, pitch); ++ if (event.isCanceled() || event.name == null) return; ++ name = event.name; ++ volume = event.newVolume; ++ pitch = event.newPitch; ++ + this.worldObj.playSound(this.posX, this.posY, this.posZ, name, volume, pitch, false); + } + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/gui/FontRenderer.java.patch.rej b/rejects/minecraft/net/minecraft/client/gui/FontRenderer.java.patch.rej new file mode 100644 index 000000000..fea762569 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/gui/FontRenderer.java.patch.rej @@ -0,0 +1,33 @@ +++++ REJECTED PATCH 3 + + try + { +- bufferedimage = TextureUtil.readBufferedImage(Minecraft.getMinecraft().getResourceManager().getResource(this.locationFontTexture).getInputStream()); ++ bufferedimage = TextureUtil.readBufferedImage(getResourceInputStream(this.locationFontTexture)); + } + catch (IOException ioexception) + { +++++ END PATCH +++++ REJECTED PATCH 4 + + try + { +- inputstream = Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation("font/glyph_sizes.bin")).getInputStream(); ++ inputstream = getResourceInputStream(new ResourceLocation("font/glyph_sizes.bin")); + inputstream.read(this.glyphWidth); + } + catch (IOException ioexception) +++++ END PATCH +++++ REJECTED PATCH 13 + int j = this.glyphWidth[character] >>> 4; + int k = this.glyphWidth[character] & 15; + +- if (k > 7) +- { +- k = 15; +- j = 0; +- } + + ++k; + return (k - j) / 2 + 1; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/gui/GuiChat.java.patch.rej b/rejects/minecraft/net/minecraft/client/gui/GuiChat.java.patch.rej new file mode 100644 index 000000000..fb030ae4d --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/gui/GuiChat.java.patch.rej @@ -0,0 +1,40 @@ +++++ REJECTED PATCH 1 + this.mc.ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(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++))); + } + + private void sendAutocompleteRequest(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) +++++ END PATCH +++++ REJECTED PATCH 2 + this.playerNamesFound = false; + this.foundPlayerNames.clear(); + ++ String[] complete = net.minecraftforge.client.ClientCommandHandler.instance.latestAutoComplete; ++ if (complete != null) ++ { ++ p_146406_1_ = com.google.common.collect.ObjectArrays.concat(complete, p_146406_1_, String.class); ++ } ++ + for (String s : p_146406_1_) + { + if (s.length() > 0) +++++ END PATCH +++++ REJECTED PATCH 3 + + String s1 = this.inputField.getText().substring(this.inputField.func_146197_a(-1, this.inputField.getCursorPosition(), false)); + String s2 = StringUtils.getCommonPrefix(p_146406_1_); ++ s2 = net.minecraft.util.EnumChatFormatting.getTextWithoutFormattingCodes(s2); + + if (s2.length() > 0 && !s1.equalsIgnoreCase(s2)) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch.rej b/rejects/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch.rej new file mode 100644 index 000000000..e60b28cb5 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/gui/GuiCreateWorld.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + } + } + ++ WorldType.worldTypes[this.selectedIndex].onGUICreateWorldPress(); ++ + WorldSettings.GameType worldsettings$gametype = WorldSettings.GameType.getByName(this.gameMode); + WorldSettings worldsettings = new WorldSettings(i, worldsettings$gametype, this.field_146341_s, this.field_146337_w, WorldType.worldTypes[this.selectedIndex]); + worldsettings.setWorldName(this.chunkProviderSettingsJson); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/gui/GuiSelectWorld.java.patch.rej b/rejects/minecraft/net/minecraft/client/gui/GuiSelectWorld.java.patch.rej new file mode 100644 index 000000000..d588a78c5 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/gui/GuiSelectWorld.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + + if (this.mc.getSaveLoader().canLoadWorld(s)) + { +- this.mc.launchIntegratedServer(s, s1, (WorldSettings)null); ++ net.minecraftforge.fml.client.FMLClientHandler.instance().tryLoadExistingWorld(this, s, s1); + } + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/gui/GuiSlot.java.patch.rej b/rejects/minecraft/net/minecraft/client/gui/GuiSlot.java.patch.rej new file mode 100644 index 000000000..f6c39b84e --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/gui/GuiSlot.java.patch.rej @@ -0,0 +1,19 @@ +++++ REJECTED PATCH 1 + 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); +- float f = 32.0F; +- worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); +- worldrenderer.pos((double)this.left, (double)this.bottom, 0.0D).tex((double)((float)this.left / f), (double)((float)(this.bottom + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex(); +- worldrenderer.pos((double)this.right, (double)this.bottom, 0.0D).tex((double)((float)this.right / f), (double)((float)(this.bottom + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex(); +- worldrenderer.pos((double)this.right, (double)this.top, 0.0D).tex((double)((float)this.right / f), (double)((float)(this.top + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex(); +- worldrenderer.pos((double)this.left, (double)this.top, 0.0D).tex((double)((float)this.left / f), (double)((float)(this.top + (int)this.amountScrolled) / f)).color(32, 32, 32, 255).endVertex(); +- tessellator.draw(); ++ // 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; + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java.patch.rej b/rejects/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java.patch.rej new file mode 100644 index 000000000..230f833b2 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java.patch.rej @@ -0,0 +1,9 @@ +++++ REJECTED PATCH 1 + s3 = s4; + } + ++ s3 = FontRenderer.getFormatFromString(s2) + s3; //Forge: Fix chat formatting not surviving line wrapping. + ChatComponentText chatcomponenttext2 = new ChatComponentText(s3); + chatcomponenttext2.setChatStyle(ichatcomponent1.getChatStyle().createShallowCopy()); + list1.add(j + 1, chatcomponenttext2); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch.rej b/rejects/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch.rej new file mode 100644 index 000000000..f680758a6 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java.patch.rej @@ -0,0 +1,46 @@ +++++ REJECTED PATCH 2 + 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); ++ minecraftAchievements.clear(); ++ for (Achievement achievement : AchievementList.achievementList) ++ { ++ if (!net.minecraftforge.common.AchievementPage.isAchievementInPages(achievement)) ++ { ++ minecraftAchievements.add(achievement); ++ } ++ } + } + + public void initGui() +++++ END PATCH +++++ REJECTED PATCH 6 + GlStateManager.depthFunc(515); + this.mc.getTextureManager().bindTexture(ACHIEVEMENT_BACKGROUND); + +- for (int j5 = 0; j5 < AchievementList.achievementList.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 = achievementList.get(j5); + +- if (achievement1.parentAchievement != null) ++ if (achievement1.parentAchievement != null && achievementList.contains(achievement1.parentAchievement)) + { + int k5 = achievement1.displayColumn * 24 - i + 11; + int l5 = achievement1.displayRow * 24 - j + 11; +++++ END PATCH +++++ REJECTED PATCH 7 + GlStateManager.enableRescaleNormal(); + GlStateManager.enableColorMaterial(); + +- for (int i6 = 0; i6 < AchievementList.achievementList.size(); ++i6) ++ for (int i6 = 0; i6 < achievementList.size(); ++i6) + { +- Achievement achievement2 = (Achievement)AchievementList.achievementList.get(i6); ++ Achievement achievement2 = achievementList.get(i6); + int l6 = achievement2.displayColumn * 24 - i; + int j7 = achievement2.displayRow * 24 - j; + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch.rej b/rejects/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch.rej new file mode 100644 index 000000000..52c077ed6 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/gui/achievement/GuiStats.java.patch.rej @@ -0,0 +1,62 @@ +++++ REJECTED PATCH 1 + import java.util.Collections; + import java.util.Comparator; + import java.util.List; ++ ++import net.minecraft.block.Block; + import net.minecraft.client.Minecraft; + import net.minecraft.client.audio.PositionedSoundRecord; + import net.minecraft.client.gui.GuiButton; +++++ END PATCH +++++ REJECTED PATCH 2 + for (StatCrafting statcrafting : StatList.objectMineStats) + { + 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()); + + if (GuiStats.this.field_146546_t.readStat(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) + { + 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) + { + flag = true; + } +++++ END PATCH +++++ REJECTED PATCH 3 + { + 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; ++ 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())); ++ } else { ++ j = Item.getIdFromItem(p_compare_1_.func_150959_a()); ++ k = Item.getIdFromItem(p_compare_2_.func_150959_a()); ++ } + StatBase statbase = null; + StatBase statbase1 = null; + +++++ END PATCH +++++ REJECTED PATCH 5 + protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn) + { + 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}); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch.rej b/rejects/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch.rej new file mode 100644 index 000000000..64f2a9b28 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch.rej @@ -0,0 +1,25 @@ +++++ REJECTED PATCH 2 + 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 (clickedButton == 0) + { +++++ END PATCH +++++ REJECTED PATCH 6 + item.getSubItems(item, (CreativeTabs)null, guicontainercreative$containercreative.itemList); + } + } ++ updateFilteredItems(guicontainercreative$containercreative); ++ } + ++ //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 (enchantment != null && enchantment.type != null) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/model/ModelBox.java.patch.rej b/rejects/minecraft/net/minecraft/client/model/ModelBox.java.patch.rej new file mode 100644 index 000000000..bb47a7107 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/model/ModelBox.java.patch.rej @@ -0,0 +1,9 @@ +++++ REJECTED PATCH 2 + } + } + ++ @SideOnly(Side.CLIENT) + public void render(WorldRenderer renderer, float scale) + { + for (int i = 0; i < this.quadList.length; ++i) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch.rej b/rejects/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch.rej new file mode 100644 index 000000000..c8880a5ec --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/model/PositionTextureVertex.java.patch.rej @@ -0,0 +1,12 @@ +++++ REJECTED PATCH 1 + package net.minecraft.client.model; + + import net.minecraft.util.Vec3; +-import net.minecraftforge.fml.relauncher.Side; +-import net.minecraftforge.fml.relauncher.SideOnly; + +-@SideOnly(Side.CLIENT) + public class PositionTextureVertex + { + public Vec3 vector3D; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/model/TexturedQuad.java.patch.rej b/rejects/minecraft/net/minecraft/client/model/TexturedQuad.java.patch.rej new file mode 100644 index 000000000..b01f45d0f --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/model/TexturedQuad.java.patch.rej @@ -0,0 +1,12 @@ +++++ REJECTED PATCH 1 + import net.minecraft.client.renderer.WorldRenderer; + import net.minecraft.client.renderer.vertex.DefaultVertexFormats; + import net.minecraft.util.Vec3; +-import net.minecraftforge.fml.relauncher.Side; +-import net.minecraftforge.fml.relauncher.SideOnly; + +-@SideOnly(Side.CLIENT) + public class TexturedQuad + { + public PositionTextureVertex[] vertexPositions; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch.rej b/rejects/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch.rej new file mode 100644 index 000000000..8d8ef37b2 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + 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())); + } + catch (UnknownHostException unknownhostexception) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch.rej b/rejects/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch.rej new file mode 100644 index 000000000..ef2f8c780 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch.rej @@ -0,0 +1,77 @@ +++++ REJECTED PATCH 1 + } + } + ++ ItemStack stack = mc.thePlayer.getCurrentEquippedItem(); ++ if (stack != null && stack.getItem() != null && stack.getItem().onBlockStartBreak(stack, pos, mc.thePlayer)) ++ { ++ return false; ++ } ++ + if (this.currentGameType.isCreative() && this.mc.thePlayer.getHeldItem() != null && this.mc.thePlayer.getHeldItem().getItem() instanceof ItemSword) + { + return false; +++++ END PATCH +++++ REJECTED PATCH 2 + else + { + world.playAuxSFX(2001, pos, Block.getStateId(iblockstate)); +- boolean flag = world.setBlockToAir(pos); + +- if (flag) +- { +- block1.onBlockDestroyedByPlayer(world, pos, iblockstate); +- } +- + this.currentBlock = new BlockPos(this.currentBlock.getX(), -1, this.currentBlock.getZ()); + + if (!this.currentGameType.isCreative()) +++++ END PATCH +++++ REJECTED PATCH 4 + { + if (this.currentGameType != WorldSettings.GameType.SPECTATOR) + { ++ ++ if (heldStack != null && ++ heldStack.getItem() != null && ++ heldStack.getItem().onItemUseFirst(heldStack, player, worldIn, hitPos, side, f, f1, f2)) ++ { ++ return true; ++ } ++ + IBlockState iblockstate = worldIn.getBlockState(hitPos); + +- if ((!player.isSneaking() || player.getHeldItem() == null) && iblockstate.getBlock().onBlockActivated(worldIn, hitPos, iblockstate, player, side, f, f1, f2)) ++ if ((!player.isSneaking() || player.getHeldItem() == null || player.getHeldItem().getItem().doesSneakBypassUse(worldIn, hitPos, player))) + { +- flag = true; ++ flag = iblockstate.getBlock().onBlockActivated(worldIn, hitPos, iblockstate, player, side, f, f1, f2); + } + + if (!flag && heldStack != null && heldStack.getItem() instanceof ItemBlock) +++++ END PATCH +++++ REJECTED PATCH 5 + } + else + { +- return heldStack.onItemUse(player, worldIn, hitPos, side, f, f1, f2); ++ if (!heldStack.onItemUse(player, worldIn, hitPos, side, f, f1, f2)) return false; ++ if (heldStack.stackSize <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(player, heldStack); ++ return true; + } + } + else +++++ END PATCH +++++ REJECTED PATCH 6 + { + playerIn.inventory.mainInventory[playerIn.inventory.currentItem] = itemstack; + +- if (itemstack.stackSize == 0) ++ if (itemstack.stackSize <= 0) + { + playerIn.inventory.mainInventory[playerIn.inventory.currentItem] = null; ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(playerIn, itemstack); + } + + return true; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch.rej b/rejects/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch.rej new file mode 100644 index 000000000..24785c80a --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java.patch.rej @@ -0,0 +1,23 @@ +++++ REJECTED PATCH 3 + float f = (float)(packetIn.getYaw() * 360) / 256.0F; + float f1 = (float)(packetIn.getPitch() * 360) / 256.0F; + EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.createEntityByID(packetIn.getEntityType(), this.gameController.theWorld); ++ 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.getEntityType(), d0, d1, d2); ++ return; ++ } + entitylivingbase.serverPosX = packetIn.getX(); + entitylivingbase.serverPosY = packetIn.getY(); + entitylivingbase.serverPosZ = packetIn.getZ(); +++++ END PATCH +++++ REJECTED PATCH 5 + + if (entity instanceof EntityLivingBase) + { +- PotionEffect potioneffect = new PotionEffect(packetIn.getEffectId(), packetIn.getDuration(), packetIn.getAmplifier(), false, packetIn.func_179707_f()); ++ PotionEffect potioneffect = new PotionEffect(packetIn.getEffectId() & 0xff, packetIn.getDuration(), packetIn.getAmplifier(), false, packetIn.func_179707_f()); + potioneffect.setPotionDurationMax(packetIn.func_149429_c()); + ((EntityLivingBase)entity).addPotionEffect(potioneffect); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/network/OldServerPinger.java.patch.rej b/rejects/minecraft/net/minecraft/client/network/OldServerPinger.java.patch.rej new file mode 100644 index 000000000..b9e4af4e1 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/network/OldServerPinger.java.patch.rej @@ -0,0 +1,9 @@ +++++ REJECTED PATCH 1 + server.setBase64EncodedIconData((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)); + this.field_147403_d = true; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch.rej b/rejects/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch.rej new file mode 100644 index 000000000..713339bfd --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/particle/EffectRenderer.java.patch.rej @@ -0,0 +1,19 @@ +++++ REJECTED PATCH 1 + + public void addEffect(EntityFX effect) + { ++ if (effect == null) return; //Forge: Prevent modders from being bad and adding nulls causing untraceable NPEs. + int i = effect.getFXLayer(); + int j = effect.getAlpha() != 1.0F ? 0 : 1; + +++++ END PATCH +++++ REJECTED PATCH 2 + + public void addBlockDestroyEffects(BlockPos pos, IBlockState state) + { +- if (state.getBlock().getMaterial() != Material.air) ++ if (!state.getBlock().isAir(worldObj, pos) && !state.getBlock().addDestroyEffects(worldObj, pos, this)) + { + state = state.getBlock().getActualState(state, this.worldObj, pos); + int i = 4; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch.rej new file mode 100644 index 000000000..21f015f76 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java.patch.rej @@ -0,0 +1,23 @@ +++++ REJECTED PATCH 1 + @SideOnly(Side.CLIENT) + public static enum EnumNeighborInfo + { +- DOWN(new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.NORTH, EnumFacing.SOUTH}, 0.5F, false, new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0]), +- UP(new EnumFacing[]{EnumFacing.EAST, EnumFacing.WEST, EnumFacing.NORTH, EnumFacing.SOUTH}, 1.0F, false, new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0]), ++ // -- Forge Patch to Fix Top/Bottom Lighting Interpolation -- ++ // Forge PR - https://github.com/MinecraftForge/MinecraftForge/pull/1892 ++ // Mojang Bug - https://bugs.mojang.com/browse/MC-80148 ++ DOWN( new EnumFacing[]{ EnumFacing.WEST, EnumFacing.EAST, EnumFacing.NORTH, EnumFacing.SOUTH }, 0.5F, true, ++ new Orientation[]{ Orientation.FLIP_WEST, Orientation.SOUTH, Orientation.FLIP_WEST, Orientation.FLIP_SOUTH, Orientation.WEST, Orientation.FLIP_SOUTH, Orientation.WEST, Orientation.SOUTH }, ++ new Orientation[]{ Orientation.FLIP_WEST, Orientation.NORTH, Orientation.FLIP_WEST, Orientation.FLIP_NORTH, Orientation.WEST, Orientation.FLIP_NORTH, Orientation.WEST, Orientation.NORTH }, ++ new Orientation[]{ Orientation.FLIP_EAST, Orientation.NORTH, Orientation.FLIP_EAST, Orientation.FLIP_NORTH, Orientation.EAST, Orientation.FLIP_NORTH, Orientation.EAST, Orientation.NORTH }, ++ new Orientation[]{ Orientation.FLIP_EAST, Orientation.SOUTH, Orientation.FLIP_EAST, Orientation.FLIP_SOUTH, Orientation.EAST, Orientation.FLIP_SOUTH, Orientation.EAST, Orientation.SOUTH } ), ++ UP( new EnumFacing[]{ EnumFacing.EAST, EnumFacing.WEST, EnumFacing.NORTH, EnumFacing.SOUTH }, 1.0F, true, ++ new Orientation[]{ Orientation.EAST, Orientation.SOUTH, Orientation.EAST, Orientation.FLIP_SOUTH, Orientation.FLIP_EAST, Orientation.FLIP_SOUTH, Orientation.FLIP_EAST, Orientation.SOUTH }, ++ new Orientation[]{ Orientation.EAST, Orientation.NORTH, Orientation.EAST, Orientation.FLIP_NORTH, Orientation.FLIP_EAST, Orientation.FLIP_NORTH, Orientation.FLIP_EAST, Orientation.NORTH }, ++ new Orientation[]{ Orientation.WEST, Orientation.NORTH, Orientation.WEST, Orientation.FLIP_NORTH, Orientation.FLIP_WEST, Orientation.FLIP_NORTH, Orientation.FLIP_WEST, Orientation.NORTH }, ++ new Orientation[]{ Orientation.WEST, Orientation.SOUTH, Orientation.WEST, Orientation.FLIP_SOUTH, Orientation.FLIP_WEST, Orientation.FLIP_SOUTH, Orientation.FLIP_WEST, Orientation.SOUTH } ), + NORTH(new EnumFacing[]{EnumFacing.UP, EnumFacing.DOWN, EnumFacing.EAST, EnumFacing.WEST}, 0.8F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_WEST}), + SOUTH(new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.DOWN, EnumFacing.UP}, 0.8F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.EAST}), + WEST(new EnumFacing[]{EnumFacing.UP, EnumFacing.DOWN, EnumFacing.NORTH, EnumFacing.SOUTH}, 0.6F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.SOUTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.SOUTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.NORTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.NORTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.NORTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.NORTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.SOUTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.SOUTH}), +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch.rej new file mode 100644 index 000000000..5c6e047af --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java.patch.rej @@ -0,0 +1,50 @@ +++++ REJECTED PATCH 1 + { + 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(); + +++++ END PATCH +++++ REJECTED PATCH 2 + { + state = block.getActualState(state, blockAccess, pos); + IBakedModel ibakedmodel = this.blockModelShapes.getModelForState(state); ++ ++ if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartBlockModel) ++ { ++ IBlockState extendedState = block.getExtendedState(state, blockAccess, pos); ++ for ( net.minecraft.util.EnumWorldBlockLayer layer : net.minecraft.util.EnumWorldBlockLayer.values() ) ++ { ++ if ( block.canRenderInLayer( layer ) ) ++ { ++ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(layer); ++ ++ IBakedModel targetLayer = ((net.minecraftforge.client.model.ISmartBlockModel)ibakedmodel).handleBlockState(extendedState); ++ IBakedModel damageModel = (new SimpleBakedModel.Builder(targetLayer, texture)).makeBakedModel(); ++ this.blockModelRenderer.renderModel(blockAccess, damageModel, state, pos, Tessellator.getInstance().getWorldRenderer()); ++ } ++ } ++ return; ++ } ++ + IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(ibakedmodel, texture)).makeBakedModel(); + this.blockModelRenderer.renderModel(blockAccess, ibakedmodel1, state, pos, Tessellator.getInstance().getWorldRenderer()); + } +++++ END PATCH +++++ REJECTED PATCH 3 + ibakedmodel = ((WeightedBakedModel)ibakedmodel).getAlternativeModel(MathHelper.getPositionRandom(pos)); + } + ++ if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartBlockModel) ++ { ++ IBlockState extendedState = block.getExtendedState(state, worldIn, pos); ++ ibakedmodel = ((net.minecraftforge.client.model.ISmartBlockModel)ibakedmodel).handleBlockState(extendedState); ++ } ++ + return ibakedmodel; + } + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch.rej new file mode 100644 index 000000000..c1b1b328c --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch.rej @@ -0,0 +1,74 @@ +++++ REJECTED PATCH 2 + + if (d3 < d2 || d2 == 0.0D) + { +- if (entity1 == entity.ridingEntity) ++ if (entity1 == entity.ridingEntity && !entity.canRiderInteract()) + { + if (d2 == 0.0D) + { +++++ END PATCH +++++ REJECTED PATCH 4 + { + 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); + +- if (block == Blocks.bed) +- { +- int j = ((EnumFacing)iblockstate.getValue(BlockBed.FACING)).getHorizontalIndex(); +- GlStateManager.rotate((float)(j * 90), 0.0F, 1.0F, 0.0F); +- } +- + GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks + 180.0F, 0.0F, -1.0F, 0.0F); + GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, -1.0F, 0.0F, 0.0F); + } +++++ END PATCH +++++ REJECTED PATCH 9 + 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(); + } +++++ END PATCH +++++ REJECTED PATCH 10 + 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(); + } +++++ END PATCH +++++ REJECTED PATCH 11 + 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. ++ { ++ RenderHelper.enableStandardItemLighting(); ++ this.mc.mcProfiler.endStartSection("entities"); ++ net.minecraftforge.client.ForgeHooksClient.setRenderPass(1); ++ renderglobal.renderEntities(entity, icamera, partialTicks); ++ net.minecraftforge.client.ForgeHooksClient.setRenderPass(-1); ++ RenderHelper.disableStandardItemLighting(); ++ } + GlStateManager.shadeModel(7424); + GlStateManager.depthMask(true); + GlStateManager.enableCull(); +++++ END PATCH +++++ REJECTED PATCH 15 + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entity, partialTicks); + ++ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, block, partialTicks, 0.1F); ++ if (hook >= 0) ++ GlStateManager.setFogDensity(hook); ++ else + if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isPotionActive(Potion.blindness)) + { + float f1 = 5.0F; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch.rej new file mode 100644 index 000000000..c919cc702 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch.rej @@ -0,0 +1,9 @@ +++++ REJECTED PATCH 2 + for (PotionEffect potioneffect : this.mc.thePlayer.getActivePotionEffects()) + { + Potion potion = Potion.potionTypes[potioneffect.getPotionID()]; ++ if(!potion.shouldRender(potioneffect)) continue; + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(inventoryBackground); + this.drawTexturedModalRect(i, j, 0, 166, 140, 32); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch.rej new file mode 100644 index 000000000..d321fc02f --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch.rej @@ -0,0 +1,39 @@ +++++ REJECTED PATCH 1 + + if (this.itemToRender != null) + { +- if (this.itemToRender.getItem() == Items.filled_map) ++ if (this.itemToRender.getItem() instanceof net.minecraft.item.ItemMap) + { + this.renderItemMap(abstractclientplayer, f2, f, f1); + } +++++ END PATCH +++++ REJECTED PATCH 3 + if (iblockstate1.getBlock().isVisuallyOpaque()) + { + iblockstate = iblockstate1; ++ overlayPos = blockpos; + } + } + + if (iblockstate.getBlock().getRenderType() != -1) + { ++ if (!net.minecraftforge.event.ForgeEventFactory.renderBlockOverlay(mc.thePlayer, partialTicks, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, iblockstate, overlayPos)) + this.func_178108_a(partialTicks, this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(iblockstate)); + } + } +++++ END PATCH +++++ REJECTED PATCH 5 + { + if (!this.itemToRender.getIsItemStackEqual(itemstack)) + { ++ if (!this.itemToRender.getItem().shouldCauseReequipAnimation(this.itemToRender, itemstack, equippedItemSlot != entityplayer.inventory.currentItem)) ++ { ++ this.itemToRender = itemstack; ++ this.equippedItemSlot = entityplayer.inventory.currentItem; ++ return; ++ } + flag = true; + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch.rej new file mode 100644 index 000000000..182cfa605 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch.rej @@ -0,0 +1,51 @@ +++++ REJECTED PATCH 4 + 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 || camera.isBoundingBoxInFrustum(entity3.getEntityBoundingBox()) || entity3.riddenByEntity == this.mc.thePlayer) && entity3 instanceof EntityPlayer; + +++++ END PATCH +++++ REJECTED PATCH 5 + } + + entity2 = (Entity)iterator.next(); ++ if (!entity2.shouldRenderInPass(pass)) continue; + flag2 = this.renderManager.shouldRender(entity2, camera, d0, d1, d2) || entity2.riddenByEntity == this.mc.thePlayer; + + if (!flag2) +++++ END PATCH +++++ REJECTED PATCH 10 + + public void renderSky(float partialTicks, int pass) + { ++ net.minecraftforge.client.IRenderHandler renderer = this.theWorld.provider.getSkyRenderer(); ++ if (renderer != null) ++ { ++ renderer.render(partialTicks, theWorld, mc); ++ return; ++ } + if (this.mc.theWorld.provider.getDimensionId() == 1) + { + this.renderSkyEnd(); +++++ END PATCH +++++ REJECTED PATCH 13 + if (recordName != null) + { + ItemRecord itemrecord = ItemRecord.getRecord(recordName); ++ ResourceLocation resource = null; + + if (itemrecord != null) + { + this.mc.ingameGUI.setRecordPlayingMessage(itemrecord.getRecordNameLocal()); ++ resource = itemrecord.getRecordResource(recordName); + } + +- 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); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch.rej new file mode 100644 index 000000000..4c835fe91 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch.rej @@ -0,0 +1,41 @@ +++++ REJECTED PATCH 1 + break; + case USHORT: + case SHORT: +- this.byteBuffer.putShort(i, (short)((int)p_181663_1_ * 32767 & 65535)); +- this.byteBuffer.putShort(i + 2, (short)((int)p_181663_2_ * 32767 & 65535)); +- this.byteBuffer.putShort(i + 4, (short)((int)p_181663_3_ * 32767 & 65535)); ++ this.byteBuffer.putShort(i, (short)((int)(p_181663_1_ * 32767) & 65535)); ++ this.byteBuffer.putShort(i + 2, (short)((int)(p_181663_2_ * 32767) & 65535)); ++ this.byteBuffer.putShort(i + 4, (short)((int)(p_181663_3_ * 32767) & 65535)); + break; + case UBYTE: + case BYTE: +- this.byteBuffer.put(i, (byte)((int)p_181663_1_ * 127 & 255)); +- this.byteBuffer.put(i + 1, (byte)((int)p_181663_2_ * 127 & 255)); +- this.byteBuffer.put(i + 2, (byte)((int)p_181663_3_ * 127 & 255)); ++ this.byteBuffer.put(i, (byte)((int)(p_181663_1_ * 127) & 255)); ++ this.byteBuffer.put(i + 1, (byte)((int)(p_181663_2_ * 127) & 255)); ++ this.byteBuffer.put(i + 2, (byte)((int)(p_181663_3_ * 127) & 255)); + } + + this.nextVertexFormatIndex(); +++++ END PATCH +++++ REJECTED PATCH 2 + } + } + ++ public void checkAndGrow() ++ { ++ this.growBuffer(vertexFormat.getNextOffset()/* / 4 * 4 */); ++ } ++ ++ public boolean isColorDisabled() ++ { ++ return noColor; ++ } ++ + @SideOnly(Side.CLIENT) + public class State + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch.rej new file mode 100644 index 000000000..1aadf2540 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java.patch.rej @@ -0,0 +1,66 @@ +++++ REJECTED PATCH 1 + + for (int j = 0; j < list.size(); ++j) + { ++ // 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(); +- bytebuffer.position(vertexformat.func_181720_d(j)); +- +- switch (vertexformatelement$enumusage) +- { +- case POSITION: +- GL11.glVertexPointer(vertexformatelement.getElementCount(), k, i, bytebuffer); +- GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); +- break; +- case UV: +- OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + l); +- GL11.glTexCoordPointer(vertexformatelement.getElementCount(), k, i, bytebuffer); +- GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); +- OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); +- break; +- case COLOR: +- GL11.glColorPointer(vertexformatelement.getElementCount(), 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); + } + + GL11.glDrawArrays(p_181679_1_.getDrawMode(), 0, p_181679_1_.getVertexCount()); +++++ END PATCH +++++ REJECTED PATCH 2 + for (int j1 = list.size(); i1 < j1; ++i1) + { + VertexFormatElement vertexformatelement1 = (VertexFormatElement)list.get(i1); +- VertexFormatElement.EnumUsage vertexformatelement$enumusage1 = vertexformatelement1.getUsage(); +- int k1 = vertexformatelement1.getIndex(); +- +- switch (vertexformatelement$enumusage1) +- { +- case POSITION: +- GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); +- break; +- case UV: +- OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + k1); +- GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); +- OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); +- break; +- case COLOR: +- GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); +- GlStateManager.resetColor(); +- break; +- case NORMAL: +- GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); +- } ++ // moved to VertexFormatElement.postDraw ++ vertexformatelement1.getUsage().postDraw(vertexformat, i1, i, bytebuffer); + } + } + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch.rej new file mode 100644 index 000000000..dcf329e61 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch.rej @@ -0,0 +1,70 @@ +++++ REJECTED PATCH 1 + + public BakedQuad makeBakedQuad(Vector3f posFrom, Vector3f posTo, BlockPartFace face, TextureAtlasSprite sprite, EnumFacing facing, ModelRotation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) + { ++ return makeBakedQuad(posFrom, posTo, face, sprite, facing, (net.minecraftforge.client.model.ITransformation)modelRotationIn, partRotation, uvLocked, shade); ++ } ++ ++ 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) ++ { + int[] aint = this.makeQuadVertexData(face, sprite, facing, this.getPositionsDiv16(posFrom, posTo), modelRotationIn, partRotation, uvLocked, shade); + EnumFacing enumfacing = getFacingFromVertexData(aint); + +++++ END PATCH +++++ REJECTED PATCH 2 + this.func_178408_a(aint, enumfacing); + } + ++ net.minecraftforge.client.ForgeHooksClient.fillNormal(aint, enumfacing); + return new BakedQuad(aint, face.tintIndex, enumfacing); + } + + private int[] makeQuadVertexData(BlockPartFace partFace, TextureAtlasSprite sprite, EnumFacing facing, float[] p_178405_4_, ModelRotation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) + { ++ return makeQuadVertexData(partFace, sprite, facing, p_178405_4_, modelRotationIn, partRotation, uvLocked, shade); ++ } ++ ++ private int[] makeQuadVertexData(BlockPartFace partFace, TextureAtlasSprite sprite, EnumFacing facing, float[] p_178405_4_, net.minecraftforge.client.model.ITransformation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) ++ { + int[] aint = new int[28]; + + for (int i = 0; i < 4; ++i) +++++ END PATCH +++++ REJECTED PATCH 3 + + 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) + { +- EnumFacing enumfacing = modelRotationIn.rotateFace(facing); ++ fillVertexData(faceData, vertexIndex, facing, partFace, p_178402_5_, sprite, modelRotationIn, partRotation, uvLocked, shade); ++ } ++ ++ 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) ++ { ++ EnumFacing enumfacing = modelRotationIn.rotate(facing); + int i = shade ? this.getFaceShadeColor(enumfacing) : -1; + EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = EnumFaceDirection.getFacing(facing).func_179025_a(vertexIndex); + 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]); +++++ END PATCH +++++ REJECTED PATCH 4 + + public int rotateVertex(Vector3f position, EnumFacing facing, int vertexIndex, ModelRotation modelRotationIn, boolean uvLocked) + { ++ return rotateVertex(position, facing, vertexIndex, modelRotationIn, uvLocked); ++ } ++ ++ public int rotateVertex(Vector3f position, EnumFacing facing, int vertexIndex, net.minecraftforge.client.model.ITransformation modelRotationIn, boolean uvLocked) ++ { + if (modelRotationIn == ModelRotation.X0_Y0) + { + return vertexIndex; + } + 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); + } + } + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch.rej new file mode 100644 index 000000000..6c3d4d0ca --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch.rej @@ -0,0 +1,19 @@ +++++ REJECTED PATCH 2 + return this.modelLocation; + } + ++ @Deprecated + public ModelRotation getRotation() + { + return this.modelRotation; + } + ++ public net.minecraftforge.client.model.IModelState getState() ++ { ++ return this.modelRotation; ++ } ++ + public boolean isUvLocked() + { + return this.uvLock; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch.rej new file mode 100644 index 000000000..5c3dd1f9c --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + } + else + { +- s = ((IProperty)this.name).getName((Comparable)map.remove(this.name)); ++ s = String.format("%s:%s", ((ResourceLocation)Block.blockRegistry.getNameForObject(state.getBlock())).getResourceDomain(), ((IProperty)this.name).getName((Comparable)map.remove(this.name))); + } + + if (this.suffix != null) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch.rej new file mode 100644 index 000000000..18d326745 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java.patch.rej @@ -0,0 +1,12 @@ +++++ REJECTED PATCH 3 + } + } + +- EnumWorldBlockLayer enumworldblocklayer1 = block.getBlockLayer(); ++ for(EnumWorldBlockLayer enumworldblocklayer1 : EnumWorldBlockLayer.values()) { ++ if(!block.canRenderInLayer(enumworldblocklayer1)) continue; ++ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(enumworldblocklayer1); + int j = enumworldblocklayer1.ordinal(); + + if (block.getRenderType() != -1) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch.rej new file mode 100644 index 000000000..576671980 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java.patch.rej @@ -0,0 +1,39 @@ +++++ REJECTED PATCH 2 + + for (int j = 0; j < i; ++j) + { +- if (ibakedmodel.isGui3d()) + { + GlStateManager.pushMatrix(); + +++++ END PATCH +++++ REJECTED PATCH 3 + float f = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; + float f1 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; + float f2 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; +- GlStateManager.translate(f, f1, f2); ++ GlStateManager.translate(shouldSpreadItems() ? f : 0.0F, shouldSpreadItems() ? f1 : 0.0F, f2); + } + ++ if (ibakedmodel.isGui3d()) + GlStateManager.scale(0.5F, 0.5F, 0.5F); +- ibakedmodel.getItemCameraTransforms().applyTransform(ItemCameraTransforms.TransformType.GROUND); ++ ibakedmodel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.GROUND); + this.itemRenderer.renderItem(itemstack, ibakedmodel); + GlStateManager.popMatrix(); + } +- else +- { +- GlStateManager.pushMatrix(); +- ibakedmodel.getItemCameraTransforms().applyTransform(ItemCameraTransforms.TransformType.GROUND); +- this.itemRenderer.renderItem(itemstack, ibakedmodel); +- GlStateManager.popMatrix(); +- float f3 = ibakedmodel.getItemCameraTransforms().ground.scale.x; +- float f4 = ibakedmodel.getItemCameraTransforms().ground.scale.y; +- float f5 = ibakedmodel.getItemCameraTransforms().ground.scale.z; +- GlStateManager.translate(0.0F * f3, 0.0F * f4, 0.046875F * f5); +- } + } + + GlStateManager.popMatrix(); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch.rej new file mode 100644 index 000000000..37febaf27 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/entity/RenderItem.java.patch.rej @@ -0,0 +1,96 @@ +++++ REJECTED PATCH 1 + public RenderItem(TextureManager textureManager, ModelManager modelManager) + { + this.textureManager = textureManager; +- this.itemModelMesher = new ItemModelMesher(modelManager); ++ this.itemModelMesher = new net.minecraftforge.client.ItemModelMesherForge(modelManager); + this.registerItems(); + } + +++++ END PATCH +++++ REJECTED PATCH 2 + k = k | -16777216; + } + +- this.renderQuad(renderer, bakedquad, k); ++ net.minecraftforge.client.model.pipeline.LightUtil.renderQuadColor(renderer, bakedquad, k); + } + } + +++++ END PATCH +++++ REJECTED PATCH 3 + modelresourcelocation = new ModelResourceLocation("bow_pulling_0", "inventory"); + } + } ++ else ++ { ++ // TODO: maybe switch to the smart player model / normal smart item model? ++ modelresourcelocation = item.getModel(stack, entityplayer, entityplayer.getItemInUseCount()); ++ } + + if (modelresourcelocation != null) + { +++++ END PATCH +++++ REJECTED PATCH 4 + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.pushMatrix(); +- ItemCameraTransforms itemcameratransforms = model.getItemCameraTransforms(); +- itemcameratransforms.applyTransform(cameraTransformType); ++ // TODO: check if negative scale is a thing ++ model = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(model, cameraTransformType); + +- if (this.func_183005_a(itemcameratransforms.getTransform(cameraTransformType))) +- { +- GlStateManager.cullFace(1028); +- } +- + this.renderItem(stack, model); + GlStateManager.cullFace(1029); + GlStateManager.popMatrix(); +++++ END PATCH +++++ REJECTED PATCH 5 + GlStateManager.blendFunc(770, 771); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.setupGuiTransform(x, y, ibakedmodel.isGui3d()); +- ibakedmodel.getItemCameraTransforms().applyTransform(ItemCameraTransforms.TransformType.GUI); ++ ibakedmodel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel, ItemCameraTransforms.TransformType.GUI); + this.renderItem(stack, ibakedmodel); + GlStateManager.disableAlpha(); + GlStateManager.disableRescaleNormal(); +++++ END PATCH +++++ REJECTED PATCH 6 + GlStateManager.enableDepth(); + } + +- if (stack.isItemDamaged()) ++ if (stack.getItem().showDurabilityBar(stack)) + { +- 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 - health * 13.0D); ++ int i = (int)Math.round(255.0D - health * 255.0D); + GlStateManager.disableLighting(); + GlStateManager.disableDepth(); + GlStateManager.disableTexture2D(); +++++ END PATCH +++++ REJECTED PATCH 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(); ++ //GlStateManager.enableBlend(); // Forge: Disable Blend because it screws with a lot of things down the line. + GlStateManager.enableAlpha(); + GlStateManager.enableTexture2D(); + GlStateManager.enableLighting(); +++++ END PATCH +++++ REJECTED PATCH 8 + 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); + } + + public void onResourceManagerReload(IResourceManager resourceManager) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch.rej new file mode 100644 index 000000000..7bcabbdeb --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch.rej @@ -0,0 +1,13 @@ +++++ REJECTED PATCH 2 + IBlockState iblockstate = worldIn.getBlockState(new BlockPos(livingPlayerIn)); + Block block = iblockstate.getBlock(); + +- if (block == Blocks.bed) ++ if (block.isBed(worldIn, new BlockPos(livingPlayerIn), (EntityLivingBase)livingPlayerIn)) + { +- int i = ((EnumFacing)iblockstate.getValue(BlockBed.FACING)).getHorizontalIndex(); ++ int i = block.getBedDirection(worldIn, new BlockPos(livingPlayerIn)).getHorizontalIndex(); + this.playerViewY = (float)(i * 90 + 180); + this.playerViewX = 0.0F; + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch.rej new file mode 100644 index 000000000..48ad3c48d --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch.rej @@ -0,0 +1,68 @@ +++++ REJECTED PATCH 1 + protected List> layerRenderers = Lists.>newArrayList(); + protected boolean renderOutlines = false; + ++ public static float NAME_TAG_RANGE = 64.0f; ++ public static float NAME_TAG_RANGE_SNEAK = 32.0f; ++ + public RendererLivingEntity(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn) + { + super(renderManagerIn); +++++ END PATCH +++++ REJECTED PATCH 2 + + public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks) + { ++ 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); +- this.mainModel.isRiding = entity.isRiding(); ++ boolean shouldSit = entity.isRiding() && (entity.ridingEntity != null && entity.ridingEntity.shouldRiderSit()); ++ this.mainModel.isRiding = shouldSit; + this.mainModel.isChild = entity.isChild(); + + try +++++ END PATCH +++++ REJECTED PATCH 3 + float f1 = this.interpolateRotation(entity.prevRotationYawHead, entity.rotationYawHead, partialTicks); + float f2 = f1 - f; + +- if (entity.isRiding() && entity.ridingEntity instanceof EntityLivingBase) ++ if (shouldSit && entity.ridingEntity instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)entity.ridingEntity; + f = this.interpolateRotation(entitylivingbase.prevRenderYawOffset, entitylivingbase.renderYawOffset, partialTicks); +++++ END PATCH +++++ REJECTED PATCH 4 + { + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Post(entity, this, x, y, z)); + } + + protected boolean setScoreTeamColor(T entityLivingBaseIn) +++++ END PATCH +++++ REJECTED PATCH 5 + + public void renderName(T entity, double x, double y, double z) + { ++ 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)) + { + 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; + + if (d0 < (double)(f * f)) + { +++++ END PATCH +++++ REJECTED PATCH 6 + } + } + } ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Post(entity, this, x, y, z)); + } + + protected boolean canRenderName(T entity) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch.rej new file mode 100644 index 000000000..ed83325a8 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java.patch.rej @@ -0,0 +1,93 @@ +++++ REJECTED PATCH 1 + T t = this.func_177175_a(armorSlot); + t.setModelAttributes(this.renderer.getMainModel()); + t.setLivingAnimations(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_4_); ++ t = getArmorModelHook(entitylivingbaseIn, itemstack, armorSlot, t); + this.func_177179_a(t, armorSlot); + boolean flag = this.isSlotForLeggings(armorSlot); +- this.renderer.bindTexture(this.getArmorResource(itemarmor, flag)); ++ this.renderer.bindTexture(this.getArmorResource(entitylivingbaseIn, itemstack, flag ? 2 : 1, null)); + +- switch (itemarmor.getArmorMaterial()) +- { +- case LEATHER: + int i = itemarmor.getColor(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.colorR * f, this.colorG * f1, this.colorB * f2, this.alpha); + t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_); +- this.renderer.bindTexture(this.getArmorResource(itemarmor, flag, "overlay")); +- case CHAIN: +- case IRON: +- case GOLD: +- case DIAMOND: ++ this.renderer.bindTexture(this.getArmorResource(entitylivingbaseIn, itemstack, flag ? 2 : 1, "overlay")); ++ } ++ { // Non-colored + GlStateManager.color(this.colorR, this.colorG, this.colorB, this.alpha); + t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_); +- default: +- +- if (!this.field_177193_i && itemstack.isItemEnchanted()) ++ } ++ // Default ++ if (!this.field_177193_i && itemstack.hasEffect()) + { + this.func_177183_a(entitylivingbaseIn, t, p_177182_2_, p_177182_3_, p_177182_4_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_); + } +++++ END PATCH +++++ REJECTED PATCH 3 + protected abstract void initArmor(); + + protected abstract void func_177179_a(T p_177179_1_, int p_177179_2_); ++ ++ /*=================================== FORGE START =========================================*/ ++ ++ /** ++ * Hook to allow item-sensitive armor model. for LayerBipedArmor. ++ */ ++ protected T getArmorModelHook(EntityLivingBase entity, ItemStack itemStack, int slot, T model) ++ { ++ return model; ++ } ++ ++ /** ++ * More generic ForgeHook version of the above function, it allows for Items to have more control over what texture they provide. ++ * ++ * @param entity Entity wearing the armor ++ * @param stack ItemStack for the armor ++ * @param slot Slot ID that the item is in ++ * @param type Subtype, can be null or "overlay" ++ * @return ResourceLocation pointing at the armor's texture ++ */ ++ public ResourceLocation getArmorResource(net.minecraft.entity.Entity entity, ItemStack stack, int slot, String type) ++ { ++ ItemArmor item = (ItemArmor)stack.getItem(); ++ String texture = item.getArmorMaterial().getName(); ++ String domain = "minecraft"; ++ int idx = texture.indexOf(':'); ++ if (idx != -1) ++ { ++ domain = texture.substring(0, idx); ++ texture = texture.substring(idx + 1); ++ } ++ String s1 = String.format("%s:textures/models/armor/%s_layer_%d%s.png", domain, texture, (slot == 2 ? 2 : 1), type == null ? "" : String.format("_%s", type)); ++ ++ s1 = net.minecraftforge.client.ForgeHooksClient.getArmorTexture(entity, stack, s1, slot, type); ++ ResourceLocation resourcelocation = (ResourceLocation)ARMOR_TEXTURE_RES_MAP.get(s1); ++ ++ if (resourcelocation == null) ++ { ++ resourcelocation = new ResourceLocation(s1); ++ ARMOR_TEXTURE_RES_MAP.put(s1, resourcelocation); ++ } ++ ++ return resourcelocation; ++ } ++ /*=================================== FORGE END ===========================================*/ + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch.rej new file mode 100644 index 000000000..25b88228c --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch.rej @@ -0,0 +1,83 @@ +++++ REJECTED PATCH 4 + int j = Integer.MAX_VALUE; + int k = 1 << this.mipmapLevels; + ++ 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()); ++ ++ if(!skipFirst) + for (Entry entry : this.mapRegisteredSprites.entrySet()) + { + TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)entry.getValue(); + ResourceLocation resourcelocation = new ResourceLocation(textureatlassprite.getIconName()); + ResourceLocation resourcelocation1 = this.completeResourceLocation(resourcelocation, 0); ++ bar.step(resourcelocation1.getResourcePath()); + ++ if (textureatlassprite.hasCustomLoader(resourceManager, resourcelocation)) ++ { ++ if (!textureatlassprite.load(resourceManager, resourcelocation)) ++ { ++ j = Math.min(j, Math.min(textureatlassprite.getIconWidth(), textureatlassprite.getIconHeight())); ++ stitcher.addSprite(textureatlassprite); ++ } ++ continue; ++ } ++ + try + { + IResource iresource = resourceManager.getResource(resourcelocation1); +++++ END PATCH +++++ REJECTED PATCH 5 + } + catch (RuntimeException runtimeexception) + { +- logger.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); ++ //logger.error((String)("Using missing texture, unable to load " + resourcelocation1), (Throwable)ioexception1); ++ net.minecraftforge.fml.client.FMLClientHandler.instance().trackMissingTexture(resourcelocation1); + continue; + } + +++++ END PATCH +++++ REJECTED PATCH 6 + stitcher.addSprite(textureatlassprite); + } + ++ net.minecraftforge.fml.common.ProgressManager.pop(bar); + int j1 = Math.min(j, k); + int k1 = MathHelper.calculateLogBaseTwo(j1); + +++++ END PATCH +++++ REJECTED PATCH 7 + this.mipmapLevels = k1; + } + ++ bar = net.minecraftforge.fml.common.ProgressManager.push("Mipmap generation", skipFirst ? 0 : this.mapRegisteredSprites.size()); + for (final TextureAtlasSprite textureatlassprite1 : this.mapRegisteredSprites.values()) + { ++ if (skipFirst) break; ++ bar.step(textureatlassprite1.getIconName()); + try + { + textureatlassprite1.generateMipmaps(this.mipmapLevels); +++++ END PATCH +++++ REJECTED PATCH 9 + } + + logger.info("Created: {}x{} {}-atlas", new Object[] {Integer.valueOf(stitcher.getCurrentWidth()), Integer.valueOf(stitcher.getCurrentHeight()), this.basePath}); ++ bar.step("Allocating GL texture"); + TextureUtil.allocateTextureImpl(this.getGlTextureId(), this.mipmapLevels, stitcher.getCurrentWidth(), stitcher.getCurrentHeight()); + Map map = Maps.newHashMap(this.mapRegisteredSprites); + ++ bar.step("Uploading GL texture"); + for (TextureAtlasSprite textureatlassprite2 : stitcher.getStichSlots()) + { + String s = textureatlassprite2.getIconName(); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch.rej new file mode 100644 index 000000000..4cd0abd61 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java.patch.rej @@ -0,0 +1,16 @@ +++++ REJECTED PATCH 1 + { + if (tileentityIn.getDistanceSq(this.entityX, this.entityY, this.entityZ) < tileentityIn.getMaxRenderDistanceSquared()) + { ++ if(!tileentityIn.hasFastRenderer()) ++ { + int i = this.worldObj.getCombinedLight(tileentityIn.getPos(), 0); + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); ++ } + BlockPos blockpos = tileentityIn.getPos(); + this.renderTileEntityAt(tileentityIn, (double)blockpos.getX() - staticPlayerX, (double)blockpos.getY() - staticPlayerY, (double)blockpos.getZ() - staticPlayerZ, partialTicks, destroyStage); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/resources/LanguageManager.java.patch.rej b/rejects/minecraft/net/minecraft/client/resources/LanguageManager.java.patch.rej new file mode 100644 index 000000000..0f6750207 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/resources/LanguageManager.java.patch.rej @@ -0,0 +1,9 @@ +++++ REJECTED PATCH 1 + } + + currentLocale.loadLocaleDataFiles(resourceManager, list); ++ net.minecraftforge.fml.common.registry.LanguageRegistry.instance().mergeLanguageTable(currentLocale.properties, this.currentLanguage); + StringTranslate.replaceWith(currentLocale.properties); + } + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch.rej b/rejects/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch.rej new file mode 100644 index 000000000..8b56b35e3 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch.rej @@ -0,0 +1,8 @@ +++++ REJECTED PATCH 1 + + TextureAtlasSprite getParticleTexture(); + ++ @Deprecated + ItemCameraTransforms getItemCameraTransforms(); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch.rej b/rejects/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch.rej new file mode 100644 index 000000000..31a5207b0 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch.rej @@ -0,0 +1,131 @@ +++++ REJECTED PATCH 1 + } + catch (Exception var6) + { +- LOGGER.warn("Unable to load variant: " + modelresourcelocation.getVariant() + " from " + modelresourcelocation); ++ LOGGER.warn("Unable to load variant: " + modelresourcelocation.getVariant() + " from " + modelresourcelocation, var6); + } + } + catch (Exception exception) +++++ END PATCH +++++ REJECTED PATCH 2 + + protected void registerVariantNames() + { ++ 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"})); +++++ END PATCH +++++ REJECTED PATCH 3 + 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"})); ++ for (Entry, Set> e : customVariantNames.entrySet()) ++ { ++ this.variantNames.put(e.getKey().get(), Lists.newArrayList(e.getValue().iterator())); ++ } + } + + protected List getVariantNames(Item p_177596_1_) +++++ END PATCH +++++ REJECTED PATCH 4 + + protected ResourceLocation getItemLocation(String p_177583_1_) + { +- ResourceLocation resourcelocation = new ResourceLocation(p_177583_1_); ++ ResourceLocation resourcelocation = new ResourceLocation(p_177583_1_.replaceAll("#.*", "")); + return new ResourceLocation(resourcelocation.getResourceDomain(), "item/" + resourcelocation.getResourcePath()); + } + +++++ END PATCH +++++ REJECTED PATCH 5 + for (Entry entry : this.itemLocations.entrySet()) + { + ResourceLocation resourcelocation = (ResourceLocation)entry.getValue(); +- ModelResourceLocation modelresourcelocation1 = new ModelResourceLocation((String)entry.getKey(), "inventory"); ++ ModelResourceLocation modelresourcelocation1 = net.minecraftforge.client.model.ModelLoader.getInventoryVariant(entry.getKey()); + ModelBlock modelblock1 = (ModelBlock)this.models.get(resourcelocation); + + if (modelblock1 != null && modelblock1.isResolved()) +++++ END PATCH +++++ REJECTED PATCH 6 + + private IBakedModel bakeModel(ModelBlock modelBlockIn, ModelRotation modelRotationIn, boolean uvLocked) + { ++ return bakeModel(modelBlockIn, (net.minecraftforge.client.model.ITransformation)modelRotationIn, uvLocked); ++ } ++ ++ protected IBakedModel bakeModel(ModelBlock modelBlockIn, net.minecraftforge.client.model.ITransformation modelRotationIn, boolean uvLocked) ++ { + TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.sprites.get(new ResourceLocation(modelBlockIn.resolveTextureName("particle"))); + SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(modelBlockIn)).setTexture(textureatlassprite); + +++++ END PATCH +++++ REJECTED PATCH 7 + BlockPartFace blockpartface = (BlockPartFace)blockpart.mapFaces.get(enumfacing); + TextureAtlasSprite textureatlassprite1 = (TextureAtlasSprite)this.sprites.get(new ResourceLocation(modelBlockIn.resolveTextureName(blockpartface.texture))); + +- if (blockpartface.cullFace == null) ++ if (blockpartface.cullFace == null || !net.minecraftforge.client.model.TRSRTransformation.isInteger(modelRotationIn.getMatrix())) + { + simplebakedmodel$builder.addGeneralQuad(this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, modelRotationIn, uvLocked)); + } + 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)); + } + } + } +++++ END PATCH +++++ REJECTED PATCH 8 + + 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_) + { ++ 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); + } + +++++ END PATCH +++++ REJECTED PATCH 9 + MODEL_CLOCK.name = "class generation marker"; + MODEL_ENTITY.name = "block entity marker"; + } ++ ++ /*********************************************************** ++ * FML Start ++ ***********************************************************/ ++ private static Map, Set> customVariantNames = Maps.newHashMap(); ++ /** ++ * @deprecated use registerItemVariants ++ */ ++ @Deprecated ++ public static void addVariantName(Item item, String... names) ++ { ++ if (customVariantNames.containsKey(item.delegate)) ++ customVariantNames.get(item.delegate).addAll(Lists.newArrayList(names)); ++ else ++ customVariantNames.put(item.delegate, Sets.newHashSet(names)); ++ } ++ ++ public static void registerItemVariants(Item item, T... names) ++ { ++ if (!customVariantNames.containsKey(item.delegate)) ++ { ++ customVariantNames.put(item.delegate, Sets.newHashSet()); ++ } ++ for(ResourceLocation name : names) ++ { ++ customVariantNames.get(item.delegate).add(name.toString()); ++ } ++ } ++ /*********************************************************** ++ * FML End ++ ***********************************************************/ + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch.rej b/rejects/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch.rej new file mode 100644 index 000000000..734c561bd --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch.rej @@ -0,0 +1,13 @@ +++++ REJECTED PATCH 1 + + public void onResourceManagerReload(IResourceManager resourceManager) + { +- 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(); + } + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch.rej b/rejects/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch.rej new file mode 100644 index 000000000..9d9e7cc81 --- /dev/null +++ b/rejects/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch.rej @@ -0,0 +1,21 @@ +++++ REJECTED PATCH 1 + import org.lwjgl.util.vector.Vector3f; + + @SideOnly(Side.CLIENT) +-public enum ModelRotation ++public enum ModelRotation implements net.minecraftforge.client.model.IModelState, net.minecraftforge.client.model.ITransformation + { + X0_Y0(0, 0), + X0_Y90(0, 90), +++++ END PATCH +++++ REJECTED PATCH 2 + mapRotations.put(Integer.valueOf(modelrotation.combinedXY), modelrotation); + } + } ++ ++ public com.google.common.base.Optional apply(com.google.common.base.Optional part) { return net.minecraftforge.client.ForgeHooksClient.applyTransform(getMatrix(), part); } ++ 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); } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/command/CommandBase.java.patch.rej b/rejects/minecraft/net/minecraft/command/CommandBase.java.patch.rej new file mode 100644 index 000000000..d826d8eee --- /dev/null +++ b/rejects/minecraft/net/minecraft/command/CommandBase.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + ichatcomponent.appendText(" "); + } + +- IChatComponent ichatcomponent1 = new ChatComponentText(args[i]); ++ IChatComponent ichatcomponent1 = net.minecraftforge.common.ForgeHooks.newChatWithLinks(args[i]); // Forge: links for messages + + if (p_147176_3_) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/command/CommandEnchant.java.patch.rej b/rejects/minecraft/net/minecraft/command/CommandEnchant.java.patch.rej new file mode 100644 index 000000000..9af81aea0 --- /dev/null +++ b/rejects/minecraft/net/minecraft/command/CommandEnchant.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + { + Enchantment enchantment2 = Enchantment.getEnchantmentById(l); + +- if (!enchantment2.canApplyTogether(enchantment1)) ++ if (!enchantment2.canApplyTogether(enchantment1) || !enchantment1.canApplyTogether(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"))}); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/command/CommandFill.java.patch.rej b/rejects/minecraft/net/minecraft/command/CommandFill.java.patch.rej new file mode 100644 index 000000000..3d13d0aa6 --- /dev/null +++ b/rejects/minecraft/net/minecraft/command/CommandFill.java.patch.rej @@ -0,0 +1,20 @@ +++++ REJECTED PATCH 2 + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + +- if (args.length >= 10 && block.hasTileEntity()) ++ if (args.length >= 10 && block.hasTileEntity(state)) + { + String s = getChatComponentFromNthArg(sender, args, 9).getUnformattedText(); + +++++ END PATCH +++++ REJECTED PATCH 3 + continue; + } + } +- else if (args[8].equals("replace") && !block.hasTileEntity()) ++ else if (args[8].equals("replace") && !block.hasTileEntity(state)) + { + if (args.length > 9) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/command/CommandHandler.java.patch.rej b/rejects/minecraft/net/minecraft/command/CommandHandler.java.patch.rej new file mode 100644 index 000000000..92101609e --- /dev/null +++ b/rejects/minecraft/net/minecraft/command/CommandHandler.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 2 + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.generic.exception", new Object[0]); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + sender.addChatMessage(chatcomponenttranslation); +- logger.warn("Couldn\'t process command: \'" + input + "\'"); ++ logger.warn("Couldn\'t process command: \'" + input + "\'", var9); // Forge: Log stacktrace of unknown exceptions + } + + return false; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/command/PlayerSelector.java.patch.rej b/rejects/minecraft/net/minecraft/command/PlayerSelector.java.patch.rej new file mode 100644 index 000000000..673621f25 --- /dev/null +++ b/rejects/minecraft/net/minecraft/command/PlayerSelector.java.patch.rej @@ -0,0 +1,13 @@ +++++ REJECTED PATCH 1 + + public class PlayerSelector + { +- private static final Pattern tokenPattern = Pattern.compile("^@([pare])(?:\\[([\\w=,!-]*)\\])?$"); ++ private static final Pattern tokenPattern = Pattern.compile("^@([pare])(?:\\[([\\w\\.=,!-]*)\\])?$"); // FORGE: allow . in entity selectors + private static final Pattern intListPattern = Pattern.compile("\\G([-!]?[\\w-]*)(?:$|,)"); +- private static final Pattern keyValueListPattern = Pattern.compile("\\G(\\w+)=([-!]?[\\w-]*)(?:$|,)"); ++ private static final Pattern keyValueListPattern = Pattern.compile("\\G(\\w+)=([-!]?[\\w\\.-]*)(?:$|,)"); // FORGE: allow . in entity selectors + private static final Set WORLD_BINDING_ARGS = Sets.newHashSet(new String[] {"x", "y", "z", "dx", "dy", "dz", "rm", "r"}); + + public static EntityPlayerMP matchOnePlayer(ICommandSender sender, String token) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch.rej b/rejects/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch.rej new file mode 100644 index 000000000..d7dd3fdf8 --- /dev/null +++ b/rejects/minecraft/net/minecraft/command/server/CommandSetBlock.java.patch.rej @@ -0,0 +1,20 @@ +++++ REJECTED PATCH 1 + i = parseInt(args[4], 0, 15); + } + ++ IBlockState state = block.getStateFromMeta(i); ++ + World world = sender.getEntityWorld(); + + if (!world.isBlockLoaded(blockpos)) +++++ END PATCH +++++ REJECTED PATCH 2 + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + +- if (args.length >= 7 && block.hasTileEntity()) ++ if (args.length >= 7 && block.hasTileEntity(state)) + { + String s = getChatComponentFromNthArg(sender, args, 6).getUnformattedText(); + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch.rej b/rejects/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch.rej new file mode 100644 index 000000000..1af151dc0 --- /dev/null +++ b/rejects/minecraft/net/minecraft/command/server/CommandTestForBlock.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + +- if (args.length >= 6 && block.hasTileEntity()) ++ if (args.length >= 6 && block.hasTileEntity(block.getStateFromMeta(i))) + { + String s = getChatComponentFromNthArg(sender, args, 5).getUnformattedText(); + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/enchantment/Enchantment.java.patch.rej b/rejects/minecraft/net/minecraft/enchantment/Enchantment.java.patch.rej new file mode 100644 index 000000000..f9ef1270f --- /dev/null +++ b/rejects/minecraft/net/minecraft/enchantment/Enchantment.java.patch.rej @@ -0,0 +1,57 @@ +++++ REJECTED PATCH 1 + + if (enchantmentsList[enchID] != null) + { +- throw new IllegalArgumentException("Duplicate enchantment id!"); ++ throw new IllegalArgumentException("Duplicate enchantment id! " + this.getClass() + " and " + enchantmentsList[enchID].getClass() + " Enchantment ID:" + enchID); + } + else + { +++++ END PATCH +++++ REJECTED PATCH 3 + { + } + ++ /** ++ * This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)} ++ * applies for all possible enchantments. ++ * @param stack ++ * @return ++ */ ++ public boolean canApplyAtEnchantingTable(ItemStack stack) ++ { ++ return this.type.canEnchantItem(stack.getItem()); ++ } ++ ++ private static final java.lang.reflect.Field bookSetter = Enchantment.class.getDeclaredFields()[1]; ++ /** ++ * Add to the list of enchantments applicable by the anvil from a book ++ * ++ * @param enchantment ++ */ ++ public static void addToBookList(Enchantment enchantment) ++ { ++ try ++ { ++ net.minecraftforge.common.util.EnumHelper.setFailsafeFieldValue(bookSetter, null, ++ com.google.common.collect.ObjectArrays.concat(enchantmentsBookList, enchantment)); ++ } ++ catch (Exception e) ++ { ++ throw new RuntimeException(e); //Rethrow see what happens ++ } ++ } ++ ++ /** ++ * Is this enchantment allowed to be enchanted on books via Enchantment Table ++ * @return false to disable the vanilla feature ++ */ ++ public boolean isAllowedOnBooks() ++ { ++ return true; ++ } ++ + static + { + List list = Lists.newArrayList(); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch.rej b/rejects/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch.rej new file mode 100644 index 000000000..69f7aae3e --- /dev/null +++ b/rejects/minecraft/net/minecraft/enchantment/EnchantmentHelper.java.patch.rej @@ -0,0 +1,23 @@ +++++ REJECTED PATCH 3 + + 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 + { + flag = false; + break; +++++ END PATCH +++++ REJECTED PATCH 4 + + for (Enchantment enchantment : Enchantment.enchantmentsBookList) + { +- if (enchantment != null && (enchantment.type.canEnchantItem(item) || flag)) ++ if (enchantment == null) continue; ++ if (enchantment.canApplyAtEnchantingTable(p_77505_1_) || (flag && enchantment.isAllowedOnBooks())) + { + for (int i = enchantment.getMinLevel(); i <= enchantment.getMaxLevel(); ++i) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/Entity.java.patch.rej b/rejects/minecraft/net/minecraft/entity/Entity.java.patch.rej new file mode 100644 index 000000000..ed53bc9e4 --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/Entity.java.patch.rej @@ -0,0 +1,59 @@ +++++ 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/EntityAgeable.java.patch.rej b/rejects/minecraft/net/minecraft/entity/EntityAgeable.java.patch.rej new file mode 100644 index 000000000..81b980feb --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/EntityAgeable.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + { + if (!this.worldObj.isRemote) + { +- Class oclass = EntityList.getClassFromID(itemstack.getMetadata()); ++ Class oclass = EntityList.stringToClassMapping.get(net.minecraft.item.ItemMonsterPlacer.getEntityName(itemstack)); + + if (oclass != null && this.getClass() == oclass) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/EntityHanging.java.patch.rej b/rejects/minecraft/net/minecraft/entity/EntityHanging.java.patch.rej new file mode 100644 index 000000000..9b9b6da9a --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/EntityHanging.java.patch.rej @@ -0,0 +1,11 @@ +++++ 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/EntityList.java.patch.rej b/rejects/minecraft/net/minecraft/entity/EntityList.java.patch.rej new file mode 100644 index 000000000..81dca3b0f --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/EntityList.java.patch.rej @@ -0,0 +1,11 @@ +++++ REJECTED PATCH 4 + + public static class EntityEggInfo + { ++ @Deprecated // This is not always a valid number in the global ID list. + public final int spawnedID; ++ public final String name; + public final int primaryColor; + public final int secondaryColor; + public final StatBase field_151512_d; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/EntityLivingBase.java.patch.rej b/rejects/minecraft/net/minecraft/entity/EntityLivingBase.java.patch.rej new file mode 100644 index 000000000..66499b8a9 --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/EntityLivingBase.java.patch.rej @@ -0,0 +1,76 @@ +++++ 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/entity/EntityMinecartCommandBlock.java.patch.rej b/rejects/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java.patch.rej new file mode 100644 index 000000000..75ed679fe --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/EntityMinecartCommandBlock.java.patch.rej @@ -0,0 +1,9 @@ +++++ REJECTED PATCH 1 + + public boolean interactFirst(EntityPlayer playerIn) + { ++ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, playerIn))) return true; + this.commandBlockLogic.tryOpenEditCommandBlock(playerIn); + return false; + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch.rej b/rejects/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch.rej new file mode 100644 index 000000000..cdbb07dee --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/EntityTrackerEntry.java.patch.rej @@ -0,0 +1,32 @@ +++++ REJECTED PATCH 1 + this.lastTrackedEntityMotionY = this.trackedEntity.motionY; + this.motionZ = this.trackedEntity.motionZ; + ++ 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) ++ { ++ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.makeEntitySpawnAdjustment(this.trackedEntity, playerMP, this.encodedPosX, this.encodedPosY, this.encodedPosZ); ++ } ++ + if (this.sendVelocityUpdates && !(packet instanceof S0FPacketSpawnMob)) + { + playerMP.playerNetServerHandler.sendPacket(new S12PacketEntityVelocity(this.trackedEntity.getEntityId(), this.trackedEntity.motionX, this.trackedEntity.motionY, this.trackedEntity.motionZ)); +++++ END PATCH +++++ REJECTED PATCH 2 + playerMP.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(this.trackedEntity.getEntityId(), potioneffect)); + } + } ++ net.minecraftforge.event.ForgeEventFactory.onStartEntityTracking(trackedEntity, playerMP); + } + } + else if (this.trackingPlayers.contains(playerMP)) + { + this.trackingPlayers.remove(playerMP); + playerMP.removeEntity(this.trackedEntity); ++ net.minecraftforge.event.ForgeEventFactory.onStopEntityTracking(trackedEntity, playerMP); + } + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch.rej b/rejects/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch.rej new file mode 100644 index 000000000..2d0c7a658 --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch.rej @@ -0,0 +1,56 @@ +++++ REJECTED PATCH 1 + private double targetX; + private double targetY; + private double targetZ; ++ private int failedPathFindingPenalty = 0; ++ private boolean canPenalize = false; + + public EntityAIAttackOnCollide(EntityCreature creature, Class targetClass, double speedIn, boolean useLongMemory) + { +++++ END PATCH +++++ REJECTED PATCH 2 + } + else + { ++ if (canPenalize) ++ { ++ if (--this.delayCounter <= 0) ++ { ++ this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(entitylivingbase); ++ this.targetX = 4 + this.attacker.getRNG().nextInt(7); ++ return this.entityPathEntity != null; ++ } ++ else ++ { ++ return true; ++ } ++ } + this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(entitylivingbase); + return this.entityPathEntity != null; + } +++++ END PATCH +++++ REJECTED PATCH 3 + this.targetZ = entitylivingbase.posZ; + this.delayCounter = 4 + this.attacker.getRNG().nextInt(7); + ++ if (this.canPenalize) ++ { ++ this.targetX += failedPathFindingPenalty; ++ if (this.attacker.getNavigator().getPath() != null) ++ { ++ net.minecraft.pathfinding.PathPoint finalPathPoint = this.attacker.getNavigator().getPath().getFinalPathPoint(); ++ if (finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1) ++ failedPathFindingPenalty = 0; ++ else ++ failedPathFindingPenalty += 10; ++ } ++ else ++ { ++ failedPathFindingPenalty += 10; ++ } ++ } ++ + if (d0 > 1024.0D) + { + this.delayCounter += 10; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch.rej b/rejects/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch.rej new file mode 100644 index 000000000..baa14587a --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/boss/EntityDragon.java.patch.rej @@ -0,0 +1,13 @@ +++++ REJECTED PATCH 1 + BlockPos blockpos = new BlockPos(k1, l1, i2); + Block block = this.worldObj.getBlockState(blockpos).getBlock(); + +- if (block.getMaterial() != Material.air) ++ if (!block.isAir(worldObj, 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().getBoolean("mobGriefing")) ++ if (block.canEntityDestroy(worldObj, new BlockPos(k1, l1, i2), this) && this.worldObj.getGameRules().getBoolean("mobGriefing")) + { + flag1 = this.worldObj.setBlockToAir(blockpos) || flag1; + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/boss/EntityWither.java.patch.rej b/rejects/minecraft/net/minecraft/entity/boss/EntityWither.java.patch.rej new file mode 100644 index 000000000..a357507d6 --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/boss/EntityWither.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + BlockPos blockpos = new BlockPos(i3, k, l); + Block block = this.worldObj.getBlockState(blockpos).getBlock(); + +- if (block.getMaterial() != Material.air && func_181033_a(block)) ++ if (!block.isAir(worldObj,blockpos) && func_181033_a(block) && block.canEntityDestroy(worldObj, blockpos, this)) + { + flag = this.worldObj.destroyBlock(blockpos, true) || flag; + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/boss/IBossDisplayData.java.patch.rej b/rejects/minecraft/net/minecraft/entity/boss/IBossDisplayData.java.patch.rej new file mode 100644 index 000000000..b7bedf878 --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/boss/IBossDisplayData.java.patch.rej @@ -0,0 +1,9 @@ +++++ REJECTED PATCH 1 + import net.minecraftforge.fml.relauncher.Side; + import net.minecraftforge.fml.relauncher.SideOnly; + +-@SideOnly(Side.CLIENT) + public interface IBossDisplayData + { + float getMaxHealth(); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch.rej b/rejects/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch.rej new file mode 100644 index 000000000..bab388b0d --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/item/EntityMinecart.java.patch.rej @@ -0,0 +1,289 @@ +++++ REJECTED PATCH 10 + 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.moveMinecartOnRail(p_180460_1_); + +- if (this.riddenByEntity != null) +- { +- d22 *= 0.75D; +- d23 *= 0.75D; +- } +- +- double d13 = this.getMaximumSpeed(); +- d22 = MathHelper.clamp_double(d22, -d13, d13); +- d23 = MathHelper.clamp_double(d23, -d13, d13); +- this.moveEntity(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]) + { + this.setPosition(this.posX, this.posY + (double)aint[0][1], this.posZ); +++++ END PATCH +++++ REJECTED PATCH 12 + + public void applyEntityCollision(Entity entityIn) + { ++ ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartCollisionEvent(this, entityIn)); ++ if (getCollisionHandler() != null) ++ { ++ getCollisionHandler().onEntityCollision(this, entityIn); ++ return; ++ } + if (!this.worldObj.isRemote) + { + if (!entityIn.noClip && !this.noClip) + { + if (entityIn != this.riddenByEntity) + { +- 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) + { + entityIn.mountEntity(this); + } +++++ END PATCH +++++ REJECTED PATCH 13 + double d7 = entityIn.motionX + this.motionX; + double d8 = entityIn.motionZ + this.motionZ; + +- if (((EntityMinecart)entityIn).getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE && this.getMinecartType() != EntityMinecart.EnumMinecartType.FURNACE) ++ if (((EntityMinecart)entityIn).isPoweredCart() && !isPoweredCart()) + { + this.motionX *= 0.20000000298023224D; + this.motionZ *= 0.20000000298023224D; +++++ END PATCH +++++ REJECTED PATCH 14 + entityIn.motionX *= 0.949999988079071D; + entityIn.motionZ *= 0.949999988079071D; + } +- else if (((EntityMinecart)entityIn).getMinecartType() != EntityMinecart.EnumMinecartType.FURNACE && this.getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE) ++ else if (((EntityMinecart)entityIn).isPoweredCart() && isPoweredCart()) + { + entityIn.motionX *= 0.20000000298023224D; + entityIn.motionZ *= 0.20000000298023224D; +++++ END PATCH +++++ REJECTED PATCH 15 + } + } + ++ /* =================================== 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); ++ } ++ ++ protected double getMaxSpeed() ++ { ++ if (!canUseRail()) return getMaximumSpeed(); ++ BlockPos pos = this.getCurrentRailPosition(); ++ IBlockState state = this.worldObj.getBlockState(pos); ++ if (!BlockRailBase.isRailBlock(state)) return getMaximumSpeed(); ++ ++ float railMaxSpeed = ((BlockRailBase)state.getBlock()).getRailMaxSpeed(worldObj, this, pos); ++ return Math.min(railMaxSpeed, getCurrentCartSpeedCapOnRail()); ++ } ++ ++ /** ++ * Moved to allow overrides. ++ * This code handles minecart movement and speed capping when on a rail. ++ */ ++ public void moveMinecartOnRail(BlockPos pos) ++ { ++ double mX = this.motionX; ++ double mZ = this.motionZ; ++ ++ if (this.riddenByEntity != 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); ++ } ++ ++ /** ++ * Gets the current global Minecart Collision handler if none ++ * is registered, returns null ++ * @return The collision handler or null ++ */ ++ public static net.minecraftforge.common.IMinecartCollisionHandler getCollisionHandler() ++ { ++ return collisionHandler; ++ } ++ ++ /** ++ * Sets the global Minecart Collision handler, overwrites any ++ * that is currently set. ++ * @param handler The new handler ++ */ ++ public static void setCollisionHandler(net.minecraftforge.common.IMinecartCollisionHandler handler) ++ { ++ collisionHandler = handler; ++ } ++ ++ /** ++ * This function returns an ItemStack that represents this cart. ++ * This should be an ItemStack that can be used by the player to place the cart, ++ * but is not necessary the item the cart drops when destroyed. ++ * @return An ItemStack that can be used to place the cart. ++ */ ++ public ItemStack getCartItem() ++ { ++ if (this instanceof EntityMinecartFurnace) ++ { ++ return new ItemStack(Items.furnace_minecart); ++ } ++ else if (this instanceof EntityMinecartChest) ++ { ++ return new ItemStack(Items.chest_minecart); ++ } ++ else if (this instanceof EntityMinecartTNT) ++ { ++ return new ItemStack(Items.tnt_minecart); ++ } ++ else if (this instanceof EntityMinecartHopper) ++ { ++ return new ItemStack(Items.hopper_minecart); ++ } ++ else if (this instanceof EntityMinecartCommandBlock) ++ { ++ return new ItemStack(Items.command_block_minecart); ++ } ++ return new ItemStack(Items.minecart); ++ } ++ ++ /** ++ * Returns true if this cart can currently use rails. ++ * This function is mainly used to gracefully detach a minecart from a rail. ++ * @return True if the minecart can use rails. ++ */ ++ public boolean canUseRail() ++ { ++ return canUseRail; ++ } ++ ++ /** ++ * Set whether the minecart can use rails. ++ * This function is mainly used to gracefully detach a minecart from a rail. ++ * @param use Whether the minecart can currently use rails. ++ */ ++ public void setCanUseRail(boolean use) ++ { ++ canUseRail = use; ++ } ++ ++ /** ++ * Return false if this cart should not call onMinecartPass() and should ignore Powered Rails. ++ * @return True if this cart should call onMinecartPass(). ++ */ ++ public boolean shouldDoRailFunctions() ++ { ++ return true; ++ } ++ ++ /** ++ * Returns true if this cart is self propelled. ++ * @return True if powered. ++ */ ++ public boolean isPoweredCart() ++ { ++ return getMinecartType() == EntityMinecart.EnumMinecartType.FURNACE; ++ } ++ ++ /** ++ * Returns true if this cart can be ridden by an Entity. ++ * @return True if this cart can be ridden. ++ */ ++ public boolean canBeRidden() ++ { ++ return this.getMinecartType() == EntityMinecart.EnumMinecartType.RIDEABLE; ++ } ++ ++ /** ++ * Getters/setters for physics variables ++ */ ++ ++ /** ++ * Returns the carts max speed when traveling on rails. Carts going faster ++ * than 1.1 cause issues with chunk loading. Carts cant traverse slopes or ++ * corners at greater than 0.5 - 0.6. This value is compared with the rails ++ * max speed and the carts current speed cap to determine the carts current ++ * max speed. A normal rail's max speed is 0.4. ++ * ++ * @return Carts max speed. ++ */ ++ public float getMaxCartSpeedOnRail() ++ { ++ return 1.2f; ++ } ++ ++ /** ++ * Returns the current speed cap for the cart when traveling on rails. This ++ * functions differs from getMaxCartSpeedOnRail() in that it controls ++ * current movement and cannot be overridden. The value however can never be ++ * higher than getMaxCartSpeedOnRail(). ++ * ++ * @return ++ */ ++ public final float getCurrentCartSpeedCapOnRail() ++ { ++ return currentSpeedRail; ++ } ++ ++ public final void setCurrentCartSpeedCapOnRail(float value) ++ { ++ value = Math.min(value, getMaxCartSpeedOnRail()); ++ currentSpeedRail = value; ++ } ++ ++ public float getMaxSpeedAirLateral() ++ { ++ return maxSpeedAirLateral; ++ } ++ ++ public void setMaxSpeedAirLateral(float value) ++ { ++ maxSpeedAirLateral = value; ++ } ++ ++ public float getMaxSpeedAirVertical() ++ { ++ return maxSpeedAirVertical; ++ } ++ ++ public void setMaxSpeedAirVertical(float value) ++ { ++ maxSpeedAirVertical = value; ++ } ++ ++ public double getDragAir() ++ { ++ return dragAir; ++ } ++ ++ public void setDragAir(double value) ++ { ++ dragAir = value; ++ } ++ ++ public double getSlopeAdjustment() ++ { ++ return 0.0078125D; ++ } ++ ++ /* =================================== FORGE END ===========================================*/ ++ + public static enum EnumMinecartType + { + RIDEABLE(0, "MinecartRideable"), +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch.rej b/rejects/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch.rej new file mode 100644 index 000000000..c29f3c2b5 --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java.patch.rej @@ -0,0 +1,9 @@ +++++ REJECTED PATCH 1 + + public boolean interactFirst(EntityPlayer playerIn) + { ++ 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) + { + return true; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch.rej b/rejects/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch.rej new file mode 100644 index 000000000..9128588fd --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java.patch.rej @@ -0,0 +1,9 @@ +++++ REJECTED PATCH 1 + + public boolean interactFirst(EntityPlayer playerIn) + { ++ 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 (itemstack != null && itemstack.getItem() == Items.coal) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch.rej b/rejects/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch.rej new file mode 100644 index 000000000..211020514 --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/monster/EntityEnderman.java.patch.rej @@ -0,0 +1,19 @@ +++++ REJECTED PATCH 1 + + protected boolean teleportTo(double x, double y, double z) + { ++ net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(this, x, y, z, 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 = x; +- this.posY = y; +- this.posZ = z; ++ this.posX = event.targetX; ++ this.posY = event.targetY; ++ this.posZ = event.targetZ; + boolean flag = false; + BlockPos blockpos = new BlockPos(this.posX, this.posY, this.posZ); + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch.rej b/rejects/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch.rej new file mode 100644 index 000000000..2d62aecaf --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/monster/EntityZombie.java.patch.rej @@ -0,0 +1,42 @@ +++++ REJECTED PATCH 1 + 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); + } + + protected void entityInit() +++++ END PATCH +++++ REJECTED PATCH 2 + entitylivingbase = (EntityLivingBase)source.getEntity(); + } + +- 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); ++ ++ net.minecraftforge.event.entity.living.ZombieEvent.SummonAidEvent summonAid = net.minecraftforge.event.ForgeEventFactory.fireZombieSummonAid(this, worldObj, i, j, k, entitylivingbase, this.getEntityAttribute(reinforcementChance).getAttributeValue()); ++ 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()) + { +- 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); ++ EntityZombie entityzombie; ++ if (summonAid.customSummonedAid != null && summonAid.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW) ++ { ++ entityzombie = summonAid.customSummonedAid; ++ } ++ else ++ { ++ entityzombie = new EntityZombie(this.worldObj); ++ } + + for (int l = 0; l < 50; ++l) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch.rej b/rejects/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch.rej new file mode 100644 index 000000000..c6f68c40e --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/passive/EntityMooshroom.java.patch.rej @@ -0,0 +1,19 @@ +++++ REJECTED PATCH 2 + this.spawnableBlock = Blocks.mycelium; + } + ++ @SuppressWarnings("unused") + public boolean interact(EntityPlayer player) + { + ItemStack itemstack = player.inventory.getCurrentItem(); +++++ END PATCH +++++ REJECTED PATCH 3 + } + } + +- 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 + { + 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]); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch.rej b/rejects/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch.rej new file mode 100644 index 000000000..c6cc508db --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/passive/EntityOcelot.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + + Block block = this.worldObj.getBlockState(blockpos.down()).getBlock(); + +- if (block == Blocks.grass || block.getMaterial() == Material.leaves) ++ if (block == Blocks.grass || block.isLeaves(worldObj, blockpos.down())) + { + return true; + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch.rej b/rejects/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch.rej new file mode 100644 index 000000000..cc41f2168 --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/passive/EntitySheep.java.patch.rej @@ -0,0 +1,15 @@ +++++ REJECTED PATCH 2 + } + } + ++ @SuppressWarnings("unused") + public boolean interact(EntityPlayer player) + { + ItemStack itemstack = player.inventory.getCurrentItem(); + +- 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 (!this.worldObj.isRemote) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch.rej b/rejects/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch.rej new file mode 100644 index 000000000..a9b8dc6a7 --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/passive/EntityVillager.java.patch.rej @@ -0,0 +1,9 @@ +++++ REJECTED PATCH 1 + private boolean isLookingForHome; + private boolean areAdditionalTasksSet; + private InventoryBasic villagerInventory; ++ @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))}}}}; + + public EntityVillager(World worldIn) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch.rej b/rejects/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch.rej new file mode 100644 index 000000000..2984065a9 --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch.rej @@ -0,0 +1,256 @@ +++++ REJECTED PATCH 1 + @SuppressWarnings("incomplete-switch") + public abstract class EntityPlayer extends EntityLivingBase + { ++ public static final String PERSISTED_NBT_TAG = "PlayerPersisted"; ++ private java.util.HashMap spawnChunkMap = new java.util.HashMap(); ++ 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; +++++ END PATCH +++++ REJECTED PATCH 2 + { + if (this.itemInUse != 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.clearItemInUse(); +++++ END PATCH +++++ REJECTED PATCH 4 + + if (itemstack == this.itemInUse) + { ++ itemInUseCount = net.minecraftforge.event.ForgeEventFactory.onItemUseTick(this, itemInUse, itemInUseCount); ++ if (itemInUseCount <= 0) ++ { ++ this.onItemUseFinish(); ++ } ++ else ++ { // Forge Keep unindented to lower patch ++ itemInUse.getItem().onUsingTick(itemInUse, this, itemInUseCount); //Forge Added + if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) + { + this.updateItemUse(itemstack, 5); +++++ END PATCH +++++ REJECTED PATCH 8 + int i = this.itemInUse.stackSize; + ItemStack itemstack = this.itemInUse.onItemUseFinish(this.worldObj, this); + ++ itemstack = net.minecraftforge.event.ForgeEventFactory.onItemUseFinish(this, itemInUse, itemInUseCount, itemstack); + if (itemstack != this.itemInUse || itemstack != null && itemstack.stackSize != i) + { + this.inventory.mainInventory[this.inventory.currentItem] = itemstack; + +- if (itemstack.stackSize == 0) ++ if (itemstack != null && itemstack.stackSize == 0) + { + this.inventory.mainInventory[this.inventory.currentItem] = null; + } +++++ END PATCH +++++ REJECTED PATCH 9 + this.cameraYaw = 0.0F; + this.addMountedMovementStat(this.posX - d0, this.posY - d1, this.posZ - d2); + +- if (this.ridingEntity instanceof EntityPig) ++ if (this.ridingEntity instanceof EntityLivingBase && ((EntityLivingBase)ridingEntity).shouldRiderFaceForward(this)) + { + this.rotationPitch = f1; + this.rotationYaw = f; +- this.renderYawOffset = ((EntityPig)this.ridingEntity).renderYawOffset; ++ this.renderYawOffset = ((EntityLivingBase)this.ridingEntity).renderYawOffset; + } + } + } +++++ END PATCH +++++ REJECTED PATCH 13 + + public void joinEntityItemWithWorld(EntityItem itemIn) + { ++ if (captureDrops) ++ { ++ capturedDrops.add(itemIn); ++ return; ++ } ++ + this.worldObj.spawnEntityInWorld(itemIn); + } + ++ @Deprecated //Use location sensitive version below + public float getToolDigEfficiency(Block p_180471_1_) + { +- float f = this.inventory.getStrVsBlock(p_180471_1_); ++ return getBreakSpeed(p_180471_1_.getDefaultState(), 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)); + if (f > 1.0F) + { + int i = EnchantmentHelper.getEfficiencyModifier(this); +++++ END PATCH +++++ REJECTED PATCH 14 + f /= 5.0F; + } + +- return f; ++ f = net.minecraftforge.event.ForgeEventFactory.getBreakSpeed(this, state, f, pos); ++ return (f < 0 ? 0 : f); + } + + public boolean canHarvestBlock(Block blockToHarvest) + { +- return this.inventory.canHeldItemHarvest(blockToHarvest); ++ return net.minecraftforge.event.ForgeEventFactory.doPlayerHarvestCheck(this, blockToHarvest, this.inventory.canHeldItemHarvest(blockToHarvest)); + } + + public void readEntityFromNBT(NBTTagCompound tagCompund) +++++ END PATCH +++++ REJECTED PATCH 18 + { + if (!this.isEntityInvulnerable(damageSrc)) + { ++ damageAmount = net.minecraftforge.common.ForgeHooks.onLivingHurt(this, damageSrc, damageAmount); ++ if (damageAmount <= 0) return; + if (!damageSrc.isUnblockable() && this.isBlocking() && damageAmount > 0.0F) + { + damageAmount = (1.0F + damageAmount) * 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); +++++ END PATCH +++++ REJECTED PATCH 19 + } + else + { ++ if (!net.minecraftforge.event.ForgeEventFactory.canInteractWith(this, targetEntity)) return false; + ItemStack itemstack = this.getCurrentEquippedItem(); + ItemStack itemstack1 = itemstack != null ? itemstack.copy() : null; + +++++ END PATCH +++++ REJECTED PATCH 20 + + public void destroyCurrentEquippedItem() + { ++ ItemStack orig = getCurrentEquippedItem(); + this.inventory.setInventorySlotContents(this.inventory.currentItem, (ItemStack)null); ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this, orig); + } + + public double getYOffset() +++++ END PATCH +++++ REJECTED PATCH 23 + + this.setSize(0.2F, 0.2F); + +- if (this.worldObj.isBlockLoaded(bedLocation)) ++ if (this.worldObj.isBlockLoaded(bedLocation) && worldObj.getBlockState(bedLocation).getBlock().isBed(worldObj, bedLocation, this)) + { +- EnumFacing enumfacing = (EnumFacing)this.worldObj.getBlockState(bedLocation).getValue(BlockDirectional.FACING); ++ EnumFacing enumfacing = this.worldObj.getBlockState(bedLocation).getBlock().getBedDirection(worldObj, bedLocation); + float f = 0.5F; + float f1 = 0.5F; + +++++ END PATCH +++++ REJECTED PATCH 27 + } + else + { +- return BlockBed.getSafeExitLocation(worldIn, bedLocation, 0); ++ return worldIn.getBlockState(bedLocation).getBlock().getBedSpawnPosition(worldIn, bedLocation, null); + } + } + + @SideOnly(Side.CLIENT) + public float getBedOrientationInDegrees() + { +- if (this.playerLocation != null) ++ if (this.playerLocation != null && worldObj.getBlockState(playerLocation).getBlock().isBed(worldObj, playerLocation, this)) + { +- EnumFacing enumfacing = (EnumFacing)this.worldObj.getBlockState(this.playerLocation).getValue(BlockDirectional.FACING); ++ EnumFacing enumfacing = this.worldObj.getBlockState(this.playerLocation).getBlock().getBedDirection(worldObj, playerLocation); + + switch (enumfacing) + { +++++ END PATCH +++++ REJECTED PATCH 30 + } + + 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)); + + if (entitylist$entityegginfo != null) + { +++++ END PATCH +++++ REJECTED PATCH 31 + { + if (stack != this.itemInUse) + { ++ duration = net.minecraftforge.event.ForgeEventFactory.onItemUseStart(this, stack, duration); ++ if (duration <= 0) return; + this.itemInUse = stack; + this.itemInUseCount = duration; + +++++ END PATCH +++++ REJECTED PATCH 33 + this.xpSeed = oldPlayer.xpSeed; + this.theInventoryEnderChest = oldPlayer.theInventoryEnderChest; + this.getDataWatcher().updateObject(10, Byte.valueOf(oldPlayer.getDataWatcher().getWatchableObjectByte(10))); ++ ++ this.spawnChunkMap = oldPlayer.spawnChunkMap; ++ this.spawnForcedMap = oldPlayer.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)) ++ { ++ getEntityData().setTag(PERSISTED_NBT_TAG, old.getCompoundTag(PERSISTED_NBT_TAG)); ++ } ++ net.minecraftforge.event.ForgeEventFactory.onPlayerClone(this, oldPlayer, !respawnFromEnd); + } + + protected boolean canTriggerWalking() +++++ END PATCH +++++ REJECTED PATCH 34 + + public void setCurrentItemOrArmor(int slotIn, ItemStack stack) + { +- this.inventory.armorInventory[slotIn] = stack; ++ if (slotIn == 0) //Forge: Fix issue in Player where it doen't take into account selected item ++ { ++ this.inventory.mainInventory[this.inventory.currentItem] = stack; ++ } ++ else ++ { ++ this.inventory.armorInventory[slotIn - 1] = stack; ++ } + } + + @SideOnly(Side.CLIENT) +++++ END PATCH +++++ REJECTED PATCH 35 + + public IChatComponent getDisplayName() + { +- IChatComponent ichatcomponent = new ChatComponentText(ScorePlayerTeam.formatPlayerName(this.getTeam(), this.getName())); ++ 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.getHoverEvent()); + ichatcomponent.getChatStyle().setInsertion(this.getName()); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch.rej b/rejects/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch.rej new file mode 100644 index 000000000..eece03232 --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch.rej @@ -0,0 +1,55 @@ +++++ REJECTED PATCH 1 + public int ping; + public boolean playerConqueredTheEnd; + ++ @SuppressWarnings("unused") + public EntityPlayerMP(MinecraftServer server, WorldServer worldIn, GameProfile profile, ItemInWorldManager interactionManager) + { + super(worldIn, profile); + interactionManager.thisPlayerMP = this; + this.theItemInWorldManager = interactionManager; +- BlockPos blockpos = worldIn.getSpawnPoint(); ++ BlockPos blockpos = worldIn.provider.getRandomizedSpawnPoint(); + +- if (!worldIn.provider.getHasNoSky() && worldIn.getWorldInfo().getGameType() != WorldSettings.GameType.ADVENTURE) ++ if (false && !worldIn.provider.getHasNoSky() && worldIn.getWorldInfo().getGameType() != 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())); +++++ END PATCH +++++ REJECTED PATCH 3 + 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)); + } + } + } +++++ END PATCH +++++ REJECTED PATCH 4 + + public void onDeath(DamageSource cause) + { ++ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, cause)) return; + if (this.worldObj.getGameRules().getBoolean("showDeathMessages")) + { + Team team = this.getTeam(); +++++ END PATCH +++++ REJECTED PATCH 6 + 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)); + + if (entitylist$entityegginfo != null) + { +++++ END PATCH +++++ REJECTED PATCH 7 + + public void travelToDimension(int dimensionId) + { ++ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, dimensionId)) return; + if (this.dimension == 1 && dimensionId == 1) + { + this.triggerAchievement(AchievementList.theEnd2); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch.rej b/rejects/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch.rej new file mode 100644 index 000000000..9fcc96b0e --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/player/InventoryPlayer.java.patch.rej @@ -0,0 +1,16 @@ +++++ REJECTED PATCH 1 + { + if (this.mainInventory[j] == null) + { +- this.mainInventory[j] = new ItemStack(item, 0, itemStackIn.getMetadata()); +- +- if (itemStackIn.hasTagCompound()) +- { +- this.mainInventory[j].setTagCompound((NBTTagCompound)itemStackIn.getTagCompound().copy()); +- } ++ this.mainInventory[j] = itemStackIn.copy(); // Forge: Replace Item clone above to preserve item capabilities when picking the item up. ++ this.mainInventory[j].stackSize = 0; + } + + int k = i; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch.rej b/rejects/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch.rej new file mode 100644 index 000000000..c55c19e5d --- /dev/null +++ b/rejects/minecraft/net/minecraft/entity/projectile/EntityFishHook.java.patch.rej @@ -0,0 +1,21 @@ +++++ REJECTED PATCH 1 + } + } + ++ @SuppressWarnings("unused") + private ItemStack getFishingResult() + { + float f = this.worldObj.rand.nextFloat(); + int i = EnchantmentHelper.getLuckOfSeaModifier(this.angler); + int j = EnchantmentHelper.getLureModifier(this.angler); ++ ++ 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); ++ } ++ + 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); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/init/Bootstrap.java.patch.rej b/rejects/minecraft/net/minecraft/init/Bootstrap.java.patch.rej new file mode 100644 index 000000000..f5b2d3aa1 --- /dev/null +++ b/rejects/minecraft/net/minecraft/init/Bootstrap.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 2 + 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()) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch.rej b/rejects/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch.rej new file mode 100644 index 000000000..663f1630b --- /dev/null +++ b/rejects/minecraft/net/minecraft/inventory/ContainerBrewingStand.java.patch.rej @@ -0,0 +1,30 @@ +++++ 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/ContainerEnchantment.java.patch.rej b/rejects/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch.rej new file mode 100644 index 000000000..35057e9a1 --- /dev/null +++ b/rejects/minecraft/net/minecraft/inventory/ContainerEnchantment.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 4 + + 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_178151_h[i1] = -1; + + if (this.enchantLevels[i1] < i1 + 1) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch.rej b/rejects/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch.rej new file mode 100644 index 000000000..9b89b48f7 --- /dev/null +++ b/rejects/minecraft/net/minecraft/inventory/ContainerPlayer.java.patch.rej @@ -0,0 +1,11 @@ +++++ 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/rejects/minecraft/net/minecraft/inventory/ContainerRepair.java.patch.rej b/rejects/minecraft/net/minecraft/inventory/ContainerRepair.java.patch.rej new file mode 100644 index 000000000..323e886d4 --- /dev/null +++ b/rejects/minecraft/net/minecraft/inventory/ContainerRepair.java.patch.rej @@ -0,0 +1,20 @@ +++++ REJECTED PATCH 3 + + 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 (itemstack1.isItemStackDamageable() && itemstack1.getItem().getIsRepairable(itemstack, itemstack2)) +++++ END PATCH +++++ REJECTED PATCH 4 + { + 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 + { + flag1 = false; + ++l1; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/Item.java.patch.rej b/rejects/minecraft/net/minecraft/item/Item.java.patch.rej new file mode 100644 index 000000000..138fb95f0 --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/Item.java.patch.rej @@ -0,0 +1,735 @@ +++++ REJECTED PATCH 1 + + 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(); +++++ END PATCH +++++ REJECTED PATCH 6 + float f6 = f3 * f4; + float f7 = f2 * f4; + double d3 = 5.0D; ++ if (playerIn instanceof net.minecraft.entity.player.EntityPlayerMP) ++ { ++ d3 = ((net.minecraft.entity.player.EntityPlayerMP)playerIn).theItemInWorldManager.getBlockReachDistance(); ++ } + Vec3 vec31 = vec3.addVector((double)f6 * d3, (double)f5 * d3, (double)f7 * d3); + return worldIn.rayTraceBlocks(vec3, vec31, useLiquids, !useLiquids, false); + } +++++ END PATCH +++++ REJECTED PATCH 7 + return false; + } + ++ @Deprecated // Use ItemStack sensitive version below. + public Multimap getItemAttributeModifiers() + { + return HashMultimap.create(); + } + ++ /* ======================================== FORGE START =====================================*/ ++ /** ++ * ItemStack sensitive version of getItemAttributeModifiers ++ */ ++ public Multimap getAttributeModifiers(ItemStack stack) ++ { ++ return this.getItemAttributeModifiers(); ++ } ++ ++ /** ++ * Called when a player drops the item into the world, ++ * returning false from this will prevent the item from ++ * being removed from the players inventory and spawning ++ * in the world ++ * ++ * @param player The player that dropped the item ++ * @param item The item stack, before the item is removed. ++ */ ++ public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player) ++ { ++ return true; ++ } ++ ++ /** ++ * Allow the item one last chance to modify its name used for the ++ * tool highlight useful for adding something extra that can't be removed ++ * by a user in the displayed name, such as a mode of operation. ++ * ++ * @param item the ItemStack for the item. ++ * @param the name that will be displayed unless it is changed in this method. ++ */ ++ public String getHighlightTip( ItemStack item, String displayName ) ++ { ++ return displayName; ++ } ++ ++ /** ++ * This is called when the item is used, before the block is activated. ++ * @param stack The Item Stack ++ * @param player The Player that used the item ++ * @param world The Current World ++ * @param pos Target position ++ * @param side The side of the target hit ++ * @return Return true to prevent any further processing. ++ */ ++ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) ++ { ++ return false; ++ } ++ ++ /** ++ * Metadata-sensitive version of getStrVsBlock ++ * @param itemstack The Item Stack ++ * @param state The block state ++ * @return The damage strength ++ */ ++ public float getDigSpeed(ItemStack itemstack, net.minecraft.block.state.IBlockState state) ++ { ++ return getStrVsBlock(itemstack, state.getBlock()); ++ } ++ ++ ++ protected boolean canRepair = true; ++ /** ++ * Called by CraftingManager to determine if an item is reparable. ++ * @return True if reparable ++ */ ++ public boolean isRepairable() ++ { ++ return canRepair && isDamageable(); ++ } ++ ++ /** ++ * Call to disable repair recipes. ++ * @return The current Item instance ++ */ ++ public Item setNoRepair() ++ { ++ canRepair = false; ++ return this; ++ } ++ ++ /** ++ * Called before a block is broken. Return true to prevent default block harvesting. ++ * ++ * Note: In SMP, this is called on both client and server sides! ++ * ++ * @param itemstack The current ItemStack ++ * @param pos Block's position in world ++ * @param player The Player that is wielding the item ++ * @return True to prevent harvesting, false to continue as normal ++ */ ++ public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer player) ++ { ++ return false; ++ } ++ ++ /** ++ * Called each tick while using an item. ++ * @param stack The Item being used ++ * @param player The Player using the item ++ * @param count The amount of time in tick the item has been used for continuously ++ */ ++ public void onUsingTick(ItemStack stack, EntityPlayer player, int count) ++ { ++ } ++ ++ /** ++ * Called when the player Left Clicks (attacks) an entity. ++ * Processed before damage is done, if return value is true further processing is canceled ++ * and the entity is not attacked. ++ * ++ * @param stack The Item being used ++ * @param player The player that is attacking ++ * @param entity The entity being attacked ++ * @return True to cancel the rest of the interaction. ++ */ ++ public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) ++ { ++ return false; ++ } ++ ++ /** ++ * Player, Render pass, and item usage sensitive version of getIconIndex. ++ * ++ * @param stack The item stack to get the icon for. ++ * @param player The player holding the item ++ * @param useRemaining The ticks remaining for the active item. ++ * @return Null to use default model, or a custom ModelResourceLocation for the stage of use. ++ */ ++ @SideOnly(Side.CLIENT) ++ public net.minecraft.client.resources.model.ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) ++ { ++ return null; ++ } ++ ++ /** ++ * ItemStack sensitive version of getContainerItem. ++ * Returns a full ItemStack instance of the result. ++ * ++ * @param itemStack The current ItemStack ++ * @return The resulting ItemStack ++ */ ++ public ItemStack getContainerItem(ItemStack itemStack) ++ { ++ if (!hasContainerItem(itemStack)) ++ { ++ return null; ++ } ++ return new ItemStack(getContainerItem()); ++ } ++ ++ /** ++ * ItemStack sensitive version of hasContainerItem ++ * @param stack The current item stack ++ * @return True if this item has a 'container' ++ */ ++ public boolean hasContainerItem(ItemStack stack) ++ { ++ return hasContainerItem(); ++ } ++ ++ /** ++ * Retrieves the normal 'lifespan' of this item when it is dropped on the ground as a EntityItem. ++ * This is in ticks, standard result is 6000, or 5 mins. ++ * ++ * @param itemStack The current ItemStack ++ * @param world The world the entity is in ++ * @return The normal lifespan in ticks. ++ */ ++ public int getEntityLifespan(ItemStack itemStack, World world) ++ { ++ return 6000; ++ } ++ ++ /** ++ * Determines if this Item has a special entity for when they are in the world. ++ * Is called when a EntityItem is spawned in the world, if true and Item#createCustomEntity ++ * returns non null, the EntityItem will be destroyed and the new Entity will be added to the world. ++ * ++ * @param stack The current item stack ++ * @return True of the item has a custom entity, If true, Item#createCustomEntity will be called ++ */ ++ public boolean hasCustomEntity(ItemStack stack) ++ { ++ return false; ++ } ++ ++ /** ++ * This function should return a new entity to replace the dropped item. ++ * Returning null here will not kill the EntityItem and will leave it to function normally. ++ * Called when the item it placed in a world. ++ * ++ * @param world The world object ++ * @param location The EntityItem object, useful for getting the position of the entity ++ * @param itemstack The current item stack ++ * @return A new Entity object to spawn or null ++ */ ++ public Entity createEntity(World world, Entity location, ItemStack itemstack) ++ { ++ return null; ++ } ++ ++ /** ++ * Called by the default implemetation of EntityItem's onUpdate method, allowing for cleaner ++ * control over the update of the item without having to write a subclass. ++ * ++ * @param entityItem The entity Item ++ * @return Return true to skip any further update code. ++ */ ++ public boolean onEntityItemUpdate(net.minecraft.entity.item.EntityItem entityItem) ++ { ++ return false; ++ } ++ ++ /** ++ * Gets a list of tabs that items belonging to this class can display on, ++ * combined properly with getSubItems allows for a single item to span ++ * many sub-items across many tabs. ++ * ++ * @return A list of all tabs that this item could possibly be one. ++ */ ++ public CreativeTabs[] getCreativeTabs() ++ { ++ return new CreativeTabs[]{ getCreativeTab() }; ++ } ++ ++ /** ++ * Determines the base experience for a player when they remove this item from a furnace slot. ++ * This number must be between 0 and 1 for it to be valid. ++ * This number will be multiplied by the stack size to get the total experience. ++ * ++ * @param item The item stack the player is picking up. ++ * @return The amount to award for each item. ++ */ ++ public float getSmeltingExperience(ItemStack item) ++ { ++ return -1; //-1 will default to the old lookups. ++ } ++ ++ /** ++ * Return the correct icon for rendering based on the supplied ItemStack and render pass. ++ * ++ * Defers to {@link #getIconFromDamageForRenderPass(int, int)} ++ * @param stack to render for ++ * @param pass the multi-render pass ++ * @return the icon ++ * / ++ public IIcon getIcon(ItemStack stack, int pass) ++ { ++ return func_77618_c(stack.getMetadata(), pass); ++ } ++ */ ++ ++ /** ++ * Generates the base Random item for a specific instance of the chest gen, ++ * Enchanted books use this to pick a random enchantment. ++ * ++ * @param chest The chest category to generate for ++ * @param rnd World RNG ++ * @param original Original result registered with the chest gen hooks. ++ * @return New values to use as the random item, typically this will be original ++ */ ++ public net.minecraft.util.WeightedRandomChestContent getChestGenBase(net.minecraftforge.common.ChestGenHooks chest, Random rnd, net.minecraft.util.WeightedRandomChestContent original) ++ { ++ if (this instanceof ItemEnchantedBook) ++ { ++ return ((ItemEnchantedBook)this).getRandom(rnd, ++ original.minStackSize, ++ original.maxStackSize, original.itemWeight); ++ } ++ return original; ++ } ++ ++ /** ++ * ++ * Should this item, when held, allow sneak-clicks to pass through to the underlying block? ++ * ++ * @param world The world ++ * @param pos Block position in world ++ * @param player The Player that is wielding the item ++ * @return ++ */ ++ public boolean doesSneakBypassUse(World world, BlockPos pos, EntityPlayer player) ++ { ++ return false; ++ } ++ ++ /** ++ * Called to tick armor in the armor slot. Override to do something ++ */ ++ public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack){} ++ ++ /** ++ * Determines if the specific ItemStack can be placed in the specified armor slot. ++ * ++ * @param stack The ItemStack ++ * @param armorType Armor slot ID: 0: Helmet, 1: Chest, 2: Legs, 3: Boots ++ * @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) ++ { ++ if (this instanceof ItemArmor) ++ { ++ return ((ItemArmor)this).armorType == armorType; ++ } ++ ++ if (armorType == 0) ++ { ++ return this == Item.getItemFromBlock(Blocks.pumpkin) || this == Items.skull; ++ } ++ ++ return false; ++ } ++ ++ /** ++ * Allow or forbid the specific book/item combination as an anvil enchant ++ * ++ * @param stack The item ++ * @param book The book ++ * @return if the enchantment is allowed ++ */ ++ public boolean isBookEnchantable(ItemStack stack, ItemStack book) ++ { ++ return true; ++ } ++ ++ /** ++ * Called by RenderBiped and RenderPlayer to determine the armor texture that ++ * should be use for the currently equipped item. ++ * This will only be called on instances of ItemArmor. ++ * ++ * Returning null from this function will use the default value. ++ * ++ * @param stack ItemStack for the equipped armor ++ * @param entity The entity wearing the armor ++ * @param slot The slot the armor is in ++ * @param type The subtype, can be null or "overlay" ++ * @return Path of texture to bind, or null to use default ++ */ ++ public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) ++ { ++ return null; ++ } ++ ++ /** ++ * Returns the font renderer used to render tooltips and overlays for this item. ++ * Returning null will use the standard font renderer. ++ * ++ * @param stack The current item stack ++ * @return A instance of FontRenderer or null to use default ++ */ ++ @SideOnly(Side.CLIENT) ++ public net.minecraft.client.gui.FontRenderer getFontRenderer(ItemStack stack) ++ { ++ return null; ++ } ++ ++ /** ++ * @deprecated Use 4-argument version. ++ */ ++ // remove 1.9 ++ @SideOnly(Side.CLIENT) ++ @Deprecated ++ public net.minecraft.client.model.ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) ++ { ++ return null; ++ } ++ ++ /** ++ * Override this method to have an item handle its own armor rendering. ++ * ++ * @param entityLiving The entity wearing the armor ++ * @param itemStack The itemStack to render the model of ++ * @param armorSlot 0=head, 1=torso, 2=legs, 3=feet ++ * @param _default Original armor model. Will have attributes set. ++ * @return A ModelBiped to render instead of the default ++ */ ++ @SideOnly(Side.CLIENT) ++ public net.minecraft.client.model.ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot, net.minecraft.client.model.ModelBiped _default) ++ { ++ return getArmorModel(entityLiving, itemStack, armorSlot); ++ } ++ ++ /** ++ * Called when a entity tries to play the 'swing' animation. ++ * ++ * @param entityLiving The entity swinging the item. ++ * @param stack The Item stack ++ * @return True to cancel any further processing by EntityLiving ++ */ ++ public boolean onEntitySwing(EntityLivingBase entityLiving, ItemStack stack) ++ { ++ return false; ++ } ++ ++ /** ++ * Called when the client starts rendering the HUD, for whatever item the player currently has as a helmet. ++ * This is where pumpkins would render there overlay. ++ * ++ * @param stack The ItemStack that is equipped ++ * @param player Reference to the current client entity ++ * @param resolution Resolution information about the current viewport and configured GUI Scale ++ * @param partialTicks Partial ticks for the renderer, useful for interpolation ++ */ ++ @SideOnly(Side.CLIENT) ++ public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, net.minecraft.client.gui.ScaledResolution resolution, float partialTicks){} ++ ++ /** ++ * Return the itemDamage represented by this ItemStack. Defaults to the itemDamage field on ItemStack, but can be overridden here for other sources such as NBT. ++ * ++ * @param stack The itemstack that is damaged ++ * @return the damage value ++ */ ++ public int getDamage(ItemStack stack) ++ { ++ return stack.itemDamage; ++ } ++ ++ /** ++ * This used to be 'display damage' but its really just 'aux' data in the ItemStack, usually shares the same variable as damage. ++ * @param stack ++ * @return ++ */ ++ public int getMetadata(ItemStack stack) ++ { ++ return stack.itemDamage; ++ } ++ ++ /** ++ * Determines if the durability bar should be rendered for this item. ++ * Defaults to vanilla stack.isDamaged behavior. ++ * But modders can use this for any data they wish. ++ * ++ * @param stack The current Item Stack ++ * @return True if it should render the 'durability' bar. ++ */ ++ public boolean showDurabilityBar(ItemStack stack) ++ { ++ return stack.isItemDamaged(); ++ } ++ ++ /** ++ * Queries the percentage of the 'Durability' bar that should be drawn. ++ * ++ * @param stack The current ItemStack ++ * @return 1.0 for 100% 0 for 0% ++ */ ++ public double getDurabilityForDisplay(ItemStack stack) ++ { ++ return (double)stack.getItemDamage() / (double)stack.getMaxDamage(); ++ } ++ ++ /** ++ * Return the maxDamage for this ItemStack. Defaults to the maxDamage field in this item, ++ * but can be overridden here for other sources such as NBT. ++ * ++ * @param stack The itemstack that is damaged ++ * @return the damage value ++ */ ++ public int getMaxDamage(ItemStack stack) ++ { ++ return getMaxDamage(); ++ } ++ ++ /** ++ * Return if this itemstack is damaged. Note only called if {@link #isDamageable()} is true. ++ * @param stack the stack ++ * @return if the stack is damaged ++ */ ++ public boolean isDamaged(ItemStack stack) ++ { ++ return stack.itemDamage > 0; ++ } ++ ++ /** ++ * Set the damage for this itemstack. Note, this method is responsible for zero checking. ++ * @param stack the stack ++ * @param damage the new damage value ++ */ ++ public void setDamage(ItemStack stack, int damage) ++ { ++ stack.itemDamage = damage; ++ ++ if (stack.itemDamage < 0) ++ { ++ stack.itemDamage = 0; ++ } ++ } ++ ++ /** ++ * ItemStack sensitive version of {@link #canHarvestBlock(Block)} ++ * @param par1Block The block trying to harvest ++ * @param itemStack The itemstack used to harvest the block ++ * @return true if can harvest the block ++ */ ++ public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) ++ { ++ return canHarvestBlock(par1Block); ++ } ++ ++ /** ++ * Gets the maximum number of items that this stack should be able to hold. ++ * This is a ItemStack (and thus NBT) sensitive version of Item.getItemStackLimit() ++ * ++ * @param stack The ItemStack ++ * @return THe maximum number this item can be stacked to ++ */ ++ public int getItemStackLimit(ItemStack stack) ++ { ++ return this.getItemStackLimit(); ++ } ++ ++ private java.util.Map toolClasses = new java.util.HashMap(); ++ /** ++ * Sets or removes the harvest level for the specified tool class. ++ * ++ * @param toolClass Class ++ * @param level Harvest level: ++ * Wood: 0 ++ * Stone: 1 ++ * Iron: 2 ++ * Diamond: 3 ++ * Gold: 0 ++ */ ++ public void setHarvestLevel(String toolClass, int level) ++ { ++ if (level < 0) ++ toolClasses.remove(toolClass); ++ else ++ toolClasses.put(toolClass, level); ++ } ++ ++ public java.util.Set getToolClasses(ItemStack stack) ++ { ++ return toolClasses.keySet(); ++ } ++ ++ /** ++ * Queries the harvest level of this item stack for the specifred tool class, ++ * Returns -1 if this tool is not of the specified type ++ * ++ * @param stack This item stack instance ++ * @param toolClass Tool Class ++ * @return Harvest level, or -1 if not the specified tool type. ++ */ ++ public int getHarvestLevel(ItemStack stack, String toolClass) ++ { ++ Integer ret = toolClasses.get(toolClass); ++ return ret == null ? -1 : ret; ++ } ++ ++ /** ++ * ItemStack sensitive version of getItemEnchantability ++ * ++ * @param stack The ItemStack ++ * @return the item echantability value ++ */ ++ public int getItemEnchantability(ItemStack stack) ++ { ++ return getItemEnchantability(); ++ } ++ ++ /** ++ * Whether this Item can be used as a payment to activate the vanilla beacon. ++ * @param stack the ItemStack ++ * @return true if this Item can be used ++ */ ++ public boolean isBeaconPayment(ItemStack stack) ++ { ++ return this == Items.emerald || this == Items.diamond || this == Items.gold_ingot || this == Items.iron_ingot; ++ } ++ ++ ++ /** ++ * Determine if the player switching between these two item stacks ++ * @param oldStack The old stack that was equipped ++ * @param newStack The new stack ++ * @param slotChanged If the current equipped slot was changed, ++ * Vanilla does not play the animation if you switch between two ++ * slots that hold the exact same item. ++ * @return True to play the item change animation ++ */ ++ public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) ++ { ++ return !ItemStack.areItemStacksEqual(oldStack, newStack); ++ } ++ ++ ++ private ResourceLocation registryName = null; ++ /** ++ * Sets a unique name for this Item. This should be used for uniquely identify the instance of the Item. ++ * This is the valid replacement for the atrocious 'getUnlocalizedName().substring(6)' stuff that everyone does. ++ * Unlocalized names have NOTHING to do with unique identifiers. As demonstrated by vanilla blocks and items. ++ * ++ * The supplied name will be prefixed with the currently active mod's modId. ++ * If the supplied name already has a prefix that is different, it will be used and a warning will be logged. ++ * ++ * If a name already exists, or this Item is already registered in a registry, then an IllegalStateException is thrown. ++ * ++ * Returns 'this' to allow for chaining. ++ * ++ * @param name Unique registry name ++ * @return This instance ++ */ ++ public final Item setRegistryName(String name) ++ { ++ if (getRegistryName() != null) ++ throw new IllegalStateException("Attempted to set registry name on block with exisiting registry name! New: " + name + " Old: " + getRegistryName()); ++ int index = name.lastIndexOf(':'); ++ String oldPrefix = index == -1 ? "" : name.substring(0, index); ++ name = index == -1 ? name : name.substring(index + 1); ++ net.minecraftforge.fml.common.ModContainer mc = net.minecraftforge.fml.common.Loader.instance().activeModContainer(); ++ String prefix = mc == null ? "minecraft" : mc.getModId(); ++ if (!oldPrefix.equals(prefix) && oldPrefix.length() > 0) ++ { ++ net.minecraftforge.fml.common.FMLLog.bigWarning("Dangerous alternative prefix %s for name %s, invalid registry invocation/invalid name?", oldPrefix, name); ++ prefix = oldPrefix; ++ } ++ this.registryName = new ResourceLocation(prefix, name); ++ return this; ++ } ++ public final Item setRegistryName(ResourceLocation name){ return setRegistryName(name.toString()); } ++ public final Item setRegistryName(String modID, String name){ return setRegistryName(modID + ":" + name); } ++ ++ /** ++ * A unique identifier for this block, if this block is registered in the game registry it will return that name. ++ * Otherwise it will return the name set in setRegistryName(). ++ * If neither are valid null is returned. ++ * ++ * @return Unique identifier or null. ++ */ ++ public final String getRegistryName() ++ { ++ if (delegate.getResourceName() != null) return delegate.getResourceName().toString(); ++ return registryName != null ? registryName.toString() : null; ++ } ++ ++ /** ++ * Called from ItemStack.setItem, will hold extra data for the life of this ItemStack. ++ * Can be retrieved from stack.getCapabilities() ++ * The NBT can be null if this is not called from readNBT or if the item the stack is ++ * changing FROM is different then this item, or the previous item had no capabilities. ++ * ++ * This is called BEFORE the stacks item is set so you can use stack.getItem() to see the OLD item. ++ * Remember that getItem CAN return null. ++ * ++ * @param stack The ItemStack ++ * @param nbt NBT of this item serialized, or null. ++ * @return A holder instance associated with this ItemStack where you can hold capabilities for the life of this item. ++ */ ++ public net.minecraftforge.common.capabilities.ICapabilityProvider initCapabilities(ItemStack stack, NBTTagCompound nbt) ++ { ++ return null; ++ } ++ /* ======================================== FORGE END =====================================*/ ++ + public static void registerItems() + { + registerItemBlock(Blocks.stone, (new ItemMultiTexture(Blocks.stone, Blocks.stone, new Function() +++++ END PATCH +++++ REJECTED PATCH 9 + return this.enchantability; + } + ++ @Deprecated // Use getRepairItemStack below + public Item getRepairItem() + { +- return this == WOOD ? Item.getItemFromBlock(Blocks.planks) : (this == STONE ? Item.getItemFromBlock(Blocks.cobblestone) : (this == GOLD ? Items.gold_ingot : (this == IRON ? Items.iron_ingot : (this == EMERALD ? Items.diamond : null)))); ++ switch (this) ++ { ++ case WOOD: return Item.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; ++ default: return customCraftingMaterial; ++ } + } ++ ++ public ToolMaterial setRepairItem(ItemStack stack) ++ { ++ 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(); ++ return this; ++ } ++ ++ public ItemStack getRepairItemStack() ++ { ++ if (repairMaterial != null) return repairMaterial; ++ Item ret = this.getRepairItem(); ++ if (ret == null) return null; ++ repairMaterial = new ItemStack(ret, 1, net.minecraftforge.oredict.OreDictionary.WILDCARD_VALUE); ++ return repairMaterial; ++ } + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/ItemArmor.java.patch.rej b/rejects/minecraft/net/minecraft/item/ItemArmor.java.patch.rej new file mode 100644 index 000000000..673c164bc --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/ItemArmor.java.patch.rej @@ -0,0 +1,31 @@ +++++ REJECTED PATCH 1 + if (list.size() > 0) + { + 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; +++++ END PATCH +++++ REJECTED PATCH 2 + + 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; + } + +++++ END PATCH +++++ REJECTED PATCH 3 + private final int[] damageReductionAmountArray; + private final int enchantability; + ++ //Added by forge for custom Armor materials. ++ public Item customCraftingMaterial = null; ++ + private ArmorMaterial(String name, int maxDamage, int[] reductionAmounts, int enchantability) + { + this.name = name; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/ItemBlock.java.patch.rej b/rejects/minecraft/net/minecraft/item/ItemBlock.java.patch.rej new file mode 100644 index 000000000..76da5c69d --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/ItemBlock.java.patch.rej @@ -0,0 +1,19 @@ +++++ REJECTED PATCH 1 + int i = this.getMetadata(stack.getMetadata()); + IBlockState iblockstate1 = this.block.onBlockPlaced(worldIn, pos, side, hitX, hitY, hitZ, i, playerIn); + +- if (worldIn.setBlockState(pos, iblockstate1, 3)) ++ if (placeBlockAt(stack, playerIn, worldIn, pos, side, hitX, hitY, hitZ, iblockstate1)) + { +- iblockstate1 = worldIn.getBlockState(pos); +- +- if (iblockstate1.getBlock() == this.block) +- { +- setTileEntityNBT(worldIn, playerIn, pos, stack); +- this.block.onBlockPlacedBy(worldIn, pos, iblockstate1, playerIn, stack); +- } +- + 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; + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/ItemBow.java.patch.rej b/rejects/minecraft/net/minecraft/item/ItemBow.java.patch.rej new file mode 100644 index 000000000..14823bc8a --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/ItemBow.java.patch.rej @@ -0,0 +1,22 @@ +++++ REJECTED PATCH 1 + if (flag || playerIn.inventory.hasItem(Items.arrow)) + { + int i = this.getMaxItemUseDuration(stack) - timeLeft; ++ net.minecraftforge.event.entity.player.ArrowLooseEvent event = new net.minecraftforge.event.entity.player.ArrowLooseEvent(playerIn, stack, i); ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; ++ i = event.charge; + float f = (float)i / 20.0F; + f = (f * f + f * 2.0F) / 3.0F; + +++++ END PATCH +++++ REJECTED PATCH 2 + + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) + { ++ net.minecraftforge.event.entity.player.ArrowNockEvent event = new net.minecraftforge.event.entity.player.ArrowNockEvent(playerIn, itemStackIn); ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return event.result; ++ + if (playerIn.capabilities.isCreativeMode || playerIn.inventory.hasItem(Items.arrow)) + { + playerIn.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/ItemBucket.java.patch.rej b/rejects/minecraft/net/minecraft/item/ItemBucket.java.patch.rej new file mode 100644 index 000000000..57675df4f --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/ItemBucket.java.patch.rej @@ -0,0 +1,11 @@ +++++ REJECTED PATCH 1 + } + else + { ++ ItemStack ret = net.minecraftforge.event.ForgeEventFactory.onBucketUse(playerIn, worldIn, itemStackIn, movingobjectposition); ++ if (ret != null) return ret; ++ + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + BlockPos blockpos = movingobjectposition.getBlockPos(); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/ItemDye.java.patch.rej b/rejects/minecraft/net/minecraft/item/ItemDye.java.patch.rej new file mode 100644 index 000000000..9932bf970 --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/ItemDye.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 3 + + Block block = worldIn.getBlockState(pos).getBlock(); + +- if (block.getMaterial() != Material.air) ++ if (block.isAir(worldIn, pos)) + { + block.setBlockBoundsBasedOnState(worldIn, pos); + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/ItemEmptyMap.java.patch.rej b/rejects/minecraft/net/minecraft/item/ItemEmptyMap.java.patch.rej new file mode 100644 index 000000000..350f0c56c --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/ItemEmptyMap.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + worldIn.setItemData(s, mapdata); + mapdata.scale = 0; + mapdata.calculateMapCenter(playerIn.posX, playerIn.posZ, mapdata.scale); +- mapdata.dimension = (byte)worldIn.provider.getDimensionId(); ++ mapdata.dimension = worldIn.provider.getDimensionId(); + mapdata.markDirty(); + --itemStackIn.stackSize; + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch.rej b/rejects/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch.rej new file mode 100644 index 000000000..dbdf00580 --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/ItemFlintAndSteel.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + } + else + { +- if (worldIn.getBlockState(pos).getBlock().getMaterial() == Material.air) ++ if (worldIn.isAirBlock(pos)) + { + 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()); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/ItemHoe.java.patch.rej b/rejects/minecraft/net/minecraft/item/ItemHoe.java.patch.rej new file mode 100644 index 000000000..dc31908b5 --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/ItemHoe.java.patch.rej @@ -0,0 +1,16 @@ +++++ REJECTED PATCH 1 + } + else + { ++ int hook = net.minecraftforge.event.ForgeEventFactory.onHoeUse(stack, playerIn, worldIn, pos); ++ if (hook != 0) return hook > 0; ++ + IBlockState iblockstate = worldIn.getBlockState(pos); + Block block = iblockstate.getBlock(); + +- if (side != EnumFacing.DOWN && worldIn.getBlockState(pos.up()).getBlock().getMaterial() == Material.air) ++ if (side != EnumFacing.DOWN && worldIn.isAirBlock(pos.up())) + { + if (block == Blocks.grass) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/ItemLilyPad.java.patch.rej b/rejects/minecraft/net/minecraft/item/ItemLilyPad.java.patch.rej new file mode 100644 index 000000000..33da610fd --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/ItemLilyPad.java.patch.rej @@ -0,0 +1,16 @@ +++++ REJECTED PATCH 1 + + if (iblockstate.getBlock().getMaterial() == Material.water && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0 && worldIn.isAirBlock(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()) ++ { ++ blocksnapshot.restore(true, false); ++ return itemStackIn; ++ } + + if (!playerIn.capabilities.isCreativeMode) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/ItemMap.java.patch.rej b/rejects/minecraft/net/minecraft/item/ItemMap.java.patch.rej new file mode 100644 index 000000000..38ab28060 --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/ItemMap.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + mapdata = new MapData(s); + mapdata.scale = 3; + mapdata.calculateMapCenter((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); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/ItemMonsterPlacer.java.patch.rej b/rejects/minecraft/net/minecraft/item/ItemMonsterPlacer.java.patch.rej new file mode 100644 index 000000000..cf591e4eb --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/ItemMonsterPlacer.java.patch.rej @@ -0,0 +1,88 @@ +++++ REJECTED PATCH 1 + public String getItemStackDisplayName(ItemStack stack) + { + String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim(); +- String s1 = EntityList.getStringFromID(stack.getMetadata()); ++ String s1 = ItemMonsterPlacer.getEntityName(stack); + + if (s1 != null) + { +++++ END PATCH +++++ REJECTED PATCH 2 + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int renderPass) + { +- 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; + } + +++++ END PATCH +++++ REJECTED PATCH 3 + 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); + +++++ END PATCH +++++ REJECTED PATCH 4 + pos = pos.offset(side); + double d0 = 0.0D; + +- if (side == EnumFacing.UP && iblockstate instanceof BlockFence) ++ if (side == EnumFacing.UP && iblockstate.getBlock() instanceof BlockFence) //Forge: Fix Vanilla bug comparing state instead of block + { + 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); + + if (entity != null) + { +++++ END PATCH +++++ REJECTED PATCH 5 + + if (worldIn.getBlockState(blockpos).getBlock() 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); + + if (entity != null) + { +++++ END PATCH +++++ REJECTED PATCH 6 + } + } + ++ @Deprecated // Use string version below. + public static Entity spawnCreature(World worldIn, int entityID, double x, double y, double z) + { + if (!EntityList.entityEggs.containsKey(Integer.valueOf(entityID))) + { + return null; + } ++ return spawnCreature(worldIn, EntityList.getStringFromID(entityID), x, y, z); ++ } ++ ++ public static Entity spawnCreature(World worldIn, String name, double x, double y, double z) ++ { ++ if (!EntityList.stringToClassMapping.containsKey(name)) ++ { ++ return null; ++ } + else + { + Entity entity = null; + + for (int i = 0; i < 1; ++i) + { +- entity = EntityList.createEntityByID(entityID, worldIn); ++ entity = EntityList.createEntityByName(name, worldIn); + + if (entity instanceof EntityLivingBase) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/ItemSeedFood.java.patch.rej b/rejects/minecraft/net/minecraft/item/ItemSeedFood.java.patch.rej new file mode 100644 index 000000000..7002a4032 --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/ItemSeedFood.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 2 + { + 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())) + { + worldIn.setBlockState(pos.up(), this.crops.getDefaultState()); + --stack.stackSize; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/ItemSeeds.java.patch.rej b/rejects/minecraft/net/minecraft/item/ItemSeeds.java.patch.rej new file mode 100644 index 000000000..3476adb20 --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/ItemSeeds.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 2 + { + 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())) + { + worldIn.setBlockState(pos.up(), this.crops.getDefaultState()); + --stack.stackSize; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/ItemShears.java.patch.rej b/rejects/minecraft/net/minecraft/item/ItemShears.java.patch.rej new file mode 100644 index 000000000..6a6935ec6 --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/ItemShears.java.patch.rej @@ -0,0 +1,16 @@ +++++ REJECTED PATCH 1 + + public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) + { +- 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)) + { + return super.onBlockDestroyed(stack, worldIn, blockIn, pos, playerIn); + } + else + { +- stack.damageItem(1, playerIn); + return true; + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/ItemSkull.java.patch.rej b/rejects/minecraft/net/minecraft/item/ItemSkull.java.patch.rej new file mode 100644 index 000000000..c1aa019c0 --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/ItemSkull.java.patch.rej @@ -0,0 +1,32 @@ +++++ REJECTED PATCH 1 + + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + { ++ if (worldIn.getBlockState(pos).getBlock().isReplaceable(worldIn, pos) && side != EnumFacing.DOWN) ++ { ++ side = EnumFacing.UP; ++ pos = pos.down(); ++ } + if (side == EnumFacing.DOWN) + { + return false; +++++ END PATCH +++++ REJECTED PATCH 2 + + if (!flag) + { +- if (!worldIn.getBlockState(pos).getBlock().getMaterial().isSolid()) ++ if (!worldIn.getBlockState(pos).getBlock().getMaterial().isSolid() && !worldIn.isSideSolid(pos, side, true)) + { + return false; + } +++++ END PATCH +++++ REJECTED PATCH 3 + { + if (!worldIn.isRemote) + { ++ if (!Blocks.skull.canPlaceBlockOnSide(worldIn, pos, side)) return false; + worldIn.setBlockState(pos, Blocks.skull.getDefaultState().withProperty(BlockSkull.FACING, side), 3); + int i = 0; + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/item/ItemStack.java.patch.rej b/rejects/minecraft/net/minecraft/item/ItemStack.java.patch.rej new file mode 100644 index 000000000..3a104b087 --- /dev/null +++ b/rejects/minecraft/net/minecraft/item/ItemStack.java.patch.rej @@ -0,0 +1,101 @@ +++++ REJECTED PATCH 4 + + public ItemStack splitStack(int amount) + { +- ItemStack itemstack = new ItemStack(this.item, amount, this.itemDamage); ++ ItemStack itemstack = new ItemStack(this.item, amount, this.itemDamage, this.capabilities != null ? this.capabilities.serializeNBT() : null); + + if (this.stackTagCompound != null) + { +++++ END PATCH +++++ REJECTED PATCH 5 + + public Item getItem() + { +- return this.item; ++ 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) + { ++ 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 (flag) +++++ END PATCH +++++ REJECTED PATCH 6 + nbt.setTag("tag", this.stackTagCompound); + } + ++ if (this.capabilities != null) nbt.setTag("ForgeCaps", this.capabilities.serializeNBT()); ++ + return nbt; + } + + public void readFromNBT(NBTTagCompound nbt) + { ++ this.capNBT = nbt.hasKey("ForgeCaps") ? nbt.getCompoundTag("ForgeCaps") : null; + if (nbt.hasKey("id", 8)) + { +- this.item = Item.getByNameOrId(nbt.getString("id")); ++ this.setItem(Item.getByNameOrId(nbt.getString("id"))); + } + else + { +- this.item = Item.getItemById(nbt.getShort("id")); ++ this.setItem(Item.getItemById(nbt.getShort("id"))); + } ++ this.capNBT = null; + + this.stackSize = nbt.getByte("Count"); + this.itemDamage = nbt.getShort("Damage"); +++++ END PATCH +++++ REJECTED PATCH 9 + + public boolean isItemDamaged() + { +- return this.isItemStackDamageable() && this.itemDamage > 0; ++ return this.isItemStackDamageable() && getItem().isDamaged(this); + } + + public int getItemDamage() + { +- return this.itemDamage; ++ return getItem().getDamage(this); + } + + public int getMetadata() + { +- return this.itemDamage; ++ return getItem().getMetadata(this); + } + + public void setItemDamage(int meta) + { +- this.itemDamage = meta; +- +- if (this.itemDamage < 0) +- { +- this.itemDamage = 0; +- } ++ getItem().setDamage(this, meta); + } + + public int getMaxDamage() + { +- return this.item.getMaxDamage(); ++ return this.item.getMaxDamage(this); + } + + public boolean attemptDamageItem(int amount, Random rand) +++++ END PATCH +++++ REJECTED PATCH 14 + } + else + { +- multimap = this.getItem().getItemAttributeModifiers(); ++ multimap = this.getItem().getAttributeModifiers(this); + } + + return multimap; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch.rej b/rejects/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch.rej new file mode 100644 index 000000000..6d8531c1b --- /dev/null +++ b/rejects/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch.rej @@ -0,0 +1,129 @@ +++++ REJECTED PATCH 1 + this.playerEntity.ridingEntity.updateRiderPosition(); + } + ++ if (!this.hasMoved) return; //Fixes teleportation kick while riding entities ++ + this.serverController.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); + + if (this.playerEntity.ridingEntity != null) +++++ END PATCH +++++ REJECTED PATCH 2 + this.playerEntity.jump(); + } + ++ if (!this.hasMoved) 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; +++++ END PATCH +++++ REJECTED PATCH 3 + logger.warn(this.playerEntity.getName() + " moved wrongly!"); + } + ++ if (!this.hasMoved) 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); + +++++ END PATCH +++++ REJECTED PATCH 4 + { + boolean flag2 = worldserver.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.getEntityBoundingBox().contract((double)f3, (double)f3, (double)f3)).isEmpty(); + +- if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping()) ++ if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.noClip) + { + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, f1, f2); + return; +++++ END PATCH +++++ REJECTED PATCH 5 + this.floatingTickCount = 0; + } + ++ if (!this.hasMoved) 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()); +++++ END PATCH +++++ REJECTED PATCH 7 + WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); + ItemStack itemstack = this.playerEntity.inventory.getCurrentItem(); + boolean flag = false; ++ boolean placeResult = true; + BlockPos blockpos = packetIn.getPosition(); + EnumFacing enumfacing = EnumFacing.getFront(packetIn.getPlacedBlockDirection()); + this.playerEntity.markPlayerActive(); +++++ END PATCH +++++ REJECTED PATCH 8 + 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, new net.minecraft.util.Vec3(packetIn.getPlacedBlockOffsetX(), packetIn.getPlacedBlockOffsetY(), packetIn.getPlacedBlockOffsetZ())); ++ if (event.useItem != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) ++ { + this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, worldserver, itemstack); ++ } + } + else if (blockpos.getY() < this.serverController.getBuildLimit() - 1 || enumfacing != EnumFacing.UP && blockpos.getY() < this.serverController.getBuildLimit()) + { +- 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; ++ 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)) + { +- this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, blockpos, enumfacing, packetIn.getPlacedBlockOffsetX(), packetIn.getPlacedBlockOffsetY(), packetIn.getPlacedBlockOffsetZ()); ++ // 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()); + } + + flag = true; +++++ END PATCH +++++ REJECTED PATCH 9 + this.playerEntity.isChangingQuantityOnly = true; + this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = ItemStack.copyItemStack(this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem]); + Slot slot = this.playerEntity.openContainer.getSlotFromInventory(this.playerEntity.inventory, this.playerEntity.inventory.currentItem); ++ int windowId = this.playerEntity.openContainer.windowId; ++ if (slot == null) // Forge: Fix 'slotless' inventories not selecting a valid slot to update ++ { ++ slot = this.playerEntity.inventoryContainer.getSlotFromInventory(this.playerEntity.inventory, this.playerEntity.inventory.currentItem); ++ windowId = this.playerEntity.inventoryContainer.windowId; ++ } + this.playerEntity.openContainer.detectAndSendChanges(); + this.playerEntity.isChangingQuantityOnly = 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 + { +- this.sendPacket(new S2FPacketSetSlot(this.playerEntity.openContainer.windowId, slot.slotNumber, this.playerEntity.inventory.getCurrentItem())); ++ this.sendPacket(new S2FPacketSetSlot(windowId, slot.slotNumber, this.playerEntity.inventory.getCurrentItem())); + } + } + } +++++ END PATCH +++++ REJECTED PATCH 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 chat = net.minecraftforge.common.ForgeHooks.onServerChatEvent(this, s, chatcomponenttranslation1); ++ if (chat == null) return; ++ this.serverController.getConfigurationManager().sendChatMsgImpl(chat, false); + } + + this.chatSpamThresholdCount += 20; +++++ END PATCH +++++ REJECTED PATCH 11 + return; + } + +- this.playerEntity = this.serverController.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, false); ++ this.playerEntity = this.serverController.getConfigurationManager().recreatePlayerEntity(this.playerEntity, playerEntity.dimension, false); + } + + break; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/network/NetworkSystem.java.patch.rej b/rejects/minecraft/net/minecraft/network/NetworkSystem.java.patch.rej new file mode 100644 index 000000000..9763848ea --- /dev/null +++ b/rejects/minecraft/net/minecraft/network/NetworkSystem.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + ; + } + +- 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); + p_initChannel_1_.pipeline().addLast((String)"packet_handler", (ChannelHandler)networkmanager); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch.rej b/rejects/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch.rej new file mode 100644 index 000000000..6302df167 --- /dev/null +++ b/rejects/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch.rej @@ -0,0 +1,13 @@ +++++ REJECTED PATCH 1 + public void writePacketData(PacketBuffer buf) 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(); ++ } + } + + public void processPacket(INetHandlerPlayServer handler) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch.rej b/rejects/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch.rej new file mode 100644 index 000000000..01dcefc10 --- /dev/null +++ b/rejects/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch.rej @@ -0,0 +1,13 @@ +++++ REJECTED PATCH 1 + public void writePacketData(PacketBuffer buf) 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(); ++ } + } + + public void processPacket(INetHandlerPlayClient handler) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java.patch.rej b/rejects/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java.patch.rej new file mode 100644 index 000000000..faf51ffc7 --- /dev/null +++ b/rejects/minecraft/net/minecraft/network/status/server/S00PacketServerInfo.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + + public void writePacketData(PacketBuffer buf) throws IOException + { +- buf.writeString(GSON.toJson((Object)this.response)); ++ buf.writeString(this.response.getJson()); + } + + public void processPacket(INetHandlerStatusClient handler) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/potion/Potion.java.patch.rej b/rejects/minecraft/net/minecraft/potion/Potion.java.patch.rej new file mode 100644 index 000000000..ccb6a70e3 --- /dev/null +++ b/rejects/minecraft/net/minecraft/potion/Potion.java.patch.rej @@ -0,0 +1,46 @@ +++++ REJECTED PATCH 1 + + public class Potion + { +- public static final Potion[] potionTypes = new Potion[32]; ++ public static final Potion[] potionTypes = new Potion[256]; + private static final Map field_180150_I = Maps.newHashMap(); + public static final Potion field_180151_b = null; + public static final Potion moveSpeed = (new Potion(1, new ResourceLocation("speed"), false, 8171462)).setPotionName("potion.moveSpeed").setIconIndex(0, 0).registerPotionAttributeModifier(SharedMonsterAttributes.movementSpeed, "91AEAA56-376B-4498-935B-2F7F68070635", 0.20000000298023224D, 2); +++++ END PATCH +++++ REJECTED PATCH 2 + private double effectiveness; + private boolean usable; + ++ @Deprecated // use the Constructor without potion ID or everything will explode. + protected Potion(int potionID, ResourceLocation location, boolean badEffect, int potionColor) + { +- this.id = potionID; +- potionTypes[potionID] = this; ++ net.minecraftforge.fml.common.registry.GameData.getPotionRegistry().register(potionID, location, this); + field_180150_I.put(location, this); + this.isBadEffect = badEffect; + +++++ END PATCH +++++ REJECTED PATCH 3 + this.liquidColor = potionColor; + } + ++ protected Potion(ResourceLocation location, boolean badEffect, int potionColor) { ++ this(-1, location, badEffect, potionColor); ++ } ++ + public static Potion getPotionFromResourceLocation(String location) + { +- return (Potion)field_180150_I.get(new ResourceLocation(location)); ++ return net.minecraftforge.fml.common.registry.GameData.getPotionRegistry().getObject(new ResourceLocation(location)); + } + + public static Set getPotionLocations() + { +- return field_180150_I.keySet(); ++ return net.minecraftforge.fml.common.registry.GameData.getPotionRegistry().getKeys(); + } + + protected Potion setIconIndex(int p_76399_1_, int p_76399_2_) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/potion/PotionEffect.java.patch.rej b/rejects/minecraft/net/minecraft/potion/PotionEffect.java.patch.rej new file mode 100644 index 000000000..cc6804782 --- /dev/null +++ b/rejects/minecraft/net/minecraft/potion/PotionEffect.java.patch.rej @@ -0,0 +1,39 @@ +++++ REJECTED PATCH 1 + @SideOnly(Side.CLIENT) + private boolean isPotionDurationMax; + private boolean showParticles; ++ /** List of ItemStack that can cure the potion effect **/ ++ private java.util.List curativeItems; + + public PotionEffect(int id, int effectDuration) + { +++++ END PATCH +++++ REJECTED PATCH 2 + this.amplifier = effectAmplifier; + this.isAmbient = ambient; + this.showParticles = showParticles; ++ this.curativeItems = new java.util.ArrayList(); ++ this.curativeItems.add(new net.minecraft.item.ItemStack(net.minecraft.init.Items.milk_bucket)); + } + + public PotionEffect(PotionEffect other) +++++ END PATCH +++++ REJECTED PATCH 3 + this.amplifier = other.amplifier; + this.isAmbient = other.isAmbient; + this.showParticles = other.showParticles; ++ this.curativeItems = other.curativeItems; + } + + public void combine(PotionEffect other) +++++ END PATCH +++++ REJECTED PATCH 4 + + public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound nbt) + { +- int i = nbt.getByte("Id"); ++ int i = nbt.getByte("Id") & 0xff; + + if (i >= 0 && i < Potion.potionTypes.length && Potion.potionTypes[i] != null) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/realms/RealmsConnect.java.patch.rej b/rejects/minecraft/net/minecraft/realms/RealmsConnect.java.patch.rej new file mode 100644 index 000000000..aaface62d --- /dev/null +++ b/rejects/minecraft/net/minecraft/realms/RealmsConnect.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 2 + 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)); + + if (RealmsConnect.this.aborted) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/server/MinecraftServer.java.patch.rej b/rejects/minecraft/net/minecraft/server/MinecraftServer.java.patch.rej new file mode 100644 index 000000000..7c9e8ee29 --- /dev/null +++ b/rejects/minecraft/net/minecraft/server/MinecraftServer.java.patch.rej @@ -0,0 +1,46 @@ +++++ REJECTED PATCH 1 + @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; +++++ END PATCH +++++ REJECTED PATCH 6 + + public void stopServer() + { +- 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 + { + logger.info("Stopping server"); + +++++ END PATCH +++++ REJECTED PATCH 7 + for (int i = 0; i < this.worldServers.length; ++i) + { + WorldServer worldserver = this.worldServers[i]; ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(worldserver)); + worldserver.flush(); + } ++ ++ WorldServer[] tmp = worldServers; ++ for (WorldServer world : tmp) ++ { ++ net.minecraftforge.common.DimensionManager.setWorld(world.provider.getDimensionId(), null); ++ } + } + + if (this.usageSnooper.isSnooperRunning()) +++++ END PATCH +++++ REJECTED PATCH 22 + + if (worldserver != null) + { ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(worldserver)); + worldserver.flush(); + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch.rej b/rejects/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch.rej new file mode 100644 index 000000000..5a4f31b4c --- /dev/null +++ b/rejects/minecraft/net/minecraft/server/dedicated/DedicatedServer.java.patch.rej @@ -0,0 +1,18 @@ +++++ REJECTED PATCH 4 + } + else + { ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().onServerStarted(); + this.setConfigManager(new DedicatedPlayerList(this)); + long j = System.nanoTime(); + +++++ END PATCH +++++ REJECTED PATCH 5 + 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())); ++ 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); + long i1 = System.nanoTime() - j; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch.rej b/rejects/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch.rej new file mode 100644 index 000000000..621619af0 --- /dev/null +++ b/rejects/minecraft/net/minecraft/server/integrated/IntegratedServer.java.patch.rej @@ -0,0 +1,58 @@ +++++ REJECTED PATCH 2 + worldinfo.setWorldName(p_71247_2_); + } + +- for (int i = 0; i < this.worldServers.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); + +- 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()) + { +- j = -1; ++ world.getWorldInfo().setGameType(getGameType()); + } +- +- if (i == 2) +- { +- j = 1; +- } +- +- if (i == 0) +- { +- if (this.isDemo()) +- { +- this.worldServers[i] = (WorldServer)(new DemoWorldServer(this, isavehandler, worldinfo, j, this.theProfiler)).init(); +- } +- else +- { +- this.worldServers[i] = (WorldServer)(new WorldServer(this, isavehandler, worldinfo, j, this.theProfiler)).init(); +- } +- +- this.worldServers[i].initialize(this.theWorldSettings); +- } +- else +- { +- this.worldServers[i] = (WorldServer)(new WorldServerMulti(this, isavehandler, j, this.worldServers[0], this.theProfiler)).init(); +- } +- +- this.worldServers[i].addWorldAccess(new WorldManager(this, this.worldServers[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 }); + +- if (this.worldServers[0].getWorldInfo().getDifficulty() == null) ++ if (overWorld.getWorldInfo().getDifficulty() == null) + { + this.setDifficultyForAllWorlds(this.mc.gameSettings.difficulty); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch.rej b/rejects/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch.rej new file mode 100644 index 000000000..58d956d21 --- /dev/null +++ b/rejects/minecraft/net/minecraft/server/management/ItemInWorldManager.java.patch.rej @@ -0,0 +1,276 @@ +++++ REJECTED PATCH 1 + + public class ItemInWorldManager + { ++ /** Forge reach distance */ ++ private double blockReachDistance = 5.0d; + public World theWorld; + public EntityPlayerMP thisPlayerMP; + private WorldSettings.GameType gameType = WorldSettings.GameType.NOT_SET; +++++ END PATCH +++++ REJECTED PATCH 2 + else + { + int k = this.curblockDamage - this.initialDamage; +- float f1 = block1.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.field_180241_i) * (float)(k + 1); ++ float f1 = block1.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.field_180240_f) * (float)(k + 1); //Forge: Fix network break progress using wrong position + int l = (int)(f1 * 10.0F); + + if (l != this.durabilityRemainingOnBlock) +++++ END PATCH +++++ REJECTED PATCH 3 + + public void onBlockClicked(BlockPos pos, EnumFacing side) + { ++ net.minecraftforge.event.entity.player.PlayerInteractEvent event = net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thisPlayerMP, ++ net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.LEFT_CLICK_BLOCK, theWorld, pos, side, net.minecraftforge.common.ForgeHooks.rayTraceEyeHitVec(thisPlayerMP, getBlockReachDistance() + 1)); ++ if (event.isCanceled()) ++ { ++ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); ++ return; ++ } ++ + if (this.isCreative()) + { + if (!this.theWorld.extinguishFire((EntityPlayer)null, pos, side)) +++++ END PATCH +++++ REJECTED PATCH 4 + } + } + +- this.theWorld.extinguishFire((EntityPlayer)null, pos, side); ++ // + this.initialDamage = this.curblockDamage; + float f = 1.0F; + +- if (block.getMaterial() != Material.air) ++ if (!block.isAir(theWorld, pos)) + { +- block.onBlockClicked(this.theWorld, pos, this.thisPlayerMP); ++ if (event.useBlock != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) ++ { ++ block.onBlockClicked(this.theWorld, pos, this.thisPlayerMP); ++ this.theWorld.extinguishFire((EntityPlayer)null, pos, side); ++ } ++ else ++ { ++ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); ++ } + f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, pos); + } + +- if (block.getMaterial() != Material.air && f >= 1.0F) ++ if (event.useItem == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) + { ++ if (f >= 1.0F) ++ { ++ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); ++ } ++ return; ++ } ++ ++ if (!block.isAir(theWorld, pos) && f >= 1.0F) ++ { + this.tryHarvestBlock(pos); + } + else +++++ END PATCH +++++ REJECTED PATCH 5 + int i = this.curblockDamage - this.initialDamage; + Block block = this.theWorld.getBlockState(pos).getBlock(); + +- if (block.getMaterial() != Material.air) ++ if (!block.isAir(theWorld, pos)) + { + float f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, pos) * (float)(i + 1); + +++++ END PATCH +++++ REJECTED PATCH 6 + + private boolean removeBlock(BlockPos pos) + { ++ return removeBlock(pos, false); ++ } ++ private boolean removeBlock(BlockPos pos, boolean canHarvest) ++ { + IBlockState iblockstate = this.theWorld.getBlockState(pos); + iblockstate.getBlock().onBlockHarvested(this.theWorld, pos, iblockstate, this.thisPlayerMP); +- boolean flag = this.theWorld.setBlockToAir(pos); ++ boolean flag = iblockstate.getBlock().removedByPlayer(theWorld, pos, thisPlayerMP, canHarvest); + + if (flag) + { +++++ END PATCH +++++ REJECTED PATCH 7 + + public boolean tryHarvestBlock(BlockPos pos) + { +- if (this.gameType.isCreative() && this.thisPlayerMP.getHeldItem() != null && this.thisPlayerMP.getHeldItem().getItem() instanceof ItemSword) ++ int exp = net.minecraftforge.common.ForgeHooks.onBlockBreakEvent(theWorld, gameType, thisPlayerMP, pos); ++ if (exp == -1) + { + return false; + } +++++ END PATCH +++++ REJECTED PATCH 8 + IBlockState iblockstate = this.theWorld.getBlockState(pos); + TileEntity tileentity = this.theWorld.getTileEntity(pos); + +- if (this.gameType.isAdventure()) +- { +- if (this.gameType == WorldSettings.GameType.SPECTATOR) +- { +- return false; +- } ++ ItemStack stack = thisPlayerMP.getCurrentEquippedItem(); ++ if (stack != null && stack.getItem().onBlockStartBreak(stack, pos, thisPlayerMP)) return false; + +- if (!this.thisPlayerMP.isAllowEdit()) +- { +- ItemStack itemstack = this.thisPlayerMP.getCurrentEquippedItem(); +- +- if (itemstack == null) +- { +- return false; +- } +- +- if (!itemstack.canDestroy(iblockstate.getBlock())) +- { +- return false; +- } +- } +- } +- + this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, pos, Block.getStateId(iblockstate)); +- boolean flag1 = this.removeBlock(pos); ++ boolean flag1 = false; + + if (this.isCreative()) + { ++ flag1 = this.removeBlock(pos); + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(this.theWorld, pos)); + } + else + { + ItemStack itemstack1 = this.thisPlayerMP.getCurrentEquippedItem(); +- boolean flag = this.thisPlayerMP.canHarvestBlock(iblockstate.getBlock()); ++ boolean flag = iblockstate.getBlock().canHarvestBlock(theWorld, pos, thisPlayerMP); + + if (itemstack1 != null) + { +++++ END PATCH +++++ REJECTED PATCH 9 + } + } + ++ flag1 = this.removeBlock(pos, flag); + if (flag1 && flag) + { + iblockstate.getBlock().harvestBlock(this.theWorld, this.thisPlayerMP, pos, iblockstate, tileentity); + } + } + ++ // Drop experiance ++ if (!this.isCreative() && flag1 && exp > 0) ++ { ++ iblockstate.getBlock().dropXpOnBlockBreak(theWorld, pos, exp); ++ } + return flag1; + } + } +++++ END PATCH +++++ REJECTED PATCH 10 + if (itemstack.stackSize == 0) + { + player.inventory.mainInventory[player.inventory.currentItem] = null; ++ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(player, itemstack); + } + + if (!player.isUsingItem()) +++++ END PATCH +++++ REJECTED PATCH 11 + } + else + { +- 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, new net.minecraft.util.Vec3(offsetX, offsetY, offsetZ)); ++ if (event.isCanceled()) + { +- IBlockState iblockstate = worldIn.getBlockState(pos); +- +- if (iblockstate.getBlock().onBlockActivated(worldIn, pos, iblockstate, player, side, offsetX, offsetY, offsetZ)) +- { +- return true; +- } ++ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); ++ return false; + } + +- if (stack == null) ++ if (stack != null && stack.getItem().onItemUseFirst(stack, player, worldIn, pos, side, offsetX, offsetY, offsetZ)) + { +- return false; ++ if (stack.stackSize <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(thisPlayerMP, stack); ++ return true; + } +- else if (this.isCreative()) ++ ++ 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); ++ boolean result = false; ++ ++ if (useBlock) + { +- int j = stack.getMetadata(); +- int i = stack.stackSize; +- boolean flag = stack.onItemUse(player, worldIn, pos, side, offsetX, offsetY, offsetZ); +- stack.setItemDamage(j); +- stack.stackSize = i; +- return flag; ++ if (event.useBlock != net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) ++ { ++ result = iblockstate.getBlock().onBlockActivated(worldIn, pos, iblockstate, player, side, offsetX, offsetY, offsetZ); ++ } ++ else ++ { ++ thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(theWorld, pos)); ++ 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) + { +- return stack.onItemUse(player, worldIn, pos, side, offsetX, offsetY, offsetZ); ++ int meta = stack.getMetadata(); ++ int size = stack.stackSize; ++ result = stack.onItemUse(player, worldIn, pos, side, offsetX, offsetY, offsetZ); ++ if (isCreative()) ++ { ++ stack.setItemDamage(meta); ++ stack.stackSize = size; ++ } ++ if (stack.stackSize <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(thisPlayerMP, stack); + } ++ return result; + } + } + +++++ END PATCH +++++ REJECTED PATCH 12 + { + this.theWorld = serverWorld; + } ++ ++ public double getBlockReachDistance() ++ { ++ return blockReachDistance; ++ } ++ public void setBlockReachDistance(double distance) ++ { ++ blockReachDistance = distance; ++ } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/server/management/PlayerManager.java.patch.rej b/rejects/minecraft/net/minecraft/server/management/PlayerManager.java.patch.rej new file mode 100644 index 000000000..cb7cb9cca --- /dev/null +++ b/rejects/minecraft/net/minecraft/server/management/PlayerManager.java.patch.rej @@ -0,0 +1,223 @@ +++++ REJECTED PATCH 1 + int j = (int)player.posZ >> 4; + player.managedPosX = player.posX; + player.managedPosZ = player.posZ; ++ // Load nearby chunks first ++ List chunkList = Lists.newArrayList(); + + for (int k = i - this.playerViewRadius; k <= i + this.playerViewRadius; ++k) + { + for (int l = j - this.playerViewRadius; l <= j + this.playerViewRadius; ++l) + { +- this.getPlayerInstance(k, l, true).addPlayer(player); ++ chunkList.add(new ChunkCoordIntPair(k, l)); + } + } + ++ java.util.Collections.sort(chunkList, new net.minecraftforge.common.util.ChunkCoordComparator(player)); ++ ++ for (ChunkCoordIntPair pair : chunkList) ++ { ++ this.getPlayerInstance(pair.chunkXPos, pair.chunkZPos, true).addPlayer(player); ++ } ++ + this.players.add(player); + this.filterChunkLoadQueue(player); + } +++++ END PATCH +++++ REJECTED PATCH 3 + { + if (!this.overlaps(l1, i2, k, l, i1)) + { +- this.getPlayerInstance(l1, i2, true).addPlayer(player); ++ chunksToLoad.add(new ChunkCoordIntPair(l1, i2)); + } + + if (!this.overlaps(l1 - j1, i2 - k1, i, j, i1)) +++++ END PATCH +++++ REJECTED PATCH 4 + this.filterChunkLoadQueue(player); + player.managedPosX = player.posX; + player.managedPosZ = player.posZ; ++ // send nearest chunks first ++ java.util.Collections.sort(chunksToLoad, new net.minecraftforge.common.util.ChunkCoordComparator(player)); ++ ++ for (ChunkCoordIntPair pair : chunksToLoad) ++ { ++ this.getPlayerInstance(pair.chunkXPos, pair.chunkZPos, true).addPlayer(player); ++ } ++ ++ if (i1 > 1 || i1 < -1 || j1 > 1 || j1 < -1) ++ { ++ java.util.Collections.sort(player.loadedChunks, new net.minecraftforge.common.util.ChunkCoordComparator(player)); ++ } + } + } + } +++++ END PATCH +++++ REJECTED PATCH 5 + private int numBlocksToUpdate; + private int flagsYAreasToUpdate; + private long previousWorldTime; ++ private final java.util.HashMap players = new java.util.HashMap(); ++ private boolean loaded = false; ++ private Runnable loadedRunnable = new Runnable() ++ { ++ public void run() ++ { ++ PlayerInstance.this.loaded = true; ++ } ++ }; + + public PlayerInstance(int chunkX, int chunkZ) + { + this.chunkCoords = new ChunkCoordIntPair(chunkX, chunkZ); +- PlayerManager.this.getWorldServer().theChunkProviderServer.loadChunk(chunkX, chunkZ); ++ PlayerManager.this.getWorldServer().theChunkProviderServer.loadChunk(chunkX, chunkZ, this.loadedRunnable); + } + + public void addPlayer(EntityPlayerMP player) +++++ END PATCH +++++ REJECTED PATCH 6 + } + + this.playersWatchingChunk.add(player); ++ Runnable playerRunnable = null; ++ if (this.loaded) ++ { + player.loadedChunks.add(this.chunkCoords); ++ } ++ else ++ { ++ final EntityPlayerMP tmp = player; ++ playerRunnable = new Runnable() ++ { ++ public void run() ++ { ++ tmp.loadedChunks.add(PlayerInstance.this.chunkCoords); ++ } ++ }; ++ PlayerManager.this.getWorldServer().theChunkProviderServer.loadChunk(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos, playerRunnable); ++ } ++ this.players.put(player, playerRunnable); + } + } + +++++ END PATCH +++++ REJECTED PATCH 7 + { + if (this.playersWatchingChunk.contains(player)) + { ++ // 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.getWorldServer(), this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos, this.players.get(player)); ++ this.playersWatchingChunk.remove(player); ++ this.players.remove(player); ++ ++ if (this.playersWatchingChunk.isEmpty()) ++ { ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.dropQueuedChunkLoad(PlayerManager.this.getWorldServer(), 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); ++ } ++ ++ return; ++ } ++ + Chunk chunk = PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos); + + if (chunk.isPopulated()) +++++ END PATCH +++++ REJECTED PATCH 8 + player.playerNetServerHandler.sendPacket(new S21PacketChunkData(chunk, true, 0)); + } + ++ this.players.remove(player); + this.playersWatchingChunk.remove(player); + player.loadedChunks.remove(this.chunkCoords); + ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.UnWatch(chunkCoords, player)); ++ + if (this.playersWatchingChunk.isEmpty()) + { + long i = (long)this.chunkCoords.chunkXPos + 2147483647L | (long)this.chunkCoords.chunkZPos + 2147483647L << 32; +++++ END PATCH +++++ REJECTED PATCH 9 + + this.flagsYAreasToUpdate |= 1 << (y >> 4); + +- if (this.numBlocksToUpdate < 64) ++ //Forge; Cache everything, so always run + { + short short1 = (short)(x << 12 | z << 8 | y); + +++++ END PATCH +++++ REJECTED PATCH 10 + } + } + ++ if (numBlocksToUpdate == locationOfBlockChange.length) ++ { ++ locationOfBlockChange = java.util.Arrays.copyOf(locationOfBlockChange, locationOfBlockChange.length << 1); ++ } + this.locationOfBlockChange[this.numBlocksToUpdate++] = short1; + } + } +++++ END PATCH +++++ REJECTED PATCH 11 + } + } + ++ @SuppressWarnings("unused") + public void onUpdate() + { + if (this.numBlocksToUpdate != 0) +++++ END PATCH +++++ REJECTED PATCH 12 + BlockPos blockpos = new BlockPos(i, j, k); + this.sendToAllPlayersWatchingChunk(new S23PacketBlockChange(PlayerManager.this.theWorldServer, blockpos)); + +- if (PlayerManager.this.theWorldServer.getBlockState(blockpos).getBlock().hasTileEntity()) ++ if (PlayerManager.this.theWorldServer.getBlockState(blockpos).getBlock().hasTileEntity(PlayerManager.this.theWorldServer.getBlockState(blockpos))) + { + this.sendTileToAllPlayersWatchingChunk(PlayerManager.this.theWorldServer.getTileEntity(blockpos)); + } + } +- else if (this.numBlocksToUpdate == 64) ++ else if (this.numBlocksToUpdate >= 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)); + +- 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) + { +++++ END PATCH +++++ REJECTED PATCH 13 + else + { + this.sendToAllPlayersWatchingChunk(new S22PacketMultiBlockChange(this.numBlocksToUpdate, this.locationOfBlockChange, PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkCoords.chunkXPos, this.chunkCoords.chunkZPos))); +- ++ } ++ { // 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) + { + int l1 = (this.locationOfBlockChange[j1] >> 12 & 15) + this.chunkCoords.chunkXPos * 16; +++++ END PATCH +++++ REJECTED PATCH 14 + int l2 = (this.locationOfBlockChange[j1] >> 8 & 15) + this.chunkCoords.chunkZPos * 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))) + { + this.sendTileToAllPlayersWatchingChunk(PlayerManager.this.theWorldServer.getTileEntity(blockpos1)); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch.rej b/rejects/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch.rej new file mode 100644 index 000000000..44d627c7e --- /dev/null +++ b/rejects/minecraft/net/minecraft/server/management/ServerConfigurationManager.java.patch.rej @@ -0,0 +1,237 @@ +++++ REJECTED PATCH 1 + this.maxPlayers = 8; + } + +- public void initializeConnectionToPlayer(NetworkManager netManager, EntityPlayerMP playerIn) ++ public void initializeConnectionToPlayer(NetworkManager netManager, EntityPlayerMP playerIn, NetHandlerPlayServer nethandlerplayserver) + { + GameProfile gameprofile = playerIn.getGameProfile(); + PlayerProfileCache playerprofilecache = this.mcServer.getPlayerProfileCache(); +++++ END PATCH +++++ REJECTED PATCH 2 + playerprofilecache.addEntry(gameprofile); + NBTTagCompound nbttagcompound = this.readPlayerDataFromFile(playerIn); + playerIn.setWorld(this.mcServer.worldServerForDimension(playerIn.dimension)); ++ ++ World playerWorld = this.mcServer.worldServerForDimension(playerIn.dimension); ++ if (playerWorld == null) ++ { ++ playerIn.dimension=0; ++ playerWorld=this.mcServer.worldServerForDimension(0); ++ BlockPos spawnPoint = playerWorld.provider.getRandomizedSpawnPoint(); ++ playerIn.setPosition(spawnPoint.getX(), spawnPoint.getY(), spawnPoint.getZ()); ++ } ++ ++ playerIn.setWorld(playerWorld); + playerIn.theItemInWorldManager.setWorld((WorldServer)playerIn.worldObj); + String s1 = "local"; + +++++ END PATCH +++++ REJECTED PATCH 3 + WorldInfo worldinfo = worldserver.getWorldInfo(); + BlockPos blockpos = worldserver.getSpawnPoint(); + this.setPlayerGameTypeBasedOnOther(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().getBoolean("reducedDebugInfo"))); + nethandlerplayserver.sendPacket(new S3FPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(this.getServerInstance().getServerModName()))); + nethandlerplayserver.sendPacket(new S41PacketServerDifficulty(worldinfo.getDifficulty(), worldinfo.isDifficultyLocked())); +++++ END PATCH +++++ REJECTED PATCH 4 + + playerIn.addSelfToInternalCraftingInventory(); + ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerLoggedIn(playerIn); + if (nbttagcompound != null && nbttagcompound.hasKey("Riding", 10)) + { + Entity entity = EntityList.createEntityFromNBT(nbttagcompound.getCompoundTag("Riding"), worldserver); +++++ END PATCH +++++ REJECTED PATCH 5 + playerIn.readFromNBT(nbttagcompound); + nbttagcompound1 = nbttagcompound; + logger.debug("loading single player"); ++ net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(playerIn, this.playerNBTManagerObj, playerIn.getUniqueID().toString()); + } + else + { +++++ END PATCH +++++ REJECTED PATCH 6 + return nbttagcompound1; + } + ++ 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) ++ { ++ return nbttagcompound; ++ } ++ else ++ { ++ return ((net.minecraft.world.storage.SaveHandler)this.playerNBTManagerObj).getPlayerNBT(player); ++ } ++ } + protected void writePlayerData(EntityPlayerMP playerIn) + { ++ if (playerIn.playerNetServerHandler == null) return; ++ + this.playerNBTManagerObj.writePlayerData(playerIn); + StatisticsFile statisticsfile = (StatisticsFile)this.playerStatFiles.get(playerIn.getUniqueID()); + +++++ END PATCH +++++ REJECTED PATCH 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.preparePlayer(playerIn, (WorldServer)null); + +++++ END PATCH +++++ REJECTED PATCH 8 + + public void playerLoggedOut(EntityPlayerMP playerIn) + { ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerLoggedOut(playerIn); + playerIn.triggerAchievement(StatList.leaveGameStat); + this.writePlayerData(playerIn); + WorldServer worldserver = playerIn.getServerForPlayer(); +++++ END PATCH +++++ REJECTED PATCH 9 + this.uuidToPlayerMap.remove(uuid); + this.playerStatFiles.remove(uuid); + } ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.adjustPoolSize(this.getCurrentPlayerCount()); + + this.sendPacketToAllPlayers(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.REMOVE_PLAYER, new EntityPlayerMP[] {playerIn})); + } +++++ END PATCH +++++ REJECTED PATCH 10 + + public EntityPlayerMP recreatePlayerEntity(EntityPlayerMP playerIn, int dimension, boolean conqueredEnd) + { ++ World world = mcServer.worldServerForDimension(dimension); ++ if (world == null) ++ { ++ dimension = 0; ++ } ++ else if (!world.provider.canRespawnHere()) ++ { ++ dimension = world.provider.getRespawnDimension(playerIn); ++ } ++ + 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; + ItemInWorldManager iteminworldmanager; + +++++ END PATCH +++++ REJECTED PATCH 11 + 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); +++++ END PATCH +++++ REJECTED PATCH 12 + this.uuidToPlayerMap.put(entityplayermp.getUniqueID(), entityplayermp); + entityplayermp.addSelfToInternalCraftingInventory(); + entityplayermp.setHealth(entityplayermp.getHealth()); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerRespawnEvent(entityplayermp); + return entityplayermp; + } + + public void transferPlayerToDimension(EntityPlayerMP playerIn, int dimension) + { ++ transferPlayerToDimension(playerIn, dimension, mcServer.worldServerForDimension(dimension).getDefaultTeleporter()); ++ } ++ ++ public void transferPlayerToDimension(EntityPlayerMP playerIn, int dimension, 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.preparePlayer(playerIn, worldserver); + playerIn.playerNetServerHandler.setPlayerLocation(playerIn.posX, playerIn.posY, playerIn.posZ, playerIn.rotationYaw, playerIn.rotationPitch); + playerIn.theItemInWorldManager.setWorld(worldserver1); +++++ END PATCH +++++ REJECTED PATCH 13 + { + playerIn.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(playerIn.getEntityId(), potioneffect)); + } ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerChangedDimensionEvent(playerIn, i, dimension); + } + + public void transferEntityToWorld(Entity entityIn, 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()); ++ } ++ ++ @SuppressWarnings("unused") ++ public void transferEntityToWorld(Entity entityIn, 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; ++ double moveFactor = pOld.getMovementFactor() / pNew.getMovementFactor(); ++ double d0 = entityIn.posX * moveFactor; ++ double d1 = entityIn.posZ * moveFactor; + double d2 = 8.0D; + float f = entityIn.rotationYaw; + p_82448_3_.theProfiler.startSection("moving"); + +- if (entityIn.dimension == -1) ++ if (false && entityIn.dimension == -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); +++++ END PATCH +++++ REJECTED PATCH 14 + p_82448_3_.updateEntityWithOptionalForce(entityIn, false); + } + } +- else if (entityIn.dimension == 0) ++ else if (false && entityIn.dimension == 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); +++++ END PATCH +++++ REJECTED PATCH 15 + p_82448_3_.updateEntityWithOptionalForce(entityIn, false); + } + } +- else ++ ++ if (entityIn.dimension == 1) + { + BlockPos blockpos; + +++++ END PATCH +++++ REJECTED PATCH 16 + if (entityIn.isEntityAlive()) + { + 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); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch.rej b/rejects/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch.rej new file mode 100644 index 000000000..befc820c0 --- /dev/null +++ b/rejects/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java.patch.rej @@ -0,0 +1,26 @@ +++++ REJECTED PATCH 1 + 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_181025_l = null; + } + } + +- if (this.connectionTimer++ == 600) ++ if (this.connectionTimer++ == net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.LOGIN_TIMEOUT) + { + this.closeConnection("Took too long to log in"); + } +++++ END PATCH +++++ REJECTED PATCH 2 + } + 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)); + } + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/stats/StatList.java.patch.rej b/rejects/minecraft/net/minecraft/stats/StatList.java.patch.rej new file mode 100644 index 000000000..7fb3cab30 --- /dev/null +++ b/rejects/minecraft/net/minecraft/stats/StatList.java.patch.rej @@ -0,0 +1,20 @@ +++++ REJECTED PATCH 1 + } + } + +- replaceAllSimilarBlocks(objectCraftStats); ++ replaceAllSimilarBlocks(objectCraftStats, true); + } + + private static void initMiningStats() +++++ END PATCH +++++ REJECTED PATCH 2 + } + } + +- replaceAllSimilarBlocks(mineBlockStatArray); ++ replaceAllSimilarBlocks(mineBlockStatArray, false); + } + + private static void initStats() +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/tileentity/TileEntity.java.patch.rej b/rejects/minecraft/net/minecraft/tileentity/TileEntity.java.patch.rej new file mode 100644 index 000000000..f181d6010 --- /dev/null +++ b/rejects/minecraft/net/minecraft/tileentity/TileEntity.java.patch.rej @@ -0,0 +1,32 @@ +++++ REJECTED PATCH 4 + { + TileEntity tileentity = null; + ++ Class oclass = null; + try + { +- Class oclass = (Class)nameToClassMap.get(nbt.getString("id")); ++ oclass = (Class)nameToClassMap.get(nbt.getString("id")); + + if (oclass != null) + { +++++ END PATCH +++++ REJECTED PATCH 5 + } + else + { ++ try ++ { + logger.warn("Skipping BlockEntity with id " + nbt.getString("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()); ++ tileentity = null; ++ } + } + + return tileentity; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch.rej b/rejects/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch.rej new file mode 100644 index 000000000..e4e37859b --- /dev/null +++ b/rejects/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java.patch.rej @@ -0,0 +1,63 @@ +++++ REJECTED PATCH 2 + + 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) + { + int j = this.brewingItemStacks[i].getMetadata(); + int k = this.getPotionResult(j, itemstack); +++++ END PATCH +++++ REJECTED PATCH 3 + } + else + { +- return false; ++ return net.minecraftforge.common.brewing.BrewingRecipeRegistry.canBrew(brewingItemStacks, brewingItemStacks[3], outputSlots); + } + } + + private void brewPotions() + { ++ if (net.minecraftforge.event.ForgeEventFactory.onPotionAttemptBreaw(brewingItemStacks)) return; + if (this.canBrew()) + { ++ net.minecraftforge.common.brewing.BrewingRecipeRegistry.brewPotions(brewingItemStacks, brewingItemStacks[3], outputSlots); + ItemStack itemstack = this.brewingItemStacks[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) + { + int j = this.brewingItemStacks[i].getMetadata(); + int k = this.getPotionResult(j, itemstack); +++++ END PATCH +++++ REJECTED PATCH 4 + } + } + } ++ } + +- if (itemstack.getItem().hasContainerItem()) ++ if (itemstack.getItem().hasContainerItem(itemstack)) + { +- this.brewingItemStacks[3] = new ItemStack(itemstack.getItem().getContainerItem()); ++ this.brewingItemStacks[3] = itemstack.getItem().getContainerItem(itemstack); + } + else + { +++++ END PATCH +++++ REJECTED PATCH 6 + + public boolean isItemValidForSlot(int index, ItemStack stack) + { +- 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 false; + } + + public boolean[] func_174902_m() +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/util/BlockPos.java.patch.rej b/rejects/minecraft/net/minecraft/util/BlockPos.java.patch.rej new file mode 100644 index 000000000..93fcafcef --- /dev/null +++ b/rejects/minecraft/net/minecraft/util/BlockPos.java.patch.rej @@ -0,0 +1,32 @@ +++++ REJECTED PATCH 1 + }; + } + ++ /** ++ * Returns a version of this BlockPos that is guaranteed to be Immutable. ++ * In most cases this will return 'this', but if 'this' is an instance of ++ * MutableBlockPos it will return a new instance of BlockPos with the same values. ++ * ++ * When storing a parameter given to you for an extended period of time, make sure you ++ * use this in case the value is changed internally. ++ * ++ * @return An immutable BlockPos. ++ */ ++ public BlockPos getImmutable() ++ { ++ return this; ++ } ++ + public static final class MutableBlockPos extends BlockPos + { + private int x; +++++ END PATCH +++++ REJECTED PATCH 2 + this.z = zIn; + return this; + } ++ ++ @Override public BlockPos getImmutable() { return new BlockPos(this); } + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/util/ChatComponentStyle.java.patch.rej b/rejects/minecraft/net/minecraft/util/ChatComponentStyle.java.patch.rej new file mode 100644 index 000000000..3f858e7db --- /dev/null +++ b/rejects/minecraft/net/minecraft/util/ChatComponentStyle.java.patch.rej @@ -0,0 +1,9 @@ +++++ REJECTED PATCH 1 + return stringbuilder.toString(); + } + +- @SideOnly(Side.CLIENT) + public final String getFormattedText() + { + StringBuilder stringbuilder = new StringBuilder(); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/util/ChatStyle.java.patch.rej b/rejects/minecraft/net/minecraft/util/ChatStyle.java.patch.rej new file mode 100644 index 000000000..8d6713dd0 --- /dev/null +++ b/rejects/minecraft/net/minecraft/util/ChatStyle.java.patch.rej @@ -0,0 +1,9 @@ +++++ REJECTED PATCH 1 + return this; + } + +- @SideOnly(Side.CLIENT) + public String getFormattingCode() + { + if (this.isEmpty()) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/util/EnumFacing.java.patch.rej b/rejects/minecraft/net/minecraft/util/EnumFacing.java.patch.rej new file mode 100644 index 000000000..d204c3b68 --- /dev/null +++ b/rejects/minecraft/net/minecraft/util/EnumFacing.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + import java.util.Iterator; + import java.util.Map; + import java.util.Random; +-import net.minecraftforge.fml.relauncher.Side; +-import net.minecraftforge.fml.relauncher.SideOnly; + + public enum EnumFacing implements IStringSerializable + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/util/EnumWorldBlockLayer.java.patch.rej b/rejects/minecraft/net/minecraft/util/EnumWorldBlockLayer.java.patch.rej new file mode 100644 index 000000000..78a01be0d --- /dev/null +++ b/rejects/minecraft/net/minecraft/util/EnumWorldBlockLayer.java.patch.rej @@ -0,0 +1,11 @@ +++++ REJECTED PATCH 1 + package net.minecraft.util; + +-import net.minecraftforge.fml.relauncher.Side; +-import net.minecraftforge.fml.relauncher.SideOnly; +- +-@SideOnly(Side.CLIENT) + public enum EnumWorldBlockLayer + { + SOLID("Solid"), +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/util/IChatComponent.java.patch.rej b/rejects/minecraft/net/minecraft/util/IChatComponent.java.patch.rej new file mode 100644 index 000000000..bf81e15d7 --- /dev/null +++ b/rejects/minecraft/net/minecraft/util/IChatComponent.java.patch.rej @@ -0,0 +1,9 @@ +++++ REJECTED PATCH 1 + + String getUnformattedText(); + +- @SideOnly(Side.CLIENT) + String getFormattedText(); + + List getSiblings(); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/util/MovingObjectPosition.java.patch.rej b/rejects/minecraft/net/minecraft/util/MovingObjectPosition.java.patch.rej new file mode 100644 index 000000000..16da2c773 --- /dev/null +++ b/rejects/minecraft/net/minecraft/util/MovingObjectPosition.java.patch.rej @@ -0,0 +1,14 @@ +++++ REJECTED PATCH 1 + public Vec3 hitVec; + public Entity entityHit; + ++ /** Used to determine what sub-segment is hit */ ++ public int subHit = -1; ++ ++ /** Used to add extra hit info */ ++ public Object hitInfo = null; ++ + public MovingObjectPosition(Vec3 hitVecIn, EnumFacing facing, BlockPos blockPosIn) + { + this(MovingObjectPosition.MovingObjectType.BLOCK, hitVecIn, facing, blockPosIn); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/util/ResourceLocation.java.patch.rej b/rejects/minecraft/net/minecraft/util/ResourceLocation.java.patch.rej new file mode 100644 index 000000000..0f0b5b06b --- /dev/null +++ b/rejects/minecraft/net/minecraft/util/ResourceLocation.java.patch.rej @@ -0,0 +1,27 @@ +++++ REJECTED PATCH 1 + package net.minecraft.util; + +-import net.minecraftforge.fml.relauncher.Side; +-import net.minecraftforge.fml.relauncher.SideOnly; + import org.apache.commons.lang3.Validate; + + public class ResourceLocation +++++ END PATCH +++++ REJECTED PATCH 2 + this(0, splitObjectName(resourceName)); + } + +- @SideOnly(Side.CLIENT) + public ResourceLocation(String resourceDomainIn, String resourcePathIn) + { + this(0, new String[] {resourceDomainIn, resourcePathIn}); +++++ END PATCH +++++ REJECTED PATCH 3 + return this.resourcePath; + } + +- @SideOnly(Side.CLIENT) + public String getResourceDomain() + { + return this.resourceDomain; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/util/Session.java.patch.rej b/rejects/minecraft/net/minecraft/util/Session.java.patch.rej new file mode 100644 index 000000000..d15c135b4 --- /dev/null +++ b/rejects/minecraft/net/minecraft/util/Session.java.patch.rej @@ -0,0 +1,21 @@ +++++ REJECTED PATCH 4 + return this.sessionType; + } + ++ /* ======================================== FORGE START ===================================== */ ++ //For internal use only. Modders should never need to use this. ++ public void setProperties(com.mojang.authlib.properties.PropertyMap properties) ++ { ++ if(this.properties == null) this.properties = properties; ++ } ++ ++ public boolean hasCachedProperties() ++ { ++ return properties != null; ++ } ++ /* ========================================= FORGE END ====================================== */ ++ + @SideOnly(Side.CLIENT) + public static enum Type + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/util/StringTranslate.java.patch.rej b/rejects/minecraft/net/minecraft/util/StringTranslate.java.patch.rej new file mode 100644 index 000000000..0ab2b52be --- /dev/null +++ b/rejects/minecraft/net/minecraft/util/StringTranslate.java.patch.rej @@ -0,0 +1,54 @@ +++++ REJECTED PATCH 1 + + public StringTranslate() + { ++ InputStream inputstream = StringTranslate.class.getResourceAsStream("/assets/minecraft/lang/en_US.lang"); ++ inject(this, inputstream); ++ } ++ ++ public static void inject(InputStream inputstream) ++ { ++ inject(instance, inputstream); ++ } ++ ++ private static void inject(StringTranslate inst, InputStream inputstream) ++ { ++ java.util.HashMap map = parseLangFile(inputstream); ++ inst.languageList.putAll(map); ++ inst.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); ++ } ++ ++ public static java.util.HashMap parseLangFile(InputStream inputstream) ++ { ++ java.util.HashMap table = Maps.newHashMap(); + try + { +- InputStream inputstream = StringTranslate.class.getResourceAsStream("/assets/minecraft/lang/en_US.lang"); ++ inputstream = net.minecraftforge.fml.common.FMLCommonHandler.instance().loadLanguage(table, inputstream); ++ if (inputstream == null) return table; + + for (String s : IOUtils.readLines(inputstream, Charsets.UTF_8)) + { +++++ END PATCH +++++ REJECTED PATCH 2 + { + String s1 = astring[0]; + String s2 = numericVariablePattern.matcher(astring[1]).replaceAll("%$1s"); +- this.languageList.put(s1, s2); ++ table.put(s1, s2); + } + } + } + +- this.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); + } +- catch (IOException var7) ++ catch (Exception var7) + { + ; + } ++ return table; + } + + static StringTranslate getInstance() +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/util/Vec3.java.patch.rej b/rejects/minecraft/net/minecraft/util/Vec3.java.patch.rej new file mode 100644 index 000000000..69addc563 --- /dev/null +++ b/rejects/minecraft/net/minecraft/util/Vec3.java.patch.rej @@ -0,0 +1,37 @@ +++++ REJECTED PATCH 1 + package net.minecraft.util; + +-import net.minecraftforge.fml.relauncher.Side; +-import net.minecraftforge.fml.relauncher.SideOnly; +- + public class Vec3 + { + public final double xCoord; +++++ END PATCH +++++ REJECTED PATCH 2 + this((double)p_i46377_1_.getX(), (double)p_i46377_1_.getY(), (double)p_i46377_1_.getZ()); + } + +- @SideOnly(Side.CLIENT) + public Vec3 subtractReverse(Vec3 vec) + { + return new Vec3(vec.xCoord - this.xCoord, vec.yCoord - this.yCoord, vec.zCoord - this.zCoord); +++++ END PATCH +++++ REJECTED PATCH 3 + return this.xCoord * vec.xCoord + this.yCoord * vec.yCoord + this.zCoord * vec.zCoord; + } + +- @SideOnly(Side.CLIENT) + public Vec3 crossProduct(Vec3 vec) + { + 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); +++++ END PATCH +++++ REJECTED PATCH 4 + return new Vec3(this.xCoord + x, this.yCoord + y, this.zCoord + z); + } + +- @SideOnly(Side.CLIENT) + public double distanceTo(Vec3 vec) + { + double d0 = vec.xCoord - this.xCoord; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch.rej b/rejects/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch.rej new file mode 100644 index 000000000..fe2c74000 --- /dev/null +++ b/rejects/minecraft/net/minecraft/util/WeightedRandomChestContent.java.patch.rej @@ -0,0 +1,67 @@ +++++ REJECTED PATCH 1 + for (int i = 0; i < max; ++i) + { + WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(random, listIn); +- int j = weightedrandomchestcontent.minStackSize + random.nextInt(weightedrandomchestcontent.maxStackSize - weightedrandomchestcontent.minStackSize + 1); ++ ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(random, inv); + +- if (weightedrandomchestcontent.theItemId.getMaxStackSize() >= j) ++ for (ItemStack itemstack1 : stacks) + { +- ItemStack itemstack1 = weightedrandomchestcontent.theItemId.copy(); +- itemstack1.stackSize = j; + inv.setInventorySlotContents(random.nextInt(inv.getSizeInventory()), itemstack1); + } +- else +- { +- for (int k = 0; k < j; ++k) +- { +- ItemStack itemstack = weightedrandomchestcontent.theItemId.copy(); +- itemstack.stackSize = 1; +- inv.setInventorySlotContents(random.nextInt(inv.getSizeInventory()), itemstack); +- } +- } + } + } + ++ // -- Forge hooks ++ /** ++ * Allow a mod to submit a custom implementation that can delegate item stack generation beyond simple stack lookup ++ * ++ * @param random The current random for generation ++ * @param newInventory The inventory being generated (do not populate it, but you can refer to it) ++ * @return An array of {@link ItemStack} to put into the chest ++ */ ++ protected ItemStack[] generateChestContent(Random random, IInventory newInventory) ++ { ++ return net.minecraftforge.common.ChestGenHooks.generateStacks(random, theItemId, minStackSize, maxStackSize); ++ } ++ + public static void generateDispenserContents(Random random, List listIn, TileEntityDispenser dispenser, int max) + { + for (int i = 0; i < max; ++i) + { + WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(random, listIn); +- int j = weightedrandomchestcontent.minStackSize + random.nextInt(weightedrandomchestcontent.maxStackSize - weightedrandomchestcontent.minStackSize + 1); ++ ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(random, dispenser); + +- if (weightedrandomchestcontent.theItemId.getMaxStackSize() >= j) ++ for (ItemStack itemstack1 : stacks) + { +- ItemStack itemstack1 = weightedrandomchestcontent.theItemId.copy(); +- itemstack1.stackSize = j; + dispenser.setInventorySlotContents(random.nextInt(dispenser.getSizeInventory()), itemstack1); + } +- else +- { +- for (int k = 0; k < j; ++k) +- { +- ItemStack itemstack = weightedrandomchestcontent.theItemId.copy(); +- itemstack.stackSize = 1; +- dispenser.setInventorySlotContents(random.nextInt(dispenser.getSizeInventory()), itemstack); +- } +- } + } + } + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/ChunkCache.java.patch.rej b/rejects/minecraft/net/minecraft/world/ChunkCache.java.patch.rej new file mode 100644 index 000000000..d67a85598 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/ChunkCache.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 3 + + public boolean isAirBlock(BlockPos pos) + { +- return this.getBlockState(pos).getBlock().getMaterial() == Material.air; ++ return this.getBlockState(pos).getBlock().isAir(this, pos); + } + + @SideOnly(Side.CLIENT) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/Explosion.java.patch.rej b/rejects/minecraft/net/minecraft/world/Explosion.java.patch.rej new file mode 100644 index 000000000..a75ecd5c2 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/Explosion.java.patch.rej @@ -0,0 +1,18 @@ +++++ REJECTED PATCH 1 + private final float explosionSize; + private final List affectedBlockPositions; + private final Map playerKnockbackMap; ++ 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_) +++++ END PATCH +++++ REJECTED PATCH 4 + 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); + + for (int k2 = 0; k2 < list.size(); ++k2) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/SpawnerAnimals.java.patch.rej b/rejects/minecraft/net/minecraft/world/SpawnerAnimals.java.patch.rej new file mode 100644 index 000000000..7c4fb96bd --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/SpawnerAnimals.java.patch.rej @@ -0,0 +1,53 @@ +++++ REJECTED PATCH 1 + { + if ((!enumcreaturetype.getPeacefulCreature() || spawnPeacefulMobs) && (enumcreaturetype.getPeacefulCreature() || spawnHostileMobs) && (!enumcreaturetype.getAnimal() || p_77192_4_)) + { +- int j4 = worldServerIn.countEntities(enumcreaturetype.getCreatureClass()); ++ int j4 = worldServerIn.countEntities(enumcreaturetype, true); + int k4 = enumcreaturetype.getMaxNumberOfCreature() * i / MOB_COUNT_DIV; + + if (j4 <= k4) + { ++ java.util.ArrayList shuffled = com.google.common.collect.Lists.newArrayList(this.eligibleChunksForSpawning); ++ java.util.Collections.shuffle(shuffled); + label374: +- +- for (ChunkCoordIntPair chunkcoordintpair1 : this.eligibleChunksForSpawning) ++ for (ChunkCoordIntPair chunkcoordintpair1 : shuffled) + { + BlockPos blockpos = getRandomChunkPosition(worldServerIn, chunkcoordintpair1.chunkXPos, chunkcoordintpair1.chunkZPos); + int k1 = blockpos.getX(); +++++ END PATCH +++++ REJECTED PATCH 2 + + entityliving.setLocationAndAngles((double)f, (double)i3, (double)f1, worldServerIn.rand.nextFloat() * 360.0F, 0.0F); + +- if (entityliving.getCanSpawnHere() && entityliving.isNotColliding()) ++ net.minecraftforge.fml.common.eventhandler.Event.Result canSpawn = net.minecraftforge.event.ForgeEventFactory.canEntitySpawn(entityliving, worldServerIn, f, i3, f1); ++ if (canSpawn == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW || (canSpawn == net.minecraftforge.fml.common.eventhandler.Event.Result.DEFAULT && (entityliving.getCanSpawnHere() && entityliving.isNotColliding()))) + { ++ if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(entityliving, worldServerIn, f, l3, f1)) + ientitylivingdata = entityliving.onInitialSpawn(worldServerIn.getDifficultyForLocation(new BlockPos(entityliving)), ientitylivingdata); + + if (entityliving.isNotColliding()) +++++ END PATCH +++++ REJECTED PATCH 3 + worldServerIn.spawnEntityInWorld(entityliving); + } + +- if (j2 >= entityliving.getMaxSpawnedInChunk()) ++ if (i2 >= net.minecraftforge.event.ForgeEventFactory.getMaxSpawnPackSize(entityliving)) + { + continue label374; + } +++++ END PATCH +++++ REJECTED PATCH 4 + { + BlockPos blockpos = pos.down(); + +- if (!World.doesBlockHaveSolidTopSurface(worldIn, blockpos)) ++ if (!worldIn.getBlockState(blockpos).getBlock().canCreatureSpawn(worldIn, blockpos, spawnPlacementTypeIn)) + { + return false; + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/World.java.patch.rej b/rejects/minecraft/net/minecraft/world/World.java.patch.rej new file mode 100644 index 000000000..234b4571b --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/World.java.patch.rej @@ -0,0 +1,319 @@ +++++ REJECTED PATCH 5 + + public boolean isAirBlock(BlockPos pos) + { +- return this.getBlockState(pos).getBlock().getMaterial() == Material.air; ++ return this.getBlockState(pos).getBlock().isAir(this, pos); + } + + public boolean isBlockLoaded(BlockPos pos) +++++ END PATCH +++++ REJECTED PATCH 6 + { + Chunk chunk = this.getChunkFromBlockCoords(pos); + Block block = newState.getBlock(); ++ ++ net.minecraftforge.common.util.BlockSnapshot blockSnapshot = null; ++ if (this.captureBlockSnapshots && !this.isRemote) ++ { ++ blockSnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(this, pos, flags); ++ this.capturedBlockSnapshots.add(blockSnapshot); ++ } ++ Block oldBlock = getBlockState(pos).getBlock(); ++ int oldLight = oldBlock.getLightValue(this, pos); ++ int oldOpacity = oldBlock.getLightOpacity(this, pos); ++ + IBlockState iblockstate = chunk.setBlockState(pos, newState); + + if (iblockstate == null) + { ++ if (blockSnapshot != null) this.capturedBlockSnapshots.remove(blockSnapshot); + return false; + } + else + { + Block block1 = iblockstate.getBlock(); + +- if (block.getLightOpacity() != block1.getLightOpacity() || block.getLightValue() != block1.getLightValue()) ++ if (block.getLightOpacity(this, pos) != oldOpacity || block.getLightValue(this, pos) != oldLight) + { + this.theProfiler.startSection("checkLight"); + this.checkLight(pos); + this.theProfiler.endSection(); + } + +- if ((flags & 2) != 0 && (!this.isRemote || (flags & 4) == 0) && chunk.isPopulated()) ++ 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 + } + ++ return true; ++ } ++ } ++ } ++ ++ // 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())) ++ { ++ this.markBlockForUpdate(pos); ++ } ++ { ++ { + if (!this.isRemote && (flags & 1) != 0) + { +- this.notifyNeighborsRespectDebug(pos, iblockstate.getBlock()); ++ this.notifyNeighborsRespectDebug(pos, new_.getBlock()); + +- if (block.hasComparatorInputOverride()) ++ if (new_.getBlock().hasComparatorInputOverride()) + { +- this.updateComparatorOutputLevel(pos, block); ++ this.updateComparatorOutputLevel(pos, new_.getBlock()); + } + } +- +- return true; + } + } + } +++++ END PATCH +++++ REJECTED PATCH 14 + + public int calculateSkylightSubtracted(float p_72967_1_) + { ++ float f = provider.getSunBrightnessFactor(p_72967_1_); ++ f = 1 - f; ++ return (int)(f * 11); ++ } ++ ++ /** ++ * The current sun brightness factor for this dimension. ++ * 0.0f means no light at all, and 1.0f means maximum sunlight. ++ * Highly recommended for sunlight detection like solar panel. ++ * ++ * @return The current brightness factor ++ * */ ++ 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); + 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 = 1.0F - f1; +- return (int)(f1 * 11.0F); ++ return f1; + } + +- @SideOnly(Side.CLIENT) + public void removeWorldAccess(IWorldAccess worldAccess) + { + this.worldAccesses.remove(worldAccess); +++++ END PATCH +++++ REJECTED PATCH 20 + for (blockpos = new BlockPos(pos.getX(), chunk.getTopFilledSegment() + 16, pos.getZ()); blockpos.getY() >= 0; blockpos = blockpos1) + { + blockpos1 = blockpos.down(); +- Material material = chunk.getBlock(blockpos1).getMaterial(); ++ Block block = chunk.getBlock(blockpos1); + +- if (material.blocksMovement() && material != Material.leaves) ++ if (block.getMaterial().blocksMovement() && !block.isLeaves(this, blockpos1) && !block.isFoliage(this, blockpos1)) + { + break; + } +++++ END PATCH +++++ REJECTED PATCH 23 + CrashReport crashreport1 = CrashReport.makeCrashReport(throwable1, "Ticking entity"); + CrashReportCategory crashreportcategory2 = crashreport1.makeCategory("Entity being ticked"); + entity2.addEntityCrashInfo(crashreportcategory2); +- throw new ReportedException(crashreport1); ++ if (net.minecraftforge.common.ForgeModContainer.removeErroringEntities) ++ { ++ net.minecraftforge.fml.common.FMLLog.severe(crashreport1.getCompleteReport()); ++ removeEntity(entity2); ++ } ++ else ++ { ++ throw new ReportedException(crashreport1); ++ } + } + } + +++++ END PATCH +++++ REJECTED PATCH 24 + CrashReport crashreport2 = CrashReport.makeCrashReport(throwable, "Ticking block entity"); + CrashReportCategory crashreportcategory1 = crashreport2.makeCategory("Block entity being ticked"); + tileentity.addInfoToCrashReport(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()); ++ } ++ else ++ { ++ throw new ReportedException(crashreport2); ++ } + } + } + } +++++ END PATCH +++++ REJECTED PATCH 28 + { + Block block = this.getBlockState(blockpos$mutableblockpos.set(k1, l1, i2)).getBlock(); + +- if (block.getMaterial() != Material.air) ++ if (!block.isAir(this, new BlockPos(k1, l1, i2))) + { + return true; + } +++++ END PATCH +++++ REJECTED PATCH 31 + IBlockState iblockstate = this.getBlockState(blockpos$mutableblockpos.set(k1, l1, i2)); + Block block = iblockstate.getBlock(); + ++ Boolean result = block.isAABBInsideMaterial(this, blockpos$mutableblockpos, bb, materialIn); ++ if (result != null) return result; ++ + if (block.getMaterial() == materialIn) + { + int j2 = ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue(); +++++ END PATCH +++++ REJECTED PATCH 35 + { + IBlockState iblockstate = blockAccess.getBlockState(pos); + 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)))); ++ return block.isSideSolid(blockAccess, pos, EnumFacing.UP); + } + + public boolean isBlockNormalCube(BlockPos pos, boolean _default) +++++ END PATCH +++++ REJECTED PATCH 36 + else + { + Block block = this.getBlockState(pos).getBlock(); +- return block.getMaterial().isOpaque() && block.isFullCube(); ++ return block.isNormalCube(this, pos); + } + } + } +++++ END PATCH +++++ REJECTED PATCH 40 + { + this.activeChunkSet.clear(); + this.theProfiler.startSection("buildList"); ++ this.activeChunkSet.addAll(getPersistentChunks().keySet()); + + for (int i = 0; i < this.playerEntities.size(); ++i) + { +++++ END PATCH +++++ REJECTED PATCH 41 + Block block = chunkIn.getBlock(blockpos); + j = j + p_147467_1_; + k = k + p_147467_2_; ++ BlockPos worldpos = blockpos.add(p_147467_1_, 0, 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, worldpos) && this.getLight(worldpos) <= this.rand.nextInt(8) && this.getLightFor(EnumSkyBlock.SKY, worldpos) <= 0) //Forge: isAir, and fix arguments to world positions instead of chunk position + { + EntityPlayer entityplayer = this.getClosestPlayer((double)j + 0.5D, (double)l + 0.5D, (double)k + 0.5D, 8.0D); + +++++ END PATCH +++++ REJECTED PATCH 44 + { + Block block = this.getBlockState(pos).getBlock(); + +- if (block.getMaterial() == Material.air && Blocks.snow_layer.canPlaceBlockAt(this, pos)) ++ if (block.isAir(this, pos) && Blocks.snow_layer.canPlaceBlockAt(this, pos)) + { + return true; + } +++++ END PATCH +++++ REJECTED PATCH 45 + 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); + +- if (j >= 15 && block.getLightValue() > 0) ++ if (j >= 15 && blockLight > 0) + { + j = 1; + } +++++ END PATCH +++++ REJECTED PATCH 47 + + public List getEntitiesWithinAABB(Class clazz, AxisAlignedBB aabb, Predicate filter) + { +- 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); + List list = Lists.newArrayList(); + + for (int i1 = i; i1 <= j; ++i1) +++++ END PATCH +++++ REJECTED PATCH 49 + { + Block block = this.getBlockState(pos).getBlock(); + AxisAlignedBB axisalignedbb = p_175716_3_ ? null : blockIn.getCollisionBoundingBox(this, pos, blockIn.getDefaultState()); +- return axisalignedbb != null && !this.checkNoEntityCollision(axisalignedbb, entityIn) ? false : (block.getMaterial() == Material.circuits && blockIn == Blocks.anvil ? true : block.getMaterial().isReplaceable() && blockIn.canReplace(this, pos, side, itemStackIn)); ++ if (axisalignedbb != null && !this.checkNoEntityCollision(axisalignedbb, entityIn)) return false; ++ if (block.getMaterial() == Material.circuits && blockIn == Blocks.anvil) return true; ++ return block.isReplaceable(this, pos) && blockIn.canReplace(this, pos, side, itemStackIn); + } + + public int getSeaLevel() +++++ END PATCH +++++ REJECTED PATCH 50 + { + IBlockState iblockstate = this.getBlockState(pos); + Block block = iblockstate.getBlock(); +- return block.isNormalCube() ? this.getStrongPower(pos) : block.getWeakPower(this, pos, iblockstate, facing); ++ return block.shouldCheckWeakPower(this, pos, facing) ? this.getStrongPower(pos) : block.getWeakPower(this, pos, iblockstate, facing); + } + + public boolean isBlockPowered(BlockPos pos) +++++ END PATCH +++++ REJECTED PATCH 59 + { + IBlockState iblockstate = this.getBlockState(blockpos); + +- if (Blocks.unpowered_comparator.isAssociated(iblockstate.getBlock())) ++ iblockstate.getBlock().onNeighborChange(this, blockpos, pos); ++ if (iblockstate.getBlock().isNormalCube(this, blockpos)) + { +- iblockstate.getBlock().onNeighborBlockChange(this, blockpos, iblockstate, blockIn); +- } +- else if (iblockstate.getBlock().isNormalCube()) +- { +- blockpos = blockpos.offset(enumfacing); +- iblockstate = this.getBlockState(blockpos); +- +- if (Blocks.unpowered_comparator.isAssociated(iblockstate.getBlock())) ++ BlockPos posOther = blockpos.offset(enumfacing); ++ Block other = getBlockState(posOther).getBlock(); ++ if (other.getWeakChanges(this, posOther)) + { +- iblockstate.getBlock().onNeighborBlockChange(this, blockpos, iblockstate, blockIn); ++ other.onNeighborChange(this, posOther, pos); + } + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/WorldProvider.java.patch.rej b/rejects/minecraft/net/minecraft/world/WorldProvider.java.patch.rej new file mode 100644 index 000000000..de0d6369d --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/WorldProvider.java.patch.rej @@ -0,0 +1,47 @@ +++++ REJECTED PATCH 1 + + protected void registerWorldChunkManager() + { +- WorldType worldtype = this.worldObj.getWorldInfo().getTerrainType(); +- +- if (worldtype == WorldType.FLAT) +- { +- FlatGeneratorInfo flatgeneratorinfo = FlatGeneratorInfo.createFlatGeneratorFromString(this.worldObj.getWorldInfo().getGeneratorOptions()); +- this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.getBiomeFromBiomeList(flatgeneratorinfo.getBiome(), BiomeGenBase.field_180279_ad), 0.5F); +- } +- else if (worldtype == WorldType.DEBUG_WORLD) +- { +- this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.plains, 0.0F); +- } +- else +- { +- this.worldChunkMgr = new WorldChunkManager(this.worldObj); +- } ++ this.worldChunkMgr = terrainType.getChunkManager(worldObj); + } + + public IChunkProvider createChunkGenerator() + { +- 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); + } + + public boolean canCoordinateBeSpawn(int x, int z) +++++ END PATCH +++++ REJECTED PATCH 2 + + public static WorldProvider getProviderForDimension(int dimension) + { +- return (WorldProvider)(dimension == -1 ? new WorldProviderHell() : (dimension == 0 ? new WorldProviderSurface() : (dimension == 1 ? new WorldProviderEnd() : null))); ++ return net.minecraftforge.common.DimensionManager.createProviderFor(dimension); + } + + @SideOnly(Side.CLIENT) + public float getCloudHeight() + { +- return 128.0F; ++ return this.terrainType.getCloudHeight(); + } + + @SideOnly(Side.CLIENT) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/WorldServer.java.patch.rej b/rejects/minecraft/net/minecraft/world/WorldServer.java.patch.rej new file mode 100644 index 000000000..217fa3a26 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/WorldServer.java.patch.rej @@ -0,0 +1,108 @@ +++++ REJECTED PATCH 1 + 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(); + ++ /** Stores the recently processed (lighting) chunks */ ++ protected Set doneChunks = new java.util.HashSet(); ++ public List customTeleporters = new ArrayList(); ++ private static boolean initChest = false; ++ public static void fillChestHook() ++ { ++ if (!initChest) ++ net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.BONUS_CHEST, bonusChestContent, 10, 10); ++ initChest = true; ++ } ++ + public WorldServer(MinecraftServer server, ISaveHandler saveHandlerIn, WorldInfo info, int dimensionId, Profiler profilerIn) + { + super(saveHandlerIn, info, WorldProvider.getProviderForDimension(dimensionId), profilerIn, false); + this.mcServer = server; + 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; + 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); + } + + public World init() + { + 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); + + if (villagecollection == null) + { + this.villageCollectionObj = new VillageCollection(this); +- this.mapStorage.setData(s, this.villageCollectionObj); ++ this.perWorldStorage.setData(s, this.villageCollectionObj); + } + else + { +++++ END PATCH +++++ REJECTED PATCH 5 + chunk.func_150804_b(false); + this.theProfiler.endStartSection("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()) + { + this.updateLCG = this.updateLCG * 3 + 1013904223; + int i1 = this.updateLCG >> 2; +++++ END PATCH +++++ REJECTED PATCH 12 + + protected void createBonusChest() + { +- WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(bonusChestContent, 10); ++ WorldGeneratorBonusChest worldgeneratorbonuschest = net.minecraftforge.common.ForgeHooks.getBonusChest(rand); + + for (int i = 0; i < 10; ++i) + { +++++ END PATCH +++++ REJECTED PATCH 13 + } + + this.chunkProvider.saveChunks(p_73044_1_, progressCallback); ++ 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())) + { +++++ END PATCH +++++ REJECTED PATCH 16 + this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(8, this.thunderingStrength), this.provider.getDimensionId()); + } + ++ /* 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.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(2, 0.0F)); ++ this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(2, 0.0F), this.provider.dimensionId); + } + else + { +- this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S2BPacketChangeGameState(1, 0.0F)); ++ this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(1, 0.0F), this.provider.dimensionId); + } + +- 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); + } + } + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/biome/BiomeColorHelper.java.patch.rej b/rejects/minecraft/net/minecraft/world/biome/BiomeColorHelper.java.patch.rej new file mode 100644 index 000000000..5bc356b51 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/biome/BiomeColorHelper.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + { + public int getColorAtPos(BiomeGenBase p_180283_1_, BlockPos blockPosition) + { +- return p_180283_1_.waterColorMultiplier; ++ return p_180283_1_.getWaterColorMultiplier(); + } + }; + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch.rej b/rejects/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch.rej new file mode 100644 index 000000000..af1943cfc --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/biome/BiomeDecorator.java.patch.rej @@ -0,0 +1,54 @@ +++++ REJECTED PATCH 1 + + protected void genDecorations(BiomeGenBase biomeGenBaseIn) + { ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(currentWorld, randomGenerator, field_180294_c)); + this.generateOres(); + ++ 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) + { + int j = this.randomGenerator.nextInt(16) + 8; +++++ END PATCH +++++ REJECTED PATCH 12 + this.reedGen.generate(this.currentWorld, this.randomGenerator, this.field_180294_c.add(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) + { + int i5 = this.randomGenerator.nextInt(16) + 8; +++++ END PATCH +++++ REJECTED PATCH 17 + + protected void generateOres() + { ++ 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)); + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch.rej b/rejects/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch.rej new file mode 100644 index 000000000..583ee45c1 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/biome/BiomeGenBase.java.patch.rej @@ -0,0 +1,107 @@ +++++ REJECTED PATCH 1 + + public BiomeGenBase(int id) + { ++ this(id, true); ++ } ++ public BiomeGenBase(int id, boolean register) ++ { + this.minHeight = height_Default.rootHeight; + this.maxHeight = height_Default.variation; + this.temperature = 0.5F; +++++ END PATCH +++++ REJECTED PATCH 2 + this.worldGeneratorBigTree = new WorldGenBigTree(false); + this.worldGeneratorSwamp = new WorldGenSwamp(); + this.biomeID = id; ++ if (register) + biomeList[id] = this; + this.theBiomeDecorator = this.createBiomeDecorator(); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4)); +++++ END PATCH +++++ REJECTED PATCH 6 + } + } + ++ /* ========================================= FORGE START ======================================*/ ++ protected List flowers = new java.util.ArrayList(); ++ ++ public BiomeDecorator getModdedBiomeDecorator(BiomeDecorator original) ++ { ++ return new net.minecraftforge.event.terraingen.DeferredBiomeDecorator(original); ++ } ++ ++ public int getWaterColorMultiplier() ++ { ++ net.minecraftforge.event.terraingen.BiomeEvent.GetWaterColor event = new net.minecraftforge.event.terraingen.BiomeEvent.GetWaterColor(this, waterColorMultiplier); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); ++ return event.newColor; ++ } ++ ++ public int getModdedBiomeGrassColor(int original) ++ { ++ net.minecraftforge.event.terraingen.BiomeEvent.GetGrassColor event = new net.minecraftforge.event.terraingen.BiomeEvent.GetGrassColor(this, original); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); ++ return event.newColor; ++ } ++ ++ public int getModdedBiomeFoliageColor(int original) ++ { ++ net.minecraftforge.event.terraingen.BiomeEvent.GetFoliageColor event = new net.minecraftforge.event.terraingen.BiomeEvent.GetFoliageColor(this, original); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); ++ return event.newColor; ++ } ++ ++ /** ++ * Weighted random holder class used to hold possible flowers ++ * that can spawn in this biome when bonemeal is used on grass. ++ */ ++ public static class FlowerEntry extends WeightedRandom.Item ++ { ++ public final net.minecraft.block.state.IBlockState state; ++ public FlowerEntry(net.minecraft.block.state.IBlockState state, int weight) ++ { ++ super(weight); ++ this.state = state; ++ } ++ } ++ ++ /** ++ * Adds the default flowers, as of 1.7, it is 2 yellow, and 1 red. I chose 10 to allow some wiggle room in the numbers. ++ */ ++ 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); ++ } ++ ++ /** Register a new plant to be planted when bonemeal is used on grass. ++ * @param state The block to place. ++ * @param weight The weight of the plant, where red flowers are ++ * 10 and yellow flowers are 20. ++ */ ++ public void addFlower(IBlockState state, int weight) ++ { ++ this.flowers.add(new FlowerEntry(state, weight)); ++ } ++ ++ public void plantFlower(World world, Random rand, BlockPos pos) ++ { ++ FlowerEntry flower = (FlowerEntry)WeightedRandom.getRandomItem(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))) ++ { ++ return; ++ } ++ ++ world.setBlockState(pos, flower.state, 3); ++ } ++ ++ ++ /* ========================================= FORGE END ======================================*/ ++ + static + { + plains.createMutation(); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch.rej b/rejects/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch.rej new file mode 100644 index 000000000..dfdca41db --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/biome/WorldChunkManager.java.patch.rej @@ -0,0 +1,47 @@ +++++ REJECTED PATCH 1 + + 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; +++++ END PATCH +++++ REJECTED PATCH 2 + this.biomeCache = 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); + } + + public WorldChunkManager(long seed, WorldType p_i45744_3_, String p_i45744_4_) +++++ END PATCH +++++ REJECTED PATCH 3 + this(); + this.field_180301_f = p_i45744_4_; + GenLayer[] agenlayer = GenLayer.initializeAllBiomeGenerators(seed, p_i45744_3_, p_i45744_4_); ++ agenlayer = getModdedBiomeGenerators(p_i45744_3_, seed, agenlayer); + this.genBiomes = agenlayer[0]; + this.biomeIndexLayer = agenlayer[1]; + } +++++ END PATCH +++++ REJECTED PATCH 4 + { + this.biomeCache.cleanupCache(); + } ++ ++ public GenLayer[] getModdedBiomeGenerators(WorldType worldType, long seed, GenLayer[] original) ++ { ++ net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens event = new net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens(worldType, seed, original); ++ net.minecraftforge.common.MinecraftForge.TERRAIN_GEN_BUS.post(event); ++ return event.newBiomeGens; ++ } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/chunk/Chunk.java.patch.rej b/rejects/minecraft/net/minecraft/world/chunk/Chunk.java.patch.rej new file mode 100644 index 000000000..f731b5fc2 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/chunk/Chunk.java.patch.rej @@ -0,0 +1,98 @@ +++++ REJECTED PATCH 1 + { + Block block = this.getBlock0(j, l - 1, k); + +- if (block.getLightOpacity() != 0) ++ if (getBlockLightOpacity(j, l - 1, k) != 0) + { + this.heightMap[k << 4 | j] = l; + +++++ END PATCH +++++ REJECTED PATCH 2 + + public int getBlockLightOpacity(BlockPos pos) + { +- return this.getBlock(pos).getLightOpacity(); ++ return this.getBlock(pos).getLightOpacity(worldObj, pos); + } + + private int getBlockLightOpacity(int x, int y, int z) + { +- return this.getBlock0(x, y, z).getLightOpacity(); ++ return getBlockLightOpacity(new BlockPos((xPosition << 4) + x, y, (zPosition << 4) + z)); + } + + private Block getBlock0(int x, int y, int z) +++++ END PATCH +++++ REJECTED PATCH 5 + } + else + { +- int j1 = block.getLightOpacity(); +- int k1 = block1.getLightOpacity(); ++ int j1 = block.getLightOpacity(this.worldObj, pos); + + if (j1 > 0) + { +++++ END PATCH +++++ REJECTED PATCH 8 + private TileEntity createNewTileEntity(BlockPos pos) + { + 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); + } + + public TileEntity getTileEntity(BlockPos pos, Chunk.EnumCreateEntityType p_177424_2_) + { + TileEntity tileentity = (TileEntity)this.chunkTileEntityMap.get(pos); + ++ if (tileentity != null && tileentity.isInvalid()) ++ { ++ chunkTileEntityMap.remove(pos); ++ tileentity = null; ++ } ++ + if (tileentity == null) + { + if (p_177424_2_ == Chunk.EnumCreateEntityType.IMMEDIATE) +++++ END PATCH +++++ REJECTED PATCH 10 + tileEntityIn.setWorldObj(this.worldObj); + tileEntityIn.setPos(pos); + +- if (this.getBlock(pos) instanceof ITileEntityProvider) ++ if (this.getBlock(pos).hasTileEntity(getBlock(pos).getStateFromMeta(this.getBlockMetadata(pos)))) + { + if (this.chunkTileEntityMap.containsKey(pos)) + { +++++ END PATCH +++++ REJECTED PATCH 16 + while (!this.tileEntityPosQueue.isEmpty()) + { + BlockPos blockpos = (BlockPos)this.tileEntityPosQueue.poll(); ++ Block block = this.getBlock(blockpos); ++ IBlockState state = block.getStateFromMeta(this.getBlockMetadata(blockpos)); + +- if (this.getTileEntity(blockpos, Chunk.EnumCreateEntityType.CHECK) == null && this.getBlock(blockpos).hasTileEntity()) ++ if (this.getTileEntity(blockpos, Chunk.EnumCreateEntityType.CHECK) == null && block.hasTileEntity(state)) + { + TileEntity tileentity = this.createNewTileEntity(blockpos); + this.worldObj.setTileEntity(blockpos, tileentity); +++++ END PATCH +++++ REJECTED PATCH 17 + @SideOnly(Side.CLIENT) + public void fillChunk(byte[] p_177439_1_, int p_177439_2_, boolean p_177439_3_) + { ++ for(TileEntity tileEntity : chunkTileEntityMap.values()) ++ { ++ tileEntity.updateContainingBlockInfo(); ++ tileEntity.getBlockMetadata(); ++ tileEntity.getBlockType(); ++ } ++ + int i = 0; + boolean flag = !this.worldObj.provider.getHasNoSky(); + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch.rej b/rejects/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch.rej new file mode 100644 index 000000000..57276f7df --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch.rej @@ -0,0 +1,41 @@ +++++ REJECTED PATCH 5 + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + ++ try ++ { + if (entity.writeToNBTOptional(nbttagcompound1)) + { + chunkIn.setHasEntities(true); + nbttaglist1.appendTag(nbttagcompound1); + } ++ } ++ catch (Exception e) ++ { ++ net.minecraftforge.fml.common.FMLLog.log(org.apache.logging.log4j.Level.ERROR, e, ++ "An Entity type %s has thrown an exception trying to write state. It will not persist. Report this to the mod author", ++ entity.getClass().getName()); ++ } + } + } + +++++ END PATCH +++++ REJECTED PATCH 6 + for (TileEntity tileentity : chunkIn.getTileEntityMap().values()) + { + NBTTagCompound nbttagcompound2 = new NBTTagCompound(); ++ try ++ { + tileentity.writeToNBT(nbttagcompound2); + nbttaglist2.appendTag(nbttagcompound2); ++ } ++ catch (Exception e) ++ { ++ net.minecraftforge.fml.common.FMLLog.log(org.apache.logging.log4j.Level.ERROR, e, ++ "A TileEntity type %s has throw an exception trying to write state. It will not persist. Report this to the mod author", ++ tileentity.getClass().getName()); ++ } + } + + p_75820_3_.setTag("TileEntities", nbttaglist2); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch.rej b/rejects/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch.rej new file mode 100644 index 000000000..4836be7fc --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch.rej @@ -0,0 +1,22 @@ +++++ REJECTED PATCH 1 + { + File file1 = this.getWorldDirectory(); + +- if (provider instanceof WorldProviderHell) ++ if (provider.getSaveFolder() != null) + { +- File file3 = new File(file1, "DIM-1"); ++ File file3 = new File(file1, provider.getSaveFolder()); + file3.mkdirs(); + return new AnvilChunkLoader(file3); + } +- else if (provider instanceof WorldProviderEnd) +- { +- File file2 = new File(file1, "DIM1"); +- file2.mkdirs(); +- return new AnvilChunkLoader(file2); +- } + else + { + return new AnvilChunkLoader(file1); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch.rej new file mode 100644 index 000000000..650a6183f --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java.patch.rej @@ -0,0 +1,60 @@ +++++ REJECTED PATCH 1 + double[] noiseData3; + double[] noiseData4; + double[] noiseData5; ++ // temporary variables used during event handling ++ private int chunkX = 0; ++ private int chunkZ = 0; + + public ChunkProviderEnd(World worldIn, long p_i2007_2_) + { +++++ END PATCH +++++ REJECTED PATCH 2 + this.noiseGen3 = new NoiseGeneratorOctaves(this.endRNG, 8); + this.noiseGen4 = new NoiseGeneratorOctaves(this.endRNG, 10); + this.noiseGen5 = new NoiseGeneratorOctaves(this.endRNG, 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]; + } + + public void func_180520_a(int p_180520_1_, int p_180520_2_, ChunkPrimer p_180520_3_) +++++ END PATCH +++++ REJECTED PATCH 4 + + public Chunk provideChunk(int x, int z) + { ++ chunkX = x; chunkZ = z; + this.endRNG.setSeed((long)x * 341873128712L + (long)z * 132897987541L); + ChunkPrimer chunkprimer = new ChunkPrimer(); + this.biomesForGeneration = this.endWorld.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16, 16); +++++ END PATCH +++++ REJECTED PATCH 5 + + 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_) + { ++ 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); ++ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.noisefield; ++ + if (p_73187_1_ == null) + { + p_73187_1_ = new double[p_73187_5_ * p_73187_6_ * p_73187_7_]; +++++ END PATCH +++++ REJECTED PATCH 6 + public void populate(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)); + 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; + } + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch.rej new file mode 100644 index 000000000..c97f24761 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java.patch.rej @@ -0,0 +1,117 @@ +++++ REJECTED PATCH 1 + + public ChunkProviderGenerate(World worldIn, 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); ++ } + this.worldObj = worldIn; + this.mapFeaturesEnabled = p_i45636_4_; + this.field_177475_o = worldIn.getWorldInfo().getTerrainType(); +++++ END PATCH +++++ REJECTED PATCH 2 + this.field_177476_s = this.settings.useLavaOceans ? Blocks.lava : Blocks.water; + worldIn.setSeaLevel(this.settings.seaLevel); + } ++ ++ 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); ++ 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]; + } + + public void setBlocksInChunk(int p_180518_1_, int p_180518_2_, ChunkPrimer p_180518_3_) +++++ END PATCH +++++ REJECTED PATCH 3 + + public void replaceBlocksForBiome(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.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); + +++++ END PATCH +++++ REJECTED PATCH 4 + 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)); ++ + if (this.settings.useMineShafts && this.mapFeaturesEnabled) + { + this.mineshaftGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); +++++ END PATCH +++++ REJECTED PATCH 5 + this.oceanMonumentGenerator.generateStructure(this.worldObj, this.rand, 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)) + { + int i1 = this.rand.nextInt(16) + 8; + int j1 = this.rand.nextInt(256); +++++ END PATCH +++++ REJECTED PATCH 6 + (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, blockpos.add(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)) + { + int i2 = this.rand.nextInt(16) + 8; + int l2 = this.rand.nextInt(this.rand.nextInt(248) + 8); +++++ END PATCH +++++ REJECTED PATCH 7 + + if (this.settings.useDungeons) + { +- 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) + { + int i3 = this.rand.nextInt(16) + 8; + int l3 = this.rand.nextInt(256); +++++ END PATCH +++++ REJECTED PATCH 8 + } + + 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)) ++ { + SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, i + 8, j + 8, 16, 16, this.rand); ++ } + blockpos = blockpos.add(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); ++ for (int k2 = 0; doGen && k2 < 16; ++k2) + { + for (int j3 = 0; j3 < 16; ++j3) + { +++++ END PATCH +++++ REJECTED PATCH 9 + } + } + ++ 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)); ++ + BlockFalling.fallInstantly = false; + } + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch.rej new file mode 100644 index 000000000..5eac183f2 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/ChunkProviderHell.java.patch.rej @@ -0,0 +1,144 @@ +++++ REJECTED PATCH 1 + 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; +++++ END PATCH +++++ REJECTED PATCH 2 + + public ChunkProviderHell(World worldIn, 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_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); ++ 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.setSeaLevel(63); + } + +++++ END PATCH +++++ REJECTED PATCH 3 + + 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.common.MinecraftForge.EVENT_BUS.post(event); ++ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return; ++ + int i = this.worldObj.getSeaLevel() + 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); +++++ END PATCH +++++ REJECTED PATCH 4 + + 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_) + { ++ 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); ++ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.noisefield; ++ + if (p_73164_1_ == null) + { + p_73164_1_ = new double[p_73164_5_ * p_73164_6_ * p_73164_7_]; +++++ END PATCH +++++ REJECTED PATCH 5 + public void populate(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)); + 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.generateStructure(this.worldObj, this.hellRNG, 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); ++ 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)); + } + +- 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) + { + 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)); + } + +- 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) + { + 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)); + } + +- 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)); + } + +- if (this.hellRNG.nextBoolean()) ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(worldObj, hellRNG, blockpos)); ++ ++ doGen = net.minecraftforge.event.terraingen.TerrainGen.decorate(worldObj, hellRNG, blockpos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM); ++ if (doGen && this.hellRNG.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)); + } + +- if (this.hellRNG.nextBoolean()) ++ if (doGen && this.hellRNG.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)); + } + +- 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); ++ 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))); + } + +- 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); ++ 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))); + } + ++ 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; + } + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch.rej new file mode 100644 index 000000000..e4824e612 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/ChunkProviderServer.java.patch.rej @@ -0,0 +1,85 @@ +++++ REJECTED PATCH 2 + + public void dropChunk(int x, int z) + { +- if (this.worldObj.provider.canRespawnHere()) ++ if (this.worldObj.provider.canRespawnHere() && net.minecraftforge.common.DimensionManager.shouldLoadSpawn(this.worldObj.provider.getDimensionId())) + { + if (!this.worldObj.isSpawnChunk(x, z)) + { +++++ END PATCH +++++ REJECTED PATCH 3 + + public Chunk loadChunk(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); ++ net.minecraft.world.chunk.storage.AnvilChunkLoader loader = null; ++ ++ if (this.chunkLoader instanceof net.minecraft.world.chunk.storage.AnvilChunkLoader) ++ { ++ loader = (net.minecraft.world.chunk.storage.AnvilChunkLoader) this.chunkLoader; ++ } ++ ++ // We can only use the queue for already generated chunks ++ if (chunk == null && loader != null && loader.chunkExists(this.worldObj, par1, par2)) ++ { ++ if (runnable != null) ++ { ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.queueChunkLoad(this.worldObj, loader, this, par1, par2, runnable); ++ return null; ++ } ++ else ++ { ++ chunk = net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(this.worldObj, loader, this, par1, par2); ++ } ++ } ++ else if (chunk == null) ++ { ++ chunk = this.originalLoadChunk(par1, par2); ++ } ++ ++ // If we didn't load the chunk async and have a callback run it now ++ if (runnable != null) ++ { ++ runnable.run(); ++ } ++ ++ return chunk; ++ } ++ ++ 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); + + 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()); ++ } ++ chunk = net.minecraftforge.common.ForgeChunkManager.fetchDormantChunk(i, this.worldObj); ++ ++ if (chunk == null) + chunk = this.loadChunkFromFile(p_73158_1_, p_73158_2_); + + if (chunk == null) +++++ END PATCH +++++ REJECTED PATCH 5 + if (this.serverChunkGenerator != 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(); + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch.rej new file mode 100644 index 000000000..5fce17302 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/MapGenCaves.java.patch.rej @@ -0,0 +1,37 @@ +++++ REJECTED PATCH 2 + 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()); + +- if (iblockstate1.getBlock() == Blocks.grass || iblockstate1.getBlock() == Blocks.mycelium) ++ if (isTopBlock(p_180702_5_, j3, j2, i2, p_180702_3_, p_180702_4_)) + { + flag1 = true; + } + +- if (this.func_175793_a(iblockstate1, iblockstate2)) +- { +- if (j2 - 1 < 10) +- { +- p_180702_5_.setBlockState(j3, j2, i2, Blocks.lava.getDefaultState()); +- } +- else +- { +- p_180702_5_.setBlockState(j3, j2, i2, Blocks.air.getDefaultState()); +- +- if (iblockstate2.getBlock() == Blocks.sand) +- { +- p_180702_5_.setBlockState(j3, j2 + 1, i2, iblockstate2.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND ? Blocks.red_sandstone.getDefaultState() : Blocks.sandstone.getDefaultState()); +- } +- +- if (flag1 && p_180702_5_.getBlockState(j3, j2 - 1, i2).getBlock() == Blocks.dirt) +- { +- blockpos$mutableblockpos.set(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()); +- } +- } +- } ++ digBlock(p_180702_5_, j3, j2, i2, p_180702_3_, p_180702_4_, flag1, iblockstate1, iblockstate2); + } + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch.rej new file mode 100644 index 000000000..cf2327018 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/MapGenRavine.java.patch.rej @@ -0,0 +1,32 @@ +++++ REJECTED PATCH 2 + { + IBlockState iblockstate1 = p_180707_5_.getBlockState(j3, j2, i2); + +- if (iblockstate1.getBlock() == Blocks.grass) ++ 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 (j2 - 1 < 10) +- { +- p_180707_5_.setBlockState(j3, j2, i2, Blocks.flowing_lava.getDefaultState()); +- } +- else +- { +- p_180707_5_.setBlockState(j3, j2, i2, Blocks.air.getDefaultState()); +- +- if (flag && p_180707_5_.getBlockState(j3, j2 - 1, i2).getBlock() == Blocks.dirt) +- { +- blockpos$mutableblockpos.set(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); +- } +- } +- } ++ digBlock(p_180707_5_, j3, j2, i2, p_180707_3_, p_180707_4_, flag); + } + } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch.rej new file mode 100644 index 000000000..9bb515365 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch.rej @@ -0,0 +1,34 @@ +++++ REJECTED PATCH 1 + { + Block block = worldIn.getBlockState(blockpos$mutableblockpos.set(l, j, i1)).getBlock(); + +- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) ++ if (!block.isAir(worldIn, blockpos$mutableblockpos) && !block.isLeaves(worldIn, blockpos$mutableblockpos)) + { + flag = false; + } +++++ END PATCH +++++ REJECTED PATCH 2 + { + BlockPos blockpos = new BlockPos(l1, l2, i2); + +- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) ++ if (worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos)) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, this.mushroomType.getDefaultState().withProperty(BlockHugeMushroom.VARIANT, blockhugemushroom$enumtype)); + } +++++ END PATCH +++++ REJECTED PATCH 3 + + for (int i3 = 0; i3 < i; ++i3) + { +- Block block2 = worldIn.getBlockState(position.up(i3)).getBlock(); ++ BlockPos upN = position.up(i3); ++ net.minecraft.block.state.IBlockState state = worldIn.getBlockState(upN); + +- if (!block2.isFullBlock()) ++ if (state.getBlock().canBeReplacedByLeaves(worldIn, upN)) + { + this.setBlockAndNotifyAdequately(worldIn, position.up(i3), this.mushroomType.getDefaultState().withProperty(BlockHugeMushroom.VARIANT, BlockHugeMushroom.EnumType.STEM)); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch.rej new file mode 100644 index 000000000..2dc3f7fbe --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch.rej @@ -0,0 +1,13 @@ +++++ REJECTED PATCH 1 + 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); + +- if (material == Material.air || material == Material.leaves) ++ if (state.getBlock().isAir(this.world, blockpos) || state.getBlock().isLeaves(this.world, blockpos)) + { + this.setBlockAndNotifyAdequately(this.world, blockpos, p_181631_3_); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch.rej new file mode 100644 index 000000000..f2c7e0fb9 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch.rej @@ -0,0 +1,34 @@ +++++ REJECTED PATCH 3 + + int k2 = k + j2; + BlockPos blockpos1 = new BlockPos(k1, k2, l1); +- Material material = worldIn.getBlockState(blockpos1).getBlock().getMaterial(); ++ state = worldIn.getBlockState(blockpos1); + +- if (material == Material.air || material == Material.leaves) ++ if (state.getBlock().isAir(worldIn, blockpos1) || state.getBlock().isLeaves(worldIn, blockpos1)) + { + this.func_181639_b(worldIn, blockpos1); + this.func_181639_b(worldIn, blockpos1.east()); +++++ END PATCH +++++ REJECTED PATCH 5 + private void func_150526_a(World worldIn, 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); + +- if (block.getMaterial() == Material.air) ++ if (state.getBlock().isAir(worldIn, blockpos)) + { + this.setBlockAndNotifyAdequately(worldIn, 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); ++ } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch.rej new file mode 100644 index 000000000..114439852 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch.rej @@ -0,0 +1,16 @@ +++++ REJECTED PATCH 1 + { + Block block; + +- while (((block = worldIn.getBlockState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 0) ++ do + { ++ block = worldIn.getBlockState(position).getBlock(); ++ if (!block.isLeaves(worldIn, position) && !block.isLeaves(worldIn, position)) break; + position = position.down(); +- } ++ } while (position.getY() > 0); + + for (int i = 0; i < 4; ++i) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch.rej new file mode 100644 index 000000000..e3b9ce02b --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch.rej @@ -0,0 +1,15 @@ +++++ REJECTED PATCH 1 + 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(rand)}); + TileEntity tileentity1 = worldIn.getTileEntity(blockpos2); + + if (tileentity1 instanceof TileEntityChest) + { +- WeightedRandomChestContent.generateChestContents(rand, list, (TileEntityChest)tileentity1, 8); ++ WeightedRandomChestContent.generateChestContents(rand, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST, rand), (TileEntityChest)tileentity1, 8); + } + + break; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch.rej new file mode 100644 index 000000000..2f590ff3a --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java.patch.rej @@ -0,0 +1,52 @@ +++++ REJECTED PATCH 1 + { + if (j >= 0 && j < 256) + { +- if (!this.func_150523_a(worldIn.getBlockState(blockpos$mutableblockpos.set(l, j, i1)).getBlock())) ++ if (!this.isReplaceable(worldIn, blockpos$mutableblockpos.set(l, j, i1))) + { + flag = false; + } +++++ END PATCH +++++ REJECTED PATCH 2 + } + else + { +- Block block1 = worldIn.getBlockState(position.down()).getBlock(); ++ BlockPos down = position.down(); ++ Block block1 = worldIn.getBlockState(down).getBlock(); ++ boolean isSoil = block1.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling)); + +- if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && position.getY() < 256 - i - 1) ++ if (isSoil && position.getY() < 256 - i - 1) + { +- this.func_175921_a(worldIn, position.down()); ++ block1.onPlantGrow(worldIn, down, position); + + for (int i2 = position.getY() - 3 + i; i2 <= position.getY() + i; ++i2) + { +++++ END PATCH +++++ REJECTED PATCH 3 + BlockPos blockpos = new BlockPos(i3, i2, k1); + Block block = worldIn.getBlockState(blockpos).getBlock(); + +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) ++ if (block.isAir(worldIn, blockpos) || block.isLeaves(worldIn, blockpos)) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181630_b); + } +++++ END PATCH +++++ REJECTED PATCH 4 + + for (int j2 = 0; j2 < i; ++j2) + { +- Block block2 = worldIn.getBlockState(position.up(j2)).getBlock(); +- +- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves) ++ BlockPos upN = position.up(j2); ++ Block block2 = worldIn.getBlockState(upN).getBlock(); ++ if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN)) + { + this.setBlockAndNotifyAdequately(worldIn, position.up(j2), field_181629_a); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch.rej new file mode 100644 index 000000000..140ae9659 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch.rej @@ -0,0 +1,26 @@ +++++ REJECTED PATCH 3 + 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); + +- if (material == Material.air || material == Material.leaves) ++ if (state.getBlock().isAir(worldIn, blockpos) || state.getBlock().isLeaves(worldIn, blockpos)) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, this.leavesMetadata); + } +++++ END PATCH +++++ REJECTED PATCH 4 + 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(); + +- if (material == Material.air || material == Material.leaves) ++ if (block.isAir(worldIn, blockpos) || block.isLeaves(worldIn, blockpos)) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, this.leavesMetadata); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch.rej new file mode 100644 index 000000000..1009b02d7 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch.rej @@ -0,0 +1,63 @@ +++++ REJECTED PATCH 1 + { + Block block = worldIn.getBlockState(position.up(j)).getBlock(); + +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) ++ if (isAirLeaves(worldIn,position.up(j))) + { + this.setBlockAndNotifyAdequately(worldIn, position.up(j), this.woodMetadata); + } + + if (j < i - 1) + { +- block = worldIn.getBlockState(position.add(1, j, 0)).getBlock(); +- +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) ++ if (isAirLeaves(worldIn,position.add(1, j, 0))) + { + this.setBlockAndNotifyAdequately(worldIn, position.add(1, j, 0), this.woodMetadata); + } + +- block = worldIn.getBlockState(position.add(1, j, 1)).getBlock(); +- +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) ++ if (isAirLeaves(worldIn,position.add(1, j, 1))) + { + this.setBlockAndNotifyAdequately(worldIn, position.add(1, j, 1), this.woodMetadata); + } + +- block = worldIn.getBlockState(position.add(0, j, 1)).getBlock(); +- +- if (block.getMaterial() == Material.air || block.getMaterial() == Material.leaves) ++ if (isAirLeaves(worldIn,position.add(0, j, 1))) + { + this.setBlockAndNotifyAdequately(worldIn, position.add(0, j, 1), this.woodMetadata); + } +++++ END PATCH +++++ REJECTED PATCH 2 + BlockPos blockpos = p_175934_2_.up(i); + Block block = worldIn.getBlockState(blockpos).getBlock(); + +- if (block == Blocks.grass || block == Blocks.dirt) ++ if (block.canSustainPlant(worldIn, blockpos, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling))) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181635_g); + break; + } + +- if (block.getMaterial() != Material.air && i < 0) ++ if (!block.isAir(worldIn, blockpos) && i < 0) + { + break; + } + } + } ++ ++ //Helper macro ++ private boolean isAirLeaves(World world, BlockPos pos) ++ { ++ net.minecraft.block.Block block = world.getBlockState(pos).getBlock(); ++ return block.isAir(world, pos) || block.isLeaves(world, pos); ++ } + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch.rej new file mode 100644 index 000000000..3072ebfaf --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch.rej @@ -0,0 +1,39 @@ +++++ REJECTED PATCH 3 + } + + BlockPos blockpos = new BlockPos(i3, i2, j1); +- Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial(); ++ block = worldIn.getBlockState(blockpos).getBlock(); + +- if (material == Material.air || material == Material.leaves) ++ if (block.isAir(worldIn, blockpos) || block.isLeaves(worldIn, blockpos)) + { + this.func_181642_b(worldIn, blockpos); + k1 = i2; +++++ END PATCH +++++ REJECTED PATCH 4 + i3 += enumfacing1.getFrontOffsetX(); + j1 += enumfacing1.getFrontOffsetZ(); + BlockPos blockpos1 = new BlockPos(i3, j2, j1); +- Material material1 = worldIn.getBlockState(blockpos1).getBlock().getMaterial(); ++ block = worldIn.getBlockState(blockpos1).getBlock(); + +- if (material1 == Material.air || material1 == Material.leaves) ++ if (block.isAir(worldIn, blockpos2) || block.isLeaves(worldIn, blockpos2)) + { + this.func_181642_b(worldIn, blockpos1); + k1 = j2; +++++ END PATCH +++++ REJECTED PATCH 5 + + private void func_175924_b(World worldIn, BlockPos p_175924_2_) + { +- Material material = worldIn.getBlockState(p_175924_2_).getBlock().getMaterial(); ++ Block block = worldIn.getBlockState(p_175924_2_).getBlock(); + +- if (material == Material.air || material == Material.leaves) ++ if (block.isAir(worldIn, p_175924_2_) || block.isLeaves(worldIn, p_175924_2_)) + { + this.setBlockAndNotifyAdequately(worldIn, p_175924_2_, field_181644_b); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch.rej new file mode 100644 index 000000000..3123677df --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java.patch.rej @@ -0,0 +1,31 @@ +++++ REJECTED PATCH 1 + { + Block block; + +- while (((block = worldIn.getBlockState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 0) ++ do + { ++ block = worldIn.getBlockState(position).getBlock(); ++ if (!block.isAir(worldIn, position) && !block.isLeaves(worldIn, position)) break; + position = position.down(); +- } ++ } while (position.getY() > 0); + + Block block1 = worldIn.getBlockState(position).getBlock(); + +- if (block1 == Blocks.dirt || block1 == Blocks.grass) ++ if (block1.canSustainPlant(worldIn, position, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.sapling))) + { + position = position.up(); + this.setBlockAndNotifyAdequately(worldIn, position, this.woodMetadata); +++++ END PATCH +++++ REJECTED PATCH 2 + { + BlockPos blockpos = new BlockPos(l, i, j1); + +- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) ++ if (worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos)) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, this.leavesMetadata); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch.rej new file mode 100644 index 000000000..da11cee0f --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch.rej @@ -0,0 +1,80 @@ +++++ REJECTED PATCH 1 + { + Block block = worldIn.getBlockState(blockpos$mutableblockpos.set(l, j, i1)).getBlock(); + +- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) ++ if (!block.isAir(worldIn, blockpos$mutableblockpos.set(l, j, i1)) && !block.isLeaves(worldIn, blockpos$mutableblockpos.set(l, j, i1))) + { + if (block != Blocks.water && block != Blocks.flowing_water) + { +++++ END PATCH +++++ REJECTED PATCH 3 + { + BlockPos blockpos = new BlockPos(k3, l1, j1); + +- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) ++ if (worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos)) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181649_b); + } +++++ END PATCH +++++ REJECTED PATCH 4 + + for (int i2 = 0; i2 < i; ++i2) + { +- Block block2 = worldIn.getBlockState(position.up(i2)).getBlock(); ++ BlockPos upN = position.up(i2); ++ Block block2 = worldIn.getBlockState(upN).getBlock(); + +- 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) + { + this.setBlockAndNotifyAdequately(worldIn, position.up(i2), field_181648_a); + } +++++ END PATCH +++++ REJECTED PATCH 5 + { + blockpos$mutableblockpos1.set(i4, j2, j4); + +- if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().getMaterial() == Material.leaves) ++ if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().isLeaves(worldIn, blockpos$mutableblockpos1)) + { + BlockPos blockpos3 = blockpos$mutableblockpos1.west(); + BlockPos blockpos4 = blockpos$mutableblockpos1.east(); + BlockPos blockpos1 = blockpos$mutableblockpos1.north(); + BlockPos blockpos2 = blockpos$mutableblockpos1.south(); + +- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().getMaterial() == Material.air) ++ if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().isAir(worldIn,blockpos3)) + { + this.func_181647_a(worldIn, blockpos3, BlockVine.EAST); + } + +- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().getMaterial() == Material.air) ++ if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().isAir(worldIn,blockpos4)) + { + this.func_181647_a(worldIn, blockpos4, BlockVine.WEST); + } + +- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().getMaterial() == Material.air) ++ if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().isAir(worldIn,blockpos1)) + { + this.func_181647_a(worldIn, blockpos1, BlockVine.SOUTH); + } + +- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().getMaterial() == Material.air) ++ if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().isAir(worldIn,blockpos2)) + { + this.func_181647_a(worldIn, blockpos2, BlockVine.NORTH); + } +++++ END PATCH +++++ REJECTED PATCH 6 + this.setBlockAndNotifyAdequately(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) + { + this.setBlockAndNotifyAdequately(p_181647_1_, p_181647_2_, iblockstate); + p_181647_2_ = p_181647_2_.down(); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch.rej new file mode 100644 index 000000000..69dac58c7 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch.rej @@ -0,0 +1,24 @@ +++++ REJECTED PATCH 3 + { + BlockPos blockpos = new BlockPos(j3, l2, i2); + +- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) ++ if (worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos)) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181637_b); + } +++++ END PATCH +++++ REJECTED PATCH 4 + + for (int i3 = 0; i3 < i - 1; ++i3) + { +- Block block1 = worldIn.getBlockState(position.up(i3)).getBlock(); ++ BlockPos upN = position.up(i3); ++ Block block1 = worldIn.getBlockState(upN).getBlock(); + +- if (block1.getMaterial() == Material.air || block1.getMaterial() == Material.leaves) ++ if (block1.isAir(worldIn, upN) || block1.isLeaves(worldIn, upN)) + { + this.setBlockAndNotifyAdequately(worldIn, position.up(i3), field_181636_a); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch.rej new file mode 100644 index 000000000..c239c82d2 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch.rej @@ -0,0 +1,52 @@ +++++ REJECTED PATCH 1 + { + Block block = worldIn.getBlockState(blockpos$mutableblockpos.set(k1, i1, l1)).getBlock(); + +- if (block.getMaterial() != Material.air && block.getMaterial() != Material.leaves) ++ if (!block.isAir(worldIn, blockpos$mutableblockpos) && !block.isLeaves(worldIn, blockpos$mutableblockpos)) + { + flag = false; + } +++++ END PATCH +++++ REJECTED PATCH 2 + } + else + { +- Block block1 = worldIn.getBlockState(position.down()).getBlock(); ++ BlockPos down = position.down(); ++ Block block1 = worldIn.getBlockState(down).getBlock(); ++ boolean isSoil = block1.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.sapling); + +- if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && position.getY() < 256 - i - 1) ++ if (isSoil && position.getY() < 256 - i - 1) + { +- this.func_175921_a(worldIn, position.down()); ++ block1.onPlantGrow(worldIn, down, position); + int i3 = rand.nextInt(2); + int j3 = 1; + int k3 = 0; +++++ END PATCH +++++ REJECTED PATCH 3 + { + BlockPos blockpos = new BlockPos(i2, j4, k2); + +- if (!worldIn.getBlockState(blockpos).getBlock().isFullBlock()) ++ if (worldIn.getBlockState(blockpos).getBlock().canBeReplacedByLeaves(worldIn, blockpos)) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, field_181646_b); + } +++++ END PATCH +++++ REJECTED PATCH 4 + + for (int k4 = 0; k4 < i - i4; ++k4) + { +- Block block2 = worldIn.getBlockState(position.up(k4)).getBlock(); ++ BlockPos upN = position.up(k4); ++ Block block2 = worldIn.getBlockState(upN).getBlock(); + +- if (block2.getMaterial() == Material.air || block2.getMaterial() == Material.leaves) ++ if (block2.isAir(worldIn, upN) || block2.isLeaves(worldIn, upN)) + { + this.setBlockAndNotifyAdequately(worldIn, position.up(k4), field_181645_a); + } +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch.rej new file mode 100644 index 000000000..8e41645a2 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch.rej @@ -0,0 +1,16 @@ +++++ REJECTED PATCH 1 + { + Block block; + +- while (((block = worldIn.getBlockState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 0) ++ do + { ++ block = worldIn.getBlockState(position).getBlock(); ++ if (!block.isAir(worldIn, position) && !block.isLeaves(worldIn, position)) break; + position = position.down(); +- } ++ } while (position.getY() > 0); + + for (int i = 0; i < 128; ++i) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch.rej new file mode 100644 index 000000000..4476c426a --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java.patch.rej @@ -0,0 +1,88 @@ +++++ REJECTED PATCH 2 + } + else + { +- Block block1 = worldIn.getBlockState(position.down()).getBlock(); ++ BlockPos down = position.down(); ++ Block block1 = worldIn.getBlockState(down).getBlock(); ++ boolean isSoil = block1.canSustainPlant(worldIn, down, net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling)Blocks.sapling); + +- if ((block1 == Blocks.grass || block1 == Blocks.dirt || block1 == Blocks.farmland) && position.getY() < 256 - i - 1) ++ if (isSoil && position.getY() < 256 - i - 1) + { +- this.func_175921_a(worldIn, position.down()); ++ block1.onPlantGrow(worldIn, down, position); + int k2 = 3; + int l2 = 0; + +++++ END PATCH +++++ REJECTED PATCH 3 + BlockPos blockpos = new BlockPos(k1, i3, i2); + Block block = worldIn.getBlockState(blockpos).getBlock(); + +- 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) + { + this.setBlockAndNotifyAdequately(worldIn, blockpos, this.metaLeaves); + } +++++ END PATCH +++++ REJECTED PATCH 4 + + for (int j3 = 0; j3 < i; ++j3) + { +- Block block2 = worldIn.getBlockState(position.up(j3)).getBlock(); ++ BlockPos upN = position.up(j3); ++ Block block2 = worldIn.getBlockState(upN).getBlock(); + +- 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) + { + this.setBlockAndNotifyAdequately(worldIn, position.up(j3), this.metaWood); + +++++ END PATCH +++++ REJECTED PATCH 5 + { + blockpos$mutableblockpos1.set(l4, k3, i5); + +- if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().getMaterial() == Material.leaves) ++ if (worldIn.getBlockState(blockpos$mutableblockpos1).getBlock().isLeaves(worldIn,blockpos$mutableblockpos1)) + { + BlockPos blockpos2 = blockpos$mutableblockpos1.west(); + BlockPos blockpos3 = blockpos$mutableblockpos1.east(); + BlockPos blockpos4 = blockpos$mutableblockpos1.north(); + BlockPos blockpos1 = blockpos$mutableblockpos1.south(); + +- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().getMaterial() == Material.air) ++ if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos2).getBlock().isAir(worldIn,blockpos2)) + { + this.func_181650_b(worldIn, blockpos2, BlockVine.EAST); + } + +- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().getMaterial() == Material.air) ++ if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos3).getBlock().isAir(worldIn,blockpos3)) + { + this.func_181650_b(worldIn, blockpos3, BlockVine.WEST); + } + +- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().getMaterial() == Material.air) ++ if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos4).getBlock().isAir(worldIn,blockpos4)) + { + this.func_181650_b(worldIn, blockpos4, BlockVine.SOUTH); + } + +- if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().getMaterial() == Material.air) ++ if (rand.nextInt(4) == 0 && worldIn.getBlockState(blockpos1).getBlock().isAir(worldIn,blockpos1)) + { + this.func_181650_b(worldIn, blockpos1, BlockVine.NORTH); + } +++++ END PATCH +++++ REJECTED PATCH 6 + 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) + { + this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_); + p_181650_2_ = p_181650_2_.down(); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch.rej new file mode 100644 index 000000000..c80d1d0f2 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch.rej @@ -0,0 +1,16 @@ +++++ REJECTED PATCH 1 + { + Block block; + +- while (((block = worldIn.getBlockState(position).getBlock()).getMaterial() == Material.air || block.getMaterial() == Material.leaves) && position.getY() > 1) ++ do + { ++ block = worldIn.getBlockState(position).getBlock(); ++ if (!block.isAir(worldIn, position) && !block.isLeaves(worldIn, position)) break; + position = position.down(); +- } ++ } while (position.getY() > 0); + + if (position.getY() < 1) + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch.rej new file mode 100644 index 000000000..2a00cca4a --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/layer/GenLayer.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 2 + + protected static boolean isBiomeOceanic(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_)); + } + + protected int selectRandom(int... p_151619_1_) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch.rej new file mode 100644 index 000000000..e2267751c --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java.patch.rej @@ -0,0 +1,84 @@ +++++ REJECTED PATCH 1 + + 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}; ++ @SuppressWarnings("unchecked") ++ private java.util.List[] biomes = new java.util.ArrayList[net.minecraftforge.common.BiomeManager.BiomeType.values().length]; ++ + private final ChunkProviderSettings field_175973_g; + + public GenLayerBiome(long p_i45560_1_, GenLayer p_i45560_3_, WorldType p_i45560_4_, String p_i45560_5_) +++++ END PATCH +++++ REJECTED PATCH 2 + super(p_i45560_1_); + this.parent = p_i45560_3_; + ++ for (net.minecraftforge.common.BiomeManager.BiomeType type : net.minecraftforge.common.BiomeManager.BiomeType.values()) ++ { ++ com.google.common.collect.ImmutableList biomesToAdd = net.minecraftforge.common.BiomeManager.getBiomes(type); ++ int idx = type.ordinal(); ++ ++ if (biomes[idx] == null) biomes[idx] = new java.util.ArrayList(); ++ if (biomesToAdd != null) biomes[idx].addAll(biomesToAdd); ++ } ++ ++ 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)); ++ + if (p_i45560_4_ == WorldType.DEFAULT_1_1) + { +- this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga}; ++ 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)); + this.field_175973_g = null; + } + else if (p_i45560_4_ == WorldType.CUSTOMIZED) +++++ END PATCH +++++ REJECTED PATCH 3 + } + 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; + } + } + else if (k == 2) +++++ END PATCH +++++ REJECTED PATCH 4 + } + 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; + } + } + else if (k == 3) +++++ END PATCH +++++ REJECTED PATCH 5 + } + 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; + } + } + 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; + } + else + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch.rej new file mode 100644 index 000000000..7cec77af0 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch.rej @@ -0,0 +1,55 @@ +++++ REJECTED PATCH 2 + { + int l1 = enumfacing.getFrontOffsetX() * 2; + int i2 = enumfacing.getFrontOffsetZ() * 2; +- this.field_74940_h[enumfacing.getHorizontalIndex()] = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 10 + l1, -11, 10 + i2, WeightedRandomChestContent.func_177629_a(itemsToGenerateInTemple, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 2 + randomIn.nextInt(5)); ++ this.field_74940_h[enumfacing.getHorizontalIndex()] = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 10 + l1, -11, 10 + i2, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST, randomIn), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.PYRAMID_DESERT_CHEST, randomIn)); + } + } + +++++ END PATCH +++++ REJECTED PATCH 4 + this.setBlockState(worldIn, Blocks.redstone_wire.getDefaultState(), 4, -3, 1, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 3, -3, 1, structureBoundingBoxIn); + ++ 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.generateDispenserContents(worldIn, structureBoundingBoxIn, randomIn, 3, -2, 1, EnumFacing.NORTH.getIndex(), field_175815_j, 2); ++ this.field_74945_j = this.generateDispenserContents(worldIn, structureBoundingBoxIn, randomIn, 3, -2, 1, EnumFacing.NORTH.getIndex(), dispenser.getItems(randomIn), dispenser.getCount(randomIn)); + } + + this.setBlockState(worldIn, Blocks.vine.getStateFromMeta(15), 3, -2, 2, structureBoundingBoxIn); +++++ END PATCH +++++ REJECTED PATCH 5 + + if (!this.field_74946_k) + { +- this.field_74946_k = this.generateDispenserContents(worldIn, structureBoundingBoxIn, randomIn, 9, -2, 3, EnumFacing.WEST.getIndex(), field_175815_j, 2); ++ this.field_74946_k = this.generateDispenserContents(worldIn, structureBoundingBoxIn, randomIn, 9, -2, 3, EnumFacing.WEST.getIndex(), dispenser.getItems(randomIn), dispenser.getCount(randomIn)); + } + + this.setBlockState(worldIn, Blocks.vine.getStateFromMeta(15), 8, -1, 3, structureBoundingBoxIn); +++++ END PATCH +++++ REJECTED PATCH 6 + + if (!this.field_74947_h) + { +- this.field_74947_h = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 8, -3, 3, WeightedRandomChestContent.func_177629_a(field_175816_i, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 2 + randomIn.nextInt(5)); ++ this.field_74947_h = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 8, -3, 3, chest.getItems(randomIn), chest.getCount(randomIn)); + } + + this.setBlockState(worldIn, Blocks.mossy_cobblestone.getDefaultState(), 9, -3, 2, structureBoundingBoxIn); +++++ END PATCH +++++ REJECTED PATCH 7 + + if (!this.field_74948_i) + { +- this.field_74948_i = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 9, -3, 10, WeightedRandomChestContent.func_177629_a(field_175816_i, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 2 + randomIn.nextInt(5)); ++ this.field_74948_i = this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 9, -3, 10, chest.getItems(randomIn), chest.getCount(randomIn)); + } + + return true; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch.rej new file mode 100644 index 000000000..5827a1fee --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java.patch.rej @@ -0,0 +1,21 @@ +++++ REJECTED PATCH 1 + + for (BiomeGenBase biomegenbase : BiomeGenBase.getBiomeGenArray()) + { +- if (biomegenbase != null && biomegenbase.minHeight > 0.0F) ++ if (biomegenbase != null && biomegenbase.minHeight > 0.0F && !net.minecraftforge.common.BiomeManager.strongHoldBiomesBlackList.contains(biomegenbase)) + { + this.field_151546_e.add(biomegenbase); + } + } ++ for (BiomeGenBase biome : net.minecraftforge.common.BiomeManager.strongHoldBiomes) ++ { ++ if (!this.field_151546_e.contains(biome)) ++ { ++ this.field_151546_e.add(biome); ++ } ++ } + } + + public MapGenStronghold(Map p_i2068_1_) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch.rej new file mode 100644 index 000000000..5ced572b8 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch.rej @@ -0,0 +1,19 @@ +++++ REJECTED PATCH 2 + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 1, 2, k1 - 1, Blocks.torch.getStateFromMeta(EnumFacing.UP.getIndex())); + this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 1, 2, k1 + 1, Blocks.torch.getStateFromMeta(EnumFacing.UP.getIndex())); + ++ net.minecraftforge.common.ChestGenHooks info = net.minecraftforge.common.ChestGenHooks.getInfo(net.minecraftforge.common.ChestGenHooks.MINESHAFT_CORRIDOR); + if (randomIn.nextInt(100) == 0) + { +- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 2, 0, k1 - 1, WeightedRandomChestContent.func_177629_a(StructureMineshaftPieces.CHEST_CONTENT_WEIGHT_LIST, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 3 + randomIn.nextInt(4)); ++ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 2, 0, k1 - 1, info.getItems(randomIn), info.getCount(randomIn)); + } + + if (randomIn.nextInt(100) == 0) + { +- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 0, 0, k1 + 1, WeightedRandomChestContent.func_177629_a(StructureMineshaftPieces.CHEST_CONTENT_WEIGHT_LIST, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 3 + randomIn.nextInt(4)); ++ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 0, 0, k1 + 1, info.getItems(randomIn), info.getCount(randomIn)); + } + + if (this.hasSpiders && !this.spawnerPlaced) +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch.rej new file mode 100644 index 000000000..230771864 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java.patch.rej @@ -0,0 +1,29 @@ +++++ REJECTED PATCH 1 + if (this.field_111021_b && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(3, 3), this.getYWithOffset(2), this.getZWithOffset(3, 3)))) + { + this.field_111021_b = false; +- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 2, 3, field_111019_a, 2 + randomIn.nextInt(4)); ++ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, randomIn), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, randomIn)); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 6, 0, 4, 6, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); +++++ END PATCH +++++ REJECTED PATCH 2 + if (this.field_111020_b && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(1, 3), this.getYWithOffset(2), this.getZWithOffset(1, 3)))) + { + this.field_111020_b = false; +- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 1, 2, 3, field_111019_a, 2 + randomIn.nextInt(4)); ++ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 1, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, randomIn), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, randomIn)); + } + + this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 6, 0, 4, 6, 4, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false); +++++ END PATCH +++++ REJECTED PATCH 3 + 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)}); ++ static { net.minecraftforge.common.ChestGenHooks.init(net.minecraftforge.common.ChestGenHooks.NETHER_FORTRESS, field_111019_a, 2, 5); } + + public Piece() + { +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch.rej new file mode 100644 index 000000000..6f7af3afd --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch.rej @@ -0,0 +1,37 @@ +++++ REJECTED PATCH 2 + if (!this.hasMadeChest && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(3, 3), this.getYWithOffset(2), this.getZWithOffset(3, 3)))) + { + this.hasMadeChest = true; +- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 2, 3, WeightedRandomChestContent.func_177629_a(strongholdChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 2 + randomIn.nextInt(2)); ++ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 2, 3, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR, randomIn), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CORRIDOR, randomIn)); + } + + return true; +++++ END PATCH +++++ REJECTED PATCH 4 + this.setBlockState(worldIn, Blocks.torch.getDefaultState(), i1, 8, j1 + 1, structureBoundingBoxIn); + } + +- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 3, 5, WeightedRandomChestContent.func_177629_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn, 1, 5, 2)}), 1 + randomIn.nextInt(4)); ++ net.minecraftforge.common.ChestGenHooks info = net.minecraftforge.common.ChestGenHooks.getInfo(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_LIBRARY); ++ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 3, 5, info.getItems(randomIn), info.getCount(randomIn)); + + if (this.isLargeRoom) + { + this.setBlockState(worldIn, Blocks.air.getDefaultState(), 12, 9, 1, structureBoundingBoxIn); +- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 12, 8, 1, WeightedRandomChestContent.func_177629_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn, 1, 5, 2)}), 1 + randomIn.nextInt(4)); ++ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 12, 8, 1, info.getItems(randomIn), info.getCount(randomIn)); + } + + return true; +++++ END PATCH +++++ REJECTED PATCH 6 + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), 9, 1, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), 9, 2, 3, structureBoundingBoxIn); + this.setBlockState(worldIn, Blocks.ladder.getStateFromMeta(this.getMetadataWithOffset(Blocks.ladder, EnumFacing.WEST.getIndex())), 9, 3, 3, structureBoundingBoxIn); +- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 4, 8, WeightedRandomChestContent.func_177629_a(strongholdRoomCrossingChestContents, new WeightedRandomChestContent[] {Items.enchanted_book.getRandom(randomIn)}), 1 + randomIn.nextInt(4)); ++ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 4, 8, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CROSSING, randomIn), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.STRONGHOLD_CROSSING, randomIn)); + } + + return true; +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch.rej b/rejects/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch.rej new file mode 100644 index 000000000..bba26e14d --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch.rej @@ -0,0 +1,19 @@ +++++ REJECTED PATCH 4 + if (!this.hasMadeChest && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(5, 5), this.getYWithOffset(1), this.getZWithOffset(5, 5)))) + { + this.hasMadeChest = true; +- this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 5, 1, 5, villageBlacksmithChestContents, 3 + randomIn.nextInt(6)); ++ this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 5, 1, 5, net.minecraftforge.common.ChestGenHooks.getItems(net.minecraftforge.common.ChestGenHooks.VILLAGE_BLACKSMITH, randomIn), net.minecraftforge.common.ChestGenHooks.getCount(net.minecraftforge.common.ChestGenHooks.VILLAGE_BLACKSMITH, randomIn)); + } + + for (int i = 6; i <= 8; ++i) +++++ END PATCH +++++ REJECTED PATCH 6 + this.terrainType = p_i2104_7_; + BiomeGenBase biomegenbase = chunkManagerIn.getBiomeGenerator(new BlockPos(p_i2104_4_, 0, p_i2104_5_), BiomeGenBase.field_180279_ad); + this.inDesert = biomegenbase == BiomeGenBase.desert || biomegenbase == BiomeGenBase.desertHills; ++ this.biome = biomegenbase; + this.func_175846_a(this.inDesert); + } + +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/storage/MapData.java.patch.rej b/rejects/minecraft/net/minecraft/world/storage/MapData.java.patch.rej new file mode 100644 index 000000000..be29e9811 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/storage/MapData.java.patch.rej @@ -0,0 +1,10 @@ +++++ REJECTED PATCH 1 + { + 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(); +++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/world/storage/SaveHandler.java.patch.rej b/rejects/minecraft/net/minecraft/world/storage/SaveHandler.java.patch.rej new file mode 100644 index 000000000..5df712317 --- /dev/null +++ b/rejects/minecraft/net/minecraft/world/storage/SaveHandler.java.patch.rej @@ -0,0 +1,57 @@ +++++ REJECTED PATCH 1 + { + File file1 = new File(this.worldDirectory, "level.dat"); + ++ WorldInfo worldInfo = null; ++ + if (file1.exists()) + { + try + { + NBTTagCompound nbttagcompound2 = CompressedStreamTools.readCompressed(new FileInputStream(file1)); + NBTTagCompound nbttagcompound3 = nbttagcompound2.getCompoundTag("Data"); +- return new WorldInfo(nbttagcompound3); ++ worldInfo = new WorldInfo(nbttagcompound3); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataLoad(this, worldInfo, nbttagcompound2); ++ return worldInfo; + } ++ catch (net.minecraftforge.fml.common.StartupQuery.AbortedException e) ++ { ++ throw e; ++ } + catch (Exception exception1) + { + exception1.printStackTrace(); + } + } + ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().confirmBackupLevelDatUse(this); + file1 = new File(this.worldDirectory, "level.dat_old"); + + if (file1.exists()) +++++ END PATCH +++++ REJECTED PATCH 2 + { + NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file1)); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data"); +- return new WorldInfo(nbttagcompound1); ++ worldInfo = new WorldInfo(nbttagcompound1); ++ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataLoad(this, worldInfo, nbttagcompound); ++ return worldInfo; ++ } ++ catch (net.minecraftforge.fml.common.StartupQuery.AbortedException e) ++ { ++ throw e; + } + catch (Exception exception) + { +++++ END PATCH +++++ REJECTED PATCH 5 + } + + file1.renameTo(file2); ++ net.minecraftforge.event.ForgeEventFactory.firePlayerSavingEvent(player, this.playersDirectory, player.getUniqueID().toString()); + } + catch (Exception var5) + { +++++ END PATCH