use of network.rs485.logisticspipes.config.PlayerConfiguration in project LogisticsPipes by RS485.
the class LogisticsEventListener method onItemCrafting.
@SubscribeEvent
public void onItemCrafting(PlayerEvent.ItemCraftedEvent event) {
if (event.player.isServerWorld() && !event.crafting.isEmpty()) {
if (event.crafting.getItem().getRegistryName().getResourceDomain().equals(LPConstants.LP_MOD_ID)) {
PlayerIdentifier identifier = PlayerIdentifier.get(event.player);
PlayerConfiguration config = LogisticsPipes.getServerConfigManager().getPlayerConfiguration(identifier);
if (!config.getHasCraftedLPItem() && !LogisticsPipes.isDEBUG()) {
ItemStack book = new ItemStack(LPItems.itemGuideBook, 1);
event.player.addItemStackToInventory(book);
config.setHasCraftedLPItem(true);
LogisticsPipes.getServerConfigManager().setPlayerConfiguration(identifier, config);
}
}
}
}
Aggregations