Fixed NEI, fixed TNT dupe
This commit is contained in:
parent
8c51e4dd25
commit
e150df8743
4 changed files with 18 additions and 26 deletions
|
@ -37,14 +37,14 @@ public abstract class AdvancedMachineRecipeHandler extends TemplateRecipeHandler
|
|||
public void drawExtras(int i)
|
||||
{
|
||||
float f = ticksPassed >= 40 ? (ticksPassed - 40) % 20 / 20.0F : 0.0F;
|
||||
drawProgressBar(63, 34, 176 + 26, 0, 24, 7, f, 0);
|
||||
drawProgressBar(63, 34, 176, 0, 24, 7, f, 0);
|
||||
|
||||
f = ticksPassed >= 20 && ticksPassed < 40 ? (ticksPassed - 20) % 20 / 20.0F : 1.0F;
|
||||
if(ticksPassed < 20) f = 0.0F;
|
||||
drawProgressBar(45, 32, 176 + 26, 7, 5, 12, f, 3);
|
||||
drawProgressBar(45, 32, 176, 7, 5, 12, f, 3);
|
||||
|
||||
f = ticksPassed <= 20 ? ticksPassed / 20.0F : 1.0F;
|
||||
drawProgressBar(149, 12, 176 + 26, 19, 4, 52, f, 3);
|
||||
drawProgressBar(149, 12, 176, 19, 4, 52, f, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -35,9 +35,9 @@ public abstract class MachineRecipeHandler extends TemplateRecipeHandler
|
|||
public void drawExtras(int i)
|
||||
{
|
||||
float f = ticksPassed >= 20 ? (ticksPassed - 20) % 20 / 20.0F : 0.0F;
|
||||
drawProgressBar(63, 34, 176 + 26, 0, 24, 7, f, 0);
|
||||
drawProgressBar(63, 34, 176, 0, 24, 7, f, 0);
|
||||
f = ticksPassed <= 20 ? ticksPassed / 20.0F : 1.0F;
|
||||
drawProgressBar(149, 12, 176 + 26, 7, 4, 52, f, 3);
|
||||
drawProgressBar(149, 12, 176, 7, 4, 52, f, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,12 +24,17 @@ public class EntityObsidianTNT extends Entity
|
|||
public EntityObsidianTNT(World world, double x, double y, double z)
|
||||
{
|
||||
this(world);
|
||||
|
||||
setPosition(x, y, z);
|
||||
|
||||
float randPi = (float)(Math.random()*Math.PI*2);
|
||||
|
||||
motionX = -(Math.sin(randPi))*0.02F;
|
||||
motionY = 0.2;
|
||||
motionZ = -(Math.cos(randPi))*0.02F;
|
||||
|
||||
fuse = Mekanism.obsidianTNTDelay;
|
||||
|
||||
prevPosX = x;
|
||||
prevPosY = y;
|
||||
prevPosZ = z;
|
||||
|
|
|
@ -59,7 +59,7 @@ public class BlockObsidianTNT extends Block
|
|||
|
||||
if(world.isBlockIndirectlyGettingPowered(x, y, z))
|
||||
{
|
||||
onBlockDestroyedByPlayer(world, x, y, z, 1);
|
||||
explode(world, x, y, z);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public class BlockObsidianTNT extends Block
|
|||
{
|
||||
if(world.isBlockIndirectlyGettingPowered(x, y, z))
|
||||
{
|
||||
onBlockDestroyedByPlayer(world, x, y, z, 1);
|
||||
explode(world, x, y, z);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
}
|
||||
|
@ -85,29 +85,22 @@ public class BlockObsidianTNT extends Block
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta)
|
||||
public void explode(World world, int x, int y, int z)
|
||||
{
|
||||
if(!world.isRemote)
|
||||
{
|
||||
if((meta & 1) == 0)
|
||||
{
|
||||
dropBlockAsItem_do(world, x, y, z, new ItemStack(Mekanism.ObsidianTNT, 1, 0));
|
||||
}
|
||||
else {
|
||||
EntityObsidianTNT entity = new EntityObsidianTNT(world, x + 0.5F, y + 0.5F, z + 0.5F);
|
||||
world.spawnEntityInWorld(entity);
|
||||
world.playSoundAtEntity(entity, "random.fuse", 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int i1, float f1, float f2, float f3)
|
||||
{
|
||||
if(entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.flintAndSteel.itemID)
|
||||
{
|
||||
onBlockDestroyedByPlayer(world, x, y, z, 1);
|
||||
explode(world, x, y, z);
|
||||
world.setBlockToAir(x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
@ -131,15 +124,9 @@ public class BlockObsidianTNT extends Block
|
|||
|
||||
if(entityarrow.isBurning())
|
||||
{
|
||||
onBlockDestroyedByPlayer(world, x, y, z, 1);
|
||||
explode(world, x, y, z);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ItemStack createStackedBlock(int i)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue