Fixed backwards compatibility
This commit is contained in:
parent
068542223d
commit
898bcf2465
7 changed files with 22 additions and 7 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue