Skip to content

Commit

Permalink
more pets
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeTheTech committed Sep 28, 2023
1 parent c401b26 commit fe62aec
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ public enum OptionSelector {
PILLAGER(new String[] {Option.NAME.name()}),
RAVAGER(new String[] {Option.NAME.name()}),
SHULKER(new String[] {Option.NAME.name(), Option.DYE.name(), Option.COLOR.name()}),
SILVERFISH(new String[] {Option.NAME.name()}),
SKELETON(new String[] {Option.NAME.name()}),
SPIDER(new String[] {Option.NAME.name()}),
STRAY(new String[] {Option.NAME.name()}),
VEX(new String[] {Option.NAME.name()}),
VINDICATOR(new String[] {Option.NAME.name()}),
WARDEN(new String[] {Option.NAME.name()}),
WITCH(new String[] {Option.NAME.name()}),
WITHER(new String[] {Option.NAME.name()}),
;

@Getter private final String[] options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public CaveSpiderPet(Player player, String[] data) {
setCustomNameVisible(true);
setPersistenceRequired(true);
setCanPickUpLoot(false);
setMaxUpStep(1.0F);
collides = false;
setCustomName(Component.Serializer.fromJson(CoreUtil.serializeColorComponentJson(data[1])));
setTarget(((CraftPlayer) player).getHandle(), EntityTargetEvent.TargetReason.CUSTOM, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public SpiderPet(Player player, String[] data) {
setCustomNameVisible(true);
setPersistenceRequired(true);
setCanPickUpLoot(false);
setMaxUpStep(1.0F);
collides = false;
setCustomName(Component.Serializer.fromJson(CoreUtil.serializeColorComponentJson(data[1])));
setTarget(((CraftPlayer) player).getHandle(), EntityTargetEvent.TargetReason.CUSTOM, false);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/lee/code/pets/pets/pet/monster/VexPet.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public VexPet(Player player, String[] data) {
collides = false;
setCustomName(Component.Serializer.fromJson(CoreUtil.serializeColorComponentJson(data[1])));
setTarget(((CraftPlayer) player).getHandle(), EntityTargetEvent.TargetReason.CUSTOM, false);
moveControl = new ControllerWASDFlying(this, player.getUniqueId(), 0.2F);
moveControl = new ControllerWASDFlying(this, player.getUniqueId(), 0.3F);
targetSelector.getAvailableGoals().clear();
getBrain().removeAllBehaviors();
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/lee/code/pets/utils/PetDataUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class PetDataUtil {

public static String getPetData(EntityType entityType, String[] data, Option option) {
switch (entityType) {
case ALLAY, BAT, IRON_GOLEM, WANDERING_TRADER, COD, DOLPHIN, ELDER_GUARDIAN, GLOW_SQUID, GUARDIAN, PUFFERFISH, SALMON, SQUID, TADPOLE, BLAZE, CAVE_SPIDER, ENDERMAN, EVOKER, GHAST, ILLUSIONER, PHANTOM, PIGLIN_BRUTE, PILLAGER, RAVAGER -> {
case ALLAY, BAT, IRON_GOLEM, WANDERING_TRADER, COD, DOLPHIN, ELDER_GUARDIAN, GLOW_SQUID, GUARDIAN, PUFFERFISH, SALMON, SQUID, TADPOLE, BLAZE, CAVE_SPIDER, ENDERMAN, EVOKER, GHAST, ILLUSIONER, PHANTOM, PIGLIN_BRUTE, PILLAGER, RAVAGER, SILVERFISH, SKELETON, SPIDER, STRAY, VEX, VINDICATOR, WARDEN, WITCH, WITHER -> {
return data[1];
}
case COW, CHICKEN, HOGLIN, OCELOT, PIG, POLAR_BEAR, SNIFFER, ZOGLIN, TURTLE, DROWNED, HUSK, PIGLIN -> {
Expand Down Expand Up @@ -170,7 +170,7 @@ public static String serializePetData(Entity entity) {
final String sep = ",";
final String startingData = entityType.name() + sep + petName;
switch (entityType) {
case ALLAY, BAT, IRON_GOLEM, WANDERING_TRADER, COD, DOLPHIN, ELDER_GUARDIAN, GLOW_SQUID, GUARDIAN, PUFFERFISH, SALMON, SQUID, TADPOLE, BLAZE, CAVE_SPIDER, ENDERMAN, EVOKER, GHAST, ILLUSIONER, PHANTOM, PIGLIN_BRUTE, PILLAGER, RAVAGER -> {
case ALLAY, BAT, IRON_GOLEM, WANDERING_TRADER, COD, DOLPHIN, ELDER_GUARDIAN, GLOW_SQUID, GUARDIAN, PUFFERFISH, SALMON, SQUID, TADPOLE, BLAZE, CAVE_SPIDER, ENDERMAN, EVOKER, GHAST, ILLUSIONER, PHANTOM, PIGLIN_BRUTE, PILLAGER, RAVAGER, SILVERFISH, SKELETON, SPIDER, STRAY, VEX, VINDICATOR, WARDEN, WITCH, WITHER -> {
return startingData;
}
case COW, CHICKEN, HOGLIN, OCELOT, PIG, POLAR_BEAR, SNIFFER, ZOGLIN, TURTLE, DROWNED, HUSK, PIGLIN -> {
Expand Down Expand Up @@ -306,7 +306,7 @@ public static String serializePetData(Entity entity) {
public static String addNewPetData(EntityType entityType, String[] data, String newData, Option option) {
final String sep = ",";
switch (entityType) {
case ALLAY, BAT, IRON_GOLEM, WANDERING_TRADER, COD, DOLPHIN, ELDER_GUARDIAN, GLOW_SQUID, GUARDIAN, PUFFERFISH, SALMON, SQUID, TADPOLE, BLAZE, CAVE_SPIDER, ENDERMAN, EVOKER, GHAST, ILLUSIONER, PHANTOM, PIGLIN_BRUTE, PILLAGER, RAVAGER -> {
case ALLAY, BAT, IRON_GOLEM, WANDERING_TRADER, COD, DOLPHIN, ELDER_GUARDIAN, GLOW_SQUID, GUARDIAN, PUFFERFISH, SALMON, SQUID, TADPOLE, BLAZE, CAVE_SPIDER, ENDERMAN, EVOKER, GHAST, ILLUSIONER, PHANTOM, PIGLIN_BRUTE, PILLAGER, RAVAGER, SILVERFISH, SKELETON, SPIDER, STRAY, VEX, VINDICATOR, WARDEN, WITCH, WITHER -> {
return data[0] + sep + newData;
}
case COW, CHICKEN, HOGLIN, OCELOT, PIG, POLAR_BEAR, SNIFFER, ZOGLIN, TURTLE, DROWNED, HUSK, PIGLIN -> {
Expand Down

0 comments on commit fe62aec

Please sign in to comment.