mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2026-10-28 09:44:56 +00:00
Fixed backwards compatibility
This commit is contained in:
1 parent
068542223d
commit
898bcf2465
7 files changed
+22
-7
No files matched your search
@@ -154,7 +154,7 @@
|
||||
<dependency>
|
||||
<groupId>io.papermc.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>1.21.4-R0.1-SNAPSHOT</version>
|
||||
<version>1.21.1-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -54,7 +54,7 @@ public final class EntityChangeBlockListener extends Queue implements Listener {
|
||||
e = "#silverfish";
|
||||
}
|
||||
}
|
||||
else if (entity instanceof WindCharge) {
|
||||
else if (entity.getType().name().equals("WIND_CHARGE")) {
|
||||
e = "#windcharge";
|
||||
}
|
||||
else if (entity.getType().name().equals("BREEZE_WIND_CHARGE")) {
|
||||
|
||||
@@ -127,7 +127,7 @@ public final class EntityDeathListener extends Queue implements Listener {
|
||||
e = isCommand ? "#command" : "";
|
||||
}
|
||||
|
||||
if (entity.getType() == EntityType.GLOW_SQUID && damage.getCause() == DamageCause.DROWNING) {
|
||||
if (entity.getType().name().equals("GLOW_SQUID") && damage.getCause() == DamageCause.DROWNING) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +144,12 @@ public final class HangingBreakByEntityListener extends Queue implements Listene
|
||||
material = Material.PAINTING;
|
||||
Painting painting = (Painting) entity;
|
||||
blockData = "FACING=" + painting.getFacing().name();
|
||||
itemData = MaterialUtils.getArtId(painting.getArt().toString(), true);
|
||||
try {
|
||||
itemData = MaterialUtils.getArtId(painting.getArt().toString(), true);
|
||||
}
|
||||
catch (IncompatibleClassChangeError e) {
|
||||
// 1.21.2+
|
||||
}
|
||||
}
|
||||
|
||||
if (!event.isCancelled() && Config.getConfig(blockEvent.getWorld()).BLOCK_BREAK && !inspecting) {
|
||||
|
||||
@@ -72,7 +72,12 @@ public final class HangingBreakListener extends Queue implements Listener {
|
||||
material = Material.PAINTING;
|
||||
Painting painting = (Painting) entity;
|
||||
blockData = "FACING=" + painting.getFacing().name();
|
||||
itemData = MaterialUtils.getArtId(painting.getArt().toString(), true);
|
||||
try {
|
||||
itemData = MaterialUtils.getArtId(painting.getArt().toString(), true);
|
||||
}
|
||||
catch (IncompatibleClassChangeError e) {
|
||||
// 1.21.2+
|
||||
}
|
||||
}
|
||||
|
||||
if (!event.isCancelled() && Config.getConfig(blockEvent.getWorld()).NATURAL_BREAK) {
|
||||
|
||||
@@ -40,7 +40,13 @@ public final class HangingPlaceListener extends Queue implements Listener {
|
||||
material = Material.PAINTING;
|
||||
Painting painting = (Painting) entity;
|
||||
blockData = "FACING=" + painting.getFacing().name();
|
||||
artId = MaterialUtils.getArtId(painting.getArt().toString(), true);
|
||||
try {
|
||||
artId = MaterialUtils.getArtId(painting.getArt().toString(), true);
|
||||
}
|
||||
catch (IncompatibleClassChangeError e) {
|
||||
artId = 0;
|
||||
// 1.21.2+
|
||||
}
|
||||
}
|
||||
|
||||
int inspect = 0;
|
||||
|
||||
@@ -16,7 +16,6 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import net.coreprotect.bukkit.BukkitAdapter;
|
||||
import net.coreprotect.model.BlockGroup;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.BlockUtils;
|
||||
import net.coreprotect.utility.MaterialUtils;
|
||||
|
||||
|
||||
Reference in new issue
Block a user