mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
First few patches applied
This commit is contained in:
1 parent
213abdb561
commit
bf7527d3cd
316 files changed
+1052
-9968
No files matched your search
@@ -1,18 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/Block.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/Block.java
|
||||
@@ -38,8 +38,9 @@
|
||||
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);
|
||||
@@ -119,6 +120,9 @@
|
||||
@@ -70,6 +70,9 @@
|
||||
private IBlockState defaultBlockState;
|
||||
private String unlocalizedName;
|
||||
|
||||
@@ -22,7 +10,7 @@
|
||||
public static int getIdFromBlock(Block blockIn)
|
||||
{
|
||||
return blockRegistry.getIDForObject(blockIn);
|
||||
@@ -132,7 +136,8 @@
|
||||
@@ -83,7 +86,8 @@
|
||||
|
||||
public static Block getBlockById(int id)
|
||||
{
|
||||
@@ -32,16 +20,16 @@
|
||||
}
|
||||
|
||||
public static IBlockState getStateById(int id)
|
||||
@@ -303,7 +308,7 @@
|
||||
@@ -268,7 +272,7 @@
|
||||
|
||||
public boolean isReplaceable(World worldIn, BlockPos pos)
|
||||
public boolean isReplaceable(IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
- return false;
|
||||
+ return getMaterial().isReplaceable();
|
||||
}
|
||||
|
||||
public Block setHardness(float hardness)
|
||||
@@ -340,9 +345,10 @@
|
||||
@@ -305,9 +309,10 @@
|
||||
return this.needsRandomTick;
|
||||
}
|
||||
|
||||
@@ -52,33 +40,8 @@
|
||||
+ return hasTileEntity(getDefaultState());
|
||||
}
|
||||
|
||||
public final void setBlockBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
|
||||
@@ -359,13 +365,13 @@
|
||||
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
|
||||
{
|
||||
@@ -376,7 +382,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)
|
||||
@@ -453,6 +459,10 @@
|
||||
public AxisAlignedBB func_185496_a(IBlockState p_185496_1_, IBlockAccess p_185496_2_, BlockPos p_185496_3_)
|
||||
@@ -472,6 +477,10 @@
|
||||
|
||||
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
|
||||
{
|
||||
@@ -89,17 +52,7 @@
|
||||
}
|
||||
|
||||
public int quantityDropped(Random random)
|
||||
@@ -467,8 +477,7 @@
|
||||
|
||||
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)
|
||||
@@ -478,20 +487,16 @@
|
||||
@@ -497,20 +506,16 @@
|
||||
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
||||
{
|
||||
@@ -125,7 +78,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -499,8 +504,13 @@
|
||||
@@ -518,8 +523,13 @@
|
||||
|
||||
public static void spawnAsEntity(World worldIn, BlockPos pos, ItemStack stack)
|
||||
{
|
||||
@@ -140,7 +93,7 @@
|
||||
float f = 0.5F;
|
||||
double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||
double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||
@@ -687,7 +697,7 @@
|
||||
@@ -588,7 +598,7 @@
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
{
|
||||
@@ -148,47 +101,8 @@
|
||||
+ return worldIn.getBlockState(pos).getBlock().isReplaceable(worldIn, pos);
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
@@ -799,25 +809,35 @@
|
||||
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)
|
||||
@@ -1010,6 +1030,1147 @@
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand side, ItemStack hitX, EnumFacing hitY, float hitZ, float p_180639_9_, float p_180639_10_)
|
||||
@@ -844,6 +854,1147 @@
|
||||
return "Block{" + blockRegistry.getNameForObject(this) + "}";
|
||||
}
|
||||
|
||||
|
||||
@@ -1,29 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockBanner.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockBanner.java
|
||||
@@ -85,22 +85,7 @@
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -133,6 +118,28 @@
|
||||
@@ -138,6 +138,28 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,4 +28,4 @@
|
||||
+
|
||||
public static class BlockBannerHanging extends BlockBanner
|
||||
{
|
||||
public BlockBannerHanging()
|
||||
protected static final AxisAlignedBB field_185551_d = new AxisAlignedBB(0.0D, 0.0D, 0.875D, 1.0D, 0.78125D, 1.0D);
|
||||
@@ -1,40 +1,18 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockBush.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockBush.java
|
||||
@@ -13,7 +13,7 @@
|
||||
@@ -14,7 +14,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
-public class BlockBush extends Block
|
||||
+public class BlockBush extends Block implements net.minecraftforge.common.IPlantable
|
||||
{
|
||||
protected BlockBush()
|
||||
{
|
||||
@@ -36,7 +36,7 @@
|
||||
protected static final AxisAlignedBB field_185515_b = new AxisAlignedBB(0.30000001192092896D, 0.0D, 0.30000001192092896D, 0.699999988079071D, 0.6000000238418579D, 0.699999988079071D);
|
||||
|
||||
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);
|
||||
@@ -90,6 +90,35 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean canPlaceBlockOn(Block ground)
|
||||
@@ -66,7 +66,10 @@
|
||||
|
||||
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)
|
||||
@@ -89,4 +92,33 @@
|
||||
{
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
@@ -63,4 +41,7 @@
|
||||
+ if (state.getBlock() != this) return getDefaultState();
|
||||
+ return state;
|
||||
+ }
|
||||
}
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BlockRenderLayer getBlockLayer()
|
||||
{
|
||||
@@ -1,12 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockButton.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockButton.java
|
||||
@@ -74,8 +74,7 @@
|
||||
|
||||
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)
|
||||
@@ -8,21 +8,11 @@
|
||||
+public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable
|
||||
{
|
||||
public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15);
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
}
|
||||
|
||||
Block block = worldIn.getBlockState(pos.down()).getBlock();
|
||||
- return block == Blocks.cactus || block == Blocks.sand;
|
||||
+ return block.canSustainPlant(worldIn, pos.down(), EnumFacing.UP, this);
|
||||
protected static final AxisAlignedBB field_185593_b = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.9375D, 0.9375D);
|
||||
@@ -135,6 +135,18 @@
|
||||
return ((Integer)state.getValue(AGE)).intValue();
|
||||
}
|
||||
|
||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn)
|
||||
@@ -137,4 +137,16 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {AGE});
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
@@ -34,4 +24,7 @@
|
||||
+ {
|
||||
+ return getDefaultState();
|
||||
+ }
|
||||
}
|
||||
+
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateContainer(this, new IProperty[] {AGE});
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockChest.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockChest.java
|
||||
@@ -527,7 +527,7 @@
|
||||
|
||||
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)
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java
|
||||
@@ -137,6 +137,13 @@
|
||||
@@ -131,6 +131,13 @@
|
||||
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
||||
{
|
||||
@@ -14,7 +14,7 @@
|
||||
int i = ((Integer)state.getValue(AGE)).intValue();
|
||||
int j = 1;
|
||||
|
||||
@@ -147,8 +154,9 @@
|
||||
@@ -141,8 +148,9 @@
|
||||
|
||||
for (int k = 0; k < j; ++k)
|
||||
{
|
||||
@@ -24,4 +24,4 @@
|
||||
+ return dropped;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_)
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockCrops.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java
|
||||
@@ -81,11 +81,11 @@
|
||||
@@ -116,11 +116,11 @@
|
||||
float f1 = 0.0F;
|
||||
IBlockState iblockstate = worldIn.getBlockState(blockpos.add(i, 0, j));
|
||||
|
||||
@@ -14,45 +14,10 @@
|
||||
{
|
||||
f1 = 3.0F;
|
||||
}
|
||||
@@ -126,7 +126,7 @@
|
||||
|
||||
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);
|
||||
@@ -174,6 +174,28 @@
|
||||
return Items.wheat;
|
||||
}
|
||||
|
||||
protected Item getSeed()
|
||||
@@ -142,24 +142,6 @@
|
||||
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)
|
||||
@@ -202,4 +184,26 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {AGE});
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
@@ -74,4 +39,7 @@
|
||||
+ }
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
+
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
||||
{
|
||||
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, 0);
|
||||
@@ -1,33 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDeadBush.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDeadBush.java
|
||||
@@ -14,7 +14,7 @@
|
||||
import net.minecraft.util.BlockPos;
|
||||
@@ -16,7 +16,7 @@
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class BlockDeadBush extends BlockBush
|
||||
+public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable
|
||||
{
|
||||
protected BlockDeadBush()
|
||||
{
|
||||
@@ -45,14 +45,15 @@
|
||||
protected static final AxisAlignedBB field_185516_a = new AxisAlignedBB(0.09999999403953552D, 0.0D, 0.09999999403953552D, 0.8999999761581421D, 0.800000011920929D, 0.8999999761581421D);
|
||||
|
||||
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)));
|
||||
+ }
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockDoor.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java
|
||||
@@ -154,7 +154,7 @@
|
||||
@@ -107,7 +107,7 @@
|
||||
{
|
||||
if (this.blockMaterial == Material.iron)
|
||||
{
|
||||
@@ -9,12 +9,3 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -272,7 +272,7 @@
|
||||
|
||||
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()
|
||||
@@ -9,7 +9,7 @@
|
||||
{
|
||||
public static final PropertyEnum<BlockDoublePlant.EnumPlantType> VARIANT = PropertyEnum.<BlockDoublePlant.EnumPlantType>create("variant", BlockDoublePlant.EnumPlantType.class);
|
||||
public static final PropertyEnum<BlockDoublePlant.EnumBlockHalf> HALF = PropertyEnum.<BlockDoublePlant.EnumBlockHalf>create("half", BlockDoublePlant.EnumBlockHalf.class);
|
||||
@@ -90,6 +90,8 @@
|
||||
@@ -88,6 +88,8 @@
|
||||
Block block = (Block)(flag ? this : worldIn.getBlockState(blockpos).getBlock());
|
||||
Block block1 = (Block)(flag ? worldIn.getBlockState(blockpos1).getBlock() : this);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
if (block == this)
|
||||
{
|
||||
worldIn.setBlockState(blockpos, Blocks.air.getDefaultState(), 2);
|
||||
@@ -98,17 +100,13 @@
|
||||
@@ -96,17 +98,13 @@
|
||||
if (block1 == this)
|
||||
{
|
||||
worldIn.setBlockState(blockpos1, Blocks.air.getDefaultState(), 3);
|
||||
@@ -37,24 +37,7 @@
|
||||
if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER)
|
||||
{
|
||||
return worldIn.getBlockState(pos.down()).getBlock() == this;
|
||||
@@ -158,7 +156,6 @@
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -221,8 +218,6 @@
|
||||
else
|
||||
{
|
||||
player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]);
|
||||
- int i = (blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS ? BlockTallGrass.EnumType.GRASS : BlockTallGrass.EnumType.FERN).getMeta();
|
||||
- spawnAsEntity(worldIn, pos, new ItemStack(Blocks.tallgrass, 2, i));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -293,6 +288,32 @@
|
||||
@@ -284,6 +282,32 @@
|
||||
return Block.EnumOffsetType.XZ;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFalling.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java
|
||||
@@ -86,6 +86,7 @@
|
||||
|
||||
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;
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java
|
||||
@@ -89,7 +89,7 @@
|
||||
@@ -87,7 +87,7 @@
|
||||
private boolean hasCrops(World worldIn, BlockPos pos)
|
||||
{
|
||||
Block block = worldIn.getBlockState(pos.up()).getBlock();
|
||||
|
||||
@@ -1,34 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFire.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFire.java
|
||||
@@ -41,18 +41,24 @@
|
||||
int j = pos.getY();
|
||||
int k = pos.getZ();
|
||||
|
||||
- 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
|
||||
{
|
||||
@@ -108,6 +114,7 @@
|
||||
@@ -90,6 +90,7 @@
|
||||
|
||||
public void setFireInfo(Block blockIn, int encouragement, int flammability)
|
||||
{
|
||||
@@ -36,22 +8,7 @@
|
||||
this.encouragements.put(blockIn, Integer.valueOf(encouragement));
|
||||
this.flammabilities.put(blockIn, Integer.valueOf(flammability));
|
||||
}
|
||||
@@ -147,13 +154,8 @@
|
||||
}
|
||||
|
||||
Block block = worldIn.getBlockState(pos.down()).getBlock();
|
||||
- boolean flag = block == Blocks.netherrack;
|
||||
+ boolean flag = block.isFireSource(worldIn, pos.down(), EnumFacing.UP);
|
||||
|
||||
- if (worldIn.provider instanceof WorldProviderEnd && block == Blocks.bedrock)
|
||||
- {
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
if (!flag && worldIn.isRaining() && this.canDie(worldIn, pos))
|
||||
{
|
||||
worldIn.setBlockToAir(pos);
|
||||
@@ -182,7 +184,7 @@
|
||||
@@ -164,7 +165,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -60,7 +17,7 @@
|
||||
{
|
||||
worldIn.setBlockToAir(pos);
|
||||
return;
|
||||
@@ -197,12 +199,12 @@
|
||||
@@ -179,12 +180,12 @@
|
||||
j = -50;
|
||||
}
|
||||
|
||||
@@ -79,7 +36,7 @@
|
||||
|
||||
for (int k = -1; k <= 1; ++k)
|
||||
{
|
||||
@@ -261,22 +263,30 @@
|
||||
@@ -243,22 +244,30 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -111,7 +68,7 @@
|
||||
if (random.nextInt(chance) < i)
|
||||
{
|
||||
IBlockState iblockstate = worldIn.getBlockState(pos);
|
||||
@@ -308,7 +318,7 @@
|
||||
@@ -290,7 +299,7 @@
|
||||
{
|
||||
for (EnumFacing enumfacing : EnumFacing.values())
|
||||
{
|
||||
@@ -120,7 +77,7 @@
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -329,7 +339,7 @@
|
||||
@@ -311,7 +320,7 @@
|
||||
|
||||
for (EnumFacing enumfacing : EnumFacing.values())
|
||||
{
|
||||
@@ -129,7 +86,7 @@
|
||||
}
|
||||
|
||||
return i;
|
||||
@@ -341,9 +351,10 @@
|
||||
@@ -323,9 +332,10 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -141,57 +98,9 @@
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
@@ -382,9 +393,9 @@
|
||||
worldIn.playSound((double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), "fire.fire", 1.0F + rand.nextFloat(), rand.nextFloat() * 0.7F + 0.3F, false);
|
||||
}
|
||||
|
||||
- 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)
|
||||
{
|
||||
@@ -395,7 +406,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.fire.canCatchFire(worldIn, pos.east()))
|
||||
+ if (Blocks.fire.canCatchFire(worldIn, pos.east(), EnumFacing.WEST))
|
||||
{
|
||||
for (int k = 0; k < 2; ++k)
|
||||
{
|
||||
@@ -406,7 +417,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.fire.canCatchFire(worldIn, pos.north()))
|
||||
+ if (Blocks.fire.canCatchFire(worldIn, pos.north(), EnumFacing.SOUTH))
|
||||
{
|
||||
for (int l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -417,7 +428,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.fire.canCatchFire(worldIn, pos.south()))
|
||||
+ if (Blocks.fire.canCatchFire(worldIn, pos.south(), EnumFacing.NORTH))
|
||||
{
|
||||
for (int i1 = 0; i1 < 2; ++i1)
|
||||
{
|
||||
@@ -428,7 +439,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (Blocks.fire.canCatchFire(worldIn, pos.up()))
|
||||
+ if (Blocks.fire.canCatchFire(worldIn, pos.up(), EnumFacing.DOWN))
|
||||
{
|
||||
for (int j1 = 0; j1 < 2; ++j1)
|
||||
{
|
||||
@@ -476,4 +487,19 @@
|
||||
@@ -458,4 +468,19 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {AGE, NORTH, EAST, SOUTH, WEST, UPPER, FLIP, ALT});
|
||||
return new BlockStateContainer(this, new IProperty[] {AGE, NORTH, EAST, SOUTH, WEST, UPPER});
|
||||
}
|
||||
+
|
||||
+ /*================================= Forge Start ======================================*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java
|
||||
@@ -169,13 +169,6 @@
|
||||
@@ -148,13 +148,6 @@
|
||||
|
||||
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
|
||||
{
|
||||
@@ -14,8 +14,8 @@
|
||||
super.breakBlock(worldIn, pos, state);
|
||||
}
|
||||
|
||||
@@ -395,6 +388,31 @@
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
@@ -374,6 +367,31 @@
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
+
|
||||
|
||||
@@ -1,24 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockGrass.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java
|
||||
@@ -58,7 +58,7 @@
|
||||
{
|
||||
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());
|
||||
}
|
||||
@@ -72,7 +72,7 @@
|
||||
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());
|
||||
}
|
||||
@@ -110,7 +110,7 @@
|
||||
@@ -96,7 +96,7 @@
|
||||
{
|
||||
if (j >= i / 16)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockHugeMushroom.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockHugeMushroom.java
|
||||
@@ -79,6 +79,20 @@
|
||||
return new BlockState(this, new IProperty[] {VARIANT});
|
||||
@@ -221,6 +221,20 @@
|
||||
return new BlockStateContainer(this, new IProperty[] {VARIANT});
|
||||
}
|
||||
|
||||
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockIce.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockIce.java
|
||||
@@ -38,14 +38,17 @@
|
||||
player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]);
|
||||
player.addExhaustion(0.025F);
|
||||
|
||||
- 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
|
||||
{
|
||||
@@ -56,7 +59,9 @@
|
||||
}
|
||||
|
||||
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())
|
||||
@@ -1,29 +1,8 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLadder.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java
|
||||
@@ -78,7 +78,10 @@
|
||||
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
@@ -139,4 +139,6 @@
|
||||
{
|
||||
- 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)
|
||||
@@ -116,7 +119,7 @@
|
||||
|
||||
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)
|
||||
@@ -146,4 +149,6 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {FACING});
|
||||
return new BlockStateContainer(this, new IProperty[] {FACING});
|
||||
}
|
||||
+
|
||||
+ @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; }
|
||||
|
||||
@@ -1,39 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java
|
||||
@@ -18,7 +18,7 @@
|
||||
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");
|
||||
@@ -75,9 +75,9 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,9 +117,9 @@
|
||||
{
|
||||
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;
|
||||
}
|
||||
@@ -226,40 +226,7 @@
|
||||
@@ -205,40 +205,7 @@
|
||||
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
||||
{
|
||||
@@ -75,11 +42,10 @@
|
||||
}
|
||||
|
||||
protected void dropApple(World worldIn, BlockPos pos, IBlockState state, int chance)
|
||||
@@ -296,4 +263,48 @@
|
||||
}
|
||||
@@ -274,6 +241,50 @@
|
||||
|
||||
public abstract BlockPlanks.EnumType getWoodType(int meta);
|
||||
+
|
||||
|
||||
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
|
||||
+ @Override public boolean isLeaves(IBlockAccess world, BlockPos pos){ return true; }
|
||||
+
|
||||
@@ -123,4 +89,7 @@
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
}
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockState worldIn, IBlockAccess pos, BlockPos side, EnumFacing p_176225_4_)
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLever.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLever.java
|
||||
@@ -237,6 +237,12 @@
|
||||
return new BlockState(this, new IProperty[] {FACING, POWERED});
|
||||
@@ -295,6 +295,12 @@
|
||||
return new BlockStateContainer(this, new IProperty[] {FACING, POWERED});
|
||||
}
|
||||
|
||||
+
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockLog.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLog.java
|
||||
@@ -33,9 +33,9 @@
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -69,6 +69,9 @@
|
||||
}
|
||||
@@ -46,6 +46,9 @@
|
||||
return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(LOG_AXIS, BlockLog.EnumAxis.fromFacingAxis(facing.getAxis()));
|
||||
}
|
||||
|
||||
+ @Override public boolean canSustainLeaves(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java
|
||||
@@ -37,10 +37,14 @@
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
||||
{
|
||||
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;
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java
|
||||
@@ -71,7 +71,7 @@
|
||||
if (pos.getY() >= 0 && pos.getY() < 256)
|
||||
{
|
||||
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
|
||||
{
|
||||
@@ -1,20 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockMycelium.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java
|
||||
@@ -39,7 +39,7 @@
|
||||
{
|
||||
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));
|
||||
}
|
||||
@@ -53,7 +53,7 @@
|
||||
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());
|
||||
}
|
||||
@@ -1,15 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockNetherWart.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
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)
|
||||
@@ -54,9 +54,11 @@
|
||||
@@ -58,9 +58,11 @@
|
||||
super.updateTick(worldIn, pos, state, rand);
|
||||
}
|
||||
|
||||
@@ -22,11 +13,10 @@
|
||||
{
|
||||
int i = 1;
|
||||
|
||||
@@ -107,4 +109,24 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {AGE});
|
||||
@@ -106,6 +108,26 @@
|
||||
return ((Integer)state.getValue(AGE)).intValue();
|
||||
}
|
||||
+
|
||||
|
||||
+ @Override
|
||||
+ public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
||||
+ {
|
||||
@@ -46,4 +36,7 @@
|
||||
+
|
||||
+ return ret;
|
||||
+ }
|
||||
}
|
||||
+
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateContainer(this, new IProperty[] {AGE});
|
||||
@@ -1,24 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockNewLeaf.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNewLeaf.java
|
||||
@@ -99,14 +99,15 @@
|
||||
|
||||
public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te)
|
||||
{
|
||||
- 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)));
|
||||
+ }
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockNote.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNote.java
|
||||
@@ -58,7 +58,9 @@
|
||||
@@ -64,7 +64,9 @@
|
||||
if (tileentity instanceof TileEntityNote)
|
||||
{
|
||||
TileEntityNote tileentitynote = (TileEntityNote)tileentity;
|
||||
@@ -8,9 +8,9 @@
|
||||
tileentitynote.changePitch();
|
||||
+ if (old == tileentitynote.note) return false;
|
||||
tileentitynote.triggerNote(worldIn, pos);
|
||||
playerIn.triggerAchievement(StatList.field_181735_S);
|
||||
playerIn.triggerAchievement(StatList.field_188087_U);
|
||||
}
|
||||
@@ -98,6 +100,10 @@
|
||||
@@ -104,6 +106,10 @@
|
||||
|
||||
public boolean onBlockEventReceived(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam)
|
||||
{
|
||||
@@ -19,5 +19,5 @@
|
||||
+ eventID = e.instrument.ordinal();
|
||||
+ eventParam = e.getVanillaNoteId();
|
||||
float f = (float)Math.pow(2.0D, (double)(eventParam - 12) / 12.0D);
|
||||
worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "note." + this.getInstrument(eventID), 3.0F, f);
|
||||
worldIn.func_184133_a((EntityPlayer)null, pos, this.func_185576_e(eventID), SoundCategory.BLOCKS, 3.0F, f);
|
||||
worldIn.spawnParticle(EnumParticleTypes.NOTE, (double)pos.getX() + 0.5D, (double)pos.getY() + 1.2D, (double)pos.getZ() + 0.5D, (double)eventParam / 24.0D, 0.0D, 0.0D, new int[0]);
|
||||
@@ -1,21 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockOldLeaf.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockOldLeaf.java
|
||||
@@ -142,11 +142,17 @@
|
||||
if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears)
|
||||
{
|
||||
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())));
|
||||
+ }
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockOre.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockOre.java
|
||||
@@ -58,34 +58,40 @@
|
||||
@@ -59,34 +59,40 @@
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
||||
{
|
||||
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
|
||||
@@ -48,4 +48,4 @@
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
public int getDamageValue(World worldIn, BlockPos pos)
|
||||
public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_)
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPane.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPane.java
|
||||
@@ -38,7 +38,10 @@
|
||||
@@ -105,7 +105,10 @@
|
||||
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
@@ -12,24 +12,9 @@
|
||||
}
|
||||
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune)
|
||||
@@ -64,10 +67,10 @@
|
||||
|
||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity)
|
||||
@@ -182,4 +185,11 @@
|
||||
{
|
||||
- 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))
|
||||
{
|
||||
@@ -186,4 +189,11 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {NORTH, EAST, WEST, SOUTH});
|
||||
return new BlockStateContainer(this, new IProperty[] {NORTH, EAST, WEST, SOUTH});
|
||||
}
|
||||
+
|
||||
+ public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir)
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java
|
||||
@@ -189,7 +189,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- 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);
|
||||
}
|
||||
@@ -333,7 +333,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
- return !(blockIn instanceof ITileEntityProvider);
|
||||
+ return !(blockIn.hasTileEntity(worldIn.getBlockState(pos)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -371,7 +371,9 @@
|
||||
{
|
||||
BlockPos blockpos = (BlockPos)list1.get(j);
|
||||
Block block = worldIn.getBlockState(blockpos).getBlock();
|
||||
- block.dropBlockAsItem(worldIn, blockpos, worldIn.getBlockState(blockpos), 0);
|
||||
+ //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;
|
||||
@@ -1,26 +1,8 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPistonMoving.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonMoving.java
|
||||
@@ -109,16 +109,7 @@
|
||||
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
||||
@@ -190,4 +190,16 @@
|
||||
{
|
||||
- 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)
|
||||
@@ -282,4 +273,16 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {FACING, TYPE});
|
||||
return new BlockStateContainer(this, new IProperty[] {FACING, TYPE});
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPotato.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPotato.java
|
||||
@@ -22,13 +22,14 @@
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
||||
{
|
||||
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;
|
||||
+ }
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockPumpkin.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java
|
||||
@@ -115,7 +115,7 @@
|
||||
|
||||
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)
|
||||
@@ -1,7 +1,7 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockQuartz.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockQuartz.java
|
||||
@@ -90,6 +90,26 @@
|
||||
return new BlockState(this, new IProperty[] {VARIANT});
|
||||
@@ -113,6 +113,26 @@
|
||||
return new BlockStateContainer(this, new IProperty[] {VARIANT});
|
||||
}
|
||||
|
||||
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java
|
||||
@@ -31,7 +31,7 @@
|
||||
@@ -32,7 +32,7 @@
|
||||
public static boolean isRailBlock(IBlockState state)
|
||||
{
|
||||
Block block = state.getBlock();
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
protected BlockRailBase(boolean isPowered)
|
||||
@@ -175,6 +175,81 @@
|
||||
@@ -160,6 +160,81 @@
|
||||
|
||||
public abstract IProperty<BlockRailBase.EnumRailDirection> getShapeProperty();
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
public static enum EnumRailDirection implements IStringSerializable
|
||||
{
|
||||
NORTH_SOUTH(0, "north_south"),
|
||||
@@ -245,6 +320,7 @@
|
||||
@@ -230,6 +305,7 @@
|
||||
private IBlockState state;
|
||||
private final boolean isPowered;
|
||||
private final List<BlockPos> field_150657_g = Lists.<BlockPos>newArrayList();
|
||||
@@ -99,17 +99,7 @@
|
||||
|
||||
public Rail(World worldIn, BlockPos pos, IBlockState state)
|
||||
{
|
||||
@@ -253,7 +329,8 @@
|
||||
this.state = state;
|
||||
this.block = (BlockRailBase)state.getBlock();
|
||||
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)state.getValue(BlockRailBase.this.getShapeProperty());
|
||||
- this.isPowered = this.block.isPowered;
|
||||
+ this.isPowered = !this.block.isFlexibleRail(worldIn, pos);
|
||||
+ canMakeSlopes = this.block.canMakeSlopes(worldIn, pos);
|
||||
this.func_180360_a(blockrailbase$enumraildirection);
|
||||
}
|
||||
|
||||
@@ -439,7 +516,7 @@
|
||||
@@ -429,7 +505,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +108,7 @@
|
||||
{
|
||||
if (BlockRailBase.isRailBlock(this.world, blockpos.up()))
|
||||
{
|
||||
@@ -452,7 +529,7 @@
|
||||
@@ -442,7 +518,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +117,7 @@
|
||||
{
|
||||
if (BlockRailBase.isRailBlock(this.world, blockpos3.up()))
|
||||
{
|
||||
@@ -595,7 +672,7 @@
|
||||
@@ -585,7 +661,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +126,7 @@
|
||||
{
|
||||
if (BlockRailBase.isRailBlock(this.world, blockpos.up()))
|
||||
{
|
||||
@@ -608,7 +685,7 @@
|
||||
@@ -598,7 +674,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneComparator.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneComparator.java
|
||||
@@ -295,6 +295,21 @@
|
||||
return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()).withProperty(POWERED, Boolean.valueOf(false)).withProperty(MODE, BlockRedstoneComparator.Mode.COMPARE);
|
||||
@@ -310,6 +310,21 @@
|
||||
return this.getDefaultState().withProperty(field_185512_D, placer.getHorizontalFacing().getOpposite()).withProperty(POWERED, Boolean.valueOf(false)).withProperty(MODE, BlockRedstoneComparator.Mode.COMPARE);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneDiode.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneDiode.java
|
||||
@@ -198,6 +198,8 @@
|
||||
@@ -204,6 +204,8 @@
|
||||
{
|
||||
EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
|
||||
EnumFacing enumfacing = (EnumFacing)state.getValue(field_185512_D);
|
||||
BlockPos blockpos = pos.offset(enumfacing.getOpposite());
|
||||
+ if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(worldIn, pos, worldIn.getBlockState(pos), java.util.EnumSet.of(enumfacing.getOpposite())).isCanceled())
|
||||
+ return;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java
|
||||
@@ -91,12 +91,16 @@
|
||||
@@ -92,12 +92,16 @@
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
||||
{
|
||||
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java
|
||||
@@ -58,10 +58,10 @@
|
||||
BlockPos blockpos = pos.offset(direction);
|
||||
Block block = worldIn.getBlockState(pos.offset(direction)).getBlock();
|
||||
|
||||
- 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
|
||||
{
|
||||
@@ -359,35 +359,24 @@
|
||||
Block block = iblockstate.getBlock();
|
||||
boolean flag = block.isNormalCube();
|
||||
boolean flag1 = worldIn.getBlockState(pos.up()).getBlock().isNormalCube();
|
||||
- return !flag1 && flag && canConnectUpwardsTo(worldIn, blockpos.up()) ? true : (canConnectTo(iblockstate, side) ? true : (block == Blocks.powered_repeater && iblockstate.getValue(BlockRedstoneDiode.FACING) == side ? true : !flag && canConnectUpwardsTo(worldIn, blockpos.down())));
|
||||
+ return !flag1 && flag && canRestoneConnect(worldIn, blockpos.up(), null) ? true : (canRestoneConnect(worldIn, blockpos, side) ? true : (block == Blocks.powered_repeater && iblockstate.getValue(BlockRedstoneDiode.FACING) == side ? true : !flag && canRestoneConnect(worldIn, blockpos.down(), null)));
|
||||
}
|
||||
|
||||
- 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockReed.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockReed.java
|
||||
@@ -18,7 +18,7 @@
|
||||
@@ -19,7 +19,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
+public class BlockReed extends Block implements net.minecraftforge.common.IPlantable
|
||||
{
|
||||
public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15);
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
protected static final AxisAlignedBB field_185701_b = new AxisAlignedBB(0.125D, 0.0D, 0.125D, 0.875D, 1.0D, 0.875D);
|
||||
@@ -70,6 +70,7 @@
|
||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
||||
{
|
||||
Block block = worldIn.getBlockState(pos.down()).getBlock();
|
||||
@@ -17,11 +17,10 @@
|
||||
|
||||
if (block == this)
|
||||
{
|
||||
@@ -164,4 +165,15 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {AGE});
|
||||
@@ -162,6 +163,17 @@
|
||||
return ((Integer)state.getValue(AGE)).intValue();
|
||||
}
|
||||
+
|
||||
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
|
||||
+ {
|
||||
@@ -32,4 +31,7 @@
|
||||
+ {
|
||||
+ return this.getDefaultState();
|
||||
+ }
|
||||
}
|
||||
+
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateContainer(this, new IProperty[] {AGE});
|
||||
@@ -1,10 +1,9 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockRotatedPillar.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRotatedPillar.java
|
||||
@@ -18,4 +18,18 @@
|
||||
{
|
||||
@@ -28,6 +28,20 @@
|
||||
super(p_i46385_1_, p_i46385_2_);
|
||||
}
|
||||
+
|
||||
|
||||
+ public boolean rotateBlock(net.minecraft.world.World world, net.minecraft.util.BlockPos pos, EnumFacing axis)
|
||||
+ {
|
||||
+ net.minecraft.block.state.IBlockState state = world.getBlockState(pos);
|
||||
@@ -18,4 +17,7 @@
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
}
|
||||
+
|
||||
public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_)
|
||||
{
|
||||
switch (p_185499_2_)
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockSapling.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java
|
||||
@@ -71,6 +71,7 @@
|
||||
@@ -77,6 +77,7 @@
|
||||
|
||||
public void generateTree(World worldIn, BlockPos pos, IBlockState state, Random rand)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockSkull.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSkull.java
|
||||
@@ -121,10 +121,6 @@
|
||||
return tileentity instanceof TileEntitySkull ? ((TileEntitySkull)tileentity).getSkullType() : super.getDamageValue(worldIn, pos);
|
||||
@@ -116,10 +116,6 @@
|
||||
return new ItemStack(Items.skull, 1, i);
|
||||
}
|
||||
|
||||
- public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
||||
@@ -11,7 +11,7 @@
|
||||
public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player)
|
||||
{
|
||||
if (player.capabilities.isCreativeMode)
|
||||
@@ -132,13 +128,18 @@
|
||||
@@ -127,13 +123,18 @@
|
||||
state = state.withProperty(NODROP, Boolean.valueOf(true));
|
||||
worldIn.setBlockState(pos, state, 4);
|
||||
}
|
||||
@@ -31,16 +31,7 @@
|
||||
{
|
||||
if (!((Boolean)state.getValue(NODROP)).booleanValue())
|
||||
{
|
||||
@@ -147,7 +148,7 @@
|
||||
if (tileentity instanceof TileEntitySkull)
|
||||
{
|
||||
TileEntitySkull tileentityskull = (TileEntitySkull)tileentity;
|
||||
- ItemStack itemstack = new ItemStack(Items.skull, 1, this.getDamageValue(worldIn, pos));
|
||||
+ ItemStack itemstack = new ItemStack(Items.skull, 1, tileentityskull.getSkullType());
|
||||
|
||||
if (tileentityskull.getSkullType() == 3 && tileentityskull.getPlayerProfile() != null)
|
||||
{
|
||||
@@ -157,12 +158,11 @@
|
||||
@@ -152,12 +153,11 @@
|
||||
itemstack.getTagCompound().setTag("SkullOwner", nbttagcompound);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockSlab.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSlab.java
|
||||
@@ -91,6 +91,17 @@
|
||||
@@ -50,6 +50,17 @@
|
||||
return this.isDouble();
|
||||
}
|
||||
|
||||
@@ -18,21 +18,3 @@
|
||||
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||
{
|
||||
IBlockState iblockstate = super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM);
|
||||
@@ -118,15 +129,8 @@
|
||||
{
|
||||
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)
|
||||
@@ -1,15 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockSnow.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java
|
||||
@@ -79,7 +79,7 @@
|
||||
{
|
||||
IBlockState iblockstate = worldIn.getBlockState(pos.down());
|
||||
Block block = iblockstate.getBlock();
|
||||
- return block != Blocks.ice && block != Blocks.packed_ice ? (block.getMaterial() == Material.leaves ? true : (block == this && ((Integer)iblockstate.getValue(LAYERS)).intValue() >= 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false;
|
||||
+ return block != Blocks.ice && block != Blocks.packed_ice ? (block.isLeaves(worldIn, pos.down()) ? true : (block == this && ((Integer)iblockstate.getValue(LAYERS)).intValue() >= 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false;
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock)
|
||||
@@ -91,7 +91,6 @@
|
||||
@@ -85,7 +85,6 @@
|
||||
{
|
||||
if (!this.canPlaceBlockAt(worldIn, pos))
|
||||
{
|
||||
@@ -17,18 +8,7 @@
|
||||
worldIn.setBlockToAir(pos);
|
||||
return false;
|
||||
}
|
||||
@@ -103,9 +102,8 @@
|
||||
|
||||
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)
|
||||
@@ -115,14 +113,13 @@
|
||||
@@ -109,14 +108,13 @@
|
||||
|
||||
public int quantityDropped(Random random)
|
||||
{
|
||||
@@ -44,10 +24,12 @@
|
||||
worldIn.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
@@ -152,4 +149,6 @@
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {LAYERS});
|
||||
@@ -150,6 +148,8 @@
|
||||
return ((Integer)state.getValue(LAYERS)).intValue() - 1;
|
||||
}
|
||||
+
|
||||
|
||||
+ @Override public int quantityDropped(IBlockState state, int fortune, Random random){ return ((Integer)state.getValue(LAYERS)) + 1; }
|
||||
}
|
||||
+
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateContainer(this, new IProperty[] {LAYERS});
|
||||
@@ -1,22 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockStairs.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockStairs.java
|
||||
@@ -68,6 +68,19 @@
|
||||
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;
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockStem.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockStem.java
|
||||
@@ -94,7 +94,7 @@
|
||||
@@ -91,7 +91,7 @@
|
||||
pos = pos.offset(EnumFacing.Plane.HORIZONTAL.random(rand));
|
||||
Block block = worldIn.getBlockState(pos.down()).getBlock();
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
{
|
||||
worldIn.setBlockState(pos, this.crop.getDefaultState());
|
||||
}
|
||||
@@ -148,8 +148,12 @@
|
||||
@@ -109,8 +109,12 @@
|
||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
||||
{
|
||||
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
|
||||
@@ -23,7 +23,7 @@
|
||||
{
|
||||
Item item = this.getSeedItem();
|
||||
|
||||
@@ -159,13 +163,14 @@
|
||||
@@ -120,13 +124,14 @@
|
||||
|
||||
for (int j = 0; j < 3; ++j)
|
||||
{
|
||||
|
||||
@@ -8,17 +8,8 @@
|
||||
+public class BlockTallGrass extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable
|
||||
{
|
||||
public static final PropertyEnum<BlockTallGrass.EnumType> TYPE = PropertyEnum.<BlockTallGrass.EnumType>create("type", BlockTallGrass.EnumType.class);
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
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)
|
||||
@@ -53,7 +53,7 @@
|
||||
protected static final AxisAlignedBB field_185522_c = new AxisAlignedBB(0.09999999403953552D, 0.0D, 0.09999999403953552D, 0.8999999761581421D, 0.800000011920929D, 0.8999999761581421D);
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune)
|
||||
{
|
||||
@@ -27,21 +18,7 @@
|
||||
}
|
||||
|
||||
public int quantityDroppedWithBonus(int fortune, Random random)
|
||||
@@ -63,13 +63,7 @@
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -204,4 +198,22 @@
|
||||
@@ -181,4 +181,22 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockTorch.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTorch.java
|
||||
@@ -63,7 +63,7 @@
|
||||
@@ -86,7 +86,7 @@
|
||||
else
|
||||
{
|
||||
Block block = worldIn.getBlockState(pos).getBlock();
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
@@ -107,7 +107,7 @@
|
||||
{
|
||||
BlockPos blockpos = pos.offset(facing.getOpposite());
|
||||
boolean flag = facing.getAxis().isHorizontal();
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
|
||||
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||
@@ -97,7 +97,7 @@
|
||||
@@ -120,7 +120,7 @@
|
||||
{
|
||||
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
|
||||
{
|
||||
@@ -27,7 +27,7 @@
|
||||
{
|
||||
return this.getDefaultState().withProperty(FACING, enumfacing);
|
||||
}
|
||||
@@ -130,7 +130,7 @@
|
||||
@@ -153,7 +153,7 @@
|
||||
EnumFacing enumfacing1 = enumfacing.getOpposite();
|
||||
boolean flag = false;
|
||||
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockTrapDoor.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTrapDoor.java
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
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);
|
||||
@@ -140,9 +142,10 @@
|
||||
{
|
||||
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);
|
||||
@@ -186,7 +189,10 @@
|
||||
|
||||
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)
|
||||
@@ -223,6 +229,7 @@
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockTripWireHook.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTripWireHook.java
|
||||
@@ -58,14 +58,14 @@
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -99,7 +99,7 @@
|
||||
{
|
||||
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);
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/BlockVine.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/BlockVine.java
|
||||
@@ -25,7 +25,7 @@
|
||||
@@ -26,7 +26,7 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -9,21 +9,7 @@
|
||||
{
|
||||
public static final PropertyBool UP = PropertyBool.create("up");
|
||||
public static final PropertyBool NORTH = PropertyBool.create("north");
|
||||
@@ -387,13 +387,7 @@
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -474,4 +468,14 @@
|
||||
@@ -457,4 +457,14 @@
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java
|
||||
@@ -78,7 +78,7 @@
|
||||
{
|
||||
Block block = this.world.getBlockState(origin).getBlock();
|
||||
|
||||
- if (block.getMaterial() == Material.air)
|
||||
+ if (block.isAir(world, origin))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -109,7 +109,7 @@
|
||||
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;
|
||||
}
|
||||
@@ -156,7 +156,7 @@
|
||||
|
||||
block = this.world.getBlockState(blockpos1).getBlock();
|
||||
|
||||
- if (block.getMaterial() == Material.air)
|
||||
+ if (block.isAir(world, blockpos1))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/state/BlockState.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/state/BlockState.java
|
||||
@@ -38,6 +38,16 @@
|
||||
|
||||
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>()
|
||||
{
|
||||
@@ -53,7 +63,7 @@
|
||||
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);
|
||||
}
|
||||
@@ -132,6 +142,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ 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))
|
||||
@@ -199,5 +216,10 @@
|
||||
map.put(property, value);
|
||||
return map;
|
||||
}
|
||||
+
|
||||
+ public ImmutableTable<IProperty, Comparable, IBlockState> getPropertyValueTable()
|
||||
+ {
|
||||
+ return propertyValueTable;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/block/state/BlockStateBase.java
|
||||
+++ ../src-work/minecraft/net/minecraft/block/state/BlockStateBase.java
|
||||
@@ -67,4 +67,9 @@
|
||||
@@ -71,4 +71,9 @@
|
||||
|
||||
return stringbuilder.toString();
|
||||
}
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
+ if (!net.minecraftforge.fml.client.FMLClientHandler.instance().handleLoadingScreen(scaledresolution)) //FML Don't render while FML's pre-screen is rendering
|
||||
+ {
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
||||
VertexBuffer vertexbuffer = tessellator.getWorldRenderer();
|
||||
this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
|
||||
@@ -174,6 +178,12 @@
|
||||
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||
GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||
this.mc.fontRendererObj.drawStringWithShadow(this.currentlyDisplayedText, (float)((k - this.mc.fontRendererObj.getStringWidth(this.currentlyDisplayedText)) / 2), (float)(l / 2 - 4 - 16), 16777215);
|
||||
this.mc.fontRendererObj.drawStringWithShadow(this.message, (float)((k - this.mc.fontRendererObj.getStringWidth(this.message)) / 2), (float)(l / 2 - 4 + 8), 16777215);
|
||||
+ }
|
||||
|
||||
@@ -1,27 +1,14 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/Minecraft.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/Minecraft.java
|
||||
@@ -301,7 +301,6 @@
|
||||
this.sessionService = (new YggdrasilAuthenticationService(gameConfig.userInfo.proxy, UUID.randomUUID().toString())).createMinecraftSessionService();
|
||||
@@ -318,7 +318,6 @@
|
||||
this.sessionService = (new YggdrasilAuthenticationService(this.proxy, UUID.randomUUID().toString())).createMinecraftSessionService();
|
||||
this.session = gameConfig.userInfo.session;
|
||||
logger.info("Setting user: " + this.session.getUsername());
|
||||
- logger.info("(Session ID is " + this.session.getSessionID() + ")");
|
||||
this.isDemo = gameConfig.gameInfo.isDemo;
|
||||
this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1;
|
||||
this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1;
|
||||
@@ -415,10 +414,10 @@
|
||||
this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_);
|
||||
this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language);
|
||||
this.mcResourceManager.registerReloadListener(this.mcLanguageManager);
|
||||
- this.refreshResources();
|
||||
+ net.minecraftforge.fml.client.FMLClientHandler.instance().beginMinecraftLoading(this, this.defaultResourcePacks, this.mcResourceManager);
|
||||
this.renderEngine = new TextureManager(this.mcResourceManager);
|
||||
this.mcResourceManager.registerReloadListener(this.renderEngine);
|
||||
- this.drawSplashScreen(this.renderEngine);
|
||||
+ net.minecraftforge.fml.client.SplashProgress.drawVanillaScreen(this.renderEngine);
|
||||
this.initStream();
|
||||
this.skinManager = new SkinManager(this.renderEngine, new File(this.fileAssets, "skins"), this.sessionService);
|
||||
this.saveLoader = new AnvilSaveConverter(new File(this.mcDataDir, "saves"));
|
||||
@@ -453,6 +452,8 @@
|
||||
@@ -469,6 +468,8 @@
|
||||
}
|
||||
});
|
||||
this.mouseHelper = new MouseHelper();
|
||||
@@ -30,59 +17,7 @@
|
||||
this.checkGLError("Pre startup");
|
||||
GlStateManager.enableTexture2D();
|
||||
GlStateManager.shadeModel(7425);
|
||||
@@ -466,17 +467,21 @@
|
||||
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);
|
||||
@@ -486,22 +491,25 @@
|
||||
this.guiAchievement = new GuiAchievement(this);
|
||||
GlStateManager.viewport(0, 0, this.displayWidth, this.displayHeight);
|
||||
this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine);
|
||||
+ 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();
|
||||
@@ -681,21 +689,23 @@
|
||||
@@ -692,21 +693,23 @@
|
||||
File file2 = new File(file1, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt");
|
||||
Bootstrap.printToSYSOUT(crashReportIn.getCompleteReport());
|
||||
|
||||
@@ -109,7 +44,7 @@
|
||||
}
|
||||
|
||||
public boolean isUnicode()
|
||||
@@ -883,11 +893,6 @@
|
||||
@@ -899,11 +902,6 @@
|
||||
|
||||
public void displayGuiScreen(GuiScreen guiScreenIn)
|
||||
{
|
||||
@@ -121,25 +56,7 @@
|
||||
if (guiScreenIn == null && this.theWorld == null)
|
||||
{
|
||||
guiScreenIn = new GuiMainMenu();
|
||||
@@ -897,6 +902,17 @@
|
||||
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;
|
||||
@@ -1030,9 +1046,11 @@
|
||||
@@ -1051,9 +1049,11 @@
|
||||
|
||||
if (!this.skipRenderWorld)
|
||||
{
|
||||
@@ -151,47 +68,7 @@
|
||||
}
|
||||
|
||||
this.mcProfiler.endSection();
|
||||
@@ -1377,7 +1395,7 @@
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -1463,15 +1481,19 @@
|
||||
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)
|
||||
{
|
||||
@@ -1494,7 +1516,8 @@
|
||||
{
|
||||
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();
|
||||
}
|
||||
@@ -1598,6 +1621,8 @@
|
||||
@@ -1623,6 +1623,8 @@
|
||||
--this.rightClickDelayTimer;
|
||||
}
|
||||
|
||||
@@ -200,48 +77,23 @@
|
||||
this.mcProfiler.startSection("gui");
|
||||
|
||||
if (!this.isGamePaused)
|
||||
@@ -1690,6 +1715,8 @@
|
||||
|
||||
while (Mouse.next())
|
||||
{
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue;
|
||||
+
|
||||
int i = Mouse.getEventButton();
|
||||
KeyBinding.setKeyBindState(i - 100, Mouse.getEventButtonState());
|
||||
|
||||
@@ -1745,6 +1772,7 @@
|
||||
this.currentScreen.handleMouseInput();
|
||||
}
|
||||
@@ -1734,6 +1736,7 @@
|
||||
this.joinPlayerCounter = 0;
|
||||
this.theWorld.joinEntityInSurroundings(this.thePlayer);
|
||||
}
|
||||
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireMouseInput();
|
||||
}
|
||||
|
||||
if (this.leftClickCounter > 0)
|
||||
@@ -1923,6 +1951,7 @@
|
||||
}
|
||||
this.mcProfiler.endStartSection("gameRenderer");
|
||||
@@ -1926,6 +1929,7 @@
|
||||
this.gameSettings.showLagometer = this.gameSettings.showDebugInfo && GuiScreen.isAltKeyDown();
|
||||
}
|
||||
}
|
||||
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireKeyInput();
|
||||
}
|
||||
|
||||
for (int l = 0; l < 9; ++l)
|
||||
@@ -2119,12 +2148,15 @@
|
||||
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);
|
||||
@@ -2160,6 +2192,12 @@
|
||||
@@ -2273,6 +2277,12 @@
|
||||
|
||||
while (!this.theIntegratedServer.serverIsInRunLoop())
|
||||
{
|
||||
@@ -254,24 +106,7 @@
|
||||
String s = this.theIntegratedServer.getUserMessage();
|
||||
|
||||
if (s != null)
|
||||
@@ -2185,8 +2223,14 @@
|
||||
SocketAddress socketaddress = this.theIntegratedServer.getNetworkSystem().addLocalEndpoint();
|
||||
NetworkManager networkmanager = NetworkManager.provideLocalClient(socketaddress);
|
||||
networkmanager.setNetHandler(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null));
|
||||
- networkmanager.sendPacket(new C00Handshake(47, socketaddress.toString(), 0, EnumConnectionState.LOGIN));
|
||||
- networkmanager.sendPacket(new C00PacketLoginStart(this.getSession().getProfile()));
|
||||
+ networkmanager.sendPacket(new C00Handshake(47, socketaddress.toString(), 0, EnumConnectionState.LOGIN, true));
|
||||
+ com.mojang.authlib.GameProfile gameProfile = this.getSession().getProfile();
|
||||
+ if (!this.getSession().hasCachedProperties())
|
||||
+ {
|
||||
+ 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;
|
||||
}
|
||||
|
||||
@@ -2197,6 +2241,8 @@
|
||||
@@ -2310,6 +2320,8 @@
|
||||
|
||||
public void loadWorld(WorldClient worldClientIn, String loadingMessage)
|
||||
{
|
||||
@@ -280,26 +115,7 @@
|
||||
if (worldClientIn == null)
|
||||
{
|
||||
NetHandlerPlayClient nethandlerplayclient = this.getNetHandler();
|
||||
@@ -2210,6 +2256,18 @@
|
||||
{
|
||||
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;
|
||||
@@ -2232,6 +2290,7 @@
|
||||
@@ -2345,6 +2357,7 @@
|
||||
this.ingameGUI.func_181029_i();
|
||||
this.setServerData((ServerData)null);
|
||||
this.integratedServerIsRunning = false;
|
||||
@@ -307,153 +123,3 @@
|
||||
}
|
||||
|
||||
this.mcSoundHandler.stopSounds();
|
||||
@@ -2336,126 +2395,10 @@
|
||||
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;
|
||||
@@ -2756,18 +2699,8 @@
|
||||
|
||||
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()
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/audio/SoundManager.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/audio/SoundManager.java
|
||||
@@ -69,6 +69,7 @@
|
||||
@@ -76,6 +76,7 @@
|
||||
{
|
||||
SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
|
||||
SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
|
||||
@@ -8,34 +8,11 @@
|
||||
}
|
||||
catch (SoundSystemException soundsystemexception)
|
||||
{
|
||||
@@ -80,6 +81,7 @@
|
||||
{
|
||||
@@ -100,6 +101,7 @@
|
||||
|
||||
this.unloadSoundSystem();
|
||||
this.loadSoundSystem();
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.SoundLoadEvent(this));
|
||||
}
|
||||
|
||||
private synchronized void loadSoundSystem()
|
||||
@@ -316,6 +318,9 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
+ sound = net.minecraftforge.client.ForgeHooksClient.playSound(this, sound);
|
||||
+ if (sound == null) return;
|
||||
+
|
||||
SoundEventAccessorComposite soundeventaccessorcomposite = this.sndHandler.getSound(sound.getSoundLocation());
|
||||
|
||||
if (soundeventaccessorcomposite == null)
|
||||
@@ -357,10 +362,12 @@
|
||||
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});
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java
|
||||
@@ -128,6 +128,6 @@
|
||||
@@ -148,6 +148,6 @@
|
||||
f *= 1.0F - f1 * 0.15F;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
|
||||
@@ -345,6 +345,15 @@
|
||||
@@ -400,6 +400,15 @@
|
||||
this.mc.ingameGUI.getChatGUI().printChatMessage(chatComponent);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
protected boolean pushOutOfBlocks(double x, double y, double z)
|
||||
{
|
||||
if (this.noClip)
|
||||
@@ -357,30 +366,34 @@
|
||||
@@ -412,30 +421,34 @@
|
||||
double d0 = x - (double)blockpos.getX();
|
||||
double d1 = z - (double)blockpos.getZ();
|
||||
|
||||
@@ -56,16 +56,3 @@
|
||||
{
|
||||
d2 = 1.0D - d1;
|
||||
i = 5;
|
||||
@@ -448,6 +461,12 @@
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -17,25 +17,7 @@
|
||||
}
|
||||
|
||||
private void readFontTexture()
|
||||
@@ -105,7 +106,7 @@
|
||||
|
||||
try
|
||||
{
|
||||
- bufferedimage = TextureUtil.readBufferedImage(Minecraft.getMinecraft().getResourceManager().getResource(this.locationFontTexture).getInputStream());
|
||||
+ bufferedimage = TextureUtil.readBufferedImage(getResourceInputStream(this.locationFontTexture));
|
||||
}
|
||||
catch (IOException ioexception)
|
||||
{
|
||||
@@ -165,7 +166,7 @@
|
||||
|
||||
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)
|
||||
@@ -196,7 +197,7 @@
|
||||
@@ -202,7 +203,7 @@
|
||||
int i = ch % 16 * 8;
|
||||
int j = ch / 16 * 8;
|
||||
int k = italic ? 1 : 0;
|
||||
@@ -43,8 +25,8 @@
|
||||
+ bindTexture(this.locationFontTexture);
|
||||
int l = this.charWidth[ch];
|
||||
float f = (float)l - 0.01F;
|
||||
GL11.glBegin(GL11.GL_TRIANGLE_STRIP);
|
||||
@@ -224,7 +225,7 @@
|
||||
GlStateManager.func_187447_r(5);
|
||||
@@ -230,7 +231,7 @@
|
||||
|
||||
private void loadGlyphTexture(int page)
|
||||
{
|
||||
@@ -53,7 +35,7 @@
|
||||
}
|
||||
|
||||
protected float renderUnicodeChar(char ch, boolean italic)
|
||||
@@ -271,7 +272,7 @@
|
||||
@@ -279,7 +280,7 @@
|
||||
|
||||
public int drawString(String text, float x, float y, int color, boolean dropShadow)
|
||||
{
|
||||
@@ -62,7 +44,7 @@
|
||||
this.resetStyles();
|
||||
int i;
|
||||
|
||||
@@ -341,7 +342,7 @@
|
||||
@@ -349,7 +350,7 @@
|
||||
|
||||
int j1 = this.colorCode[i1];
|
||||
this.textColor = j1;
|
||||
@@ -71,7 +53,7 @@
|
||||
}
|
||||
else if (i1 == 16)
|
||||
{
|
||||
@@ -370,7 +371,7 @@
|
||||
@@ -378,7 +379,7 @@
|
||||
this.strikethroughStyle = false;
|
||||
this.underlineStyle = false;
|
||||
this.italicStyle = false;
|
||||
@@ -80,7 +62,7 @@
|
||||
}
|
||||
|
||||
++i;
|
||||
@@ -398,7 +399,7 @@
|
||||
@@ -406,7 +407,7 @@
|
||||
c0 = c1;
|
||||
}
|
||||
|
||||
@@ -89,7 +71,7 @@
|
||||
boolean flag = (c0 == 0 || j == -1 || this.unicodeFlag) && shadow;
|
||||
|
||||
if (flag)
|
||||
@@ -436,7 +437,16 @@
|
||||
@@ -444,7 +445,16 @@
|
||||
|
||||
++f;
|
||||
}
|
||||
@@ -106,7 +88,7 @@
|
||||
if (this.strikethroughStyle)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
@@ -509,7 +519,7 @@
|
||||
@@ -517,7 +527,7 @@
|
||||
this.blue = (float)(color >> 8 & 255) / 255.0F;
|
||||
this.green = (float)(color & 255) / 255.0F;
|
||||
this.alpha = (float)(color >> 24 & 255) / 255.0F;
|
||||
@@ -115,19 +97,7 @@
|
||||
this.posX = x;
|
||||
this.posY = y;
|
||||
this.renderStringAtPos(text, dropShadow);
|
||||
@@ -588,11 +598,6 @@
|
||||
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;
|
||||
@@ -846,6 +851,26 @@
|
||||
@@ -848,6 +858,26 @@
|
||||
return this.bidiFlag;
|
||||
}
|
||||
|
||||
@@ -153,4 +123,4 @@
|
||||
+
|
||||
public int getColorCode(char character)
|
||||
{
|
||||
return this.colorCode["0123456789abcdef".indexOf(character)];
|
||||
int i = "0123456789abcdef".indexOf(character);
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiButton.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiButton.java
|
||||
@@ -21,6 +21,7 @@
|
||||
@@ -22,6 +22,7 @@
|
||||
public boolean enabled;
|
||||
public boolean visible;
|
||||
protected boolean hovered;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public GuiButton(int buttonId, int x, int y, String buttonText)
|
||||
{
|
||||
@@ -74,6 +75,11 @@
|
||||
@@ -75,6 +76,11 @@
|
||||
this.mouseDragged(mc, mouseX, mouseY);
|
||||
int j = 14737632;
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiChat.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiChat.java
|
||||
@@ -215,13 +215,14 @@
|
||||
this.mc.ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new ChatComponentText(stringbuilder.toString()), 1);
|
||||
}
|
||||
|
||||
- this.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)
|
||||
@@ -281,6 +282,12 @@
|
||||
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)
|
||||
@@ -291,6 +298,7 @@
|
||||
|
||||
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))
|
||||
{
|
||||
@@ -1,15 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
|
||||
@@ -205,6 +205,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ 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);
|
||||
@@ -312,14 +314,7 @@
|
||||
@@ -311,14 +311,7 @@
|
||||
}
|
||||
else if (button.id == 8)
|
||||
{
|
||||
@@ -25,7 +16,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -371,7 +366,7 @@
|
||||
@@ -370,7 +363,7 @@
|
||||
this.btnBonusItems.visible = this.field_146344_y;
|
||||
this.btnMapType.visible = this.field_146344_y;
|
||||
this.btnAllowCommands.visible = this.field_146344_y;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiMainMenu.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiMainMenu.java
|
||||
@@ -223,7 +223,8 @@
|
||||
@@ -216,7 +216,8 @@
|
||||
{
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, p_73969_1_, I18n.format("menu.singleplayer", new Object[0])));
|
||||
this.buttonList.add(new GuiButton(2, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 1, I18n.format("menu.multiplayer", new Object[0])));
|
||||
@@ -10,7 +10,7 @@
|
||||
}
|
||||
|
||||
private void addDemoButtons(int p_73972_1_, int p_73972_2_)
|
||||
@@ -271,6 +272,11 @@
|
||||
@@ -264,6 +265,11 @@
|
||||
this.mc.shutdown();
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
if (button.id == 11)
|
||||
{
|
||||
this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings);
|
||||
@@ -516,7 +522,16 @@
|
||||
s = s + " Demo";
|
||||
@@ -512,7 +518,16 @@
|
||||
s = s + ("release".equalsIgnoreCase(this.mc.func_184123_d()) ? "" : "/" + this.mc.func_184123_d());
|
||||
}
|
||||
|
||||
- this.drawString(this.fontRendererObj, s, 2, this.height - 10, -1);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java
|
||||
@@ -176,6 +176,9 @@
|
||||
long l = j - k;
|
||||
List<String> list = Lists.newArrayList(new String[] {String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.mc.isJava64bit() ? 64 : 32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(bytesToMb(l)), Long.valueOf(bytesToMb(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(bytesToMb(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.getCpu()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GL11.glGetString(GL11.GL_VENDOR)}), GL11.glGetString(GL11.GL_RENDERER), GL11.glGetString(GL11.GL_VERSION)});
|
||||
@@ -108,6 +108,9 @@
|
||||
{
|
||||
BlockPos blockpos = new BlockPos(this.mc.getRenderViewEntity().posX, this.mc.getRenderViewEntity().getEntityBoundingBox().minY, this.mc.getRenderViewEntity().posZ);
|
||||
|
||||
+ list.add("");
|
||||
+ list.addAll(net.minecraftforge.fml.common.FMLCommonHandler.instance().getBrandings(false));
|
||||
+
|
||||
if (this.isReducedDebug())
|
||||
{
|
||||
return list;
|
||||
return Lists.newArrayList(new String[] {"Minecraft 1.9 (" + this.mc.getVersion() + "/" + ClientBrandRetriever.getClientModName() + ")", this.mc.debug, this.mc.renderGlobal.getDebugInfoRenders(), this.mc.renderGlobal.getDebugInfoEntities(), "P: " + this.mc.effectRenderer.getStatistics() + ". T: " + this.mc.theWorld.getDebugLoadedEntities(), this.mc.theWorld.getProviderName(), "", String.format("Chunk-relative: %d %d %d", new Object[]{Integer.valueOf(blockpos.getX() & 15), Integer.valueOf(blockpos.getY() & 15), Integer.valueOf(blockpos.getZ() & 15)})});
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiScreen.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreen.java
|
||||
@@ -143,7 +143,8 @@
|
||||
@@ -141,7 +141,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
}
|
||||
|
||||
protected void drawCreativeTabHoveringText(String tabName, int mouseX, int mouseY)
|
||||
@@ -153,6 +154,11 @@
|
||||
@@ -151,6 +152,11 @@
|
||||
|
||||
protected void drawHoveringText(List<String> textLines, int x, int y)
|
||||
{
|
||||
@@ -22,7 +22,7 @@
|
||||
if (!textLines.isEmpty())
|
||||
{
|
||||
GlStateManager.disableRescaleNormal();
|
||||
@@ -163,7 +169,7 @@
|
||||
@@ -161,7 +167,7 @@
|
||||
|
||||
for (String s : textLines)
|
||||
{
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
if (j > i)
|
||||
{
|
||||
@@ -208,7 +214,7 @@
|
||||
@@ -206,7 +212,7 @@
|
||||
for (int k1 = 0; k1 < textLines.size(); ++k1)
|
||||
{
|
||||
String s1 = (String)textLines.get(k1);
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
if (k1 == 0)
|
||||
{
|
||||
@@ -436,6 +442,7 @@
|
||||
@@ -421,6 +427,7 @@
|
||||
{
|
||||
this.mc.ingameGUI.getChatGUI().addToSentMessages(msg);
|
||||
}
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
this.mc.thePlayer.sendChatMessage(msg);
|
||||
}
|
||||
@@ -450,9 +457,15 @@
|
||||
@@ -435,9 +442,15 @@
|
||||
|
||||
if (guibutton.mousePressed(this.mc, mouseX, mouseY))
|
||||
{
|
||||
@@ -64,7 +64,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -482,8 +495,12 @@
|
||||
@@ -467,8 +480,12 @@
|
||||
this.fontRendererObj = mc.fontRendererObj;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
@@ -77,7 +77,7 @@
|
||||
}
|
||||
|
||||
public void func_183500_a(int p_183500_1_, int p_183500_2_)
|
||||
@@ -502,7 +519,9 @@
|
||||
@@ -487,7 +504,9 @@
|
||||
{
|
||||
while (Mouse.next())
|
||||
{
|
||||
@@ -87,7 +87,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -510,7 +529,9 @@
|
||||
@@ -495,7 +514,9 @@
|
||||
{
|
||||
while (Keyboard.next())
|
||||
{
|
||||
@@ -97,7 +97,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -570,6 +591,7 @@
|
||||
@@ -557,6 +578,7 @@
|
||||
public void drawDefaultBackground()
|
||||
{
|
||||
this.drawWorldBackground(0);
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiSelectWorld.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSelectWorld.java
|
||||
@@ -186,7 +186,7 @@
|
||||
|
||||
if (this.mc.getSaveLoader().canLoadWorld(s))
|
||||
{
|
||||
- this.mc.launchIntegratedServer(s, s1, (WorldSettings)null);
|
||||
+ net.minecraftforge.fml.client.FMLClientHandler.instance().tryLoadExistingWorld(this, s, s1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiSlot.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSlot.java
|
||||
@@ -181,15 +181,8 @@
|
||||
GlStateManager.disableFog();
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
||||
- this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
|
||||
- GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
- 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;
|
||||
|
||||
@@ -458,4 +451,18 @@
|
||||
@@ -458,4 +458,18 @@
|
||||
{
|
||||
return this.slotHeight;
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiUtilRenderComponents.java
|
||||
@@ -73,6 +73,7 @@
|
||||
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);
|
||||
@@ -1,7 +1,7 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java
|
||||
@@ -82,7 +82,7 @@
|
||||
boolean flag1 = this.field_148301_e.version < 47;
|
||||
boolean flag1 = this.field_148301_e.version < 107;
|
||||
boolean flag2 = flag || flag1;
|
||||
this.mc.fontRendererObj.drawString(this.field_148301_e.serverName, x + 32 + 3, y + 1, 16777215);
|
||||
- List<String> list = this.mc.fontRendererObj.listFormattedStringToWidth(this.field_148301_e.serverMOTD, listWidth - 32 - 2);
|
||||
|
||||
+8
-51
@@ -11,30 +11,15 @@
|
||||
public GuiAchievements(GuiScreen parentScreenIn, StatFileWriter statFileWriterIn)
|
||||
{
|
||||
this.parentScreen = parentScreenIn;
|
||||
@@ -57,6 +61,14 @@
|
||||
int j = 141;
|
||||
this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.openInventory.displayColumn * 24 - i / 2 - 12);
|
||||
this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.openInventory.displayRow * 24 - j / 2);
|
||||
+ minecraftAchievements.clear();
|
||||
+ for (Achievement achievement : AchievementList.achievementList)
|
||||
+ {
|
||||
+ if (!net.minecraftforge.common.AchievementPage.isAchievementInPages(achievement))
|
||||
+ {
|
||||
+ minecraftAchievements.add(achievement);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
public void initGui()
|
||||
@@ -64,6 +76,7 @@
|
||||
this.mc.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS));
|
||||
@@ -64,6 +68,7 @@
|
||||
this.mc.getNetHandler().addToSendQueue(new CPacketClientStatus(CPacketClientStatus.State.REQUEST_STATS));
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.format("gui.done", new Object[0])));
|
||||
+ this.buttonList.add(button = new GuiButton(2, (width - field_146555_f) / 2 + 24, height / 2 + 74, 125, 20, net.minecraftforge.common.AchievementPage.getTitle(currentPage)));
|
||||
}
|
||||
|
||||
protected void actionPerformed(GuiButton button) throws IOException
|
||||
@@ -74,6 +87,16 @@
|
||||
@@ -74,6 +79,16 @@
|
||||
{
|
||||
this.mc.displayGuiScreen(this.parentScreen);
|
||||
}
|
||||
@@ -51,7 +36,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,7 +280,9 @@
|
||||
@@ -257,7 +272,9 @@
|
||||
GlStateManager.depthFunc(518);
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate((float)i1, (float)j1, -200.0F);
|
||||
@@ -62,35 +47,7 @@
|
||||
GlStateManager.enableTexture2D();
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
@@ -331,11 +356,12 @@
|
||||
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;
|
||||
@@ -389,9 +415,9 @@
|
||||
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;
|
||||
|
||||
@@ -432,6 +458,7 @@
|
||||
@@ -432,6 +449,7 @@
|
||||
|
||||
this.mc.getTextureManager().bindTexture(ACHIEVEMENT_BACKGROUND);
|
||||
|
||||
@@ -98,7 +55,7 @@
|
||||
if (achievement2.getSpecial())
|
||||
{
|
||||
this.drawTexturedModalRect(l6 - 2, j7 - 2, 26, 202, 26, 26);
|
||||
@@ -440,6 +467,7 @@
|
||||
@@ -440,6 +458,7 @@
|
||||
{
|
||||
this.drawTexturedModalRect(l6 - 2, j7 - 2, 0, 202, 26, 26);
|
||||
}
|
||||
@@ -106,7 +63,7 @@
|
||||
|
||||
if (!this.statFileWriter.canUnlockAchievement(achievement2))
|
||||
{
|
||||
@@ -448,7 +476,7 @@
|
||||
@@ -448,7 +467,7 @@
|
||||
this.itemRender.func_175039_a(false);
|
||||
}
|
||||
|
||||
@@ -114,4 +71,4 @@
|
||||
+ GlStateManager.disableLighting(); //Forge: Make sure Lighting is disabled. Fixes MC-33065
|
||||
GlStateManager.enableCull();
|
||||
this.itemRender.renderItemAndEffectIntoGUI(achievement2.theItemStack, l6 + 3, j7 + 3);
|
||||
GlStateManager.blendFunc(770, 771);
|
||||
GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
|
||||
@@ -1,55 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/achievement/GuiStats.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/achievement/GuiStats.java
|
||||
@@ -5,6 +5,8 @@
|
||||
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;
|
||||
@@ -443,17 +445,18 @@
|
||||
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;
|
||||
}
|
||||
@@ -468,8 +471,15 @@
|
||||
{
|
||||
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;
|
||||
|
||||
@@ -748,7 +758,7 @@
|
||||
@@ -877,7 +877,7 @@
|
||||
super(mcIn, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, GuiStats.this.fontRendererObj.FONT_HEIGHT * 4);
|
||||
this.setShowSelectionBox(false);
|
||||
|
||||
@@ -58,12 +9,3 @@
|
||||
{
|
||||
if (GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151512_d) > 0 || GuiStats.this.field_146546_t.readStat(entitylist$entityegginfo.field_151513_e) > 0)
|
||||
{
|
||||
@@ -784,7 +794,7 @@
|
||||
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});
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
|
||||
@@ -175,8 +175,11 @@
|
||||
@@ -176,8 +176,11 @@
|
||||
GlStateManager.translate(0.0F, 0.0F, 32.0F);
|
||||
this.zLevel = 200.0F;
|
||||
this.itemRender.zLevel = 200.0F;
|
||||
@@ -13,9 +13,9 @@
|
||||
this.zLevel = 0.0F;
|
||||
this.itemRender.zLevel = 0.0F;
|
||||
}
|
||||
@@ -239,13 +242,12 @@
|
||||
@@ -240,13 +243,12 @@
|
||||
|
||||
if (itemstack == null)
|
||||
if (itemstack == null && slotIn.canBeHovered())
|
||||
{
|
||||
- String s1 = slotIn.getSlotTexture();
|
||||
+ TextureAtlasSprite textureatlassprite = slotIn.getBackgroundSprite();
|
||||
@@ -30,7 +30,7 @@
|
||||
this.drawTexturedModalRect(i, j, textureatlassprite, 16, 16);
|
||||
GlStateManager.enableLighting();
|
||||
flag1 = true;
|
||||
@@ -326,6 +328,7 @@
|
||||
@@ -327,6 +329,7 @@
|
||||
int j = this.guiLeft;
|
||||
int k = this.guiTop;
|
||||
boolean flag1 = mouseX < j || mouseY < k || mouseX >= j + this.xSize || mouseY >= k + this.ySize;
|
||||
@@ -38,7 +38,7 @@
|
||||
int l = -1;
|
||||
|
||||
if (slot != null)
|
||||
@@ -463,10 +466,12 @@
|
||||
@@ -464,10 +467,12 @@
|
||||
|
||||
protected void mouseReleased(int mouseX, int mouseY, int state)
|
||||
{
|
||||
@@ -51,7 +51,7 @@
|
||||
int k = -1;
|
||||
|
||||
if (slot != null)
|
||||
@@ -685,4 +690,16 @@
|
||||
@@ -686,4 +691,16 @@
|
||||
this.mc.thePlayer.closeScreen();
|
||||
}
|
||||
}
|
||||
|
||||
+15
-38
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java
|
||||
@@ -48,6 +48,8 @@
|
||||
@@ -49,6 +49,8 @@
|
||||
private Slot field_147064_C;
|
||||
private boolean field_147057_D;
|
||||
private CreativeCrafting field_147059_E;
|
||||
@@ -9,16 +9,7 @@
|
||||
|
||||
public GuiContainerCreative(EntityPlayer p_i1088_1_)
|
||||
{
|
||||
@@ -175,7 +177,7 @@
|
||||
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)
|
||||
{
|
||||
@@ -259,6 +261,13 @@
|
||||
@@ -258,6 +260,13 @@
|
||||
this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[i]);
|
||||
this.field_147059_E = new CreativeCrafting(this.mc);
|
||||
this.mc.thePlayer.inventoryContainer.onCraftGuiOpened(this.field_147059_E);
|
||||
@@ -32,7 +23,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -280,7 +289,7 @@
|
||||
@@ -279,7 +288,7 @@
|
||||
|
||||
protected void keyTyped(char typedChar, int keyCode) throws IOException
|
||||
{
|
||||
@@ -41,7 +32,7 @@
|
||||
{
|
||||
if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat))
|
||||
{
|
||||
@@ -318,6 +327,14 @@
|
||||
@@ -317,6 +326,14 @@
|
||||
GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots;
|
||||
guicontainercreative$containercreative.itemList.clear();
|
||||
|
||||
@@ -56,21 +47,7 @@
|
||||
for (Item item : Item.itemRegistry)
|
||||
{
|
||||
if (item != null && item.getCreativeTab() != null)
|
||||
@@ -325,7 +342,13 @@
|
||||
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)
|
||||
@@ -333,7 +356,6 @@
|
||||
@@ -332,7 +349,6 @@
|
||||
Items.enchanted_book.getAll(enchantment, guicontainercreative$containercreative.itemList);
|
||||
}
|
||||
}
|
||||
@@ -78,7 +55,7 @@
|
||||
Iterator<ItemStack> iterator = guicontainercreative$containercreative.itemList.iterator();
|
||||
String s1 = this.searchField.getText().toLowerCase();
|
||||
|
||||
@@ -365,7 +387,7 @@
|
||||
@@ -364,7 +380,7 @@
|
||||
{
|
||||
CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex];
|
||||
|
||||
@@ -87,7 +64,7 @@
|
||||
{
|
||||
GlStateManager.disableBlend();
|
||||
this.fontRendererObj.drawString(I18n.format(creativetabs.getTranslatedTabLabel(), new Object[0]), 8, 6, 4210752);
|
||||
@@ -400,7 +422,7 @@
|
||||
@@ -399,7 +415,7 @@
|
||||
|
||||
for (CreativeTabs creativetabs : CreativeTabs.creativeTabArray)
|
||||
{
|
||||
@@ -96,7 +73,7 @@
|
||||
{
|
||||
this.setCurrentCreativeTab(creativetabs);
|
||||
return;
|
||||
@@ -413,11 +435,13 @@
|
||||
@@ -412,11 +428,13 @@
|
||||
|
||||
private boolean needsScrollBars()
|
||||
{
|
||||
@@ -110,7 +87,7 @@
|
||||
int i = selectedTabIndex;
|
||||
selectedTabIndex = p_147050_1_.getTabIndex();
|
||||
GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots;
|
||||
@@ -483,12 +507,14 @@
|
||||
@@ -487,12 +505,14 @@
|
||||
|
||||
if (this.searchField != null)
|
||||
{
|
||||
@@ -126,7 +103,7 @@
|
||||
this.updateCreativeSearch();
|
||||
}
|
||||
else
|
||||
@@ -558,20 +584,43 @@
|
||||
@@ -562,20 +582,43 @@
|
||||
}
|
||||
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
@@ -171,7 +148,7 @@
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.disableLighting();
|
||||
}
|
||||
@@ -633,16 +682,35 @@
|
||||
@@ -637,16 +680,35 @@
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex];
|
||||
|
||||
@@ -208,7 +185,7 @@
|
||||
this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.getBackgroundImageName()));
|
||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
||||
this.searchField.drawTextBox();
|
||||
@@ -657,6 +725,14 @@
|
||||
@@ -661,6 +723,14 @@
|
||||
this.drawTexturedModalRect(i, j + (int)((float)(k - j - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15);
|
||||
}
|
||||
|
||||
@@ -223,7 +200,7 @@
|
||||
this.func_147051_a(creativetabs);
|
||||
|
||||
if (creativetabs == CreativeTabs.tabInventory)
|
||||
@@ -667,6 +743,14 @@
|
||||
@@ -671,6 +741,14 @@
|
||||
|
||||
protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_)
|
||||
{
|
||||
@@ -238,7 +215,7 @@
|
||||
int i = p_147049_1_.getTabColumn();
|
||||
int j = 28 * i;
|
||||
int k = 0;
|
||||
@@ -763,6 +847,8 @@
|
||||
@@ -767,6 +845,8 @@
|
||||
}
|
||||
|
||||
GlStateManager.disableLighting();
|
||||
@@ -247,7 +224,7 @@
|
||||
this.drawTexturedModalRect(l, i1, j, k, 28, j1);
|
||||
this.zLevel = 100.0F;
|
||||
this.itemRender.zLevel = 100.0F;
|
||||
@@ -789,6 +875,15 @@
|
||||
@@ -793,6 +873,15 @@
|
||||
{
|
||||
this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter()));
|
||||
}
|
||||
|
||||
@@ -8,11 +8,3 @@
|
||||
public class ModelBox
|
||||
{
|
||||
private PositionTextureVertex[] vertexPositions;
|
||||
@@ -81,6 +80,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ @SideOnly(Side.CLIENT)
|
||||
public void render(WorldRenderer renderer, float scale)
|
||||
{
|
||||
for (int i = 0; i < this.quadList.length; ++i)
|
||||
@@ -1,14 +1,14 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/model/ModelRenderer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/model/ModelRenderer.java
|
||||
@@ -10,7 +10,6 @@
|
||||
@@ -9,7 +9,6 @@
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
-@SideOnly(Side.CLIENT)
|
||||
public class ModelRenderer
|
||||
{
|
||||
public float textureWidth;
|
||||
@@ -109,6 +108,7 @@
|
||||
@@ -108,6 +107,7 @@
|
||||
this.rotationPointZ = rotationPointZIn;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
public void render(float p_78785_1_)
|
||||
{
|
||||
if (!this.isHidden)
|
||||
@@ -190,6 +190,7 @@
|
||||
@@ -189,6 +189,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
public void renderWithRotation(float p_78791_1_)
|
||||
{
|
||||
if (!this.isHidden)
|
||||
@@ -225,6 +226,7 @@
|
||||
@@ -224,6 +225,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
public void postRender(float scale)
|
||||
{
|
||||
if (!this.isHidden)
|
||||
@@ -266,6 +268,7 @@
|
||||
@@ -265,6 +267,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/model/PositionTextureVertex.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/model/PositionTextureVertex.java
|
||||
@@ -1,10 +1,7 @@
|
||||
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;
|
||||
@@ -1,13 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/model/TexturedQuad.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/model/TexturedQuad.java
|
||||
@@ -4,10 +4,7 @@
|
||||
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;
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java
|
||||
@@ -55,6 +55,7 @@
|
||||
@@ -52,6 +52,7 @@
|
||||
Chunk chunk = new Chunk(this.worldObj, p_73158_1_, p_73158_2_);
|
||||
this.chunkMapping.add(ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_), chunk);
|
||||
this.chunkListing.add(chunk);
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java
|
||||
@@ -67,7 +67,7 @@
|
||||
inetaddress = InetAddress.getByName(ip);
|
||||
GuiConnecting.this.networkManager = NetworkManager.func_181124_a(inetaddress, port, GuiConnecting.this.mc.gameSettings.func_181148_f());
|
||||
GuiConnecting.this.networkManager.setNetHandler(new NetHandlerLoginClient(GuiConnecting.this.networkManager, GuiConnecting.this.mc, GuiConnecting.this.previousGuiScreen));
|
||||
- GuiConnecting.this.networkManager.sendPacket(new C00Handshake(47, ip, port, EnumConnectionState.LOGIN));
|
||||
+ GuiConnecting.this.networkManager.sendPacket(new C00Handshake(47, ip, port, EnumConnectionState.LOGIN, true));
|
||||
GuiConnecting.this.networkManager.sendPacket(new C00PacketLoginStart(GuiConnecting.this.mc.getSession().getProfile()));
|
||||
}
|
||||
catch (UnknownHostException unknownhostexception)
|
||||
+1
-73
@@ -1,33 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java
|
||||
@@ -111,6 +111,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ 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;
|
||||
@@ -128,13 +134,7 @@
|
||||
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())
|
||||
@@ -152,6 +152,12 @@
|
||||
@@ -167,6 +167,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,48 +13,3 @@
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
@@ -356,11 +362,19 @@
|
||||
{
|
||||
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)
|
||||
@@ -393,7 +407,9 @@
|
||||
}
|
||||
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
|
||||
@@ -420,9 +436,10 @@
|
||||
{
|
||||
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;
|
||||
@@ -1,7 +1,7 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/multiplayer/WorldClient.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/WorldClient.java
|
||||
@@ -52,12 +52,13 @@
|
||||
super(new SaveHandlerMP(), new WorldInfo(p_i45063_2_, "MpServer"), WorldProvider.getProviderForDimension(p_i45063_3_), p_i45063_5_, true);
|
||||
@@ -63,12 +63,13 @@
|
||||
this.field_184157_a = Sets.<ChunkCoordIntPair>newHashSet();
|
||||
this.sendQueue = p_i45063_1_;
|
||||
this.getWorldInfo().setDifficulty(p_i45063_4_);
|
||||
- this.setSpawnPoint(new BlockPos(8, 64, 8));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java
|
||||
@@ -104,7 +104,10 @@
|
||||
@@ -106,7 +106,10 @@
|
||||
{
|
||||
this.gameProfile = packetIn.getProfile();
|
||||
this.networkManager.setConnectionState(EnumConnectionState.PLAY);
|
||||
@@ -11,4 +11,4 @@
|
||||
+ net.minecraftforge.fml.client.FMLClientHandler.instance().setPlayClient(nhpc);
|
||||
}
|
||||
|
||||
public void onDisconnect(IChatComponent reason)
|
||||
public void onDisconnect(ITextComponent reason)
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java
|
||||
@@ -246,7 +246,7 @@
|
||||
@@ -267,7 +267,7 @@
|
||||
{
|
||||
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
|
||||
this.gameController.playerController = new PlayerControllerMP(this.gameController, this);
|
||||
@@ -9,8 +9,8 @@
|
||||
this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
|
||||
this.gameController.loadWorld(this.clientWorldController);
|
||||
this.gameController.thePlayer.dimension = packetIn.getDimension();
|
||||
@@ -750,14 +750,16 @@
|
||||
public void handleChat(S02PacketChat packetIn)
|
||||
@@ -785,14 +785,16 @@
|
||||
public void handleChat(SPacketChat packetIn)
|
||||
{
|
||||
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
|
||||
+ net.minecraft.util.IChatComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(packetIn.getType(), packetIn.getChatComponent());
|
||||
@@ -28,21 +28,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -808,6 +810,11 @@
|
||||
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();
|
||||
@@ -1133,6 +1140,10 @@
|
||||
@@ -1082,6 +1084,10 @@
|
||||
{
|
||||
tileentity.readFromNBT(packetIn.getNbtCompound());
|
||||
entityplayer.openContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e());
|
||||
}
|
||||
+ else
|
||||
+ {
|
||||
@@ -51,12 +39,3 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1341,7 +1352,7 @@
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/network/OldServerPinger.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/network/OldServerPinger.java
|
||||
@@ -150,6 +150,7 @@
|
||||
server.setBase64EncodedIconData((String)null);
|
||||
}
|
||||
|
||||
+ 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;
|
||||
@@ -1,23 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/particle/EffectRenderer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/particle/EffectRenderer.java
|
||||
@@ -133,6 +133,7 @@
|
||||
|
||||
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;
|
||||
|
||||
@@ -351,7 +352,7 @@
|
||||
|
||||
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;
|
||||
@@ -457,4 +458,13 @@
|
||||
@@ -460,4 +460,13 @@
|
||||
|
||||
return "" + i;
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java
|
||||
@@ -533,8 +533,19 @@
|
||||
@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}),
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/BlockModelShapes.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockModelShapes.java
|
||||
@@ -309,5 +309,6 @@
|
||||
@@ -307,5 +307,6 @@
|
||||
return new ModelResourceLocation(s + "_double_slab", s1);
|
||||
}
|
||||
});
|
||||
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java
|
||||
@@ -24,7 +24,7 @@
|
||||
{
|
||||
private BlockModelShapes blockModelShapes;
|
||||
private final GameSettings gameSettings;
|
||||
- private final BlockModelRenderer blockModelRenderer = new BlockModelRenderer();
|
||||
+ private final BlockModelRenderer blockModelRenderer = new net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer();
|
||||
private final ChestRenderer chestRenderer = new ChestRenderer();
|
||||
private final BlockFluidRenderer fluidRenderer = new BlockFluidRenderer();
|
||||
|
||||
@@ -48,6 +48,24 @@
|
||||
{
|
||||
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());
|
||||
}
|
||||
@@ -128,6 +146,12 @@
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/EntityRenderer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/EntityRenderer.java
|
||||
@@ -200,6 +200,7 @@
|
||||
@@ -207,6 +207,7 @@
|
||||
{
|
||||
this.loadShader(new ResourceLocation("shaders/post/invert.json"));
|
||||
}
|
||||
@@ -8,16 +8,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -419,7 +420,7 @@
|
||||
|
||||
if (d3 < d2 || d2 == 0.0D)
|
||||
{
|
||||
- if (entity1 == entity.ridingEntity)
|
||||
+ if (entity1 == entity.ridingEntity && !entity.canRiderInteract())
|
||||
{
|
||||
if (d2 == 0.0D)
|
||||
{
|
||||
@@ -512,7 +513,7 @@
|
||||
@@ -491,7 +492,7 @@
|
||||
f = f * 60.0F / 70.0F;
|
||||
}
|
||||
|
||||
@@ -26,23 +17,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -576,14 +577,8 @@
|
||||
{
|
||||
BlockPos blockpos = new BlockPos(entity);
|
||||
IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos);
|
||||
- Block block = iblockstate.getBlock();
|
||||
+ net.minecraftforge.client.ForgeHooksClient.orientBedCamera(this.mc.theWorld, blockpos, iblockstate, entity);
|
||||
|
||||
- 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);
|
||||
}
|
||||
@@ -650,17 +645,20 @@
|
||||
@@ -629,17 +630,20 @@
|
||||
|
||||
if (!this.mc.gameSettings.debugCamEnable)
|
||||
{
|
||||
@@ -70,7 +45,7 @@
|
||||
}
|
||||
|
||||
GlStateManager.translate(0.0F, -f, 0.0F);
|
||||
@@ -1103,7 +1101,7 @@
|
||||
@@ -1092,7 +1096,7 @@
|
||||
|
||||
try
|
||||
{
|
||||
@@ -79,7 +54,7 @@
|
||||
}
|
||||
catch (Throwable throwable)
|
||||
{
|
||||
@@ -1164,7 +1162,7 @@
|
||||
@@ -1187,7 +1191,7 @@
|
||||
|
||||
if (this.mc.playerController.getCurrentGameType() == WorldSettings.GameType.SPECTATOR)
|
||||
{
|
||||
@@ -88,7 +63,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1314,7 +1312,9 @@
|
||||
@@ -1312,7 +1316,9 @@
|
||||
GlStateManager.pushMatrix();
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
this.mc.mcProfiler.endStartSection("entities");
|
||||
@@ -97,40 +72,8 @@
|
||||
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
this.disableLightmap();
|
||||
GlStateManager.matrixMode(5888);
|
||||
@@ -1326,6 +1326,7 @@
|
||||
EntityPlayer entityplayer = (EntityPlayer)entity;
|
||||
GlStateManager.disableAlpha();
|
||||
this.mc.mcProfiler.endStartSection("outline");
|
||||
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, entityplayer.getHeldItem(), partialTicks))
|
||||
renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, partialTicks);
|
||||
GlStateManager.enableAlpha();
|
||||
}
|
||||
@@ -1339,6 +1340,7 @@
|
||||
EntityPlayer entityplayer1 = (EntityPlayer)entity;
|
||||
GlStateManager.disableAlpha();
|
||||
this.mc.mcProfiler.endStartSection("outline");
|
||||
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer1, mc.objectMouseOver, 0, entityplayer1.getHeldItem(), partialTicks))
|
||||
renderglobal.drawSelectionBox(entityplayer1, this.mc.objectMouseOver, 0, partialTicks);
|
||||
GlStateManager.enableAlpha();
|
||||
}
|
||||
@@ -1380,6 +1382,15 @@
|
||||
GlStateManager.shadeModel(7425);
|
||||
this.mc.mcProfiler.endStartSection("translucent");
|
||||
renderglobal.renderBlockLayer(EnumWorldBlockLayer.TRANSLUCENT, (double)partialTicks, pass, entity);
|
||||
+ if (!this.debugView) //Only render if render pass 0 happens as well.
|
||||
+ {
|
||||
+ 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();
|
||||
@@ -1392,8 +1403,12 @@
|
||||
@@ -1378,8 +1384,12 @@
|
||||
this.renderCloudsCheck(renderglobal, partialTicks, pass);
|
||||
}
|
||||
|
||||
@@ -143,7 +86,7 @@
|
||||
if (this.renderHand)
|
||||
{
|
||||
GlStateManager.clear(256);
|
||||
@@ -1505,6 +1520,13 @@
|
||||
@@ -1490,6 +1500,13 @@
|
||||
|
||||
protected void renderRainSnow(float partialTicks)
|
||||
{
|
||||
@@ -157,7 +100,7 @@
|
||||
float f = this.mc.theWorld.getRainStrength(partialTicks);
|
||||
|
||||
if (f > 0.0F)
|
||||
@@ -1830,6 +1852,13 @@
|
||||
@@ -1820,6 +1837,13 @@
|
||||
this.fogColorBlue = f7;
|
||||
}
|
||||
|
||||
@@ -171,18 +114,7 @@
|
||||
GlStateManager.clearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F);
|
||||
}
|
||||
|
||||
@@ -1848,6 +1877,10 @@
|
||||
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;
|
||||
@@ -1925,6 +1958,7 @@
|
||||
@@ -1915,6 +1939,7 @@
|
||||
GlStateManager.setFogStart(f * 0.05F);
|
||||
GlStateManager.setFogEnd(Math.min(f, 192.0F) * 0.5F);
|
||||
}
|
||||
|
||||
+2
-10
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java
|
||||
@@ -27,7 +27,12 @@
|
||||
@@ -28,7 +28,12 @@
|
||||
|
||||
protected void updateActivePotionEffects()
|
||||
{
|
||||
@@ -14,15 +14,7 @@
|
||||
{
|
||||
this.guiLeft = 160 + (this.width - this.xSize - 200) / 2;
|
||||
this.hasActivePotionEffects = true;
|
||||
@@ -70,6 +75,7 @@
|
||||
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);
|
||||
@@ -80,6 +86,8 @@
|
||||
@@ -81,6 +86,8 @@
|
||||
this.drawTexturedModalRect(i + 6, j + 7, 0 + i1 % 8 * 18, 198 + i1 / 8 * 18, 18, 18);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/ItemRenderer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/ItemRenderer.java
|
||||
@@ -313,7 +313,7 @@
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -365,6 +365,7 @@
|
||||
@@ -444,6 +444,7 @@
|
||||
if (this.mc.thePlayer.isEntityInsideOpaqueBlock())
|
||||
{
|
||||
IBlockState iblockstate = this.mc.theWorld.getBlockState(new BlockPos(this.mc.thePlayer));
|
||||
@@ -17,21 +8,7 @@
|
||||
EntityPlayer entityplayer = this.mc.thePlayer;
|
||||
|
||||
for (int i = 0; i < 8; ++i)
|
||||
@@ -378,11 +379,13 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -391,11 +394,13 @@
|
||||
@@ -470,11 +471,13 @@
|
||||
{
|
||||
if (this.mc.thePlayer.isInsideOfMaterial(Material.water))
|
||||
{
|
||||
@@ -45,16 +22,3 @@
|
||||
this.renderFireInFirstPerson(partialTicks);
|
||||
}
|
||||
}
|
||||
@@ -512,6 +517,12 @@
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java
|
||||
@@ -83,6 +83,10 @@
|
||||
@@ -92,6 +92,10 @@
|
||||
public static int GL_ARRAY_BUFFER;
|
||||
public static int GL_STATIC_DRAW;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public static void initializeTextures()
|
||||
{
|
||||
ContextCapabilities contextcapabilities = GLContext.getCapabilities();
|
||||
@@ -843,6 +847,12 @@
|
||||
@@ -852,6 +856,12 @@
|
||||
{
|
||||
GL13.glMultiTexCoord2f(target, p_77475_1_, p_77475_2_);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/RenderGlobal.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/RenderGlobal.java
|
||||
@@ -525,8 +525,10 @@
|
||||
@@ -547,8 +547,10 @@
|
||||
|
||||
public void renderEntities(Entity renderViewEntity, ICamera camera, float partialTicks)
|
||||
{
|
||||
@@ -11,7 +11,7 @@
|
||||
--this.renderEntitiesStartupCounter;
|
||||
}
|
||||
else
|
||||
@@ -537,9 +539,12 @@
|
||||
@@ -559,9 +561,12 @@
|
||||
this.theWorld.theProfiler.startSection("prepare");
|
||||
TileEntityRendererDispatcher.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRendererObj, this.mc.getRenderViewEntity(), partialTicks);
|
||||
this.renderManager.cacheActiveRenderInfo(this.theWorld, this.mc.fontRendererObj, this.mc.getRenderViewEntity(), this.mc.pointedEntity, this.mc.gameSettings, partialTicks);
|
||||
@@ -24,7 +24,7 @@
|
||||
Entity entity = this.mc.getRenderViewEntity();
|
||||
double d3 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks;
|
||||
double d4 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partialTicks;
|
||||
@@ -551,11 +556,15 @@
|
||||
@@ -573,11 +578,15 @@
|
||||
this.mc.entityRenderer.enableLightmap();
|
||||
this.theWorld.theProfiler.endStartSection("global");
|
||||
List<Entity> list = this.theWorld.getLoadedEntityList();
|
||||
@@ -40,39 +40,23 @@
|
||||
++this.countEntitiesRendered;
|
||||
|
||||
if (entity1.isInRangeToRender3d(d0, d1, d2))
|
||||
@@ -577,6 +586,7 @@
|
||||
for (int j = 0; j < list.size(); ++j)
|
||||
{
|
||||
Entity entity3 = (Entity)list.get(j);
|
||||
+ if (!entity3.shouldRenderInPass(pass)) continue;
|
||||
boolean flag = this.mc.getRenderViewEntity() instanceof EntityLivingBase && ((EntityLivingBase)this.mc.getRenderViewEntity()).isPlayerSleeping();
|
||||
boolean flag1 = entity3.isInRangeToRender3d(d0, d1, d2) && (entity3.ignoreFrustumCheck || camera.isBoundingBoxInFrustum(entity3.getEntityBoundingBox()) || entity3.riddenByEntity == this.mc.thePlayer) && entity3 instanceof EntityPlayer;
|
||||
|
||||
@@ -626,6 +636,7 @@
|
||||
}
|
||||
|
||||
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)
|
||||
@@ -654,6 +665,7 @@
|
||||
@@ -672,6 +681,7 @@
|
||||
this.theWorld.theProfiler.endStartSection("blockentities");
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
|
||||
+ TileEntityRendererDispatcher.instance.preDrawBatch();
|
||||
for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 : this.renderInfos)
|
||||
{
|
||||
List<TileEntity> list1 = renderglobal$containerlocalrenderinformation1.renderChunk.getCompiledChunk().getTileEntities();
|
||||
@@ -662,6 +674,7 @@
|
||||
List<TileEntity> list3 = renderglobal$containerlocalrenderinformation1.renderChunk.getCompiledChunk().getTileEntities();
|
||||
@@ -680,6 +690,7 @@
|
||||
{
|
||||
for (TileEntity tileentity2 : list1)
|
||||
for (TileEntity tileentity2 : list3)
|
||||
{
|
||||
+ if (!tileentity2.shouldRenderInPass(pass) || !camera.isBoundingBoxInFrustum(tileentity2.getRenderBoundingBox())) continue;
|
||||
TileEntityRendererDispatcher.instance.renderTileEntity(tileentity2, partialTicks, -1);
|
||||
}
|
||||
}
|
||||
@@ -671,9 +684,11 @@
|
||||
@@ -689,9 +700,11 @@
|
||||
{
|
||||
for (TileEntity tileentity : this.setTileEntities)
|
||||
{
|
||||
@@ -84,7 +68,7 @@
|
||||
|
||||
this.preRenderDamagedBlocks();
|
||||
|
||||
@@ -700,7 +715,7 @@
|
||||
@@ -718,7 +731,7 @@
|
||||
|
||||
Block block = this.theWorld.getBlockState(blockpos).getBlock();
|
||||
|
||||
@@ -93,20 +77,7 @@
|
||||
{
|
||||
TileEntityRendererDispatcher.instance.renderTileEntity(tileentity1, partialTicks, destroyblockprogress.getPartialBlockDamage());
|
||||
}
|
||||
@@ -1161,6 +1176,12 @@
|
||||
|
||||
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();
|
||||
@@ -1378,6 +1399,12 @@
|
||||
@@ -1427,6 +1440,12 @@
|
||||
|
||||
public void renderClouds(float partialTicks, int pass)
|
||||
{
|
||||
@@ -119,7 +90,7 @@
|
||||
if (this.mc.theWorld.provider.isSurfaceWorld())
|
||||
{
|
||||
if (this.mc.gameSettings.func_181147_e() == 2)
|
||||
@@ -1793,8 +1820,11 @@
|
||||
@@ -1854,8 +1873,11 @@
|
||||
double d4 = (double)blockpos.getY() - d1;
|
||||
double d5 = (double)blockpos.getZ() - d2;
|
||||
Block block = this.theWorld.getBlockState(blockpos).getBlock();
|
||||
@@ -132,21 +103,3 @@
|
||||
{
|
||||
if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D)
|
||||
{
|
||||
@@ -1949,13 +1979,16 @@
|
||||
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);
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/WorldRenderer.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/WorldRenderer.java
|
||||
@@ -506,15 +506,15 @@
|
||||
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();
|
||||
@@ -578,6 +578,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ public void checkAndGrow()
|
||||
+ {
|
||||
+ this.growBuffer(vertexFormat.getNextOffset()/* / 4 * 4 */);
|
||||
+ }
|
||||
+
|
||||
+ public boolean isColorDisabled()
|
||||
+ {
|
||||
+ return noColor;
|
||||
+ }
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class State
|
||||
{
|
||||
-66
@@ -1,66 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/WorldVertexBufferUploader.java
|
||||
@@ -23,32 +23,9 @@
|
||||
|
||||
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());
|
||||
@@ -57,26 +34,8 @@
|
||||
for (int j1 = list.size(); i1 < j1; ++i1)
|
||||
{
|
||||
VertexFormatElement vertexformatelement1 = (VertexFormatElement)list.get(i1);
|
||||
- VertexFormatElement.EnumUsage vertexformatelement$enumusage1 = vertexformatelement1.getUsage();
|
||||
- int k1 = vertexformatelement1.getIndex();
|
||||
-
|
||||
- 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);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/BakedQuad.java
|
||||
@@ -5,8 +5,9 @@
|
||||
@@ -6,8 +6,9 @@
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
Loaded 100 of 316 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user