mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-19 11:59:11 +00:00
Update buildscript & spotlessApply
This commit is contained in:
1 parent
e4329e2b8f
commit
8683a345c3
818 files changed
+51123
-49403
No files matched your search
@@ -11,80 +11,92 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemETSlab extends ItemMetadata {
|
||||
private boolean isFullBlock;
|
||||
private BlockETSlab theHalfSlab;
|
||||
private BlockETSlab doubleSlab;
|
||||
private boolean isFullBlock;
|
||||
private BlockETSlab theHalfSlab;
|
||||
private BlockETSlab doubleSlab;
|
||||
|
||||
public ItemETSlab(Block block) {
|
||||
super(block);
|
||||
theHalfSlab = (BlockETSlab) ExtraTrees.blockSlab;
|
||||
doubleSlab = (BlockETSlab) ExtraTrees.blockDoubleSlab;
|
||||
isFullBlock = (block != theHalfSlab);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
public ItemETSlab(Block block) {
|
||||
super(block);
|
||||
theHalfSlab = (BlockETSlab) ExtraTrees.blockSlab;
|
||||
doubleSlab = (BlockETSlab) ExtraTrees.blockDoubleSlab;
|
||||
isFullBlock = (block != theHalfSlab);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int meta, float hitX, float hitY, float hitZ) {
|
||||
if (isFullBlock) {
|
||||
return super.onItemUse(stack, player, world, x, y, z, meta, hitX, hitY, hitZ);
|
||||
}
|
||||
if (stack.stackSize == 0 || !player.canPlayerEdit(x, y, z, meta, stack)) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean onItemUse(
|
||||
ItemStack stack,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
int meta,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ) {
|
||||
if (isFullBlock) {
|
||||
return super.onItemUse(stack, player, world, x, y, z, meta, hitX, hitY, hitZ);
|
||||
}
|
||||
if (stack.stackSize == 0 || !player.canPlayerEdit(x, y, z, meta, stack)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Block i1 = world.getBlock(x, y, z);
|
||||
int j1 = world.getBlockMetadata(x, y, z);
|
||||
int tileMeta = TileEntityMetadata.getTileMetadata(world, x, y, z);
|
||||
int k1 = j1 & 0x7;
|
||||
boolean flag = (j1 & 0x8) != 0x0;
|
||||
Block i1 = world.getBlock(x, y, z);
|
||||
int j1 = world.getBlockMetadata(x, y, z);
|
||||
int tileMeta = TileEntityMetadata.getTileMetadata(world, x, y, z);
|
||||
int k1 = j1 & 0x7;
|
||||
boolean flag = (j1 & 0x8) != 0x0;
|
||||
|
||||
if (((meta == 1 && !flag) || (meta == 0 && flag)) && i1 == theHalfSlab && tileMeta == stack.getItemDamage()) {
|
||||
if (world.checkNoEntityCollision(doubleSlab.getCollisionBoundingBoxFromPool(world, x, y, z)) && world.setBlock(x, y, z, doubleSlab, k1, 3)) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
tile.setTileMetadata(tileMeta, true);
|
||||
}
|
||||
stack.stackSize--;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return func_77888_a(stack, player, world, x, y, z, meta)
|
||||
|| super.onItemUse(stack, player, world, x, y, z, meta, hitX, hitY, hitZ);
|
||||
}
|
||||
if (((meta == 1 && !flag) || (meta == 0 && flag)) && i1 == theHalfSlab && tileMeta == stack.getItemDamage()) {
|
||||
if (world.checkNoEntityCollision(doubleSlab.getCollisionBoundingBoxFromPool(world, x, y, z))
|
||||
&& world.setBlock(x, y, z, doubleSlab, k1, 3)) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
tile.setTileMetadata(tileMeta, true);
|
||||
}
|
||||
stack.stackSize--;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return func_77888_a(stack, player, world, x, y, z, meta)
|
||||
|| super.onItemUse(stack, player, world, x, y, z, meta, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
private boolean func_77888_a(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side) {
|
||||
if (side == 0) {
|
||||
y--;
|
||||
} else if (side == 1) {
|
||||
y++;
|
||||
} else if (side == 2) {
|
||||
z--;
|
||||
} else if (side == 3) {
|
||||
z++;
|
||||
} else if (side == 4) {
|
||||
x--;
|
||||
} else if (side == 5) {
|
||||
x++;
|
||||
}
|
||||
private boolean func_77888_a(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side) {
|
||||
if (side == 0) {
|
||||
y--;
|
||||
} else if (side == 1) {
|
||||
y++;
|
||||
} else if (side == 2) {
|
||||
z--;
|
||||
} else if (side == 3) {
|
||||
z++;
|
||||
} else if (side == 4) {
|
||||
x--;
|
||||
} else if (side == 5) {
|
||||
x++;
|
||||
}
|
||||
|
||||
Block i1 = world.getBlock(x, y, z);
|
||||
int j1 = world.getBlockMetadata(x, y, z);
|
||||
int k1 = j1 & 0x7;
|
||||
int tileMeta = TileEntityMetadata.getTileMetadata(world, x, y, z);
|
||||
Block i1 = world.getBlock(x, y, z);
|
||||
int j1 = world.getBlockMetadata(x, y, z);
|
||||
int k1 = j1 & 0x7;
|
||||
int tileMeta = TileEntityMetadata.getTileMetadata(world, x, y, z);
|
||||
|
||||
if (i1 == theHalfSlab && tileMeta == stack.getItemDamage()) {
|
||||
if (world.checkNoEntityCollision(doubleSlab.getCollisionBoundingBoxFromPool(world, x, y, z)) && world.setBlock(x, y, z, doubleSlab, k1, 3)) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
tile.setTileMetadata(tileMeta, false);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
stack.stackSize--;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (i1 == theHalfSlab && tileMeta == stack.getItemDamage()) {
|
||||
if (world.checkNoEntityCollision(doubleSlab.getCollisionBoundingBoxFromPool(world, x, y, z))
|
||||
&& world.setBlock(x, y, z, doubleSlab, k1, 3)) {
|
||||
TileEntityMetadata tile = TileEntityMetadata.getTile(world, x, y, z);
|
||||
if (tile != null) {
|
||||
tile.setTileMetadata(tileMeta, false);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
stack.stackSize--;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user