mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-28 03:34:42 +02:00
Merge branch 'v6' into build/v6/annotations
This commit is contained in:
@ -46,7 +46,7 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
|
||||
public class SingleWorldListener implements Listener {
|
||||
|
||||
private final Method methodGetHandleChunk;
|
||||
private Field shouldSave;
|
||||
private Field shouldSave = null;
|
||||
|
||||
public SingleWorldListener() throws Exception {
|
||||
ReflectionUtils.RefClass classCraftChunk = getRefClass("{cb}.CraftChunk");
|
||||
@ -59,9 +59,12 @@ public class SingleWorldListener implements Listener {
|
||||
} else {
|
||||
this.shouldSave = classChunk.getField("s").getRealField();
|
||||
}
|
||||
} else {
|
||||
} else if (PlotSquared.platform().serverVersion()[1] == 17) {
|
||||
ReflectionUtils.RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.Chunk");
|
||||
this.shouldSave = classChunk.getField("r").getRealField();
|
||||
} else if (PlotSquared.platform().serverVersion()[1] == 18) {
|
||||
ReflectionUtils.RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.IChunkAccess");
|
||||
this.shouldSave = classChunk.getField("b").getRealField();
|
||||
}
|
||||
} catch (NoSuchFieldException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -347,13 +347,15 @@ public class BukkitUtil extends WorldUtil {
|
||||
final Block block = world.getBlockAt(location.getX(), location.getY(), location.getZ());
|
||||
final Material type = block.getType();
|
||||
if (type != Material.LEGACY_SIGN && type != Material.LEGACY_WALL_SIGN) {
|
||||
BlockFace facing = BlockFace.EAST;
|
||||
if (world.getBlockAt(location.getX(), location.getY(), location.getZ() + 1).getType().isSolid()) {
|
||||
facing = BlockFace.NORTH;
|
||||
} else if (world.getBlockAt(location.getX() + 1, location.getY(), location.getZ()).getType().isSolid()) {
|
||||
facing = BlockFace.WEST;
|
||||
} else if (world.getBlockAt(location.getX(), location.getY(), location.getZ() - 1).getType().isSolid()) {
|
||||
facing = BlockFace.SOUTH;
|
||||
BlockFace facing = BlockFace.NORTH;
|
||||
if (!world.getBlockAt(location.getX(), location.getY(), location.getZ() + 1).getType().isSolid()) {
|
||||
if (world.getBlockAt(location.getX() - 1, location.getY(), location.getZ()).getType().isSolid()) {
|
||||
facing = BlockFace.EAST;
|
||||
} else if (world.getBlockAt(location.getX() + 1, location.getY(), location.getZ()).getType().isSolid()) {
|
||||
facing = BlockFace.WEST;
|
||||
} else if (world.getBlockAt(location.getX(), location.getY(), location.getZ() - 1).getType().isSolid()) {
|
||||
facing = BlockFace.SOUTH;
|
||||
}
|
||||
}
|
||||
if (PlotSquared.platform().serverVersion()[1] == 13) {
|
||||
block.setType(Material.valueOf(area.legacySignMaterial()), false);
|
||||
|
@ -67,7 +67,7 @@ public class FaweSchematicHandler extends SchematicHandler {
|
||||
final PlotPlayer<?> actor,
|
||||
final RunnableVal<Boolean> whenDone
|
||||
) {
|
||||
delegate.paste(schematic, plot, xOffset, yOffset, zOffset, autoHeight, whenDone);
|
||||
delegate.paste(schematic, plot, xOffset, yOffset, zOffset, autoHeight, actor, whenDone);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user