Fix pre MC 1.21.11 compiling

This commit is contained in:
James Seibel
2025-12-10 07:28:39 -06:00
parent cdfb46b041
commit e1c3da59db
6 changed files with 24 additions and 7 deletions
@@ -3,13 +3,17 @@ package com.seibel.distanthorizons.common.commands;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.server.permissions.PermissionCheck;
import net.minecraft.server.permissions.Permissions;
import org.jetbrains.annotations.Nullable;
import static com.seibel.distanthorizons.core.network.messages.MessageRegistry.DEBUG_CODEC_CRASH_MESSAGE;
import static net.minecraft.commands.Commands.literal;
#if MC_VER <= MC_1_21_10
#else
import net.minecraft.server.permissions.PermissionCheck;
import net.minecraft.server.permissions.Permissions;
#endif
public class CommandInitializer
{
private boolean serverReady = false;
@@ -92,7 +92,7 @@ public class BlockStateWrapper implements IBlockStateWrapper
public static HashSet<IBlockStateWrapper> rendererIgnoredCaveBlocks = null;
/** keep track of broken blocks so we don't log every time */
#if MC_VER < MC_1_21_10
#if MC_VER <= MC_1_21_10
private static final HashSet<ResourceLocation> BROKEN_RESOURCE_LOCATIONS = new HashSet<>();
#else
private static final HashSet<Identifier> BROKEN_RESOURCE_LOCATIONS = new HashSet<>();
@@ -185,7 +185,7 @@ public class ClassicConfigGUI
0,
#if MC_VER < MC_1_21_1
new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"),
#elif MC_VER < MC_1_21_10
#elif MC_VER <= MC_1_21_10
ResourceLocation.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"),
#else
Identifier.fromNamespaceAndPath(ModInfo.ID, "textures/gui/changelog.png"),
@@ -59,7 +59,6 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IOptifineAc
import net.minecraft.client.Camera;
import net.minecraft.client.Minecraft;
import net.minecraft.core.BlockPos;
import net.minecraft.world.attribute.EnvironmentAttributes;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.phys.Vec3;
@@ -81,6 +80,11 @@ import com.mojang.blaze3d.opengl.GlTexture;
#else
#endif
#if MC_VER <= MC_1_21_10
#else
import net.minecraft.world.attribute.EnvironmentAttributes;
#endif
/**
* A singleton that contains everything
* related to rendering in Minecraft.
@@ -75,7 +75,12 @@ public class DimensionTypeWrapper implements IDimensionTypeWrapper
// create the missing wrapper
#if MC_VER <= MC_1_21_10
DimensionTypeWrapper dimensionTypeWrapper = new DimensionTypeWrapper(dimensionType);
#else
DimensionTypeWrapper dimensionTypeWrapper = new DimensionTypeWrapper(dimensionType, dimName);
#endif
DIMENSION_WRAPPER_BY_NAME.put(dimName, dimensionTypeWrapper);
return dimensionTypeWrapper;
}