mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 05:33:00 +00:00 
			
		
		
		
	Bump dependency versions
Mostly in prep for 1.19.4. - Update to Loom 1.1. - Simplifies our handling of remapped configurations a little. - Removes the need for a fake fabric.mod.json in the API jar. For reasons I don't quite understand, this required us to bump the Fabric API version. Otherwise interfaces are not injected. - Update to Rollup 3.0. - Do NOT update NullAway: It now correctly checks @Nullable fields in inherited classes. This is good, but also a pain as Minecraft is a little over-eager in where it puts @Nullable.
This commit is contained in:
		| @@ -49,8 +49,8 @@ import java.util.concurrent.Executor; | ||||
| public class ComputerCraft { | ||||
|     public static void init() { | ||||
|         NetworkHandler.init(); | ||||
|         FabricRegistryBuilder.createSimple(TurtleUpgradeSerialiser.class, TurtleUpgradeSerialiser.REGISTRY_ID.location()).buildAndRegister(); | ||||
|         FabricRegistryBuilder.createSimple(PocketUpgradeSerialiser.class, PocketUpgradeSerialiser.REGISTRY_ID.location()).buildAndRegister(); | ||||
|         FabricRegistryBuilder.createSimple(TurtleUpgradeSerialiser.REGISTRY_ID).buildAndRegister(); | ||||
|         FabricRegistryBuilder.createSimple(PocketUpgradeSerialiser.REGISTRY_ID).buildAndRegister(); | ||||
|         ModRegistry.register(); | ||||
|         ModRegistry.registerMainThread(); | ||||
|         ModRegistry.registerCreativeTab(FabricItemGroup.builder(new ResourceLocation(ComputerCraftAPI.MOD_ID, "tab"))).build(); | ||||
|   | ||||
| @@ -47,7 +47,7 @@ | ||||
|     ], | ||||
|     "depends": { | ||||
|         "fabricloader": ">=0.14.11", | ||||
|         "fabric-api": ">=0.68.1", | ||||
|         "fabric-api": ">=0.75.1", | ||||
|         "minecraft": ">=1.19.3 <1.20" | ||||
|     }, | ||||
|     "accessWidener": "computercraft.accesswidener" | ||||
|   | ||||
| @@ -1,59 +0,0 @@ | ||||
| /* | ||||
|  * This file is part of ComputerCraft - http://www.computercraft.info | ||||
|  * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. | ||||
|  * Send enquiries to dratcliffe@gmail.com | ||||
|  */ | ||||
| package dan200.computercraft.mixin.gametest; | ||||
| 
 | ||||
| import net.minecraft.gametest.framework.StructureUtils; | ||||
| import net.minecraft.nbt.CompoundTag; | ||||
| import net.minecraft.resources.ResourceLocation; | ||||
| import net.minecraft.server.level.ServerLevel; | ||||
| import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate; | ||||
| import org.spongepowered.asm.mixin.Mixin; | ||||
| import org.spongepowered.asm.mixin.Shadow; | ||||
| import org.spongepowered.asm.mixin.Unique; | ||||
| import org.spongepowered.asm.mixin.injection.At; | ||||
| import org.spongepowered.asm.mixin.injection.Inject; | ||||
| import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||||
| 
 | ||||
| import java.nio.file.Path; | ||||
| import java.nio.file.Paths; | ||||
| 
 | ||||
| /** | ||||
|  * Undo Fabric's mixin which ignores {@link StructureUtils#testStructuresDir}. | ||||
|  */ | ||||
| @Mixin(value = StructureUtils.class, priority = 0) | ||||
| public class StructureUtilsMixin { | ||||
|     // TODO: Replace with https://github.com/FabricMC/fabric/pull/2555 if merged. | ||||
| 
 | ||||
|     @Inject(method = "getStructureTemplate", at = @At("HEAD"), cancellable = true) | ||||
|     @SuppressWarnings("UnusedMethod") | ||||
|     private static void getStructureTemplate(String structureName, ServerLevel serverLevel, CallbackInfoReturnable<StructureTemplate> result) { | ||||
|         result.setReturnValue(getStructureTemplateImpl(structureName, serverLevel)); | ||||
|     } | ||||
| 
 | ||||
|     @Unique | ||||
|     private static StructureTemplate getStructureTemplateImpl(String structureName, ServerLevel serverLevel) { | ||||
|         var structureTemplateManager = serverLevel.getStructureManager(); | ||||
| 
 | ||||
|         var structureId = new ResourceLocation(structureName); | ||||
|         var resourceStructure = structureTemplateManager.get(structureId); | ||||
|         if (resourceStructure.isPresent()) { | ||||
|             return resourceStructure.get(); | ||||
|         } else { | ||||
|             var path = Paths.get(StructureUtils.testStructuresDir, structureId.getPath() + ".snbt"); | ||||
|             var structureInfo = tryLoadStructure(path); | ||||
|             if (structureInfo == null) { | ||||
|                 throw new RuntimeException("Could not find structure file " + path + ", and the structure is not available in the world structures either."); | ||||
|             } | ||||
| 
 | ||||
|             return structureTemplateManager.readStructure(structureInfo); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @Shadow | ||||
|     private static CompoundTag tryLoadStructure(Path pathToStructure) { | ||||
|         throw new IllegalArgumentException("Uncallable"); | ||||
|     } | ||||
| } | ||||
| @@ -1,12 +0,0 @@ | ||||
| { | ||||
|     "required": true, | ||||
|     "package": "dan200.computercraft.mixin.gametest", | ||||
|     "minVersion": "0.8", | ||||
|     "compatibilityLevel": "JAVA_17", | ||||
|     "injectors": { | ||||
|         "defaultRequire": 1 | ||||
|     }, | ||||
|     "mixins": [ | ||||
|         "StructureUtilsMixin" | ||||
|     ] | ||||
| } | ||||
| @@ -11,8 +11,7 @@ | ||||
|         ] | ||||
|     }, | ||||
|     "mixins": [ | ||||
|         "computercraft-gametest.mixins.json", | ||||
|         "computercraft-gametest.fabric.mixins.json" | ||||
|         "computercraft-gametest.mixins.json" | ||||
|     ], | ||||
|     "depends": { | ||||
|         "computercraft": "*" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jonathan Coates
					Jonathan Coates