@@ -14,14 +14,14 @@
|
||||
|
||||
@@ -55,7 +60,7 @@
|
||||
|
||||
SoundEffectType soundeffecttype = iblockdata1.r();
|
||||
SoundEffectType soundeffecttype = iblockdata1.getStepSound();
|
||||
|
||||
- world.playSound(entityhuman, blockposition, this.a(iblockdata1), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F);
|
||||
+ // world.playSound(entityhuman, blockposition, this.a(iblockdata1), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F);
|
||||
itemstack.subtract(1);
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
}
|
||||
@@ -89,6 +94,21 @@
|
||||
if (entityhuman == null || !entityhuman.abilities.canInstantlyBuild) {
|
||||
itemstack.subtract(1);
|
||||
}
|
||||
@@ -92,6 +97,21 @@
|
||||
|
||||
if (nbttagcompound != null) {
|
||||
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("BlockStateTag");
|
||||
@@ -43,7 +43,7 @@
|
||||
BlockStateList<Block, IBlockData> blockstatelist = iblockdata.getBlock().getStates();
|
||||
Iterator iterator = nbttagcompound1.getKeys().iterator();
|
||||
|
||||
@@ -103,11 +123,6 @@
|
||||
@@ -106,11 +126,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,20 +55,20 @@
|
||||
return iblockdata1;
|
||||
}
|
||||
|
||||
@@ -120,8 +135,15 @@
|
||||
@@ -123,8 +138,15 @@
|
||||
protected boolean b(BlockActionContext blockactioncontext, IBlockData iblockdata) {
|
||||
EntityHuman entityhuman = blockactioncontext.getEntity();
|
||||
VoxelShapeCollision voxelshapecollision = entityhuman == null ? VoxelShapeCollision.a() : VoxelShapeCollision.a((Entity) entityhuman);
|
||||
+ // CraftBukkit start - store default return
|
||||
+ boolean defaultReturn = (!this.T_() || iblockdata.canPlace(blockactioncontext.getWorld(), blockactioncontext.getClickPosition())) && blockactioncontext.getWorld().a(iblockdata, blockactioncontext.getClickPosition(), voxelshapecollision);
|
||||
+ boolean defaultReturn = (!this.isCheckCollisions() || iblockdata.canPlace(blockactioncontext.getWorld(), blockactioncontext.getClickPosition())) && blockactioncontext.getWorld().a(iblockdata, blockactioncontext.getClickPosition(), voxelshapecollision);
|
||||
+ org.bukkit.entity.Player player = (blockactioncontext.getEntity() instanceof EntityPlayer) ? (org.bukkit.entity.Player) blockactioncontext.getEntity().getBukkitEntity() : null;
|
||||
+
|
||||
+ BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(blockactioncontext.getWorld(), blockactioncontext.getClickPosition()), player, CraftBlockData.fromData(iblockdata), defaultReturn);
|
||||
+ blockactioncontext.getWorld().getServer().getPluginManager().callEvent(event);
|
||||
|
||||
- return (!this.T_() || iblockdata.canPlace(blockactioncontext.getWorld(), blockactioncontext.getClickPosition())) && blockactioncontext.getWorld().a(iblockdata, blockactioncontext.getClickPosition(), voxelshapecollision);
|
||||
- return (!this.isCheckCollisions() || iblockdata.canPlace(blockactioncontext.getWorld(), blockactioncontext.getClickPosition())) && blockactioncontext.getWorld().a(iblockdata, blockactioncontext.getClickPosition(), voxelshapecollision);
|
||||
+ return event.isBuildable();
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
protected boolean T_() {
|
||||
protected boolean isCheckCollisions() {
|
||||
|
||||
Reference in New Issue
Block a user