Skip to content

Commit

Permalink
remove faces from poi codec
Browse files Browse the repository at this point in the history
  • Loading branch information
bazke committed Oct 29, 2023
1 parent 812ef7e commit d2d66ca
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/main/java/com/lovetropics/extras/data/poi/Poi.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ public final class Poi {
ExtraCodecs.COMPONENT.fieldOf("description").forGetter(Poi::description),
ResourceLocation.CODEC.fieldOf("resourceLocation").forGetter(Poi::resourceLocation),
GlobalPos.CODEC.fieldOf("blockPos").forGetter(Poi::globalPos),
Codec.BOOL.fieldOf("enabled").forGetter(Poi::enabled),
Codec.list(UUIDUtil.CODEC).fieldOf("faces").forGetter(Poi::faces)
Codec.BOOL.fieldOf("enabled").forGetter(Poi::enabled)
).apply(i, Poi::new));

private final String name;
Expand All @@ -46,6 +45,20 @@ public Poi(
this.faces = new ArrayList<>(faces);
}

public Poi(
String name,
Component description,
ResourceLocation resourceLocation,
GlobalPos globalPos,
boolean enabled) {
this.name = name;
this.description = description;
this.resourceLocation = resourceLocation;
this.globalPos = globalPos;
this.enabled = enabled;
this.faces = new ArrayList<>();
}

//Use only the name for equals&hashCode. Maybe tiny bit risky but dupe handling is free
@Override
public boolean equals(final Object o) {
Expand Down

0 comments on commit d2d66ca

Please sign in to comment.