Skip to content

Commit

Permalink
fix villager render issues
Browse files Browse the repository at this point in the history
  • Loading branch information
way2muchnoise committed Jun 21, 2024
1 parent 0ad4b92 commit ff94130
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ public AbstractVillagerEntry(Int2ObjectMap<VillagerTrades.ItemListing[]> itemLis
addITradeLists(itemListings);
}

public AbstractVillagerEntry() {
this.tradeList = new LinkedList<>();
}

public void addITradeLists(Int2ObjectMap<VillagerTrades.ItemListing[]> itemListings) {
for (int i = 1;i < itemListings.size() + 1;i++) {
VillagerTrades.ItemListing[] levelList = itemListings.get(i);
Expand Down
5 changes: 4 additions & 1 deletion Common/src/main/java/jeresources/entry/VillagerEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ public class VillagerEntry extends AbstractVillagerEntry<Villager>{
private final VillagerProfession profession;

public VillagerEntry(VillagerProfession profession, Int2ObjectMap<VillagerTrades.ItemListing[]> itemListings) {
super(itemListings);
super();
this.profession = profession;
// only make trades after setting profession
addITradeLists(itemListings);
}

@Override
Expand Down Expand Up @@ -45,6 +47,7 @@ public Villager getVillagerEntity() {
this.entity = EntityType.VILLAGER.create(CompatBase.getLevel());
assert this.entity != null;
this.entity.setVillagerData(this.entity.getVillagerData().setProfession(this.profession));
this.entity.tick();
}
return this.entity;
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ curseHomepageLink=https://www.curseforge.com/minecraft/mc-mods/just-enough-resou
modrinthProjectId=uEfK2CXF

# Version
specificationVersion=1.5.0
specificationVersion=1.5.1

0 comments on commit ff94130

Please sign in to comment.