main #6

Zusammengeführt
Lixfel hat 10 Commits von Mirrors/FastAsyncWorldEdit:main nach main 2023-02-23 10:18:59 +01:00 zusammengeführt
9 geänderte Dateien mit 37 neuen und 52 gelöschten Zeilen

Datei anzeigen

@ -5,7 +5,7 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
import java.net.URI import java.net.URI
plugins { plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0" id("io.github.gradle-nexus.publish-plugin") version "1.2.0"
id("xyz.jpenilla.run-paper") version "2.0.1" id("xyz.jpenilla.run-paper") version "2.0.1"
} }
@ -33,7 +33,7 @@ logger.lifecycle("""
******************************************* *******************************************
""") """)
var rootVersion by extra("2.5.2") var rootVersion by extra("2.5.3")
var snapshot by extra("SNAPSHOT") var snapshot by extra("SNAPSHOT")
var revision: String by extra("") var revision: String by extra("")
var buildNumber by extra("") var buildNumber by extra("")

Datei anzeigen

@ -31,7 +31,7 @@ dependencies {
implementation(gradleApi()) implementation(gradleApi())
implementation("org.ajoberstar.grgit:grgit-gradle:4.1.1") implementation("org.ajoberstar.grgit:grgit-gradle:4.1.1")
implementation("gradle.plugin.com.github.johnrengelman:shadow:7.1.2") implementation("gradle.plugin.com.github.johnrengelman:shadow:7.1.2")
implementation("io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.4.1") implementation("io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.5.1")
} }
kotlin { kotlin {

Datei anzeigen

@ -10,10 +10,8 @@ worldguard-bukkit = "7.0.7"
mapmanager = "1.8.0-SNAPSHOT" mapmanager = "1.8.0-SNAPSHOT"
griefprevention = "16.18" griefprevention = "16.18"
griefdefender = "2.1.0-SNAPSHOT" griefdefender = "2.1.0-SNAPSHOT"
mcore = "7.0.1"
residence = "4.5._13.1" residence = "4.5._13.1"
towny = "0.98.4.18" towny = "0.98.4.18"
redprotect = "1.9.6"
# Third party # Third party
bstats = "3.0.0" bstats = "3.0.0"
@ -25,7 +23,7 @@ auto-value = "1.10.1"
findbugs = "3.0.2" findbugs = "3.0.2"
rhino-runtime = "1.7.14" rhino-runtime = "1.7.14"
zstd-jni = "1.4.8-1" # Not latest as it can be difficult to obtain latest ZSTD libs zstd-jni = "1.4.8-1" # Not latest as it can be difficult to obtain latest ZSTD libs
antlr4 = "4.11.1" antlr4 = "4.12.0"
json-simple = "1.1.1" json-simple = "1.1.1"
jlibnoise = "1.0.0" jlibnoise = "1.0.0"
jchronic = "0.2.4a" jchronic = "0.2.4a"
@ -55,10 +53,8 @@ worldguard = { group = "com.sk89q.worldguard", name = "worldguard-bukkit", versi
mapmanager = { group = "com.github.InventivetalentDev", name = "MapManager", version.ref = "mapmanager" } mapmanager = { group = "com.github.InventivetalentDev", name = "MapManager", version.ref = "mapmanager" }
griefprevention = { group = "com.github.TechFortress", name = "GriefPrevention", version.ref = "griefprevention" } griefprevention = { group = "com.github.TechFortress", name = "GriefPrevention", version.ref = "griefprevention" }
griefdefender = { group = "com.griefdefender", name = "api", version.ref = "griefdefender" } griefdefender = { group = "com.griefdefender", name = "api", version.ref = "griefdefender" }
mcore = { group = "com.massivecraft", name = "mcore", version.ref = "mcore" }
residence = { group = "com.bekvon.bukkit.residence", name = "Residence", version.ref = "residence" } residence = { group = "com.bekvon.bukkit.residence", name = "Residence", version.ref = "residence" }
towny = { group = "com.github.TownyAdvanced", name = "Towny", version.ref = "towny" } towny = { group = "com.github.TownyAdvanced", name = "Towny", version.ref = "towny" }
redprotect = { group = "net.fabiozumbi12", name = "redprotect", version.ref = "redprotect" }
# Third Party # Third Party
bstatsBase = { group = "org.bstats", name = "bstats-base", version.ref = "bstats" } bstatsBase = { group = "org.bstats", name = "bstats-base", version.ref = "bstats" }

Datei anzeigen

@ -89,7 +89,6 @@ dependencies {
compileOnly(libs.mapmanager) { isTransitive = false } compileOnly(libs.mapmanager) { isTransitive = false }
compileOnly(libs.griefprevention) { isTransitive = false } compileOnly(libs.griefprevention) { isTransitive = false }
compileOnly(libs.griefdefender) { isTransitive = false } compileOnly(libs.griefdefender) { isTransitive = false }
compileOnly(libs.mcore) { isTransitive = false }
compileOnly(libs.residence) { isTransitive = false } compileOnly(libs.residence) { isTransitive = false }
compileOnly(libs.towny) { isTransitive = false } compileOnly(libs.towny) { isTransitive = false }
compileOnly("com.plotsquared:PlotSquared-Bukkit") { isTransitive = false } compileOnly("com.plotsquared:PlotSquared-Bukkit") { isTransitive = false }

Datei anzeigen

@ -1,6 +1,5 @@
package com.fastasyncworldedit.bukkit.listener; package com.fastasyncworldedit.bukkit.listener;
import com.fastasyncworldedit.core.command.tool.MovableTool;
import com.fastasyncworldedit.core.command.tool.ResettableTool; import com.fastasyncworldedit.core.command.tool.ResettableTool;
import com.fastasyncworldedit.core.command.tool.scroll.ScrollTool; import com.fastasyncworldedit.core.command.tool.scroll.ScrollTool;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
@ -8,7 +7,6 @@ import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.bukkit.BukkitPlayer; import com.sk89q.worldedit.bukkit.BukkitPlayer;
import com.sk89q.worldedit.command.tool.Tool; import com.sk89q.worldedit.command.tool.Tool;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
@ -16,7 +14,6 @@ import org.bukkit.event.Listener;
import org.bukkit.event.block.Action; import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerItemHeldEvent; import org.bukkit.event.player.PlayerItemHeldEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
public class BrushListener implements Listener { public class BrushListener implements Listener {
@ -49,24 +46,6 @@ public class BrushListener implements Listener {
} }
} }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerMove(PlayerMoveEvent event) {
Location from = event.getFrom();
Location to = event.getTo();
if ((from.getYaw() != to.getYaw() && from.getPitch() != to.getPitch()) || from.getBlockX() != to.getBlockX() || from.getBlockZ() != to
.getBlockZ() || from.getBlockY() != to.getBlockY()) {
Player bukkitPlayer = event.getPlayer();
com.sk89q.worldedit.entity.Player player = BukkitAdapter.adapt(bukkitPlayer);
LocalSession session = player.getSession();
Tool tool = session.getTool(player);
if (tool != null) {
if (tool instanceof MovableTool) {
((MovableTool) tool).move(player);
}
}
}
}
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.LOWEST)
public void onPlayerInteract(final PlayerInteractEvent event) { public void onPlayerInteract(final PlayerInteractEvent event) {
Player bukkitPlayer = event.getPlayer(); Player bukkitPlayer = event.getPlayer();

Datei anzeigen

@ -23,6 +23,7 @@ import com.fastasyncworldedit.bukkit.BukkitPermissionAttachmentManager;
import com.fastasyncworldedit.bukkit.FaweBukkit; import com.fastasyncworldedit.bukkit.FaweBukkit;
import com.fastasyncworldedit.core.util.UpdateNotification; import com.fastasyncworldedit.core.util.UpdateNotification;
import com.fastasyncworldedit.core.Fawe; import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.util.WEManager;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.sk89q.bukkit.util.ClassSourceValidator; import com.sk89q.bukkit.util.ClassSourceValidator;
@ -58,6 +59,7 @@ import com.sk89q.worldedit.world.weather.WeatherTypes;
import io.papermc.lib.PaperLib; import io.papermc.lib.PaperLib;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.bstats.bukkit.Metrics; import org.bstats.bukkit.Metrics;
import org.bstats.charts.SimplePie;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.NamespacedKey; import org.bukkit.NamespacedKey;
@ -220,8 +222,10 @@ public class WorldEditPlugin extends JavaPlugin {
} }
// Enable metrics // Enable metrics
new Metrics(this, BSTATS_ID); Metrics m = new Metrics(this, BSTATS_ID);
// First introduced in build 349, release 2.5.2
m.addCustomChart(new SimplePie("residence", ()
-> WEManager.weManager().getManagers().toString().contains("residence") ? "Yes" : "No"));
// Check if we are in a safe environment // Check if we are in a safe environment
ServerLib.checkUnsafeForks(); ServerLib.checkUnsafeForks();
// Check if a new build is available // Check if a new build is available

Datei anzeigen

@ -34,7 +34,6 @@ dependencies {
implementation("org.apache.logging.log4j:log4j-api") implementation("org.apache.logging.log4j:log4j-api")
// Plugins // Plugins
compileOnly(libs.redprotect) { isTransitive = false }
compileOnly("com.plotsquared:PlotSquared-Core") { isTransitive = false } compileOnly("com.plotsquared:PlotSquared-Core") { isTransitive = false }
// ensure this is on the classpath for the AP // ensure this is on the classpath for the AP

Datei anzeigen

@ -2,8 +2,16 @@ package com.fastasyncworldedit.core.command.tool;
import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.entity.Player;
/**
* @deprecated This interface has no functionality anymore
*/
@Deprecated(forRemoval = true, since = "2.5.2")
public interface MovableTool { public interface MovableTool {
/**
* @deprecated This interface has no functionality anymore
*/
@Deprecated(forRemoval = true, since = "2.5.2")
boolean move(Player player); boolean move(Player player);
} }

Datei anzeigen

@ -18,9 +18,9 @@ public class PropertyKeySet implements Set<PropertyKey> {
public static PropertyKeySet ofCollection(Collection<? extends PropertyKey> collection) { public static PropertyKeySet ofCollection(Collection<? extends PropertyKey> collection) {
PropertyKeySet set = new PropertyKeySet(); PropertyKeySet set = new PropertyKeySet();
if (collection instanceof PropertyKeySet) { if (collection instanceof PropertyKeySet pks) {
// simple copy // simple copy
set.bits.or(((PropertyKeySet) collection).bits); set.bits.or(pks.bits);
return set; return set;
} }
for (PropertyKey key : collection) { for (PropertyKey key : collection) {
@ -51,10 +51,10 @@ public class PropertyKeySet implements Set<PropertyKey> {
@Override @Override
public boolean contains(Object o) { public boolean contains(Object o) {
if (!(o instanceof PropertyKey)) { if (!(o instanceof PropertyKey pk)) {
return false; return false;
} }
return this.bits.get(((PropertyKey) o).getId()); return this.bits.get(pk.getId());
} }
@Nonnull @Nonnull
@ -92,26 +92,26 @@ public class PropertyKeySet implements Set<PropertyKey> {
@Override @Override
public boolean remove(Object o) { public boolean remove(Object o) {
if (!(o instanceof PropertyKey)) { if (!(o instanceof PropertyKey pk)) {
return false; return false;
} }
if (!this.bits.get(((PropertyKey) o).getId())) { if (!this.bits.get(pk.getId())) {
return false; return false;
} }
this.bits.clear(((PropertyKey) o).getId()); this.bits.clear(pk.getId());
return true; return true;
} }
@Override @Override
public boolean containsAll(@Nonnull Collection<?> c) { public boolean containsAll(@Nonnull Collection<?> c) {
if (c instanceof PropertyKeySet) { if (c instanceof PropertyKeySet pks) {
return ((PropertyKeySet) c).bits.intersects(this.bits); return pks.bits.intersects(this.bits);
} }
for (Object o : c) { for (Object o : c) {
if (!(o instanceof PropertyKey)) { if (!(o instanceof PropertyKey pk)) {
return false; return false;
} }
if (!this.bits.get(((PropertyKey) o).getId())) { if (!this.bits.get(pk.getId())) {
return false; return false;
} }
} }
@ -121,8 +121,8 @@ public class PropertyKeySet implements Set<PropertyKey> {
@Override @Override
public boolean addAll(@Nonnull Collection<? extends PropertyKey> c) { public boolean addAll(@Nonnull Collection<? extends PropertyKey> c) {
int cardinality = this.bits.cardinality(); int cardinality = this.bits.cardinality();
if (c instanceof PropertyKeySet) { if (c instanceof PropertyKeySet pks) {
this.bits.or(((PropertyKeySet) c).bits); this.bits.or(pks.bits);
} else { } else {
for (PropertyKey key : c) { for (PropertyKey key : c) {
this.bits.set(key.getId()); this.bits.set(key.getId());
@ -135,8 +135,8 @@ public class PropertyKeySet implements Set<PropertyKey> {
public boolean retainAll(@Nonnull Collection<?> c) { public boolean retainAll(@Nonnull Collection<?> c) {
int cardinality = this.bits.cardinality(); int cardinality = this.bits.cardinality();
BitSet removal; BitSet removal;
if (c instanceof PropertyKeySet) { if (c instanceof PropertyKeySet pks) {
removal = ((PropertyKeySet) c).bits; removal = pks.bits;
} else { } else {
removal = new BitSet(this.bits.length()); removal = new BitSet(this.bits.length());
for (PropertyKey key : this) { for (PropertyKey key : this) {
@ -152,12 +152,12 @@ public class PropertyKeySet implements Set<PropertyKey> {
@Override @Override
public boolean removeAll(@Nonnull Collection<?> c) { public boolean removeAll(@Nonnull Collection<?> c) {
int cardinality = this.bits.cardinality(); int cardinality = this.bits.cardinality();
if (c instanceof PropertyKeySet) { if (c instanceof PropertyKeySet pks) {
this.bits.andNot(((PropertyKeySet) c).bits); this.bits.andNot(pks.bits);
} else { } else {
for (Object o : c) { // mh for (Object o : c) { // mh
if (o instanceof PropertyKey) { if (o instanceof PropertyKey pk) {
this.bits.clear(((PropertyKey) o).getId()); this.bits.clear(pk.getId());
} }
} }
} }