mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-22 05:02:18 +00:00
Updated onItemUseFirst call to include the new hit vector information, and updated readme.
This commit is contained in:
1 parent
d3300cabb0
commit
d5610afdff
4 files changed
+28
-17
No files matched your search
@@ -5,10 +5,11 @@ It should create a folder "forge" within that directory, containing all
|
||||
extracted files.
|
||||
|
||||
You should use freshly downloaded jars, add NOTHING to the jars, ModLoader
|
||||
is no longer needed. Both client and server should be 100% clean.
|
||||
is no longer needed. Both client and server are required and should be 100% clean.
|
||||
|
||||
You also need to install the FernFlower decompiler, you can download it at
|
||||
http://goo.gl/PnJHp. Extract fernflower.jar into your MCP's runtime/bin folder.
|
||||
It comes with MCP 7.2a+, but if you do not have it, you need to install the
|
||||
FernFlower decompiler, you can download it at http://goo.gl/PnJHp.
|
||||
Extract fernflower.jar into your MCP's runtime/bin folder.
|
||||
|
||||
Now just start the install.cmd/.sh, MCForge will install itself into the proper
|
||||
locations and copy all needed files, as well as modifying the needed baseclasses.
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
|
||||
return par1World.rayTraceBlocks_do_do(var13, var23, par3, !par3);
|
||||
}
|
||||
@@ -650,4 +657,189 @@
|
||||
@@ -650,4 +657,199 @@
|
||||
{
|
||||
StatList.initStats();
|
||||
}
|
||||
@@ -57,13 +57,23 @@
|
||||
+ * @param stack The Item Stack
|
||||
+ * @param player The Player that used the item
|
||||
+ * @param world The Current World
|
||||
+ * @param X Target X Position
|
||||
+ * @param Y Target Y Position
|
||||
+ * @param Z Target Z Position
|
||||
+ * @param x Target X Position
|
||||
+ * @param y Target Y Position
|
||||
+ * @param z Target Z Position
|
||||
+ * @param side The side of the target hit
|
||||
+ * @return Return true to prevent any further processing.
|
||||
+ */
|
||||
+ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int X, int Y, int Z, int side)
|
||||
+ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
+ {
|
||||
+ return onItemUseFirst(stack, player, world, x, y, z, side);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * See onItemUseFirst above, this is deprecated in favor of the more aware version.
|
||||
+ * Only here for compaibility.
|
||||
+ */
|
||||
+ @Deprecated
|
||||
+ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side)
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
{
|
||||
+ if (par3ItemStack != null &&
|
||||
+ par3ItemStack.getItem() != null &&
|
||||
+ par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7))
|
||||
+ par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10))
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
|
||||
@@ -31,19 +31,19 @@
|
||||
|
||||
if (var8)
|
||||
{
|
||||
@@ -290,6 +298,12 @@
|
||||
public boolean onPlayerRightClick(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7, Vec3 par8Vec3)
|
||||
{
|
||||
this.syncCurrentPlayItem();
|
||||
@@ -295,6 +303,12 @@
|
||||
float var11 = (float)par8Vec3.zCoord - (float)par6;
|
||||
boolean var12 = false;
|
||||
int var13 = par2World.getBlockId(par4, par5, par6);
|
||||
+ if (par3ItemStack != null &&
|
||||
+ par3ItemStack.getItem() != null &&
|
||||
+ par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7))
|
||||
+ par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7, var9, var10, var11))
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
float var9 = (float)par8Vec3.xCoord - (float)par4;
|
||||
float var10 = (float)par8Vec3.yCoord - (float)par5;
|
||||
float var11 = (float)par8Vec3.zCoord - (float)par6;
|
||||
|
||||
if (var13 > 0 && Block.blocksList[var13].onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, var9, var10, var11))
|
||||
{
|
||||
@@ -332,7 +346,15 @@
|
||||
}
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user