3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00
Paper/nms-patches/EntityTippedArrow.patch

36 Zeilen
1.3 KiB
Diff

--- a/net/minecraft/server/EntityTippedArrow.java
+++ b/net/minecraft/server/EntityTippedArrow.java
@@ -116,11 +116,30 @@
}
}
- public int o() {
+ // CraftBukkit start accessor methods
+ public void refreshEffects() {
+ this.getDataWatcher().set(EntityTippedArrow.f, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects))));
+ }
+
+ public String getType() {
+ return ((MinecraftKey) PotionRegistry.a.b(this.potionRegistry)).toString();
+ }
+
+ public void setType(String string) {
+ this.potionRegistry = PotionRegistry.a.get(new MinecraftKey(string));
+ this.datawatcher.set(EntityTippedArrow.f, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects))));
+ }
+
+ public boolean isTipped() {
+ return !(this.effects.isEmpty() && this.potionRegistry == Potions.EMPTY);
+ }
+ // CraftBukkit end
+
+ public int o() { // PAIL: rename getColor
return ((Integer) this.datawatcher.get(EntityTippedArrow.f)).intValue();
}
- private void d(int i) {
+ public void d(int i) { // PAIL: private -> public, rename setColor
this.at = true;
this.datawatcher.set(EntityTippedArrow.f, Integer.valueOf(i));
}