mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
Version control logic, improved the destroy handling hook.
This commit is contained in:
1 parent
8fcc2a1f9f
commit
6cfbc34940
4 files changed
+80
-17
No files matched your search
+18
-14
@@ -956,7 +956,7 @@ diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/EntityLiv
|
||||
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/EntityPlayer.java ../src_work/minecraft/net/minecraft/src/EntityPlayer.java
|
||||
--- ../src_base/minecraft/net/minecraft/src/EntityPlayer.java 2011-08-11 17:02:11.000000000 -0400
|
||||
+++ ../src_work/minecraft/net/minecraft/src/EntityPlayer.java 2011-08-17 19:06:38.000000000 -0400
|
||||
+++ ../src_work/minecraft/net/minecraft/src/EntityPlayer.java 2011-08-20 03:54:26.000000000 -0400
|
||||
@@ -6,6 +6,9 @@
|
||||
|
||||
import java.util.*;
|
||||
@@ -1023,15 +1023,17 @@ diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/EntityPla
|
||||
int j = 25 - inventory.getTotalArmorValue();
|
||||
int k = i * j + damageRemainder;
|
||||
inventory.damageArmor(i);
|
||||
@@ -523,6 +561,7 @@
|
||||
@@ -522,7 +560,9 @@
|
||||
|
||||
public void destroyCurrentEquippedItem()
|
||||
{
|
||||
+ ItemStack orig=inventory.getCurrentItem();
|
||||
inventory.setInventorySlotContents(inventory.currentItem, null);
|
||||
+ ForgeHooks.onDestroyCurrentItem(this);
|
||||
+ ForgeHooks.onDestroyCurrentItem(this,orig);
|
||||
}
|
||||
|
||||
public double getYOffset()
|
||||
@@ -594,6 +633,10 @@
|
||||
@@ -594,6 +634,10 @@
|
||||
|
||||
public EnumStatus sleepInBedAt(int i, int j, int k)
|
||||
{
|
||||
@@ -1186,7 +1188,7 @@ diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/MovingObj
|
||||
}
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/PlayerController.java ../src_work/minecraft/net/minecraft/src/PlayerController.java
|
||||
--- ../src_base/minecraft/net/minecraft/src/PlayerController.java 2011-08-11 17:02:11.000000000 -0400
|
||||
+++ ../src_work/minecraft/net/minecraft/src/PlayerController.java 2011-08-17 20:02:41.000000000 -0400
|
||||
+++ ../src_work/minecraft/net/minecraft/src/PlayerController.java 2011-08-20 03:56:00.000000000 -0400
|
||||
@@ -3,6 +3,7 @@
|
||||
// Decompiler options: packimports(3) braces deadcode
|
||||
|
||||
@@ -1199,7 +1201,7 @@ diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/PlayerCon
|
||||
if(itemstack1.stackSize == 0)
|
||||
{
|
||||
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = null;
|
||||
+ ForgeHooks.onDestroyCurrentItem(entityplayer);
|
||||
+ ForgeHooks.onDestroyCurrentItem(entityplayer,itemstack1);
|
||||
}
|
||||
return true;
|
||||
} else
|
||||
@@ -1224,7 +1226,7 @@ diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/PlayerCon
|
||||
+ if(!itemstack.useItem(entityplayer, world, i, j, k, l))
|
||||
+ return false;
|
||||
+ if(itemstack.stackSize == 0)
|
||||
+ ForgeHooks.onDestroyCurrentItem(entityplayer);
|
||||
+ ForgeHooks.onDestroyCurrentItem(entityplayer,itemstack);
|
||||
+ return true;
|
||||
}
|
||||
}
|
||||
@@ -2632,7 +2634,7 @@ diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/En
|
||||
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/EntityPlayer.java ../src_work/minecraft_server/net/minecraft/src/EntityPlayer.java
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/EntityPlayer.java 2011-08-11 17:02:12.000000000 -0400
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/EntityPlayer.java 2011-08-17 19:06:41.000000000 -0400
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/EntityPlayer.java 2011-08-20 03:53:18.000000000 -0400
|
||||
@@ -6,6 +6,9 @@
|
||||
|
||||
import java.util.*;
|
||||
@@ -2699,15 +2701,17 @@ diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/En
|
||||
int j = 25 - inventory.getTotalArmorValue();
|
||||
int k = i * j + damageRemainder;
|
||||
inventory.damageArmor(i);
|
||||
@@ -503,6 +541,7 @@
|
||||
@@ -502,7 +540,9 @@
|
||||
|
||||
public void destroyCurrentEquippedItem()
|
||||
{
|
||||
+ ItemStack orig=inventory.getCurrentItem();
|
||||
inventory.setInventorySlotContents(inventory.currentItem, null);
|
||||
+ ForgeHooks.onDestroyCurrentItem(this);
|
||||
+ ForgeHooks.onDestroyCurrentItem(this,orig);
|
||||
}
|
||||
|
||||
public double getYOffset()
|
||||
@@ -568,6 +607,10 @@
|
||||
@@ -568,6 +608,10 @@
|
||||
|
||||
public EnumStatus goToSleep(int i, int j, int k)
|
||||
{
|
||||
@@ -2775,7 +2779,7 @@ diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/It
|
||||
world.setBlockWithNotify(i, j, k, 0);
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/ItemInWorldManager.java ../src_work/minecraft_server/net/minecraft/src/ItemInWorldManager.java
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/ItemInWorldManager.java 2011-08-11 17:02:12.000000000 -0400
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/ItemInWorldManager.java 2011-08-17 20:02:48.000000000 -0400
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/ItemInWorldManager.java 2011-08-20 03:56:01.000000000 -0400
|
||||
@@ -3,6 +3,7 @@
|
||||
// Decompiler options: packimports(3) braces deadcode
|
||||
|
||||
@@ -2825,7 +2829,7 @@ diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/It
|
||||
if(itemstack1.stackSize == 0)
|
||||
{
|
||||
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = null;
|
||||
+ ForgeHooks.onDestroyCurrentItem(entityplayer);
|
||||
+ ForgeHooks.onDestroyCurrentItem(entityplayer,itemstack1);
|
||||
}
|
||||
return true;
|
||||
} else
|
||||
@@ -2849,7 +2853,7 @@ diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/It
|
||||
+ if(!itemstack.useItem(entityplayer, world, i, j, k, l))
|
||||
+ return false;
|
||||
+ if(itemstack.stackSize == 0)
|
||||
+ ForgeHooks.onDestroyCurrentItem(entityplayer);
|
||||
+ ForgeHooks.onDestroyCurrentItem(entityplayer,itemstack);
|
||||
+ return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user