mirror of
https://github.com/GTNewHorizons/Applied-Energistics-2-Unofficial.git
synced 2026-11-26 15:03:17 +00:00
fix the event firing of AE2's items
This commit is contained in:
1 parent
3334933701
commit
11bc4b60a2
11 files changed
+55
-13
No files matched your search
@@ -45,6 +45,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
@@ -61,6 +62,9 @@ public class ToolDebugCard extends AEBaseItem
|
||||
@Override
|
||||
public boolean onItemUseFirst( final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
if( ForgeEventFactory.onItemUseStart( player, stack, 1 ) <= 0 )
|
||||
return true;
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -30,6 +30,8 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.EnumSet;
|
||||
@@ -56,6 +58,9 @@ public class ToolEraser extends AEBaseItem
|
||||
@Override
|
||||
public boolean onItemUseFirst( final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
if( ForgeEventFactory.onItemUseStart( player, stack, 1 ) <= 0 )
|
||||
return true;
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return false;
|
||||
@@ -64,6 +69,9 @@ public class ToolEraser extends AEBaseItem
|
||||
final Block blk = world.getBlock( x, y, z );
|
||||
final int meta = world.getBlockMetadata( x, y, z );
|
||||
|
||||
if( blk != null && ForgeEventFactory.onPlayerInteract( player, PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, x, y, z, side, world ).isCanceled() )
|
||||
return true;
|
||||
|
||||
List<WorldCoord> next = new LinkedList<WorldCoord>();
|
||||
next.add( new WorldCoord( x, y, z ) );
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
@@ -50,6 +51,9 @@ public class ToolMeteoritePlacer extends AEBaseItem
|
||||
@Override
|
||||
public boolean onItemUseFirst( final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
if( ForgeEventFactory.onItemUseStart( player, stack, 1 ) <= 0 )
|
||||
return true;
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -37,6 +37,7 @@ import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
@@ -51,6 +52,9 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
@Override
|
||||
public boolean onItemUseFirst( final ItemStack stack, final EntityPlayer player, final World world, int x, int y, int z, final int side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
if( ForgeEventFactory.onItemUseStart( player, stack, 1 ) <= 0 )
|
||||
return true;
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user