Signed-off-by: Glease <4586901+Glease@users.noreply.github.com>
This commit is contained in:
Glease committed 2024-04-25 17:04:13 +08:00
1 parent 69c4be6419
commit 2ebc05bcc1
5 files changed
+22 -13

No files matched your search

@@ -5,7 +5,6 @@ import static com.gtnewhorizon.structurelib.StructureLib.RANDOM;
import java.lang.ref.WeakReference;
import java.util.*;
import cpw.mods.fml.client.config.GuiConfig;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
@@ -38,6 +37,7 @@ import com.gtnewhorizon.structurelib.entity.fx.WeightlessParticleFX;
import com.gtnewhorizon.structurelib.net.RegistryOrderSyncMessage;
import com.gtnewhorizon.structurelib.net.SetChannelDataMessage;
import cpw.mods.fml.client.config.GuiConfig;
import cpw.mods.fml.client.event.ConfigChangedEvent;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
@@ -287,8 +287,16 @@ public class ClientProxy extends CommonProxy {
}
public void displayConfigGUI(String category) {
ConfigElement<Object> element = new ConfigElement<>(ConfigurationHandler.INSTANCE.getConfig().getCategory(category));
GuiConfig guiConfig = new GuiConfig(null, element.getChildElements(), StructureLibAPI.MOD_ID, null, false, false, I18n.format(element.getLanguageKey()));
ConfigElement<Object> element = new ConfigElement<>(
ConfigurationHandler.INSTANCE.getConfig().getCategory(category));
GuiConfig guiConfig = new GuiConfig(
null,
element.getChildElements(),
StructureLibAPI.MOD_ID,
null,
false,
false,
I18n.format(element.getLanguageKey()));
Minecraft.getMinecraft().displayGuiScreen(guiConfig);
}
@@ -108,8 +108,7 @@ public class CommonProxy {
}
}
public void displayConfigGUI(String category) {
}
public void displayConfigGUI(String category) {}
public static class ForgeEventHandler {
@@ -180,7 +180,6 @@ public enum ConfigurationHandler {
return registryOrders.get(name);
}
Configuration getConfig() {
return config;
}
@@ -129,7 +129,7 @@ public class GuiEditRegistryConfig extends GuiScreen {
this.orderEntries = new EntriesList(
(width - MID_SECTION_WIDTH) / 2 - LIST_WINDOW_PADDING,
(width + MID_SECTION_WIDTH) / 2,
I18n.format("structurelib.configgui.enabled"));
I18n.format("structurelib.configgui.enabled"));
this.orderEntries.initEntries(Arrays.asList(orderElement.getList()));
} else {
this.orderEntries
@@ -361,14 +361,18 @@ public class GuiEditRegistryConfig extends GuiScreen {
public void drawScreen(int p_148128_1_, int p_148128_2_, float p_148128_3_) {
GL11.glEnable(GL11.GL_SCISSOR_TEST);
ScaledResolution scaledresolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
GL11.glScissor((left - 4) * scaledresolution.getScaleFactor(), (int) ((scaledresolution.getScaledHeight_double() - (bottom + 4)) * scaledresolution.getScaleFactor()), (width + 8) * scaledresolution.getScaleFactor(), (height + 8) * scaledresolution.getScaleFactor());
GL11.glScissor(
(left - 4) * scaledresolution.getScaleFactor(),
(int) ((scaledresolution.getScaledHeight_double() - (bottom + 4))
* scaledresolution.getScaleFactor()),
(width + 8) * scaledresolution.getScaleFactor(),
(height + 8) * scaledresolution.getScaleFactor());
super.drawScreen(p_148128_1_, p_148128_2_, p_148128_3_);
GL11.glDisable(GL11.GL_SCISSOR_TEST);
}
@Override
public void overlayBackground(int p_148136_1_, int p_148136_2_, int p_148136_3_, int p_148136_4_) {
}
public void overlayBackground(int p_148136_1_, int p_148136_2_, int p_148136_3_, int p_148136_4_) {}
@Override
protected void drawContainerBackground(Tessellator tessellator) {
@@ -397,7 +401,7 @@ public class GuiEditRegistryConfig extends GuiScreen {
}
FontRenderer fr = mc.fontRenderer;
fr.drawString(
this.heading,
this.heading,
p_148129_1_ + this.width / 2 - fr.getStringWidth(this.heading) / 2,
Math.min(this.top + 3, p_148129_2_),
0xffffff);
@@ -49,8 +49,7 @@ public class SortedRegistry<V> implements Iterable<V> {
/**
* Construct an unsynchronized registry
*/
public SortedRegistry() {
}
public SortedRegistry() {}
/**
* Construct a synchronized registry whose ordering will be synced to the server