Fixes TinyTNT not being primable with flint & steel.
This commit is contained in:
@@ -129,11 +129,6 @@ public abstract class AEBaseBlock extends Block {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
|
|
||||||
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
|
|
||||||
return ActionResultType.PASS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final Direction mapRotation(final IOrientable ori, final Direction dir) {
|
public final Direction mapRotation(final IOrientable ori, final Direction dir) {
|
||||||
// case DOWN: return bottomIcon;
|
// case DOWN: return bottomIcon;
|
||||||
// case UP: return blockIcon;
|
// case UP: return blockIcon;
|
||||||
|
|||||||
@@ -278,6 +278,11 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
|
|||||||
return this.onActivated(world, pos, player, hand, player.getHeldItem(hand), hit);
|
return this.onActivated(world, pos, player, hand, player.getHeldItem(hand), hit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
|
||||||
|
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
|
||||||
|
return ActionResultType.PASS;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IOrientable getOrientable(final IBlockReader w, final BlockPos pos) {
|
public IOrientable getOrientable(final IBlockReader w, final BlockPos pos) {
|
||||||
return this.getTileEntity(w, pos);
|
return this.getTileEntity(w, pos);
|
||||||
|
|||||||
@@ -67,17 +67,17 @@ public class TinyTNTBlock extends AEBaseBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
|
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||||
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
|
ItemStack heldItem = player.getHeldItem(handIn);
|
||||||
if (heldItem != null && heldItem.getItem() == Items.FLINT_AND_STEEL) {
|
if (!heldItem.isEmpty() && heldItem.getItem() == Items.FLINT_AND_STEEL) {
|
||||||
this.startFuse(w, pos, player);
|
this.startFuse(world, pos, player);
|
||||||
w.removeBlock(pos, false);
|
world.removeBlock(pos, false);
|
||||||
heldItem.damageItem(1, player, p -> {
|
heldItem.damageItem(1, player, p -> {
|
||||||
p.sendBreakAnimation(hand);
|
p.sendBreakAnimation(handIn);
|
||||||
}); // FIXME Check if onBroken is equivalent
|
}); // FIXME Check if onBroken is equivalent
|
||||||
return ActionResultType.SUCCESS;
|
return ActionResultType.SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
return super.onActivated(w, pos, player, hand, heldItem, hit);
|
return super.onBlockActivated(state, world, pos, player, handIn, hit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user