mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-12 04:23:54 +00:00
Merge branch 'logging' into main
This commit is contained in:
@ -68,7 +68,7 @@ public class FaweBukkit implements IFawe, Listener {
|
||||
try {
|
||||
new BrushListener(plugin);
|
||||
} catch (Throwable e) {
|
||||
log.debug("Brush Listener Failed", e);
|
||||
log.error("Brush Listener Failed", e);
|
||||
}
|
||||
if (PaperLib.isPaper() && Settings.IMP.EXPERIMENTAL.DYNAMIC_CHUNK_RENDERING > 1) {
|
||||
new RenderListener(plugin);
|
||||
@ -146,10 +146,6 @@ public class FaweBukkit implements IFawe, Listener {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public void debug(final String message) {
|
||||
Bukkit.getConsoleSender().sendMessage(message);
|
||||
}
|
||||
|
||||
@Override public File getDirectory() {
|
||||
return plugin.getDataFolder();
|
||||
}
|
||||
@ -162,7 +158,7 @@ public class FaweBukkit implements IFawe, Listener {
|
||||
this.itemUtil = tmp = new ItemUtil();
|
||||
} catch (Throwable e) {
|
||||
Settings.IMP.EXPERIMENTAL.PERSISTENT_BRUSHES = false;
|
||||
log.debug("Persistent Brushes Failed", e);
|
||||
log.error("Persistent Brushes Failed", e);
|
||||
}
|
||||
}
|
||||
return tmp;
|
||||
|
@ -14,10 +14,13 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
|
||||
public class GriefPreventionFeature extends BukkitMaskManager implements Listener {
|
||||
|
||||
public GriefPreventionFeature(final Plugin griefpreventionPlugin) {
|
||||
super(griefpreventionPlugin.getName());
|
||||
getLogger(GriefPreventionFeature.class).debug("Plugin 'GriefPrevention' found. Using it now.");
|
||||
}
|
||||
|
||||
public boolean isAllowed(Player player, Claim claim, MaskType type) {
|
||||
|
@ -12,6 +12,8 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
|
||||
public class ResidenceFeature extends BukkitMaskManager implements Listener {
|
||||
private FaweBukkit plugin;
|
||||
private Plugin residence;
|
||||
@ -20,7 +22,7 @@ public class ResidenceFeature extends BukkitMaskManager implements Listener {
|
||||
super(residencePlugin.getName());
|
||||
this.residence = residencePlugin;
|
||||
this.plugin = p3;
|
||||
|
||||
getLogger(ResidenceFeature.class).debug("Plugin 'Residence' found. Using it now.");
|
||||
}
|
||||
|
||||
public boolean isAllowed(Player player, ClaimedResidence residence, MaskType type) {
|
||||
|
@ -18,6 +18,8 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
|
||||
public class TownyFeature extends BukkitMaskManager implements Listener {
|
||||
|
||||
private final Plugin towny;
|
||||
@ -25,6 +27,8 @@ public class TownyFeature extends BukkitMaskManager implements Listener {
|
||||
public TownyFeature(Plugin townyPlugin) {
|
||||
super(townyPlugin.getName());
|
||||
this.towny = townyPlugin;
|
||||
getLogger(TownyFeature.class).debug("Plugin 'Towny' found. Using it now.");
|
||||
|
||||
}
|
||||
|
||||
public boolean isAllowed(Player player, TownBlock block) {
|
||||
|
@ -26,11 +26,15 @@ import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
|
||||
public class Worldguard extends BukkitMaskManager implements Listener {
|
||||
private final WorldGuardPlugin worldguard;
|
||||
private static final Logger logger = getLogger(Worldguard.class);
|
||||
|
||||
private WorldGuardPlugin getWorldGuard() {
|
||||
final Plugin plugin = Bukkit.getPluginManager().getPlugin("WorldGuard");
|
||||
@ -46,17 +50,19 @@ public class Worldguard extends BukkitMaskManager implements Listener {
|
||||
public Worldguard(Plugin p2) {
|
||||
super(p2.getName());
|
||||
this.worldguard = this.getWorldGuard();
|
||||
logger.debug("Plugin 'WorldGuard' found. Using it now.");
|
||||
|
||||
}
|
||||
|
||||
public ProtectedRegion getRegion(LocalPlayer player, Location location) {
|
||||
RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
|
||||
if (container == null) {
|
||||
System.out.println("Region capability is not enabled for WorldGuard.");
|
||||
logger.info("Region capability is not enabled for WorldGuard.");
|
||||
return null;
|
||||
}
|
||||
RegionManager manager = container.get(BukkitAdapter.adapt(location.getWorld()));
|
||||
if (manager == null) {
|
||||
System.out.println("Region capability is not enabled for that world.");
|
||||
logger.info("Region capability is not enabled for that world.");
|
||||
return null;
|
||||
}
|
||||
final ProtectedRegion global = manager.getRegion("__global__");
|
||||
|
@ -114,6 +114,7 @@ import java.util.stream.Stream;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
|
||||
public final class FAWE_Spigot_v1_15_R2 extends CachedBukkitAdapter implements IDelegateBukkitImplAdapter<NBTBase> {
|
||||
private final Spigot_v1_15_R2 parent;
|
||||
@ -339,7 +340,9 @@ public final class FAWE_Spigot_v1_15_R2 extends CachedBukkitAdapter implements I
|
||||
init();
|
||||
return adaptToChar(ibd);
|
||||
} catch (ArrayIndexOutOfBoundsException e1) {
|
||||
Fawe.debug("Attempted to convert " + ibd.getBlock() + " with ID " + Block.REGISTRY_ID.getId(ibd) + " to char. ibdToStateOrdinal length: " + ibdToStateOrdinal.length + ". Defaulting to air!");
|
||||
getLogger(FAWE_Spigot_v1_15_R2.class)
|
||||
.error("Attempted to convert {} with ID {} to char. ibdToStateOrdinal length: {}. Defaulting to air!",
|
||||
ibd.getBlock(), Block.REGISTRY_ID.getId(ibd), ibdToStateOrdinal.length, e1);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -19,13 +19,17 @@
|
||||
|
||||
package com.sk89q.worldedit.bukkit.adapter.impl;
|
||||
|
||||
import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.FaweCache;
|
||||
import com.boydti.fawe.beta.IChunkGet;
|
||||
import com.boydti.fawe.beta.implementation.packet.ChunkPacket;
|
||||
import com.boydti.fawe.bukkit.adapter.mc1_16_1.*;
|
||||
import com.boydti.fawe.bukkit.adapter.mc1_16_1.BlockMaterial_1_16_1;
|
||||
import com.boydti.fawe.bukkit.adapter.mc1_16_1.BukkitAdapter_1_16_1;
|
||||
import com.boydti.fawe.bukkit.adapter.mc1_16_1.BukkitGetBlocks_1_16_1;
|
||||
import com.boydti.fawe.bukkit.adapter.mc1_16_1.FAWEWorldNativeAccess_1_16;
|
||||
import com.boydti.fawe.bukkit.adapter.mc1_16_1.MapChunkUtil_1_16_1;
|
||||
import com.boydti.fawe.bukkit.adapter.mc1_16_1.nbt.LazyCompoundTag_1_16_1;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.jnbt.StringTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.blocks.BaseItemStack;
|
||||
@ -42,11 +46,35 @@ import com.sk89q.worldedit.registry.state.Property;
|
||||
import com.sk89q.worldedit.util.SideEffect;
|
||||
import com.sk89q.worldedit.util.SideEffectSet;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.*;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.world.block.BlockTypesCache;
|
||||
import com.sk89q.worldedit.world.entity.EntityType;
|
||||
import com.sk89q.worldedit.world.registry.BlockMaterial;
|
||||
import net.minecraft.server.v1_16_R1.*;
|
||||
import net.minecraft.server.v1_16_R1.BiomeBase;
|
||||
import net.minecraft.server.v1_16_R1.Block;
|
||||
import net.minecraft.server.v1_16_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_16_R1.Chunk;
|
||||
import net.minecraft.server.v1_16_R1.ChunkCoordIntPair;
|
||||
import net.minecraft.server.v1_16_R1.ChunkSection;
|
||||
import net.minecraft.server.v1_16_R1.Entity;
|
||||
import net.minecraft.server.v1_16_R1.EntityPlayer;
|
||||
import net.minecraft.server.v1_16_R1.EntityTypes;
|
||||
import net.minecraft.server.v1_16_R1.IBlockData;
|
||||
import net.minecraft.server.v1_16_R1.IRegistry;
|
||||
import net.minecraft.server.v1_16_R1.ItemStack;
|
||||
import net.minecraft.server.v1_16_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_16_R1.NBTBase;
|
||||
import net.minecraft.server.v1_16_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_16_R1.NBTTagInt;
|
||||
import net.minecraft.server.v1_16_R1.PacketPlayOutMapChunk;
|
||||
import net.minecraft.server.v1_16_R1.PlayerChunk;
|
||||
import net.minecraft.server.v1_16_R1.TileEntity;
|
||||
import net.minecraft.server.v1_16_R1.World;
|
||||
import net.minecraft.server.v1_16_R1.WorldServer;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
@ -59,16 +87,16 @@ import org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_16_R1.inventory.CraftItemStack;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Map;
|
||||
import java.util.OptionalInt;
|
||||
import java.util.Set;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Stream;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import com.sk89q.jnbt.StringTag;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
|
||||
public final class FAWE_Spigot_v1_16_R1 extends CachedBukkitAdapter implements IDelegateBukkitImplAdapter<NBTBase> {
|
||||
private final Spigot_v1_16_R1 parent;
|
||||
@ -294,7 +322,9 @@ public final class FAWE_Spigot_v1_16_R1 extends CachedBukkitAdapter implements I
|
||||
init();
|
||||
return adaptToChar(ibd);
|
||||
} catch (ArrayIndexOutOfBoundsException e1) {
|
||||
Fawe.debug("Attempted to convert " + ibd.getBlock() + " with ID " + Block.REGISTRY_ID.getId(ibd) + " to char. ibdToStateOrdinal length: " + ibdToStateOrdinal.length + ". Defaulting to air!");
|
||||
getLogger(FAWE_Spigot_v1_16_R1.class)
|
||||
.error("Attempted to convert {} with ID {} to char. ibdToStateOrdinal length: {}. Defaulting to air!",
|
||||
ibd.getBlock(), Block.REGISTRY_ID.getId(ibd), ibdToStateOrdinal.length, e1);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
package com.sk89q.worldedit.bukkit.adapter.impl;
|
||||
|
||||
import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.FaweCache;
|
||||
import com.boydti.fawe.beta.IChunkGet;
|
||||
import com.boydti.fawe.beta.implementation.packet.ChunkPacket;
|
||||
@ -98,6 +97,7 @@ import java.util.stream.Stream;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
|
||||
public final class FAWE_Spigot_v1_16_R2 extends CachedBukkitAdapter implements IDelegateBukkitImplAdapter<NBTBase> {
|
||||
private final Spigot_v1_16_R2 parent;
|
||||
@ -321,7 +321,9 @@ public final class FAWE_Spigot_v1_16_R2 extends CachedBukkitAdapter implements I
|
||||
init();
|
||||
return adaptToChar(ibd);
|
||||
} catch (ArrayIndexOutOfBoundsException e1) {
|
||||
Fawe.debug("Attempted to convert " + ibd.getBlock() + " with ID " + Block.REGISTRY_ID.getId(ibd) + " to char. ibdToStateOrdinal length: " + ibdToStateOrdinal.length + ". Defaulting to air!");
|
||||
getLogger(FAWE_Spigot_v1_16_R2.class)
|
||||
.error("Attempted to convert {} with ID {} to char. ibdToStateOrdinal length: {}. Defaulting to air!",
|
||||
ibd.getBlock(), Block.REGISTRY_ID.getId(ibd), ibdToStateOrdinal.length, e1);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user