mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Various minor
refactor some region dependencies swithc masking extent to a filter (so it can be parallelized) Some unfinished refactoring of the filters remove piston messages from strings.json
This commit is contained in:
@ -13,7 +13,6 @@ import com.boydti.fawe.bukkit.listener.ChunkListener_8;
|
||||
import com.boydti.fawe.bukkit.listener.ChunkListener_9;
|
||||
import com.boydti.fawe.bukkit.listener.RenderListener;
|
||||
import com.boydti.fawe.bukkit.regions.ASkyBlockHook;
|
||||
import com.boydti.fawe.bukkit.regions.FactionsFeature;
|
||||
import com.boydti.fawe.bukkit.regions.FactionsUUIDFeature;
|
||||
import com.boydti.fawe.bukkit.regions.FreeBuildRegion;
|
||||
import com.boydti.fawe.bukkit.regions.GriefPreventionFeature;
|
||||
@ -269,14 +268,9 @@ public class FaweBukkit implements IFawe, Listener {
|
||||
final Plugin factionsPlugin = Bukkit.getServer().getPluginManager().getPlugin("Factions");
|
||||
if (factionsPlugin != null && factionsPlugin.isEnabled()) {
|
||||
try {
|
||||
managers.add(new FactionsFeature(factionsPlugin));
|
||||
log.debug("Attempting to use plugin 'Factions'");
|
||||
} catch (Throwable e) {
|
||||
try {
|
||||
managers.add(new FactionsUUIDFeature(factionsPlugin, this));
|
||||
log.debug("Attempting to use plugin 'FactionsUUID'");
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
managers.add(new FactionsUUIDFeature(factionsPlugin, this));
|
||||
log.debug("Attempting to use plugin 'FactionsUUID'");
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
}
|
||||
final Plugin residencePlugin = Bukkit.getServer().getPluginManager().getPlugin("Residence");
|
||||
|
@ -94,7 +94,7 @@ public class BukkitGetBlocks_1_13 extends CharGetBlocks {
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag getTag(int x, int y, int z) {
|
||||
public CompoundTag getTile(int x, int y, int z) {
|
||||
TileEntity tileEntity = getChunk().getTileEntity(new BlockPosition((x & 15) + (X << 4), y, (z & 15) + (Z << 4)));
|
||||
if (tileEntity == null) {
|
||||
return null;
|
||||
|
@ -101,7 +101,7 @@ public class BukkitGetBlocks_1_14 extends CharGetBlocks {
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag getTag(int x, int y, int z) {
|
||||
public CompoundTag getTile(int x, int y, int z) {
|
||||
TileEntity tileEntity = getChunk().getTileEntity(new BlockPosition((x & 15) + (X << 4), y, (z & 15) + (Z << 4)));
|
||||
if (tileEntity == null) {
|
||||
return null;
|
||||
|
@ -1,49 +0,0 @@
|
||||
package com.boydti.fawe.bukkit.regions;
|
||||
|
||||
import com.boydti.fawe.regions.FaweMask;
|
||||
import com.massivecraft.factions.entity.BoardColl;
|
||||
import com.massivecraft.factions.entity.Faction;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.ps.PS;
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class FactionsFeature extends BukkitMaskManager implements Listener {
|
||||
|
||||
public FactionsFeature(final Plugin factionsPlugin) {
|
||||
super(factionsPlugin.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public FaweMask getMask(final com.sk89q.worldedit.entity.Player p, MaskType type) {
|
||||
final Player player = BukkitAdapter.adapt(p);
|
||||
final Location loc = player.getLocation();
|
||||
final PS ps = PS.valueOf(loc);
|
||||
final Faction fac = BoardColl.get().getFactionAt(ps);
|
||||
if (fac != null) {
|
||||
if (type == MaskType.OWNER) {
|
||||
MPlayer leader = fac.getLeader();
|
||||
if (leader != null && p.getUniqueId().equals(leader.getUuid())) {
|
||||
final Chunk chunk = loc.getChunk();
|
||||
final BlockVector3 pos1 = BlockVector3.at(chunk.getX() * 16, 0, chunk.getZ() * 16);
|
||||
final BlockVector3 pos2 = BlockVector3
|
||||
.at((chunk.getX() * 16) + 15, 156, (chunk.getZ() * 16) + 15);
|
||||
return new FaweMask(pos1, pos2);
|
||||
}
|
||||
} else if (fac.getOnlinePlayers().contains(player)) {
|
||||
if (!fac.getComparisonName().equals("wilderness")) {
|
||||
final Chunk chunk = loc.getChunk();
|
||||
final BlockVector3 pos1 = BlockVector3.at(chunk.getX() * 16, 0, chunk.getZ() * 16);
|
||||
final BlockVector3 pos2 = BlockVector3.at((chunk.getX() * 16) + 15, 156, (chunk.getZ() * 16) + 15);
|
||||
return new FaweMask(pos1, pos2);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user