mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-17 17:55:09 +01:00
stonecutter: support MC 1.21.5
This commit is contained in:
@@ -98,7 +98,11 @@ public class MidnightLib {
|
|||||||
if (PlatformFunctions.isClientEnv()) this.onInitializeClient();
|
if (PlatformFunctions.isClientEnv()) this.onInitializeClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//? if >= 1.21.6 {
|
||||||
@EventBusSubscriber(modid = "midnightlib", value = Dist.CLIENT)
|
@EventBusSubscriber(modid = "midnightlib", value = Dist.CLIENT)
|
||||||
|
//?} else {
|
||||||
|
/^@EventBusSubscriber(modid = "midnightlib", bus = EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
|
||||||
|
^///?}
|
||||||
public static class MidnightLibBusEvents {
|
public static class MidnightLibBusEvents {
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void onPostInit(FMLClientSetupEvent event) {
|
public static void onPostInit(FMLClientSetupEvent event) {
|
||||||
|
|||||||
@@ -6,8 +6,13 @@ import net.minecraft.client.gui.GuiGraphics;
|
|||||||
import net.minecraft.client.gui.components.AbstractWidget;
|
import net.minecraft.client.gui.components.AbstractWidget;
|
||||||
import net.minecraft.client.gui.components.ContainerObjectSelectionList;
|
import net.minecraft.client.gui.components.ContainerObjectSelectionList;
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
import net.minecraft.client.renderer.RenderPipelines;
|
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
//? if >= 1.21.6 {
|
||||||
|
import net.minecraft.client.renderer.RenderPipelines;
|
||||||
|
//?} else {
|
||||||
|
/*import net.minecraft.client.renderer.RenderType;
|
||||||
|
*///?}
|
||||||
|
|
||||||
|
|
||||||
public class MidnightConfigListWidget extends ContainerObjectSelectionList<ButtonEntry> {
|
public class MidnightConfigListWidget extends ContainerObjectSelectionList<ButtonEntry> {
|
||||||
public boolean renderHeaderSeparator = true;
|
public boolean renderHeaderSeparator = true;
|
||||||
@@ -26,7 +31,13 @@ public class MidnightConfigListWidget extends ContainerObjectSelectionList<Butto
|
|||||||
if (renderHeaderSeparator)
|
if (renderHeaderSeparator)
|
||||||
super.renderListSeparators(context);
|
super.renderListSeparators(context);
|
||||||
else
|
else
|
||||||
context.blit(RenderPipelines.GUI_TEXTURED, this.minecraft.level == null ? Screen.FOOTER_SEPARATOR : Screen.INWORLD_FOOTER_SEPARATOR, this.getX(), this.getBottom(), 0, 0, this.getWidth(), 2, 32, 2);
|
context.blit(
|
||||||
|
//? if >= 1.21.6 {
|
||||||
|
RenderPipelines.GUI_TEXTURED
|
||||||
|
//?} else {
|
||||||
|
/*RenderType::guiTextured
|
||||||
|
*///?}
|
||||||
|
, this.minecraft.level == null ? Screen.FOOTER_SEPARATOR : Screen.INWORLD_FOOTER_SEPARATOR, this.getX(), this.getBottom(), 0, 0, this.getWidth(), 2, 32, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addButton(List<AbstractWidget> buttons, Component text, EntryInfo info) {
|
public void addButton(List<AbstractWidget> buttons, Component text, EntryInfo info) {
|
||||||
|
|||||||
@@ -43,10 +43,10 @@ public class PlatformFunctions {
|
|||||||
}
|
}
|
||||||
public static boolean isClientEnv() {
|
public static boolean isClientEnv() {
|
||||||
//? if >= 1.21.9 {
|
//? if >= 1.21.9 {
|
||||||
/^return FMLEnvironment.getDist().isClient();
|
return FMLEnvironment.getDist().isClient();
|
||||||
^///?} else {
|
//?} else {
|
||||||
return FMLEnvironment.dist.isClient();
|
/^return FMLEnvironment.dist.isClient();
|
||||||
//?}
|
^///?}
|
||||||
}
|
}
|
||||||
public static boolean isModLoaded(String modid) {
|
public static boolean isModLoaded(String modid) {
|
||||||
return ModList.get().isLoaded(modid);
|
return ModList.get().isLoaded(modid);
|
||||||
|
|||||||
Reference in New Issue
Block a user