Merge branch 'merge' into 1.15

This commit is contained in:
NotMyFault
2019-12-19 19:05:27 +01:00
36 changed files with 323 additions and 196 deletions

View File

@ -12,7 +12,7 @@ import com.boydti.fawe.bukkit.listener.CFIPacketListener;
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.FactionsFeature;
import com.boydti.fawe.bukkit.regions.ASkyBlockHook;
import com.boydti.fawe.bukkit.regions.FactionsUUIDFeature;
import com.boydti.fawe.bukkit.regions.FreeBuildRegion;
import com.boydti.fawe.bukkit.regions.GriefPreventionFeature;
@ -268,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");

View File

@ -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;

View File

@ -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;

View File

@ -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;
}
}