From adf59774d4e96ef66dd0697266d187c37c647c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salom=C3=A3o?= Date: Wed, 18 Nov 2020 20:22:40 -0300 Subject: [PATCH] Remove uneeded Forge Event Firing improves crafting calculation performance --- src/main/java/appeng/crafting/CraftingTreeProcess.java | 4 ---- .../appeng/me/cluster/implementations/CraftingCPUCluster.java | 4 ---- .../java/appeng/tile/crafting/TileMolecularAssembler.java | 2 -- 3 files changed, 10 deletions(-) diff --git a/src/main/java/appeng/crafting/CraftingTreeProcess.java b/src/main/java/appeng/crafting/CraftingTreeProcess.java index 7f0c2936b..b82e3458f 100644 --- a/src/main/java/appeng/crafting/CraftingTreeProcess.java +++ b/src/main/java/appeng/crafting/CraftingTreeProcess.java @@ -77,8 +77,6 @@ public class CraftingTreeProcess ic.setInventorySlotContents( x, is[x] == null ? ItemStack.EMPTY : is[x].createItemStack() ); } - FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) world ), details.getOutput( ic, world ), ic ); - for( int x = 0; x < ic.getSizeInventory(); x++ ) { final ItemStack g = ic.getStackInSlot( x ); @@ -201,8 +199,6 @@ public class CraftingTreeProcess ic.setInventorySlotContents( entry.getKey().getSlot(), stack.createItemStack() ); } - FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) this.world ), this.details.getOutput( ic, this.world ), ic ); - for( int x = 0; x < ic.getSizeInventory(); x++ ) { ItemStack is = ic.getStackInSlot( x ); diff --git a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java index b9c2d5288..91db2d4e8 100644 --- a/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java +++ b/src/main/java/appeng/me/cluster/implementations/CraftingCPUCluster.java @@ -779,10 +779,6 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU if( details.isCraftable() ) { - FMLCommonHandler.instance() - .firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) this.getWorld() ), - details.getOutput( ic, this.getWorld() ), ic ); - for( int x = 0; x < ic.getSizeInventory(); x++ ) { final ItemStack output = Platform.getContainerItem( ic.getStackInSlot( x ) ); diff --git a/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java b/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java index c41231bec..e6639bac3 100644 --- a/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java +++ b/src/main/java/appeng/tile/crafting/TileMolecularAssembler.java @@ -458,8 +458,6 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade final ItemStack output = this.myPlan.getOutput( this.craftingInv, this.getWorld() ); if( !output.isEmpty() ) { - FMLCommonHandler.instance().firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) this.getWorld() ), output, this.craftingInv ); - this.pushOut( output.copy() ); for( int x = 0; x < this.craftingInv.getSizeInventory(); x++ )