From 02eaf365c8c7b9b016a06cd8288906c27d04d29a Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 30 Sep 2022 16:42:56 +0200 Subject: [PATCH] Remove the race selection from the world creation screen (no longer needed since you are asked to select a race upon joining the world) --- .../unicopia/client/UnicopiaClient.java | 4 ---- .../client/gui/LanSettingsScreen.java | 21 ------------------- 2 files changed, 25 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/client/UnicopiaClient.java b/src/main/java/com/minelittlepony/unicopia/client/UnicopiaClient.java index f83a4c9a..5818b187 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/UnicopiaClient.java +++ b/src/main/java/com/minelittlepony/unicopia/client/UnicopiaClient.java @@ -22,7 +22,6 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.OpenToLanScreen; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.ingame.HandledScreens; -import net.minecraft.client.gui.screen.world.CreateWorldScreen; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.Text; @@ -77,9 +76,6 @@ public class UnicopiaClient implements ClientModInitializer { } private void onScreenInit(Screen screen, ButtonList buttons) { - if (screen instanceof CreateWorldScreen) { - buttons.addButton(LanSettingsScreen.createRaceSelector(screen)); - } if (screen instanceof OpenToLanScreen) { buttons.addButton(new Button(screen.width / 2 - 155, 130, 150, 20)) .onClick(b -> MinecraftClient.getInstance().setScreen(new LanSettingsScreen(screen))) diff --git a/src/main/java/com/minelittlepony/unicopia/client/gui/LanSettingsScreen.java b/src/main/java/com/minelittlepony/unicopia/client/gui/LanSettingsScreen.java index 6fa16e87..ccc36e6e 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/gui/LanSettingsScreen.java +++ b/src/main/java/com/minelittlepony/unicopia/client/gui/LanSettingsScreen.java @@ -6,7 +6,6 @@ import com.minelittlepony.common.client.gui.GameGui; import com.minelittlepony.common.client.gui.ScrollContainer; import com.minelittlepony.common.client.gui.dimension.Bounds; import com.minelittlepony.common.client.gui.element.Button; -import com.minelittlepony.common.client.gui.element.Cycler; import com.minelittlepony.common.client.gui.element.Label; import com.minelittlepony.common.client.gui.element.Toggle; import com.minelittlepony.common.client.gui.packing.GridPacker; @@ -15,9 +14,7 @@ import com.minelittlepony.common.client.gui.style.Style; import com.minelittlepony.unicopia.Config; import com.minelittlepony.unicopia.Race; import com.minelittlepony.unicopia.Unicopia; -import com.minelittlepony.unicopia.util.RegistryIndexer; -import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.server.integrated.IntegratedServer; @@ -149,22 +146,4 @@ public class LanSettingsScreen extends GameGui { return new Style().setIcon(TribeButton.createSprite(race, 2, 2, 15)) .setTooltip(race.getTranslationKey(), 0, 10); } - - public static Cycler createRaceSelector(Screen screen) { - RegistryIndexer races = RegistryIndexer.of(Race.REGISTRY); - return new Cycler(screen.width / 2 + 110, 60, 20, 20) { - @Override - protected void renderForground(MatrixStack matrices, MinecraftClient mc, int mouseX, int mouseY, int foreColor) { - super.renderForground(matrices, mc, mouseX, mouseY, foreColor); - if (isMouseOver(mouseX, mouseY)) { - renderToolTip(matrices, screen, mouseX, mouseY); - } - } - }.setStyles(Race.REGISTRY.stream().map(LanSettingsScreen::createStyle).toArray(Style[]::new)).onChange(i -> { - Unicopia.getConfig().preferredRace.set(races.valueOf(i)); - Unicopia.getConfig().save(); - - return i; - }).setValue(races.indexOf(Unicopia.getConfig().preferredRace.get())); - } }