@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockTNT.java
|
||||
+++ b/net/minecraft/world/level/block/BlockTNT.java
|
||||
@@ -26,6 +26,11 @@
|
||||
@@ -27,6 +27,11 @@
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
|
||||
@@ -12,25 +12,25 @@
|
||||
public class BlockTNT extends Block {
|
||||
|
||||
public static final MapCodec<BlockTNT> CODEC = simpleCodec(BlockTNT::new);
|
||||
@@ -44,7 +49,7 @@
|
||||
@@ -45,7 +50,7 @@
|
||||
@Override
|
||||
public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) {
|
||||
protected void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) {
|
||||
if (!iblockdata1.is(iblockdata.getBlock())) {
|
||||
- if (world.hasNeighborSignal(blockposition)) {
|
||||
+ if (world.hasNeighborSignal(blockposition) && CraftEventFactory.callTNTPrimeEvent(world, blockposition, PrimeCause.REDSTONE, null, null)) { // CraftBukkit - TNTPrimeEvent
|
||||
explode(world, blockposition);
|
||||
world.removeBlock(blockposition, false);
|
||||
}
|
||||
@@ -54,7 +59,7 @@
|
||||
@@ -55,7 +60,7 @@
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) {
|
||||
protected void neighborChanged(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) {
|
||||
- if (world.hasNeighborSignal(blockposition)) {
|
||||
+ if (world.hasNeighborSignal(blockposition) && CraftEventFactory.callTNTPrimeEvent(world, blockposition, PrimeCause.REDSTONE, null, blockposition1)) { // CraftBukkit - TNTPrimeEvent
|
||||
explode(world, blockposition);
|
||||
world.removeBlock(blockposition, false);
|
||||
}
|
||||
@@ -63,7 +68,7 @@
|
||||
@@ -64,7 +69,7 @@
|
||||
|
||||
@Override
|
||||
public IBlockData playerWillDestroy(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) {
|
||||
@@ -39,19 +39,19 @@
|
||||
explode(world, blockposition);
|
||||
}
|
||||
|
||||
@@ -102,6 +107,11 @@
|
||||
@@ -101,6 +106,11 @@
|
||||
if (!itemstack.is(Items.FLINT_AND_STEEL) && !itemstack.is(Items.FIRE_CHARGE)) {
|
||||
return super.use(iblockdata, world, blockposition, entityhuman, enumhand, movingobjectpositionblock);
|
||||
return super.useItemOn(itemstack, iblockdata, world, blockposition, entityhuman, enumhand, movingobjectpositionblock);
|
||||
} else {
|
||||
+ // CraftBukkit start - TNTPrimeEvent
|
||||
+ if (!CraftEventFactory.callTNTPrimeEvent(world, blockposition, PrimeCause.PLAYER, entityhuman, null)) {
|
||||
+ return EnumInteractionResult.CONSUME;
|
||||
+ return ItemInteractionResult.CONSUME;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
explode(world, blockposition, entityhuman);
|
||||
world.setBlock(blockposition, Blocks.AIR.defaultBlockState(), 11);
|
||||
Item item = itemstack.getItem();
|
||||
@@ -128,6 +138,11 @@
|
||||
@@ -125,6 +135,11 @@
|
||||
Entity entity = iprojectile.getOwner();
|
||||
|
||||
if (iprojectile.isOnFire() && iprojectile.mayInteract(world, blockposition)) {
|
||||
|
||||
Reference in New Issue
Block a user