Use proper adapter for EntityType.END_CRYSTAL
This commit is contained in:
parent
49eb176ee6
commit
fa1de08c0d
4 changed files with 24 additions and 8 deletions
|
|
@ -649,14 +649,7 @@ public class Rollback extends RollbackUtil {
|
|||
}
|
||||
|
||||
if (!exists) {
|
||||
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);
|
||||
Entity entity = block.getLocation().getWorld().spawnEntity(location1, BukkitAdapter.ADAPTER.getEntityType(Material.END_CRYSTAL));
|
||||
EnderCrystal enderCrystal = (EnderCrystal) entity;
|
||||
enderCrystal.setShowingBottom((rowData != 0));
|
||||
PaperAdapter.ADAPTER.teleportAsync(entity, location1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue