Implemented item.onBlockStartBreak call for creative single player.

This commit is contained in:
LexManos 2012-02-13 04:11:39 -08:00
parent d8fa9a8497
commit 5163a30002
1 changed files with 11 additions and 1 deletions

View File

@ -1,6 +1,16 @@
--- ../src_base/minecraft/net/minecraft/src/PlayerControllerCreative.java 0000-00-00 00:00:00.000000000 -0000 --- ../src_base/minecraft/net/minecraft/src/PlayerControllerCreative.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft/net/minecraft/src/PlayerControllerCreative.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft/net/minecraft/src/PlayerControllerCreative.java 0000-00-00 00:00:00.000000000 -0000
@@ -48,6 +48,14 @@ @@ -43,11 +43,24 @@
public static void clickBlockCreative(Minecraft minecraft, PlayerController playercontroller, int i, int j, int k, int l)
{
minecraft.theWorld.onBlockHit(minecraft.thePlayer, i, j, k, l);
+ ItemStack itemstack = minecraft.thePlayer.getCurrentEquippedItem();
+ if (itemstack != null && itemstack.getItem().onBlockStartBreak(itemstack, i, j, k, minecraft.thePlayer))
+ {
+ return;
+ }
playercontroller.onPlayerDestroyBlock(i, j, k, l);
}
public boolean onPlayerRightClick(EntityPlayer entityplayer, World world, ItemStack itemstack, int i, int j, int k, int l) public boolean onPlayerRightClick(EntityPlayer entityplayer, World world, ItemStack itemstack, int i, int j, int k, int l)
{ {