1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
--- a/net/minecraft/server/commands/EffectCommands.java
+++ b/net/minecraft/server/commands/EffectCommands.java
@@ -180,9 +82,10 @@
for (Entity entity : targets) {
if (entity instanceof LivingEntity) {
- MobEffectInstance mobEffectInstance = new MobEffectInstance(mobEffect, i1, amplifier, false, showParticles);
- if (((LivingEntity)entity).addEffect(mobEffectInstance, source.getEntity())) {
- i++;
+ MobEffectInstance mobeffect = new MobEffectInstance(mobeffectlist, k, amplifier, false, showParticles);
+
+ if (((LivingEntity) entity).addEffect(mobeffect, source.getEntity(), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.COMMAND)) { // CraftBukkit
+ ++j;
}
}
}
@@ -210,9 +111,11 @@
private static int clearEffects(CommandSourceStack source, Collection<? extends Entity> targets) throws CommandSyntaxException {
int i = 0;
- for (Entity entity : targets) {
- if (entity instanceof LivingEntity && ((LivingEntity)entity).removeAllEffects()) {
- i++;
+ while (iterator.hasNext()) {
+ Entity entity = (Entity) iterator.next();
+
+ if (entity instanceof LivingEntity && ((LivingEntity) entity).removeAllEffects(org.bukkit.event.entity.EntityPotionEffectEvent.Cause.COMMAND)) { // CraftBukkit
+ ++i;
}
}
@@ -235,9 +141,11 @@
MobEffect mobEffect = effect.value();
int i = 0;
- for (Entity entity : targets) {
- if (entity instanceof LivingEntity && ((LivingEntity)entity).removeEffect(mobEffect)) {
- i++;
+ while (iterator.hasNext()) {
+ Entity entity = (Entity) iterator.next();
+
+ if (entity instanceof LivingEntity && ((LivingEntity) entity).removeEffect(mobeffectlist, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.COMMAND)) { // CraftBukkit
+ ++i;
}
}
|