summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authornathat890 <nathat890@outlook.com>2018-12-05 09:51:20 +1100
committermd_5 <git@md-5.net>2018-12-05 09:51:45 +1100
commit20fc5bea2c51de8d5239b68d83e878896b8ff505 (patch)
treecd93f48fe1c8d6a33fb2d14f54b328c7611505f9 /src/main
parent38e4c013b66d2a870e83fe61b2da6bad608c69af (diff)
downloadcraftbukkit-20fc5bea2c51de8d5239b68d83e878896b8ff505.tar
craftbukkit-20fc5bea2c51de8d5239b68d83e878896b8ff505.tar.gz
craftbukkit-20fc5bea2c51de8d5239b68d83e878896b8ff505.tar.lz
craftbukkit-20fc5bea2c51de8d5239b68d83e878896b8ff505.tar.xz
craftbukkit-20fc5bea2c51de8d5239b68d83e878896b8ff505.zip
Add list of entities to EntityTransformEvent & move die calls
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index aca32147..26e14f0d 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.event;
import java.net.InetAddress;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
@@ -303,8 +304,20 @@ public class CraftEventFactory {
/**
* EntityTransformEvent
*/
- public static EntityTransformEvent callEntityTransformEvent(EntityLiving original, EntityLiving converted, EntityTransformEvent.TransformReason convertType) {
- EntityTransformEvent event = new EntityTransformEvent(original.getBukkitEntity(), converted.getBukkitEntity(), convertType);
+ public static EntityTransformEvent callEntityTransformEvent(EntityLiving original, EntityLiving coverted, EntityTransformEvent.TransformReason transformReason) {
+ return callEntityTransformEvent(original, Collections.singletonList(coverted), transformReason);
+ }
+
+ /**
+ * EntityTransformEvent
+ */
+ public static EntityTransformEvent callEntityTransformEvent(EntityLiving original, List<EntityLiving> convertedList, EntityTransformEvent.TransformReason convertType) {
+ List<org.bukkit.entity.Entity> list = new ArrayList<>();
+ for (EntityLiving entityLiving : convertedList) {
+ list.add(entityLiving.getBukkitEntity());
+ }
+
+ EntityTransformEvent event = new EntityTransformEvent(original.getBukkitEntity(), list, convertType);
Bukkit.getPluginManager().callEvent(event);
return event;