More patches for 1.14

This commit is contained in:
William Blake Galbreath
2019-05-05 03:33:44 -05:00
parent f542bdef09
commit 3f43b7abe8
40 changed files with 537 additions and 546 deletions

View File

@@ -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 feedfc9d9c..955e0e19b9 100644
index ae9efb72c..3cbb34a0c 100644
--- a/src/main/java/net/minecraft/server/EntityWitch.java
+++ b/src/main/java/net/minecraft/server/EntityWitch.java
@@ -0,0 +0,0 @@
@@ -20,32 +20,32 @@ index feedfc9d9c..955e0e19b9 100644
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
public class EntityWitch extends EntityMonster implements IRangedEntity {
@@ -0,0 +0,0 @@ import java.util.function.Predicate;
public class EntityWitch extends EntityRaider implements IRangedEntity {
private static final UUID a = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E");
- private static final AttributeModifier b = (new AttributeModifier(EntityWitch.a, "Drinking speed penalty", -0.25D, 0)).a(false);
+ private static final AttributeModifier b = (new AttributeModifier(EntityWitch.a, "Drinking speed penalty", -0.25D, 0)).a(false); private static final AttributeModifier DRINKING_SPEED = b; // Paper - OBFHELPER
private static final DataWatcherObject<Boolean> c = DataWatcher.a(EntityWitch.class, DataWatcherRegistry.i);
- private int bC;
+ private int bC; public int getPotionUseTimeLeft() { return bC; } public void setPotionUseTimeLeft(int timeLeft) { bC = timeLeft; } // Paper - OBFHELPER
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;
public EntityWitch(World world) {
super(EntityTypes.WITCH, world);
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
return SoundEffects.ENTITY_WITCH_DEATH;
}
+ public void setDrinkingPotion(boolean drinkingPotion) { a(drinkingPotion); } // Paper - OBFHELPER
public void a(boolean flag) {
this.getDataWatcher().set(EntityWitch.c, flag);
+ public void setDrinkingPotion(boolean drinkingPotion) { s(drinkingPotion); } // Paper - OBFHELPER
public void s(boolean flag) {
this.getDataWatcher().set(EntityWitch.bA, flag);
}
+ public boolean isDrinkingPotion() { return l(); } // Paper - OBFHELPER
public boolean l() {
return (Boolean) this.getDataWatcher().get(EntityWitch.c);
return (Boolean) this.getDataWatcher().get(EntityWitch.bA);
}
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
}
if (potionregistry != null) {
@@ -54,27 +54,29 @@ index feedfc9d9c..955e0e19b9 100644
- org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion));
- this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack));
+ // Paper start - moved all this down into its own method
+ //this.setSlot(EnumItemSlot.MAINHAND, PotionUtil.a(new ItemStack(Items.POTION), potionregistry));
+ //this.bC = this.getItemInMainHand().k();
+ //this.a(true);
+ //this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_WITCH_DRINK, this.bV(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F);
+ //ItemStack potion = PotionUtil.a(new ItemStack(Items.POTION), potionregistry);
+ //org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion));
+ //this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack));
+ //this.bB = this.getItemInMainHand().k();
+ //this.s(true);
+ //this.world.a((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.c(EntityWitch.b);
+ //attributeinstance.b(EntityWitch.b);
+ //attributeinstance.c(EntityWitch.bz);
+ //attributeinstance.b(EntityWitch.bz);
+
+ setDrinkingPotion(PotionUtil.addPotionToItemStack(new ItemStack(Items.POTION), potionregistry));
// Paper end
- this.bC = this.getItemInMainHand().k();
- this.a(true);
- this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.ENTITY_WITCH_DRINK, this.bV(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F);
- this.bB = this.getItemInMainHand().k();
- this.s(true);
- this.world.a((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.c(EntityWitch.b);
- attributeinstance.b(EntityWitch.b);
- attributeinstance.c(EntityWitch.bz);
- attributeinstance.b(EntityWitch.bz);
}
}
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
super.movementTick();
}
@@ -90,28 +92,35 @@ index feedfc9d9c..955e0e19b9 100644
+ }
+ // Paper end
+
protected float applyMagicModifier(DamageSource damagesource, float f) {
f = super.applyMagicModifier(damagesource, f);
if (damagesource.getEntity() == this) {
@Override
public SoundEffect dW() {
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 f25998eb6d..ac465bda2e 100644
index 49e0f2206..d157d195d 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 @@ import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Witch;
import org.bukkit.entity.EntityType;
@@ -0,0 +0,0 @@
package org.bukkit.craftbukkit.entity;
-import com.destroystokyo.paper.entity.CraftRangedEntity; // Paper
import net.minecraft.server.EntityWitch;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Witch;
+// Paper start
+import com.destroystokyo.paper.entity.CraftRangedEntity;
+import com.google.common.base.Preconditions;
+import org.bukkit.Material;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.inventory.ItemStack;
+// Paper end
+
public class CraftWitch extends CraftMonster implements Witch, CraftRangedEntity<EntityWitch> { // Paper
-public class CraftWitch extends CraftRaider implements Witch, CraftRangedEntity<EntityWitch> { // Paper
+public class CraftWitch extends CraftRaider implements Witch, CraftRangedEntity<EntityWitch> {
public CraftWitch(CraftServer server, EntityWitch entity) {
super(server, entity);
@@ -0,0 +0,0 @@ public class CraftWitch extends CraftMonster implements Witch, CraftRangedEntity
}
@@ -0,0 +0,0 @@ public class CraftWitch extends CraftRaider implements Witch, CraftRangedEntity<
public EntityType getType() {
return EntityType.WITCH;
}