Add rejects with mcp names for application to main codebase. Let's roll?

This commit is contained in:
cpw 2016-02-29 21:45:40 -05:00
parent d29b9f8752
commit 213abdb561
214 changed files with 9282 additions and 0 deletions

View File

@ -0,0 +1,91 @@
++++ REJECTED PATCH 1
public class Block
{
private static final ResourceLocation AIR_ID = new ResourceLocation("air");
- public static final RegistryNamespacedDefaultedByKey<ResourceLocation, Block> blockRegistry = new RegistryNamespacedDefaultedByKey(AIR_ID);
- public static final ObjectIntIdentityMap<IBlockState> BLOCK_STATE_IDS = new ObjectIntIdentityMap();
+ public static final RegistryNamespacedDefaultedByKey<ResourceLocation,Block> blockRegistry = net.minecraftforge.fml.common.registry.GameData.getBlockRegistry();
+ @Deprecated //Modders: DO NOT use this! Use GameRegistry
+ public static final ObjectIntIdentityMap<IBlockState> 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<ItemStack> items = new java.util.ArrayList<ItemStack>();
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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return new java.util.ArrayList<ItemStack>(java.util.Arrays.asList(new ItemStack(Blocks.deadbush)));
+ }
}
++++ END PATCH

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<ItemStack> items = new java.util.ArrayList<ItemStack>();
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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<ItemStack> 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

View File

@ -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<ItemStack> 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

View File

@ -0,0 +1,16 @@
++++ REJECTED PATCH 2
public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List<AxisAlignedBB> 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

View File

@ -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

View File

@ -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

View File

@ -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<net.minecraft.item.ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ java.util.List<ItemStack> 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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<BlockTrapDoor.DoorHalf> HALF = PropertyEnum.<BlockTrapDoor.DoorHalf>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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,55 @@
++++ REJECTED PATCH 1
public BlockState(Block blockIn, IProperty... properties)
{
+ this(blockIn, properties, null);
+ }
+
+ protected StateImplementation createState(Block block, ImmutableMap<IProperty, Comparable> properties, ImmutableMap<net.minecraftforge.common.property.IUnlistedProperty<?>, com.google.common.base.Optional<?>> unlistedProperties)
+ {
+ return new StateImplementation(block, properties);
+ }
+
+ protected BlockState(Block blockIn, IProperty[] properties, ImmutableMap<net.minecraftforge.common.property.IUnlistedProperty<?>, com.google.common.base.Optional<?>> unlistedProperties)
+ {
this.block = blockIn;
Arrays.sort(properties, new Comparator<IProperty>()
{
++++ END PATCH
++++ REJECTED PATCH 2
for (List<Comparable> list1 : Cartesian.cartesianProduct(this.getAllowedValues()))
{
Map<IProperty, Comparable> map1 = MapPopulator.<IProperty, Comparable>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<IProperty, Comparable> propertiesIn, ImmutableTable<IProperty, Comparable, IBlockState> propertyValueTable)
+ {
+ this.block = blockIn;
+ this.properties = propertiesIn;
+ this.propertyValueTable = propertyValueTable;
+ }
+
public <T extends Comparable<T>, V extends T> IBlockState withProperty(IProperty<T> property, V value)
{
if (!this.properties.containsKey(property))
++++ END PATCH
++++ REJECTED PATCH 4
map.put(property, value);
return map;
}
+
+ public ImmutableTable<IProperty, Comparable, IBlockState> getPropertyValueTable()
+ {
+ return propertyValueTable;
+ }
}
}
++++ END PATCH

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<Achievement> 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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,68 @@
++++ REJECTED PATCH 1
protected List<LayerRenderer<T>> layerRenderers = Lists.<LayerRenderer<T>>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

View File

@ -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

View File

@ -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<String, TextureAtlasSprite> 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<String, TextureAtlasSprite> map = Maps.<String, TextureAtlasSprite>newHashMap(this.mapRegisteredSprites);
+ bar.step("Uploading GL texture");
for (TextureAtlasSprite textureatlassprite2 : stitcher.getStichSlots())
{
String s = textureatlassprite2.getIconName();
++++ END PATCH

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,8 @@
++++ REJECTED PATCH 1
TextureAtlasSprite getParticleTexture();
+ @Deprecated
ItemCameraTransforms getItemCameraTransforms();
}
++++ END PATCH

View File

@ -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<net.minecraftforge.fml.common.registry.RegistryDelegate<Item>, Set<String>> e : customVariantNames.entrySet())
+ {
+ this.variantNames.put(e.getKey().get(), Lists.newArrayList(e.getValue().iterator()));
+ }
}
protected List<String> 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<String, ResourceLocation> 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<net.minecraftforge.fml.common.registry.RegistryDelegate<Item>, Set<String>> 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 <T extends ResourceLocation> void registerItemVariants(Item item, T... names)
+ {
+ if (!customVariantNames.containsKey(item.delegate))
+ {
+ customVariantNames.put(item.delegate, Sets.<String>newHashSet());
+ }
+ for(ResourceLocation name : names)
+ {
+ customVariantNames.get(item.delegate).add(name.toString());
+ }
+ }
+ /***********************************************************
+ * FML End
+ ***********************************************************/
}
++++ END PATCH

View File

@ -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

View File

@ -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<net.minecraftforge.client.model.TRSRTransformation> apply(com.google.common.base.Optional<? extends net.minecraftforge.client.model.IModelPart> 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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<String> 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

View File

@ -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

View File

@ -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

View File

@ -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 <i>all possible</i> 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<Enchantment> list = Lists.<Enchantment>newArrayList();
++++ END PATCH

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,10 @@
++++ REJECTED PATCH 1
{
if (!this.worldObj.isRemote)
{
- Class <? extends Entity > oclass = EntityList.getClassFromID(itemstack.getMetadata());
+ Class <? extends Entity > oclass = EntityList.stringToClassMapping.get(net.minecraft.item.ItemMonsterPlacer.getEntityName(itemstack));
if (oclass != null && this.getClass() == oclass)
{
++++ END PATCH

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

Some files were not shown because too many files have changed in this diff Show More