Fixed stuff and made core use mc 1.16 version of log4j
This commit is contained in:
@@ -35,14 +35,6 @@ def loadProperties() {
|
||||
}
|
||||
writeBuildGradlePredefine()
|
||||
|
||||
def mcVersionToAcsessWidenerVersion = [
|
||||
"1_16_5": "1_16",
|
||||
"1.17.1": "1_17",
|
||||
"1.18.1": "1_18",
|
||||
"1.18.2": "1_18"
|
||||
]
|
||||
rootProject.ext.set("acsessWidenerVersion", mcVersionToAcsessWidenerVersion.get(mcVersion))
|
||||
|
||||
}
|
||||
loadProperties()
|
||||
|
||||
|
||||
+3
-3
@@ -100,7 +100,7 @@ public class WorldGenStructFeatManager extends StructureFeatureManager {
|
||||
StructureFeature<?> structureFeature) {
|
||||
|
||||
ChunkAccess chunk = _getChunk(sectionPos.x(), sectionPos.z(), ChunkStatus.STRUCTURE_REFERENCES);
|
||||
if (chunk == null) return (List<StructureStart>) Stream.empty();
|
||||
if (chunk == null) return List.of();
|
||||
|
||||
// Copied from StructureFeatureManager::startsForFeature(...) with slight tweaks
|
||||
LongSet longSet = chunk.getReferencesForFeature(structureFeature);
|
||||
@@ -122,7 +122,7 @@ public class WorldGenStructFeatManager extends StructureFeatureManager {
|
||||
@Override
|
||||
public List<StructureStart> startsForFeature(SectionPos sectionPos, Predicate<ConfiguredStructureFeature<?, ?>> predicate) {
|
||||
ChunkAccess chunk = _getChunk(sectionPos.x(), sectionPos.z(), ChunkStatus.STRUCTURE_REFERENCES);
|
||||
if (chunk == null) return (List<StructureStart>) Stream.empty();
|
||||
if (chunk == null) return List.of();
|
||||
|
||||
// Copied from StructureFeatureManager::startsForFeature(...)
|
||||
Map<ConfiguredStructureFeature<?, ?>, LongSet> map = chunk.getAllReferences();
|
||||
@@ -165,4 +165,4 @@ public class WorldGenStructFeatManager extends StructureFeatureManager {
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class MixinUtilBackgroudThread
|
||||
ci.setReturnValue(r);
|
||||
}
|
||||
}
|
||||
#if MC_VERSION_1_18_1 | MC_VERSION_1_18_2
|
||||
#if MC_VERSION_1_18_1 || MC_VERSION_1_18_2
|
||||
@Inject(method = "wrapThreadWithTaskName(Ljava/lang/String;Ljava/util/function/Supplier;)Ljava/util/function/Supplier;",
|
||||
at = @At("HEAD"), cancellable = true)
|
||||
private static void overrideUtil$wrapThreadWithTaskNameForSupplier(String string, Supplier<?> r, CallbackInfoReturnable<Supplier<?>> ci)
|
||||
|
||||
@@ -43,7 +43,7 @@ public class MixinClientLevel {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if MC_VERSION_1_18_1 | MC_VERSION_1_18_2
|
||||
#if MC_VERSION_1_18_1 || MC_VERSION_1_18_2
|
||||
@Inject(method = "setLightReady", at = @At("RETURN"))
|
||||
private void onChunkLightReady(int x, int z, CallbackInfo ci) {
|
||||
ClientLevel l = (ClientLevel) (Object) this;
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ package com.seibel.lod.fabric.mixins.unsafe;
|
||||
import net.minecraft.util.ThreadingDetector;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
#if MC_VERSION_1_18_1 | MC_VERSION_1_18_2
|
||||
#if MC_VERSION_1_18_1 || MC_VERSION_1_18_2
|
||||
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@@ -30,4 +30,4 @@ public class MixinThreadingDectector {
|
||||
#else
|
||||
@Mixin(ThreadingDetector.class)
|
||||
public class MixinThreadingDectector {} //FIXME: Is there some way to make this file just not be added?
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -47,8 +47,11 @@ import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
#if MC_VERSION_1_18_1 || MC_VERSION_1_18_2
|
||||
import net.minecraftforge.client.ConfigGuiHandler;
|
||||
#elif MC_VERSION_1_16_5 || MC_VERSION_1_17_1
|
||||
import net.minecraftforge.fmlclient.ConfigGuiHandler;
|
||||
//import net.minecraftforge.client.ConfigGuiHandler;
|
||||
#endif
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
@@ -108,6 +111,10 @@ public class ForgeMain implements LodForgeMethodCaller
|
||||
|
||||
@Override
|
||||
public int colorResolverGetColor(ColorResolver resolver, Biome biome, double x, double z) {
|
||||
#if MC_VERSION_1_18_1 || MC_VERSION_1_18_2
|
||||
return resolver.getColor(biome, x, z);
|
||||
#elif MC_VERSION_1_17_1
|
||||
return resolver.m_130045_(biome, x, z);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public final class PlayerLookup {
|
||||
public static Collection<ServerPlayer> tracking(ServerLevel world, ChunkPos pos) {
|
||||
Objects.requireNonNull(world, "The world cannot be null");
|
||||
Objects.requireNonNull(pos, "The chunk pos cannot be null");
|
||||
#if MC_VERSION_1_18_1 | MC_VERSION_1_18_2
|
||||
#if MC_VERSION_1_18_1 || MC_VERSION_1_18_2
|
||||
return world.getChunkSource().chunkMap.getPlayers(pos, false);
|
||||
#else
|
||||
return world.getChunkSource().chunkMap.getPlayers(pos, false).toList();
|
||||
|
||||
@@ -32,7 +32,7 @@ public class MixinUtilBackgroudThread
|
||||
ci.setReturnValue(r);
|
||||
}
|
||||
}
|
||||
#if MC_VERSION_1_18_1 | MC_VERSION_1_18_2
|
||||
#if MC_VERSION_1_18_1 || MC_VERSION_1_18_2
|
||||
@Inject(method = "wrapThreadWithTaskName(Ljava/lang/String;Ljava/util/function/Supplier;)Ljava/util/function/Supplier;",
|
||||
at = @At("HEAD"), cancellable = true)
|
||||
private static void overrideUtil$wrapThreadWithTaskNameForSupplier(String string, Supplier<?> r, CallbackInfoReturnable<Supplier<?>> ci)
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.seibel.lod.forge.mixins.unsafe;
|
||||
import net.minecraft.util.ThreadingDetector;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
#if MC_VERSION_1_18_1 | MC_VERSION_1_18_2
|
||||
#if MC_VERSION_1_18_1 || MC_VERSION_1_18_2
|
||||
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
Reference in New Issue
Block a user