2016-03-03 02:43:58 +01:00
|
|
|
--- a/net/minecraft/server/EntityTippedArrow.java
|
|
|
|
+++ b/net/minecraft/server/EntityTippedArrow.java
|
2019-12-10 23:00:00 +01:00
|
|
|
@@ -122,6 +122,25 @@
|
2016-03-03 02:43:58 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // CraftBukkit start accessor methods
|
|
|
|
+ public void refreshEffects() {
|
2019-04-23 04:00:00 +02:00
|
|
|
+ this.getDataWatcher().set(EntityTippedArrow.COLOR, PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects)));
|
2016-03-03 02:43:58 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getType() {
|
2018-08-26 04:00:00 +02:00
|
|
|
+ return IRegistry.POTION.getKey(this.potionRegistry).toString();
|
2016-03-03 02:43:58 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setType(String string) {
|
2018-08-26 04:00:00 +02:00
|
|
|
+ this.potionRegistry = IRegistry.POTION.get(new MinecraftKey(string));
|
2019-04-23 04:00:00 +02:00
|
|
|
+ this.getDataWatcher().set(EntityTippedArrow.COLOR, PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects)));
|
2016-03-03 02:43:58 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean isTipped() {
|
2016-11-17 02:41:03 +01:00
|
|
|
+ return !(this.effects.isEmpty() && this.potionRegistry == Potions.EMPTY);
|
2016-03-03 02:43:58 +01:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
+
|
2017-05-14 04:00:00 +02:00
|
|
|
public int getColor() {
|
2019-04-23 04:00:00 +02:00
|
|
|
return (Integer) this.datawatcher.get(EntityTippedArrow.COLOR);
|
2016-03-03 02:43:58 +01:00
|
|
|
}
|
2019-12-10 23:00:00 +01:00
|
|
|
@@ -189,7 +208,7 @@
|
2018-07-20 08:04:37 +02:00
|
|
|
|
|
|
|
while (iterator.hasNext()) {
|
|
|
|
mobeffect = (MobEffect) iterator.next();
|
|
|
|
- entityliving.addEffect(new MobEffect(mobeffect.getMobEffect(), Math.max(mobeffect.getDuration() / 8, 1), mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isShowParticles()));
|
|
|
|
+ entityliving.addEffect(new MobEffect(mobeffect.getMobEffect(), Math.max(mobeffect.getDuration() / 8, 1), mobeffect.getAmplifier(), mobeffect.isAmbient(), mobeffect.isShowParticles()), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ARROW); // CraftBukkit
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!this.effects.isEmpty()) {
|
2019-12-10 23:00:00 +01:00
|
|
|
@@ -197,7 +216,7 @@
|
2018-07-20 08:04:37 +02:00
|
|
|
|
|
|
|
while (iterator.hasNext()) {
|
|
|
|
mobeffect = (MobEffect) iterator.next();
|
|
|
|
- entityliving.addEffect(mobeffect);
|
|
|
|
+ entityliving.addEffect(mobeffect, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ARROW); // CraftBukkit
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|