Skip to content

Commit

Permalink
port to 25w03a
Browse files Browse the repository at this point in the history
  • Loading branch information
sakura-ryoko committed Jan 17, 2025
1 parent 0b7e50e commit 967619d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ public void sendBrainDebugData(ServerWorld serverWorld, LivingEntity livingEntit

if (entity instanceof VillagerEntity villager)
{
profession = villager.getVillagerData().getProfession().toString();
profession = villager.getVillagerData().profession().toString();
xp = villager.getExperience();
inventory = villager.getInventory().toString();
wantsGolem = villager.canSummonGolem(serverWorld.getTime());
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/fi/dy/masa/minihud/event/RenderHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ else if (type == InfoToggle.LOOKING_AT_ENTITY)
{
NbtCompound nbt = pair.getRight();
Pair<Double, Double> healthPair = NbtEntityUtils.getHealthFromNbt(nbt);
Pair<UUID, ItemStack> ownerPair = NbtEntityUtils.getOwnerAndSaddle(nbt, world.getRegistryManager());
Pair<UUID, Boolean> ownerPair = NbtEntityUtils.getTamableOwner(nbt);
Pair<Integer, Integer> agePair = NbtEntityUtils.getAgeFromNbt(nbt);

double health = healthPair.getLeft();
Expand Down Expand Up @@ -1341,7 +1341,7 @@ else if (type == InfoToggle.ENTITY_VARIANT)

if (variant != null)
{
this.addLineI18n("minihud.info_line.entity_variant.axolotl", variant.getName());
this.addLineI18n("minihud.info_line.entity_variant.axolotl", variant.name());
}
}
else if (entityType.equals(EntityType.CAT))
Expand Down Expand Up @@ -1423,7 +1423,7 @@ else if (entityType.equals(EntityType.PIG))
}
else if (entityType.equals(EntityType.RABBIT))
{
RabbitEntity.RabbitType rabbitType = NbtEntityUtils.getRabbitTypeFromNbt(nbt);
RabbitEntity.Variant rabbitType = NbtEntityUtils.getRabbitTypeFromNbt(nbt);

if (rabbitType != null)
{
Expand Down Expand Up @@ -1460,7 +1460,7 @@ else if (entityType.equals(EntityType.WOLF))
}
else if (pair.getLeft() instanceof AxolotlEntity axolotl)
{
this.addLineI18n("minihud.info_line.entity_variant.axolotl", axolotl.getVariant().getName());
this.addLineI18n("minihud.info_line.entity_variant.axolotl", axolotl.getVariant().name());
}
else if (pair.getLeft() instanceof CatEntity cat)
{
Expand All @@ -1474,7 +1474,7 @@ else if (pair.getLeft() instanceof FrogEntity frog)
}
else if (pair.getLeft() instanceof HorseEntity horse)
{
this.addLineI18n("minihud.info_line.entity_variant.horse", horse.getVariant().asString(), horse.getMarking().name().toLowerCase());
this.addLineI18n("minihud.info_line.entity_variant.horse", horse.getHorseColor().asString(), horse.getMarking().name().toLowerCase());
}
else if (pair.getLeft() instanceof LlamaEntity llama)
{
Expand Down Expand Up @@ -1521,11 +1521,11 @@ else if (pair.getLeft() instanceof SheepEntity sheep)
}
else if (pair.getLeft() instanceof TropicalFishEntity fish)
{
this.addLineI18n("minihud.info_line.entity_variant.tropical_fish", fish.getVariant().asString());
this.addLineI18n("minihud.info_line.entity_variant.tropical_fish", fish.getVariety().asString());
}
else if (pair.getLeft() instanceof WolfEntity wolf)
{
RegistryKey<WolfVariant> variant = wolf.getVariant().getKey().orElse(WolfVariants.PALE);
RegistryKey<WolfVariant> variant = wolf.get(DataComponentTypes.WOLF_VARIANT).getKey().get();
this.addLineI18n("minihud.info_line.entity_variant.wolf", variant.getValue().getPath(), wolf.getCollarColor().getName());
}
}
Expand Down Expand Up @@ -1814,7 +1814,7 @@ private boolean isEntityDataValid(@Nonnull NbtCompound nbt)
case NbtKeys.CONVERSION_PLAYER -> { return true; }
case NbtKeys.RECIPE_BOOK -> { return true; }
case NbtKeys.RECIPES -> { return true; }
case NbtKeys.SADDLE -> { return true; }
//case NbtKeys.SADDLE -> { return true; }
case NbtKeys.EFFECTS -> { return true; }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,8 @@ else if (entity instanceof PiglinEntity)
}
// Fix for saddled horse, no inv
else if (inv != null &&
inv.size() == 1 &&
nbt.contains(NbtKeys.SADDLE))
//inv.size() == 1 &&
nbt.contains(NbtKeys.EQUIPMENT) && nbt.contains(NbtKeys.EATING_HAY))
{
inv2 = InventoryUtils.getNbtInventoryHorseFix(nbt, -1, entity.getRegistryManager());
inv = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public void update(Vec3d cameraPos, Entity entity, MinecraftClient mc)

if (Configs.Generic.VILLAGER_OFFER_ENCHANTMENT_BOOKS.getBooleanValue())
{
List<VillagerEntity> librarians = EntityUtils.getEntitiesByClass(mc, VillagerEntity.class, box, villager -> villager.getVillagerData().getProfession() == VillagerProfession.LIBRARIAN);
List<VillagerEntity> librarians = EntityUtils.getEntitiesByClass(mc, VillagerEntity.class, box, villager -> villager.getVillagerData().profession().matchesKey(VillagerProfession.LIBRARIAN));
Map<Object2IntMap.Entry<RegistryEntry<Enchantment>>, Integer> lowestPrices = new HashMap<>();

// Prepare
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/fi/dy/masa/minihud/util/MiscUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ public static void addAxolotlTooltip(ItemStack stack, List<Text> lines)
NbtCompound tag = entityData.copyNbt();
int variantId = tag.getInt(AxolotlEntity.VARIANT_KEY);
// FIXME 1.19.3+ this is not validated now... with AIOOB it will return the entry for ID 0
AxolotlEntity.Variant variant = AxolotlEntity.Variant.byId(variantId);
String variantName = variant.getName();
AxolotlEntity.Variant variant = AxolotlEntity.Variant.byIndex(variantId);
String variantName = variant.name();
MutableText labelText = Text.translatable("minihud.label.axolotl_tooltip.label");
MutableText valueText = Text.translatable("minihud.label.axolotl_tooltip.value", variantName, variantId);

Expand Down

0 comments on commit 967619d

Please sign in to comment.