From 348b0b788932fd585705a6ec46aefe77164652b1 Mon Sep 17 00:00:00 2001
From: Jakllp <57708725+Jakllp@users.noreply.github.com>
Date: Wed, 25 Aug 2021 02:34:04 +0200
Subject: [PATCH] dev5.1 Hotfix
Fixed:
- Parrots spawn again
- Axolot-Variants work now
- Mooshrooms spawn again (and types work)
- Probably fixed UUID Error in 1.12
---
.../skill/experience/MonsterExperience.java | 2 +
modules/MyPet/pom.xml | 2 +-
.../commands/admin/CommandOptionCreate.java | 4 +-
.../Keyle/MyPet/entity/types/MyAxolotl.java | 11 +-
.../compat/v1_12_R1/entity/EntityMyPet.java | 6 +
.../v1_17_R1/entity/EntityRegistry.java | 4 +-
.../v1_17_R1/entity/MyAttributeDefaults.java | 143 +++++++++---------
.../entity/types/EntityMyAxolotl.java | 4 +-
.../v1_17_R1/entity/types/EntityMyParrot.java | 1 +
.../services/EntityConverterService.java | 11 ++
10 files changed, 109 insertions(+), 79 deletions(-)
diff --git a/modules/API/src/main/java/de/Keyle/MyPet/api/skill/experience/MonsterExperience.java b/modules/API/src/main/java/de/Keyle/MyPet/api/skill/experience/MonsterExperience.java
index ff056b16ab..ae3a96553a 100644
--- a/modules/API/src/main/java/de/Keyle/MyPet/api/skill/experience/MonsterExperience.java
+++ b/modules/API/src/main/java/de/Keyle/MyPet/api/skill/experience/MonsterExperience.java
@@ -60,6 +60,7 @@ public class MonsterExperience {
mobExp.put("CHICKEN", new MonsterExperience(1., 3., "CHICKEN"));
mobExp.put("SQUID", new MonsterExperience(1., 3., "SQUID"));
mobExp.put("SHEEP", new MonsterExperience(1., 3., "SHEEP"));
+ mobExp.put("GOAT", new MonsterExperience(1., 3., "GOAT"));
mobExp.put("OCELOT", new MonsterExperience(1., 3., "OCELOT"));
mobExp.put("MUSHROOM_COW", new MonsterExperience(1., 3., "MUSHROOM_COW"));
mobExp.put("VILLAGER", new MonsterExperience(0., "VILLAGER"));
@@ -103,6 +104,7 @@ public class MonsterExperience {
mobExp.put("TRADER_LLAMA", new MonsterExperience(1, 3, "TRADER_LLAMA"));
mobExp.put("WANDERING_TRADER", new MonsterExperience(1, 2, "WANDERING_TRADER"));
mobExp.put("BEE", new MonsterExperience(1, 3, "BEE"));
+ mobExp.put("AXOLOTL", new MonsterExperience(1, 3, "AXOLOTL"));
mobExp.put("ZOMBIFIED_PIGLIN", new MonsterExperience(5, "ZOMBIFIED_PIGLIN"));
mobExp.put("HOGLIN", new MonsterExperience(5, "HOGLIN"));
mobExp.put("ZOGLIN", new MonsterExperience(5, "ZOGLIN"));
diff --git a/modules/MyPet/pom.xml b/modules/MyPet/pom.xml
index 74cba96a27..4074db1447 100644
--- a/modules/MyPet/pom.xml
+++ b/modules/MyPet/pom.xml
@@ -24,7 +24,7 @@
de.keyle
mypet
- 3.12-dev5
+ 3.12-dev5.1
jar
MyPet
https://www.spigotmc.org/resources/mypet.12725/
diff --git a/modules/Plugin/src/main/java/de/Keyle/MyPet/commands/admin/CommandOptionCreate.java b/modules/Plugin/src/main/java/de/Keyle/MyPet/commands/admin/CommandOptionCreate.java
index 617e822e75..cddb115233 100644
--- a/modules/Plugin/src/main/java/de/Keyle/MyPet/commands/admin/CommandOptionCreate.java
+++ b/modules/Plugin/src/main/java/de/Keyle/MyPet/commands/admin/CommandOptionCreate.java
@@ -63,7 +63,7 @@ public class CommandOptionCreate implements CommandOptionTabCompleter {
petTypeOptionMap.put("axolotl", new CommandOptionCreator()
.add("baby")
- .add("type:")
+ .add("variant:")
.get());
petTypeOptionMap.put("bee", new CommandOptionCreator()
@@ -539,6 +539,8 @@ public static void createInfo(MyPetType petType, String[] args, TagCompound comp
}
compound.getCompoundData().put("Variant", new TagInt(variant));
} else if (petType == MyPetType.Parrot) {
+ compound.getCompoundData().put("Variant", new TagInt(variant));
+ } else if (petType == MyPetType.Axolotl) {
compound.getCompoundData().put("Variant", new TagInt(variant));
} else if (petType == MyPetType.TropicalFish) {
compound.getCompoundData().put("Variant", new TagInt(variant));
diff --git a/modules/Plugin/src/main/java/de/Keyle/MyPet/entity/types/MyAxolotl.java b/modules/Plugin/src/main/java/de/Keyle/MyPet/entity/types/MyAxolotl.java
index 27590a602d..1d543b7209 100644
--- a/modules/Plugin/src/main/java/de/Keyle/MyPet/entity/types/MyAxolotl.java
+++ b/modules/Plugin/src/main/java/de/Keyle/MyPet/entity/types/MyAxolotl.java
@@ -31,7 +31,7 @@
public class MyAxolotl extends MyPet implements de.Keyle.MyPet.api.entity.types.MyAxolotl {
protected boolean isBaby = false;
- protected int axolotlType = 1;
+ protected int axolotlType = 0;
public MyAxolotl(MyPetPlayer petOwner) {
super(petOwner);
@@ -86,6 +86,13 @@ public void setBaby(boolean flag) {
@Override
public String toString() {
- return "MyAxolotl{owner=" + getOwner().getName() + ", name=" + ChatColor.stripColor(petName) + ", exp=" + experience.getExp() + "/" + experience.getRequiredExp() + ", lv=" + experience.getLevel() + ", status=" + status.name() + ", skilltree=" + (skilltree != null ? skilltree.getName() : "-") + ", worldgroup=" + worldGroup + ", baby=" + isBaby() + "}";
+ return "MyAxolotl{owner=" + getOwner().getName() +
+ ", name=" + ChatColor.stripColor(petName) +
+ ", exp=" + experience.getExp() + "/" + experience.getRequiredExp() +
+ ", lv=" + experience.getLevel() +
+ ", status=" + status.name() +
+ ", skilltree=" + (skilltree != null ? skilltree.getName() : "-") +
+ ", worldgroup=" + worldGroup +
+ ", baby=" + isBaby() + "}";
}
}
\ No newline at end of file
diff --git a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/EntityMyPet.java b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/EntityMyPet.java
index 6def656fa4..a6691fe6ff 100644
--- a/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/EntityMyPet.java
+++ b/modules/v1_12_R1/src/main/java/de/Keyle/MyPet/compat/v1_12_R1/entity/EntityMyPet.java
@@ -69,6 +69,7 @@
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.List;
+import java.util.UUID;
public abstract class EntityMyPet extends EntityCreature implements IAnimal, MyPetMinecraftEntity {
@@ -1270,4 +1271,9 @@ public DamageSource ce() {
}
return source;
}
+
+ @Override
+ public UUID getUniqueID() {
+ return this.uniqueID;
+ }
}
\ No newline at end of file
diff --git a/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/entity/EntityRegistry.java b/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/entity/EntityRegistry.java
index 757a685f76..58db4a0c57 100644
--- a/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/entity/EntityRegistry.java
+++ b/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/entity/EntityRegistry.java
@@ -55,7 +55,7 @@ public class EntityRegistry extends de.Keyle.MyPet.api.entity.EntityRegistry {
BiMap> entityClasses = HashBiMap.create();
Map entityTypes = new HashMap<>();
- protected void registerEntityType(MyPetType petType, String key, DefaultedRegistry> entityRegistry) { //TODO 2021/08/19 The only thing left: They need to follow the player
+ protected void registerEntityType(MyPetType petType, String key, DefaultedRegistry> entityRegistry) {
EntityType extends LivingEntity> types = (EntityType extends LivingEntity>) entityRegistry.get(new ResourceLocation(key));
entityTypes.put(petType, types);
registerDefaultAttributes(entityTypes.get(petType), types);
@@ -148,8 +148,6 @@ public DefaultedRegistry> getRegistry(DefaultedRegistry registryMa
}
protected void overwriteEntityID(EntityType types, int id, DefaultedRegistry> entityRegistry) {
-
-
try {
Field bgF = MappedRegistry.class.getDeclaredField("bw"); //TODO Might fail.
bgF.setAccessible(true);
diff --git a/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/entity/MyAttributeDefaults.java b/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/entity/MyAttributeDefaults.java
index d86cee908e..b781fe605b 100644
--- a/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/entity/MyAttributeDefaults.java
+++ b/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/entity/MyAttributeDefaults.java
@@ -34,6 +34,7 @@
import net.minecraft.world.entity.animal.Dolphin;
import net.minecraft.world.entity.animal.Fox;
import net.minecraft.world.entity.animal.IronGolem;
+import net.minecraft.world.entity.animal.MushroomCow;
import net.minecraft.world.entity.animal.Ocelot;
import net.minecraft.world.entity.animal.Panda;
import net.minecraft.world.entity.animal.Parrot;
@@ -105,80 +106,80 @@ public class MyAttributeDefaults {
static {
defaultAttribute
.putFast(EntityType.ARMOR_STAND, ArmorStand.createLivingAttributes().build()) //Armor-Stand
- .putFast(EntityType.AXOLOTL, Axolotl.createAttributes().build()) //Axolotl
- .putFast(EntityType.BAT, Bat.createAttributes().build()) //Bat
- .putFast(EntityType.BEE, Bee.createAttributes().build()) //Bee
- .putFast(EntityType.BLAZE, Blaze.createAttributes().build()) //Blaze
- .putFast(EntityType.CAT, Cat.createAttributes().build()) //Cat
- .putFast(EntityType.CAVE_SPIDER, CaveSpider.createAttributes().build()) //CaveSpider
- .putFast(EntityType.CHICKEN, Chicken.createAttributes().build()) //Chicken
- .putFast(EntityType.COD, Cod.createAttributes().build()) //Cod
- .putFast(EntityType.COW, Cow.createAttributes().build()) //Cow
- .putFast(EntityType.CREEPER, Creeper.createAttributes().build()) //Creeper
- .putFast(EntityType.DOLPHIN, Dolphin.createAttributes().build()) //Dolphin
- .putFast(EntityType.DONKEY, Donkey.createLivingAttributes().build()) //Donkey
- .putFast(EntityType.ZOMBIE, Zombie.createAttributes().build()) //Drowned
- .putFast(EntityType.ELDER_GUARDIAN, ElderGuardian.createAttributes().build()) //Elder Guardian
- .putFast(EntityType.ENDERMAN, EnderMan.createAttributes().build()) //Enderman
- .putFast(EntityType.ENDERMITE, Endermite.createAttributes().build()) //Endermite
- .putFast(EntityType.ENDER_DRAGON, EnderDragon.createAttributes().build()) //Ender Dragon
- .putFast(EntityType.EVOKER, Evoker.createAttributes().build()) //Evoker
- .putFast(EntityType.FOX, Fox.createAttributes().build()) //Fox
- .putFast(EntityType.GHAST, Ghast.createAttributes().build()) //Ghast
- .putFast(EntityType.GIANT, Giant.createAttributes().build()) //Giant
- .putFast(EntityType.GUARDIAN, Guardian.createAttributes().build()) //Guardian
- .putFast(EntityType.GOAT, Goat.createAttributes().build()) //Goat
+ .putFast(EntityType.AXOLOTL, Axolotl.createAttributes().build()) //Axolotl
+ .putFast(EntityType.BAT, Bat.createAttributes().build()) //Bat
+ .putFast(EntityType.BEE, Bee.createAttributes().build()) //Bee
+ .putFast(EntityType.BLAZE, Blaze.createAttributes().build()) //Blaze
+ .putFast(EntityType.CAT, Cat.createAttributes().build()) //Cat
+ .putFast(EntityType.CAVE_SPIDER, CaveSpider.createAttributes().build()) //CaveSpider
+ .putFast(EntityType.CHICKEN, Chicken.createAttributes().build()) //Chicken
+ .putFast(EntityType.COD, Cod.createAttributes().build()) //Cod
+ .putFast(EntityType.COW, Cow.createAttributes().build()) //Cow
+ .putFast(EntityType.CREEPER, Creeper.createAttributes().build()) //Creeper
+ .putFast(EntityType.DOLPHIN, Dolphin.createAttributes().build()) //Dolphin
+ .putFast(EntityType.DONKEY, Donkey.createLivingAttributes().build()) //Donkey
+ .putFast(EntityType.ZOMBIE, Zombie.createAttributes().build()) //Drowned
+ .putFast(EntityType.ELDER_GUARDIAN, ElderGuardian.createAttributes().build()) //Elder Guardian
+ .putFast(EntityType.ENDERMAN, EnderMan.createAttributes().build()) //Enderman
+ .putFast(EntityType.ENDERMITE, Endermite.createAttributes().build()) //Endermite
+ .putFast(EntityType.ENDER_DRAGON, EnderDragon.createAttributes().build()) //Ender Dragon
+ .putFast(EntityType.EVOKER, Evoker.createAttributes().build()) //Evoker
+ .putFast(EntityType.FOX, Fox.createAttributes().build()) //Fox
+ .putFast(EntityType.GHAST, Ghast.createAttributes().build()) //Ghast
+ .putFast(EntityType.GIANT, Giant.createAttributes().build()) //Giant
+ .putFast(EntityType.GUARDIAN, Guardian.createAttributes().build()) //Guardian
+ .putFast(EntityType.GOAT, Goat.createAttributes().build()) //Goat
.putFast(EntityType.GLOW_SQUID, GlowSquid.createAttributes().build()) //GlowSquid
- .putFast(EntityType.HOGLIN, Hoglin.createAttributes().build()) //Hoglin
- .putFast(EntityType.HORSE, Horse.createBaseHorseAttributes().build()) //Horse
- .putFast(EntityType.HUSK, Husk.createAttributes().build()) //Husk
- .putFast(EntityType.ILLUSIONER, Illusioner.createAttributes().build()) //Illusioner
- .putFast(EntityType.IRON_GOLEM, IronGolem.createAttributes().build()) //Iron Golem
- .putFast(EntityType.LLAMA, Llama.createAttributes().build()) //Llama
- .putFast(EntityType.MAGMA_CUBE, MagmaCube.createAttributes().build()) //Magma Cube
- .putFast(EntityType.COW, Cow.createAttributes().build()) //Mooshroom
- .putFast(EntityType.MULE, Mule.createLivingAttributes().build()) //Mule
- .putFast(EntityType.OCELOT, Ocelot.createAttributes().build()) //Ocelot
- .putFast(EntityType.PANDA, Panda.createAttributes().build()) //Panda
- .putFast(EntityType.PARROT, Parrot.createAttributes().build()) //Parrot
- .putFast(EntityType.PHANTOM, Phantom.createLivingAttributes().build()) //Phantom
- .putFast(EntityType.PIG, Pig.createAttributes().build()) //Pig
- .putFast(EntityType.PIGLIN, Piglin.createAttributes().build()) //Piglin
- .putFast(EntityType.PIGLIN_BRUTE, PiglinBrute.createAttributes().build()) //Piglin Brute
- .putFast(EntityType.PILLAGER, Pillager.createAttributes().build()) //Pillager
- .putFast(EntityType.PLAYER, Player.createAttributes().build()) //Player
- .putFast(EntityType.POLAR_BEAR, PolarBear.createAttributes().build()) //PolarBear
- .putFast(EntityType.PUFFERFISH, Pufferfish.createAttributes().build()) //Pufferfish
- .putFast(EntityType.RABBIT, Rabbit.createAttributes().build()) //Rabbit
- .putFast(EntityType.RAVAGER, Ravager.createAttributes().build()) //Ravager
- .putFast(EntityType.SALMON, Salmon.createAttributes().build()) //Salmon
- .putFast(EntityType.SHEEP, Sheep.createAttributes().build()) //Sheep
- .putFast(EntityType.SHULKER, Shulker.createAttributes().build()) //Shulker
- .putFast(EntityType.SILVERFISH, Silverfish.createAttributes().build()) //Silverfish
- .putFast(EntityType.SKELETON, Skeleton.createAttributes().build()) //Skeleton
- .putFast(EntityType.SKELETON_HORSE, SkeletonHorse.createAttributes().build()) //Skeleton Horse
- .putFast(EntityType.SLIME, Slime.createLivingAttributes().build()) //Slime
- .putFast(EntityType.SNOW_GOLEM, SnowGolem.createAttributes().build()) //Snow Golem
- .putFast(EntityType.SPIDER, Spider.createAttributes().build()) //Spider
- .putFast(EntityType.SQUID, Squid.createAttributes().build()) //Squid
- .putFast(EntityType.STRAY, Stray.createAttributes().build()) //Stray
- .putFast(EntityType.STRIDER, Strider.createAttributes().build()) //Strider
+ .putFast(EntityType.HOGLIN, Hoglin.createAttributes().build()) //Hoglin
+ .putFast(EntityType.HORSE, Horse.createBaseHorseAttributes().build()) //Horse
+ .putFast(EntityType.HUSK, Husk.createAttributes().build()) //Husk
+ .putFast(EntityType.ILLUSIONER, Illusioner.createAttributes().build()) //Illusioner
+ .putFast(EntityType.IRON_GOLEM, IronGolem.createAttributes().build()) //Iron Golem
+ .putFast(EntityType.LLAMA, Llama.createAttributes().build()) //Llama
+ .putFast(EntityType.MAGMA_CUBE, MagmaCube.createAttributes().build()) //Magma Cube
+ .putFast(EntityType.MOOSHROOM, MushroomCow.createAttributes().build()) //Mooshroom
+ .putFast(EntityType.MULE, Mule.createLivingAttributes().build()) //Mule
+ .putFast(EntityType.OCELOT, Ocelot.createAttributes().build()) //Ocelot
+ .putFast(EntityType.PANDA, Panda.createAttributes().build()) //Panda
+ .putFast(EntityType.PARROT, Parrot.createAttributes().build()) //Parrot
+ .putFast(EntityType.PHANTOM, Phantom.createLivingAttributes().build()) //Phantom
+ .putFast(EntityType.PIG, Pig.createAttributes().build()) //Pig
+ .putFast(EntityType.PIGLIN, Piglin.createAttributes().build()) //Piglin
+ .putFast(EntityType.PIGLIN_BRUTE, PiglinBrute.createAttributes().build()) //Piglin Brute
+ .putFast(EntityType.PILLAGER, Pillager.createAttributes().build()) //Pillager
+ .putFast(EntityType.PLAYER, Player.createAttributes().build()) //Player
+ .putFast(EntityType.POLAR_BEAR, PolarBear.createAttributes().build()) //PolarBear
+ .putFast(EntityType.PUFFERFISH, Pufferfish.createAttributes().build()) //Pufferfish
+ .putFast(EntityType.RABBIT, Rabbit.createAttributes().build()) //Rabbit
+ .putFast(EntityType.RAVAGER, Ravager.createAttributes().build()) //Ravager
+ .putFast(EntityType.SALMON, Salmon.createAttributes().build()) //Salmon
+ .putFast(EntityType.SHEEP, Sheep.createAttributes().build()) //Sheep
+ .putFast(EntityType.SHULKER, Shulker.createAttributes().build()) //Shulker
+ .putFast(EntityType.SILVERFISH, Silverfish.createAttributes().build()) //Silverfish
+ .putFast(EntityType.SKELETON, Skeleton.createAttributes().build()) //Skeleton
+ .putFast(EntityType.SKELETON_HORSE, SkeletonHorse.createAttributes().build()) //Skeleton Horse
+ .putFast(EntityType.SLIME, Slime.createLivingAttributes().build()) //Slime
+ .putFast(EntityType.SNOW_GOLEM, SnowGolem.createAttributes().build()) //Snow Golem
+ .putFast(EntityType.SPIDER, Spider.createAttributes().build()) //Spider
+ .putFast(EntityType.SQUID, Squid.createAttributes().build()) //Squid
+ .putFast(EntityType.STRAY, Stray.createAttributes().build()) //Stray
+ .putFast(EntityType.STRIDER, Strider.createAttributes().build()) //Strider
.putFast(EntityType.TRADER_LLAMA, TraderLlama.createAttributes().build()) //Trader_Llama
.putFast(EntityType.TROPICAL_FISH, TropicalFish.createAttributes().build()) //Tropical Fish
- .putFast(EntityType.TURTLE, Turtle.createAttributes().build()) //Turtle
- .putFast(EntityType.VEX, Vex.createAttributes().build()) //Vex
- .putFast(EntityType.VILLAGER, Villager.createAttributes().build()) //Villager
- .putFast(EntityType.VINDICATOR, Vindicator.createAttributes().build()) //Vindicator
- .putFast(EntityType.WANDERING_TRADER, WanderingTrader.createLivingAttributes().build()) //Wandering Trader
- .putFast(EntityType.WITCH, Witch.createAttributes().build()) //Witch
- .putFast(EntityType.WITHER, WitherBoss.createAttributes().build()) //Wither
- .putFast(EntityType.WITHER_SKELETON, WitherSkeleton.createAttributes().build()) //Wither Skeleton
- .putFast(EntityType.WOLF, Wolf.createAttributes().build()) //Wolf
- .putFast(EntityType.ZOGLIN, Zoglin.createAttributes().build()) //Zoglin
- .putFast(EntityType.ZOMBIE, Zombie.createAttributes().build()) //Zombie
- .putFast(EntityType.ZOMBIE_HORSE, ZombieHorse.createAttributes().build()) //Zombie Horse
- .putFast(EntityType.ZOMBIE_VILLAGER, ZombieVillager.createAttributes().build()) //Zombie Villager
- .putFast(EntityType.ZOMBIFIED_PIGLIN, ZombifiedPiglin.createAttributes().build()); //Zombie Piglin
+ .putFast(EntityType.TURTLE, Turtle.createAttributes().build()) //Turtle
+ .putFast(EntityType.VEX, Vex.createAttributes().build()) //Vex
+ .putFast(EntityType.VILLAGER, Villager.createAttributes().build()) //Villager
+ .putFast(EntityType.VINDICATOR, Vindicator.createAttributes().build()) //Vindicator
+ .putFast(EntityType.WANDERING_TRADER, WanderingTrader.createLivingAttributes().build()) //Wandering Trader
+ .putFast(EntityType.WITCH, Witch.createAttributes().build()) //Witch
+ .putFast(EntityType.WITHER, WitherBoss.createAttributes().build()) //Wither
+ .putFast(EntityType.WITHER_SKELETON, WitherSkeleton.createAttributes().build()) //Wither Skeleton
+ .putFast(EntityType.WOLF, Wolf.createAttributes().build()) //Wolf
+ .putFast(EntityType.ZOGLIN, Zoglin.createAttributes().build()) //Zoglin
+ .putFast(EntityType.ZOMBIE, Zombie.createAttributes().build()) //Zombie
+ .putFast(EntityType.ZOMBIE_HORSE, ZombieHorse.createAttributes().build()) //Zombie Horse
+ .putFast(EntityType.ZOMBIE_VILLAGER, ZombieVillager.createAttributes().build()) //Zombie Villager
+ .putFast(EntityType.ZOMBIFIED_PIGLIN, ZombifiedPiglin.createAttributes().build()); //Zombie Piglin
}
diff --git a/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/entity/types/EntityMyAxolotl.java b/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/entity/types/EntityMyAxolotl.java
index 1d709e0505..95bc37388e 100644
--- a/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/entity/types/EntityMyAxolotl.java
+++ b/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/entity/types/EntityMyAxolotl.java
@@ -20,6 +20,8 @@
package de.Keyle.MyPet.compat.v1_17_R1.entity.types;
+import org.bukkit.block.data.Ageable;
+
import de.Keyle.MyPet.api.entity.EntitySize;
import de.Keyle.MyPet.api.entity.MyPet;
import de.Keyle.MyPet.api.entity.types.MyAxolotl;
@@ -69,7 +71,7 @@ public void updateVisuals() {
@Override
public void playPetStepSound() {
- makeSound("entity.axolotl.step", 0.15F, 1.0F);
+ makeSound("entity.axolotl.splash", 0.15F, 1.0F);
}
@Override
diff --git a/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/entity/types/EntityMyParrot.java b/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/entity/types/EntityMyParrot.java
index b58ad6e15a..3ebb0adb33 100644
--- a/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/entity/types/EntityMyParrot.java
+++ b/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/entity/types/EntityMyParrot.java
@@ -73,6 +73,7 @@ protected String getLivingSound() {
@Override
protected void defineSynchedData() {
+ super.defineSynchedData();
getEntityData().define(AGE_WATCHER, false);
getEntityData().define(SIT_WATCHER, (byte) 0);
getEntityData().define(OWNER_WATCHER, Optional.empty());
diff --git a/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/services/EntityConverterService.java b/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/services/EntityConverterService.java
index a31d5260ee..16f560b583 100644
--- a/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/services/EntityConverterService.java
+++ b/modules/v1_17_R1/src/main/java/de/Keyle/MyPet/compat/v1_17_R1/services/EntityConverterService.java
@@ -32,6 +32,7 @@
import org.bukkit.craftbukkit.v1_17_R1.entity.CraftVillagerZombie;
import org.bukkit.entity.AbstractHorse;
import org.bukkit.entity.Ageable;
+import org.bukkit.entity.Axolotl;
import org.bukkit.entity.Bee;
import org.bukkit.entity.Cat;
import org.bukkit.entity.ChestedHorse;
@@ -73,6 +74,7 @@
import de.Keyle.MyPet.api.entity.EquipmentSlot;
import de.Keyle.MyPet.api.entity.MyPet;
import de.Keyle.MyPet.api.entity.MyPetBaby;
+import de.Keyle.MyPet.api.entity.types.MyAxolotl;
import de.Keyle.MyPet.api.entity.types.MyBee;
import de.Keyle.MyPet.api.entity.types.MyCat;
import de.Keyle.MyPet.api.entity.types.MyCreeper;
@@ -179,6 +181,9 @@ public TagCompound convertEntity(LivingEntity entity) {
case LLAMA:
convertLlama((Llama) entity, properties);
break;
+ case AXOLOTL:
+ convertAxolotl((Axolotl) entity, properties);
+ break;
case PARROT:
convertParrot((Parrot) entity, properties);
break;
@@ -342,6 +347,8 @@ public void convertEntity(MyPet myPet, LivingEntity normalEntity) {
((Rabbit) normalEntity).setRabbitType(((MyRabbit) myPet).getVariant().getBukkitType());
} else if (myPet instanceof MyParrot) {
((Parrot) normalEntity).setVariant(Parrot.Variant.values()[((MyParrot) myPet).getVariant()]);
+ } else if (myPet instanceof MyAxolotl) {
+ ((Axolotl) normalEntity).setVariant(Axolotl.Variant.values()[((MyAxolotl) myPet).getVariant()]);
} else if (myPet instanceof MyTropicalFish) {
((CraftTropicalFish) normalEntity).getHandle().setVariant(((MyTropicalFish) myPet).getVariant());
} else if (myPet instanceof MyPufferfish) {
@@ -388,6 +395,10 @@ private void convertLlama(Llama llama, TagCompound properties) {
properties.getCompoundData().put("Chest", MyPetApi.getPlatformHelper().itemStackToCompund(new ItemStack(Material.CHEST)));
}
}
+
+ private void convertAxolotl(Axolotl axolotl, TagCompound properties) {
+ properties.getCompoundData().put("Variant", new TagInt(axolotl.getVariant().ordinal()));
+ }
private void convertParrot(Parrot parrot, TagCompound properties) {
properties.getCompoundData().put("Variant", new TagInt(parrot.getVariant().ordinal()));