1 parent
1cda6506c7
commit
8b34e39797
3 files changed
+23
-1
No files matched your search
@@ -28,7 +28,8 @@ public class EntityChange implements LookupCacheElement {
|
|||||||
KILL,
|
KILL,
|
||||||
MODIFY,
|
MODIFY,
|
||||||
ADDEQUIP,
|
ADDEQUIP,
|
||||||
REMOVEEQUIP;
|
REMOVEEQUIP,
|
||||||
|
GET_STUNG;
|
||||||
|
|
||||||
private static EntityChangeType[] values = values();
|
private static EntityChangeType[] values = values();
|
||||||
|
|
||||||
@@ -113,6 +114,8 @@ public class EntityChange implements LookupCacheElement {
|
|||||||
}
|
}
|
||||||
} else if (changeType == EntityChangeType.MODIFY) {
|
} else if (changeType == EntityChangeType.MODIFY) {
|
||||||
msg.addExtra(createTextComponentWithColor("modified ", INTERACT.getColor()));
|
msg.addExtra(createTextComponentWithColor("modified ", INTERACT.getColor()));
|
||||||
|
} else if (changeType == EntityChangeType.GET_STUNG) {
|
||||||
|
msg.addExtra(createTextComponentWithColor("got stung by ", DESTROY.getColor()));
|
||||||
} else {
|
} else {
|
||||||
msg.addExtra(createTextComponentWithColor("did an unknown action to ", INTERACT.getColor()));
|
msg.addExtra(createTextComponentWithColor("did an unknown action to ", INTERACT.getColor()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import org.bukkit.block.data.type.TechnicalPiston.Type;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.entity.ArmorStand;
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.entity.Bee;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.ItemFrame;
|
import org.bukkit.entity.ItemFrame;
|
||||||
import org.bukkit.inventory.EquipmentSlot;
|
import org.bukkit.inventory.EquipmentSlot;
|
||||||
@@ -324,6 +325,12 @@ public class WorldEditor implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return PerformResult.NO_ACTION; // the entity is not there, or equip does not match
|
return PerformResult.NO_ACTION; // the entity is not there, or equip does not match
|
||||||
|
} else if (changeType == EntityChangeType.GET_STUNG) {
|
||||||
|
UUID uuid = getReplacedUUID(entityId, entityUUID);
|
||||||
|
Entity existing = BukkitUtils.loadEntityAround(loc.getChunk(), uuid);
|
||||||
|
if (existing != null && existing instanceof Bee) {
|
||||||
|
((Bee) existing).setHasStung(!rollback);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return PerformResult.NO_ACTION;
|
return PerformResult.NO_ACTION;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.entity.ArmorStand;
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.entity.Bee;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Hanging;
|
import org.bukkit.entity.Hanging;
|
||||||
import org.bukkit.entity.IronGolem;
|
import org.bukkit.entity.IronGolem;
|
||||||
@@ -226,6 +227,17 @@ public class AdvancedEntityLogging extends LoggingListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
|
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
|
||||||
|
Entity damager = event.getDamager();
|
||||||
|
if (damager instanceof Bee && !((Bee) damager).hasStung()) {
|
||||||
|
if (Config.isLogging(damager.getWorld(), EntityLogging.MODIFY, damager)) {
|
||||||
|
Actor actor = Actor.actorFromEntity(event.getEntity());
|
||||||
|
consumer.queueEntityModification(actor, damager.getUniqueId(), damager.getType(), damager.getLocation(), EntityChange.EntityChangeType.GET_STUNG, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onPlayerArmorStandManipulate(PlayerArmorStandManipulateEvent event) {
|
public void onPlayerArmorStandManipulate(PlayerArmorStandManipulateEvent event) {
|
||||||
ArmorStand entity = event.getRightClicked();
|
ArmorStand entity = event.getRightClicked();
|
||||||
|
|||||||
Reference in new issue
Block a user