Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.20.1/dev' into 1.20.1/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
desht committed Jul 26, 2024
2 parents f67e780 + 49891cc commit 5cafcc5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ public <E, CV extends ConfigValue<E>> ListConfig<E, CV> addList(String id, List<
}, Collections.emptyList());
}

public <E, CV extends ConfigValue<E>> ListConfig<E, CV> addList(String id, List<E> value, CV type, Consumer<List<E>> setter, E def) {
type.setDefaultValue(def);
return add(id, new ListConfig<>(type), value, setter, Collections.emptyList());
}

public EnumConfig<Tristate> addTristate(String id, Tristate value, Consumer<Tristate> setter, Tristate def) {
return addEnum(id, value, setter, Tristate.NAME_MAP, def);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package dev.ftb.mods.ftblibrary.util;

import dev.architectury.networking.NetworkManager;
import dev.architectury.networking.simple.MessageType;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.MinecraftServer;

public class NetworkHelper {
public static void sendToAll(MessageType type, MinecraftServer server, FriendlyByteBuf buffer) {
NetworkManager.sendToPlayers(server.getPlayerList().getPlayers(), type.getId(), buffer);
}
}

0 comments on commit 5cafcc5

Please sign in to comment.