mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 11:59:14 +00:00
Fix JABBA-related issues with crafting station slots (#54)
* Fix shift-merging tools voiding items fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/11392> * Change 0-sized ItemStacks into null stacks in crafting station attached slots Fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10425> * Update buildscript * spotlessApply
This commit is contained in:
1 parent
18bfeaff32
commit
39be06c23b
571 files changed
+25959
-28223
No files matched your search
@@ -12,84 +12,102 @@ import net.minecraft.world.*;
|
||||
import tconstruct.tools.logic.BattlesignLogic;
|
||||
import tconstruct.tools.model.BattlesignRender;
|
||||
|
||||
public class BattlesignBlock extends EquipBlock
|
||||
{
|
||||
public class BattlesignBlock extends EquipBlock {
|
||||
|
||||
public BattlesignBlock(Material material)
|
||||
{
|
||||
public BattlesignBlock(Material material) {
|
||||
super(material);
|
||||
|
||||
this.setBlockBounds(0.45F, 0F, 0.45F, 0.55F, 1.125F, 0.55F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType ()
|
||||
{
|
||||
public int getRenderType() {
|
||||
return BattlesignRender.battlesignModelID;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public boolean shouldSideBeRendered (IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_)
|
||||
{
|
||||
return p_149646_5_ == 0 && this.minY > 0.0D ? true : (p_149646_5_ == 1 && this.maxY < 1.0D ? true : (p_149646_5_ == 2 && this.minZ > 0.0D ? true : (p_149646_5_ == 3 && this.maxZ < 1.0D ? true : (p_149646_5_ == 4 && this.minX > 0.0D ? true : (p_149646_5_ == 5 && this.maxX < 1.0D ? true : !(p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_).isOpaqueCube() && p_149646_1_.getBlock(p_149646_2_, p_149646_3_ + 1, p_149646_4_).isOpaqueCube()))))));
|
||||
public boolean shouldSideBeRendered(
|
||||
IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
|
||||
return p_149646_5_ == 0 && this.minY > 0.0D
|
||||
? true
|
||||
: (p_149646_5_ == 1 && this.maxY < 1.0D
|
||||
? true
|
||||
: (p_149646_5_ == 2 && this.minZ > 0.0D
|
||||
? true
|
||||
: (p_149646_5_ == 3 && this.maxZ < 1.0D
|
||||
? true
|
||||
: (p_149646_5_ == 4 && this.minX > 0.0D
|
||||
? true
|
||||
: (p_149646_5_ == 5 && this.maxX < 1.0D
|
||||
? true
|
||||
: !(p_149646_1_
|
||||
.getBlock(p_149646_2_, p_149646_3_, p_149646_4_)
|
||||
.isOpaqueCube()
|
||||
&& p_149646_1_
|
||||
.getBlock(
|
||||
p_149646_2_,
|
||||
p_149646_3_ + 1,
|
||||
p_149646_4_)
|
||||
.isOpaqueCube()))))));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity (World world, int metadata)
|
||||
{
|
||||
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||
return new BattlesignLogic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy (World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
||||
{
|
||||
public void onBlockPlacedBy(
|
||||
World par1World,
|
||||
int par2,
|
||||
int par3,
|
||||
int par4,
|
||||
EntityLivingBase par5EntityLivingBase,
|
||||
ItemStack par6ItemStack) {
|
||||
super.onBlockPlacedBy(par1World, par2, par3, par4, par5EntityLivingBase, par6ItemStack);
|
||||
int i3 = MathHelper.floor_double((par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
|
||||
int newMeta = 0;
|
||||
|
||||
switch (i3)
|
||||
{
|
||||
case 3:
|
||||
newMeta = 0;
|
||||
break;
|
||||
case 0:
|
||||
newMeta = 3;
|
||||
break;
|
||||
case 1:
|
||||
newMeta = 1;
|
||||
break;
|
||||
case 2:
|
||||
newMeta = 2;
|
||||
break;
|
||||
switch (i3) {
|
||||
case 3:
|
||||
newMeta = 0;
|
||||
break;
|
||||
case 0:
|
||||
newMeta = 3;
|
||||
break;
|
||||
case 1:
|
||||
newMeta = 1;
|
||||
break;
|
||||
case 2:
|
||||
newMeta = 2;
|
||||
break;
|
||||
}
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, newMeta, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState (IBlockAccess blockAccess, int x, int y, int z)
|
||||
{
|
||||
switch (blockAccess.getBlockMetadata(x, y, z))
|
||||
{
|
||||
case 0:
|
||||
setBlockBounds(0.42F, 0.5F, 0F, 0.50F, 1.1F, 1F);
|
||||
break;
|
||||
case 1:
|
||||
setBlockBounds(0.50F, 0.5F, 0F, 0.58F, 1.1F, 1F);
|
||||
break;
|
||||
case 2:
|
||||
setBlockBounds(0F, 0.5F, 0.50F, 1F, 1.1F, 0.58F);
|
||||
break;
|
||||
case 3:
|
||||
setBlockBounds(0F, 0.5F, 0.42F, 1F, 1.1F, 0.50F);
|
||||
break;
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int x, int y, int z) {
|
||||
switch (blockAccess.getBlockMetadata(x, y, z)) {
|
||||
case 0:
|
||||
setBlockBounds(0.42F, 0.5F, 0F, 0.50F, 1.1F, 1F);
|
||||
break;
|
||||
case 1:
|
||||
setBlockBounds(0.50F, 0.5F, 0F, 0.58F, 1.1F, 1F);
|
||||
break;
|
||||
case 2:
|
||||
setBlockBounds(0F, 0.5F, 0.50F, 1F, 1.1F, 0.58F);
|
||||
break;
|
||||
case 3:
|
||||
setBlockBounds(0F, 0.5F, 0.42F, 1F, 1.1F, 0.50F);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList (World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity)
|
||||
{
|
||||
public void addCollisionBoxesToList(
|
||||
World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity) {
|
||||
setBlockBoundsBasedOnState(world, x, y, z);
|
||||
|
||||
super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity);
|
||||
@@ -100,15 +118,12 @@ public class BattlesignBlock extends EquipBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity (World world, int metadata)
|
||||
{
|
||||
public TileEntity createTileEntity(World world, int metadata) {
|
||||
return new BattlesignLogic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer)
|
||||
{
|
||||
public Integer getGui(World world, int x, int y, int z, EntityPlayer entityplayer) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user