2021-03-16 09:00:00 +11:00
|
|
|
--- a/net/minecraft/world/entity/projectile/EntityTippedArrow.java
|
|
|
|
+++ b/net/minecraft/world/entity/projectile/EntityTippedArrow.java
|
2023-06-24 17:15:05 +10:00
|
|
|
@@ -28,7 +28,7 @@
|
|
|
|
private static final int NO_EFFECT_COLOR = -1;
|
|
|
|
private static final DataWatcherObject<Integer> ID_EFFECT_COLOR = DataWatcher.defineId(EntityTippedArrow.class, DataWatcherRegistry.INT);
|
|
|
|
private static final byte EVENT_POTION_PUFF = 0;
|
|
|
|
- private PotionRegistry potion;
|
|
|
|
+ public PotionRegistry potion; // CraftBukkit private -> public
|
|
|
|
public final Set<MobEffect> effects;
|
|
|
|
private boolean fixedColor;
|
2016-03-02 20:43:58 -05:00
|
|
|
|
2023-06-24 17:15:05 +10:00
|
|
|
@@ -86,7 +86,7 @@
|
|
|
|
return nbttagcompound != null && nbttagcompound.contains("CustomPotionColor", 99) ? nbttagcompound.getInt("CustomPotionColor") : -1;
|
2016-03-02 20:43:58 -05:00
|
|
|
}
|
2023-06-24 17:15:05 +10:00
|
|
|
|
|
|
|
- private void updateColor() {
|
|
|
|
+ public void updateColor() { // CraftBukkit private -> public
|
|
|
|
this.fixedColor = false;
|
|
|
|
if (this.potion == Potions.EMPTY && this.effects.isEmpty()) {
|
|
|
|
this.entityData.set(EntityTippedArrow.ID_EFFECT_COLOR, -1);
|
|
|
|
@@ -212,7 +212,7 @@
|
2018-07-20 16:04:37 +10:00
|
|
|
mobeffect = (MobEffect) iterator.next();
|
2023-03-15 03:30:00 +11:00
|
|
|
entityliving.addEffect(new MobEffect(mobeffect.getEffect(), Math.max(mobeffect.mapDuration((i) -> {
|
|
|
|
return i / 8;
|
|
|
|
- }), 1), mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isVisible()), entity);
|
|
|
|
+ }), 1), mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isVisible()), entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ARROW); // CraftBukkit
|
2018-07-20 16:04:37 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!this.effects.isEmpty()) {
|
2023-06-24 17:15:05 +10:00
|
|
|
@@ -220,7 +220,7 @@
|
2018-07-20 16:04:37 +10:00
|
|
|
|
|
|
|
while (iterator.hasNext()) {
|
|
|
|
mobeffect = (MobEffect) iterator.next();
|
2021-06-11 15:00:00 +10:00
|
|
|
- entityliving.addEffect(mobeffect, entity);
|
|
|
|
+ entityliving.addEffect(mobeffect, entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ARROW); // CraftBukkit
|
2018-07-20 16:04:37 +10:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|