Added MC 1.21 support
This commit is contained in:
parent
371e496351
commit
37fc9af300
6 changed files with 33 additions and 18 deletions
|
|
@ -649,7 +649,14 @@ public class Rollback extends RollbackUtil {
|
|||
}
|
||||
|
||||
if (!exists) {
|
||||
Entity entity = block.getLocation().getWorld().spawnEntity(location1, EntityType.ENDER_CRYSTAL);
|
||||
EntityType END_CRYSTAL = null;
|
||||
try {
|
||||
END_CRYSTAL = EntityType.valueOf("END_CRYSTAL"); // 1.21+
|
||||
}
|
||||
catch (Exception e) {
|
||||
END_CRYSTAL = EntityType.valueOf("ENDER_CRYSTAL"); // <= 1.20
|
||||
}
|
||||
Entity entity = block.getLocation().getWorld().spawnEntity(location1, END_CRYSTAL);
|
||||
EnderCrystal enderCrystal = (EnderCrystal) entity;
|
||||
enderCrystal.setShowingBottom((rowData != 0));
|
||||
PaperAdapter.ADAPTER.teleportAsync(entity, location1);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import java.util.Map;
|
|||
import org.bukkit.FireworkEffect;
|
||||
import org.bukkit.FireworkEffect.Builder;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Tag;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
import org.bukkit.block.Jukebox;
|
||||
|
|
@ -93,7 +92,7 @@ public class RollbackUtil extends Lookup {
|
|||
else if (type != null && type.equals(Material.JUKEBOX)) {
|
||||
Jukebox jukebox = (Jukebox) container;
|
||||
if (jukebox != null) {
|
||||
if (action == 1 && Tag.ITEMS_MUSIC_DISCS.isTagged(itemstack.getType())) {
|
||||
if (action == 1 && itemstack.getType().name().startsWith("MUSIC_DISC")) {
|
||||
itemstack.setAmount(1);
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue