mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-24 17:39:26 +00:00
2.0.11
This commit is contained in:
@@ -4,7 +4,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = 'net.momirealms'
|
||||
version = '2.0.10'
|
||||
version = '2.0.11'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
@@ -61,6 +61,7 @@ public class ConfigUtil {
|
||||
}
|
||||
|
||||
public static void reloadConfigs() {
|
||||
|
||||
MainConfig.load();
|
||||
BasicItemConfig.load();
|
||||
CropConfig.load();
|
||||
|
||||
@@ -28,6 +28,7 @@ public interface AntiGrief {
|
||||
boolean canPlace(Location location, Player player);
|
||||
|
||||
static boolean testBreak(Player player, Location location) {
|
||||
if (player.isOp()) return true;
|
||||
for (AntiGrief antiGrief : MainConfig.antiGriefs) {
|
||||
if(!antiGrief.canBreak(location, player)) {
|
||||
return false;
|
||||
@@ -37,6 +38,7 @@ public interface AntiGrief {
|
||||
}
|
||||
|
||||
static boolean testPlace(Player player, Location location) {
|
||||
if (player.isOp()) return true;
|
||||
for (AntiGrief antiGrief : MainConfig.antiGriefs) {
|
||||
if(!antiGrief.canPlace(location, player)) {
|
||||
return false;
|
||||
|
||||
@@ -192,7 +192,6 @@ public abstract class HandlerP extends Function {
|
||||
player,
|
||||
location.add(0, MainConfig.sprinklerInfoY - 1,0),
|
||||
MainConfig.sprinklerInfoDuration);
|
||||
|
||||
}
|
||||
|
||||
public boolean useSurveyor(Location potLoc, String id, Player player) {
|
||||
|
||||
@@ -33,7 +33,6 @@ import net.momirealms.customcrops.managers.CropManager;
|
||||
import net.momirealms.customcrops.objects.Sprinkler;
|
||||
import net.momirealms.customcrops.utils.AdventureUtil;
|
||||
import net.momirealms.customcrops.utils.FurnitureUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
|
||||
@@ -24,10 +24,7 @@ import dev.lone.itemsadder.api.Events.*;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.momirealms.customcrops.CustomCrops;
|
||||
import net.momirealms.customcrops.api.crop.Crop;
|
||||
import net.momirealms.customcrops.api.event.SeedPlantEvent;
|
||||
import net.momirealms.customcrops.api.event.WaterPotEvent;
|
||||
import net.momirealms.customcrops.api.utils.CCSeason;
|
||||
import net.momirealms.customcrops.api.utils.SeasonUtils;
|
||||
import net.momirealms.customcrops.config.*;
|
||||
import net.momirealms.customcrops.integrations.AntiGrief;
|
||||
import net.momirealms.customcrops.integrations.customplugin.HandlerP;
|
||||
@@ -36,26 +33,19 @@ import net.momirealms.customcrops.integrations.customplugin.itemsadder.listeners
|
||||
import net.momirealms.customcrops.managers.CropManager;
|
||||
import net.momirealms.customcrops.managers.CustomWorld;
|
||||
import net.momirealms.customcrops.objects.WaterCan;
|
||||
import net.momirealms.customcrops.objects.requirements.PlantingCondition;
|
||||
import net.momirealms.customcrops.objects.requirements.RequirementInterface;
|
||||
import net.momirealms.customcrops.utils.AdventureUtil;
|
||||
import net.momirealms.customcrops.utils.FurnitureUtil;
|
||||
import net.momirealms.customcrops.utils.LimitationUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public abstract class ItemsAdderHandler extends HandlerP {
|
||||
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
|
||||
package net.momirealms.customcrops.integrations.customplugin.oraxen;
|
||||
|
||||
import io.th0rgal.oraxen.events.OraxenFurnitureBreakEvent;
|
||||
import io.th0rgal.oraxen.events.OraxenFurnitureInteractEvent;
|
||||
import io.th0rgal.oraxen.events.OraxenNoteBlockBreakEvent;
|
||||
import io.th0rgal.oraxen.events.OraxenNoteBlockInteractEvent;
|
||||
import io.th0rgal.oraxen.items.OraxenItems;
|
||||
import io.th0rgal.oraxen.api.OraxenItems;
|
||||
import io.th0rgal.oraxen.api.events.OraxenFurnitureBreakEvent;
|
||||
import io.th0rgal.oraxen.api.events.OraxenFurnitureInteractEvent;
|
||||
import io.th0rgal.oraxen.api.events.OraxenNoteBlockBreakEvent;
|
||||
import io.th0rgal.oraxen.api.events.OraxenNoteBlockInteractEvent;
|
||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.furniture.FurnitureFactory;
|
||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.furniture.FurnitureMechanic;
|
||||
import io.th0rgal.oraxen.utils.drops.Drop;
|
||||
@@ -55,7 +55,7 @@ public class OraxenFrameHandler extends OraxenHandler {
|
||||
public void onBreakNoteBlock(OraxenNoteBlockBreakEvent event) {
|
||||
if (event.isCancelled()) return;
|
||||
|
||||
String id = event.getNoteBlockMechanic().getItemID();
|
||||
String id = event.getMechanic().getItemID();
|
||||
Player player = event.getPlayer();
|
||||
Location location = event.getBlock().getLocation();
|
||||
|
||||
@@ -98,7 +98,7 @@ public class OraxenFrameHandler extends OraxenHandler {
|
||||
public void onBreakFurniture(OraxenFurnitureBreakEvent event) {
|
||||
if (event.isCancelled()) return;
|
||||
|
||||
String id = event.getFurnitureMechanic().getItemID();
|
||||
String id = event.getMechanic().getItemID();
|
||||
if (id == null) return;
|
||||
|
||||
Sprinkler sprinkler = SprinklerConfig.SPRINKLERS_3D.get(id);
|
||||
@@ -128,7 +128,11 @@ public class OraxenFrameHandler extends OraxenHandler {
|
||||
final ItemStack itemInHand = event.getItemInHand();
|
||||
final Block block = event.getBlock();
|
||||
|
||||
String blockID = event.getNoteBlockMechanic().getItemID();
|
||||
long time = System.currentTimeMillis();
|
||||
if (time - (coolDown.getOrDefault(player, time - 50)) < 50) return;
|
||||
coolDown.put(player, time);
|
||||
|
||||
String blockID = event.getMechanic().getItemID();
|
||||
if (blockID.equals(BasicItemConfig.dryPot) || blockID.equals(BasicItemConfig.wetPot)) {
|
||||
|
||||
Location seedLoc = block.getLocation().clone().add(0,1,0);
|
||||
@@ -158,7 +162,7 @@ public class OraxenFrameHandler extends OraxenHandler {
|
||||
public void onInteractFurniture(OraxenFurnitureInteractEvent event) {
|
||||
if (event.isCancelled()) return;
|
||||
|
||||
String id = event.getFurnitureMechanic().getItemID();
|
||||
String id = event.getMechanic().getItemID();
|
||||
if (id == null) return;
|
||||
|
||||
final Player player = event.getPlayer();
|
||||
|
||||
@@ -19,15 +19,12 @@ package net.momirealms.customcrops.integrations.customplugin.oraxen;
|
||||
|
||||
import de.tr7zw.changeme.nbtapi.NBTCompound;
|
||||
import de.tr7zw.changeme.nbtapi.NBTItem;
|
||||
import io.th0rgal.oraxen.events.*;
|
||||
import io.th0rgal.oraxen.items.OraxenItems;
|
||||
import io.th0rgal.oraxen.api.OraxenItems;
|
||||
import io.th0rgal.oraxen.api.events.*;
|
||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.furniture.FurnitureMechanic;
|
||||
import net.momirealms.customcrops.CustomCrops;
|
||||
import net.momirealms.customcrops.api.crop.Crop;
|
||||
import net.momirealms.customcrops.api.event.SeedPlantEvent;
|
||||
import net.momirealms.customcrops.api.event.WaterPotEvent;
|
||||
import net.momirealms.customcrops.api.utils.CCSeason;
|
||||
import net.momirealms.customcrops.api.utils.SeasonUtils;
|
||||
import net.momirealms.customcrops.config.*;
|
||||
import net.momirealms.customcrops.integrations.customplugin.HandlerP;
|
||||
import net.momirealms.customcrops.integrations.customplugin.oraxen.listeners.OraxenBlockListener;
|
||||
@@ -35,19 +32,13 @@ import net.momirealms.customcrops.integrations.customplugin.oraxen.listeners.Ora
|
||||
import net.momirealms.customcrops.managers.CropManager;
|
||||
import net.momirealms.customcrops.managers.CustomWorld;
|
||||
import net.momirealms.customcrops.objects.WaterCan;
|
||||
import net.momirealms.customcrops.objects.requirements.PlantingCondition;
|
||||
import net.momirealms.customcrops.objects.requirements.RequirementInterface;
|
||||
import net.momirealms.customcrops.utils.AdventureUtil;
|
||||
import net.momirealms.customcrops.utils.FurnitureUtil;
|
||||
import net.momirealms.customcrops.utils.LimitationUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.block.Action;
|
||||
@@ -84,7 +75,7 @@ public abstract class OraxenHandler extends HandlerP {
|
||||
//scarecrow place
|
||||
public void placeScarecrow(OraxenFurniturePlaceEvent event) {
|
||||
if (!MainConfig.enableCrow) return;
|
||||
FurnitureMechanic mechanic = event.getFurnitureMechanic();
|
||||
FurnitureMechanic mechanic = event.getMechanic();
|
||||
String id = mechanic.getItemID();
|
||||
if (!id.equals(BasicItemConfig.scarecrow)) return;
|
||||
Location location = event.getItemFrame().getLocation();
|
||||
|
||||
@@ -18,29 +18,28 @@
|
||||
package net.momirealms.customcrops.integrations.customplugin.oraxen;
|
||||
|
||||
import io.th0rgal.oraxen.OraxenPlugin;
|
||||
import io.th0rgal.oraxen.api.OraxenBlocks;
|
||||
import io.th0rgal.oraxen.api.OraxenItems;
|
||||
import io.th0rgal.oraxen.items.ItemBuilder;
|
||||
import io.th0rgal.oraxen.items.OraxenItems;
|
||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.furniture.FurnitureFactory;
|
||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.furniture.FurnitureMechanic;
|
||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.noteblock.NoteBlockMechanic;
|
||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.noteblock.NoteBlockMechanicFactory;
|
||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.noteblock.NoteBlockMechanicListener;
|
||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.stringblock.StringBlockMechanic;
|
||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.stringblock.StringBlockMechanicFactory;
|
||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.stringblock.StringBlockMechanicListener;
|
||||
import net.momirealms.customcrops.integrations.customplugin.CustomInterface;
|
||||
import net.momirealms.customcrops.utils.FurnitureUtil;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.Rotation;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.persistence.PersistentDataContainer;
|
||||
import org.bukkit.persistence.PersistentDataType;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import static io.th0rgal.oraxen.mechanics.provided.gameplay.furniture.FurnitureMechanic.FURNITURE_KEY;
|
||||
|
||||
public class OraxenHook implements CustomInterface {
|
||||
|
||||
public static NamespacedKey FURNITURE = new NamespacedKey(OraxenPlugin.get(), "furniture");
|
||||
@@ -65,12 +64,12 @@ public class OraxenHook implements CustomInterface {
|
||||
public String getBlockID(Location location) {
|
||||
Block block = location.getBlock();
|
||||
if (block.getType() == Material.TRIPWIRE) {
|
||||
StringBlockMechanic mechanic = StringBlockMechanicListener.getStringMechanic(block);
|
||||
StringBlockMechanic mechanic = OraxenBlocks.getStringMechanic(block);
|
||||
if (mechanic == null) return null;
|
||||
else return mechanic.getItemID();
|
||||
}
|
||||
else if (block.getType() == Material.NOTE_BLOCK) {
|
||||
NoteBlockMechanic mechanic = NoteBlockMechanicListener.getNoteBlockMechanic(block);
|
||||
NoteBlockMechanic mechanic = OraxenBlocks.getNoteBlockMechanic(block);
|
||||
if (mechanic == null) return null;
|
||||
else return mechanic.getItemID();
|
||||
}
|
||||
@@ -94,18 +93,8 @@ public class OraxenHook implements CustomInterface {
|
||||
@Override
|
||||
@Nullable
|
||||
public ItemFrame placeFurniture(Location location, String id) {
|
||||
ItemBuilder itemBuilder = OraxenItems.getItemById(id);
|
||||
if (itemBuilder == null) return null;
|
||||
return location.getWorld().spawn(location, ItemFrame.class, (ItemFrame frame) -> {
|
||||
frame.setVisible(false);
|
||||
frame.setFixed(false);
|
||||
frame.setPersistent(true);
|
||||
frame.setItemDropChance(0);
|
||||
frame.setItem(itemBuilder.build(), false);
|
||||
frame.setFacingDirection(BlockFace.UP, true);
|
||||
PersistentDataContainer pdc = frame.getPersistentDataContainer();
|
||||
pdc.set(FURNITURE_KEY, PersistentDataType.STRING, id);
|
||||
});
|
||||
FurnitureMechanic mechanic = (FurnitureMechanic) FurnitureFactory.getInstance().getMechanic(id);
|
||||
return mechanic.place(Rotation.NONE, 0, BlockFace.UP, location, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
package net.momirealms.customcrops.integrations.customplugin.oraxen;
|
||||
|
||||
import io.th0rgal.oraxen.events.*;
|
||||
import io.th0rgal.oraxen.items.OraxenItems;
|
||||
import io.th0rgal.oraxen.api.OraxenItems;
|
||||
import io.th0rgal.oraxen.api.events.*;
|
||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.furniture.FurnitureMechanic;
|
||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.stringblock.StringBlockMechanic;
|
||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.stringblock.StringBlockMechanicFactory;
|
||||
@@ -49,50 +49,14 @@ public class OraxenWireHandler extends OraxenHandler{
|
||||
|
||||
@Override
|
||||
public void onBreakNoteBlock(OraxenNoteBlockBreakEvent event) {
|
||||
if (event.isCancelled()) return;
|
||||
|
||||
// not necessary because string break event would be triggered too
|
||||
|
||||
// String id = event.getNoteBlockMechanic().getItemID();
|
||||
// if (id.equals(BasicItemConfig.dryPot) || id.equals(BasicItemConfig.wetPot)) {
|
||||
//
|
||||
// Location location = event.getBlock().getLocation();
|
||||
// Player player = event.getPlayer();
|
||||
//
|
||||
// if (!AntiGrief.testBreak(player, location)) {
|
||||
// event.setCancelled(true);
|
||||
// return;
|
||||
// }
|
||||
// super.onBreakPot(location);
|
||||
//
|
||||
// Location seedLocation = location.clone().add(0,1,0);
|
||||
// StringBlockMechanic mechanic = StringBlockMechanicListener.getStringMechanic(seedLocation.getBlock());
|
||||
// if (mechanic == null) return;
|
||||
// String seedID = mechanic.getItemID();
|
||||
//
|
||||
// if (seedID.contains("_stage_")) {
|
||||
|
||||
// seedLocation.getBlock().setType(Material.AIR);
|
||||
// if (seedID.equals(BasicItemConfig.deadCrop)) return;
|
||||
//ripe or not
|
||||
// if (hasNextStage(seedID)) {
|
||||
// Drop drop = mechanic.getDrop();
|
||||
// if (drop != null && player.getGameMode() != GameMode.CREATIVE) {
|
||||
// drop.spawns(location, new ItemStack(Material.AIR));
|
||||
// }
|
||||
// super.onBreakUnripeCrop(location);
|
||||
// return;
|
||||
// }
|
||||
// super.onBreakRipeCrop(seedLocation, seedID, player, false, false);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBreakStringBlock(OraxenStringBlockBreakEvent event) {
|
||||
if (event.isCancelled()) return;
|
||||
|
||||
StringBlockMechanic mechanic = event.getStringBlockMechanic();
|
||||
StringBlockMechanic mechanic = event.getMechanic();
|
||||
String id = mechanic.getItemID();
|
||||
|
||||
final Player player = event.getPlayer();
|
||||
@@ -134,7 +98,7 @@ public class OraxenWireHandler extends OraxenHandler{
|
||||
public void onBreakFurniture(OraxenFurnitureBreakEvent event) {
|
||||
if (event.isCancelled()) return;
|
||||
|
||||
FurnitureMechanic mechanic = event.getFurnitureMechanic();
|
||||
FurnitureMechanic mechanic = event.getMechanic();
|
||||
if (mechanic == null) return;
|
||||
String id = mechanic.getItemID();
|
||||
Sprinkler sprinkler = SprinklerConfig.SPRINKLERS_3D.get(id);
|
||||
@@ -157,7 +121,7 @@ public class OraxenWireHandler extends OraxenHandler{
|
||||
if (!AntiGrief.testPlace(player, blockLoc)) return;
|
||||
if (!canProceedAction(player, blockLoc)) return;
|
||||
|
||||
FurnitureMechanic mechanic = event.getFurnitureMechanic();
|
||||
FurnitureMechanic mechanic = event.getMechanic();
|
||||
if (mechanic == null) return;
|
||||
String id = mechanic.getItemID();
|
||||
Sprinkler sprinkler = SprinklerConfig.SPRINKLERS_3D.get(id);
|
||||
@@ -174,6 +138,10 @@ public class OraxenWireHandler extends OraxenHandler{
|
||||
Location potLoc = event.getBlock().getLocation();
|
||||
Player player = event.getPlayer();
|
||||
|
||||
long time = System.currentTimeMillis();
|
||||
if (time - (coolDown.getOrDefault(player, time - 50)) < 50) return;
|
||||
coolDown.put(player, time);
|
||||
|
||||
if (!AntiGrief.testPlace(player, potLoc)) return;
|
||||
if (super.tryMisc(event.getPlayer(), itemInHand, potLoc)) return;
|
||||
if (event.getBlockFace() != BlockFace.UP) return;
|
||||
@@ -205,7 +173,7 @@ public class OraxenWireHandler extends OraxenHandler{
|
||||
coolDown.put(player, time);
|
||||
|
||||
final Block block = event.getBlock();
|
||||
final String id = event.getStringBlockMechanic().getItemID();
|
||||
final String id = event.getMechanic().getItemID();
|
||||
|
||||
if (id.contains("_stage_")) {
|
||||
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
|
||||
package net.momirealms.customcrops.integrations.customplugin.oraxen.listeners;
|
||||
|
||||
import io.th0rgal.oraxen.events.OraxenNoteBlockBreakEvent;
|
||||
import io.th0rgal.oraxen.events.OraxenNoteBlockInteractEvent;
|
||||
import io.th0rgal.oraxen.events.OraxenStringBlockBreakEvent;
|
||||
import io.th0rgal.oraxen.events.OraxenStringBlockInteractEvent;
|
||||
import io.th0rgal.oraxen.api.events.OraxenNoteBlockBreakEvent;
|
||||
import io.th0rgal.oraxen.api.events.OraxenNoteBlockInteractEvent;
|
||||
import io.th0rgal.oraxen.api.events.OraxenStringBlockBreakEvent;
|
||||
import io.th0rgal.oraxen.api.events.OraxenStringBlockInteractEvent;
|
||||
import net.momirealms.customcrops.integrations.customplugin.oraxen.OraxenHandler;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
|
||||
package net.momirealms.customcrops.integrations.customplugin.oraxen.listeners;
|
||||
|
||||
import io.th0rgal.oraxen.events.OraxenFurnitureBreakEvent;
|
||||
import io.th0rgal.oraxen.events.OraxenFurnitureInteractEvent;
|
||||
import io.th0rgal.oraxen.events.OraxenFurniturePlaceEvent;
|
||||
import io.th0rgal.oraxen.api.events.OraxenFurnitureBreakEvent;
|
||||
import io.th0rgal.oraxen.api.events.OraxenFurnitureInteractEvent;
|
||||
import io.th0rgal.oraxen.api.events.OraxenFurniturePlaceEvent;
|
||||
import net.momirealms.customcrops.integrations.customplugin.oraxen.OraxenHandler;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ResidenceHook implements AntiGrief {
|
||||
@Override
|
||||
public boolean canBreak(Location location, Player player) {
|
||||
ClaimedResidence res = com.bekvon.bukkit.residence.Residence.getInstance().getResidenceManager().getByLoc(location);
|
||||
if(res!=null){
|
||||
if (res != null) {
|
||||
ResidencePermissions perms = res.getPermissions();
|
||||
return perms.playerHas(player, Flags.destroy, true);
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public class ResidenceHook implements AntiGrief {
|
||||
@Override
|
||||
public boolean canPlace(Location location, Player player) {
|
||||
ClaimedResidence res = com.bekvon.bukkit.residence.Residence.getInstance().getResidenceManager().getByLoc(location);
|
||||
if(res!=null){
|
||||
if (res != null) {
|
||||
ResidencePermissions perms = res.getPermissions();
|
||||
return perms.playerHas(player, Flags.build, true);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ public class WorldGuardHook implements AntiGrief {
|
||||
|
||||
@Override
|
||||
public boolean canPlace(Location location, Player player) {
|
||||
if (player.isOp()) return true;
|
||||
LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(player);
|
||||
World world = BukkitAdapter.adapt(location.getWorld());
|
||||
WorldGuardPlatform platform = com.sk89q.worldguard.WorldGuard.getInstance().getPlatform();
|
||||
@@ -48,7 +47,6 @@ public class WorldGuardHook implements AntiGrief {
|
||||
|
||||
@Override
|
||||
public boolean canBreak(Location location, Player player) {
|
||||
if (player.isOp()) return true;
|
||||
LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(player);
|
||||
World world = BukkitAdapter.adapt(location.getWorld());
|
||||
WorldGuardPlatform platform = com.sk89q.worldguard.WorldGuard.getInstance().getPlatform();
|
||||
|
||||
Reference in New Issue
Block a user