diff options
author | t00thpick1 <t00thpick1dirko@gmail.com> | 2016-03-02 20:43:58 -0500 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-03-12 12:38:22 +1100 |
commit | 4a8818c5fd4be406c59b518b86f10f39b4e6dcdd (patch) | |
tree | 372af2cd4688e8f5142eedd7601a919e58f65b8b /nms-patches | |
parent | 75286088fe01abc77edb96b5c240f9de6da86c7c (diff) | |
download | craftbukkit-4a8818c5fd4be406c59b518b86f10f39b4e6dcdd.tar craftbukkit-4a8818c5fd4be406c59b518b86f10f39b4e6dcdd.tar.gz craftbukkit-4a8818c5fd4be406c59b518b86f10f39b4e6dcdd.tar.lz craftbukkit-4a8818c5fd4be406c59b518b86f10f39b4e6dcdd.tar.xz craftbukkit-4a8818c5fd4be406c59b518b86f10f39b4e6dcdd.zip |
SPIGOT-1638 / SPIGOT-1673: Rework Potions API
Diffstat (limited to 'nms-patches')
-rw-r--r-- | nms-patches/EntityAreaEffectCloud.patch | 25 | ||||
-rw-r--r-- | nms-patches/EntityPotion.patch | 7 | ||||
-rw-r--r-- | nms-patches/EntityTippedArrow.patch | 37 |
3 files changed, 67 insertions, 2 deletions
diff --git a/nms-patches/EntityAreaEffectCloud.patch b/nms-patches/EntityAreaEffectCloud.patch new file mode 100644 index 00000000..0be2ccd8 --- /dev/null +++ b/nms-patches/EntityAreaEffectCloud.patch @@ -0,0 +1,25 @@ +--- a/net/minecraft/server/EntityAreaEffectCloud.java ++++ b/net/minecraft/server/EntityAreaEffectCloud.java +@@ -91,6 +91,22 @@ + + } + ++ // CraftBukkit start accessor methods ++ public void refreshEffects() { ++ if (!this.au) { ++ this.getDataWatcher().set(EntityAreaEffectCloud.b, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.e, (Collection) this.effects)))); // PAIL: rename ++ } ++ } ++ ++ public String getType() { ++ return ((MinecraftKey) PotionRegistry.a.b(this.e)).toString(); // PAIL: rename ++ } ++ ++ public void setType(String string) { ++ a(PotionRegistry.a.get(new MinecraftKey(string))); // PAIL: rename ++ } ++ // CraftBukkit end ++ + public int getColor() { + return ((Integer) this.getDataWatcher().get(EntityAreaEffectCloud.b)).intValue(); + } diff --git a/nms-patches/EntityPotion.patch b/nms-patches/EntityPotion.patch index b8469651..f4731684 100644 --- a/nms-patches/EntityPotion.patch +++ b/nms-patches/EntityPotion.patch @@ -101,7 +101,7 @@ } } } -@@ -138,10 +173,10 @@ +@@ -138,19 +173,20 @@ } } } @@ -115,7 +115,10 @@ } } -@@ -151,6 +186,7 @@ +- private boolean n() { ++ public boolean n() { // PAIL: rename, access + return this.getItem().getItem() == Items.LINGERING_POTION; + } private void a(BlockPosition blockposition) { if (this.world.getType(blockposition).getBlock() == Blocks.FIRE) { diff --git a/nms-patches/EntityTippedArrow.patch b/nms-patches/EntityTippedArrow.patch new file mode 100644 index 00000000..135274da --- /dev/null +++ b/nms-patches/EntityTippedArrow.patch @@ -0,0 +1,37 @@ +--- a/net/minecraft/server/EntityTippedArrow.java ++++ b/net/minecraft/server/EntityTippedArrow.java +@@ -10,7 +10,7 @@ + + private static final DataWatcherObject<Integer> f = DataWatcher.a(EntityTippedArrow.class, DataWatcherRegistry.b); + private PotionRegistry g; +- private final Set<MobEffect> h; ++ public final Set<MobEffect> h; // CraftBukkit private -> public + + public EntityTippedArrow(World world) { + super(world); +@@ -98,6 +98,25 @@ + } + } + ++ // CraftBukkit start accessor methods ++ public void refreshEffects() { ++ this.getDataWatcher().set(EntityTippedArrow.f, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.g, (Collection) this.h)))); // PAIL: rename ++ } ++ ++ public String getType() { ++ return ((MinecraftKey) PotionRegistry.a.b(this.g)).toString(); ++ } ++ ++ public void setType(String string) { ++ this.g = PotionRegistry.a.get(new MinecraftKey(string)); ++ this.datawatcher.set(EntityTippedArrow.f, Integer.valueOf(PotionUtil.a((Collection) PotionUtil.a(this.g, (Collection) this.h)))); // PAIL: rename ++ } ++ ++ public boolean isTipped() { ++ return !(this.h.isEmpty() && this.g == Potions.a); // PAIL: rename ++ } ++ // CraftBukkit end ++ + public int n() { + return ((Integer) this.datawatcher.get(EntityTippedArrow.f)).intValue(); + } |