Require build trust to hatch eggs
This commit is contained in:
parent
f99d17f5c5
commit
af91fbe5b4
|
|
@ -932,6 +932,7 @@ class PlayerEventHandler implements Listener
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onPlayerThrowEgg(PlayerEggThrowEvent event)
|
public void onPlayerThrowEgg(PlayerEggThrowEvent event)
|
||||||
{
|
{
|
||||||
|
if (!event.isHatching()) return;
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId());
|
PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId());
|
||||||
Claim claim = this.dataStore.getClaimAt(event.getEgg().getLocation(), false, playerData.lastClaim);
|
Claim claim = this.dataStore.getClaimAt(event.getEgg().getLocation(), false, playerData.lastClaim);
|
||||||
|
|
@ -939,7 +940,8 @@ class PlayerEventHandler implements Listener
|
||||||
//allow throw egg if player is in ignore claims mode
|
//allow throw egg if player is in ignore claims mode
|
||||||
if (playerData.ignoreClaims || claim == null) return;
|
if (playerData.ignoreClaims || claim == null) return;
|
||||||
|
|
||||||
Supplier<String> failureReason = claim.checkPermission(player, ClaimPermission.Inventory, event);
|
// Supplier<String> failureReason = claim.checkPermission(player, ClaimPermission.Inventory, event);
|
||||||
|
Supplier<String> failureReason = claim.checkPermission(player, ClaimPermission.Build, event);
|
||||||
if (failureReason != null)
|
if (failureReason != null)
|
||||||
{
|
{
|
||||||
String reason = failureReason.get();
|
String reason = failureReason.get();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user