feat: make the plugin compatible to up to 1.21.8
This commit is contained in:
parent
e3fe5fb325
commit
84c078e88c
5 changed files with 12 additions and 11 deletions
|
|
@ -95,7 +95,7 @@ public class Announcement {
|
||||||
*/
|
*/
|
||||||
public static void ShowEggEffects(Location loc) {
|
public static void ShowEggEffects(Location loc) {
|
||||||
for (Player p : loc.getWorld().getPlayers()) {
|
for (Player p : loc.getWorld().getPlayers()) {
|
||||||
p.spawnParticle(Particle.SPELL_WITCH, loc, 50, 0.3, 0.1, 0.3);
|
p.spawnParticle(Particle.WITCH, loc, 50, 0.3, 0.1, 0.3);
|
||||||
p.spawnParticle(Particle.PORTAL, loc, 50, 0.3, 0.1, 0.3);
|
p.spawnParticle(Particle.PORTAL, loc, 50, 0.3, 0.1, 0.3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ public class EggDestroyListener implements Listener {
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onEntityDamageEvent(EntityDamageEvent event) {
|
public void onEntityDamageEvent(EntityDamageEvent event) {
|
||||||
Entity entity = event.getEntity();
|
Entity entity = event.getEntity();
|
||||||
if (entity.getType().equals(EntityType.DROPPED_ITEM)) {
|
if (entity.getType().equals(EntityType.ITEM)) {
|
||||||
ItemStack item = ((Item)entity).getItemStack();
|
ItemStack item = ((Item)entity).getItemStack();
|
||||||
if (Egg.hasEgg(item)) {
|
if (Egg.hasEgg(item)) {
|
||||||
//make sure item is destroyed to prevent dupes
|
//make sure item is destroyed to prevent dupes
|
||||||
|
|
@ -93,8 +93,9 @@ public class EggDestroyListener implements Listener {
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onEntityDeath(EntityDeathEvent event) {
|
public void onEntityDeath(EntityDeathEvent event) {
|
||||||
//if the egg item dies, notify that it has been destroyed
|
//if the egg item dies, notify that it has been destroyed
|
||||||
if (event.getEntityType().equals(EntityType.DROPPED_ITEM)) {
|
if (event.getEntityType().equals(EntityType.ITEM)) {
|
||||||
if (Egg.hasEgg((ItemStack) event.getEntity())) {
|
Item item = (Item) event.getEntity();
|
||||||
|
if (Egg.hasEgg((ItemStack) item.getItemStack())) {
|
||||||
//remove just in case to prevent dupes
|
//remove just in case to prevent dupes
|
||||||
event.getEntity().remove();
|
event.getEntity().remove();
|
||||||
EggController.eggDestroyed(config, data, logger);
|
EggController.eggDestroyed(config, data, logger);
|
||||||
|
|
@ -295,7 +296,7 @@ public class EggDestroyListener implements Listener {
|
||||||
public void onConsiderEntityDamageEvent(EntityDamageEvent event) {
|
public void onConsiderEntityDamageEvent(EntityDamageEvent event) {
|
||||||
if (config.getEggInvulnerable()) {
|
if (config.getEggInvulnerable()) {
|
||||||
Entity entity = event.getEntity();
|
Entity entity = event.getEntity();
|
||||||
if (entity.getType().equals(EntityType.DROPPED_ITEM)) {
|
if (entity.getType().equals(EntityType.ITEM)) {
|
||||||
if (Egg.hasEgg((Item) entity)) {
|
if (Egg.hasEgg((Item) entity)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ public class EventScheduler extends BukkitRunnable {
|
||||||
player.getInventory().remove(m);
|
player.getInventory().remove(m);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DROPPED_ITEM:
|
case ITEM:
|
||||||
((Item) entity).remove();
|
((Item) entity).remove();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -380,7 +380,7 @@ public class Data {
|
||||||
storageMsg = String.format("is a falling block");
|
storageMsg = String.format("is a falling block");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DROPPED_ITEM:
|
case ITEM:
|
||||||
storageMsg = String.format("is a dropped item");
|
storageMsg = String.format("is a dropped item");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
#See pom.xml for this information
|
#See pom.xml for this information
|
||||||
name: ${project.name}
|
name: ${project_name}
|
||||||
website: ${project.url}
|
website: ${project_url}
|
||||||
version: ${project.version}
|
version: ${project_version}
|
||||||
description: ${project.description}
|
description: ${project_description}
|
||||||
|
|
||||||
api-version: '1.17'
|
api-version: '1.17'
|
||||||
author: J0hnL0cke
|
author: J0hnL0cke
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue