use of net.minecraft.inventory.InventoryMerchant in project Solar by Martacus.
the class EventHandler method onOpenVillagerGUI.
@SubscribeEvent
public static void onOpenVillagerGUI(PlayerContainerEvent event) {
if (event.getContainer() instanceof ContainerMerchant) {
ContainerMerchant merchantContainer = (ContainerMerchant) event.getContainer();
InventoryMerchant merchant = merchantContainer.getMerchantInventory();
EntityVillager villager = (EntityVillager) merchant.merchant;
if (villager.getProfessionForge().getRegistryName().toString().equalsIgnoreCase(ModVillage.OLD_PRIEST_PROFESSION.getRegistryName().toString())) {
event.setCanceled(true);
}
}
}
Aggregations