mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-15 17:05: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 >= 1.21.6 {
|
||||
@EventBusSubscriber(modid = "midnightlib", value = Dist.CLIENT)
|
||||
//?} else {
|
||||
/^@EventBusSubscriber(modid = "midnightlib", bus = EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
|
||||
^///?}
|
||||
public static class MidnightLibBusEvents {
|
||||
@SubscribeEvent
|
||||
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.ContainerObjectSelectionList;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.renderer.RenderPipelines;
|
||||
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 boolean renderHeaderSeparator = true;
|
||||
@@ -26,7 +31,13 @@ public class MidnightConfigListWidget extends ContainerObjectSelectionList<Butto
|
||||
if (renderHeaderSeparator)
|
||||
super.renderListSeparators(context);
|
||||
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) {
|
||||
|
||||
@@ -43,10 +43,10 @@ public class PlatformFunctions {
|
||||
}
|
||||
public static boolean isClientEnv() {
|
||||
//? if >= 1.21.9 {
|
||||
/^return FMLEnvironment.getDist().isClient();
|
||||
^///?} else {
|
||||
return FMLEnvironment.dist.isClient();
|
||||
//?}
|
||||
return FMLEnvironment.getDist().isClient();
|
||||
//?} else {
|
||||
/^return FMLEnvironment.dist.isClient();
|
||||
^///?}
|
||||
}
|
||||
public static boolean isModLoaded(String modid) {
|
||||
return ModList.get().isLoaded(modid);
|
||||
|
||||
Reference in New Issue
Block a user