mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-04 06:34:42 +02:00
Compare commits
2 Commits
fix/wrong-
...
deprecatio
Author | SHA1 | Date | |
---|---|---|---|
7ab89f7a4b | |||
339ca8e30f |
@ -36,7 +36,6 @@ import com.plotsquared.bukkit.listener.ChunkListener;
|
|||||||
import com.plotsquared.bukkit.listener.EntityEventListener;
|
import com.plotsquared.bukkit.listener.EntityEventListener;
|
||||||
import com.plotsquared.bukkit.listener.EntitySpawnListener;
|
import com.plotsquared.bukkit.listener.EntitySpawnListener;
|
||||||
import com.plotsquared.bukkit.listener.PaperListener;
|
import com.plotsquared.bukkit.listener.PaperListener;
|
||||||
import com.plotsquared.bukkit.listener.PaperListener113;
|
|
||||||
import com.plotsquared.bukkit.listener.PlayerEventListener;
|
import com.plotsquared.bukkit.listener.PlayerEventListener;
|
||||||
import com.plotsquared.bukkit.listener.ProjectileEventListener;
|
import com.plotsquared.bukkit.listener.ProjectileEventListener;
|
||||||
import com.plotsquared.bukkit.listener.ServerListener;
|
import com.plotsquared.bukkit.listener.ServerListener;
|
||||||
@ -356,11 +355,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
getServer().getPluginManager().registerEvents(injector().getInstance(ServerListener.class), this);
|
getServer().getPluginManager().registerEvents(injector().getInstance(ServerListener.class), this);
|
||||||
getServer().getPluginManager().registerEvents(injector().getInstance(EntitySpawnListener.class), this);
|
getServer().getPluginManager().registerEvents(injector().getInstance(EntitySpawnListener.class), this);
|
||||||
if (PaperLib.isPaper() && Settings.Paper_Components.PAPER_LISTENERS) {
|
if (PaperLib.isPaper() && Settings.Paper_Components.PAPER_LISTENERS) {
|
||||||
if (serverVersion()[1] == 13) {
|
|
||||||
getServer().getPluginManager().registerEvents(injector().getInstance(PaperListener113.class), this);
|
|
||||||
} else {
|
|
||||||
getServer().getPluginManager().registerEvents(injector().getInstance(PaperListener.class), this);
|
getServer().getPluginManager().registerEvents(injector().getInstance(PaperListener.class), this);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
getServer().getPluginManager().registerEvents(injector().getInstance(SpigotListener.class), this);
|
getServer().getPluginManager().registerEvents(injector().getInstance(SpigotListener.class), this);
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,9 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
|||||||
*
|
*
|
||||||
* @deprecated Deprecated and scheduled for removal without replacement
|
* @deprecated Deprecated and scheduled for removal without replacement
|
||||||
* in favor of the build in setup wizard.
|
* in favor of the build in setup wizard.
|
||||||
|
* However, this class will be kept around for a while, given it's not a maintenance burden.
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "6.0.0")
|
@Deprecated
|
||||||
@Singleton
|
@Singleton
|
||||||
public class MultiverseWorldManager extends BukkitWorldManager {
|
public class MultiverseWorldManager extends BukkitWorldManager {
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
Reference in New Issue
Block a user