Only validate GUI types from TR.

This commit is contained in:
modmuss50 2023-02-02 16:10:48 +00:00
parent 4be0031344
commit 0169651414

View file

@ -27,6 +27,7 @@ package techreborn.client;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.gui.screen.ingame.HandledScreens;
import net.minecraft.util.Identifier;
import techreborn.TechReborn;
import techreborn.blockentity.GuiType;
import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity;
import techreborn.blockentity.generator.SolarPanelBlockEntity;
@ -187,13 +188,14 @@ public class ClientGuiType<T extends BlockEntity> {
public static final ClientGuiType<ElevatorBlockEntity> ELEVATOR = register(GuiType.ELEVATOR, GuiElevator::new);
public static final ClientGuiType<FishingStationBlockEntity> FISHING_STATION = register(GuiType.FISHING_STATION, GuiFishingStation::new);
private static <T extends BlockEntity> ClientGuiType<T> register(GuiType<T> type, GuiFactory<T> factory) {
public static <T extends BlockEntity> ClientGuiType<T> register(GuiType<T> type, GuiFactory<T> factory) {
return new ClientGuiType<>(type, factory);
}
public static void validate() {
// Ensure all gui types also have a client version.
for (Identifier identifier : GuiType.TYPES.keySet()) {
if (!identifier.getNamespace().equals(TechReborn.MOD_ID)) continue;
Objects.requireNonNull(TYPES.get(identifier), "No ClientGuiType for " + identifier);
}
}