mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 11:59:14 +00:00
more fixes
This commit is contained in:
1 parent
eba66e0182
commit
fb04e8eb08
55 files changed
+1446
-1442
No files matched your search
@@ -15,11 +15,12 @@ import net.minecraft.util.StatCollector;
|
||||
|
||||
public class BarricadeItem extends ItemBlock
|
||||
{
|
||||
private int bID;
|
||||
private Block b;
|
||||
|
||||
public BarricadeItem(Block b)
|
||||
{
|
||||
super(b);
|
||||
this.b = b;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,17 +80,17 @@ public class BarricadeItem extends ItemBlock
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (y == 255 && Block.blocksList[this.bID].blockMaterial.isSolid())
|
||||
else if (y == 255 && this.b.func_149688_o().isSolid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (world.canPlaceEntityOnSide(this.bID, x, y, z, false, side, player, stack))
|
||||
else if (world.canPlaceEntityOnSide(this.b, x, y, z, false, side, player, stack))
|
||||
{
|
||||
Block block = Block.blocksList[this.bID];
|
||||
Block block = this.b;
|
||||
//int meta = this.getMetadata(stack.getItemDamage());
|
||||
int rotation = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
int meta = rotation * 4;
|
||||
int metadata = Block.blocksList[this.bID].onBlockPlaced(world, x, y, z, side, hitX, hitY, hitZ, meta);
|
||||
int metadata = this.b.onBlockPlaced(world, x, y, z, side, hitX, hitY, hitZ, meta);
|
||||
|
||||
if (placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata))
|
||||
{
|
||||
|
||||
@@ -10,15 +10,13 @@ import net.minecraft.world.World;
|
||||
|
||||
public class WoolSlab1Item extends MultiItemBlock
|
||||
{
|
||||
int blockID;
|
||||
Block block;
|
||||
|
||||
public WoolSlab1Item(Block b)
|
||||
{
|
||||
super(b, "", "slab", ItemDye.dyeColorNames);
|
||||
this.setSpecialIndex(7, 15);
|
||||
this.blockID = id + 256;
|
||||
this.block = Block.blocksList[id + 256];
|
||||
this.block = b;
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
@@ -31,9 +29,9 @@ public class WoolSlab1Item extends MultiItemBlock
|
||||
int trueMeta = meta % 8;
|
||||
boolean flag = (id & 8) != 0;
|
||||
|
||||
if ((side == 1 && flag || side == 0 && !flag) && id == this.blockID && trueMeta == stack.getItemDamage())
|
||||
if ((side == 1 && flag || side == 0 && !flag) && id == this && trueMeta == stack.getItemDamage())
|
||||
{
|
||||
if (world.setBlock(x, y, z, Blocks.wool.blockID, trueMeta, 3))
|
||||
if (world.setBlock(x, y, z, Blocks.wool, trueMeta, 3))
|
||||
{
|
||||
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), this.block.stepSound.getPlaceSound(),
|
||||
(this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getPitch() * 0.8F);
|
||||
|
||||
@@ -27,14 +27,14 @@ public class WoolSlab2Item extends MultiItemBlock
|
||||
@Override
|
||||
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
int id = world.getBlockId(x, y, z);
|
||||
int id = world.func_147439_a(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
int trueMeta = meta % 8;
|
||||
boolean flag = (id & 8) != 0;
|
||||
|
||||
if ((side == 1 && flag || side == 0 && !flag) && id == this.blockID && trueMeta == stack.getItemDamage())
|
||||
{
|
||||
if (world.setBlock(x, y, z, Blocks.wool.blockID, trueMeta + 8, 3))
|
||||
if (world.func_147465_d(x, y, z, Blocks.wool, trueMeta + 8, 3))
|
||||
{
|
||||
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), this.block.stepSound.getPlaceSound(),
|
||||
(this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getPitch() * 0.8F);
|
||||
|
||||
@@ -52,7 +52,7 @@ public class Battleaxe extends HarvestTool
|
||||
return AbilityHelper.onBlockChanged(itemstack, world, b, x, y, z, player, random);
|
||||
}
|
||||
|
||||
static Material[] materials = { Material.wood, Material.vine, Material.circuits, Material.cactus, Material.pumpkin };
|
||||
static Material[] materials = { Material.field_151575_d, Material.field_151582_l, Material.circuits, Material.cactus, Material.pumpkin };
|
||||
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
@@ -252,7 +252,7 @@ public class Battleaxe extends HarvestTool
|
||||
for (int yPos = y + 1; yPos < y + 9; yPos++)
|
||||
{
|
||||
Block block = world.func_147439_a(x, yPos, z);
|
||||
if (!(tags.getBoolean("Broken")) && block != null && block.func_149688_o() == Material.wood)
|
||||
if (!(tags.getBoolean("Broken")) && block != null && block.func_149688_o() == Material.field_151575_d)
|
||||
{
|
||||
Block localblock = world.func_147439_a(x, yPos, z);
|
||||
int localMeta = world.getBlockMetadata(x, yPos, z);
|
||||
@@ -269,7 +269,7 @@ public class Battleaxe extends HarvestTool
|
||||
|
||||
if (!cancelHarvest)
|
||||
{
|
||||
if (block != null && block.func_149688_o() == Material.wood)
|
||||
if (block != null && block.func_149688_o() == Material.field_151575_d)
|
||||
{
|
||||
localMeta = world.getBlockMetadata(x, yPos, z);
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
@@ -280,7 +280,7 @@ public class Battleaxe extends HarvestTool
|
||||
}
|
||||
block.harvestBlock(world, player, x, yPos, z, localMeta);
|
||||
block.onBlockHarvested(world, x, yPos, z, localMeta, player);
|
||||
onBlockDestroyed(stack, world, func_147439_a, x, yPos, z, player);
|
||||
onBlockDestroyed(stack, world, block, x, yPos, z, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -140,9 +140,8 @@ public class Excavator extends HarvestTool
|
||||
return false;
|
||||
|
||||
World world = player.worldObj;
|
||||
final int blockID = world.getBlockId(x, y, z);
|
||||
final int meta = world.getBlockMetadata(x, y, z);
|
||||
Block block = Block.blocksList[blockID];
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (!stack.hasTagCompound())
|
||||
return false;
|
||||
|
||||
@@ -192,8 +191,8 @@ public class Excavator extends HarvestTool
|
||||
{
|
||||
if (!(tags.getBoolean("Broken")))
|
||||
{
|
||||
int localblockID = world.getBlockId(xPos, yPos, zPos);
|
||||
block = Block.blocksList[localblockID];
|
||||
Block localblock = world.getBlock(xPos, yPos, zPos);
|
||||
block = localblock;
|
||||
int localMeta = world.getBlockMetadata(xPos, yPos, zPos);
|
||||
int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType());
|
||||
float localHardness = block == null ? Float.MAX_VALUE : block.getBlockHardness(world, xPos, yPos, zPos);
|
||||
@@ -224,7 +223,7 @@ public class Excavator extends HarvestTool
|
||||
block.harvestBlock(world, player, xPos, yPos, zPos, localMeta);
|
||||
block.onBlockHarvested(world, xPos, yPos, zPos, localMeta, player);
|
||||
if (blockHardness > 0f)
|
||||
onBlockDestroyed(stack, world, localblockID, xPos, yPos, zPos, player);
|
||||
onBlockDestroyed(stack, world, localblock, xPos, yPos, zPos, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -127,7 +127,7 @@ public class FryingPan extends Weapon
|
||||
}
|
||||
else
|
||||
{
|
||||
world.setBlock(x, y, z, TRepo.heldItemBlock.blockID, 0, 3);
|
||||
world.setBlock(x, y, z, TRepo.heldItemBlock, 0, 3);
|
||||
TRepo.heldItemBlock.onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
world.playSoundEffect(x, y, z, "tinker:frypan_hit", 1.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 0.65F);
|
||||
|
||||
|
||||
@@ -289,8 +289,7 @@ public class Hammer extends HarvestTool
|
||||
{
|
||||
if (!(tags.getBoolean("Broken")))
|
||||
{
|
||||
int localblockID = world.getBlockId(xPos, yPos, zPos);
|
||||
Block localBlock = Block.blocksList[localblockID];
|
||||
Block localBlock = world.getBlock(xPos, yPos, zPos);
|
||||
int localMeta = world.getBlockMetadata(xPos, yPos, zPos);
|
||||
int hlvl = MinecraftForge.getBlockHarvestLevel(localBlock, meta, getHarvestType());
|
||||
float localHardness = localBlock == null ? Float.MAX_VALUE : localBlock.getBlockHardness(world, xPos, yPos, zPos);
|
||||
@@ -321,7 +320,7 @@ public class Hammer extends HarvestTool
|
||||
localBlock.harvestBlock(world, player, xPos, yPos, zPos, localMeta);
|
||||
localBlock.onBlockHarvested(world, xPos, yPos, zPos, localMeta, player);
|
||||
if (blockHardness > 0f)
|
||||
onBlockDestroyed(stack, world, localblockID, xPos, yPos, zPos, player);
|
||||
onBlockDestroyed(stack, world, localBlock, xPos, yPos, zPos, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -34,16 +34,15 @@ public class Hatchet extends HarvestTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed (ItemStack itemstack, World world, int bID, int x, int y, int z, EntityLivingBase player)
|
||||
public boolean onBlockDestroyed (ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player)
|
||||
{
|
||||
Block block = Block.blocksList[bID];
|
||||
if (block != null && block.func_149688_o() == Material.leaves)
|
||||
return false;
|
||||
|
||||
return AbilityHelper.onBlockChanged(itemstack, world, bID, x, y, z, player, random);
|
||||
return AbilityHelper.onBlockChanged(itemstack, world, block, x, y, z, player, random);
|
||||
}
|
||||
|
||||
static Material[] materials = { Material.wood, Material.leaves, Material.vine, Material.circuits, Material.cactus, Material.pumpkin };
|
||||
static Material[] materials = { Material.field_151575_d, Material.leaves, Material.field_151582_l, Material.circuits, Material.cactus, Material.pumpkin };
|
||||
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
|
||||
@@ -54,16 +54,15 @@ public class LumberAxe extends HarvestTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed (ItemStack itemstack, World world, int bID, int x, int y, int z, EntityLivingBase player)
|
||||
public boolean onBlockDestroyed (ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player)
|
||||
{
|
||||
Block block = Block.blocksList[bID];
|
||||
if (block != null && block.func_149688_o() == Material.leaves)
|
||||
return false;
|
||||
|
||||
return AbilityHelper.onBlockChanged(itemstack, world, bID, x, y, z, player, random);
|
||||
return AbilityHelper.onBlockChanged(itemstack, world, block, x, y, z, player, random);
|
||||
}
|
||||
|
||||
static Material[] materials = { Material.wood, Material.vine, Material.circuits, Material.cactus, Material.pumpkin };
|
||||
static Material[] materials = { Material.field_151575_d, Material.field_151582_l, Material.circuits, Material.cactus, Material.pumpkin };
|
||||
|
||||
/* Lumber axe specific */
|
||||
|
||||
@@ -139,8 +138,7 @@ public class LumberAxe extends HarvestTool
|
||||
return false;
|
||||
|
||||
World world = player.worldObj;
|
||||
final int woodID = world.getBlockId(x, y, z);
|
||||
final Block wood = Block.blocksList[woodID];
|
||||
final Block wood = world.func_147439_a(x, y, z);;
|
||||
if (wood == null)
|
||||
{
|
||||
return super.onBlockStartBreak(stack, x, y, z, player);
|
||||
@@ -152,8 +150,8 @@ public class LumberAxe extends HarvestTool
|
||||
do
|
||||
{
|
||||
height++;
|
||||
int blockID = world.getBlockId(x, height, z);
|
||||
if (blockID != woodID)
|
||||
Block block = world.func_147439_a(x, height, z);
|
||||
if (block != wood)
|
||||
{
|
||||
height--;
|
||||
foundTop = true;
|
||||
@@ -169,7 +167,7 @@ public class LumberAxe extends HarvestTool
|
||||
{
|
||||
for (int zPos = z - 1; zPos <= z + 1; zPos++)
|
||||
{
|
||||
Block leaves = Block.blocksList[world.getBlockId(xPos, yPos, zPos)];
|
||||
Block leaves = world.func_147439_a(xPos, yPos, zPos);
|
||||
if (leaves != null && leaves.isLeaves(world, xPos, yPos, zPos))
|
||||
numLeaves++;
|
||||
}
|
||||
@@ -180,14 +178,14 @@ public class LumberAxe extends HarvestTool
|
||||
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (numLeaves > 3)
|
||||
breakTree(world, x, y, z, stack, tags, woodID, meta, player);
|
||||
breakTree(world, x, y, z, stack, tags, wood, meta, player);
|
||||
else
|
||||
destroyWood(world, x, y, z, stack, tags, player);
|
||||
|
||||
if (!world.isRemote)
|
||||
world.playAuxSFX(2001, x, y, z, woodID + (meta << 12));
|
||||
}
|
||||
else if (wood.func_149688_o() == Material.wood)
|
||||
else if (wood.func_149688_o() == Material.field_151575_d)
|
||||
{
|
||||
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
@@ -198,7 +196,7 @@ public class LumberAxe extends HarvestTool
|
||||
return super.onBlockStartBreak(stack, x, y, z, player);
|
||||
}
|
||||
|
||||
void breakTree (World world, int x, int y, int z, ItemStack stack, NBTTagCompound tags, int bID, int meta, EntityPlayer player)
|
||||
void breakTree (World world, int x, int y, int z, ItemStack stack, NBTTagCompound tags, Block bID, int meta, EntityPlayer player)
|
||||
{
|
||||
Block block;
|
||||
for (int xPos = x - 1; xPos <= x + 1; xPos++)
|
||||
@@ -209,10 +207,10 @@ public class LumberAxe extends HarvestTool
|
||||
{
|
||||
if (!(tags.getBoolean("Broken")))
|
||||
{
|
||||
int localblockID = world.getBlockId(xPos, yPos, zPos);
|
||||
if (bID == localblockID)
|
||||
Block localblock = world.func_147439_a(xPos, yPos, zPos);
|
||||
if (bID == localblock)
|
||||
{
|
||||
block = Block.blocksList[localblockID];
|
||||
block = localblock;
|
||||
meta = world.getBlockMetadata(xPos, yPos, zPos);
|
||||
int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType());
|
||||
|
||||
@@ -231,7 +229,7 @@ public class LumberAxe extends HarvestTool
|
||||
}
|
||||
else
|
||||
{
|
||||
if (localblockID == bID && world.getBlockMetadata(xPos, yPos, zPos) % 4 == meta % 4)
|
||||
if (localblock == bID && world.getBlockMetadata(xPos, yPos, zPos) % 4 == meta % 4)
|
||||
{
|
||||
/* world.setBlock(xPos, yPos, zPos, 0, 0, 3);
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
@@ -247,7 +245,7 @@ public class LumberAxe extends HarvestTool
|
||||
}
|
||||
block.harvestBlock(world, player, xPos, yPos, zPos, meta);
|
||||
block.onBlockHarvested(world, xPos, yPos, zPos, meta, player);
|
||||
onBlockDestroyed(stack, world, localblockID, xPos, yPos, zPos, player);
|
||||
onBlockDestroyed(stack, world, localblock, xPos, yPos, zPos, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -287,11 +285,11 @@ public class LumberAxe extends HarvestTool
|
||||
{
|
||||
if (!(tags.getBoolean("Broken")))
|
||||
{
|
||||
Block block = world.getBlock(xPos, yPos, zPos);
|
||||
Block block = world.func_147439_a(xPos, yPos, zPos);
|
||||
int meta = world.getBlockMetadata(xPos, yPos, zPos);
|
||||
int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType());
|
||||
|
||||
if (block != null && block.func_149688_o() == Material.wood)
|
||||
if (block != null && block.func_149688_o() == Material.field_151575_d)
|
||||
{
|
||||
if (hlvl <= tags.getInteger("HarvestLevel"))
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ public class Mattock extends DualHarvestTool
|
||||
return "shovel";
|
||||
}
|
||||
|
||||
static Material[] axeMaterials = { Material.wood, Material.cactus, Material.pumpkin, Material.plants, Material.vine };
|
||||
static Material[] axeMaterials = { Material.field_151575_d, Material.cactus, Material.pumpkin, Material.plants, Material.vine };
|
||||
static Material[] shovelMaterials = { Material.grass, Material.ground, Material.clay };
|
||||
|
||||
@Override
|
||||
@@ -122,8 +122,8 @@ public class Mattock extends DualHarvestTool
|
||||
{
|
||||
if (!TRepo.supressMissingToolLogs)
|
||||
{
|
||||
TConstruct.logger.warning("Creative builder failed tool for " + name + this.getToolName());
|
||||
TConstruct.logger.warning("Make sure you do not have item ID conflicts");
|
||||
TConstruct.logger.warn("Creative builder failed tool for " + name + this.getToolName());
|
||||
TConstruct.logger.warn("Make sure you do not have item ID conflicts");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -40,7 +40,7 @@ public class Scythe extends Weapon
|
||||
return materials;
|
||||
}
|
||||
|
||||
static Material[] materials = new Material[] { Material.web, Material.cactus, Material.pumpkin, Material.plants, Material.vine, Material.leaves };
|
||||
static Material[] materials = new Material[] { Material.web, Material.cactus, Material.pumpkin, Material.plants, Material.field_151582_l, Material.leaves };
|
||||
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
|
||||
Reference in new issue
Block a user