Skip to content

Commit

Permalink
also remove faces when moving around
Browse files Browse the repository at this point in the history
  • Loading branch information
bazke committed Oct 28, 2023
1 parent 3b18b97 commit cf3fcc2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,14 @@ private void removeFace(String name, UUID face) {
public void addFace(String name, UUID face) {
final Poi poi = pois.get(name);
if (poi != null) {
getAllPois().stream()
.filter(p -> p != poi)
.filter(p -> p.faces().contains(face))
.forEach(p -> removeFace(p.name(), face));
poi.addFace(face);
setDirty();
LTExtrasNetwork.CHANNEL.send(PacketDistributor.ALL.noArg(), new ClientboundPoiPacket(poi, false));
}
setDirty();
}

public void clearFaces() {
Expand Down Expand Up @@ -183,6 +187,7 @@ private static Set<ServerPlayer> getHosts(final MinecraftServer server) {
.collect(Collectors.toSet());
}

//TODO remove faces when they move around.......
private static void addNewFacesToPois(final MapPoiManager manager, final Set<ServerPlayer> hosts) {
for (ServerPlayer host : hosts) {
final BlockPos hostPosition = host.blockPosition();
Expand Down

0 comments on commit cf3fcc2

Please sign in to comment.