1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-16 18:19:55 +00:00

Fix a couple of packaging issues

- Fix client classes not being included in Forge.
 - Only remap Nettty's HTTP classes, not all of them. This feels a
   little more error prone - maybe we should jar-in-jar this in the
   future.
 - Use the correct refmaps on Forge.
 - Prevent the Fabric jar pulling in some other mods.

Closes #1247
This commit is contained in:
Jonathan Coates 2022-12-12 20:28:18 +00:00
parent 18fbd96c10
commit 06163e4f25
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
5 changed files with 17 additions and 15 deletions

View File

@ -27,7 +27,7 @@ nightConfig = "3.6.5"
slf4j = "1.7.36"
# Minecraft mods
forgeConfig = "4.2.7"
forgeConfig = "4.2.9"
iris = "1.19.3-v1.4.6"
jei = "11.3.0.262"
modmenu = "5.0.1"

View File

@ -35,9 +35,7 @@ addRemappedConfiguration("testWithSodium")
addRemappedConfiguration("testWithIris")
dependencies {
modImplementation(libs.bundles.externalMods.fabric) {
exclude("curse.maven", "configured-fabric-667378") // Added by Forge Config API
}
modImplementation(libs.bundles.externalMods.fabric)
modCompileOnly(libs.bundles.externalMods.fabric.compile) {
exclude("net.fabricmc", "fabric-loader")
exclude("net.fabricmc.fabric-api")
@ -238,6 +236,7 @@ publishing {
mavenDependencies {
exclude(dependencies.create("cc.tweaked:"))
exclude(libs.jei.fabric.get())
exclude(libs.modmenu.get())
}
}
}

View File

@ -25,6 +25,7 @@
import net.fabricmc.fabric.api.lookup.v1.block.BlockApiCache;
import net.fabricmc.fabric.api.lookup.v1.block.BlockApiLookup;
import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder;
import net.fabricmc.fabric.api.registry.FuelRegistry;
import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerFactory;
import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerType;
import net.fabricmc.fabric.api.tag.convention.v1.ConventionalItemTags;
@ -60,7 +61,6 @@
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
@ -242,7 +242,7 @@ public List<TagKey<Item>> getDyeTags() {
@Override
public int getBurnTime(ItemStack stack) {
return AbstractFurnaceBlockEntity.getFuel().getOrDefault(stack.getItem(), 0);
return FuelRegistry.INSTANCE.get(stack.getItem());
}
@Nullable

View File

@ -115,8 +115,8 @@ minecraft {
}
mixin {
add(sourceSets.main.get(), "computercraft.mixins.refmap.json")
add(sourceSets.client.get(), "computercraft-client.mixins.refmap.json")
add(sourceSets.main.get(), "computercraft.refmap.json")
add(sourceSets.client.get(), "client-computercraft.refmap.json")
config("computercraft.mixins.json")
config("computercraft-client.mixins.json")
@ -133,6 +133,7 @@ configurations {
dependencies {
annotationProcessor("org.spongepowered:mixin:0.8.5-SQUID:processor")
clientAnnotationProcessor("org.spongepowered:mixin:0.8.5-SQUID:processor")
compileOnly(libs.jetbrainsAnnotations)
annotationProcessorEverywhere(libs.autoService)
@ -219,13 +220,15 @@ tasks.shadowJar {
finalizedBy("reobfShadowJar")
archiveClassifier.set("")
from(sourceSets.client.get().output)
dependencies {
include(dependency("cc.tweaked:"))
include(dependency(libs.cobalt.get()))
include(dependency(libs.netty.http.get()))
}
relocate("org.squiddev.cobalt", "cc.tweaked.internal.cobalt")
relocate("io.netty.handler", "cc.tweaked.internal.netty")
relocate("io.netty.handler.codec.http", "cc.tweaked.internal.netty.codec.http")
minimize()
}

View File

@ -1,13 +1,13 @@
{
"minVersion": "0.8",
"required": true,
"compatibilityLevel": "JAVA_17",
"refmap": "computercraft.mixins.refmap.json",
"package": "dan200.computercraft.mixin.client",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_17",
"injectors": {
"defaultRequire": 1
},
"client": [
"BlockRenderDispatcherMixin"
],
"injectors": {
"defaultRequire": 1
}
"refmap": "client-computercraft.refmap.json"
}