fun initiateItemEvent( player: EntityPlayer?, itemStack: ItemStack?, event: Int, limitRange: Boolean ) { try { if (NetworkManager_initiateItemEvent == null) NetworkManager_initiateItemEvent = Class.forName( getPackage().toString() + ".core.network.NetworkManager" ).getMethod( "initiateItemEvent", EntityPlayer::class.java, ItemStack::class.java, Integer.TYPE, java.lang.Boolean.TYPE ) if (instance == null) instance = getInstance() NetworkManager_initiateItemEvent.invoke(instance, player, itemStack, event, limitRange) } catch (e: Exception) { throw RuntimeException(e) } }
Immediately send an event for the specified Item to the clients in range . The item should implement INetworkItemEventListener to receive the event . If this method is being executed on the client ( i.e . Singleplayer ) , it 'll just call INetworkItemEventListener.onNetworkEvent ( if implemented by the item ) .