mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-29 03:13:52 -07:00
Implement cooldown API
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
if (this.isCreative()) {
|
||||
if (!this.world.douseFire((EntityHuman) null, blockposition, enumdirection)) {
|
||||
this.breakBlock(blockposition);
|
||||
@@ -125,15 +146,49 @@
|
||||
@@ -125,14 +146,48 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,8 +79,8 @@
|
||||
f = iblockdata.a((EntityHuman) this.player, this.player.world, blockposition);
|
||||
+ // Allow fire punching to be blocked
|
||||
+ this.world.douseFire((EntityHuman) null, blockposition, enumdirection);
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
+ if (event.useItemInHand() == Event.Result.DENY) {
|
||||
+ // If we 'insta destroyed' then the client needs to be informed.
|
||||
+ if (f > 1.0f) {
|
||||
@@ -98,12 +98,11 @@
|
||||
+
|
||||
+ if (blockEvent.getInstaBreak()) {
|
||||
+ f = 2.0f;
|
||||
+ }
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
|
||||
if (iblockdata.getMaterial() != Material.AIR && f >= 1.0F) {
|
||||
this.breakBlock(blockposition);
|
||||
} else {
|
||||
@@ -150,6 +205,7 @@
|
||||
|
||||
public void a(BlockPosition blockposition) {
|
||||
@@ -224,7 +223,7 @@
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
@@ -280,63 +419,86 @@
|
||||
@@ -280,63 +419,90 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,12 +249,16 @@
|
||||
- if (itileinventory instanceof TileEntityChest && block instanceof BlockChest) {
|
||||
- itileinventory = ((BlockChest) block).c(world, blockposition);
|
||||
- }
|
||||
+ if (itemstack.getItem() instanceof ItemBlock && !entityhuman.dk()) { // PAIL: creativeAndOp
|
||||
+ Block block1 = ((ItemBlock) itemstack.getItem()).getBlock();
|
||||
+ if (entityhuman.di().a(itemstack.getItem())) {
|
||||
+ cancelledBlock = true;
|
||||
+ }
|
||||
|
||||
- if (itileinventory != null) {
|
||||
- entityhuman.openContainer(itileinventory);
|
||||
- return EnumInteractionResult.SUCCESS;
|
||||
+ if (itemstack.getItem() instanceof ItemBlock && !entityhuman.dk()) { // PAIL: creativeAndOp
|
||||
+ Block block1 = ((ItemBlock) itemstack.getItem()).getBlock();
|
||||
+
|
||||
+ if (block1 instanceof BlockCommand || block1 instanceof BlockStructure) {
|
||||
+ cancelledBlock = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user