Remove MCP reference patches.
This commit is contained in:
parent
30bc2653c5
commit
01f4a627be
337 changed files with 0 additions and 20692 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,9 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockAir.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockAir.java
|
|
||||||
@@ -36,4 +36,6 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) {}
|
|
||||||
+
|
|
||||||
+ public boolean isReplaceable(World worldIn, BlockPos pos){ return true; }
|
|
||||||
}
|
|
|
@ -1,66 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockBush.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockBush.java
|
|
||||||
@@ -12,7 +12,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
|
|
||||||
{
|
|
||||||
private static final String __OBFID = "CL_00000208";
|
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@
|
|
||||||
|
|
||||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
|
||||||
{
|
|
||||||
- return super.canPlaceBlockAt(worldIn, pos) && this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock());
|
|
||||||
+ return super.canPlaceBlockAt(worldIn, pos) && worldIn.getBlockState(pos.down()).getBlock().canSustainPlant(worldIn, pos.down(), net.minecraft.util.EnumFacing.UP, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean canPlaceBlockOn(Block ground)
|
|
||||||
@@ -62,7 +62,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)
|
|
||||||
@@ -85,4 +88,33 @@
|
|
||||||
{
|
|
||||||
return EnumWorldBlockLayer.CUTOUT;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
|
||||||
+ {
|
|
||||||
+ if (this == Blocks.wheat) return net.minecraftforge.common.EnumPlantType.Crop;
|
|
||||||
+ if (this == Blocks.carrots) return net.minecraftforge.common.EnumPlantType.Crop;
|
|
||||||
+ if (this == Blocks.potatoes) return net.minecraftforge.common.EnumPlantType.Crop;
|
|
||||||
+ if (this == Blocks.melon_stem) return net.minecraftforge.common.EnumPlantType.Crop;
|
|
||||||
+ if (this == Blocks.pumpkin_stem) return net.minecraftforge.common.EnumPlantType.Crop;
|
|
||||||
+ if (this == Blocks.deadbush) return net.minecraftforge.common.EnumPlantType.Desert;
|
|
||||||
+ if (this == Blocks.waterlily) return net.minecraftforge.common.EnumPlantType.Water;
|
|
||||||
+ if (this == Blocks.red_mushroom) return net.minecraftforge.common.EnumPlantType.Cave;
|
|
||||||
+ if (this == Blocks.brown_mushroom) return net.minecraftforge.common.EnumPlantType.Cave;
|
|
||||||
+ if (this == Blocks.nether_wart) return net.minecraftforge.common.EnumPlantType.Nether;
|
|
||||||
+ if (this == Blocks.sapling) return net.minecraftforge.common.EnumPlantType.Plains;
|
|
||||||
+ if (this == Blocks.tallgrass) return net.minecraftforge.common.EnumPlantType.Plains;
|
|
||||||
+ if (this == Blocks.double_plant) return net.minecraftforge.common.EnumPlantType.Plains;
|
|
||||||
+ if (this == Blocks.red_flower) return net.minecraftforge.common.EnumPlantType.Plains;
|
|
||||||
+ if (this == Blocks.yellow_flower) return net.minecraftforge.common.EnumPlantType.Plains;
|
|
||||||
+ return net.minecraftforge.common.EnumPlantType.Plains;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
|
||||||
+ {
|
|
||||||
+ IBlockState state = world.getBlockState(pos);
|
|
||||||
+ if (state.getBlock() != this) return getDefaultState();
|
|
||||||
+ return state;
|
|
||||||
+ }
|
|
||||||
}
|
|
|
@ -1,46 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockButton.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockButton.java
|
|
||||||
@@ -18,6 +18,7 @@
|
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
+import static net.minecraft.util.EnumFacing.*;
|
|
||||||
|
|
||||||
public abstract class BlockButton extends Block
|
|
||||||
{
|
|
||||||
@@ -57,7 +58,7 @@
|
|
||||||
|
|
||||||
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side)
|
|
||||||
{
|
|
||||||
- return worldIn.getBlockState(pos.offset(side.getOpposite())).getBlock().isNormalCube();
|
|
||||||
+ return worldIn.isSideSolid(pos.offset(side.getOpposite()), side, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
|
||||||
@@ -69,7 +70,7 @@
|
|
||||||
{
|
|
||||||
EnumFacing enumfacing = aenumfacing[j];
|
|
||||||
|
|
||||||
- if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock().isNormalCube())
|
|
||||||
+ if (worldIn.isSideSolid(pos.offset(enumfacing), enumfacing.getOpposite(), true))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@@ -80,7 +81,7 @@
|
|
||||||
|
|
||||||
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
|
||||||
{
|
|
||||||
- return worldIn.getBlockState(pos.offset(facing.getOpposite())).getBlock().isNormalCube() ? this.getDefaultState().withProperty(FACING, facing).withProperty(POWERED, Boolean.valueOf(false)) : this.getDefaultState().withProperty(FACING, EnumFacing.DOWN).withProperty(POWERED, Boolean.valueOf(false));
|
|
||||||
+ return worldIn.isSideSolid(pos.offset(facing.getOpposite()), facing, true) ? this.getDefaultState().withProperty(FACING, facing).withProperty(POWERED, Boolean.valueOf(false)) : this.getDefaultState().withProperty(FACING, EnumFacing.DOWN).withProperty(POWERED, Boolean.valueOf(false));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock)
|
|
||||||
@@ -89,7 +90,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,37 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockCactus.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCactus.java
|
|
||||||
@@ -19,7 +19,7 @@
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
-public class BlockCactus extends Block
|
|
||||||
+public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable
|
|
||||||
{
|
|
||||||
public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15);
|
|
||||||
private static final String __OBFID = "CL_00000210";
|
|
||||||
@@ -115,7 +115,7 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
Block block = worldIn.getBlockState(pos.down()).getBlock();
|
|
||||||
- return block == Blocks.cactus || block == Blocks.sand;
|
|
||||||
+ return block.canSustainPlant(worldIn, pos.down(), EnumFacing.UP, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn)
|
|
||||||
@@ -143,4 +143,16 @@
|
|
||||||
{
|
|
||||||
return new BlockState(this, new IProperty[] {AGE});
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
|
||||||
+ {
|
|
||||||
+ return net.minecraftforge.common.EnumPlantType.Desert;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
|
|
||||||
+ {
|
|
||||||
+ return getDefaultState();
|
|
||||||
+ }
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockChest.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockChest.java
|
|
||||||
@@ -531,7 +531,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,27 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java
|
|
||||||
@@ -137,6 +137,13 @@
|
|
||||||
|
|
||||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
|
||||||
{
|
|
||||||
+ super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
|
||||||
+ {
|
|
||||||
+ java.util.List<ItemStack> dropped = super.getDrops(world, pos, state, fortune);
|
|
||||||
int j = ((Integer)state.getValue(AGE)).intValue();
|
|
||||||
byte b0 = 1;
|
|
||||||
|
|
||||||
@@ -147,8 +154,9 @@
|
|
||||||
|
|
||||||
for (int k = 0; k < b0; ++k)
|
|
||||||
{
|
|
||||||
- spawnAsEntity(worldIn, pos, new ItemStack(Items.dye, 1, EnumDyeColor.BROWN.getDyeDamage()));
|
|
||||||
+ dropped.add(new ItemStack(Items.dye, 1, EnumDyeColor.BROWN.getDyeDamage()));
|
|
||||||
}
|
|
||||||
+ return dropped;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
|
@ -1,77 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockCrops.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java
|
|
||||||
@@ -82,11 +82,11 @@
|
|
||||||
float f1 = 0.0F;
|
|
||||||
IBlockState iblockstate = worldIn.getBlockState(blockpos1.add(i, 0, j));
|
|
||||||
|
|
||||||
- if (iblockstate.getBlock() == Blocks.farmland)
|
|
||||||
+ if (iblockstate.getBlock().canSustainPlant(worldIn, blockpos1.add(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)blockIn))
|
|
||||||
{
|
|
||||||
f1 = 1.0F;
|
|
||||||
|
|
||||||
- if (((Integer)iblockstate.getValue(BlockFarmland.MOISTURE)).intValue() > 0)
|
|
||||||
+ if (iblockstate.getBlock().isFertile(worldIn, blockpos1.add(i, 0, j)))
|
|
||||||
{
|
|
||||||
f1 = 3.0F;
|
|
||||||
}
|
|
||||||
@@ -127,7 +127,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);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Item getSeed()
|
|
||||||
@@ -143,24 +143,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 j = ((Integer)state.getValue(AGE)).intValue();
|
|
||||||
-
|
|
||||||
- if (j >= 7)
|
|
||||||
- {
|
|
||||||
- int k = 3 + fortune;
|
|
||||||
-
|
|
||||||
- for (int l = 0; l < k; ++l)
|
|
||||||
- {
|
|
||||||
- if (worldIn.rand.nextInt(15) <= j)
|
|
||||||
- {
|
|
||||||
- spawnAsEntity(worldIn, pos, new ItemStack(this.getSeed(), 1, 0));
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
}
|
|
||||||
|
|
||||||
public Item getItemDropped(IBlockState state, Random rand, int fortune)
|
|
||||||
@@ -203,4 +185,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)
|
|
||||||
+ {
|
|
||||||
+ java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
|
|
||||||
+ int age = ((Integer)state.getValue(AGE)).intValue();
|
|
||||||
+ Random rand = world instanceof World ? ((World)world).rand : new Random();
|
|
||||||
+
|
|
||||||
+ if (age >= 7)
|
|
||||||
+ {
|
|
||||||
+ int k = 3 + fortune;
|
|
||||||
+
|
|
||||||
+ for (int i = 0; i < 3 + fortune; ++i)
|
|
||||||
+ {
|
|
||||||
+ if (rand.nextInt(15) <= age)
|
|
||||||
+ {
|
|
||||||
+ ret.add(new ItemStack(this.getSeed(), 1, 0));
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return ret;
|
|
||||||
+ }
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockDeadBush.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDeadBush.java
|
|
||||||
@@ -13,7 +13,7 @@
|
|
||||||
import net.minecraft.util.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
-public class BlockDeadBush extends BlockBush
|
|
||||||
+public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable
|
|
||||||
{
|
|
||||||
private static final String __OBFID = "CL_00000224";
|
|
||||||
|
|
||||||
@@ -41,14 +41,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(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,20 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockDoor.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java
|
|
||||||
@@ -149,7 +149,7 @@
|
|
||||||
{
|
|
||||||
if (this.blockMaterial == Material.iron)
|
|
||||||
{
|
|
||||||
- return true;
|
|
||||||
+ return false; //Allow items to interact with the door
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@@ -267,7 +267,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()
|
|
|
@ -1,89 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockDoublePlant.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockDoublePlant.java
|
|
||||||
@@ -24,7 +24,7 @@
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
-public class BlockDoublePlant extends BlockBush implements IGrowable
|
|
||||||
+public class BlockDoublePlant extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable
|
|
||||||
{
|
|
||||||
public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BlockDoublePlant.EnumPlantType.class);
|
|
||||||
public static final PropertyEnum HALF = PropertyEnum.create("half", BlockDoublePlant.EnumBlockHalf.class);
|
|
||||||
@@ -89,6 +89,8 @@
|
|
||||||
Object object = flag ? this : worldIn.getBlockState(blockpos1).getBlock();
|
|
||||||
Object object1 = flag ? worldIn.getBlockState(blockpos2).getBlock() : this;
|
|
||||||
|
|
||||||
+ if (!flag) this.dropBlockAsItem(worldIn, pos, state, 0); //Forge move above the setting to air.
|
|
||||||
+
|
|
||||||
if (object == this)
|
|
||||||
{
|
|
||||||
worldIn.setBlockState(blockpos1, Blocks.air.getDefaultState(), 3);
|
|
||||||
@@ -97,17 +99,13 @@
|
|
||||||
if (object1 == this)
|
|
||||||
{
|
|
||||||
worldIn.setBlockState(blockpos2, Blocks.air.getDefaultState(), 3);
|
|
||||||
-
|
|
||||||
- if (!flag)
|
|
||||||
- {
|
|
||||||
- this.dropBlockAsItem(worldIn, blockpos2, state, 0);
|
|
||||||
- }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state)
|
|
||||||
{
|
|
||||||
+ if (state.getBlock() != this) return super.canBlockStay(worldIn, pos, state); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
|
|
||||||
if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER)
|
|
||||||
{
|
|
||||||
return worldIn.getBlockState(pos.down()).getBlock() == this;
|
|
||||||
@@ -157,7 +155,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);
|
|
||||||
}
|
|
||||||
@@ -220,8 +217,6 @@
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]);
|
|
||||||
- int i = (enumplanttype == BlockDoublePlant.EnumPlantType.GRASS ? BlockTallGrass.EnumType.GRASS : BlockTallGrass.EnumType.FERN).getMeta();
|
|
||||||
- spawnAsEntity(worldIn, pos, new ItemStack(Blocks.tallgrass, 2, i));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -296,6 +291,32 @@
|
|
||||||
return Block.EnumOffsetType.XZ;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Override
|
|
||||||
+ public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos)
|
|
||||||
+ {
|
|
||||||
+ IBlockState state = world.getBlockState(pos);
|
|
||||||
+ EnumPlantType type = (EnumPlantType)state.getValue(VARIANT);
|
|
||||||
+ return state.getValue(HALF) == EnumBlockHalf.LOWER && (type == EnumPlantType.FERN || type == EnumPlantType.GRASS);
|
|
||||||
+ }
|
|
||||||
+ @Override
|
|
||||||
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
|
||||||
+ {
|
|
||||||
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
|
||||||
+ EnumPlantType type = (EnumPlantType)world.getBlockState(pos).getValue(VARIANT);
|
|
||||||
+ if (type == EnumPlantType.FERN) ret.add(new ItemStack(Blocks.tallgrass, 2, BlockTallGrass.EnumType.FERN.getMeta()));
|
|
||||||
+ if (type == EnumPlantType.GRASS) ret.add(new ItemStack(Blocks.tallgrass, 2, BlockTallGrass.EnumType.GRASS.getMeta()));
|
|
||||||
+ return ret;
|
|
||||||
+ }
|
|
||||||
+ @Override
|
|
||||||
+ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
|
||||||
+ {
|
|
||||||
+ //Forge: Break both parts on the client to prevent the top part flickering as default type for a few frames.
|
|
||||||
+ IBlockState state = world.getBlockState(pos);
|
|
||||||
+ if (state.getBlock() == this && state.getValue(HALF) == EnumBlockHalf.LOWER && world.getBlockState(pos.up()).getBlock() == this)
|
|
||||||
+ world.setBlockToAir(pos.up());
|
|
||||||
+ return world.setBlockToAir(pos);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
static enum EnumBlockHalf implements IStringSerializable
|
|
||||||
{
|
|
||||||
UPPER,
|
|
|
@ -1,10 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockFalling.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java
|
|
||||||
@@ -85,6 +85,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,11 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java
|
|
||||||
@@ -89,7 +89,7 @@
|
|
||||||
private boolean hasCrops(World worldIn, BlockPos pos)
|
|
||||||
{
|
|
||||||
Block block = worldIn.getBlockState(pos.up()).getBlock();
|
|
||||||
- return block instanceof BlockCrops || block instanceof BlockStem;
|
|
||||||
+ return block instanceof net.minecraftforge.common.IPlantable && canSustainPlant(worldIn, pos, net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)block);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean hasWater(World worldIn, BlockPos pos)
|
|
|
@ -1,211 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockFire.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFire.java
|
|
||||||
@@ -42,18 +42,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
|
|
||||||
{
|
|
||||||
@@ -109,6 +115,7 @@
|
|
||||||
|
|
||||||
public void setFireInfo(Block blockIn, int encouragement, int flammability)
|
|
||||||
{
|
|
||||||
+ if (blockIn == Blocks.air) throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
|
|
||||||
this.encouragements.put(blockIn, Integer.valueOf(encouragement));
|
|
||||||
this.flammabilities.put(blockIn, Integer.valueOf(flammability));
|
|
||||||
}
|
|
||||||
@@ -148,13 +155,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);
|
|
||||||
@@ -183,7 +185,7 @@
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (!this.canCatchFire(worldIn, pos.down()) && i == 15 && rand.nextInt(4) == 0)
|
|
||||||
+ if (!this.canCatchFire(worldIn, pos.down(), EnumFacing.UP) && i == 15 && rand.nextInt(4) == 0)
|
|
||||||
{
|
|
||||||
worldIn.setBlockToAir(pos);
|
|
||||||
return;
|
|
||||||
@@ -198,12 +200,12 @@
|
|
||||||
b0 = -50;
|
|
||||||
}
|
|
||||||
|
|
||||||
- this.catchOnFire(worldIn, pos.east(), 300 + b0, rand, i);
|
|
||||||
- this.catchOnFire(worldIn, pos.west(), 300 + b0, rand, i);
|
|
||||||
- this.catchOnFire(worldIn, pos.down(), 250 + b0, rand, i);
|
|
||||||
- this.catchOnFire(worldIn, pos.up(), 250 + b0, rand, i);
|
|
||||||
- this.catchOnFire(worldIn, pos.north(), 300 + b0, rand, i);
|
|
||||||
- this.catchOnFire(worldIn, pos.south(), 300 + b0, rand, i);
|
|
||||||
+ this.tryCatchFire(worldIn, pos.east(), 300 + b0, rand, i, EnumFacing.WEST);
|
|
||||||
+ this.tryCatchFire(worldIn, pos.west(), 300 + b0, rand, i, EnumFacing.EAST);
|
|
||||||
+ this.tryCatchFire(worldIn, pos.down(), 250 + b0, rand, i, EnumFacing.UP);
|
|
||||||
+ this.tryCatchFire(worldIn, pos.up(), 250 + b0, rand, i, EnumFacing.DOWN);
|
|
||||||
+ this.tryCatchFire(worldIn, pos.north(), 300 + b0, rand, i, EnumFacing.SOUTH);
|
|
||||||
+ this.tryCatchFire(worldIn, pos.south(), 300 + b0, rand, i, EnumFacing.NORTH);
|
|
||||||
|
|
||||||
for (int j = -1; j <= 1; ++j)
|
|
||||||
{
|
|
||||||
@@ -262,22 +264,30 @@
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated // Use Block.getFlammability
|
|
||||||
public int getFlammability(Block blockIn)
|
|
||||||
{
|
|
||||||
Integer integer = (Integer)this.flammabilities.get(blockIn);
|
|
||||||
return integer == null ? 0 : integer.intValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated // Use Block.getFlammability
|
|
||||||
public int getEncouragement(Block blockIn)
|
|
||||||
{
|
|
||||||
Integer integer = (Integer)this.encouragements.get(blockIn);
|
|
||||||
return integer == null ? 0 : integer.intValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated // Use tryCatchFire with face below
|
|
||||||
private void catchOnFire(World worldIn, BlockPos pos, int chance, Random random, int age)
|
|
||||||
{
|
|
||||||
- int k = this.getFlammability(worldIn.getBlockState(pos).getBlock());
|
|
||||||
+ this.tryCatchFire(worldIn, pos, chance, random, age, EnumFacing.UP);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
+ private void tryCatchFire(World worldIn, BlockPos pos, int chance, Random random, int age, EnumFacing face)
|
|
||||||
+ {
|
|
||||||
+ int k = worldIn.getBlockState(pos).getBlock().getFlammability(worldIn, pos, face);
|
|
||||||
+
|
|
||||||
if (random.nextInt(chance) < k)
|
|
||||||
{
|
|
||||||
IBlockState iblockstate = worldIn.getBlockState(pos);
|
|
||||||
@@ -314,7 +324,7 @@
|
|
||||||
{
|
|
||||||
EnumFacing enumfacing = aenumfacing[j];
|
|
||||||
|
|
||||||
- if (this.canCatchFire(worldIn, pos.offset(enumfacing)))
|
|
||||||
+ if (this.canCatchFire(worldIn, pos.offset(enumfacing), enumfacing.getOpposite()))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@@ -338,7 +348,7 @@
|
|
||||||
for (int k = 0; k < j; ++k)
|
|
||||||
{
|
|
||||||
EnumFacing enumfacing = aenumfacing[k];
|
|
||||||
- i = Math.max(this.getEncouragement(worldIn.getBlockState(pos.offset(enumfacing)).getBlock()), i);
|
|
||||||
+ i = Math.max(worldIn.getBlockState(pos.offset(enumfacing)).getBlock().getFlammability(worldIn, pos.offset(enumfacing), enumfacing.getOpposite()), i);
|
|
||||||
}
|
|
||||||
|
|
||||||
return i;
|
|
||||||
@@ -350,9 +360,10 @@
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Deprecated // Use canCatchFire with face sensitive version below
|
|
||||||
public boolean canCatchFire(IBlockAccess worldIn, BlockPos pos)
|
|
||||||
{
|
|
||||||
- return this.getEncouragement(worldIn.getBlockState(pos).getBlock()) > 0;
|
|
||||||
+ return canCatchFire(worldIn, pos, EnumFacing.UP);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
|
||||||
@@ -396,9 +407,9 @@
|
|
||||||
double d1;
|
|
||||||
double d2;
|
|
||||||
|
|
||||||
- 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 (i = 0; i < 2; ++i)
|
|
||||||
{
|
|
||||||
@@ -409,7 +420,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (Blocks.fire.canCatchFire(worldIn, pos.east()))
|
|
||||||
+ if (Blocks.fire.canCatchFire(worldIn, pos.east(), EnumFacing.WEST))
|
|
||||||
{
|
|
||||||
for (i = 0; i < 2; ++i)
|
|
||||||
{
|
|
||||||
@@ -420,7 +431,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (Blocks.fire.canCatchFire(worldIn, pos.north()))
|
|
||||||
+ if (Blocks.fire.canCatchFire(worldIn, pos.north(), EnumFacing.SOUTH))
|
|
||||||
{
|
|
||||||
for (i = 0; i < 2; ++i)
|
|
||||||
{
|
|
||||||
@@ -431,7 +442,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (Blocks.fire.canCatchFire(worldIn, pos.south()))
|
|
||||||
+ if (Blocks.fire.canCatchFire(worldIn, pos.south(), EnumFacing.NORTH))
|
|
||||||
{
|
|
||||||
for (i = 0; i < 2; ++i)
|
|
||||||
{
|
|
||||||
@@ -442,7 +453,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (Blocks.fire.canCatchFire(worldIn, pos.up()))
|
|
||||||
+ if (Blocks.fire.canCatchFire(worldIn, pos.up(), EnumFacing.DOWN))
|
|
||||||
{
|
|
||||||
for (i = 0; i < 2; ++i)
|
|
||||||
{
|
|
||||||
@@ -490,4 +501,19 @@
|
|
||||||
{
|
|
||||||
return new BlockState(this, new IProperty[] {AGE, NORTH, EAST, SOUTH, WEST, UPPER, FLIP, ALT});
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ /*================================= Forge Start ======================================*/
|
|
||||||
+ /**
|
|
||||||
+ * Side sensitive version that calls the block function.
|
|
||||||
+ *
|
|
||||||
+ * @param world The current world
|
|
||||||
+ * @param pos Block position
|
|
||||||
+ * @param face The side the fire is coming from
|
|
||||||
+ * @return True if the face can catch fire.
|
|
||||||
+ */
|
|
||||||
+ public boolean canCatchFire(IBlockAccess world, BlockPos pos, EnumFacing face)
|
|
||||||
+ {
|
|
||||||
+ return world.getBlockState(pos).getBlock().isFlammable(world, pos, face);
|
|
||||||
+ }
|
|
||||||
+ /*================================= Forge Start ======================================*/
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java
|
|
||||||
@@ -162,13 +162,6 @@
|
|
||||||
|
|
||||||
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
|
|
||||||
{
|
|
||||||
- TileEntityFlowerPot tileentityflowerpot = this.getTileEntity(worldIn, pos);
|
|
||||||
-
|
|
||||||
- if (tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null)
|
|
||||||
- {
|
|
||||||
- spawnAsEntity(worldIn, pos, new ItemStack(tileentityflowerpot.getFlowerPotItem(), 1, tileentityflowerpot.getFlowerPotData()));
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
super.breakBlock(worldIn, pos, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -388,6 +381,31 @@
|
|
||||||
return EnumWorldBlockLayer.CUTOUT;
|
|
||||||
}
|
|
||||||
|
|
||||||
+
|
|
||||||
+ /*============================FORGE START=====================================*/
|
|
||||||
+ @Override
|
|
||||||
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
|
||||||
+ {
|
|
||||||
+ java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
|
|
||||||
+ TileEntityFlowerPot te = world.getTileEntity(pos) instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)world.getTileEntity(pos) : null;
|
|
||||||
+ if (te != null && te.getFlowerPotItem() != null)
|
|
||||||
+ ret.add(new ItemStack(te.getFlowerPotItem(), 1, te.getFlowerPotData()));
|
|
||||||
+ return ret;
|
|
||||||
+ }
|
|
||||||
+ @Override
|
|
||||||
+ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
|
||||||
+ {
|
|
||||||
+ if (willHarvest) return true; //If it will harvest, delay deletion of the block until after getDrops
|
|
||||||
+ return super.removedByPlayer(world, pos, player, willHarvest);
|
|
||||||
+ }
|
|
||||||
+ @Override
|
|
||||||
+ public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te)
|
|
||||||
+ {
|
|
||||||
+ super.harvestBlock(world, player, pos, state, te);
|
|
||||||
+ world.setBlockToAir(pos);
|
|
||||||
+ }
|
|
||||||
+ /*===========================FORGE END==========================================*/
|
|
||||||
+
|
|
||||||
public static enum EnumFlowerType implements IStringSerializable
|
|
||||||
{
|
|
||||||
EMPTY("empty"),
|
|
|
@ -1,41 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockGrass.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java
|
|
||||||
@@ -59,7 +59,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());
|
|
||||||
}
|
|
||||||
@@ -73,7 +73,7 @@
|
|
||||||
Block block = worldIn.getBlockState(blockpos1.up()).getBlock();
|
|
||||||
IBlockState iblockstate1 = worldIn.getBlockState(blockpos1);
|
|
||||||
|
|
||||||
- if (iblockstate1.getBlock() == Blocks.dirt && iblockstate1.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && worldIn.getLightFromNeighbors(blockpos1.up()) >= 4 && block.getLightOpacity() <= 2)
|
|
||||||
+ if (iblockstate1.getBlock() == Blocks.dirt && iblockstate1.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && worldIn.getLightFromNeighbors(blockpos1.up()) >= 4 && block.getLightOpacity(worldIn, blockpos1.up()) <= 2)
|
|
||||||
{
|
|
||||||
worldIn.setBlockState(blockpos1, Blocks.grass.getDefaultState());
|
|
||||||
}
|
|
||||||
@@ -120,18 +120,11 @@
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- else if (worldIn.getBlockState(blockpos2).getBlock().blockMaterial == Material.air)
|
|
||||||
+ else if (worldIn.isAirBlock(blockpos2))
|
|
||||||
{
|
|
||||||
if (rand.nextInt(8) == 0)
|
|
||||||
{
|
|
||||||
- BlockFlower.EnumFlowerType enumflowertype = worldIn.getBiomeGenForCoords(blockpos2).pickRandomFlower(rand, blockpos2);
|
|
||||||
- BlockFlower blockflower = enumflowertype.getBlockType().getBlock();
|
|
||||||
- IBlockState iblockstate1 = blockflower.getDefaultState().withProperty(blockflower.getTypeProperty(), enumflowertype);
|
|
||||||
-
|
|
||||||
- if (blockflower.canBlockStay(worldIn, blockpos2, iblockstate1))
|
|
||||||
- {
|
|
||||||
- worldIn.setBlockState(blockpos2, iblockstate1, 3);
|
|
||||||
- }
|
|
||||||
+ worldIn.getBiomeGenForCoords(blockpos2).plantFlower(worldIn, rand, blockpos2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
|
@ -1,23 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockHugeMushroom.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockHugeMushroom.java
|
|
||||||
@@ -64,6 +64,20 @@
|
|
||||||
return new BlockState(this, new IProperty[] {VARIANT});
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
|
||||||
+ {
|
|
||||||
+ IBlockState state = world.getBlockState(pos);
|
|
||||||
+ for (IProperty prop : (java.util.Set<IProperty>)state.getProperties().keySet())
|
|
||||||
+ {
|
|
||||||
+ if (prop.getName().equals("variant"))
|
|
||||||
+ {
|
|
||||||
+ world.setBlockState(pos, state.cycleProperty(prop));
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public static enum EnumType implements IStringSerializable
|
|
||||||
{
|
|
||||||
NORTH_WEST(1, "north_west"),
|
|
|
@ -1,35 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockIce.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockIce.java
|
|
||||||
@@ -40,14 +40,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
|
|
||||||
{
|
|
||||||
@@ -58,7 +61,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,32 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockLadder.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java
|
|
||||||
@@ -80,7 +80,10 @@
|
|
||||||
|
|
||||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
|
||||||
{
|
|
||||||
- return worldIn.getBlockState(pos.west()).getBlock().isNormalCube() ? true : (worldIn.getBlockState(pos.east()).getBlock().isNormalCube() ? true : (worldIn.getBlockState(pos.north()).getBlock().isNormalCube() ? true : worldIn.getBlockState(pos.south()).getBlock().isNormalCube()));
|
|
||||||
+ return worldIn.isSideSolid(pos.west(), EnumFacing.EAST, true) ||
|
|
||||||
+ worldIn.isSideSolid(pos.east(), EnumFacing.WEST, true) ||
|
|
||||||
+ worldIn.isSideSolid(pos.north(), EnumFacing.SOUTH, true) ||
|
|
||||||
+ worldIn.isSideSolid(pos.south(), EnumFacing.NORTH, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
|
||||||
@@ -124,7 +127,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);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@@ -155,6 +158,8 @@
|
|
||||||
return new BlockState(this, new IProperty[] {FACING});
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; }
|
|
||||||
+
|
|
||||||
static final class SwitchEnumFacing
|
|
||||||
{
|
|
||||||
static final int[] FACING_LOOKUP = new int[EnumFacing.values().length];
|
|
|
@ -1,130 +0,0 @@
|
||||||
--- ../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");
|
|
||||||
@@ -76,9 +76,9 @@
|
|
||||||
BlockPos blockpos1 = pos.add(i1, j1, k1);
|
|
||||||
IBlockState iblockstate1 = worldIn.getBlockState(blockpos1);
|
|
||||||
|
|
||||||
- if (iblockstate1.getBlock().getMaterial() == Material.leaves && !((Boolean)iblockstate1.getValue(CHECK_DECAY)).booleanValue())
|
|
||||||
+ if (iblockstate1.getBlock().isLeaves(worldIn, blockpos1))
|
|
||||||
{
|
|
||||||
- worldIn.setBlockState(blockpos1, iblockstate1.withProperty(CHECK_DECAY, Boolean.valueOf(true)), 4);
|
|
||||||
+ iblockstate1.getBlock().beginLeavesDecay(worldIn, blockpos1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -119,11 +119,12 @@
|
|
||||||
{
|
|
||||||
for (i2 = -b0; i2 <= b0; ++i2)
|
|
||||||
{
|
|
||||||
- Block block = worldIn.getBlockState(new BlockPos(j + k1, k + l1, l + i2)).getBlock();
|
|
||||||
+ BlockPos tmp = new BlockPos(j + k1, k + l1, l + i2);
|
|
||||||
+ Block block = worldIn.getBlockState(tmp).getBlock();
|
|
||||||
|
|
||||||
- if (block != Blocks.log && block != Blocks.log2)
|
|
||||||
+ if (!block.canSustainLeaves(worldIn, tmp))
|
|
||||||
{
|
|
||||||
- if (block.getMaterial() == Material.leaves)
|
|
||||||
+ if (block.isLeaves(worldIn, tmp))
|
|
||||||
{
|
|
||||||
this.surroundings[(k1 + j1) * i1 + (l1 + j1) * b1 + i2 + j1] = -2;
|
|
||||||
}
|
|
||||||
@@ -230,40 +231,7 @@
|
|
||||||
|
|
||||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
|
||||||
{
|
|
||||||
- if (!worldIn.isRemote)
|
|
||||||
- {
|
|
||||||
- int j = this.getSaplingDropChance(state);
|
|
||||||
-
|
|
||||||
- if (fortune > 0)
|
|
||||||
- {
|
|
||||||
- j -= 2 << fortune;
|
|
||||||
-
|
|
||||||
- if (j < 10)
|
|
||||||
- {
|
|
||||||
- j = 10;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (worldIn.rand.nextInt(j) == 0)
|
|
||||||
- {
|
|
||||||
- Item item = this.getItemDropped(state, worldIn.rand, fortune);
|
|
||||||
- spawnAsEntity(worldIn, pos, new ItemStack(item, 1, this.damageDropped(state)));
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- j = 200;
|
|
||||||
-
|
|
||||||
- if (fortune > 0)
|
|
||||||
- {
|
|
||||||
- j -= 10 << fortune;
|
|
||||||
-
|
|
||||||
- if (j < 40)
|
|
||||||
- {
|
|
||||||
- j = 40;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- this.dropApple(worldIn, pos, state, j);
|
|
||||||
- }
|
|
||||||
+ super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void dropApple(World worldIn, BlockPos pos, IBlockState state, int chance) {}
|
|
||||||
@@ -298,4 +266,48 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
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; }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void beginLeavesDecay(World world, BlockPos pos)
|
|
||||||
+ {
|
|
||||||
+ IBlockState state = world.getBlockState(pos);
|
|
||||||
+ if (!(Boolean)state.getValue(CHECK_DECAY))
|
|
||||||
+ {
|
|
||||||
+ world.setBlockState(pos, state.withProperty(CHECK_DECAY, true), 4);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
|
||||||
+ {
|
|
||||||
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
|
||||||
+ Random rand = world instanceof World ? ((World)world).rand : new Random();
|
|
||||||
+ int chance = this.getSaplingDropChance(state);
|
|
||||||
+
|
|
||||||
+ if (fortune > 0)
|
|
||||||
+ {
|
|
||||||
+ chance -= 2 << fortune;
|
|
||||||
+ if (chance < 10) chance = 10;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (rand.nextInt(chance) == 0)
|
|
||||||
+ ret.add(new ItemStack(getItemDropped(state, rand, fortune), 1, damageDropped(state)));
|
|
||||||
+
|
|
||||||
+ chance = 200;
|
|
||||||
+ if (fortune > 0)
|
|
||||||
+ {
|
|
||||||
+ chance -= 10 << fortune;
|
|
||||||
+ if (chance < 40) chance = 40;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ this.captureDrops(true);
|
|
||||||
+ if (world instanceof World)
|
|
||||||
+ this.dropApple((World)world, pos, state, chance); // Dammet mojang
|
|
||||||
+ ret.addAll(this.captureDrops(false));
|
|
||||||
+ return ret;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
}
|
|
|
@ -1,67 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockLever.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLever.java
|
|
||||||
@@ -47,24 +47,24 @@
|
|
||||||
|
|
||||||
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side)
|
|
||||||
{
|
|
||||||
- return side == EnumFacing.UP && World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) ? true : this.canSustainLever(worldIn, pos.offset(side.getOpposite()));
|
|
||||||
+ return side == EnumFacing.UP && World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) ? true : worldIn.isSideSolid(pos.offset(side.getOpposite()), side);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
|
||||||
{
|
|
||||||
- return this.canSustainLever(worldIn, pos.west()) ? true : (this.canSustainLever(worldIn, pos.east()) ? true : (this.canSustainLever(worldIn, pos.north()) ? true : (this.canSustainLever(worldIn, pos.south()) ? true : (World.doesBlockHaveSolidTopSurface(worldIn, pos.down()) ? true : this.canSustainLever(worldIn, pos.up())))));
|
|
||||||
+ return worldIn.isSideSolid(pos.west(), EnumFacing.EAST ) ||
|
|
||||||
+ worldIn.isSideSolid(pos.east(), EnumFacing.WEST ) ||
|
|
||||||
+ worldIn.isSideSolid(pos.north(), EnumFacing.SOUTH) ||
|
|
||||||
+ worldIn.isSideSolid(pos.south(), EnumFacing.NORTH) ||
|
|
||||||
+ worldIn.isSideSolid(pos.down(), EnumFacing.UP ) ||
|
|
||||||
+ worldIn.isSideSolid(pos.up(), EnumFacing.DOWN );
|
|
||||||
}
|
|
||||||
|
|
||||||
- protected boolean canSustainLever(World worldIn, BlockPos pos)
|
|
||||||
- {
|
|
||||||
- return worldIn.getBlockState(pos).getBlock().isNormalCube();
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
|
||||||
{
|
|
||||||
IBlockState iblockstate = this.getDefaultState().withProperty(POWERED, Boolean.valueOf(false));
|
|
||||||
|
|
||||||
- if (this.canSustainLever(worldIn, pos.offset(facing.getOpposite())))
|
|
||||||
+ if (worldIn.isSideSolid(pos.offset(facing.getOpposite()), facing))
|
|
||||||
{
|
|
||||||
return iblockstate.withProperty(FACING, BlockLever.EnumOrientation.forFacings(facing, placer.getHorizontalFacing()));
|
|
||||||
}
|
|
||||||
@@ -87,7 +87,7 @@
|
|
||||||
|
|
||||||
enumfacing1 = (EnumFacing)iterator.next();
|
|
||||||
}
|
|
||||||
- while (enumfacing1 == facing || !this.canSustainLever(worldIn, pos.offset(enumfacing1.getOpposite())));
|
|
||||||
+ while (enumfacing1 == facing || !worldIn.isSideSolid(pos.offset(enumfacing1.getOpposite()), enumfacing1));
|
|
||||||
|
|
||||||
return iblockstate.withProperty(FACING, BlockLever.EnumOrientation.forFacings(enumfacing1, placer.getHorizontalFacing()));
|
|
||||||
}
|
|
||||||
@@ -116,7 +116,8 @@
|
|
||||||
|
|
||||||
public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock)
|
|
||||||
{
|
|
||||||
- if (this.checkForDrop(worldIn, pos) && !this.canSustainLever(worldIn, pos.offset(((BlockLever.EnumOrientation)state.getValue(FACING)).getFacing().getOpposite())))
|
|
||||||
+ EnumFacing dir = ((BlockLever.EnumOrientation)state.getValue(FACING)).getFacing();
|
|
||||||
+ if (this.checkForDrop(worldIn, pos) && !worldIn.isSideSolid(pos.offset(dir.getOpposite()), dir))
|
|
||||||
{
|
|
||||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
|
||||||
worldIn.setBlockToAir(pos);
|
|
||||||
@@ -235,6 +236,12 @@
|
|
||||||
return new BlockState(this, new IProperty[] {FACING, POWERED});
|
|
||||||
}
|
|
||||||
|
|
||||||
+
|
|
||||||
+ private boolean canAttach(World world, BlockPos pos, EnumFacing side)
|
|
||||||
+ {
|
|
||||||
+ return world.isSideSolid(pos, side);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public static enum EnumOrientation implements IStringSerializable
|
|
||||||
{
|
|
||||||
DOWN_X(0, "down_x", EnumFacing.DOWN),
|
|
|
@ -1,24 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockLog.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockLog.java
|
|
||||||
@@ -38,9 +38,9 @@
|
|
||||||
BlockPos blockpos1 = (BlockPos)iterator.next();
|
|
||||||
IBlockState iblockstate1 = worldIn.getBlockState(blockpos1);
|
|
||||||
|
|
||||||
- if (iblockstate1.getBlock().getMaterial() == Material.leaves && !((Boolean)iblockstate1.getValue(BlockLeaves.CHECK_DECAY)).booleanValue())
|
|
||||||
+ if (iblockstate1.getBlock().isLeaves(worldIn, blockpos1))
|
|
||||||
{
|
|
||||||
- worldIn.setBlockState(blockpos1, iblockstate1.withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(true)), 4);
|
|
||||||
+ iblockstate1.getBlock().beginLeavesDecay(worldIn, blockpos1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -51,6 +51,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; }
|
|
||||||
+ @Override public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
|
|
||||||
+
|
|
||||||
public static enum EnumAxis implements IStringSerializable
|
|
||||||
{
|
|
||||||
X("x"),
|
|
|
@ -1,19 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java
|
|
||||||
@@ -39,10 +39,14 @@
|
|
||||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
|
||||||
{
|
|
||||||
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
|
|
||||||
- int j = 15 + worldIn.rand.nextInt(15) + worldIn.rand.nextInt(15);
|
|
||||||
- this.dropXpOnBlockBreak(worldIn, pos, j);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @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
|
|
||||||
@@ -76,7 +76,7 @@
|
|
||||||
if (pos.getY() >= 0 && pos.getY() < 256)
|
|
||||||
{
|
|
||||||
IBlockState iblockstate1 = worldIn.getBlockState(pos.down());
|
|
||||||
- return iblockstate1.getBlock() == Blocks.mycelium ? true : (iblockstate1.getBlock() == Blocks.dirt && iblockstate1.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.PODZOL ? true : worldIn.getLight(pos) < 13 && this.canPlaceBlockOn(iblockstate1.getBlock()));
|
|
||||||
+ return iblockstate1.getBlock() == Blocks.mycelium ? true : (iblockstate1.getBlock() == Blocks.dirt && iblockstate1.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.PODZOL ? true : worldIn.getLight(pos) < 13 && iblockstate1.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 iblockstate1 = worldIn.getBlockState(blockpos1);
|
|
||||||
Block block = worldIn.getBlockState(blockpos1.up()).getBlock();
|
|
||||||
|
|
||||||
- if (iblockstate1.getBlock() == Blocks.dirt && iblockstate1.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && worldIn.getLightFromNeighbors(blockpos1.up()) >= 4 && block.getLightOpacity() <= 2)
|
|
||||||
+ if (iblockstate1.getBlock() == Blocks.dirt && iblockstate1.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && worldIn.getLightFromNeighbors(blockpos1.up()) >= 4 && block.getLightOpacity(worldIn, blockpos1.up()) <= 2)
|
|
||||||
{
|
|
||||||
worldIn.setBlockState(blockpos1, this.getDefaultState());
|
|
||||||
}
|
|
|
@ -1,49 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockNetherWart.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java
|
|
||||||
@@ -36,7 +36,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)
|
|
||||||
@@ -52,9 +52,11 @@
|
|
||||||
super.updateTick(worldIn, pos, state, rand);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @SuppressWarnings("unused")
|
|
||||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
|
||||||
{
|
|
||||||
- if (!worldIn.isRemote)
|
|
||||||
+ super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
|
|
||||||
+ if (false && !worldIn.isRemote)
|
|
||||||
{
|
|
||||||
int j = 1;
|
|
||||||
|
|
||||||
@@ -105,4 +107,24 @@
|
|
||||||
{
|
|
||||||
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)
|
|
||||||
+ {
|
|
||||||
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
|
||||||
+ Random rand = world instanceof World ? ((World)world).rand : new Random();
|
|
||||||
+ int count = 1;
|
|
||||||
+
|
|
||||||
+ if (((Integer)state.getValue(AGE)) >= 3)
|
|
||||||
+ {
|
|
||||||
+ count = 2 + rand.nextInt(3) + (fortune > 0 ? rand.nextInt(fortune + 1) : 0);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ for (int i = 0; i < count; i++)
|
|
||||||
+ {
|
|
||||||
+ ret.add(new ItemStack(Items.nether_wart));
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return ret;
|
|
||||||
+ }
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockNewLeaf.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNewLeaf.java
|
|
||||||
@@ -105,14 +105,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,23 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockNote.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockNote.java
|
|
||||||
@@ -58,7 +58,9 @@
|
|
||||||
if (tileentity instanceof TileEntityNote)
|
|
||||||
{
|
|
||||||
TileEntityNote tileentitynote = (TileEntityNote)tileentity;
|
|
||||||
+ int old = tileentitynote.note;
|
|
||||||
tileentitynote.changePitch();
|
|
||||||
+ if (old == tileentitynote.note) return false;
|
|
||||||
tileentitynote.triggerNote(worldIn, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -96,6 +98,10 @@
|
|
||||||
|
|
||||||
public boolean onBlockEventReceived(World worldIn, BlockPos pos, IBlockState state, int eventID, int eventParam)
|
|
||||||
{
|
|
||||||
+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(worldIn, pos, state, eventParam, eventID);
|
|
||||||
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false;
|
|
||||||
+ eventID = e.instrument.ordinal();
|
|
||||||
+ eventParam = e.getVanillaNoteId();
|
|
||||||
float f = (float)Math.pow(2.0D, (double)(eventParam - 12) / 12.0D);
|
|
||||||
worldIn.playSoundEffect((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, "note." + this.getInstrument(eventID), 3.0F, f);
|
|
||||||
worldIn.spawnParticle(EnumParticleTypes.NOTE, (double)pos.getX() + 0.5D, (double)pos.getY() + 1.2D, (double)pos.getZ() + 0.5D, (double)eventParam / 24.0D, 0.0D, 0.0D, new int[0]);
|
|
|
@ -1,21 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockOldLeaf.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockOldLeaf.java
|
|
||||||
@@ -148,11 +148,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,59 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockOre.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockOre.java
|
|
||||||
@@ -10,6 +10,7 @@
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.util.BlockPos;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
+import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class BlockOre extends Block
|
|
||||||
@@ -54,34 +55,40 @@
|
|
||||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
|
||||||
{
|
|
||||||
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
|
|
||||||
-
|
|
||||||
- if (this.getItemDropped(state, worldIn.rand, fortune) != Item.getItemFromBlock(this))
|
|
||||||
+ }
|
|
||||||
+ @Override
|
|
||||||
+ public int getExpDrop(IBlockAccess world, BlockPos pos, int fortune)
|
|
||||||
+ {
|
|
||||||
+ IBlockState state = world.getBlockState(pos);
|
|
||||||
+ Random rand = world instanceof World ? ((World)world).rand : new Random();
|
|
||||||
+ if (this.getItemDropped(state, rand, fortune) != Item.getItemFromBlock(this))
|
|
||||||
{
|
|
||||||
int j = 0;
|
|
||||||
|
|
||||||
if (this == Blocks.coal_ore)
|
|
||||||
{
|
|
||||||
- j = MathHelper.getRandomIntegerInRange(worldIn.rand, 0, 2);
|
|
||||||
+ j = MathHelper.getRandomIntegerInRange(rand, 0, 2);
|
|
||||||
}
|
|
||||||
else if (this == Blocks.diamond_ore)
|
|
||||||
{
|
|
||||||
- j = MathHelper.getRandomIntegerInRange(worldIn.rand, 3, 7);
|
|
||||||
+ j = MathHelper.getRandomIntegerInRange(rand, 3, 7);
|
|
||||||
}
|
|
||||||
else if (this == Blocks.emerald_ore)
|
|
||||||
{
|
|
||||||
- j = MathHelper.getRandomIntegerInRange(worldIn.rand, 3, 7);
|
|
||||||
+ j = MathHelper.getRandomIntegerInRange(rand, 3, 7);
|
|
||||||
}
|
|
||||||
else if (this == Blocks.lapis_ore)
|
|
||||||
{
|
|
||||||
- j = MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5);
|
|
||||||
+ j = MathHelper.getRandomIntegerInRange(rand, 2, 5);
|
|
||||||
}
|
|
||||||
else if (this == Blocks.quartz_ore)
|
|
||||||
{
|
|
||||||
- j = MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5);
|
|
||||||
+ j = MathHelper.getRandomIntegerInRange(rand, 2, 5);
|
|
||||||
}
|
|
||||||
|
|
||||||
- this.dropXpOnBlockBreak(worldIn, pos, j);
|
|
||||||
+ return j;
|
|
||||||
}
|
|
||||||
+ return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getDamageValue(World worldIn, BlockPos pos)
|
|
|
@ -1,41 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockPane.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPane.java
|
|
||||||
@@ -39,7 +39,10 @@
|
|
||||||
|
|
||||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
|
||||||
{
|
|
||||||
- return state.withProperty(NORTH, Boolean.valueOf(this.canPaneConnectToBlock(worldIn.getBlockState(pos.north()).getBlock()))).withProperty(SOUTH, Boolean.valueOf(this.canPaneConnectToBlock(worldIn.getBlockState(pos.south()).getBlock()))).withProperty(WEST, Boolean.valueOf(this.canPaneConnectToBlock(worldIn.getBlockState(pos.west()).getBlock()))).withProperty(EAST, Boolean.valueOf(this.canPaneConnectToBlock(worldIn.getBlockState(pos.east()).getBlock())));
|
|
||||||
+ return state.withProperty(NORTH, canPaneConnectTo(worldIn, pos, EnumFacing.NORTH))
|
|
||||||
+ .withProperty(SOUTH, canPaneConnectTo(worldIn, pos, EnumFacing.SOUTH))
|
|
||||||
+ .withProperty(WEST, canPaneConnectTo(worldIn, pos, EnumFacing.WEST))
|
|
||||||
+ .withProperty(EAST, canPaneConnectTo(worldIn, pos, EnumFacing.EAST));
|
|
||||||
}
|
|
||||||
|
|
||||||
public Item getItemDropped(IBlockState state, Random rand, int fortune)
|
|
||||||
@@ -65,10 +68,10 @@
|
|
||||||
|
|
||||||
public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity)
|
|
||||||
{
|
|
||||||
- boolean flag = this.canPaneConnectToBlock(worldIn.getBlockState(pos.north()).getBlock());
|
|
||||||
- boolean flag1 = this.canPaneConnectToBlock(worldIn.getBlockState(pos.south()).getBlock());
|
|
||||||
- boolean flag2 = this.canPaneConnectToBlock(worldIn.getBlockState(pos.west()).getBlock());
|
|
||||||
- boolean flag3 = this.canPaneConnectToBlock(worldIn.getBlockState(pos.east()).getBlock());
|
|
||||||
+ boolean flag = this.canPaneConnectTo(worldIn, pos, EnumFacing.NORTH);
|
|
||||||
+ boolean flag1 = this.canPaneConnectTo(worldIn, pos, EnumFacing.SOUTH);
|
|
||||||
+ boolean flag2 = this.canPaneConnectTo(worldIn, pos, EnumFacing.WEST);
|
|
||||||
+ boolean flag3 = this.canPaneConnectTo(worldIn, pos, EnumFacing.EAST);
|
|
||||||
|
|
||||||
if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1))
|
|
||||||
{
|
|
||||||
@@ -187,4 +190,11 @@
|
|
||||||
{
|
|
||||||
return new BlockState(this, new IProperty[] {NORTH, EAST, WEST, SOUTH});
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir)
|
|
||||||
+ {
|
|
||||||
+ BlockPos off = pos.offset(dir);
|
|
||||||
+ Block block = world.getBlockState(off).getBlock();
|
|
||||||
+ return canPaneConnectToBlock(block) || block.isSideSolid(world, off, dir.getOpposite());
|
|
||||||
+ }
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java
|
|
||||||
@@ -200,7 +200,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (!flag1 && block.getMaterial() != Material.air && canPush(block, worldIn, blockpos1, enumfacing.getOpposite(), false) && (block.getMobilityFlag() == 0 || block == Blocks.piston || block == Blocks.sticky_piston))
|
|
||||||
+ if (!flag1 && !block.isAir(worldIn, blockpos1) && canPush(block, worldIn, blockpos1, enumfacing.getOpposite(), false) && (block.getMobilityFlag() == 0 || block == Blocks.piston || block == Blocks.sticky_piston))
|
|
||||||
{
|
|
||||||
this.doMove(worldIn, pos, enumfacing, false);
|
|
||||||
}
|
|
||||||
@@ -344,7 +344,7 @@
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
- return !(blockIn instanceof ITileEntityProvider);
|
|
||||||
+ return !(blockIn.hasTileEntity(worldIn.getBlockState(pos)));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@@ -384,7 +384,9 @@
|
|
||||||
{
|
|
||||||
blockpos1 = (BlockPos)list1.get(j);
|
|
||||||
Block block = worldIn.getBlockState(blockpos1).getBlock();
|
|
||||||
- block.dropBlockAsItem(worldIn, blockpos1, worldIn.getBlockState(blockpos1), 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, blockpos1, worldIn.getBlockState(blockpos1), chance, 0);
|
|
||||||
worldIn.setBlockToAir(blockpos1);
|
|
||||||
--i;
|
|
||||||
ablock[i] = block;
|
|
|
@ -1,37 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockPistonMoving.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonMoving.java
|
|
||||||
@@ -110,16 +110,7 @@
|
|
||||||
|
|
||||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
|
||||||
{
|
|
||||||
- if (!worldIn.isRemote)
|
|
||||||
- {
|
|
||||||
- TileEntityPiston tileentitypiston = this.getTileEntity(worldIn, pos);
|
|
||||||
-
|
|
||||||
- if (tileentitypiston != null)
|
|
||||||
- {
|
|
||||||
- IBlockState iblockstate1 = tileentitypiston.getPistonState();
|
|
||||||
- iblockstate1.getBlock().dropBlockAsItem(worldIn, pos, iblockstate1, 0);
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
+ super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MovingObjectPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end)
|
|
||||||
@@ -283,4 +274,16 @@
|
|
||||||
{
|
|
||||||
return new BlockState(this, new IProperty[] {FACING, TYPE});
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public java.util.List<net.minecraft.item.ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
|
||||||
+ {
|
|
||||||
+ TileEntityPiston tileentitypiston = this.getTileEntity(world, pos);
|
|
||||||
+ if (tileentitypiston != null)
|
|
||||||
+ {
|
|
||||||
+ IBlockState pushed = tileentitypiston.getPistonState();
|
|
||||||
+ return pushed.getBlock().getDrops(world, pos, pushed, fortune);
|
|
||||||
+ }
|
|
||||||
+ return new java.util.ArrayList();
|
|
||||||
+ }
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockPotato.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockPotato.java
|
|
||||||
@@ -24,13 +24,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
|
|
||||||
@@ -109,7 +109,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,29 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockQuartz.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockQuartz.java
|
|
||||||
@@ -91,6 +91,26 @@
|
|
||||||
return new BlockState(this, new IProperty[] {VARIANT});
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
|
||||||
+ {
|
|
||||||
+ IBlockState state = world.getBlockState(pos);
|
|
||||||
+ for (IProperty prop : (java.util.Set<IProperty>)state.getProperties().keySet())
|
|
||||||
+ {
|
|
||||||
+ if (prop.getName().equals("variant") && prop.getValueClass() == EnumType.class)
|
|
||||||
+ {
|
|
||||||
+ EnumType current = (EnumType)state.getValue(prop);
|
|
||||||
+ EnumType next = current == EnumType.LINES_X ? EnumType.LINES_Y :
|
|
||||||
+ current == EnumType.LINES_Y ? EnumType.LINES_Z :
|
|
||||||
+ current == EnumType.LINES_Z ? EnumType.LINES_X : current;
|
|
||||||
+ if (next == current)
|
|
||||||
+ return false;
|
|
||||||
+ world.setBlockState(pos, state.withProperty(prop, next));
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public static enum EnumType implements IStringSerializable
|
|
||||||
{
|
|
||||||
DEFAULT(0, "default", "default"),
|
|
|
@ -1,147 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java
|
|
||||||
@@ -33,7 +33,7 @@
|
|
||||||
public static boolean isRailBlock(IBlockState state)
|
|
||||||
{
|
|
||||||
Block block = state.getBlock();
|
|
||||||
- return block == Blocks.rail || block == Blocks.golden_rail || block == Blocks.detector_rail || block == Blocks.activator_rail;
|
|
||||||
+ return block instanceof BlockRailBase;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected BlockRailBase(boolean isPowered)
|
|
||||||
@@ -174,7 +174,81 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract IProperty getShapeProperty();
|
|
||||||
+ /* ======================================== FORGE START =====================================*/
|
|
||||||
+ /**
|
|
||||||
+ * Return true if the rail can make corners.
|
|
||||||
+ * Used by placement logic.
|
|
||||||
+ * @param world The world.
|
|
||||||
+ * @param pod Block's position in world
|
|
||||||
+ * @return True if the rail can make corners.
|
|
||||||
+ */
|
|
||||||
+ public boolean isFlexibleRail(IBlockAccess world, BlockPos pos)
|
|
||||||
+ {
|
|
||||||
+ return !this.isPowered;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
+ /**
|
|
||||||
+ * Returns true if the rail can make up and down slopes.
|
|
||||||
+ * Used by placement logic.
|
|
||||||
+ * @param world The world.
|
|
||||||
+ * @param pod Block's position in world
|
|
||||||
+ * @return True if the rail can make slopes.
|
|
||||||
+ */
|
|
||||||
+ public boolean canMakeSlopes(IBlockAccess world, BlockPos pos)
|
|
||||||
+ {
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Returns the max speed of the rail at the specified position.
|
|
||||||
+ * @param world The world.
|
|
||||||
+ * @param cart The cart on the rail, may be null.
|
|
||||||
+ * @param pod Block's position in world
|
|
||||||
+ * @return The max speed of the current rail.
|
|
||||||
+ */
|
|
||||||
+ public float getRailMaxSpeed(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
|
|
||||||
+ {
|
|
||||||
+ return 0.4f;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * This function is called by any minecart that passes over this rail.
|
|
||||||
+ * It is called once per update tick that the minecart is on the rail.
|
|
||||||
+ * @param world The world.
|
|
||||||
+ * @param cart The cart on the rail.
|
|
||||||
+ * @param pod Block's position in world
|
|
||||||
+ */
|
|
||||||
+ public void onMinecartPass(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
|
|
||||||
+ {
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Rotate the block. For vanilla blocks this rotates around the axis passed in (generally, it should be the "face" that was hit).
|
|
||||||
+ * Note: for mod blocks, this is up to the block and modder to decide. It is not mandated that it be a rotation around the
|
|
||||||
+ * face, but could be a rotation to orient *to* that face, or a visiting of possible rotations.
|
|
||||||
+ * The method should return true if the rotation was successful though.
|
|
||||||
+ *
|
|
||||||
+ * @param world The world
|
|
||||||
+ * @param pos Block position in world
|
|
||||||
+ * @param axis The axis to rotate around
|
|
||||||
+ * @return True if the rotation was successful, False if the rotation failed, or is not possible
|
|
||||||
+ */
|
|
||||||
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
|
||||||
+ {
|
|
||||||
+ IBlockState state = world.getBlockState(pos);
|
|
||||||
+ for (IProperty prop : (java.util.Set<IProperty>)state.getProperties().keySet())
|
|
||||||
+ {
|
|
||||||
+ if (prop.getName().equals("shape"))
|
|
||||||
+ {
|
|
||||||
+ world.setBlockState(pos, state.cycleProperty(prop));
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* ======================================== FORGE END =====================================*/
|
|
||||||
+
|
|
||||||
public static enum EnumRailDirection implements IStringSerializable
|
|
||||||
{
|
|
||||||
NORTH_SOUTH(0, "north_south"),
|
|
||||||
@@ -251,6 +325,7 @@
|
|
||||||
private final boolean isPowered;
|
|
||||||
private final List field_150657_g = Lists.newArrayList();
|
|
||||||
private static final String __OBFID = "CL_00000196";
|
|
||||||
+ private final boolean canMakeSlopes;
|
|
||||||
|
|
||||||
public Rail(World worldIn, BlockPos pos, IBlockState state)
|
|
||||||
{
|
|
||||||
@@ -259,7 +334,8 @@
|
|
||||||
this.state = state;
|
|
||||||
this.block = (BlockRailBase)state.getBlock();
|
|
||||||
BlockRailBase.EnumRailDirection 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(enumraildirection);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -448,7 +524,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
|
|
||||||
+ if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
|
|
||||||
{
|
|
||||||
if (BlockRailBase.isRailBlock(this.world, blockpos.up()))
|
|
||||||
{
|
|
||||||
@@ -461,7 +537,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
|
|
||||||
+ if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes)
|
|
||||||
{
|
|
||||||
if (BlockRailBase.isRailBlock(this.world, blockpos3.up()))
|
|
||||||
{
|
|
||||||
@@ -604,7 +680,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
|
|
||||||
+ if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
|
|
||||||
{
|
|
||||||
if (BlockRailBase.isRailBlock(this.world, blockpos.up()))
|
|
||||||
{
|
|
||||||
@@ -617,7 +693,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
|
|
||||||
+ if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes)
|
|
||||||
{
|
|
||||||
if (BlockRailBase.isRailBlock(this.world, blockpos3.up()))
|
|
||||||
{
|
|
|
@ -1,24 +0,0 @@
|
||||||
--- ../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);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @Override
|
|
||||||
+ public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor)
|
|
||||||
+ {
|
|
||||||
+ if (pos.getY() == neighbor.getY() && world instanceof World)
|
|
||||||
+ {
|
|
||||||
+ onNeighborBlockChange((World)world, pos, world.getBlockState(pos), world.getBlockState(neighbor).getBlock());
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean getWeakChanges(IBlockAccess world, BlockPos pos)
|
|
||||||
+ {
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public static enum Mode implements IStringSerializable
|
|
||||||
{
|
|
||||||
COMPARE("compare"),
|
|
|
@ -1,11 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneDiode.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneDiode.java
|
|
||||||
@@ -200,6 +200,8 @@
|
|
||||||
{
|
|
||||||
EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
|
|
||||||
BlockPos blockpos1 = pos.offset(enumfacing.getOpposite());
|
|
||||||
+ if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(worldIn, pos, worldIn.getBlockState(pos), java.util.EnumSet.of(enumfacing.getOpposite())).isCanceled())
|
|
||||||
+ return;
|
|
||||||
worldIn.notifyBlockOfStateChange(blockpos1, this);
|
|
||||||
worldIn.notifyNeighborsOfStateExcept(blockpos1, this, enumfacing);
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java
|
|
||||||
@@ -92,12 +92,16 @@
|
|
||||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
|
||||||
{
|
|
||||||
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
- if (this.getItemDropped(state, worldIn.rand, fortune) != Item.getItemFromBlock(this))
|
|
||||||
+ @Override
|
|
||||||
+ public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
|
|
||||||
+ {
|
|
||||||
+ if (this.getItemDropped(world.getBlockState(pos), RANDOM, fortune) != Item.getItemFromBlock(this))
|
|
||||||
{
|
|
||||||
- int j = 1 + worldIn.rand.nextInt(5);
|
|
||||||
- this.dropXpOnBlockBreak(worldIn, pos, j);
|
|
||||||
+ return 1 + RANDOM.nextInt(5);
|
|
||||||
}
|
|
||||||
+ return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
|
@ -1,59 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java
|
|
||||||
@@ -60,10 +60,10 @@
|
|
||||||
BlockPos blockpos1 = pos.offset(direction);
|
|
||||||
Block block = worldIn.getBlockState(pos.offset(direction)).getBlock();
|
|
||||||
|
|
||||||
- if (!canConnectTo(worldIn.getBlockState(blockpos1), direction) && (block.isSolidFullCube() || !canConnectUpwardsTo(worldIn.getBlockState(blockpos1.down()))))
|
|
||||||
+ if (!canRestoneConnect(worldIn, blockpos1, direction) && (block.isSolidFullCube() || !canRestoneConnect(worldIn, blockpos1.down(), null)))
|
|
||||||
{
|
|
||||||
Block block1 = worldIn.getBlockState(pos.up()).getBlock();
|
|
||||||
- return !block1.isSolidFullCube() && block.isSolidFullCube() && canConnectUpwardsTo(worldIn.getBlockState(blockpos1.up())) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE;
|
|
||||||
+ return !block1.isSolidFullCube() && block.isSolidFullCube() && canRestoneConnect(worldIn, blockpos1.up(), null) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@@ -393,35 +393,25 @@
|
|
||||||
Block block = iblockstate.getBlock();
|
|
||||||
boolean flag = block.isNormalCube();
|
|
||||||
boolean flag1 = worldIn.getBlockState(pos.up()).getBlock().isNormalCube();
|
|
||||||
- return !flag1 && flag && canConnectUpwardsTo(worldIn, blockpos1.up()) ? true : (canConnectTo(iblockstate, side) ? true : (block == Blocks.powered_repeater && iblockstate.getValue(BlockRedstoneDiode.FACING) == side ? true : !flag && canConnectUpwardsTo(worldIn, blockpos1.down())));
|
|
||||||
+ return !flag1 && flag && canRestoneConnect(worldIn, blockpos1.up(), null) ? true : (canRestoneConnect(worldIn, blockpos1, side) ? true : (block == Blocks.powered_repeater && iblockstate.getValue(BlockRedstoneDiode.FACING) == side ? true : !flag && canRestoneConnect(worldIn, blockpos1.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));
|
|
||||||
- }
|
|
||||||
+ IBlockState state = world.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)
|
|
||||||
+ if (state.getBlock() == Blocks.redstone_wire)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- else if (Blocks.unpowered_repeater.isAssociated(block))
|
|
||||||
+ else if (Blocks.unpowered_repeater.isAssociated(state.getBlock()))
|
|
||||||
{
|
|
||||||
- EnumFacing enumfacing1 = (EnumFacing)blockState.getValue(BlockRedstoneRepeater.FACING);
|
|
||||||
- return enumfacing1 == side || enumfacing1.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,35 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockReed.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockReed.java
|
|
||||||
@@ -19,7 +19,7 @@
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
-public class BlockReed extends Block
|
|
||||||
+public class BlockReed extends Block implements net.minecraftforge.common.IPlantable
|
|
||||||
{
|
|
||||||
public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15);
|
|
||||||
private static final String __OBFID = "CL_00000300";
|
|
||||||
@@ -67,6 +67,7 @@
|
|
||||||
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
|
|
||||||
{
|
|
||||||
Block block = worldIn.getBlockState(pos.down()).getBlock();
|
|
||||||
+ if (block.canSustainPlant(worldIn, pos.down(), EnumFacing.UP, this)) return true;
|
|
||||||
|
|
||||||
if (block == this)
|
|
||||||
{
|
|
||||||
@@ -172,4 +173,15 @@
|
|
||||||
{
|
|
||||||
return new BlockState(this, new IProperty[] {AGE});
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public net.minecraftforge.common.EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
|
|
||||||
+ {
|
|
||||||
+ return net.minecraftforge.common.EnumPlantType.Beach;
|
|
||||||
+ }
|
|
||||||
+ @Override
|
|
||||||
+ public IBlockState getPlant(IBlockAccess world, BlockPos pos)
|
|
||||||
+ {
|
|
||||||
+ return this.getDefaultState();
|
|
||||||
+ }
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockRotatedPillar.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockRotatedPillar.java
|
|
||||||
@@ -2,6 +2,7 @@
|
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.properties.PropertyEnum;
|
|
||||||
+import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
|
|
||||||
public abstract class BlockRotatedPillar extends Block
|
|
||||||
@@ -13,4 +14,18 @@
|
|
||||||
{
|
|
||||||
super(materialIn);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ public boolean rotateBlock(net.minecraft.world.World world, net.minecraft.util.BlockPos pos, EnumFacing axis)
|
|
||||||
+ {
|
|
||||||
+ IBlockState state = world.getBlockState(pos);
|
|
||||||
+ for (net.minecraft.block.properties.IProperty prop : (java.util.Set<net.minecraft.block.properties.IProperty>)state.getProperties().keySet())
|
|
||||||
+ {
|
|
||||||
+ if (prop.getName().equals("axis"))
|
|
||||||
+ {
|
|
||||||
+ world.setBlockState(pos, state.cycleProperty(prop));
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockSapling.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java
|
|
||||||
@@ -66,6 +66,7 @@
|
|
||||||
|
|
||||||
public void generateTree(World worldIn, BlockPos pos, IBlockState state, Random rand)
|
|
||||||
{
|
|
||||||
+ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(worldIn, rand, pos)) return;
|
|
||||||
Object object = rand.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true);
|
|
||||||
int i = 0;
|
|
||||||
int j = 0;
|
|
|
@ -1,55 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockSkull.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSkull.java
|
|
||||||
@@ -122,8 +122,6 @@
|
|
||||||
return tileentity instanceof TileEntitySkull ? ((TileEntitySkull)tileentity).getSkullType() : super.getDamageValue(worldIn, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
- public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) {}
|
|
||||||
-
|
|
||||||
public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player)
|
|
||||||
{
|
|
||||||
if (player.capabilities.isCreativeMode)
|
|
||||||
@@ -131,13 +129,18 @@
|
|
||||||
state = state.withProperty(NODROP, Boolean.valueOf(true));
|
|
||||||
worldIn.setBlockState(pos, state, 4);
|
|
||||||
}
|
|
||||||
+ this.dropBlockAsItem(worldIn, pos, state, 0);
|
|
||||||
|
|
||||||
super.onBlockHarvested(worldIn, pos, state, player);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
|
|
||||||
{
|
|
||||||
- if (!worldIn.isRemote)
|
|
||||||
+ super.breakBlock(worldIn, pos, state);
|
|
||||||
+ }
|
|
||||||
+ public java.util.List<ItemStack> getDrops(IBlockAccess worldIn, BlockPos pos, IBlockState state, int fortune)
|
|
||||||
+ {
|
|
||||||
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
|
||||||
{
|
|
||||||
if (!((Boolean)state.getValue(NODROP)).booleanValue())
|
|
||||||
{
|
|
||||||
@@ -146,7 +149,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)
|
|
||||||
{
|
|
||||||
@@ -156,12 +159,11 @@
|
|
||||||
itemstack.getTagCompound().setTag("SkullOwner", nbttagcompound);
|
|
||||||
}
|
|
||||||
|
|
||||||
- spawnAsEntity(worldIn, pos, itemstack);
|
|
||||||
+ ret.add(itemstack);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- super.breakBlock(worldIn, pos, state);
|
|
||||||
}
|
|
||||||
+ return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Item getItemDropped(IBlockState state, Random rand, int fortune)
|
|
|
@ -1,53 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockSnow.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java
|
|
||||||
@@ -80,7 +80,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)
|
|
||||||
@@ -92,7 +92,6 @@
|
|
||||||
{
|
|
||||||
if (!this.canPlaceBlockAt(worldIn, p_176314_2_))
|
|
||||||
{
|
|
||||||
- this.dropBlockAsItem(worldIn, p_176314_2_, p_176314_3_, 0);
|
|
||||||
worldIn.setBlockToAir(p_176314_2_);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
@@ -104,9 +103,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)
|
|
||||||
@@ -116,14 +114,13 @@
|
|
||||||
|
|
||||||
public int quantityDropped(Random random)
|
|
||||||
{
|
|
||||||
- return 0;
|
|
||||||
+ return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
|
|
||||||
{
|
|
||||||
if (worldIn.getLightFor(EnumSkyBlock.BLOCK, pos) > 11)
|
|
||||||
{
|
|
||||||
- this.dropBlockAsItem(worldIn, pos, worldIn.getBlockState(pos), 0);
|
|
||||||
worldIn.setBlockToAir(pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -153,4 +150,6 @@
|
|
||||||
{
|
|
||||||
return new BlockState(this, new IProperty[] {LAYERS});
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ @Override public int quantityDropped(IBlockState state, int fortune, Random random){ return ((Integer)state.getValue(LAYERS)) + 1; }
|
|
||||||
}
|
|
|
@ -1,42 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockStem.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockStem.java
|
|
||||||
@@ -108,7 +108,7 @@
|
|
||||||
pos = pos.offset(EnumFacing.Plane.HORIZONTAL.random(rand));
|
|
||||||
Block block = worldIn.getBlockState(pos.down()).getBlock();
|
|
||||||
|
|
||||||
- if (worldIn.getBlockState(pos).getBlock().blockMaterial == Material.air && (block == Blocks.farmland || block == Blocks.dirt || block == Blocks.grass))
|
|
||||||
+ if (worldIn.isAirBlock(pos) && (block.canSustainPlant(worldIn, pos.down(), EnumFacing.UP, this) || block == Blocks.dirt || block == Blocks.grass))
|
|
||||||
{
|
|
||||||
worldIn.setBlockState(pos, this.crop.getDefaultState());
|
|
||||||
}
|
|
||||||
@@ -162,8 +162,12 @@
|
|
||||||
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
|
|
||||||
{
|
|
||||||
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
- if (!worldIn.isRemote)
|
|
||||||
+ @Override
|
|
||||||
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
|
||||||
+ {
|
|
||||||
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
|
||||||
{
|
|
||||||
Item item = this.getSeedItem();
|
|
||||||
|
|
||||||
@@ -173,13 +177,14 @@
|
|
||||||
|
|
||||||
for (int k = 0; k < 3; ++k)
|
|
||||||
{
|
|
||||||
- if (worldIn.rand.nextInt(15) <= j)
|
|
||||||
+ if (RANDOM.nextInt(15) <= j)
|
|
||||||
{
|
|
||||||
- spawnAsEntity(worldIn, pos, new ItemStack(item));
|
|
||||||
+ ret.add(new ItemStack(item));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Item getSeedItem()
|
|
|
@ -1,66 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockTallGrass.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTallGrass.java
|
|
||||||
@@ -23,7 +23,7 @@
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
-public class BlockTallGrass extends BlockBush implements IGrowable
|
|
||||||
+public class BlockTallGrass extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable
|
|
||||||
{
|
|
||||||
public static final PropertyEnum TYPE = PropertyEnum.create("type", BlockTallGrass.EnumType.class);
|
|
||||||
private static final String __OBFID = "CL_00000321";
|
|
||||||
@@ -44,7 +44,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)
|
|
||||||
@@ -74,7 +74,7 @@
|
|
||||||
|
|
||||||
public Item getItemDropped(IBlockState state, Random rand, int fortune)
|
|
||||||
{
|
|
||||||
- return rand.nextInt(8) == 0 ? Items.wheat_seeds : null;
|
|
||||||
+ return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int quantityDroppedWithBonus(int fortune, Random random)
|
|
||||||
@@ -84,13 +84,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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -210,4 +204,22 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
|
|
||||||
+ @Override
|
|
||||||
+ public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
|
|
||||||
+ {
|
|
||||||
+ List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
|
||||||
+ ret.add(new ItemStack(Blocks.tallgrass, 1, ((BlockTallGrass.EnumType)world.getBlockState(pos).getValue(TYPE)).getMeta()));
|
|
||||||
+ return ret;
|
|
||||||
+ }
|
|
||||||
+ @Override
|
|
||||||
+ public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
|
|
||||||
+ {
|
|
||||||
+ List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
|
|
||||||
+ if (RANDOM.nextInt(8) != 0) return ret;
|
|
||||||
+ ItemStack seed = net.minecraftforge.common.ForgeHooks.getGrassSeed(RANDOM);
|
|
||||||
+ if (seed != null) ret.add(seed);
|
|
||||||
+ return ret;
|
|
||||||
+ }
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockTorch.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTorch.java
|
|
||||||
@@ -70,7 +70,7 @@
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Block block = worldIn.getBlockState(pos).getBlock();
|
|
||||||
- return block instanceof BlockFence || block == Blocks.glass || block == Blocks.cobblestone_wall || block == Blocks.stained_glass;
|
|
||||||
+ return block.canPlaceTorchOnTop(worldIn, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@
|
|
||||||
{
|
|
||||||
BlockPos blockpos1 = pos.offset(facing.getOpposite());
|
|
||||||
boolean flag = facing.getAxis().isHorizontal();
|
|
||||||
- return flag && worldIn.isBlockNormalCube(blockpos1, true) || facing.equals(EnumFacing.UP) && this.canPlaceOn(worldIn, blockpos1);
|
|
||||||
+ return flag && worldIn.isSideSolid(blockpos1, facing, true) || facing.equals(EnumFacing.UP) && this.canPlaceOn(worldIn, blockpos1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
|
||||||
@@ -120,7 +120,7 @@
|
|
||||||
|
|
||||||
enumfacing1 = (EnumFacing)iterator.next();
|
|
||||||
}
|
|
||||||
- while (!worldIn.isBlockNormalCube(pos.offset(enumfacing1.getOpposite()), true));
|
|
||||||
+ while (!worldIn.isSideSolid(pos.offset(enumfacing1.getOpposite()), enumfacing1, true));
|
|
||||||
|
|
||||||
return this.getDefaultState().withProperty(FACING, enumfacing1);
|
|
||||||
}
|
|
||||||
@@ -149,7 +149,7 @@
|
|
||||||
EnumFacing enumfacing1 = enumfacing.getOpposite();
|
|
||||||
boolean flag = false;
|
|
||||||
|
|
||||||
- if (axis.isHorizontal() && !worldIn.isBlockNormalCube(pos.offset(enumfacing1), true))
|
|
||||||
+ if (axis.isHorizontal() && !worldIn.isSideSolid(pos.offset(enumfacing1), enumfacing1, true))
|
|
||||||
{
|
|
||||||
flag = true;
|
|
||||||
}
|
|
|
@ -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 HALF = PropertyEnum.create("half", BlockTrapDoor.DoorHalf.class);
|
|
||||||
@@ -141,9 +143,10 @@
|
|
||||||
{
|
|
||||||
if (!worldIn.isRemote)
|
|
||||||
{
|
|
||||||
+ EnumFacing direction = (EnumFacing)state.getValue(FACING);
|
|
||||||
BlockPos blockpos1 = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite());
|
|
||||||
|
|
||||||
- if (!isValidSupportBlock(worldIn.getBlockState(blockpos1).getBlock()))
|
|
||||||
+ if (!(isValidSupportBlock(worldIn.getBlockState(blockpos1).getBlock()) || worldIn.isSideSolid(blockpos1, direction, true)))
|
|
||||||
{
|
|
||||||
worldIn.setBlockToAir(pos);
|
|
||||||
this.dropBlockAsItem(worldIn, pos, state, 0);
|
|
||||||
@@ -187,7 +190,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)
|
|
||||||
@@ -224,6 +230,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,29 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockTripWireHook.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockTripWireHook.java
|
|
||||||
@@ -60,7 +60,7 @@
|
|
||||||
|
|
||||||
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)
|
|
||||||
@@ -77,7 +77,7 @@
|
|
||||||
|
|
||||||
enumfacing = (EnumFacing)iterator.next();
|
|
||||||
}
|
|
||||||
- while (!worldIn.getBlockState(pos.offset(enumfacing)).getBlock().isNormalCube());
|
|
||||||
+ while (!worldIn.isSideSolid(pos.offset(enumfacing), enumfacing.getOpposite(), true));
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@@ -107,7 +107,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,42 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/BlockVine.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/BlockVine.java
|
|
||||||
@@ -26,7 +26,7 @@
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
-public class BlockVine extends Block
|
|
||||||
+public class BlockVine extends Block implements net.minecraftforge.common.IShearable
|
|
||||||
{
|
|
||||||
public static final PropertyBool UP = PropertyBool.create("up");
|
|
||||||
public static final PropertyBool NORTH = PropertyBool.create("north");
|
|
||||||
@@ -416,13 +416,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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -508,6 +502,16 @@
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /*************************FORGE START***********************************/
|
|
||||||
+ @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity){ return true; }
|
|
||||||
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
|
|
||||||
+ @Override
|
|
||||||
+ public java.util.List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
|
|
||||||
+ {
|
|
||||||
+ return java.util.Arrays.asList(new ItemStack(this, 1));
|
|
||||||
+ }
|
|
||||||
+ /*************************FORGE END***********************************/
|
|
||||||
+
|
|
||||||
static final class SwitchEnumFacing
|
|
||||||
{
|
|
||||||
static final int[] FACING_LOOKUP = new int[EnumFacing.values().length];
|
|
|
@ -1,29 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java
|
|
||||||
@@ -80,7 +80,7 @@
|
|
||||||
{
|
|
||||||
Block block = this.world.getBlockState(origin).getBlock();
|
|
||||||
|
|
||||||
- if (block.getMaterial() == Material.air)
|
|
||||||
+ if (block.isAir(world, origin))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@@ -111,7 +111,7 @@
|
|
||||||
BlockPos blockpos1 = origin.offset(this.moveDirection.getOpposite(), i);
|
|
||||||
block = this.world.getBlockState(blockpos1).getBlock();
|
|
||||||
|
|
||||||
- if (block.getMaterial() == Material.air || !BlockPistonBase.canPush(block, this.world, blockpos1, this.moveDirection, false) || blockpos1.equals(this.pistonPos))
|
|
||||||
+ if (block.isAir(world, blockpos1)|| !BlockPistonBase.canPush(block, this.world, blockpos1, this.moveDirection, false) || blockpos1.equals(this.pistonPos))
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
@@ -159,7 +159,7 @@
|
|
||||||
|
|
||||||
block = this.world.getBlockState(blockpos2).getBlock();
|
|
||||||
|
|
||||||
- if (block.getMaterial() == Material.air)
|
|
||||||
+ if (block.isAir(world, blockpos2))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/state/BlockState.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/state/BlockState.java
|
|
||||||
@@ -47,6 +47,16 @@
|
|
||||||
|
|
||||||
public BlockState(Block blockIn, IProperty ... properties)
|
|
||||||
{
|
|
||||||
+ this(blockIn, properties, null);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ protected StateImplementation createState(Block block, ImmutableMap properties, ImmutableMap unlistedProperties)
|
|
||||||
+ {
|
|
||||||
+ return new StateImplementation(block, properties);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ protected BlockState(Block blockIn, IProperty[] properties, ImmutableMap unlistedProperties)
|
|
||||||
+ {
|
|
||||||
this.block = blockIn;
|
|
||||||
Arrays.sort(properties, new Comparator()
|
|
||||||
{
|
|
||||||
@@ -70,7 +80,7 @@
|
|
||||||
{
|
|
||||||
List list = (List)iterator.next();
|
|
||||||
Map map = MapPopulator.createMap(this.properties, list);
|
|
||||||
- BlockState.StateImplementation stateimplementation = new BlockState.StateImplementation(blockIn, ImmutableMap.copyOf(map), null);
|
|
||||||
+ BlockState.StateImplementation stateimplementation = createState(blockIn, ImmutableMap.copyOf(map), unlistedProperties);
|
|
||||||
linkedhashmap.put(map, stateimplementation);
|
|
||||||
arraylist.add(stateimplementation);
|
|
||||||
}
|
|
||||||
@@ -135,6 +145,13 @@
|
|
||||||
this.block = blockIn;
|
|
||||||
this.properties = propertiesIn;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ protected StateImplementation(Block blockIn, ImmutableMap propertiesIn, ImmutableTable propertyValueTable)
|
|
||||||
+ {
|
|
||||||
+ this.block = blockIn;
|
|
||||||
+ this.properties = propertiesIn;
|
|
||||||
+ this.propertyValueTable = propertyValueTable;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
public Collection getPropertyNames()
|
|
||||||
{
|
|
||||||
@@ -231,5 +248,10 @@
|
|
||||||
{
|
|
||||||
this(p_i45661_1_, p_i45661_2_);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ public ImmutableTable<IProperty, Comparable, IBlockState> getPropertyValueTable()
|
|
||||||
+ {
|
|
||||||
+ return propertyValueTable;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/block/state/BlockStateBase.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/block/state/BlockStateBase.java
|
|
||||||
@@ -76,4 +76,9 @@
|
|
||||||
|
|
||||||
return stringbuilder.toString();
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ public com.google.common.collect.ImmutableTable<IProperty, Comparable, IBlockState> getPropertyValueTable()
|
|
||||||
+ {
|
|
||||||
+ return null;
|
|
||||||
+ }
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/ClientBrandRetriever.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/ClientBrandRetriever.java
|
|
||||||
@@ -10,6 +10,6 @@
|
|
||||||
|
|
||||||
public static String getClientModName()
|
|
||||||
{
|
|
||||||
- return "vanilla";
|
|
||||||
+ return net.minecraftforge.fml.common.FMLCommonHandler.instance().getModName();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/LoadingScreenRenderer.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/LoadingScreenRenderer.java
|
|
||||||
@@ -139,6 +139,10 @@
|
|
||||||
GlStateManager.clear(16640);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ try
|
|
||||||
+ {
|
|
||||||
+ if (!net.minecraftforge.fml.client.FMLClientHandler.instance().handleLoadingScreen(scaledresolution)) //FML Don't render while FML's pre-screen is rendering
|
|
||||||
+ {
|
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
|
||||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
|
||||||
this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
|
|
||||||
@@ -177,6 +181,12 @@
|
|
||||||
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
|
||||||
this.mc.fontRendererObj.drawStringWithShadow(this.currentlyDisplayedText, (float)((l - this.mc.fontRendererObj.getStringWidth(this.currentlyDisplayedText)) / 2), (float)(i1 / 2 - 4 - 16), 16777215);
|
|
||||||
this.mc.fontRendererObj.drawStringWithShadow(this.message, (float)((l - this.mc.fontRendererObj.getStringWidth(this.message)) / 2), (float)(i1 / 2 - 4 + 8), 16777215);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ catch (java.io.IOException e)
|
|
||||||
+ {
|
|
||||||
+ com.google.common.base.Throwables.propagate(e);
|
|
||||||
+ } //FML End
|
|
||||||
this.framebuffer.unbindFramebuffer();
|
|
||||||
|
|
||||||
if (OpenGlHelper.isFramebufferEnabled())
|
|
|
@ -1,476 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/Minecraft.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/Minecraft.java
|
|
||||||
@@ -296,7 +296,6 @@
|
|
||||||
this.sessionService = (new YggdrasilAuthenticationService(gameConfig.userInfo.proxy, UUID.randomUUID().toString())).createMinecraftSessionService();
|
|
||||||
this.session = gameConfig.userInfo.session;
|
|
||||||
logger.info("Setting user: " + this.session.getUsername());
|
|
||||||
- logger.info("(Session ID is " + this.session.getSessionID() + ")");
|
|
||||||
this.isDemo = gameConfig.gameInfo.isDemo;
|
|
||||||
this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1;
|
|
||||||
this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1;
|
|
||||||
@@ -410,10 +409,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"));
|
|
||||||
@@ -449,6 +448,8 @@
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.mouseHelper = new MouseHelper();
|
|
||||||
+ net.minecraftforge.fml.common.ProgressManager.ProgressBar bar= net.minecraftforge.fml.common.ProgressManager.push("Rendering Setup", 5, true);
|
|
||||||
+ bar.step("GL Setup");
|
|
||||||
this.checkGLError("Pre startup");
|
|
||||||
GlStateManager.enableTexture2D();
|
|
||||||
GlStateManager.shadeModel(7425);
|
|
||||||
@@ -462,17 +463,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);
|
|
||||||
@@ -482,22 +487,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 @@
|
|
||||||
File file2 = new File(file1, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt");
|
|
||||||
Bootstrap.printToSYSOUT(crashReportIn.getCompleteReport());
|
|
||||||
|
|
||||||
+ int retVal;
|
|
||||||
if (crashReportIn.getFile() != null)
|
|
||||||
{
|
|
||||||
Bootstrap.printToSYSOUT("#@!@# Game crashed! Crash report saved to: #@!@# " + crashReportIn.getFile());
|
|
||||||
- System.exit(-1);
|
|
||||||
+ retVal = -1;
|
|
||||||
}
|
|
||||||
else if (crashReportIn.saveToFile(file2))
|
|
||||||
{
|
|
||||||
Bootstrap.printToSYSOUT("#@!@# Game crashed! Crash report saved to: #@!@# " + file2.getAbsolutePath());
|
|
||||||
- System.exit(-1);
|
|
||||||
+ retVal = -1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Bootstrap.printToSYSOUT("#@?@# Game crashed! Crash report could not be saved. #@?@#");
|
|
||||||
- System.exit(-2);
|
|
||||||
+ retVal = -2;
|
|
||||||
}
|
|
||||||
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleExit(retVal);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnicode()
|
|
||||||
@@ -887,11 +897,6 @@
|
|
||||||
|
|
||||||
public void displayGuiScreen(GuiScreen guiScreenIn)
|
|
||||||
{
|
|
||||||
- if (this.currentScreen != null)
|
|
||||||
- {
|
|
||||||
- this.currentScreen.onGuiClosed();
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
if (guiScreenIn == null && this.theWorld == null)
|
|
||||||
{
|
|
||||||
guiScreenIn = new GuiMainMenu();
|
|
||||||
@@ -901,6 +906,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;
|
|
||||||
@@ -999,7 +1015,7 @@
|
|
||||||
{
|
|
||||||
while (!this.scheduledTasks.isEmpty())
|
|
||||||
{
|
|
||||||
- ((FutureTask)this.scheduledTasks.poll()).run();
|
|
||||||
+ net.minecraftforge.fml.common.FMLCommonHandler.callFuture(((FutureTask)this.scheduledTasks.poll()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1034,9 +1050,11 @@
|
|
||||||
|
|
||||||
if (!this.skipRenderWorld)
|
|
||||||
{
|
|
||||||
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onRenderTickStart(this.timer.renderPartialTicks);
|
|
||||||
this.mcProfiler.endStartSection("gameRenderer");
|
|
||||||
this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks);
|
|
||||||
this.mcProfiler.endSection();
|
|
||||||
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onRenderTickEnd(this.timer.renderPartialTicks);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.mcProfiler.endSection();
|
|
||||||
@@ -1382,7 +1400,7 @@
|
|
||||||
|
|
||||||
if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air && this.playerController.func_180512_c(blockpos, this.objectMouseOver.sideHit))
|
|
||||||
{
|
|
||||||
- this.effectRenderer.addBlockHitEffects(blockpos, this.objectMouseOver.sideHit);
|
|
||||||
+ this.effectRenderer.addBlockHitEffects(blockpos, this.objectMouseOver);
|
|
||||||
this.thePlayer.swingItem();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1462,15 +1480,19 @@
|
|
||||||
case 2:
|
|
||||||
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).isCanceled();
|
|
||||||
+ if (result) { //Forge: Kept separate to simplify patch
|
|
||||||
if (this.playerController.func_178890_a(this.thePlayer, this.theWorld, itemstack, blockpos, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec))
|
|
||||||
{
|
|
||||||
flag = false;
|
|
||||||
this.thePlayer.swingItem();
|
|
||||||
}
|
|
||||||
+ }
|
|
||||||
|
|
||||||
if (itemstack == null)
|
|
||||||
{
|
|
||||||
@@ -1493,7 +1515,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).isCanceled();
|
|
||||||
+ if (result && itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1))
|
|
||||||
{
|
|
||||||
this.entityRenderer.itemRenderer.resetEquippedProgress2();
|
|
||||||
}
|
|
||||||
@@ -1591,6 +1614,8 @@
|
|
||||||
--this.rightClickDelayTimer;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onPreClientTick();
|
|
||||||
+
|
|
||||||
this.mcProfiler.startSection("gui");
|
|
||||||
|
|
||||||
if (!this.isGamePaused)
|
|
||||||
@@ -1689,6 +1714,8 @@
|
|
||||||
|
|
||||||
while (Mouse.next())
|
|
||||||
{
|
|
||||||
+ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue;
|
|
||||||
+
|
|
||||||
i = Mouse.getEventButton();
|
|
||||||
KeyBinding.setKeyBindState(i - 100, Mouse.getEventButtonState());
|
|
||||||
|
|
||||||
@@ -1744,6 +1771,7 @@
|
|
||||||
this.currentScreen.handleMouseInput();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireMouseInput();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.leftClickCounter > 0)
|
|
||||||
@@ -1920,6 +1948,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireKeyInput();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i)
|
|
||||||
@@ -2120,12 +2149,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);
|
|
||||||
@@ -2161,6 +2193,12 @@
|
|
||||||
|
|
||||||
while (!this.theIntegratedServer.serverIsInRunLoop())
|
|
||||||
{
|
|
||||||
+ if (!net.minecraftforge.fml.common.StartupQuery.check())
|
|
||||||
+ {
|
|
||||||
+ loadWorld(null);
|
|
||||||
+ displayGuiScreen(null);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
String s2 = this.theIntegratedServer.getUserMessage();
|
|
||||||
|
|
||||||
if (s2 != null)
|
|
||||||
@@ -2186,8 +2224,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;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -2198,6 +2242,8 @@
|
|
||||||
|
|
||||||
public void loadWorld(WorldClient worldClientIn, String loadingMessage)
|
|
||||||
{
|
|
||||||
+ if (theWorld != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(theWorld));
|
|
||||||
+
|
|
||||||
if (worldClientIn == null)
|
|
||||||
{
|
|
||||||
NetHandlerPlayClient nethandlerplayclient = this.getNetHandler();
|
|
||||||
@@ -2211,6 +2257,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;
|
|
||||||
@@ -2237,6 +2295,7 @@
|
|
||||||
|
|
||||||
this.setServerData((ServerData)null);
|
|
||||||
this.integratedServerIsRunning = false;
|
|
||||||
+ net.minecraftforge.fml.client.FMLClientHandler.instance().handleClientWorldClosing(this.theWorld);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.mcSoundHandler.stopSounds();
|
|
||||||
@@ -2341,134 +2400,11 @@
|
|
||||||
if (this.objectMouseOver != null)
|
|
||||||
{
|
|
||||||
boolean flag = this.thePlayer.capabilities.isCreativeMode;
|
|
||||||
- int i = 0;
|
|
||||||
- boolean flag1 = false;
|
|
||||||
- TileEntity tileentity = null;
|
|
||||||
- Object object;
|
|
||||||
|
|
||||||
- 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;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- object = block.getItem(this.theWorld, blockpos);
|
|
||||||
-
|
|
||||||
- if (object == null)
|
|
||||||
- {
|
|
||||||
- return;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (flag && GuiScreen.isCtrlKeyDown())
|
|
||||||
- {
|
|
||||||
- tileentity = this.theWorld.getTileEntity(blockpos);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- Block block1 = object instanceof ItemBlock && !block.isFlowerPot() ? Block.getBlockFromItem((Item)object) : block;
|
|
||||||
- i = block1.getDamageValue(this.theWorld, blockpos);
|
|
||||||
- flag1 = ((Item)object).getHasSubtypes();
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- if (this.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !flag)
|
|
||||||
- {
|
|
||||||
- return;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (this.objectMouseOver.entityHit instanceof EntityPainting)
|
|
||||||
- {
|
|
||||||
- object = Items.painting;
|
|
||||||
- }
|
|
||||||
- else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot)
|
|
||||||
- {
|
|
||||||
- object = Items.lead;
|
|
||||||
- }
|
|
||||||
- else if (this.objectMouseOver.entityHit instanceof EntityItemFrame)
|
|
||||||
- {
|
|
||||||
- EntityItemFrame entityitemframe = (EntityItemFrame)this.objectMouseOver.entityHit;
|
|
||||||
- ItemStack itemstack = entityitemframe.getDisplayedItem();
|
|
||||||
-
|
|
||||||
- if (itemstack == null)
|
|
||||||
- {
|
|
||||||
- object = Items.item_frame;
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- object = itemstack.getItem();
|
|
||||||
- i = itemstack.getMetadata();
|
|
||||||
- flag1 = true;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- else if (this.objectMouseOver.entityHit instanceof EntityMinecart)
|
|
||||||
- {
|
|
||||||
- EntityMinecart entityminecart = (EntityMinecart)this.objectMouseOver.entityHit;
|
|
||||||
-
|
|
||||||
- switch (Minecraft.SwitchEnumMinecartType.field_178901_b[entityminecart.getMinecartType().ordinal()])
|
|
||||||
- {
|
|
||||||
- case 1:
|
|
||||||
- object = Items.furnace_minecart;
|
|
||||||
- break;
|
|
||||||
- case 2:
|
|
||||||
- object = Items.chest_minecart;
|
|
||||||
- break;
|
|
||||||
- case 3:
|
|
||||||
- object = Items.tnt_minecart;
|
|
||||||
- break;
|
|
||||||
- case 4:
|
|
||||||
- object = Items.hopper_minecart;
|
|
||||||
- break;
|
|
||||||
- case 5:
|
|
||||||
- object = Items.command_block_minecart;
|
|
||||||
- break;
|
|
||||||
- default:
|
|
||||||
- object = Items.minecart;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- else if (this.objectMouseOver.entityHit instanceof EntityBoat)
|
|
||||||
- {
|
|
||||||
- object = Items.boat;
|
|
||||||
- }
|
|
||||||
- else if (this.objectMouseOver.entityHit instanceof EntityArmorStand)
|
|
||||||
- {
|
|
||||||
- object = Items.armor_stand;
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- object = 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)object, i, flag1, flag);
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
|
||||||
- tileentity.writeToNBT(nbttagcompound1);
|
|
||||||
- ItemStack itemstack1 = new ItemStack((Item)object, 1, i);
|
|
||||||
- itemstack1.setTagInfo("BlockEntityTag", nbttagcompound1);
|
|
||||||
- NBTTagCompound nbttagcompound = new NBTTagCompound();
|
|
||||||
- NBTTagList nbttaglist = new NBTTagList();
|
|
||||||
- nbttaglist.appendTag(new NBTTagString("(+NBT)"));
|
|
||||||
- nbttagcompound.setTag("Lore", nbttaglist);
|
|
||||||
- itemstack1.setTagInfo("display", nbttagcompound);
|
|
||||||
- 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;
|
|
||||||
@@ -2726,18 +2662,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)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,52 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/audio/SoundManager.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/audio/SoundManager.java
|
|
||||||
@@ -36,6 +36,10 @@
|
|
||||||
import paulscode.sound.codecs.CodecJOrbis;
|
|
||||||
import paulscode.sound.libraries.LibraryLWJGLOpenAL;
|
|
||||||
|
|
||||||
+import net.minecraftforge.client.ForgeHooksClient;
|
|
||||||
+import net.minecraftforge.client.event.sound.*;
|
|
||||||
+import net.minecraftforge.common.MinecraftForge;
|
|
||||||
+
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public class SoundManager
|
|
||||||
{
|
|
||||||
@@ -70,6 +74,7 @@
|
|
||||||
{
|
|
||||||
SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
|
|
||||||
SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
|
|
||||||
+ MinecraftForge.EVENT_BUS.post(new SoundSetupEvent(this));
|
|
||||||
}
|
|
||||||
catch (SoundSystemException soundsystemexception)
|
|
||||||
{
|
|
||||||
@@ -81,6 +86,7 @@
|
|
||||||
{
|
|
||||||
this.unloadSoundSystem();
|
|
||||||
this.loadSoundSystem();
|
|
||||||
+ MinecraftForge.EVENT_BUS.post(new SoundLoadEvent(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
private synchronized void loadSoundSystem()
|
|
||||||
@@ -329,6 +335,9 @@
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
+ sound = ForgeHooksClient.playSound(this, sound);
|
|
||||||
+ if (sound == null) return;
|
|
||||||
+
|
|
||||||
SoundEventAccessorComposite soundeventaccessorcomposite = this.sndHandler.getSound(sound.getSoundLocation());
|
|
||||||
|
|
||||||
if (soundeventaccessorcomposite == null)
|
|
||||||
@@ -370,10 +379,12 @@
|
|
||||||
if (soundpoolentry.isStreamingSound())
|
|
||||||
{
|
|
||||||
this.sndSystem.newStreamingSource(false, s, getURLForSoundResource(resourcelocation), resourcelocation.toString(), flag, sound.getXPosF(), sound.getYPosF(), sound.getZPosF(), sound.getAttenuationType().getTypeInt(), f1);
|
|
||||||
+ MinecraftForge.EVENT_BUS.post(new 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);
|
|
||||||
+ MinecraftForge.EVENT_BUS.post(new PlaySoundSourceEvent(this, sound, s));
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.debug(LOG_MARKER, "Playing sound {} for event {} as channel {}", new Object[] {soundpoolentry.getSoundPoolEntryLocation(), soundeventaccessorcomposite.getSoundEventLocation(), s});
|
|
|
@ -1,10 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java
|
|
||||||
@@ -129,6 +129,6 @@
|
|
||||||
f *= 1.0F - f1 * 0.15F;
|
|
||||||
}
|
|
||||||
|
|
||||||
- return f;
|
|
||||||
+ return net.minecraftforge.client.ForgeHooksClient.getOffsetFOV(this, f);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,80 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
|
|
||||||
@@ -53,6 +53,9 @@
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
+import net.minecraftforge.client.ForgeHooksClient;
|
|
||||||
+import net.minecraftforge.common.MinecraftForge;
|
|
||||||
+import net.minecraftforge.event.entity.PlaySoundAtEntityEvent;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public class EntityPlayerSP extends AbstractClientPlayer
|
|
||||||
@@ -342,6 +345,15 @@
|
|
||||||
this.mc.ingameGUI.getChatGUI().printChatMessage(chatComponent);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ private boolean isHeadspaceFree(BlockPos pos, int height)
|
|
||||||
+ {
|
|
||||||
+ for (int y = 0; y < height; y++)
|
|
||||||
+ {
|
|
||||||
+ if (isOpenBlockSpace(pos.add(0, y, 0))) return false;
|
|
||||||
+ }
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
protected boolean pushOutOfBlocks(double x, double y, double z)
|
|
||||||
{
|
|
||||||
if (this.noClip)
|
|
||||||
@@ -354,30 +366,34 @@
|
|
||||||
double d3 = x - (double)blockpos.getX();
|
|
||||||
double d4 = z - (double)blockpos.getZ();
|
|
||||||
|
|
||||||
- if (!this.isOpenBlockSpace(blockpos))
|
|
||||||
+ int entHeight = Math.max(Math.round(this.height), 1);
|
|
||||||
+
|
|
||||||
+ boolean inTranslucentBlock = this.isHeadspaceFree(blockpos, entHeight);
|
|
||||||
+
|
|
||||||
+ if (inTranslucentBlock)
|
|
||||||
{
|
|
||||||
byte b0 = -1;
|
|
||||||
double d5 = 9999.0D;
|
|
||||||
|
|
||||||
- if (this.isOpenBlockSpace(blockpos.west()) && d3 < d5)
|
|
||||||
+ if (!this.isHeadspaceFree(blockpos.west(), entHeight) && d3 < d5)
|
|
||||||
{
|
|
||||||
d5 = d3;
|
|
||||||
b0 = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (this.isOpenBlockSpace(blockpos.east()) && 1.0D - d3 < d5)
|
|
||||||
+ if (!this.isHeadspaceFree(blockpos.east(), entHeight) && 1.0D - d3 < d5)
|
|
||||||
{
|
|
||||||
d5 = 1.0D - d3;
|
|
||||||
b0 = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (this.isOpenBlockSpace(blockpos.north()) && d4 < d5)
|
|
||||||
+ if (!this.isHeadspaceFree(blockpos.north(), entHeight) && d4 < d5)
|
|
||||||
{
|
|
||||||
d5 = d4;
|
|
||||||
b0 = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (this.isOpenBlockSpace(blockpos.south()) && 1.0D - d4 < d5)
|
|
||||||
+ if (!this.isHeadspaceFree(blockpos.south(), entHeight) && 1.0D - d4 < d5)
|
|
||||||
{
|
|
||||||
d5 = 1.0D - d4;
|
|
||||||
b0 = 5;
|
|
||||||
@@ -445,6 +461,11 @@
|
|
||||||
|
|
||||||
public void playSound(String name, float volume, float pitch)
|
|
||||||
{
|
|
||||||
+ 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);
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,155 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/FontRenderer.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/FontRenderer.java
|
|
||||||
@@ -57,7 +57,7 @@
|
|
||||||
this.locationFontTexture = p_i1035_2_;
|
|
||||||
this.renderEngine = p_i1035_3_;
|
|
||||||
this.unicodeFlag = p_i1035_4_;
|
|
||||||
- p_i1035_3_.bindTexture(this.locationFontTexture);
|
|
||||||
+ bindTexture(this.locationFontTexture);
|
|
||||||
|
|
||||||
for (int i = 0; i < 32; ++i)
|
|
||||||
{
|
|
||||||
@@ -97,6 +97,7 @@
|
|
||||||
public void onResourceManagerReload(IResourceManager resourceManager)
|
|
||||||
{
|
|
||||||
this.readFontTexture();
|
|
||||||
+ this.readGlyphSizes();
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
@@ -172,7 +173,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)
|
|
||||||
@@ -195,7 +196,7 @@
|
|
||||||
float f = (float)(p_78266_1_ % 16 * 8);
|
|
||||||
float f1 = (float)(p_78266_1_ / 16 * 8);
|
|
||||||
float f2 = p_78266_2_ ? 1.0F : 0.0F;
|
|
||||||
- this.renderEngine.bindTexture(this.locationFontTexture);
|
|
||||||
+ bindTexture(this.locationFontTexture);
|
|
||||||
float f3 = (float)this.charWidth[p_78266_1_] - 0.01F;
|
|
||||||
GL11.glBegin(GL11.GL_TRIANGLE_STRIP);
|
|
||||||
GL11.glTexCoord2f(f / 128.0F, f1 / 128.0F);
|
|
||||||
@@ -222,7 +223,7 @@
|
|
||||||
|
|
||||||
private void loadGlyphTexture(int p_78257_1_)
|
|
||||||
{
|
|
||||||
- this.renderEngine.bindTexture(this.getUnicodePageLocation(p_78257_1_));
|
|
||||||
+ bindTexture(this.getUnicodePageLocation(p_78257_1_));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected float renderUnicodeChar(char p_78277_1_, boolean p_78277_2_)
|
|
||||||
@@ -269,7 +270,7 @@
|
|
||||||
|
|
||||||
public int drawString(String p_175065_1_, float p_175065_2_, float p_175065_3_, int p_175065_4_, boolean p_175065_5_)
|
|
||||||
{
|
|
||||||
- GlStateManager.enableAlpha();
|
|
||||||
+ enableAlpha();
|
|
||||||
this.resetStyles();
|
|
||||||
int j;
|
|
||||||
|
|
||||||
@@ -341,7 +342,7 @@
|
|
||||||
|
|
||||||
k = this.colorCode[j];
|
|
||||||
this.textColor = k;
|
|
||||||
- GlStateManager.color((float)(k >> 16) / 255.0F, (float)(k >> 8 & 255) / 255.0F, (float)(k & 255) / 255.0F, this.alpha);
|
|
||||||
+ setColor((float)(k >> 16) / 255.0F, (float)(k >> 8 & 255) / 255.0F, (float)(k & 255) / 255.0F, this.alpha);
|
|
||||||
}
|
|
||||||
else if (j == 16)
|
|
||||||
{
|
|
||||||
@@ -370,7 +371,7 @@
|
|
||||||
this.strikethroughStyle = false;
|
|
||||||
this.underlineStyle = false;
|
|
||||||
this.italicStyle = false;
|
|
||||||
- GlStateManager.color(this.red, this.blue, this.green, this.alpha);
|
|
||||||
+ setColor(this.red, this.blue, this.green, this.alpha);
|
|
||||||
}
|
|
||||||
|
|
||||||
++i;
|
|
||||||
@@ -390,7 +391,7 @@
|
|
||||||
j = k;
|
|
||||||
}
|
|
||||||
|
|
||||||
- float f1 = this.unicodeFlag ? 0.5F : 1.0F;
|
|
||||||
+ float f1 = getCharWidth(c0) / 32f;
|
|
||||||
boolean flag1 = (c0 == 0 || j == -1 || this.unicodeFlag) && p_78255_2_;
|
|
||||||
|
|
||||||
if (flag1)
|
|
||||||
@@ -429,6 +430,15 @@
|
|
||||||
++f;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ doDraw(f);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ protected void doDraw(float f)
|
|
||||||
+ {
|
|
||||||
+ {
|
|
||||||
+ {
|
|
||||||
Tessellator tessellator;
|
|
||||||
WorldRenderer worldrenderer;
|
|
||||||
|
|
||||||
@@ -504,7 +514,7 @@
|
|
||||||
this.blue = (float)(p_180455_4_ >> 8 & 255) / 255.0F;
|
|
||||||
this.green = (float)(p_180455_4_ & 255) / 255.0F;
|
|
||||||
this.alpha = (float)(p_180455_4_ >> 24 & 255) / 255.0F;
|
|
||||||
- GlStateManager.color(this.red, this.blue, this.green, this.alpha);
|
|
||||||
+ setColor(this.red, this.blue, this.green, this.alpha);
|
|
||||||
this.posX = p_180455_2_;
|
|
||||||
this.posY = p_180455_3_;
|
|
||||||
this.renderStringAtPos(p_180455_1_, p_180455_5_);
|
|
||||||
@@ -583,11 +593,6 @@
|
|
||||||
int j = this.glyphWidth[p_78263_1_] >>> 4;
|
|
||||||
int k = this.glyphWidth[p_78263_1_] & 15;
|
|
||||||
|
|
||||||
- if (k > 7)
|
|
||||||
- {
|
|
||||||
- k = 15;
|
|
||||||
- j = 0;
|
|
||||||
- }
|
|
||||||
|
|
||||||
++k;
|
|
||||||
return (k - j) / 2 + 1;
|
|
||||||
@@ -842,6 +847,26 @@
|
|
||||||
return this.bidiFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ protected void setColor(float r, float g, float b, float a)
|
|
||||||
+ {
|
|
||||||
+ GlStateManager.color(r,g,b,a);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ protected void enableAlpha()
|
|
||||||
+ {
|
|
||||||
+ GlStateManager.enableAlpha();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ protected void bindTexture(ResourceLocation location)
|
|
||||||
+ {
|
|
||||||
+ renderEngine.bindTexture(location);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ protected InputStream getResourceInputStream(ResourceLocation location) throws IOException
|
|
||||||
+ {
|
|
||||||
+ return Minecraft.getMinecraft().getResourceManager().getResource(location).getInputStream();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public int getColorCode(char p_175064_1_)
|
|
||||||
{
|
|
||||||
return this.colorCode["0123456789abcdef".indexOf(p_175064_1_)];
|
|
|
@ -1,24 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiButton.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiButton.java
|
|
||||||
@@ -22,6 +22,7 @@
|
|
||||||
public boolean visible;
|
|
||||||
protected boolean hovered;
|
|
||||||
private static final String __OBFID = "CL_00000668";
|
|
||||||
+ public int packedFGColour; //FML
|
|
||||||
|
|
||||||
public GuiButton(int buttonId, int x, int y, String buttonText)
|
|
||||||
{
|
|
||||||
@@ -75,8 +76,12 @@
|
|
||||||
this.mouseDragged(mc, mouseX, mouseY);
|
|
||||||
int l = 14737632;
|
|
||||||
|
|
||||||
- if (!this.enabled)
|
|
||||||
+ if (packedFGColour != 0)
|
|
||||||
{
|
|
||||||
+ l = packedFGColour;
|
|
||||||
+ }
|
|
||||||
+ else if (!this.enabled)
|
|
||||||
+ {
|
|
||||||
l = 10526880;
|
|
||||||
}
|
|
||||||
else if (this.hovered)
|
|
|
@ -1,32 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiChat.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiChat.java
|
|
||||||
@@ -217,13 +217,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)
|
|
||||||
@@ -285,6 +286,13 @@
|
|
||||||
String[] astring1 = p_146406_1_;
|
|
||||||
int i = p_146406_1_.length;
|
|
||||||
|
|
||||||
+ String[] complete = net.minecraftforge.client.ClientCommandHandler.instance.latestAutoComplete;
|
|
||||||
+ if (complete != null)
|
|
||||||
+ {
|
|
||||||
+ astring1 = com.google.common.collect.ObjectArrays.concat(complete, astring1, String.class);
|
|
||||||
+ i = astring1.length;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
for (int j = 0; j < i; ++j)
|
|
||||||
{
|
|
||||||
String s = astring1[j];
|
|
|
@ -1,36 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
|
|
||||||
@@ -213,6 +213,8 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ WorldType.worldTypes[this.selectedIndex].onGUICreateWorldPress();
|
|
||||||
+
|
|
||||||
WorldSettings.GameType gametype = WorldSettings.GameType.getByName(this.field_146342_r);
|
|
||||||
WorldSettings worldsettings = new WorldSettings(i, gametype, this.field_146341_s, this.field_146337_w, WorldType.worldTypes[this.selectedIndex]);
|
|
||||||
worldsettings.setWorldName(this.chunkProviderSettingsJson);
|
|
||||||
@@ -320,14 +322,7 @@
|
|
||||||
}
|
|
||||||
else if (button.id == 8)
|
|
||||||
{
|
|
||||||
- if (WorldType.worldTypes[this.selectedIndex] == WorldType.FLAT)
|
|
||||||
- {
|
|
||||||
- this.mc.displayGuiScreen(new GuiCreateFlatWorld(this, this.chunkProviderSettingsJson));
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- this.mc.displayGuiScreen(new GuiCustomizeWorldScreen(this, this.chunkProviderSettingsJson));
|
|
||||||
- }
|
|
||||||
+ WorldType.worldTypes[this.selectedIndex].onCustomizeButton(mc, this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -379,7 +374,7 @@
|
|
||||||
this.btnBonusItems.visible = this.field_146344_y;
|
|
||||||
this.btnMapType.visible = this.field_146344_y;
|
|
||||||
this.btnAllowCommands.visible = this.field_146344_y;
|
|
||||||
- this.btnCustomizeType.visible = this.field_146344_y && (WorldType.worldTypes[this.selectedIndex] == WorldType.FLAT || WorldType.worldTypes[this.selectedIndex] == WorldType.CUSTOMIZED);
|
|
||||||
+ this.btnCustomizeType.visible = this.field_146344_y && WorldType.worldTypes[this.selectedIndex].isCustomizable();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.func_146319_h();
|
|
|
@ -1,33 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiIngameMenu.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiIngameMenu.java
|
|
||||||
@@ -30,8 +30,9 @@
|
|
||||||
|
|
||||||
this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24 + b0, I18n.format("menu.returnToGame", new Object[0])));
|
|
||||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + b0, 98, 20, I18n.format("menu.options", new Object[0])));
|
|
||||||
+ this.buttonList.add(new GuiButton(12, this.width / 2 + 2, this.height / 4 + 96 + b0, 98, 20, I18n.format("fml.menu.modoptions")));
|
|
||||||
GuiButton guibutton;
|
|
||||||
- this.buttonList.add(guibutton = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + b0, 98, 20, I18n.format("menu.shareToLan", new Object[0])));
|
|
||||||
+ this.buttonList.add(guibutton = new GuiButton(7, this.width / 2 - 100, this.height / 4 + 72 + b0, 200, 20, I18n.format("menu.shareToLan", new Object[0])));
|
|
||||||
this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + b0, 98, 20, I18n.format("gui.achievements", new Object[0])));
|
|
||||||
this.buttonList.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + b0, 98, 20, I18n.format("gui.stats", new Object[0])));
|
|
||||||
guibutton.enabled = this.mc.isSingleplayer() && !this.mc.getIntegratedServer().getPublic();
|
|
||||||
@@ -58,13 +59,19 @@
|
|
||||||
this.mc.setIngameFocus();
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
+ if (this.mc.thePlayer != null)
|
|
||||||
this.mc.displayGuiScreen(new GuiAchievements(this, this.mc.thePlayer.getStatFileWriter()));
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
+ if (this.mc.thePlayer != null)
|
|
||||||
this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter()));
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
this.mc.displayGuiScreen(new GuiShareToLan(this));
|
|
||||||
+ break;
|
|
||||||
+ case 12:
|
|
||||||
+ net.minecraftforge.fml.client.FMLClientHandler.instance().showInGameModOptions(this);
|
|
||||||
+ break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiMainMenu.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiMainMenu.java
|
|
||||||
@@ -198,6 +198,11 @@
|
|
||||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, p_73969_1_, I18n.format("menu.singleplayer", new Object[0])));
|
|
||||||
this.buttonList.add(new GuiButton(2, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 1, I18n.format("menu.multiplayer", new Object[0])));
|
|
||||||
this.buttonList.add(this.realmsButton = new GuiButton(14, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 2, I18n.format("menu.online", new Object[0])));
|
|
||||||
+ GuiButton fmlModButton = new GuiButton(6, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 2, I18n.format("fml.menu.mods"));
|
|
||||||
+ fmlModButton.xPosition = this.width / 2 + 2;
|
|
||||||
+ realmsButton.width = 98;
|
|
||||||
+ fmlModButton.width = 98;
|
|
||||||
+ this.buttonList.add(fmlModButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addDemoButtons(int p_73972_1_, int p_73972_2_)
|
|
||||||
@@ -245,6 +250,11 @@
|
|
||||||
this.mc.shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (button.id == 6)
|
|
||||||
+ {
|
|
||||||
+ this.mc.displayGuiScreen(new net.minecraftforge.fml.client.GuiModList(this));
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if (button.id == 11)
|
|
||||||
{
|
|
||||||
this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings);
|
|
||||||
@@ -492,7 +502,16 @@
|
|
||||||
s = s + " Demo";
|
|
||||||
}
|
|
||||||
|
|
||||||
- this.drawString(this.fontRendererObj, s, 2, this.height - 10, -1);
|
|
||||||
+ java.util.List<String> brandings = com.google.common.collect.Lists.reverse(net.minecraftforge.fml.common.FMLCommonHandler.instance().getBrandings(true));
|
|
||||||
+ for (int i = 0; i < brandings.size(); i++)
|
|
||||||
+ {
|
|
||||||
+ String brd = brandings.get(i);
|
|
||||||
+ if (!com.google.common.base.Strings.isNullOrEmpty(brd))
|
|
||||||
+ {
|
|
||||||
+ this.drawString(this.fontRendererObj, brd, 2, this.height - ( 10 + i * (this.fontRendererObj.FONT_HEIGHT + 1)), 16777215);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, this.fontRendererObj, this.width, this.height);
|
|
||||||
String s1 = "Copyright Mojang AB. Do not distribute!";
|
|
||||||
this.drawString(this.fontRendererObj, s1, this.width - this.fontRendererObj.getStringWidth(s1) - 2, this.height - 10, -1);
|
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiMultiplayer.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiMultiplayer.java
|
|
||||||
@@ -41,6 +41,7 @@
|
|
||||||
public GuiMultiplayer(GuiScreen parentScreen)
|
|
||||||
{
|
|
||||||
this.parentScreen = parentScreen;
|
|
||||||
+ net.minecraftforge.fml.client.FMLClientHandler.instance().setupServerList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void initGui()
|
|
||||||
@@ -373,7 +374,7 @@
|
|
||||||
|
|
||||||
private void connectToServer(ServerData server)
|
|
||||||
{
|
|
||||||
- this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, server));
|
|
||||||
+ net.minecraftforge.fml.client.FMLClientHandler.instance().connectToServer(this, server);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void selectServer(int index)
|
|
|
@ -1,12 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java
|
|
||||||
@@ -170,6 +170,9 @@
|
|
||||||
long l = j - k;
|
|
||||||
ArrayList arraylist = 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("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)});
|
|
||||||
|
|
||||||
+ arraylist.add("");
|
|
||||||
+ arraylist.addAll(net.minecraftforge.fml.common.FMLCommonHandler.instance().getBrandings(false));
|
|
||||||
+
|
|
||||||
if (this.isReducedDebug())
|
|
||||||
{
|
|
||||||
return arraylist;
|
|
|
@ -1,113 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiScreen.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreen.java
|
|
||||||
@@ -37,6 +37,9 @@
|
|
||||||
import net.minecraft.util.ChatComponentTranslation;
|
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
|
||||||
import net.minecraft.util.IChatComponent;
|
|
||||||
+import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent;
|
|
||||||
+import net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent;
|
|
||||||
+import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
@@ -146,7 +149,8 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- this.drawHoveringText(list, x, y);
|
|
||||||
+ FontRenderer font = stack.getItem().getFontRenderer(stack);
|
|
||||||
+ this.drawHoveringText(list, x, y, (font == null ? fontRendererObj : font));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void drawCreativeTabHoveringText(String tabName, int mouseX, int mouseY)
|
|
||||||
@@ -156,6 +160,11 @@
|
|
||||||
|
|
||||||
protected void drawHoveringText(List textLines, int x, int y)
|
|
||||||
{
|
|
||||||
+ drawHoveringText(textLines, x, y, fontRendererObj);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ protected void drawHoveringText(List textLines, int x, int y, FontRenderer font)
|
|
||||||
+ {
|
|
||||||
if (!textLines.isEmpty())
|
|
||||||
{
|
|
||||||
GlStateManager.disableRescaleNormal();
|
|
||||||
@@ -168,7 +177,7 @@
|
|
||||||
while (iterator.hasNext())
|
|
||||||
{
|
|
||||||
String s = (String)iterator.next();
|
|
||||||
- int l = this.fontRendererObj.getStringWidth(s);
|
|
||||||
+ int l = font.getStringWidth(s);
|
|
||||||
|
|
||||||
if (l > k)
|
|
||||||
{
|
|
||||||
@@ -213,7 +222,7 @@
|
|
||||||
for (int i2 = 0; i2 < textLines.size(); ++i2)
|
|
||||||
{
|
|
||||||
String s1 = (String)textLines.get(i2);
|
|
||||||
- this.fontRendererObj.drawStringWithShadow(s1, (float)j2, (float)k2, -1);
|
|
||||||
+ font.drawStringWithShadow(s1, j2, k2, -1);
|
|
||||||
|
|
||||||
if (i2 == 0)
|
|
||||||
{
|
|
||||||
@@ -441,6 +450,7 @@
|
|
||||||
this.mc.ingameGUI.getChatGUI().addToSentMessages(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (net.minecraftforge.client.ClientCommandHandler.instance.executeCommand(mc.thePlayer, msg) != 0) return;
|
|
||||||
this.mc.thePlayer.sendChatMessage(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -454,9 +464,14 @@
|
|
||||||
|
|
||||||
if (guibutton.mousePressed(this.mc, mouseX, mouseY))
|
|
||||||
{
|
|
||||||
- this.selectedButton = guibutton;
|
|
||||||
- guibutton.playPressSound(this.mc.getSoundHandler());
|
|
||||||
- this.actionPerformed(guibutton);
|
|
||||||
+ ActionPerformedEvent.Pre event = new ActionPerformedEvent.Pre(this, guibutton, this.buttonList);
|
|
||||||
+ if (MinecraftForge.EVENT_BUS.post(event))
|
|
||||||
+ break;
|
|
||||||
+ this.selectedButton = event.button;
|
|
||||||
+ event.button.playPressSound(this.mc.getSoundHandler());
|
|
||||||
+ this.actionPerformed(event.button);
|
|
||||||
+ if (this.equals(this.mc.currentScreen))
|
|
||||||
+ MinecraftForge.EVENT_BUS.post(new ActionPerformedEvent.Post(this, event.button, this.buttonList));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -482,8 +497,12 @@
|
|
||||||
this.fontRendererObj = mc.fontRendererObj;
|
|
||||||
this.width = width;
|
|
||||||
this.height = height;
|
|
||||||
- this.buttonList.clear();
|
|
||||||
- this.initGui();
|
|
||||||
+ if (!MinecraftForge.EVENT_BUS.post(new InitGuiEvent.Pre(this, this.buttonList)))
|
|
||||||
+ {
|
|
||||||
+ this.buttonList.clear();
|
|
||||||
+ this.initGui();
|
|
||||||
+ }
|
|
||||||
+ MinecraftForge.EVENT_BUS.post(new InitGuiEvent.Post(this, this.buttonList));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void initGui() {}
|
|
||||||
@@ -494,7 +513,9 @@
|
|
||||||
{
|
|
||||||
while (Mouse.next())
|
|
||||||
{
|
|
||||||
+ if (MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.MouseInputEvent.Pre(this))) continue;
|
|
||||||
this.handleMouseInput();
|
|
||||||
+ if (this.equals(this.mc.currentScreen)) MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.MouseInputEvent.Post(this));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -502,7 +523,9 @@
|
|
||||||
{
|
|
||||||
while (Keyboard.next())
|
|
||||||
{
|
|
||||||
+ if (MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.KeyboardInputEvent.Pre(this))) continue;
|
|
||||||
this.handleKeyboardInput();
|
|
||||||
+ if (this.equals(this.mc.currentScreen)) MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.KeyboardInputEvent.Post(this));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiSelectWorld.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSelectWorld.java
|
|
||||||
@@ -187,7 +187,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,11 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiSleepMP.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSleepMP.java
|
|
||||||
@@ -34,7 +34,7 @@
|
|
||||||
|
|
||||||
if (!s.isEmpty())
|
|
||||||
{
|
|
||||||
- this.mc.thePlayer.sendChatMessage(s);
|
|
||||||
+ this.sendChatMessage(s); // Forge: fix vanilla not adding messages to the sent list while sleeping
|
|
||||||
}
|
|
||||||
|
|
||||||
this.inputField.setText("");
|
|
|
@ -1,40 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiSlot.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSlot.java
|
|
||||||
@@ -185,16 +185,7 @@
|
|
||||||
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 f1 = 32.0F;
|
|
||||||
- worldrenderer.startDrawingQuads();
|
|
||||||
- worldrenderer.setColorOpaque_I(2105376);
|
|
||||||
- worldrenderer.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1));
|
|
||||||
- worldrenderer.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1));
|
|
||||||
- worldrenderer.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1));
|
|
||||||
- worldrenderer.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1));
|
|
||||||
- tessellator.draw();
|
|
||||||
+ this.drawContainerBackground(tessellator);
|
|
||||||
int i1 = this.left + this.width / 2 - this.getListWidth() / 2 + 2;
|
|
||||||
int j1 = this.top + 4 - (int)this.amountScrolled;
|
|
||||||
|
|
||||||
@@ -456,4 +447,19 @@
|
|
||||||
{
|
|
||||||
return this.slotHeight;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ protected void drawContainerBackground(Tessellator tessellator)
|
|
||||||
+ {
|
|
||||||
+ WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
|
||||||
+ this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
|
|
||||||
+ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
+ float f1 = 32.0F;
|
|
||||||
+ worldrenderer.startDrawingQuads();
|
|
||||||
+ worldrenderer.setColorOpaque_I(2105376);
|
|
||||||
+ worldrenderer.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1));
|
|
||||||
+ worldrenderer.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1));
|
|
||||||
+ worldrenderer.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1));
|
|
||||||
+ worldrenderer.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1));
|
|
||||||
+ tessellator.draw();
|
|
||||||
+ }
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java
|
|
||||||
@@ -84,7 +84,7 @@
|
|
||||||
boolean flag2 = this.field_148301_e.version < 47;
|
|
||||||
boolean flag3 = flag1 || flag2;
|
|
||||||
this.field_148300_d.fontRendererObj.drawString(this.field_148301_e.serverName, x + 32 + 3, y + 1, 16777215);
|
|
||||||
- List list = this.field_148300_d.fontRendererObj.listFormattedStringToWidth(this.field_148301_e.serverMOTD, listWidth - 32 - 2);
|
|
||||||
+ List list = this.field_148300_d.fontRendererObj.listFormattedStringToWidth(net.minecraftforge.fml.client.FMLClientHandler.instance().fixDescription(this.field_148301_e.serverMOTD), listWidth - 48 - 2);
|
|
||||||
|
|
||||||
for (int l1 = 0; l1 < Math.min(list.size(), 2); ++l1)
|
|
||||||
{
|
|
||||||
@@ -178,6 +178,11 @@
|
|
||||||
int k2 = mouseX - x;
|
|
||||||
int l2 = mouseY - y;
|
|
||||||
|
|
||||||
+ String tooltip = net.minecraftforge.fml.client.FMLClientHandler.instance().enhanceServerListEntry(this, this.field_148301_e, x, listWidth, y, k2, l2);
|
|
||||||
+ if (tooltip != null)
|
|
||||||
+ {
|
|
||||||
+ this.field_148303_c.func_146793_a(tooltip);
|
|
||||||
+ } else
|
|
||||||
if (k2 >= listWidth - 15 && k2 <= listWidth - 5 && l2 >= 0 && l2 <= 8)
|
|
||||||
{
|
|
||||||
this.field_148303_c.func_146793_a(s1);
|
|
|
@ -1,127 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java
|
|
||||||
@@ -24,6 +24,9 @@
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import org.lwjgl.input.Mouse;
|
|
||||||
+import java.util.LinkedList;
|
|
||||||
+import java.util.List;
|
|
||||||
+import net.minecraftforge.common.AchievementPage;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public class GuiAchievements extends GuiScreen implements IProgressMeter
|
|
||||||
@@ -50,6 +53,10 @@
|
|
||||||
private boolean loadingAchievements = true;
|
|
||||||
private static final String __OBFID = "CL_00000722";
|
|
||||||
|
|
||||||
+ private int currentPage = -1;
|
|
||||||
+ private GuiButton button;
|
|
||||||
+ private LinkedList<Achievement> minecraftAchievements = new LinkedList<Achievement>();
|
|
||||||
+
|
|
||||||
public GuiAchievements(GuiScreen p_i45026_1_, StatFileWriter p_i45026_2_)
|
|
||||||
{
|
|
||||||
this.parentScreen = p_i45026_1_;
|
|
||||||
@@ -58,6 +65,14 @@
|
|
||||||
short short2 = 141;
|
|
||||||
this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.openInventory.displayColumn * 24 - short1 / 2 - 12);
|
|
||||||
this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.openInventory.displayRow * 24 - short2 / 2);
|
|
||||||
+ minecraftAchievements.clear();
|
|
||||||
+ for (Object achievement : AchievementList.achievementList)
|
|
||||||
+ {
|
|
||||||
+ if (!AchievementPage.isAchievementInPages((Achievement)achievement))
|
|
||||||
+ {
|
|
||||||
+ minecraftAchievements.add((Achievement)achievement);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
public void initGui()
|
|
||||||
@@ -65,6 +80,7 @@
|
|
||||||
this.mc.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS));
|
|
||||||
this.buttonList.clear();
|
|
||||||
this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.format("gui.done", new Object[0])));
|
|
||||||
+ this.buttonList.add(button = new GuiButton(2, (width - field_146555_f) / 2 + 24, height / 2 + 74, 125, 20, AchievementPage.getTitle(currentPage)));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void actionPerformed(GuiButton button) throws IOException
|
|
||||||
@@ -75,6 +91,16 @@
|
|
||||||
{
|
|
||||||
this.mc.displayGuiScreen(this.parentScreen);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ if (button.id == 2)
|
|
||||||
+ {
|
|
||||||
+ currentPage++;
|
|
||||||
+ if (currentPage >= AchievementPage.getAchievementPages().size())
|
|
||||||
+ {
|
|
||||||
+ currentPage = -1;
|
|
||||||
+ }
|
|
||||||
+ this.button.displayString = AchievementPage.getTitle(currentPage);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -260,7 +286,9 @@
|
|
||||||
GlStateManager.depthFunc(518);
|
|
||||||
GlStateManager.pushMatrix();
|
|
||||||
GlStateManager.translate((float)k1, (float)l1, -200.0F);
|
|
||||||
- GlStateManager.scale(1.0F / this.field_146570_r, 1.0F / this.field_146570_r, 0.0F);
|
|
||||||
+ // FIXES models rendering weirdly in the acheivements pane
|
|
||||||
+ // see https://github.com/MinecraftForge/MinecraftForge/commit/1b7ce7592caafb760ec93066184182ae0711e793#commitcomment-10512284
|
|
||||||
+ GlStateManager.scale(1.0F / this.field_146570_r, 1.0F / this.field_146570_r, 1.0F);
|
|
||||||
GlStateManager.enableTexture2D();
|
|
||||||
GlStateManager.disableLighting();
|
|
||||||
GlStateManager.enableRescaleNormal();
|
|
||||||
@@ -341,11 +369,12 @@
|
|
||||||
int i4;
|
|
||||||
int l4;
|
|
||||||
|
|
||||||
- for (i3 = 0; i3 < AchievementList.achievementList.size(); ++i3)
|
|
||||||
+ List<Achievement> achievementList = (currentPage == -1 ? minecraftAchievements : AchievementPage.getAchievementPage(currentPage).getAchievements());
|
|
||||||
+ for (i3 = 0; i3 < achievementList.size(); ++i3)
|
|
||||||
{
|
|
||||||
- Achievement achievement1 = (Achievement)AchievementList.achievementList.get(i3);
|
|
||||||
+ Achievement achievement1 = achievementList.get(i3);
|
|
||||||
|
|
||||||
- if (achievement1.parentAchievement != null)
|
|
||||||
+ if (achievement1.parentAchievement != null && achievementList.contains(achievement1.parentAchievement))
|
|
||||||
{
|
|
||||||
j3 = achievement1.displayColumn * 24 - k + 11;
|
|
||||||
k3 = achievement1.displayRow * 24 - l + 11;
|
|
||||||
@@ -401,9 +430,9 @@
|
|
||||||
int i5;
|
|
||||||
int j5;
|
|
||||||
|
|
||||||
- for (k3 = 0; k3 < AchievementList.achievementList.size(); ++k3)
|
|
||||||
+ for (k3 = 0; k3 < achievementList.size(); ++k3)
|
|
||||||
{
|
|
||||||
- Achievement achievement2 = (Achievement)AchievementList.achievementList.get(k3);
|
|
||||||
+ Achievement achievement2 = (Achievement)achievementList.get(k3);
|
|
||||||
l4 = achievement2.displayColumn * 24 - k;
|
|
||||||
i5 = achievement2.displayRow * 24 - l;
|
|
||||||
|
|
||||||
@@ -445,6 +474,7 @@
|
|
||||||
|
|
||||||
this.mc.getTextureManager().bindTexture(field_146561_C);
|
|
||||||
|
|
||||||
+ GlStateManager.enableBlend(); // Forge: Specifically enable blend because it is needed here. And we fix Generic RenderItem's leakage of it.
|
|
||||||
if (achievement2.getSpecial())
|
|
||||||
{
|
|
||||||
this.drawTexturedModalRect(l4 - 2, i5 - 2, 26, 202, 26, 26);
|
|
||||||
@@ -453,6 +483,7 @@
|
|
||||||
{
|
|
||||||
this.drawTexturedModalRect(l4 - 2, i5 - 2, 0, 202, 26, 26);
|
|
||||||
}
|
|
||||||
+ GlStateManager.disableBlend(); //Forge: Cleanup states we set.
|
|
||||||
|
|
||||||
if (!this.statFileWriter.canUnlockAchievement(achievement2))
|
|
||||||
{
|
|
||||||
@@ -461,7 +492,7 @@
|
|
||||||
this.itemRender.func_175039_a(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
- GlStateManager.enableLighting();
|
|
||||||
+ GlStateManager.disableLighting(); //Forge: Make sure Lighting is disabled. Fixes MC-33065
|
|
||||||
GlStateManager.enableCull();
|
|
||||||
this.itemRender.renderItemAndEffectIntoGUI(achievement2.theItemStack, l4 + 3, i5 + 3);
|
|
||||||
GlStateManager.blendFunc(770, 771);
|
|
|
@ -1,19 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/achievement/GuiStats.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/achievement/GuiStats.java
|
|
||||||
@@ -769,6 +769,7 @@
|
|
||||||
super(mcIn, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, GuiStats.this.fontRendererObj.FONT_HEIGHT * 4);
|
|
||||||
this.setShowSelectionBox(false);
|
|
||||||
Iterator iterator = EntityList.entityEggs.values().iterator();
|
|
||||||
+ iterator = com.google.common.collect.Iterators.concat(iterator, net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().values().iterator());
|
|
||||||
|
|
||||||
while (iterator.hasNext())
|
|
||||||
{
|
|
||||||
@@ -806,7 +807,7 @@
|
|
||||||
protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int p_180791_5_, int p_180791_6_)
|
|
||||||
{
|
|
||||||
EntityList.EntityEggInfo entityegginfo = (EntityList.EntityEggInfo)this.field_148222_l.get(entryID);
|
|
||||||
- String s = I18n.format("entity." + EntityList.getStringFromID(entityegginfo.spawnedID) + ".name", new Object[0]);
|
|
||||||
+ String s = I18n.format("entity." + entityegginfo.name + ".name", new Object[0]);
|
|
||||||
int k1 = GuiStats.this.field_146546_t.readStat(entityegginfo.field_151512_d);
|
|
||||||
int l1 = GuiStats.this.field_146546_t.readStat(entityegginfo.field_151513_e);
|
|
||||||
String s1 = I18n.format("stat.entityKills", new Object[] {Integer.valueOf(k1), s});
|
|
|
@ -1,65 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
|
|
||||||
@@ -5,6 +5,7 @@
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Set;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
+import net.minecraft.client.gui.FontRenderer;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
|
||||||
import net.minecraft.client.renderer.OpenGlHelper;
|
|
||||||
@@ -178,8 +179,11 @@
|
|
||||||
GlStateManager.translate(0.0F, 0.0F, 32.0F);
|
|
||||||
this.zLevel = 200.0F;
|
|
||||||
this.itemRender.zLevel = 200.0F;
|
|
||||||
+ FontRenderer font = null;
|
|
||||||
+ if (stack != null) font = stack.getItem().getFontRenderer(stack);
|
|
||||||
+ if (font == null) font = fontRendererObj;
|
|
||||||
this.itemRender.renderItemAndEffectIntoGUI(stack, x, y);
|
|
||||||
- this.itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, stack, x, y - (this.draggedStack == null ? 0 : 8), altText);
|
|
||||||
+ this.itemRender.renderItemOverlayIntoGUI(font, stack, x, y - (this.draggedStack == null ? 0 : 8), altText);
|
|
||||||
this.zLevel = 0.0F;
|
|
||||||
this.itemRender.zLevel = 0.0F;
|
|
||||||
}
|
|
||||||
@@ -240,13 +244,12 @@
|
|
||||||
|
|
||||||
if (itemstack == null)
|
|
||||||
{
|
|
||||||
- String s1 = slotIn.getSlotTexture();
|
|
||||||
+ TextureAtlasSprite textureatlassprite = slotIn.getBackgroundSprite();
|
|
||||||
|
|
||||||
- if (s1 != null)
|
|
||||||
+ if (textureatlassprite != null)
|
|
||||||
{
|
|
||||||
- TextureAtlasSprite textureatlassprite = this.mc.getTextureMapBlocks().getAtlasSprite(s1);
|
|
||||||
GlStateManager.disableLighting();
|
|
||||||
- this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
|
|
||||||
+ this.mc.getTextureManager().bindTexture(slotIn.getBackgroundLocation());
|
|
||||||
this.drawTexturedModalRect(i, j, textureatlassprite, 16, 16);
|
|
||||||
GlStateManager.enableLighting();
|
|
||||||
flag1 = true;
|
|
||||||
@@ -465,6 +468,7 @@
|
|
||||||
|
|
||||||
protected void mouseReleased(int mouseX, int mouseY, int state)
|
|
||||||
{
|
|
||||||
+ super.mouseReleased(mouseX, mouseY, state); //Forge, Call parent to release buttons
|
|
||||||
Slot slot = this.getSlotAtPosition(mouseX, mouseY);
|
|
||||||
int l = this.guiLeft;
|
|
||||||
int i1 = this.guiTop;
|
|
||||||
@@ -698,4 +702,16 @@
|
|
||||||
this.mc.thePlayer.closeScreen();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ /* ======================================== FORGE START =====================================*/
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Returns the slot that is currently displayed under the mouse.
|
|
||||||
+ */
|
|
||||||
+ public Slot getSlotUnderMouse()
|
|
||||||
+ {
|
|
||||||
+ return this.theSlot;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* ======================================== FORGE END =====================================*/
|
|
||||||
}
|
|
|
@ -1,267 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java
|
|
||||||
@@ -49,6 +49,8 @@
|
|
||||||
private boolean field_147057_D;
|
|
||||||
private CreativeCrafting field_147059_E;
|
|
||||||
private static final String __OBFID = "CL_00000752";
|
|
||||||
+ private static int tabPage = 0;
|
|
||||||
+ private int maxPages = 0;
|
|
||||||
|
|
||||||
public GuiContainerCreative(EntityPlayer p_i1088_1_)
|
|
||||||
{
|
|
||||||
@@ -187,7 +189,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)
|
|
||||||
{
|
|
||||||
@@ -262,6 +264,13 @@
|
|
||||||
this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[i]);
|
|
||||||
this.field_147059_E = new CreativeCrafting(this.mc);
|
|
||||||
this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_147059_E);
|
|
||||||
+ int tabCount = CreativeTabs.creativeTabArray.length;
|
|
||||||
+ if (tabCount > 12)
|
|
||||||
+ {
|
|
||||||
+ buttonList.add(new GuiButton(101, guiLeft, guiTop - 50, 20, 20, "<"));
|
|
||||||
+ buttonList.add(new GuiButton(102, guiLeft + xSize - 20, guiTop - 50, 20, 20, ">"));
|
|
||||||
+ maxPages = ((tabCount - 12) / 10) + 1;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@@ -283,7 +292,7 @@
|
|
||||||
|
|
||||||
protected void keyTyped(char typedChar, int keyCode) throws IOException
|
|
||||||
{
|
|
||||||
- if (selectedTabIndex != CreativeTabs.tabAllSearch.getTabIndex())
|
|
||||||
+ if (!CreativeTabs.creativeTabArray[selectedTabIndex].hasSearchBar())
|
|
||||||
{
|
|
||||||
if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat))
|
|
||||||
{
|
|
||||||
@@ -320,6 +329,15 @@
|
|
||||||
{
|
|
||||||
GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots;
|
|
||||||
containercreative.itemList.clear();
|
|
||||||
+
|
|
||||||
+ CreativeTabs tab = CreativeTabs.creativeTabArray[selectedTabIndex];
|
|
||||||
+ if (tab.hasSearchBar() && tab != CreativeTabs.tabAllSearch)
|
|
||||||
+ {
|
|
||||||
+ tab.displayAllReleventItems(containercreative.itemList);
|
|
||||||
+ updateFilteredItems(containercreative);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
Iterator iterator = Item.itemRegistry.iterator();
|
|
||||||
|
|
||||||
while (iterator.hasNext())
|
|
||||||
@@ -331,10 +349,17 @@
|
|
||||||
item.getSubItems(item, (CreativeTabs)null, containercreative.itemList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ updateFilteredItems(containercreative);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
+ //split from above for custom search tabs
|
|
||||||
+ private void updateFilteredItems(GuiContainerCreative.ContainerCreative containercreative)
|
|
||||||
+ {
|
|
||||||
+ Iterator iterator;
|
|
||||||
Enchantment[] aenchantment = Enchantment.enchantmentsBookList;
|
|
||||||
int j = aenchantment.length;
|
|
||||||
|
|
||||||
+ if (CreativeTabs.creativeTabArray[selectedTabIndex] != CreativeTabs.tabAllSearch) j = 0; //Forge: Don't add enchants to custom tabs.
|
|
||||||
for (int i = 0; i < j; ++i)
|
|
||||||
{
|
|
||||||
Enchantment enchantment = aenchantment[i];
|
|
||||||
@@ -385,7 +410,7 @@
|
|
||||||
{
|
|
||||||
CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex];
|
|
||||||
|
|
||||||
- if (creativetabs.drawInForegroundOfTab())
|
|
||||||
+ if (creativetabs != null && creativetabs.drawInForegroundOfTab())
|
|
||||||
{
|
|
||||||
GlStateManager.disableBlend();
|
|
||||||
this.fontRendererObj.drawString(I18n.format(creativetabs.getTranslatedTabLabel(), new Object[0]), 8, 6, 4210752);
|
|
||||||
@@ -428,7 +453,7 @@
|
|
||||||
{
|
|
||||||
CreativeTabs creativetabs = acreativetabs[k1];
|
|
||||||
|
|
||||||
- if (this.func_147049_a(creativetabs, l, i1))
|
|
||||||
+ if (creativetabs != null && this.func_147049_a(creativetabs, l, i1))
|
|
||||||
{
|
|
||||||
this.setCurrentCreativeTab(creativetabs);
|
|
||||||
return;
|
|
||||||
@@ -441,11 +466,13 @@
|
|
||||||
|
|
||||||
private boolean needsScrollBars()
|
|
||||||
{
|
|
||||||
+ if (CreativeTabs.creativeTabArray[selectedTabIndex] == null) return false;
|
|
||||||
return selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && CreativeTabs.creativeTabArray[selectedTabIndex].shouldHidePlayerInventory() && ((GuiContainerCreative.ContainerCreative)this.inventorySlots).func_148328_e();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setCurrentCreativeTab(CreativeTabs p_147050_1_)
|
|
||||||
{
|
|
||||||
+ if (p_147050_1_ == null) return;
|
|
||||||
int i = selectedTabIndex;
|
|
||||||
selectedTabIndex = p_147050_1_.getTabIndex();
|
|
||||||
GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots;
|
|
||||||
@@ -514,12 +541,14 @@
|
|
||||||
|
|
||||||
if (this.searchField != null)
|
|
||||||
{
|
|
||||||
- if (p_147050_1_ == CreativeTabs.tabAllSearch)
|
|
||||||
+ if (p_147050_1_.hasSearchBar())
|
|
||||||
{
|
|
||||||
this.searchField.setVisible(true);
|
|
||||||
this.searchField.setCanLoseFocus(false);
|
|
||||||
this.searchField.setFocused(true);
|
|
||||||
this.searchField.setText("");
|
|
||||||
+ this.searchField.width = p_147050_1_.getSearchbarWidth();
|
|
||||||
+ this.searchField.xPosition = this.guiLeft + (82 /*default left*/ + 89 /*default width*/) - this.searchField.width;
|
|
||||||
this.updateCreativeSearch();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
@@ -590,23 +619,45 @@
|
|
||||||
|
|
||||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
|
||||||
CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray;
|
|
||||||
- int i2 = acreativetabs.length;
|
|
||||||
+ int start = tabPage * 10;
|
|
||||||
+ int i2 = Math.min(acreativetabs.length, ((tabPage + 1) * 10) + 2);
|
|
||||||
+ if (tabPage != 0) start += 2;
|
|
||||||
+ boolean rendered = false;
|
|
||||||
|
|
||||||
- for (int j2 = 0; j2 < i2; ++j2)
|
|
||||||
+ for (int j2 = start; j2 < i2; ++j2)
|
|
||||||
{
|
|
||||||
CreativeTabs creativetabs = acreativetabs[j2];
|
|
||||||
|
|
||||||
+ if (creativetabs == null) continue;
|
|
||||||
if (this.renderCreativeInventoryHoveringText(creativetabs, mouseX, mouseY))
|
|
||||||
{
|
|
||||||
+ rendered = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (!rendered && renderCreativeInventoryHoveringText(CreativeTabs.tabAllSearch, mouseX, mouseY))
|
|
||||||
+ {
|
|
||||||
+ renderCreativeInventoryHoveringText(CreativeTabs.tabInventory, mouseX, mouseY);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if (this.field_147064_C != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.isPointInRegion(this.field_147064_C.xDisplayPosition, this.field_147064_C.yDisplayPosition, 16, 16, mouseX, mouseY))
|
|
||||||
{
|
|
||||||
this.drawCreativeTabHoveringText(I18n.format("inventory.binSlot", new Object[0]), mouseX, mouseY);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (maxPages != 0)
|
|
||||||
+ {
|
|
||||||
+ String page = String.format("%d / %d", tabPage + 1, maxPages + 1);
|
|
||||||
+ int width = fontRendererObj.getStringWidth(page);
|
|
||||||
+ GlStateManager.disableLighting();
|
|
||||||
+ this.zLevel = 300.0F;
|
|
||||||
+ itemRender.zLevel = 300.0F;
|
|
||||||
+ fontRendererObj.drawString(page, guiLeft + (xSize / 2) - (width / 2), guiTop - 44, -1);
|
|
||||||
+ this.zLevel = 0.0F;
|
|
||||||
+ itemRender.zLevel = 0.0F;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
GlStateManager.disableLighting();
|
|
||||||
}
|
|
||||||
@@ -675,17 +726,36 @@
|
|
||||||
int k = acreativetabs.length;
|
|
||||||
int l;
|
|
||||||
|
|
||||||
- for (l = 0; l < k; ++l)
|
|
||||||
+ int start = tabPage * 10;
|
|
||||||
+ k = Math.min(acreativetabs.length, ((tabPage + 1) * 10 + 2));
|
|
||||||
+ if (tabPage != 0) start += 2;
|
|
||||||
+
|
|
||||||
+ for (l = start; l < k; ++l)
|
|
||||||
{
|
|
||||||
CreativeTabs creativetabs1 = acreativetabs[l];
|
|
||||||
this.mc.getTextureManager().bindTexture(creativeInventoryTabs);
|
|
||||||
|
|
||||||
+ if (creativetabs1 == null) continue;
|
|
||||||
if (creativetabs1.getTabIndex() != selectedTabIndex)
|
|
||||||
{
|
|
||||||
this.func_147051_a(creativetabs1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (tabPage != 0)
|
|
||||||
+ {
|
|
||||||
+ if (creativetabs != CreativeTabs.tabAllSearch)
|
|
||||||
+ {
|
|
||||||
+ this.mc.getTextureManager().bindTexture(creativeInventoryTabs);
|
|
||||||
+ func_147051_a(CreativeTabs.tabAllSearch);
|
|
||||||
+ }
|
|
||||||
+ if (creativetabs != CreativeTabs.tabInventory)
|
|
||||||
+ {
|
|
||||||
+ this.mc.getTextureManager().bindTexture(creativeInventoryTabs);
|
|
||||||
+ func_147051_a(CreativeTabs.tabInventory);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
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();
|
|
||||||
@@ -700,6 +770,14 @@
|
|
||||||
this.drawTexturedModalRect(i1, k + (int)((float)(l - k - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (creativetabs == null || creativetabs.getTabPage() != tabPage)
|
|
||||||
+ {
|
|
||||||
+ if (creativetabs != CreativeTabs.tabAllSearch && creativetabs != CreativeTabs.tabInventory)
|
|
||||||
+ {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
this.func_147051_a(creativetabs);
|
|
||||||
|
|
||||||
if (creativetabs == CreativeTabs.tabInventory)
|
|
||||||
@@ -710,6 +788,15 @@
|
|
||||||
|
|
||||||
protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_)
|
|
||||||
{
|
|
||||||
+ if (p_147049_1_.getTabPage() != tabPage)
|
|
||||||
+ {
|
|
||||||
+ if (p_147049_1_ != CreativeTabs.tabAllSearch &&
|
|
||||||
+ p_147049_1_ != CreativeTabs.tabInventory)
|
|
||||||
+ {
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
int k = p_147049_1_.getTabColumn();
|
|
||||||
int l = 28 * k;
|
|
||||||
byte b0 = 0;
|
|
||||||
@@ -810,6 +897,8 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
GlStateManager.disableLighting();
|
|
||||||
+ GlStateManager.color(1F, 1F, 1F); //Forge: Reset color in case Items change it.
|
|
||||||
+ GlStateManager.enableBlend(); //Forge: Make sure blend is enabled else tabs show a white border.
|
|
||||||
this.drawTexturedModalRect(l, i1, j, k, 28, b0);
|
|
||||||
this.zLevel = 100.0F;
|
|
||||||
this.itemRender.zLevel = 100.0F;
|
|
||||||
@@ -836,6 +925,15 @@
|
|
||||||
{
|
|
||||||
this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter()));
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ if (button.id == 101)
|
|
||||||
+ {
|
|
||||||
+ tabPage = Math.max(tabPage - 1, 0);
|
|
||||||
+ }
|
|
||||||
+ else if (button.id == 102)
|
|
||||||
+ {
|
|
||||||
+ tabPage = Math.min(tabPage + 1, maxPages);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSelectedTabIndex()
|
|
|
@ -1,10 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/model/ModelBase.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/model/ModelBase.java
|
|
||||||
@@ -10,7 +10,6 @@
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
-@SideOnly(Side.CLIENT)
|
|
||||||
public abstract class ModelBase
|
|
||||||
{
|
|
||||||
public float swingProgress;
|
|
|
@ -1,18 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/model/ModelBox.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/model/ModelBox.java
|
|
||||||
@@ -4,7 +4,6 @@
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
-@SideOnly(Side.CLIENT)
|
|
||||||
public class ModelBox
|
|
||||||
{
|
|
||||||
private PositionTextureVertex[] vertexPositions;
|
|
||||||
@@ -82,6 +81,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @SideOnly(Side.CLIENT)
|
|
||||||
public void render(WorldRenderer p_178780_1_, float p_178780_2_)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < this.quadList.length; ++i)
|
|
|
@ -1,42 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/model/ModelRenderer.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/model/ModelRenderer.java
|
|
||||||
@@ -10,7 +10,6 @@
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
-@SideOnly(Side.CLIENT)
|
|
||||||
public class ModelRenderer
|
|
||||||
{
|
|
||||||
public float textureWidth;
|
|
||||||
@@ -110,6 +109,7 @@
|
|
||||||
this.rotationPointZ = p_78793_3_;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @SideOnly(Side.CLIENT)
|
|
||||||
public void render(float p_78785_1_)
|
|
||||||
{
|
|
||||||
if (!this.isHidden)
|
|
||||||
@@ -192,6 +192,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @SideOnly(Side.CLIENT)
|
|
||||||
public void renderWithRotation(float p_78791_1_)
|
|
||||||
{
|
|
||||||
if (!this.isHidden)
|
|
||||||
@@ -227,6 +228,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @SideOnly(Side.CLIENT)
|
|
||||||
public void postRender(float p_78794_1_)
|
|
||||||
{
|
|
||||||
if (!this.isHidden)
|
|
||||||
@@ -268,6 +270,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ @SideOnly(Side.CLIENT)
|
|
||||||
private void compileDisplayList(float p_78788_1_)
|
|
||||||
{
|
|
||||||
this.displayList = GLAllocation.generateDisplayLists(1);
|
|
|
@ -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
|
|
||||||
@@ -3,10 +3,7 @@
|
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
|
||||||
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,10 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java
|
|
||||||
@@ -56,6 +56,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);
|
|
||||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(chunk));
|
|
||||||
chunk.setChunkLoaded(true);
|
|
||||||
return chunk;
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/GuiConnecting.java
|
|
||||||
@@ -69,7 +69,7 @@
|
|
||||||
inetaddress = InetAddress.getByName(ip);
|
|
||||||
GuiConnecting.this.networkManager = NetworkManager.provideLanClient(inetaddress, port);
|
|
||||||
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,69 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java
|
|
||||||
@@ -113,6 +113,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;
|
|
||||||
@@ -130,7 +136,7 @@
|
|
||||||
else
|
|
||||||
{
|
|
||||||
worldclient.playAuxSFX(2001, pos, Block.getStateId(iblockstate));
|
|
||||||
- boolean flag = worldclient.setBlockToAir(pos);
|
|
||||||
+ boolean flag = block1.removedByPlayer(worldclient, pos, mc.thePlayer, false);
|
|
||||||
|
|
||||||
if (flag)
|
|
||||||
{
|
|
||||||
@@ -360,11 +366,19 @@
|
|
||||||
{
|
|
||||||
if (this.currentGameType != WorldSettings.GameType.SPECTATOR)
|
|
||||||
{
|
|
||||||
+
|
|
||||||
+ if (p_178890_3_ != null &&
|
|
||||||
+ p_178890_3_.getItem() != null &&
|
|
||||||
+ p_178890_3_.getItem().onItemUseFirst(p_178890_3_, p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2))
|
|
||||||
+ {
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
IBlockState iblockstate = p_178890_2_.getBlockState(p_178890_4_);
|
|
||||||
|
|
||||||
- if ((!p_178890_1_.isSneaking() || p_178890_1_.getHeldItem() == null) && iblockstate.getBlock().onBlockActivated(p_178890_2_, p_178890_4_, iblockstate, p_178890_1_, p_178890_5_, f, f1, f2))
|
|
||||||
+ if ((!p_178890_1_.isSneaking() || p_178890_1_.getHeldItem() == null || p_178890_1_.getHeldItem().getItem().doesSneakBypassUse(p_178890_2_, p_178890_4_, p_178890_1_)))
|
|
||||||
{
|
|
||||||
- flag = true;
|
|
||||||
+ flag = iblockstate.getBlock().onBlockActivated(p_178890_2_, p_178890_4_, iblockstate, p_178890_1_, p_178890_5_, f, f1, f2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!flag && p_178890_3_ != null && p_178890_3_.getItem() instanceof ItemBlock)
|
|
||||||
@@ -397,7 +411,9 @@
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
- return p_178890_3_.onItemUse(p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2);
|
|
||||||
+ if (!p_178890_3_.onItemUse(p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2)) return false;
|
|
||||||
+ if (p_178890_3_.stackSize <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_178890_1_, p_178890_3_);
|
|
||||||
+ return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
@@ -428,9 +444,10 @@
|
|
||||||
{
|
|
||||||
playerIn.inventory.mainInventory[playerIn.inventory.currentItem] = itemstack1;
|
|
||||||
|
|
||||||
- if (itemstack1.stackSize == 0)
|
|
||||||
+ if (itemstack1.stackSize <= 0)
|
|
||||||
{
|
|
||||||
playerIn.inventory.mainInventory[playerIn.inventory.currentItem] = null;
|
|
||||||
+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(playerIn, itemstack1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
|
@ -1,17 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/multiplayer/WorldClient.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/WorldClient.java
|
|
||||||
@@ -54,12 +54,13 @@
|
|
||||||
super(new SaveHandlerMP(), new WorldInfo(p_i45063_2_, "MpServer"), WorldProvider.getProviderForDimension(p_i45063_3_), p_i45063_5_, true);
|
|
||||||
this.sendQueue = p_i45063_1_;
|
|
||||||
this.getWorldInfo().setDifficulty(p_i45063_4_);
|
|
||||||
- this.setSpawnPoint(new BlockPos(8, 64, 8));
|
|
||||||
this.provider.registerWorld(this);
|
|
||||||
+ this.setSpawnPoint(new BlockPos(8, 64, 8)); //Forge: Moved below registerWorld to prevent NPE in our redirect.
|
|
||||||
this.chunkProvider = this.createChunkProvider();
|
|
||||||
this.mapStorage = new SaveDataMemoryStorage();
|
|
||||||
this.calculateInitialSkylight();
|
|
||||||
this.calculateInitialWeather();
|
|
||||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Load(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void tick()
|
|
|
@ -1,10 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerHandshakeMemory.java
|
|
||||||
@@ -24,6 +24,7 @@
|
|
||||||
|
|
||||||
public void processHandshake(C00Handshake packetIn)
|
|
||||||
{
|
|
||||||
+ if (!net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerHandshake(packetIn, this.networkManager)) return;
|
|
||||||
this.networkManager.setConnectionState(packetIn.getRequestedState());
|
|
||||||
this.networkManager.setNetHandler(new NetHandlerLoginServer(this.mcServer, this.networkManager));
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java
|
|
||||||
@@ -92,7 +92,10 @@
|
|
||||||
{
|
|
||||||
this.gameProfile = packetIn.getProfile();
|
|
||||||
this.networkManager.setConnectionState(EnumConnectionState.PLAY);
|
|
||||||
- this.networkManager.setNetHandler(new NetHandlerPlayClient(this.mc, this.previousGuiScreen, this.networkManager, this.gameProfile));
|
|
||||||
+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlClientHandshake(this.networkManager);
|
|
||||||
+ NetHandlerPlayClient nhpc = new NetHandlerPlayClient(this.mc, this.previousGuiScreen, this.networkManager, this.gameProfile);
|
|
||||||
+ this.networkManager.setNetHandler(nhpc);
|
|
||||||
+ net.minecraftforge.fml.client.FMLClientHandler.instance().setPlayClient(nhpc);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onDisconnect(IChatComponent reason)
|
|
|
@ -1,72 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java
|
|
||||||
@@ -247,7 +247,7 @@
|
|
||||||
{
|
|
||||||
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
|
|
||||||
this.gameController.playerController = new PlayerControllerMP(this.gameController, this);
|
|
||||||
- this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler);
|
|
||||||
+ this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.get(getNetworkManager()).getOverrideDimension(packetIn), packetIn.getDifficulty(), this.gameController.mcProfiler);
|
|
||||||
this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
|
|
||||||
this.gameController.loadWorld(this.clientWorldController);
|
|
||||||
this.gameController.thePlayer.dimension = packetIn.getDimension();
|
|
||||||
@@ -410,7 +410,8 @@
|
|
||||||
public void handleSpawnExperienceOrb(S11PacketSpawnExperienceOrb packetIn)
|
|
||||||
{
|
|
||||||
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
|
|
||||||
- EntityXPOrb entityxporb = new EntityXPOrb(this.clientWorldController, (double)packetIn.func_148984_d(), (double)packetIn.func_148983_e(), (double)packetIn.func_148982_f(), packetIn.func_148986_g());
|
|
||||||
+ EntityXPOrb entityxporb = new EntityXPOrb(this.clientWorldController, (double)packetIn.func_148984_d() / 32.0D, (double)packetIn.func_148983_e() / 32.0D, (double)packetIn.func_148982_f() / 32.0D, packetIn.func_148986_g());
|
|
||||||
+ // FORGE: BugFix MC-12013 Wrong XP orb clientside spawn position
|
|
||||||
entityxporb.serverPosX = packetIn.func_148984_d();
|
|
||||||
entityxporb.serverPosY = packetIn.func_148983_e();
|
|
||||||
entityxporb.serverPosZ = packetIn.func_148982_f();
|
|
||||||
@@ -754,14 +755,16 @@
|
|
||||||
public void handleChat(S02PacketChat packetIn)
|
|
||||||
{
|
|
||||||
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
|
|
||||||
+ net.minecraft.util.IChatComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(packetIn.func_179841_c(), packetIn.func_148915_c());
|
|
||||||
+ if (message == null) return;
|
|
||||||
|
|
||||||
if (packetIn.func_179841_c() == 2)
|
|
||||||
{
|
|
||||||
- this.gameController.ingameGUI.func_175188_a(packetIn.func_148915_c(), false);
|
|
||||||
+ this.gameController.ingameGUI.func_175188_a(message, false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
- this.gameController.ingameGUI.getChatGUI().printChatMessage(packetIn.func_148915_c());
|
|
||||||
+ this.gameController.ingameGUI.getChatGUI().printChatMessage(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -812,6 +815,11 @@
|
|
||||||
float f = (float)(packetIn.func_149028_l() * 360) / 256.0F;
|
|
||||||
float f1 = (float)(packetIn.func_149030_m() * 360) / 256.0F;
|
|
||||||
EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.createEntityByID(packetIn.func_149025_e(), this.gameController.theWorld);
|
|
||||||
+ if (entitylivingbase == null)
|
|
||||||
+ {
|
|
||||||
+ net.minecraftforge.fml.common.FMLLog.info("Server attempted to spawn an unknown entity using ID: {0} at ({1}, {2}, {3}) Skipping!", packetIn.func_149025_e(), d0, d1, d2);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
entitylivingbase.serverPosX = packetIn.func_149023_f();
|
|
||||||
entitylivingbase.serverPosY = packetIn.func_149034_g();
|
|
||||||
entitylivingbase.serverPosZ = packetIn.func_149029_h();
|
|
||||||
@@ -1137,6 +1145,10 @@
|
|
||||||
{
|
|
||||||
tileentity.readFromNBT(packetIn.getNbtCompound());
|
|
||||||
}
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ tileentity.onDataPacket(netManager, packetIn);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1346,7 +1358,7 @@
|
|
||||||
|
|
||||||
if (entity instanceof EntityLivingBase)
|
|
||||||
{
|
|
||||||
- PotionEffect potioneffect = new PotionEffect(packetIn.func_149427_e(), packetIn.func_180755_e(), packetIn.func_149428_f(), false, packetIn.func_179707_f());
|
|
||||||
+ PotionEffect potioneffect = new PotionEffect(packetIn.func_149427_e() & 0xff, packetIn.func_180755_e(), packetIn.func_149428_f(), false, packetIn.func_179707_f());
|
|
||||||
potioneffect.setPotionDurationMax(packetIn.func_149429_c());
|
|
||||||
((EntityLivingBase)entity).addPotionEffect(potioneffect);
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/network/OldServerPinger.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/network/OldServerPinger.java
|
|
||||||
@@ -148,6 +148,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,33 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/particle/EffectRenderer.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/particle/EffectRenderer.java
|
|
||||||
@@ -135,6 +135,7 @@
|
|
||||||
|
|
||||||
public void addEffect(EntityFX p_78873_1_)
|
|
||||||
{
|
|
||||||
+ if (p_78873_1_ == null) return; //Forge: Prevent modders from being bad and adding nulls causing untraceable NPEs.
|
|
||||||
int i = p_78873_1_.getFXLayer();
|
|
||||||
int j = p_78873_1_.func_174838_j() != 1.0F ? 0 : 1;
|
|
||||||
|
|
||||||
@@ -361,7 +362,7 @@
|
|
||||||
|
|
||||||
public void func_180533_a(BlockPos p_180533_1_, IBlockState p_180533_2_)
|
|
||||||
{
|
|
||||||
- if (p_180533_2_.getBlock().getMaterial() != Material.air)
|
|
||||||
+ if (!p_180533_2_.getBlock().isAir(worldObj, p_180533_1_) && !p_180533_2_.getBlock().addDestroyEffects(worldObj, p_180533_1_, this))
|
|
||||||
{
|
|
||||||
p_180533_2_ = p_180533_2_.getBlock().getActualState(p_180533_2_, this.worldObj, p_180533_1_);
|
|
||||||
byte b0 = 4;
|
|
||||||
@@ -467,4 +468,13 @@
|
|
||||||
|
|
||||||
return "" + i;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ public void addBlockHitEffects(BlockPos pos, net.minecraft.util.MovingObjectPosition target)
|
|
||||||
+ {
|
|
||||||
+ Block block = worldObj.getBlockState(pos).getBlock();
|
|
||||||
+ if (block != null && !block.addHitEffects(worldObj, target, this))
|
|
||||||
+ {
|
|
||||||
+ addBlockHitEffects(pos, target.sideHit);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java
|
|
||||||
@@ -20,6 +20,7 @@
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
+import static net.minecraft.client.renderer.BlockModelRenderer.Orientation.*;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public class BlockModelRenderer
|
|
||||||
@@ -556,8 +557,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[]{ FLIP_WEST, Orientation.SOUTH, FLIP_WEST, FLIP_SOUTH, Orientation.WEST, FLIP_SOUTH, Orientation.WEST, Orientation.SOUTH },
|
|
||||||
+ new Orientation[]{ FLIP_WEST, Orientation.NORTH, FLIP_WEST, FLIP_NORTH, Orientation.WEST, Orientation.FLIP_NORTH, Orientation.WEST, Orientation.NORTH },
|
|
||||||
+ new Orientation[]{ FLIP_EAST, Orientation.NORTH, FLIP_EAST, FLIP_NORTH, Orientation.EAST, Orientation.FLIP_NORTH, Orientation.EAST, Orientation.NORTH },
|
|
||||||
+ new Orientation[]{ FLIP_EAST, Orientation.SOUTH, FLIP_EAST, FLIP_SOUTH, Orientation.EAST, 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, FLIP_SOUTH, FLIP_EAST, FLIP_SOUTH, FLIP_EAST, Orientation.SOUTH },
|
|
||||||
+ new Orientation[]{ Orientation.EAST, Orientation.NORTH, Orientation.EAST, FLIP_NORTH, FLIP_EAST, FLIP_NORTH, FLIP_EAST, Orientation.NORTH },
|
|
||||||
+ new Orientation[]{ Orientation.WEST, Orientation.NORTH, Orientation.WEST, FLIP_NORTH, FLIP_WEST, FLIP_NORTH, FLIP_WEST, Orientation.NORTH },
|
|
||||||
+ new Orientation[]{ Orientation.WEST, Orientation.SOUTH, Orientation.WEST, FLIP_SOUTH, FLIP_WEST, FLIP_SOUTH, 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,10 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/renderer/BlockModelShapes.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockModelShapes.java
|
|
||||||
@@ -321,6 +321,7 @@
|
|
||||||
return new ModelResourceLocation(s + "_double_slab", s1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
+ net.minecraftforge.client.model.ModelLoader.onRegisterAllBlocks(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
|
@ -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();
|
|
||||||
private static final String __OBFID = "CL_00002520";
|
|
||||||
@@ -49,6 +49,24 @@
|
|
||||||
{
|
|
||||||
p_175020_1_ = block.getActualState(p_175020_1_, p_175020_4_, p_175020_2_);
|
|
||||||
IBakedModel ibakedmodel = this.blockModelShapes.getModelForState(p_175020_1_);
|
|
||||||
+
|
|
||||||
+ if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartBlockModel)
|
|
||||||
+ {
|
|
||||||
+ IBlockState extendedState = block.getExtendedState(p_175020_1_, p_175020_4_, p_175020_2_);
|
|
||||||
+ 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, p_175020_3_)).makeBakedModel();
|
|
||||||
+ this.blockModelRenderer.renderModel(p_175020_4_, damageModel, p_175020_1_, p_175020_2_, Tessellator.getInstance().getWorldRenderer());
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(ibakedmodel, p_175020_3_)).makeBakedModel();
|
|
||||||
this.blockModelRenderer.renderModel(p_175020_4_, ibakedmodel1, p_175020_1_, p_175020_2_, Tessellator.getInstance().getWorldRenderer());
|
|
||||||
}
|
|
||||||
@@ -129,6 +147,12 @@
|
|
||||||
ibakedmodel = ((WeightedBakedModel)ibakedmodel).getAlternativeModel(MathHelper.getPositionRandom(p_175022_3_));
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartBlockModel)
|
|
||||||
+ {
|
|
||||||
+ IBlockState extendedState = block.getExtendedState(p_175022_1_, p_175022_2_, p_175022_3_);
|
|
||||||
+ ibakedmodel = ((net.minecraftforge.client.model.ISmartBlockModel)ibakedmodel).handleBlockState(extendedState);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
return ibakedmodel;
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,176 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/renderer/EntityRenderer.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/EntityRenderer.java
|
|
||||||
@@ -403,7 +403,7 @@
|
|
||||||
|
|
||||||
if (d3 < d2 || d2 == 0.0D)
|
|
||||||
{
|
|
||||||
- if (entity1 == entity.ridingEntity)
|
|
||||||
+ if (entity1 == entity.ridingEntity && !entity.canRiderInteract())
|
|
||||||
{
|
|
||||||
if (d2 == 0.0D)
|
|
||||||
{
|
|
||||||
@@ -556,14 +556,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) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F);
|
|
||||||
GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * p_78467_1_, -1.0F, 0.0F, 0.0F);
|
|
||||||
}
|
|
||||||
@@ -630,17 +624,20 @@
|
|
||||||
|
|
||||||
if (!this.mc.gameSettings.debugCamEnable)
|
|
||||||
{
|
|
||||||
- GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * p_78467_1_, 1.0F, 0.0F, 0.0F);
|
|
||||||
-
|
|
||||||
+ float yaw = entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * p_78467_1_ + 180.0F;
|
|
||||||
+ float pitch = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * p_78467_1_;
|
|
||||||
+ float roll = 0.0F;
|
|
||||||
if (entity instanceof EntityAnimal)
|
|
||||||
{
|
|
||||||
EntityAnimal entityanimal = (EntityAnimal)entity;
|
|
||||||
- GlStateManager.rotate(entityanimal.prevRotationYawHead + (entityanimal.rotationYawHead - entityanimal.prevRotationYawHead) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F);
|
|
||||||
+ yaw = entityanimal.prevRotationYawHead + (entityanimal.rotationYawHead - entityanimal.prevRotationYawHead) * p_78467_1_ + 180.0F;
|
|
||||||
}
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F);
|
|
||||||
- }
|
|
||||||
+ Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entity, p_78467_1_);
|
|
||||||
+ net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup event = new net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup(this, entity, block, p_78467_1_, yaw, pitch, roll);
|
|
||||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
|
|
||||||
+ GlStateManager.rotate(event.roll, 0.0F, 0.0F, 1.0F);
|
|
||||||
+ GlStateManager.rotate(event.pitch, 1.0F, 0.0F, 0.0F);
|
|
||||||
+ GlStateManager.rotate(event.yaw, 0.0F, 1.0F, 0.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
GlStateManager.translate(0.0F, -f1, 0.0F);
|
|
||||||
@@ -1081,7 +1078,7 @@
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
- this.mc.currentScreen.drawScreen(l, i1, partialTicks);
|
|
||||||
+ net.minecraftforge.client.ForgeHooksClient.drawScreen(this.mc.currentScreen, l, i1, partialTicks);
|
|
||||||
}
|
|
||||||
catch (Throwable throwable)
|
|
||||||
{
|
|
||||||
@@ -1145,7 +1142,7 @@
|
|
||||||
|
|
||||||
if (this.mc.playerController.getCurrentGameType() == WorldSettings.GameType.SPECTATOR)
|
|
||||||
{
|
|
||||||
- flag = block.hasTileEntity() && this.mc.theWorld.getTileEntity(blockpos) instanceof IInventory;
|
|
||||||
+ flag = block.hasTileEntity(this.mc.theWorld.getBlockState(blockpos)) && this.mc.theWorld.getTileEntity(blockpos) instanceof IInventory;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@@ -1296,7 +1293,9 @@
|
|
||||||
GlStateManager.pushMatrix();
|
|
||||||
RenderHelper.enableStandardItemLighting();
|
|
||||||
this.mc.mcProfiler.endStartSection("entities");
|
|
||||||
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
|
|
||||||
renderglobal.renderEntities(entity, frustum, partialTicks);
|
|
||||||
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
|
|
||||||
RenderHelper.disableStandardItemLighting();
|
|
||||||
this.disableLightmap();
|
|
||||||
GlStateManager.matrixMode(5888);
|
|
||||||
@@ -1308,6 +1307,7 @@
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
@@ -1321,6 +1321,7 @@
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
@@ -1373,6 +1374,16 @@
|
|
||||||
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, frustum, partialTicks);
|
|
||||||
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(-1);
|
|
||||||
+ RenderHelper.disableStandardItemLighting();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
GlStateManager.shadeModel(7424);
|
|
||||||
GlStateManager.depthMask(true);
|
|
||||||
GlStateManager.enableCull();
|
|
||||||
@@ -1385,8 +1396,12 @@
|
|
||||||
this.renderCloudsCheck(renderglobal, partialTicks, pass);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ this.mc.mcProfiler.endStartSection("forge_render_last");
|
|
||||||
+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(renderglobal, partialTicks);
|
|
||||||
+
|
|
||||||
this.mc.mcProfiler.endStartSection("hand");
|
|
||||||
|
|
||||||
+ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(renderglobal, partialTicks, pass))
|
|
||||||
if (this.renderHand)
|
|
||||||
{
|
|
||||||
GlStateManager.clear(256);
|
|
||||||
@@ -1498,6 +1513,13 @@
|
|
||||||
|
|
||||||
protected void renderRainSnow(float partialTicks)
|
|
||||||
{
|
|
||||||
+ net.minecraftforge.client.IRenderHandler renderer = this.mc.theWorld.provider.getWeatherRenderer();
|
|
||||||
+ if (renderer != null)
|
|
||||||
+ {
|
|
||||||
+ renderer.render(partialTicks, this.mc.theWorld, mc);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
float f1 = this.mc.theWorld.getRainStrength(partialTicks);
|
|
||||||
|
|
||||||
if (f1 > 0.0F)
|
|
||||||
@@ -1835,6 +1857,13 @@
|
|
||||||
this.fogColorBlue = f8;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, block, partialTicks, this.fogColorRed, this.fogColorGreen, this.fogColorBlue);
|
|
||||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
|
|
||||||
+
|
|
||||||
+ this.fogColorRed = event.red;
|
|
||||||
+ this.fogColorGreen = event.green;
|
|
||||||
+ this.fogColorBlue = event.blue;
|
|
||||||
+
|
|
||||||
GlStateManager.clearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1854,6 +1883,10 @@
|
|
||||||
Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entity, partialTicks);
|
|
||||||
float f1;
|
|
||||||
|
|
||||||
+ 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))
|
|
||||||
{
|
|
||||||
f1 = 5.0F;
|
|
||||||
@@ -1931,6 +1964,7 @@
|
|
||||||
GlStateManager.setFogStart(f1 * 0.05F);
|
|
||||||
GlStateManager.setFogEnd(Math.min(f1, 192.0F) * 0.5F);
|
|
||||||
}
|
|
||||||
+ net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, block, partialTicks, p_78468_1_, f1);
|
|
||||||
}
|
|
||||||
|
|
||||||
GlStateManager.enableColorMaterial();
|
|
|
@ -1,11 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java
|
|
||||||
@@ -83,6 +83,8 @@
|
|
||||||
this.drawTexturedModalRect(i + 6, j + 7, 0 + l % 8 * 18, 198 + l / 8 * 18, 18, 18);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ potion.renderInventoryEffect(i, j, potioneffect, mc);
|
|
||||||
+ if (!potion.shouldRenderInvText(potioneffect)) continue;
|
|
||||||
String s1 = I18n.format(potion.getName(), new Object[0]);
|
|
||||||
|
|
||||||
if (potioneffect.getAmplifier() == 1)
|
|
|
@ -1,14 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/renderer/ItemModelMesher.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/ItemModelMesher.java
|
|
||||||
@@ -52,6 +52,11 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartItemModel)
|
|
||||||
+ {
|
|
||||||
+ ibakedmodel = ((net.minecraftforge.client.model.ISmartItemModel)ibakedmodel).handleItemState(stack);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if (ibakedmodel == null)
|
|
||||||
{
|
|
||||||
ibakedmodel = this.modelManager.getMissingModel();
|
|
|
@ -1,65 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/renderer/ItemRenderer.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/ItemRenderer.java
|
|
||||||
@@ -308,7 +308,7 @@
|
|
||||||
|
|
||||||
if (this.itemToRender != null)
|
|
||||||
{
|
|
||||||
- if (this.itemToRender.getItem() == Items.filled_map)
|
|
||||||
+ if (this.itemToRender.getItem() instanceof net.minecraft.item.ItemMap)
|
|
||||||
{
|
|
||||||
this.func_178097_a(entityplayersp, f3, f1, f2);
|
|
||||||
}
|
|
||||||
@@ -359,7 +359,8 @@
|
|
||||||
|
|
||||||
if (this.mc.thePlayer.isEntityInsideOpaqueBlock())
|
|
||||||
{
|
|
||||||
- IBlockState iblockstate = this.mc.theWorld.getBlockState(new BlockPos(this.mc.thePlayer));
|
|
||||||
+ BlockPos blockpos = new BlockPos(this.mc.thePlayer);
|
|
||||||
+ IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos);
|
|
||||||
EntityPlayerSP entityplayersp = this.mc.thePlayer;
|
|
||||||
|
|
||||||
for (int i = 0; i < 8; ++i)
|
|
||||||
@@ -367,7 +368,7 @@
|
|
||||||
double d0 = entityplayersp.posX + (double)(((float)((i >> 0) % 2) - 0.5F) * entityplayersp.width * 0.8F);
|
|
||||||
double d1 = entityplayersp.posY + (double)(((float)((i >> 1) % 2) - 0.5F) * 0.1F);
|
|
||||||
double d2 = entityplayersp.posZ + (double)(((float)((i >> 2) % 2) - 0.5F) * entityplayersp.width * 0.8F);
|
|
||||||
- BlockPos blockpos = new BlockPos(d0, d1 + (double)entityplayersp.getEyeHeight(), d2);
|
|
||||||
+ blockpos = new BlockPos(d0, d1 + (double)entityplayersp.getEyeHeight(), d2);
|
|
||||||
IBlockState iblockstate1 = this.mc.theWorld.getBlockState(blockpos);
|
|
||||||
|
|
||||||
if (iblockstate1.getBlock().isVisuallyOpaque())
|
|
||||||
@@ -378,6 +379,7 @@
|
|
||||||
|
|
||||||
if (iblockstate.getBlock().getRenderType() != -1)
|
|
||||||
{
|
|
||||||
+ if (!net.minecraftforge.event.ForgeEventFactory.renderBlockOverlay(mc.thePlayer, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, iblockstate, blockpos))
|
|
||||||
this.func_178108_a(p_78447_1_, this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(iblockstate));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -386,11 +388,13 @@
|
|
||||||
{
|
|
||||||
if (this.mc.thePlayer.isInsideOfMaterial(Material.water))
|
|
||||||
{
|
|
||||||
+ if (!net.minecraftforge.event.ForgeEventFactory.renderWaterOverlay(mc.thePlayer, p_78447_1_))
|
|
||||||
this.renderWaterOverlayTexture(p_78447_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.mc.thePlayer.isBurning())
|
|
||||||
{
|
|
||||||
+ if (!net.minecraftforge.event.ForgeEventFactory.renderFireOverlay(mc.thePlayer, p_78447_1_))
|
|
||||||
this.renderFireInFirstPerson(p_78447_1_);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -507,6 +511,12 @@
|
|
||||||
{
|
|
||||||
if (!this.itemToRender.getIsItemStackEqual(itemstack))
|
|
||||||
{
|
|
||||||
+ if (!this.itemToRender.getItem().shouldCauseReequipAnimation(this.itemToRender, itemstack, equippedItemSlot != entityplayersp.inventory.currentItem))
|
|
||||||
+ {
|
|
||||||
+ this.itemToRender = itemstack;
|
|
||||||
+ this.equippedItemSlot = entityplayersp.inventory.currentItem;
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
--- ../src-base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java
|
|
||||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java
|
|
||||||
@@ -78,6 +78,10 @@
|
|
||||||
public static int GL_STATIC_DRAW;
|
|
||||||
private static final String __OBFID = "CL_00001179";
|
|
||||||
|
|
||||||
+ /* Stores the last values sent into setLightmapTextureCoords */
|
|
||||||
+ public static float lastBrightnessX = 0.0f;
|
|
||||||
+ public static float lastBrightnessY = 0.0f;
|
|
||||||
+
|
|
||||||
public static void initializeTextures()
|
|
||||||
{
|
|
||||||
ContextCapabilities contextcapabilities = GLContext.getCapabilities();
|
|
||||||
@@ -813,6 +817,12 @@
|
|
||||||
{
|
|
||||||
GL13.glMultiTexCoord2f(p_77475_0_, p_77475_1_, p_77475_2_);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ if (p_77475_0_ == lightmapTexUnit)
|
|
||||||
+ {
|
|
||||||
+ lastBrightnessX = p_77475_1_;
|
|
||||||
+ lastBrightnessY = p_77475_2_;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void glBlendFunc(int p_148821_0_, int p_148821_1_, int p_148821_2_, int p_148821_3_)
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue