2016-03-03 02:43:58 +01:00
|
|
|
--- a/net/minecraft/server/EntityAreaEffectCloud.java
|
|
|
|
+++ b/net/minecraft/server/EntityAreaEffectCloud.java
|
2016-03-12 18:12:25 +01:00
|
|
|
@@ -8,6 +8,10 @@
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.UUID;
|
|
|
|
+
|
|
|
|
+import org.bukkit.craftbukkit.entity.CraftLivingEntity; // CraftBukkit
|
|
|
|
+import org.bukkit.entity.LivingEntity; // CraftBukkit
|
|
|
|
+
|
|
|
|
import java.util.Map.Entry;
|
2016-05-10 13:47:39 +02:00
|
|
|
import javax.annotation.Nullable;
|
2016-03-12 18:12:25 +01:00
|
|
|
|
2016-11-17 02:41:03 +01:00
|
|
|
@@ -101,6 +105,22 @@
|
2016-03-03 02:43:58 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // CraftBukkit start accessor methods
|
|
|
|
+ public void refreshEffects() {
|
2016-05-10 13:47:39 +02:00
|
|
|
+ if (!this.hasColor) {
|
2016-06-09 03:43:49 +02:00
|
|
|
+ this.getDataWatcher().set(EntityAreaEffectCloud.b, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects)))); // PAIL: rename
|
2016-03-03 02:43:58 +01:00
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getType() {
|
2016-06-09 03:43:49 +02:00
|
|
|
+ return ((MinecraftKey) PotionRegistry.a.b(this.potionRegistry)).toString(); // PAIL: rename
|
2016-03-03 02:43:58 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setType(String string) {
|
|
|
|
+ a(PotionRegistry.a.get(new MinecraftKey(string))); // PAIL: rename
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
+
|
|
|
|
public int getColor() {
|
|
|
|
return ((Integer) this.getDataWatcher().get(EntityAreaEffectCloud.b)).intValue();
|
|
|
|
}
|
2016-11-17 02:41:03 +01:00
|
|
|
@@ -270,6 +290,7 @@
|
2016-03-12 18:12:25 +01:00
|
|
|
if (!list.isEmpty()) {
|
|
|
|
Iterator iterator2 = list.iterator();
|
|
|
|
|
|
|
|
+ List<LivingEntity> entities = new ArrayList<LivingEntity>(); // CraftBukkit
|
|
|
|
while (iterator2.hasNext()) {
|
|
|
|
EntityLiving entityliving = (EntityLiving) iterator2.next();
|
|
|
|
|
2016-11-17 02:41:03 +01:00
|
|
|
@@ -279,6 +300,17 @@
|
2016-03-12 18:12:25 +01:00
|
|
|
double d2 = d0 * d0 + d1 * d1;
|
|
|
|
|
|
|
|
if (d2 <= (double) (f * f)) {
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ entities.add((LivingEntity) entityliving.getBukkitEntity());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ org.bukkit.event.entity.AreaEffectCloudApplyEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callAreaEffectCloudApplyEvent(this, entities);
|
|
|
|
+ if (true) { // Preserve NMS spacing and bracket count for smallest diff
|
|
|
|
+ for (LivingEntity entity : event.getAffectedEntities()) {
|
|
|
|
+ if (entity instanceof CraftLivingEntity) {
|
|
|
|
+ EntityLiving entityliving = ((CraftLivingEntity) entity).getHandle();
|
|
|
|
+ // CraftBukkit end
|
2016-11-17 02:41:03 +01:00
|
|
|
this.at.put(entityliving, Integer.valueOf(this.ticksLived + this.reapplicationDelay));
|
2016-03-12 18:12:25 +01:00
|
|
|
Iterator iterator3 = arraylist.iterator();
|
|
|
|
|