2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/entity/projectile/EntityTippedArrow.java
|
|
|
|
+++ b/net/minecraft/world/entity/projectile/EntityTippedArrow.java
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -142,6 +142,25 @@
|
2016-03-03 02:43:58 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // CraftBukkit start accessor methods
|
|
|
|
+ public void refreshEffects() {
|
2021-06-11 07:00:00 +02:00
|
|
|
+ this.getDataWatcher().set(EntityTippedArrow.ID_EFFECT_COLOR, PotionUtil.a((Collection) PotionUtil.a(this.potion, (Collection) this.effects)));
|
2016-03-03 02:43:58 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getType() {
|
2021-06-11 07:00:00 +02:00
|
|
|
+ return IRegistry.POTION.getKey(this.potion).toString();
|
2016-03-03 02:43:58 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setType(String string) {
|
2021-06-11 07:00:00 +02:00
|
|
|
+ this.potion = IRegistry.POTION.get(new net.minecraft.resources.MinecraftKey(string));
|
|
|
|
+ this.getDataWatcher().set(EntityTippedArrow.ID_EFFECT_COLOR, PotionUtil.a((Collection) PotionUtil.a(this.potion, (Collection) this.effects)));
|
2016-03-03 02:43:58 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean isTipped() {
|
2021-06-11 07:00:00 +02:00
|
|
|
+ return !(this.effects.isEmpty() && this.potion == Potions.EMPTY);
|
2016-03-03 02:43:58 +01:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
+
|
2017-05-14 04:00:00 +02:00
|
|
|
public int getColor() {
|
2021-06-11 07:00:00 +02:00
|
|
|
return (Integer) this.entityData.get(EntityTippedArrow.ID_EFFECT_COLOR);
|
2016-03-03 02:43:58 +01:00
|
|
|
}
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -210,7 +229,7 @@
|
2018-07-20 08:04:37 +02:00
|
|
|
|
|
|
|
while (iterator.hasNext()) {
|
|
|
|
mobeffect = (MobEffect) iterator.next();
|
2021-06-11 07:00:00 +02:00
|
|
|
- entityliving.addEffect(new MobEffect(mobeffect.getMobEffect(), Math.max(mobeffect.getDuration() / 8, 1), mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isShowParticles()), entity);
|
|
|
|
+ entityliving.addEffect(new MobEffect(mobeffect.getMobEffect(), Math.max(mobeffect.getDuration() / 8, 1), mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isShowParticles()), entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ARROW); // CraftBukkit
|
2018-07-20 08:04:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!this.effects.isEmpty()) {
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -218,7 +237,7 @@
|
2018-07-20 08:04:37 +02:00
|
|
|
|
|
|
|
while (iterator.hasNext()) {
|
|
|
|
mobeffect = (MobEffect) iterator.next();
|
2021-06-11 07:00:00 +02:00
|
|
|
- entityliving.addEffect(mobeffect, entity);
|
|
|
|
+ entityliving.addEffect(mobeffect, entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ARROW); // CraftBukkit
|
2018-07-20 08:04:37 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|