1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-25 20:16:13 +01:00

Not check for explorer by the ground, but check flying, #357

This commit is contained in:
montlikadani 2019-02-13 20:44:29 +01:00
parent 62f5718eb1
commit 1f2219b3cb

View File

@ -23,6 +23,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.UUID;
import org.bukkit.Bukkit;
@ -184,9 +185,9 @@ public class JobsPaymentListener implements Listener {
ItemStack toStore = event.getCursor();
// Make sure we are actually traded anything
if (hasItems(toCraft))
if (event.isShiftClick()) {
if (event.isShiftClick())
schedulePostDetection(player, toCraft.clone(), jPlayer, resultStack.clone(), ActionType.VTRADE);
} else {
else {
// The items are stored in the cursor. Make sure there's enough space.
if (isStackSumLegal(toCraft, toStore)) {
int newItemsCount = toCraft.getAmount();
@ -367,14 +368,14 @@ public class JobsPaymentListener implements Listener {
if (!payIfCreative(player))
return;
if (CMIMaterial.get(block).equals(CMIMaterial.FURNACE) && block.hasMetadata(furnaceOwnerMetadata))
FurnaceBrewingHandling.removeFurnace(block);
if (CMIMaterial.get(block).equals(CMIMaterial.BREWING_STAND) && block.hasMetadata(brewingOwnerMetadata))
FurnaceBrewingHandling.removeBrewing(block);
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
return;
if (Jobs.getGCManager().isFurnacesReassign() && CMIMaterial.get(block).equals(CMIMaterial.FURNACE) && block.hasMetadata(furnaceOwnerMetadata))
FurnaceBrewingHandling.removeFurnace(block);
if (Jobs.getGCManager().isBrewingStandsReassign() && CMIMaterial.get(block).equals(CMIMaterial.BREWING_STAND) && block.hasMetadata(brewingOwnerMetadata))
FurnaceBrewingHandling.removeBrewing(block);
BlockActionInfo bInfo = new BlockActionInfo(block, ActionType.BREAK);
FastPayment fp = Jobs.FastPayment.get(player.getUniqueId());
@ -1526,9 +1527,8 @@ public class JobsPaymentListener implements Listener {
@Override
public void run() {
Block b = loc.getBlock();
if (b.getType().toString().startsWith("STRIPPED_")) {
if (b.getType().toString().startsWith("STRIPPED_"))
Jobs.action(jPlayer, new BlockActionInfo(b, ActionType.STRIPLOGS), b);
}
return;
}
}, 1);
@ -1590,7 +1590,7 @@ public class JobsPaymentListener implements Listener {
if (player.getGameMode().toString().equals("SPECTATOR"))
return;
if (!Jobs.getGCManager().payExploringWhenFlying() && player.isOnGround())
if (!Jobs.getGCManager().payExploringWhenFlying() && player.isFlying())
return;
ExploreRespond respond = Jobs.getExplore().ChunkRespond(player, event.getNewChunk());