Houston, we got a patch (#2731)
* Houston, we got a patch * is this the end of the beginning or the beginning of the end
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] Add more Witch API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java
|
||||
index ff4e73fff3..0b849f37c5 100644
|
||||
index be6ecfb08..f1a4c10ad 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityWitch.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityWitch.java
|
||||
@@ -0,0 +0,0 @@
|
||||
@@ -24,26 +24,26 @@ index ff4e73fff3..0b849f37c5 100644
|
||||
public class EntityWitch extends EntityRaider implements IRangedEntity {
|
||||
|
||||
private static final UUID b = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E");
|
||||
- private static final AttributeModifier bz = (new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION)).a(false);
|
||||
+ private static final AttributeModifier bz = (new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION)).a(false); private static final AttributeModifier DRINKING_SPEED = bz; // Paper - OBFHELPER
|
||||
private static final DataWatcherObject<Boolean> bA = DataWatcher.a(EntityWitch.class, DataWatcherRegistry.i);
|
||||
- private int bB;
|
||||
+ private int bB; public int getPotionUseTimeLeft() { return bB; } public void setPotionUseTimeLeft(int timeLeft) { bB = timeLeft; } // Paper - OBFHELPER
|
||||
private PathfinderGoalNearestHealableRaider<EntityRaider> bC;
|
||||
private PathfinderGoalNearestAttackableTargetWitch<EntityHuman> bD;
|
||||
- private static final AttributeModifier bw = (new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION)).a(false);
|
||||
+ private static final AttributeModifier bw = (new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION)).a(false); private static final AttributeModifier DRINKING_SPEED = bz; // Paper - OBFHELPER
|
||||
private static final DataWatcherObject<Boolean> bx = DataWatcher.a(EntityWitch.class, DataWatcherRegistry.i);
|
||||
- private int by;
|
||||
+ private int by; public int getPotionUseTimeLeft() { return by; } public void setPotionUseTimeLeft(int timeLeft) { by = timeLeft; } // Paper - OBFHELPER
|
||||
private PathfinderGoalNearestHealableRaider<EntityRaider> bz;
|
||||
private PathfinderGoalNearestAttackableTargetWitch<EntityHuman> bA;
|
||||
|
||||
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
|
||||
return SoundEffects.ENTITY_WITCH_DEATH;
|
||||
}
|
||||
|
||||
+ public void setDrinkingPotion(boolean drinkingPotion) { s(drinkingPotion); } // Paper - OBFHELPER
|
||||
public void s(boolean flag) {
|
||||
this.getDataWatcher().set(EntityWitch.bA, flag);
|
||||
+ public void setDrinkingPotion(boolean drinkingPotion) { t(drinkingPotion); } // Paper - OBFHELPER
|
||||
public void t(boolean flag) {
|
||||
this.getDataWatcher().set(EntityWitch.bx, flag);
|
||||
}
|
||||
|
||||
+ public boolean isDrinkingPotion() { return l(); } // Paper - OBFHELPER
|
||||
public boolean l() {
|
||||
return (Boolean) this.getDataWatcher().get(EntityWitch.bA);
|
||||
return (Boolean) this.getDataWatcher().get(EntityWitch.bx);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
|
||||
}
|
||||
@@ -67,13 +67,13 @@ index ff4e73fff3..0b849f37c5 100644
|
||||
+// attributeinstance.addModifier(EntityWitch.bz);
|
||||
+ this.setDrinkingPotion(PotionUtil.addPotionToItemStack(new ItemStack(Items.POTION), potionregistry));
|
||||
// Paper end
|
||||
- this.bB = this.getItemInMainHand().k();
|
||||
- this.s(true);
|
||||
- this.world.playSound((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F);
|
||||
- this.by = this.getItemInMainHand().k();
|
||||
- this.t(true);
|
||||
- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F);
|
||||
- AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
-
|
||||
- attributeinstance.removeModifier(EntityWitch.bz);
|
||||
- attributeinstance.addModifier(EntityWitch.bz);
|
||||
- attributeinstance.removeModifier(EntityWitch.bw);
|
||||
- attributeinstance.addModifier(EntityWitch.bw);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ index ff4e73fff3..0b849f37c5 100644
|
||||
+ setSlot(EnumItemSlot.MAINHAND, CraftItemStack.asNMSCopy(WitchReadyPotionEvent.process((Witch) getBukkitEntity(), CraftItemStack.asCraftMirror(potion))));
|
||||
+ setPotionUseTimeLeft(getItemInMainHand().getItemUseMaxDuration());
|
||||
+ setDrinkingPotion(true);
|
||||
+ world.sendSoundEffect(null, locX, locY, locZ, SoundEffects.ENTITY_WITCH_DRINK, getSoundCategory(), 1.0F, 0.8F + random.nextFloat() * 0.4F);
|
||||
+ world.sendSoundEffect(null, locX(), locY(), locZ(), SoundEffects.ENTITY_WITCH_DRINK, getSoundCategory(), 1.0F, 0.8F + random.nextFloat() * 0.4F);
|
||||
+ AttributeInstance attributeinstance = getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
+ attributeinstance.removeModifier(EntityWitch.DRINKING_SPEED);
|
||||
+ attributeinstance.addModifier(EntityWitch.DRINKING_SPEED);
|
||||
@@ -94,10 +94,10 @@ index ff4e73fff3..0b849f37c5 100644
|
||||
+ // Paper end
|
||||
+
|
||||
@Override
|
||||
public SoundEffect dV() {
|
||||
public SoundEffect eq() {
|
||||
return SoundEffects.ENTITY_WITCH_CELEBRATE;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
|
||||
index bae107e76e..b43a2bbd5b 100644
|
||||
index bae107e76..b43a2bbd5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
||||
Reference in New Issue
Block a user