Fixed backwards compatibility
This commit is contained in:
parent
068542223d
commit
898bcf2465
7 changed files with 22 additions and 7 deletions
2
pom.xml
2
pom.xml
|
|
@ -154,7 +154,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.papermc.paper</groupId>
|
<groupId>io.papermc.paper</groupId>
|
||||||
<artifactId>paper-api</artifactId>
|
<artifactId>paper-api</artifactId>
|
||||||
<version>1.21.4-R0.1-SNAPSHOT</version>
|
<version>1.21.1-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ public final class EntityChangeBlockListener extends Queue implements Listener {
|
||||||
e = "#silverfish";
|
e = "#silverfish";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (entity instanceof WindCharge) {
|
else if (entity.getType().name().equals("WIND_CHARGE")) {
|
||||||
e = "#windcharge";
|
e = "#windcharge";
|
||||||
}
|
}
|
||||||
else if (entity.getType().name().equals("BREEZE_WIND_CHARGE")) {
|
else if (entity.getType().name().equals("BREEZE_WIND_CHARGE")) {
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ public final class EntityDeathListener extends Queue implements Listener {
|
||||||
e = isCommand ? "#command" : "";
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,12 @@ public final class HangingBreakByEntityListener extends Queue implements Listene
|
||||||
material = Material.PAINTING;
|
material = Material.PAINTING;
|
||||||
Painting painting = (Painting) entity;
|
Painting painting = (Painting) entity;
|
||||||
blockData = "FACING=" + painting.getFacing().name();
|
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) {
|
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;
|
material = Material.PAINTING;
|
||||||
Painting painting = (Painting) entity;
|
Painting painting = (Painting) entity;
|
||||||
blockData = "FACING=" + painting.getFacing().name();
|
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) {
|
if (!event.isCancelled() && Config.getConfig(blockEvent.getWorld()).NATURAL_BREAK) {
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,13 @@ public final class HangingPlaceListener extends Queue implements Listener {
|
||||||
material = Material.PAINTING;
|
material = Material.PAINTING;
|
||||||
Painting painting = (Painting) entity;
|
Painting painting = (Painting) entity;
|
||||||
blockData = "FACING=" + painting.getFacing().name();
|
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;
|
int inspect = 0;
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import net.coreprotect.bukkit.BukkitAdapter;
|
import net.coreprotect.bukkit.BukkitAdapter;
|
||||||
import net.coreprotect.model.BlockGroup;
|
import net.coreprotect.model.BlockGroup;
|
||||||
import net.coreprotect.utility.Util;
|
|
||||||
import net.coreprotect.utility.BlockUtils;
|
import net.coreprotect.utility.BlockUtils;
|
||||||
import net.coreprotect.utility.MaterialUtils;
|
import net.coreprotect.utility.MaterialUtils;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue