mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
Add more Witch API (#1564)
This commit is contained in:
parent
6ef36f5d24
commit
4a5ad2e1d2
4 changed files with 253 additions and 27 deletions
55
Spigot-API-Patches/Add-more-Witch-API.patch
Normal file
55
Spigot-API-Patches/Add-more-Witch-API.patch
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
||||||
|
Date: Fri, 12 Oct 2018 03:47:26 -0500
|
||||||
|
Subject: [PATCH] Add more Witch API
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/bukkit/entity/Witch.java b/src/main/java/org/bukkit/entity/Witch.java
|
||||||
|
index 7ac07ac07ac0..7ac07ac07ac0 100644
|
||||||
|
--- a/src/main/java/org/bukkit/entity/Witch.java
|
||||||
|
+++ b/src/main/java/org/bukkit/entity/Witch.java
|
||||||
|
@@ -0,0 +0,0 @@ package org.bukkit.entity;
|
||||||
|
|
||||||
|
import com.destroystokyo.paper.entity.RangedEntity;
|
||||||
|
|
||||||
|
+// Paper start
|
||||||
|
+import org.bukkit.inventory.ItemStack;
|
||||||
|
+import javax.annotation.Nullable;
|
||||||
|
+// Paper end
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
* Represents a Witch
|
||||||
|
*/
|
||||||
|
-public interface Witch extends Monster, RangedEntity { // Paper
|
||||||
|
+// Paper start
|
||||||
|
+public interface Witch extends Monster, RangedEntity {
|
||||||
|
+ /**
|
||||||
|
+ * Check if Witch is drinking a potion
|
||||||
|
+ *
|
||||||
|
+ * @return True if drinking a potion
|
||||||
|
+ */
|
||||||
|
+ boolean isDrinkingPotion();
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Get time remaining (in ticks) the Witch is drinking a potion
|
||||||
|
+ *
|
||||||
|
+ * @return Time remaining (in ticks)
|
||||||
|
+ */
|
||||||
|
+ int getPotionUseTimeLeft();
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Get the potion the Witch is drinking
|
||||||
|
+ *
|
||||||
|
+ * @return The potion the witch is drinking
|
||||||
|
+ */
|
||||||
|
+ ItemStack getDrinkingPotion();
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Set the potion the Witch should drink
|
||||||
|
+ *
|
||||||
|
+ * @param potion Potion to drink
|
||||||
|
+ */
|
||||||
|
+ void setDrinkingPotion(@Nullable ItemStack potion);
|
||||||
|
+ // Paper end
|
||||||
|
}
|
||||||
|
--
|
138
Spigot-Server-Patches/Add-more-Witch-API.patch
Normal file
138
Spigot-Server-Patches/Add-more-Witch-API.patch
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
||||||
|
Date: Fri, 12 Oct 2018 14:10:46 -0500
|
||||||
|
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 7ac07ac07ac0..7ac07ac07ac0 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/EntityWitch.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/EntityWitch.java
|
||||||
|
@@ -0,0 +0,0 @@
|
||||||
|
package net.minecraft.server;
|
||||||
|
|
||||||
|
+// Paper start
|
||||||
|
+import com.destroystokyo.paper.event.entity.WitchReadyPotionEvent;
|
||||||
|
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||||
|
+import org.bukkit.entity.Witch;
|
||||||
|
+// Paper end
|
||||||
|
+
|
||||||
|
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 {
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
public EntityWitch(World world) {
|
||||||
|
super(EntityTypes.WITCH, world);
|
||||||
|
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster 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, Boolean.valueOf(flag));
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public boolean isDrinkingPotion() { return l(); } // Paper - OBFHELPER
|
||||||
|
public boolean l() {
|
||||||
|
return ((Boolean) this.getDataWatcher().get(EntityWitch.c)).booleanValue();
|
||||||
|
}
|
||||||
|
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
|
||||||
|
}
|
||||||
|
|
||||||
|
if (potionregistry != null) {
|
||||||
|
- // Paper start
|
||||||
|
- 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));
|
||||||
|
+ // 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);
|
||||||
|
+ //AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||||
|
+ //attributeinstance.c(EntityWitch.b);
|
||||||
|
+ //attributeinstance.b(EntityWitch.b);
|
||||||
|
+
|
||||||
|
+ 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);
|
||||||
|
- AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||||
|
-
|
||||||
|
- attributeinstance.c(EntityWitch.b);
|
||||||
|
- attributeinstance.b(EntityWitch.b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
|
||||||
|
super.k();
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Paper start
|
||||||
|
+ public void setDrinkingPotion(ItemStack potion) {
|
||||||
|
+ 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);
|
||||||
|
+ AttributeInstance attributeinstance = getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||||
|
+ attributeinstance.removeModifier(EntityWitch.DRINKING_SPEED);
|
||||||
|
+ attributeinstance.addModifier(EntityWitch.DRINKING_SPEED);
|
||||||
|
+ }
|
||||||
|
+ // Paper end
|
||||||
|
+
|
||||||
|
protected float applyMagicModifier(DamageSource damagesource, float f) {
|
||||||
|
f = super.applyMagicModifier(damagesource, f);
|
||||||
|
if (damagesource.getEntity() == this) {
|
||||||
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
|
||||||
|
index 7ac07ac07ac0..7ac07ac07ac0 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;
|
||||||
|
|
||||||
|
+// Paper start
|
||||||
|
+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 CraftWitch(CraftServer server, EntityWitch entity) {
|
||||||
|
super(server, entity);
|
||||||
|
@@ -0,0 +0,0 @@ public class CraftWitch extends CraftMonster implements Witch, CraftRangedEntity
|
||||||
|
public EntityType getType() {
|
||||||
|
return EntityType.WITCH;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ // Paper start
|
||||||
|
+ public boolean isDrinkingPotion() {
|
||||||
|
+ return getHandle().isDrinkingPotion();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public int getPotionUseTimeLeft() {
|
||||||
|
+ return getHandle().getPotionUseTimeLeft();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public ItemStack getDrinkingPotion() {
|
||||||
|
+ return CraftItemStack.asCraftMirror(getHandle().getItemInMainHand());
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public void setDrinkingPotion(ItemStack potion) {
|
||||||
|
+ Preconditions.checkArgument(potion == null || potion.getType().isEmpty() || potion.getType() == Material.POTION, "must be potion, air, or null");
|
||||||
|
+ getHandle().setDrinkingPotion(CraftItemStack.asNMSCopy(potion));
|
||||||
|
+ }
|
||||||
|
+ // Paper end
|
||||||
|
}
|
||||||
|
--
|
|
@ -4,8 +4,23 @@ Date: Mon, 28 Mar 2016 20:55:47 -0400
|
||||||
Subject: [PATCH] MC Utils
|
Subject: [PATCH] MC Utils
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/AttributeInstance.java b/src/main/java/net/minecraft/server/AttributeInstance.java
|
||||||
|
index 1c1a6a37a..0929e0189 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/AttributeInstance.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/AttributeInstance.java
|
||||||
|
@@ -0,0 +0,0 @@ public interface AttributeInstance {
|
||||||
|
@Nullable
|
||||||
|
AttributeModifier a(UUID var1);
|
||||||
|
|
||||||
|
+ default void addModifier(AttributeModifier modifier) { b(modifier); } // Paper - OBFHELPER
|
||||||
|
void b(AttributeModifier var1);
|
||||||
|
|
||||||
|
+ default void removeModifier(AttributeModifier modifier) { c(modifier); } // Paper - OBFHELPER
|
||||||
|
void c(AttributeModifier var1);
|
||||||
|
|
||||||
|
void b(UUID var1);
|
||||||
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
|
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||||
index 6ffc535146..5c5f19b4b4 100644
|
index 6ffc53514..5c5f19b4b 100644
|
||||||
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
||||||
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
|
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||||
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
||||||
|
@ -50,7 +65,7 @@ index 6ffc535146..5c5f19b4b4 100644
|
||||||
return this.c(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2));
|
return this.c(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2));
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||||
index bc5e4a654a..d3eac35e4d 100644
|
index bc5e4a654..d3eac35e4 100644
|
||||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||||
@@ -0,0 +0,0 @@ import com.google.common.collect.Lists; // CraftBukkit
|
@@ -0,0 +0,0 @@ import com.google.common.collect.Lists; // CraftBukkit
|
||||||
|
@ -71,7 +86,7 @@ index bc5e4a654a..d3eac35e4d 100644
|
||||||
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
|
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
|
diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
|
||||||
index 744762b8b9..d9608121b6 100644
|
index 744762b8b..d9608121b 100644
|
||||||
--- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
|
--- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
|
||||||
+++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
|
+++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
|
||||||
@@ -0,0 +0,0 @@ public class ChunkCoordIntPair {
|
@@ -0,0 +0,0 @@ public class ChunkCoordIntPair {
|
||||||
|
@ -84,7 +99,7 @@ index 744762b8b9..d9608121b6 100644
|
||||||
return (long)i & 4294967295L | ((long)j & 4294967295L) << 32;
|
return (long)i & 4294967295L | ((long)j & 4294967295L) << 32;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
||||||
index 3b6b3b9a99..22af9c1885 100644
|
index 3b6b3b9a9..22af9c188 100644
|
||||||
--- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
--- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
||||||
+++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
+++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
||||||
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
||||||
|
@ -97,7 +112,7 @@ index 3b6b3b9a99..22af9c1885 100644
|
||||||
private final IChunkLoader e;
|
private final IChunkLoader e;
|
||||||
private final IAsyncTaskHandler f;
|
private final IAsyncTaskHandler f;
|
||||||
diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java
|
diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java
|
||||||
index 95ca5f6d80..0dc948a375 100644
|
index 95ca5f6d8..0dc948a37 100644
|
||||||
--- a/src/main/java/net/minecraft/server/DataBits.java
|
--- a/src/main/java/net/minecraft/server/DataBits.java
|
||||||
+++ b/src/main/java/net/minecraft/server/DataBits.java
|
+++ b/src/main/java/net/minecraft/server/DataBits.java
|
||||||
@@ -0,0 +0,0 @@ public class DataBits {
|
@@ -0,0 +0,0 @@ public class DataBits {
|
||||||
|
@ -109,7 +124,7 @@ index 95ca5f6d80..0dc948a375 100644
|
||||||
return this.a;
|
return this.a;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java
|
diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java
|
||||||
index 7f905b1e09..fa5b9262b4 100644
|
index 7f905b1e0..fa5b9262b 100644
|
||||||
--- a/src/main/java/net/minecraft/server/DataPalette.java
|
--- a/src/main/java/net/minecraft/server/DataPalette.java
|
||||||
+++ b/src/main/java/net/minecraft/server/DataPalette.java
|
+++ b/src/main/java/net/minecraft/server/DataPalette.java
|
||||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||||
|
@ -127,7 +142,7 @@ index 7f905b1e09..fa5b9262b4 100644
|
||||||
void b(PacketDataSerializer var1);
|
void b(PacketDataSerializer var1);
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||||
index 304e47bf20..6e7454b134 100644
|
index 304e47bf2..6e7454b13 100644
|
||||||
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||||
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
||||||
@@ -0,0 +0,0 @@ import java.util.function.Function;
|
@@ -0,0 +0,0 @@ import java.util.function.Function;
|
||||||
|
@ -169,7 +184,7 @@ index 304e47bf20..6e7454b134 100644
|
||||||
this.b();
|
this.b();
|
||||||
packetdataserializer.writeByte(this.i);
|
packetdataserializer.writeByte(this.i);
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java
|
diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java
|
||||||
index 2c6fbd1d6f..a5c147b989 100644
|
index 2c6fbd1d6..a5c147b98 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityCreature.java
|
--- a/src/main/java/net/minecraft/server/EntityCreature.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityCreature.java
|
+++ b/src/main/java/net/minecraft/server/EntityCreature.java
|
||||||
@@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityUnleashEvent;
|
@@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityUnleashEvent;
|
||||||
|
@ -181,7 +196,7 @@ index 2c6fbd1d6f..a5c147b989 100644
|
||||||
private float b;
|
private float b;
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||||
index ebb177927f..60b1dcd8ea 100644
|
index ebb177927..60b1dcd8e 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
|
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||||
|
@ -193,7 +208,7 @@ index ebb177927f..60b1dcd8ea 100644
|
||||||
// CraftBukkit start - fire event
|
// CraftBukkit start - fire event
|
||||||
setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true);
|
setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true);
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
index 1aefd3763a..76cc9085bd 100644
|
index 1aefd3763..76cc9085b 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||||
|
@ -205,7 +220,7 @@ index 1aefd3763a..76cc9085bd 100644
|
||||||
@Override
|
@Override
|
||||||
public float getBukkitYaw() {
|
public float getBukkitYaw() {
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java
|
diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java
|
||||||
index c0f48bbc29..f3cc2cef0a 100644
|
index c0f48bbc2..a0e3b72c1 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityMonster.java
|
--- a/src/main/java/net/minecraft/server/EntityMonster.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityMonster.java
|
+++ b/src/main/java/net/minecraft/server/EntityMonster.java
|
||||||
@@ -0,0 +0,0 @@
|
@@ -0,0 +0,0 @@
|
||||||
|
@ -217,8 +232,14 @@ index c0f48bbc29..f3cc2cef0a 100644
|
||||||
protected EntityMonster(EntityTypes<?> entitytypes, World world) {
|
protected EntityMonster(EntityTypes<?> entitytypes, World world) {
|
||||||
super(entitytypes, world);
|
super(entitytypes, world);
|
||||||
this.b_ = 5;
|
this.b_ = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public SoundCategory getSoundCategory() { return bV(); } // Paper - OBFHELPER
|
||||||
|
public SoundCategory bV() {
|
||||||
|
return SoundCategory.HOSTILE;
|
||||||
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
|
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||||
index 17bfa356f1..5c1ab6a0b6 100644
|
index 17bfa356f..5c1ab6a0b 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityTypes.java
|
--- a/src/main/java/net/minecraft/server/EntityTypes.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
|
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||||
|
@ -269,7 +290,7 @@ index 17bfa356f1..5c1ab6a0b6 100644
|
||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
index c54275bc2f..318c4204df 100644
|
index c54275bc2..318c4204d 100644
|
||||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
@@ -0,0 +0,0 @@ import org.bukkit.TreeType;
|
@@ -0,0 +0,0 @@ import org.bukkit.TreeType;
|
||||||
|
@ -300,7 +321,7 @@ index c54275bc2f..318c4204df 100644
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000..c97e116aaf
|
index 000000000..c97e116aa
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/net/minecraft/server/MCUtil.java
|
+++ b/src/main/java/net/minecraft/server/MCUtil.java
|
||||||
@@ -0,0 +0,0 @@
|
@@ -0,0 +0,0 @@
|
||||||
|
@ -621,7 +642,7 @@ index 0000000000..c97e116aaf
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java
|
diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java
|
||||||
index 41cd3ceabe..2a66a30264 100644
|
index 41cd3ceab..2a66a3026 100644
|
||||||
--- a/src/main/java/net/minecraft/server/NBTTagCompound.java
|
--- a/src/main/java/net/minecraft/server/NBTTagCompound.java
|
||||||
+++ b/src/main/java/net/minecraft/server/NBTTagCompound.java
|
+++ b/src/main/java/net/minecraft/server/NBTTagCompound.java
|
||||||
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
||||||
|
@ -666,7 +687,7 @@ index 41cd3ceabe..2a66a30264 100644
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
|
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||||
index 0afaea8109..26da897243 100644
|
index 0afaea810..26da89724 100644
|
||||||
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
||||||
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||||
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||||
|
@ -707,7 +728,7 @@ index 0afaea8109..26da897243 100644
|
||||||
public QueuedPacket(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericfuturelistener) {
|
public QueuedPacket(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericfuturelistener) {
|
||||||
this.a = packet;
|
this.a = packet;
|
||||||
diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||||
index d04afceb70..a63a5811d6 100644
|
index d04afceb7..a63a5811d 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||||
@@ -0,0 +0,0 @@ public class PacketDataSerializer extends ByteBuf {
|
@@ -0,0 +0,0 @@ public class PacketDataSerializer extends ByteBuf {
|
||||||
|
@ -719,7 +740,7 @@ index d04afceb70..a63a5811d6 100644
|
||||||
for (int j = 1; j < 5; ++j) {
|
for (int j = 1; j < 5; ++j) {
|
||||||
if ((i & -1 << j * 7) == 0) {
|
if ((i & -1 << j * 7) == 0) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java
|
diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java
|
||||||
index 8e312c7617..c20911c965 100644
|
index 8e312c761..c20911c96 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PacketEncoder.java
|
--- a/src/main/java/net/minecraft/server/PacketEncoder.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PacketEncoder.java
|
+++ b/src/main/java/net/minecraft/server/PacketEncoder.java
|
||||||
@@ -0,0 +0,0 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
@@ -0,0 +0,0 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
|
||||||
|
@ -731,7 +752,7 @@ index 8e312c7617..c20911c965 100644
|
||||||
throw new SkipEncodeException(throwable);
|
throw new SkipEncodeException(throwable);
|
||||||
} else {
|
} else {
|
||||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||||
index 12d6c99cf0..af382815f3 100644
|
index 12d6c99cf..af382815f 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||||
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
||||||
|
@ -752,7 +773,7 @@ index 12d6c99cf0..af382815f3 100644
|
||||||
int j = 0;
|
int j = 0;
|
||||||
ChunkSection[] achunksection = chunk.getSections();
|
ChunkSection[] achunksection = chunk.getSections();
|
||||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
index d455eadfc7..8db0b6a6db 100644
|
index d455eadfc..8db0b6a6d 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||||
|
@ -768,8 +789,20 @@ index d455eadfc7..8db0b6a6db 100644
|
||||||
// CraftBukkit start - multithreaded fields
|
// CraftBukkit start - multithreaded fields
|
||||||
private volatile int chatThrottle;
|
private volatile int chatThrottle;
|
||||||
private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle");
|
private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle");
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/PotionUtil.java b/src/main/java/net/minecraft/server/PotionUtil.java
|
||||||
|
index 8fce3b022..58ac6eafc 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/PotionUtil.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/PotionUtil.java
|
||||||
|
@@ -0,0 +0,0 @@ public class PotionUtil {
|
||||||
|
return nbttagcompound == null ? Potions.EMPTY : PotionRegistry.a(nbttagcompound.getString("Potion"));
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public static ItemStack addPotionToItemStack(ItemStack itemstack, PotionRegistry potionregistry) { return a(itemstack, potionregistry); } // Paper - OBFHELPER
|
||||||
|
public static ItemStack a(ItemStack itemstack, PotionRegistry potionregistry) {
|
||||||
|
MinecraftKey minecraftkey = IRegistry.POTION.getKey(potionregistry);
|
||||||
|
if (potionregistry == Potions.EMPTY) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
|
diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
|
||||||
index a21006290c..6c6f006f3a 100644
|
index a21006290..6c6f006f3 100644
|
||||||
--- a/src/main/java/net/minecraft/server/RegistryBlockID.java
|
--- a/src/main/java/net/minecraft/server/RegistryBlockID.java
|
||||||
+++ b/src/main/java/net/minecraft/server/RegistryBlockID.java
|
+++ b/src/main/java/net/minecraft/server/RegistryBlockID.java
|
||||||
@@ -0,0 +0,0 @@ public class RegistryBlockID<T> implements Registry<T> {
|
@@ -0,0 +0,0 @@ public class RegistryBlockID<T> implements Registry<T> {
|
||||||
|
@ -781,7 +814,7 @@ index a21006290c..6c6f006f3a 100644
|
||||||
return this.b.size();
|
return this.b.size();
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
|
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
|
||||||
index 1f1cb6a1b2..ced573d7fb 100644
|
index 1f1cb6a1b..ced573d7f 100644
|
||||||
--- a/src/main/java/net/minecraft/server/SystemUtils.java
|
--- a/src/main/java/net/minecraft/server/SystemUtils.java
|
||||||
+++ b/src/main/java/net/minecraft/server/SystemUtils.java
|
+++ b/src/main/java/net/minecraft/server/SystemUtils.java
|
||||||
@@ -0,0 +0,0 @@ public class SystemUtils {
|
@@ -0,0 +0,0 @@ public class SystemUtils {
|
||||||
|
|
|
@ -8,7 +8,7 @@ Use an optimized method to test if a block position meets a desired light level.
|
||||||
This method benefits from returning as soon as the desired light level matches.
|
This method benefits from returning as soon as the desired light level matches.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/BlockCrops.java b/src/main/java/net/minecraft/server/BlockCrops.java
|
diff --git a/src/main/java/net/minecraft/server/BlockCrops.java b/src/main/java/net/minecraft/server/BlockCrops.java
|
||||||
index 1506c9ede0..6ae6fc3ecb 100644
|
index 1506c9ede..6ae6fc3ec 100644
|
||||||
--- a/src/main/java/net/minecraft/server/BlockCrops.java
|
--- a/src/main/java/net/minecraft/server/BlockCrops.java
|
||||||
+++ b/src/main/java/net/minecraft/server/BlockCrops.java
|
+++ b/src/main/java/net/minecraft/server/BlockCrops.java
|
||||||
@@ -0,0 +0,0 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement
|
@@ -0,0 +0,0 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement
|
||||||
|
@ -21,7 +21,7 @@ index 1506c9ede0..6ae6fc3ecb 100644
|
||||||
|
|
||||||
if (i < this.e()) {
|
if (i < this.e()) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java
|
diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java
|
||||||
index 42478d1fed..7426d14cbf 100644
|
index 42478d1fe..7426d14cb 100644
|
||||||
--- a/src/main/java/net/minecraft/server/BlockSapling.java
|
--- a/src/main/java/net/minecraft/server/BlockSapling.java
|
||||||
+++ b/src/main/java/net/minecraft/server/BlockSapling.java
|
+++ b/src/main/java/net/minecraft/server/BlockSapling.java
|
||||||
@@ -0,0 +0,0 @@ public class BlockSapling extends BlockPlant implements IBlockFragilePlantElemen
|
@@ -0,0 +0,0 @@ public class BlockSapling extends BlockPlant implements IBlockFragilePlantElemen
|
||||||
|
@ -34,7 +34,7 @@ index 42478d1fed..7426d14cbf 100644
|
||||||
world.captureTreeGeneration = true;
|
world.captureTreeGeneration = true;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
diff --git a/src/main/java/net/minecraft/server/BlockStem.java b/src/main/java/net/minecraft/server/BlockStem.java
|
diff --git a/src/main/java/net/minecraft/server/BlockStem.java b/src/main/java/net/minecraft/server/BlockStem.java
|
||||||
index dd309030e5..7cddfc380c 100644
|
index dd309030e..7cddfc380 100644
|
||||||
--- a/src/main/java/net/minecraft/server/BlockStem.java
|
--- a/src/main/java/net/minecraft/server/BlockStem.java
|
||||||
+++ b/src/main/java/net/minecraft/server/BlockStem.java
|
+++ b/src/main/java/net/minecraft/server/BlockStem.java
|
||||||
@@ -0,0 +0,0 @@ public class BlockStem extends BlockPlant implements IBlockFragilePlantElement {
|
@@ -0,0 +0,0 @@ public class BlockStem extends BlockPlant implements IBlockFragilePlantElement {
|
||||||
|
@ -47,7 +47,7 @@ index dd309030e5..7cddfc380c 100644
|
||||||
|
|
||||||
if (random.nextInt((int) ((100.0F / (this == Blocks.PUMPKIN_STEM ? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier)) * (25.0F / f)) + 1) == 0) { // Spigot
|
if (random.nextInt((int) ((100.0F / (this == Blocks.PUMPKIN_STEM ? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier)) * (25.0F / f)) + 1) == 0) { // Spigot
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java
|
diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java
|
||||||
index f3cc2cef0a..7cba60e475 100644
|
index a0e3b72c1..f6231f3e5 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityMonster.java
|
--- a/src/main/java/net/minecraft/server/EntityMonster.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityMonster.java
|
+++ b/src/main/java/net/minecraft/server/EntityMonster.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
@@ -0,0 +0,0 @@ public abstract class EntityMonster extends EntityCreature implements IMonster {
|
||||||
|
@ -72,7 +72,7 @@ index f3cc2cef0a..7cba60e475 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
|
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
|
||||||
index 1ab3072cc3..e5170bff5b 100644
|
index 1ab3072cc..e5170bff5 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityZombie.java
|
--- a/src/main/java/net/minecraft/server/EntityZombie.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
|
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
|
||||||
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
|
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
|
||||||
|
|
Loading…
Reference in a new issue