hiding title screen branding if others were removed
This commit is contained in:
@@ -6,6 +6,7 @@ import com.mojang.logging.LogUtils;
|
||||
import net.minecraft.client.gui.screens.TitleScreen;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.client.event.ScreenEvent;
|
||||
import net.minecraftforge.eventbus.api.EventPriority;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.internal.BrandingControl;
|
||||
@@ -23,8 +24,8 @@ public class TitleScreenInjector {
|
||||
private static boolean launchComplete = false;
|
||||
|
||||
@SuppressWarnings({"InstantiationOfUtilityClass", "unchecked"})
|
||||
@SubscribeEvent
|
||||
public static void onScreenInit(ScreenEvent.InitScreenEvent event) {
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public static void onScreenInit(ScreenEvent.InitScreenEvent.Post event) {
|
||||
if (!(event.getScreen() instanceof TitleScreen) || launchComplete)
|
||||
return;
|
||||
launchComplete = true;
|
||||
@@ -40,6 +41,7 @@ public class TitleScreenInjector {
|
||||
computeBranding.invoke(null);
|
||||
|
||||
List<String> brandings = new ArrayList<>((List<String>) f.get(brandingControl));
|
||||
LogUtils.getLogger().info("ERRORR: " + brandings);
|
||||
if (brandings.size() > 1) {
|
||||
List<String> newBrandings = new ArrayList<>(brandings);
|
||||
f.set(brandingControl, newBrandings);
|
||||
|
||||
Reference in New Issue
Block a user