mirror of
https://github.com/darksaid98/SiegeEngines.git
synced 2026-12-01 14:38:55 +00:00
Fix Destroy-Releasing again
Also attempt to fix the message spam upon Engine Destruction
This commit is contained in:
1 parent
64358e9b80
commit
5b22c1aed4
4 files changed
+14
-11
No files matched your search
@@ -595,16 +595,15 @@ public class ClickHandler implements Listener {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onEngineDamage(EntityDamageByEntityEvent event) {
|
||||
if (event.getEntity() instanceof ArmorStand) {
|
||||
if (event.isCancelled()) return;
|
||||
if (event.getDamager() instanceof Player) {
|
||||
PlayerHandler.siegeEngineEntityDied(event.getEntity());
|
||||
event.setDamage(20);
|
||||
event.setDamage(2);
|
||||
} else {
|
||||
event.setDamage(5);
|
||||
event.setDamage(4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -871,7 +870,7 @@ public class ClickHandler implements Listener {
|
||||
if (removeStands) {
|
||||
for (ItemStack i : items) {
|
||||
if (i.getType() == Material.ARMOR_STAND) {
|
||||
PlayerHandler.siegeEngineEntityDied(event.getEntity());
|
||||
PlayerHandler.siegeEngineEntityDied(event.getEntity(),false);
|
||||
SiegeEngines.activeSiegeEngines.remove(event.getEntity().getUniqueId());
|
||||
i.setAmount(0);
|
||||
return;
|
||||
|
||||
@@ -33,6 +33,9 @@ public class PlayerHandler implements Listener {
|
||||
playerJoinLeave(event.getPlayer());
|
||||
}
|
||||
public static void siegeEngineEntityDied(Entity entity) {
|
||||
siegeEngineEntityDied(entity,true);
|
||||
}
|
||||
public static void siegeEngineEntityDied(Entity entity, boolean silent) {
|
||||
for (UUID uuid : SiegeEngines.siegeEngineEntitiesPerPlayer.keySet()) {
|
||||
if (SiegeEngines.siegeEngineEntitiesPerPlayer.containsKey(uuid)) {
|
||||
if (entity.isDead()) {
|
||||
@@ -49,9 +52,10 @@ public class PlayerHandler implements Listener {
|
||||
if (SiegeEngines.siegeEngineEntitiesPerPlayer.get(uuid) != null) SiegeEngines.siegeEngineEntitiesPerPlayer.get(uuid).remove(Bukkit.getEntity(eUuid));
|
||||
}
|
||||
}
|
||||
SiegeEngines.activeSiegeEngines.remove(entity.getUniqueId());
|
||||
SiegeEnginesLogger.debug("ENGINE DISABLED/DEAD "+entity.getUniqueId().toString());
|
||||
}
|
||||
Bukkit.getPlayer(uuid).sendMessage("§eSiege Engine Destroyed!");
|
||||
if (!silent) Bukkit.getPlayer(uuid).sendMessage("§eSiege Engine Destroyed!");
|
||||
for (UUID eUuid : SiegeEngines.activeSiegeEngines.keySet()) {
|
||||
if (Bukkit.getEntity(eUuid) == null || Bukkit.getEntity(eUuid).isDead() || !Bukkit.getEntity(eUuid).isValid()) {
|
||||
SiegeEngines.activeSiegeEngines.remove(eUuid);
|
||||
|
||||
@@ -40,8 +40,8 @@ public class RotationHandler implements Listener {
|
||||
if (equipment == null) continue;
|
||||
final LivingEntity living = (LivingEntity) ent;
|
||||
if (Config.disabledWorlds.contains(ent.getWorld())) {
|
||||
PlayerHandler.siegeEngineEntityDied(ent);
|
||||
living.setHealth(0.0d);
|
||||
PlayerHandler.siegeEngineEntityDied(ent);
|
||||
continue;
|
||||
}
|
||||
if (!(ent.getLocation().getWorld().equals(player.getLocation().getWorld()))) {
|
||||
|
||||
@@ -91,9 +91,9 @@ Projectiles:
|
||||
FireSound: ITEM_CROSSBOW_SHOOT
|
||||
DragonsBreath:
|
||||
ProjectileType: ENTITY
|
||||
Inaccuracy: 0.125
|
||||
EntityCount: 1
|
||||
VelocityFactor: 1.0
|
||||
Inaccuracy: 0.65
|
||||
EntityCount: 3
|
||||
VelocityFactor: 1.125
|
||||
EntityType: DRAGON_FIREBALL
|
||||
AmmoItem: DRAGON_BREATH
|
||||
FireSound: ENTITY_GENERIC_EXPLODE
|
||||
@@ -169,7 +169,7 @@ SiegeEngines:
|
||||
- StoneShot
|
||||
- RepeatingShot
|
||||
- BreachShot
|
||||
- FireShot
|
||||
- DragonsBreath
|
||||
- FireworkShot
|
||||
ItemName: "&e&lBreach Cannon"
|
||||
Lore:
|
||||
|
||||
Reference in new issue
Block a user