use of moriyashiine.bewitchment.client.screen.BaphometScreenHandler in project bewitchment by MoriyaShiine.
the class BaphometEntity method interactMob.
@Override
protected ActionResult interactMob(PlayerEntity player, Hand hand) {
if (!world.isClient && isAlive() && getTarget() == null && BewitchmentAPI.isPledged(player, getPledgeID())) {
if (BWUtil.rejectTrades(this)) {
return ActionResult.FAIL;
}
if (getCurrentCustomer() == null) {
setCurrentCustomer(player);
}
if (!getOffers().isEmpty()) {
SyncContractsPacket.send(player);
player.openHandledScreen(new SimpleNamedScreenHandlerFactory((id, playerInventory, customer) -> new BaphometScreenHandler(id, this), getDisplayName())).ifPresent(syncId -> SyncDemonTradesPacket.send(player, this, syncId));
} else {
setCurrentCustomer(null);
}
}
return ActionResult.success(world.isClient);
}
Aggregations