@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/effect/MobEffectList.java
|
||||
+++ b/net/minecraft/world/effect/MobEffectList.java
|
||||
@@ -19,6 +19,13 @@
|
||||
@@ -20,6 +20,13 @@
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.player.EntityHuman;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
public class MobEffectList {
|
||||
|
||||
private final Map<AttributeBase, AttributeModifier> attributeModifiers = Maps.newHashMap();
|
||||
@@ -44,26 +51,37 @@
|
||||
@@ -56,26 +63,37 @@
|
||||
public void applyEffectTick(EntityLiving entityliving, int i) {
|
||||
if (this == MobEffects.REGENERATION) {
|
||||
if (entityliving.getHealth() < entityliving.getMaxHealth()) {
|
||||
@@ -57,7 +57,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -84,7 +102,7 @@
|
||||
@@ -96,7 +114,7 @@
|
||||
}
|
||||
} else {
|
||||
j = (int) (d0 * (double) (4 << i) + 0.5D);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
--- a/net/minecraft/world/effect/MobEffectUtil.java
|
||||
+++ b/net/minecraft/world/effect/MobEffectUtil.java
|
||||
@@ -48,13 +48,19 @@
|
||||
}
|
||||
|
||||
public static List<EntityPlayer> addEffectToPlayersAround(WorldServer worldserver, @Nullable Entity entity, Vec3D vec3d, double d0, MobEffect mobeffect, int i) {
|
||||
+ // CraftBukkit start
|
||||
+ return addEffectToPlayersAround(worldserver, entity, vec3d, d0, mobeffect, i, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.UNKNOWN);
|
||||
+ }
|
||||
+
|
||||
+ public static List<EntityPlayer> addEffectToPlayersAround(WorldServer worldserver, @Nullable Entity entity, Vec3D vec3d, double d0, MobEffect mobeffect, int i, org.bukkit.event.entity.EntityPotionEffectEvent.Cause cause) {
|
||||
+ // CraftBukkit end
|
||||
MobEffectList mobeffectlist = mobeffect.getEffect();
|
||||
List<EntityPlayer> list = worldserver.getPlayers((entityplayer) -> {
|
||||
return entityplayer.gameMode.isSurvival() && (entity == null || !entity.isAlliedTo((Entity) entityplayer)) && vec3d.closerThan(entityplayer.position(), d0) && (!entityplayer.hasEffect(mobeffectlist) || entityplayer.getEffect(mobeffectlist).getAmplifier() < mobeffect.getAmplifier() || entityplayer.getEffect(mobeffectlist).getDuration() < i);
|
||||
});
|
||||
|
||||
list.forEach((entityplayer) -> {
|
||||
- entityplayer.addEffect(new MobEffect(mobeffect), entity);
|
||||
+ entityplayer.addEffect(new MobEffect(mobeffect), entity, cause); // CraftBukkit
|
||||
});
|
||||
return list;
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/effect/MobEffects.java
|
||||
+++ b/net/minecraft/world/effect/MobEffects.java
|
||||
@@ -65,6 +65,14 @@
|
||||
});
|
||||
public static final MobEffectList HERO_OF_THE_VILLAGE = register(32, "hero_of_the_village", new MobEffectList(MobEffectInfo.BENEFICIAL, 4521796));
|
||||
@@ -69,6 +69,14 @@
|
||||
return new MobEffect.a(22);
|
||||
}));
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ static {
|
||||
|
||||
Reference in New Issue
Block a user