diff --git a/pom.xml b/pom.xml
index f1657460..728a1bdc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,12 +53,12 @@
org.spigotmc
spigot-api
- 1.14-R0.1-SNAPSHOT
+ 1.15-R0.1-SNAPSHOT
org.spigotmc
spigot
- 1.14-R0.1-SNAPSHOT
+ 1.15-R0.1-SNAPSHOT
diff --git a/src/main/java/me/libraryaddict/disguise/LibsDisguises.java b/src/main/java/me/libraryaddict/disguise/LibsDisguises.java
index 9831efa7..b3edb5c2 100644
--- a/src/main/java/me/libraryaddict/disguise/LibsDisguises.java
+++ b/src/main/java/me/libraryaddict/disguise/LibsDisguises.java
@@ -60,7 +60,7 @@ public class LibsDisguises extends JavaPlugin {
"Blocks, Admins)");
}
- if (!ReflectionManager.getMinecraftVersion().startsWith("1.14.4")) {
+ if (!ReflectionManager.getMinecraftVersion().startsWith("1.15")) {
getLogger().severe("You're using the wrong version of Lib's Disguises for your server! This is " +
"intended for 1.14.4!");
getPluginLoader().disablePlugin(this);
diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/DisguiseType.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/DisguiseType.java
index 34a2afac..f64e737c 100644
--- a/src/main/java/me/libraryaddict/disguise/disguisetypes/DisguiseType.java
+++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/DisguiseType.java
@@ -4,6 +4,7 @@ import me.libraryaddict.disguise.utilities.translations.TranslateType;
import org.apache.commons.lang.StringUtils;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
+import org.omg.CORBA.UNKNOWN;
public enum DisguiseType {
AREA_EFFECT_CLOUD(3, 0),
@@ -14,6 +15,8 @@ public enum DisguiseType {
BAT,
+ BEE,
+
BLAZE,
BOAT(1),
diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/MetaIndex.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/MetaIndex.java
index f37a4bff..c6b3980a 100644
--- a/src/main/java/me/libraryaddict/disguise/disguisetypes/MetaIndex.java
+++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/MetaIndex.java
@@ -108,6 +108,10 @@ public class MetaIndex {
*/
public static MetaIndex BAT_HANGING = new MetaIndex<>(BatWatcher.class, 0, (byte) 1);
+ public static MetaIndex BEE_META = new MetaIndex<>(BeeWatcher.class, 0, (byte) 0);
+
+ public static MetaIndex BEE_ANGER = new MetaIndex<>(BeeWatcher.class, 1, 0);
+
/**
* If the blaze is ignited, false/true state
*/
@@ -195,6 +199,8 @@ public class MetaIndex {
*/
public static MetaIndex ENDERMAN_AGRESSIVE = new MetaIndex<>(EndermanWatcher.class, 1, false);
+ public static MetaIndex ENDERMAN_UNKNOWN = new MetaIndex<>(EndermanWatcher.class, 2, false);
+
/**
* What block the enderman is holding
*/
@@ -342,7 +348,12 @@ public class MetaIndex {
*/
public static MetaIndex LIVING_POTIONS = new MetaIndex<>(LivingWatcher.class, 2, 0);
- public static MetaIndex> LIVING_BED_POSITION = new MetaIndex<>(LivingWatcher.class, 5,
+ /**
+ * How many bee stings does the entity have
+ */
+ public static MetaIndex LIVING_STINGS = new MetaIndex<>(LivingWatcher.class, 5, 0);
+
+ public static MetaIndex> LIVING_BED_POSITION = new MetaIndex<>(LivingWatcher.class, 6,
Optional.empty());
/**
@@ -477,6 +488,8 @@ public class MetaIndex {
public static MetaIndex TRIDENT_ENCHANTS = new MetaIndex<>(TridentWatcher.class, 0, (byte) 0);
+ public static MetaIndex TRIDENT_ENCHANTED = new MetaIndex<>(TridentWatcher.class, 1, false);
+
public static MetaIndex TROPICAL_FISH_VARIANT = new MetaIndex<>(TropicalFishWatcher.class, 0, 0);
public static MetaIndex TURTLE_HOME_POSITION = new MetaIndex<>(TurtleWatcher.class, 0,
@@ -512,11 +525,9 @@ public class MetaIndex {
public static MetaIndex WITHER_SKULL_BLUE = new MetaIndex<>(WitherSkullWatcher.class, 0, false);
- public static MetaIndex WOLF_BEGGING = new MetaIndex<>(WolfWatcher.class, 1, false);
+ public static MetaIndex WOLF_BEGGING = new MetaIndex<>(WolfWatcher.class, 0, false);
- public static MetaIndex WOLF_COLLAR = new MetaIndex<>(WolfWatcher.class, 2, 14);
-
- public static MetaIndex WOLF_DAMAGE = new MetaIndex<>(WolfWatcher.class, 0, 1F);
+ public static MetaIndex WOLF_COLLAR = new MetaIndex<>(WolfWatcher.class, 1, 14);
public static MetaIndex ZOMBIE_BABY = new MetaIndex<>(ZombieWatcher.class, 0, false);
diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/BeeWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/BeeWatcher.java
new file mode 100644
index 00000000..148ddbff
--- /dev/null
+++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/BeeWatcher.java
@@ -0,0 +1,63 @@
+package me.libraryaddict.disguise.disguisetypes.watchers;
+
+import me.libraryaddict.disguise.disguisetypes.Disguise;
+import me.libraryaddict.disguise.disguisetypes.MetaIndex;
+
+/**
+ * Created by libraryaddict on 14/12/2019.
+ */
+public class BeeWatcher extends AgeableWatcher {
+ public BeeWatcher(Disguise disguise) {
+ super(disguise);
+ }
+
+ public void setBeeAnger(int beeAnger) {
+ setData(MetaIndex.BEE_ANGER, beeAnger);
+ sendData(MetaIndex.BEE_ANGER);
+ }
+
+ public int getBeeAnger() {
+ return getData(MetaIndex.BEE_ANGER);
+ }
+
+ public void setHasNectar(boolean hasNectar) {
+ setBeeFlag(8, hasNectar);
+ }
+
+ public boolean hasNectar() {
+ return getBeeFlag(8);
+ }
+
+ public void setHasStung(boolean hasStung) {
+ setBeeFlag(4, hasStung);
+ }
+
+ public boolean hasStung() {
+ return getBeeFlag(4);
+ }
+
+ public void setFlipped(boolean isFlipped) {
+ setBeeFlag(2, isFlipped);
+ }
+
+ public boolean isFlipped() {
+ return getBeeFlag(2);
+ }
+
+ private boolean getBeeFlag(int value) {
+ return (getData(MetaIndex.PANDA_META) & value) != 0;
+ }
+
+ private void setBeeFlag(int no, boolean flag) {
+ byte b1 = getData(MetaIndex.BEE_META);
+
+ if (flag) {
+ b1 = (byte) (b1 | no);
+ } else {
+ b1 = (byte) (b1 & ~no);
+ }
+
+ setData(MetaIndex.BEE_META, b1);
+ sendData(MetaIndex.BEE_META);
+ }
+}
diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EndermanWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EndermanWatcher.java
index 58ca207e..70e3721c 100644
--- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EndermanWatcher.java
+++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EndermanWatcher.java
@@ -55,4 +55,9 @@ public class EndermanWatcher extends InsentientWatcher {
setData(MetaIndex.ENDERMAN_AGRESSIVE, isAggressive);
sendData(MetaIndex.ENDERMAN_AGRESSIVE);
}
+
+ public void setUnknown(boolean bo) {
+ setData(MetaIndex.ENDERMAN_UNKNOWN, bo);
+ sendData(MetaIndex.ENDERMAN_UNKNOWN);
+ }
}
diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/IllagerWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/IllagerWatcher.java
index ffbd48ec..aff1a33f 100644
--- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/IllagerWatcher.java
+++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/IllagerWatcher.java
@@ -1,7 +1,6 @@
package me.libraryaddict.disguise.disguisetypes.watchers;
import me.libraryaddict.disguise.disguisetypes.Disguise;
-import net.minecraft.server.v1_14_R1.EntityRaider;
/**
* Created by libraryaddict on 9/06/2017.
diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/TridentWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/TridentWatcher.java
index f5d069ca..777d4306 100644
--- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/TridentWatcher.java
+++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/TridentWatcher.java
@@ -1,6 +1,7 @@
package me.libraryaddict.disguise.disguisetypes.watchers;
import me.libraryaddict.disguise.disguisetypes.Disguise;
+import me.libraryaddict.disguise.disguisetypes.MetaIndex;
/**
* Created by libraryaddict on 6/08/2018.
@@ -9,4 +10,13 @@ public class TridentWatcher extends ArrowWatcher {
public TridentWatcher(Disguise disguise) {
super(disguise);
}
+
+ public void setEnchanted(boolean enchanted) {
+ setData(MetaIndex.TRIDENT_ENCHANTED, enchanted);
+ sendData(MetaIndex.TRIDENT_ENCHANTED);
+ }
+
+ public boolean isEnchanted() {
+ return getData(MetaIndex.TRIDENT_ENCHANTED);
+ }
}
diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/WolfWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/WolfWatcher.java
index a040035c..0641c950 100644
--- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/WolfWatcher.java
+++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/WolfWatcher.java
@@ -15,25 +15,6 @@ public class WolfWatcher extends TameableWatcher {
return AnimalColor.getColorByWool(getData(MetaIndex.WOLF_COLLAR));
}
- /**
- * Used for tail rotation.
- *
- * @return
- */
- public float getDamageTaken() {
- return getData(MetaIndex.WOLF_DAMAGE);
- }
-
- /**
- * Used for tail rotation.
- *
- * @param damage
- */
- public void setDamageTaken(float damage) {
- setData(MetaIndex.WOLF_DAMAGE, damage);
- sendData(MetaIndex.WOLF_DAMAGE);
- }
-
public boolean isBegging() {
return getData(MetaIndex.WOLF_BEGGING);
}
diff --git a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseSound.java b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseSound.java
index fee6bdfa..dbd77c10 100644
--- a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseSound.java
+++ b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseSound.java
@@ -19,6 +19,9 @@ public enum DisguiseSound {
BAT(Sound.ENTITY_BAT_HURT, null, Sound.ENTITY_BAT_DEATH, Sound.ENTITY_BAT_AMBIENT, Sound.ENTITY_PLAYER_SMALL_FALL,
Sound.ENTITY_BAT_LOOP, Sound.ENTITY_PLAYER_BIG_FALL, Sound.ENTITY_BAT_TAKEOFF),
+ BEE(Sound.ENTITY_BEE_HURT, null, Sound.ENTITY_BEE_DEATH, null, Sound.ENTITY_BEE_LOOP,
+ Sound.ENTITY_BEE_LOOP_AGGRESSIVE, Sound.ENTITY_BEE_POLLINATE, Sound.ENTITY_BEE_STING),
+
BLAZE(Sound.ENTITY_BLAZE_HURT, null, Sound.ENTITY_BLAZE_DEATH, Sound.ENTITY_BLAZE_AMBIENT,
Sound.ENTITY_PLAYER_SMALL_FALL, Sound.ENTITY_PLAYER_BIG_FALL, Sound.ENTITY_BLAZE_BURN,
Sound.ENTITY_BLAZE_SHOOT),
diff --git a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java
index cec90b14..c4098709 100644
--- a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java
+++ b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java
@@ -525,62 +525,6 @@ public class DisguiseUtilities {
return cord;
}
- public static PacketContainer[] getBedChunkPacket(Location newLoc, Location oldLoc) {
- int i = 0;
-
- PacketContainer[] packets = new PacketContainer[(newLoc != null ? 1 : 0) + (oldLoc != null ? 1 : 0)];
-
- if (oldLoc != null) {
- PacketContainer despawn = new PacketContainer(Server.UNLOAD_CHUNK);
-
- StructureModifier