mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 13:09:53 +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
@@ -16,13 +16,11 @@ import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import tconstruct.world.gen.SlimeTreeGen;
|
||||
|
||||
public class SlimeSapling extends BlockSapling
|
||||
{
|
||||
public class SlimeSapling extends BlockSapling {
|
||||
public IIcon[] icons;
|
||||
public String[] textureNames = new String[] { "blue" };
|
||||
public String[] textureNames = new String[] {"blue"};
|
||||
|
||||
public SlimeSapling()
|
||||
{
|
||||
public SlimeSapling() {
|
||||
super();
|
||||
float f = 0.4F;
|
||||
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
|
||||
@@ -33,95 +31,74 @@ public class SlimeSapling extends BlockSapling
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons (IIconRegister iconRegister)
|
||||
{
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.icons = new IIcon[textureNames.length];
|
||||
|
||||
for (int i = 0; i < this.icons.length; ++i)
|
||||
{
|
||||
for (int i = 0; i < this.icons.length; ++i) {
|
||||
this.icons[i] = iconRegister.registerIcon("tinker:slimesapling_" + textureNames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockOn (Block id)
|
||||
{
|
||||
public boolean canPlaceBlockOn(Block id) {
|
||||
return id == Blocks.grass || id == Blocks.dirt || id == TinkerWorld.slimeGrass || id == TinkerTools.craftedSoil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick (World world, int x, int y, int z, Random random)
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
public void updateTick(World world, int x, int y, int z, Random random) {
|
||||
if (world.isRemote) {
|
||||
return;
|
||||
}
|
||||
super.updateTick(world, x, y, z, random);
|
||||
int md = world.getBlockMetadata(x, y, z);
|
||||
if (random.nextInt(10) == 0 && world.getBlockLightValue(x, y + 1, z) >= 9)
|
||||
{
|
||||
if ((md & 8) == 0)
|
||||
world.setBlockMetadataWithNotify(x, y, z, md | 8, 4);
|
||||
|
||||
else
|
||||
growTree(world, x, y, z, random);
|
||||
if (random.nextInt(10) == 0 && world.getBlockLightValue(x, y + 1, z) >= 9) {
|
||||
if ((md & 8) == 0) world.setBlockMetadataWithNotify(x, y, z, md | 8, 4);
|
||||
else growTree(world, x, y, z, random);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon (int side, int meta)
|
||||
{
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return icons[meta % icons.length];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_149879_c (World world, int x, int y, int z, Random random)
|
||||
{
|
||||
public void func_149879_c(World world, int x, int y, int z, Random random) {
|
||||
boneFertilize(world, x, y, z, random, null);
|
||||
}
|
||||
|
||||
public boolean boneFertilize (World world, int x, int y, int z, Random random, EntityPlayer player)
|
||||
{
|
||||
public boolean boneFertilize(World world, int x, int y, int z, Random random, EntityPlayer player) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if (meta % 8 == 0 && (player == null || !player.capabilities.isCreativeMode))
|
||||
return false;
|
||||
if (meta % 8 == 0 && (player == null || !player.capabilities.isCreativeMode)) return false;
|
||||
|
||||
if ((meta & 8) == 0)
|
||||
{
|
||||
if ((meta & 8) == 0) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, meta | 8, 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.growTree(world, x, y, z, random);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void growTree (World world, int x, int y, int z, Random random)
|
||||
{
|
||||
public void growTree(World world, int x, int y, int z, Random random) {
|
||||
int md = world.getBlockMetadata(x, y, z) % 8;
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
WorldGenerator obj = null;
|
||||
|
||||
obj = new SlimeTreeGen(true, 5, 4, 1, 0);
|
||||
|
||||
if (!(obj.generate(world, random, x, y, z)))
|
||||
world.setBlock(x, y, z, this, md + 8, 3);
|
||||
if (!(obj.generate(world, random, x, y, z))) world.setBlock(x, y, z, this, md + 8, 3);
|
||||
}
|
||||
|
||||
public int damageDropped (int i)
|
||||
{
|
||||
public int damageDropped(int i) {
|
||||
return i % 8;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks (Item par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
for (int i = 0; i < 1; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int i = 0; i < 1; i++) par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user