Compare commits

..

9 Commits

Author SHA1 Message Date
2633aa41a0 Fix wrong plot id calculation for negative coordinates 2022-12-28 19:40:54 +01:00
742d78a505 Add 1.19.3 to the issue template 2022-12-23 13:41:58 +01:00
120bf37196 Fix dispensers loading Legacy Material Support (#3894)
Fixes https://github.com/IntellectualSites/PlotSquared/issues/3883
2022-12-23 09:08:38 +00:00
2a40a6b35e Update dependency com.intellectualsites.bom:bom-1.18.x to v1.21 (#3890)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-13 22:45:51 +01:00
ea1f35b45a Update dependency cloud.commandframework:cloud-services to v1.8.0 (#3891)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-13 22:44:29 +01:00
15e63378a7 Update worldedit to v7.2.13 (#3889)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-11 08:39:32 +01:00
f3bc504a6f refactor: adjust specific Nullable annotations used (#3869) 2022-12-02 12:39:38 +00:00
3a8fae47a0 Update dependency com.intellectualsites.bom:bom-1.18.x to v1.20 (#3882)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-28 15:23:44 +01:00
70cb1cd100 Back to snapshot for development 2022-11-28 11:18:56 +01:00
11 changed files with 35 additions and 62 deletions

View File

@ -27,6 +27,7 @@ body:
description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first. description: Which server version version you using? If your server version is not listed, it is not supported. Update to a supported version first.
multiple: false multiple: false
options: options:
- '1.19.3'
- '1.19.2' - '1.19.2'
- '1.19.1' - '1.19.1'
- '1.19' - '1.19'

View File

@ -33,7 +33,6 @@ import org.bukkit.Chunk;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.BlockPopulator;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.NotNull;
import java.util.Random; import java.util.Random;
@ -51,7 +50,7 @@ final class LegacyBlockStatePopulator extends BlockPopulator {
} }
@Override @Override
public void populate(@NotNull final World world, @NotNull final Random random, @NotNull final Chunk source) { public void populate(@NonNull final World world, @NonNull final Random random, @NonNull final Chunk source) {
int chunkMinX = source.getX() << 4; int chunkMinX = source.getX() << 4;
int chunkMinZ = source.getZ() << 4; int chunkMinZ = source.getZ() << 4;
PlotArea area = Location.at(world.getName(), chunkMinX, 0, chunkMinZ).getPlotArea(); PlotArea area = Location.at(world.getName(), chunkMinX, 0, chunkMinZ).getPlotArea();

View File

@ -71,6 +71,7 @@ import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.block.data.BlockData; import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.type.Dispenser;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Fireball; import org.bukkit.entity.Fireball;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -100,7 +101,6 @@ import org.bukkit.event.block.EntityBlockFormEvent;
import org.bukkit.event.block.LeavesDecayEvent; import org.bukkit.event.block.LeavesDecayEvent;
import org.bukkit.event.block.SpongeAbsorbEvent; import org.bukkit.event.block.SpongeAbsorbEvent;
import org.bukkit.event.world.StructureGrowEvent; import org.bukkit.event.world.StructureGrowEvent;
import org.bukkit.material.Directional;
import org.bukkit.projectiles.BlockProjectileSource; import org.bukkit.projectiles.BlockProjectileSource;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
@ -926,6 +926,9 @@ public class BlockEventListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockDispense(BlockDispenseEvent event) { public void onBlockDispense(BlockDispenseEvent event) {
if (!this.plotAreaManager.hasPlotArea(event.getBlock().getWorld().getName())) {
return;
}
Material type = event.getItem().getType(); Material type = event.getItem().getType();
switch (type.toString()) { switch (type.toString()) {
case "SHULKER_BOX", "WHITE_SHULKER_BOX", "ORANGE_SHULKER_BOX", "MAGENTA_SHULKER_BOX", "LIGHT_BLUE_SHULKER_BOX", case "SHULKER_BOX", "WHITE_SHULKER_BOX", "ORANGE_SHULKER_BOX", "MAGENTA_SHULKER_BOX", "LIGHT_BLUE_SHULKER_BOX",
@ -937,7 +940,7 @@ public class BlockEventListener implements Listener {
if (event.getBlock().getType() == Material.DROPPER) { if (event.getBlock().getType() == Material.DROPPER) {
return; return;
} }
BlockFace targetFace = ((Directional) event.getBlock().getState().getData()).getFacing(); BlockFace targetFace = ((Dispenser) event.getBlock().getBlockData()).getFacing();
Location location = BukkitUtil.adapt(event.getBlock().getRelative(targetFace).getLocation()); Location location = BukkitUtil.adapt(event.getBlock().getRelative(targetFace).getLocation());
if (location.isPlotRoad()) { if (location.isPlotRoad()) {
event.setCancelled(true); event.setCancelled(true);

View File

@ -36,8 +36,7 @@ import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeType;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.NotNull; import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.Nullable;
import java.util.Set; import java.util.Set;
@ -46,10 +45,7 @@ public class FaweRegionManager extends BukkitRegionManager {
private final FaweDelegateRegionManager delegate = new FaweDelegateRegionManager(); private final FaweDelegateRegionManager delegate = new FaweDelegateRegionManager();
@Inject @Inject
public FaweRegionManager( public FaweRegionManager(WorldUtil worldUtil, GlobalBlockQueue blockQueue, ProgressSubscriberFactory subscriberFactory) {
@NonNull WorldUtil worldUtil, @NonNull GlobalBlockQueue blockQueue, @NonNull
ProgressSubscriberFactory subscriberFactory
) {
super(worldUtil, blockQueue, subscriberFactory); super(worldUtil, blockQueue, subscriberFactory);
} }
@ -76,9 +72,9 @@ public class FaweRegionManager extends BukkitRegionManager {
@Override @Override
public boolean handleClear( public boolean handleClear(
@NotNull Plot plot, @NonNull Plot plot,
@Nullable Runnable whenDone, @Nullable Runnable whenDone,
@NotNull PlotManager manager, @NonNull PlotManager manager,
final @Nullable PlotPlayer<?> player final @Nullable PlotPlayer<?> player
) { ) {
if (!Settings.FAWE_Components.CLEAR || !(manager instanceof HybridPlotManager)) { if (!Settings.FAWE_Components.CLEAR || !(manager instanceof HybridPlotManager)) {

View File

@ -29,7 +29,7 @@ import com.plotsquared.core.util.SchematicHandler;
import com.plotsquared.core.util.WorldUtil; import com.plotsquared.core.util.WorldUtil;
import com.plotsquared.core.util.task.RunnableVal; import com.plotsquared.core.util.task.RunnableVal;
import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.CompoundTag;
import org.jetbrains.annotations.NotNull; import org.checkerframework.checker.nullness.qual.NonNull;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;
@ -40,7 +40,7 @@ public class FaweSchematicHandler extends SchematicHandler {
private final FaweDelegateSchematicHandler delegate = new FaweDelegateSchematicHandler(); private final FaweDelegateSchematicHandler delegate = new FaweDelegateSchematicHandler();
@Inject @Inject
public FaweSchematicHandler(@NotNull WorldUtil worldUtil, @NotNull ProgressSubscriberFactory subscriberFactory) { public FaweSchematicHandler(WorldUtil worldUtil, ProgressSubscriberFactory subscriberFactory) {
super(worldUtil, subscriberFactory); super(worldUtil, subscriberFactory);
} }
@ -75,7 +75,7 @@ public class FaweSchematicHandler extends SchematicHandler {
} }
@Override @Override
public Schematic getSchematic(@NotNull InputStream is) { public Schematic getSchematic(@NonNull InputStream is) {
return delegate.getSchematic(is); return delegate.getSchematic(is);
} }

View File

@ -21,16 +21,15 @@ package com.plotsquared.core.configuration.caption;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.ClickEvent;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.NotNull;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.Set; import java.util.Set;
final class ClickStripTransform implements ComponentTransform { final class ClickStripTransform implements ComponentTransform {
private final Set<ClickEvent.@NotNull Action> actionsToStrip; private final Set<ClickEvent.@NonNull Action> actionsToStrip;
public ClickStripTransform(final Set<ClickEvent.@NotNull Action> actionsToStrip) { public ClickStripTransform(final Set<ClickEvent.@NonNull Action> actionsToStrip) {
this.actionsToStrip = EnumSet.copyOf(actionsToStrip); this.actionsToStrip = EnumSet.copyOf(actionsToStrip);
} }

View File

@ -93,10 +93,10 @@ public class HybridPlotWorld extends ClassicPlotWorld {
@Inject @Inject
public HybridPlotWorld( public HybridPlotWorld(
@Assisted("world") final String worldName, @Assisted("world") final String worldName,
@Nullable @Assisted("id") final String id, @javax.annotation.Nullable @Assisted("id") final String id,
@Assisted final @NonNull IndependentPlotGenerator generator, @Assisted final @NonNull IndependentPlotGenerator generator,
@Nullable @Assisted("min") final PlotId min, @javax.annotation.Nullable @Assisted("min") final PlotId min,
@Nullable @Assisted("max") final PlotId max, @javax.annotation.Nullable @Assisted("max") final PlotId max,
@WorldConfig final @NonNull YamlConfiguration worldConfiguration, @WorldConfig final @NonNull YamlConfiguration worldConfiguration,
final @NonNull GlobalBlockQueue blockQueue final @NonNull GlobalBlockQueue blockQueue
) { ) {

View File

@ -114,26 +114,14 @@ public abstract class SquarePlotManager extends GridPlotManager {
end = pathWidthLower + squarePlotWorld.PLOT_WIDTH; end = pathWidthLower + squarePlotWorld.PLOT_WIDTH;
} }
int size = squarePlotWorld.PLOT_WIDTH + squarePlotWorld.ROAD_WIDTH; int size = squarePlotWorld.PLOT_WIDTH + squarePlotWorld.ROAD_WIDTH;
int idx; int dx = Math.floorDiv(x, size) + 1;
if (x < 0) { int rx = Math.floorMod(x, size);
idx = x / size; int dz = Math.floorDiv(z, size) + 1;
x = size + (x % size); int rz = Math.floorMod(z, size);
} else { if (rz <= pathWidthLower || rz > end || rx <= pathWidthLower || rx > end) {
idx = (x / size) + 1;
x = x % size;
}
int idz;
if (z < 0) {
idz = z / size;
z = size + (z % size);
} else {
idz = (z / size) + 1;
z = z % size;
}
if (z <= pathWidthLower || z > end || x <= pathWidthLower || x > end) {
return null; return null;
} else { } else {
return PlotId.of(idx, idz); return PlotId.of(dx, dz);
} }
} }
@ -180,24 +168,10 @@ public abstract class SquarePlotManager extends GridPlotManager {
} }
end = pathWidthLower + squarePlotWorld.PLOT_WIDTH; end = pathWidthLower + squarePlotWorld.PLOT_WIDTH;
} }
int dx; int dx = Math.floorDiv(x, size) + 1;
int rx; int rx = Math.floorMod(x, size);
if (x < 0) { int dz = Math.floorDiv(z, size) + 1;
dx = x / size; int rz = Math.floorMod(z, size);
rx = size + (x % size);
} else {
dx = (x / size) + 1;
rx = x % size;
}
int dz;
int rz;
if (z < 0) {
dz = z / size;
rz = size + (z % size);
} else {
dz = (z / size) + 1;
rz = z % size;
}
PlotId id = PlotId.of(dx, dz); PlotId id = PlotId.of(dx, dz);
boolean[] merged = new boolean[]{rz <= pathWidthLower, rx > end, rz > end, rx <= pathWidthLower}; boolean[] merged = new boolean[]{rz <= pathWidthLower, rx > end, rz > end, rx <= pathWidthLower};
int hash = HashUtil.hash(merged); int hash = HashUtil.hash(merged);

View File

@ -18,7 +18,8 @@
*/ */
package com.plotsquared.core.plot; package com.plotsquared.core.plot;
import javax.annotation.Nullable; import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Objects; import java.util.Objects;
public class PlotTitle { public class PlotTitle {

View File

@ -19,7 +19,7 @@ plugins {
} }
group = "com.plotsquared" group = "com.plotsquared"
version = "6.10.5" version = "6.10.6-SNAPSHOT"
subprojects { subprojects {
group = rootProject.group group = rootProject.group
@ -65,7 +65,7 @@ subprojects {
} }
dependencies { dependencies {
implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.19")) implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.21"))
} }
dependencies { dependencies {

View File

@ -4,7 +4,7 @@ guice = "5.1.0"
spotbugs = "4.7.3" spotbugs = "4.7.3"
# Plugins # Plugins
worldedit = "7.2.12" worldedit = "7.2.13"
placeholderapi = "2.11.2" placeholderapi = "2.11.2"
luckperms = "5.4" luckperms = "5.4"
essentialsx = "2.19.7" essentialsx = "2.19.7"
@ -13,7 +13,7 @@ mvdwapi = "3.1.1"
# Third party # Third party
prtree = "2.0.0" prtree = "2.0.0"
aopalliance = "1.0" aopalliance = "1.0"
cloud-services = "1.7.1" cloud-services = "1.8.0"
arkitektonika = "2.1.1" arkitektonika = "2.1.1"
squirrelid = "0.3.1" squirrelid = "0.3.1"
http4j = "1.3" http4j = "1.3"