mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +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
@@ -15,73 +15,58 @@ import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.tools.ToolProxyCommon;
|
||||
import tconstruct.tools.logic.FurnaceLogic;
|
||||
|
||||
public class FurnaceSlab extends InventorySlab
|
||||
{
|
||||
public class FurnaceSlab extends InventorySlab {
|
||||
|
||||
public FurnaceSlab(Material material)
|
||||
{
|
||||
public FurnaceSlab(Material material) {
|
||||
super(material);
|
||||
this.setCreativeTab(TConstructRegistry.blockTab);
|
||||
this.setHardness(3.5f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity (World world, int metadata)
|
||||
{
|
||||
switch (metadata % 8)
|
||||
{
|
||||
case 0:
|
||||
return new FurnaceLogic();
|
||||
public TileEntity createTileEntity(World world, int metadata) {
|
||||
switch (metadata % 8) {
|
||||
case 0:
|
||||
return new FurnaceLogic();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@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 ToolProxyCommon.furnaceID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getModInstance ()
|
||||
{
|
||||
public Object getModInstance() {
|
||||
return TConstruct.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getTextureNames ()
|
||||
{
|
||||
String[] textureNames = { "furnaceslab_front", "furnaceslab_front_active", "furnaceslab_side", "furnace_top" };
|
||||
public String[] getTextureNames() {
|
||||
String[] textureNames = {"furnaceslab_front", "furnaceslab_front_active", "furnaceslab_side", "furnace_top"};
|
||||
|
||||
return textureNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon (int side, int meta)
|
||||
{
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return icons[(meta % 8) * 3 + getTextureIndex(side)];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon (IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntity logic = world.getTileEntity(x, y, z);
|
||||
short direction = (logic instanceof IFacingLogic) ? ((IFacingLogic) logic).getRenderDirection() : 0;
|
||||
int meta = world.getBlockMetadata(x, y, z) % 8;
|
||||
|
||||
if (meta == 0)
|
||||
{
|
||||
if (side == direction)
|
||||
{
|
||||
if (((IActiveLogic) logic).getActive())
|
||||
return icons[1];
|
||||
else
|
||||
return icons[0];
|
||||
}
|
||||
else if (side > 1)
|
||||
{
|
||||
if (meta == 0) {
|
||||
if (side == direction) {
|
||||
if (((IActiveLogic) logic).getActive()) return icons[1];
|
||||
else return icons[0];
|
||||
} else if (side > 1) {
|
||||
return icons[2];
|
||||
}
|
||||
return icons[3];
|
||||
@@ -89,87 +74,66 @@ public class FurnaceSlab extends InventorySlab
|
||||
return icons[0];
|
||||
}
|
||||
|
||||
public int getTextureIndex (int side)
|
||||
{
|
||||
if (side == 0 || side == 1)
|
||||
return 3;
|
||||
if (side == 3)
|
||||
return 0;
|
||||
public int getTextureIndex(int side) {
|
||||
if (side == 0 || side == 1) return 3;
|
||||
if (side == 3) return 0;
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextureDomain (int textureNameIndex)
|
||||
{
|
||||
public String getTextureDomain(int textureNameIndex) {
|
||||
return "tinker";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons (IIconRegister iconRegister)
|
||||
{
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
String[] textureNames = getTextureNames();
|
||||
this.icons = new IIcon[textureNames.length];
|
||||
|
||||
for (int i = 0; i < this.icons.length; ++i)
|
||||
{
|
||||
if (i == 3)
|
||||
this.icons[i] = iconRegister.registerIcon("minecraft:" + textureNames[i]);
|
||||
else
|
||||
this.icons[i] = iconRegister.registerIcon("tinker:" + textureNames[i]);
|
||||
for (int i = 0; i < this.icons.length; ++i) {
|
||||
if (i == 3) this.icons[i] = iconRegister.registerIcon("minecraft:" + textureNames[i]);
|
||||
else this.icons[i] = iconRegister.registerIcon("tinker:" + textureNames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity (World var1, int metadata)
|
||||
{
|
||||
switch (metadata % 8)
|
||||
{
|
||||
case 0:
|
||||
return new FurnaceLogic();
|
||||
public TileEntity createNewTileEntity(World var1, int metadata) {
|
||||
switch (metadata % 8) {
|
||||
case 0:
|
||||
return new FurnaceLogic();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void randomDisplayTick (World world, int x, int y, int z, Random random)
|
||||
{
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
|
||||
TileEntity logic = world.getTileEntity(x, y, z);
|
||||
short direction = (logic instanceof IFacingLogic) ? ((IFacingLogic) logic).getRenderDirection() : 0;
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
int metaType = meta % 8;
|
||||
int metaPos = meta / 8;
|
||||
|
||||
if (metaType == 0)
|
||||
{
|
||||
if (((IActiveLogic) logic).getActive())
|
||||
{
|
||||
if (metaType == 0) {
|
||||
if (((IActiveLogic) logic).getActive()) {
|
||||
float offset = random.nextFloat() * 0.6F - 0.3F;
|
||||
float offsetY = random.nextFloat() * 6.0F / 16.0F;
|
||||
|
||||
if (metaPos == 1)
|
||||
{
|
||||
if (metaPos == 1) {
|
||||
offsetY += 0.5F;
|
||||
}
|
||||
|
||||
if (direction == 4)
|
||||
{
|
||||
if (direction == 4) {
|
||||
world.spawnParticle("smoke", x - 0.02F, y + offsetY, z + offset + 0.5F, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", x - 0.02F, y + offsetY, z + offset + 0.5F, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (direction == 5)
|
||||
{
|
||||
} else if (direction == 5) {
|
||||
world.spawnParticle("smoke", x + 1.02F, y + offsetY, z + offset + 0.5F, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", x + 1.02F, y + offsetY, z + offset + 0.5F, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (direction == 2)
|
||||
{
|
||||
} else if (direction == 2) {
|
||||
world.spawnParticle("smoke", x + offset + 0.5F, y + offsetY, z - 0.02F, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", x + offset + 0.5F, y + offsetY, z - 0.02F, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (direction == 3)
|
||||
{
|
||||
} else if (direction == 3) {
|
||||
world.spawnParticle("smoke", x + offset + 0.5F, y + offsetY, z + 1.02F, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", x + offset + 0.5F, y + offsetY, z + 1.02F, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user