本文整理匯總了Java中net.canarymod.api.entity.hanging.HangingEntity類的典型用法代碼示例。如果您正苦於以下問題:Java HangingEntity類的具體用法?Java HangingEntity怎麽用?Java HangingEntity使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
HangingEntity類屬於net.canarymod.api.entity.hanging包,在下文中一共展示了HangingEntity類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onHangingEntityDestroy
import net.canarymod.api.entity.hanging.HangingEntity; //導入依賴的package包/類
@HookHandler(priority = Priority.CRITICAL)
public void onHangingEntityDestroy(final HangingEntityDestroyHook hook) {
final Player player = hook.getPlayer();
final HangingEntity entity = hook.getPainting();
if (player == null || !player.isOperator()) {
final Tree<? extends IZown> zownTree = zownManager.getZown(entity.getLocation());
if (player == null || !zownTree.getData().isOwnerOrMember(player)) {
final Boolean flag = zownTree.getData().getConfiguration().getFlag(Flag.build.name());
if (flag != null) {
final boolean excluded = zownTree.getData().getConfiguration()
.hasEntityCreateExclusion(entity.getClass());
if (flag) {
if (excluded) {
hook.setCanceled();
}
} else {
if (!excluded) {
hook.setCanceled();
}
}
}
}
}
}