Port forge and finally fix build scripts

This commit is contained in:
2023-09-25 20:18:35 +02:00
parent ec5fa726a0
commit aef4992cf5
22 changed files with 156 additions and 141 deletions

View File

@@ -1,16 +1,16 @@
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'maven-publish'
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'idea'
id 'com.github.johnrengelman.shadow' version '7.0.0'
id "me.hypherionmc.modutils.modpublisher" version "1.0.+"
}
apply plugin: 'me.hypherionmc.modutils.modpublisher'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'maven-publish'
archivesBaseName = "${mod_name}-fabric-${minecraft_version}"
configurations {
shade
implementation.extendsFrom shade
}
dependencies {
@@ -30,7 +30,6 @@ dependencies {
}
loom {
shareCaches()
accessWidenerPath = project(":Common").file("src/main/resources/craterlib.aw")
runs {
client {
@@ -48,7 +47,6 @@ loom {
}
}
processResources {
from project(":Common").sourceSets.main.resources
inputs.property "version", project.version
@@ -72,23 +70,28 @@ jar {
}
}
/**
* Shadowjar Config
*/
shadowJar {
from sourceSets.main.output
configurations = [project.configurations.shade]
dependencies {
relocate 'me.hypherionmc.moonconfig', 'shadow.hypherionmc.moonconfig'
}
setArchiveClassifier("dev-shadow")
}
remapJar {
dependsOn(shadowJar)
shouldRunAfter(shadowJar)
input.set shadowJar.archiveFile.get()
input.set shadowJar.archiveFile
dependsOn shadowJar
setArchiveClassifier(null)
}
reg.configureJarTask(shadowJar)
//reg.configureJarTask(shadowJar)
/**
* Publishing Config
*/
publishing {
publications {
mavenJava(MavenPublication) {
@@ -125,24 +128,6 @@ publishing {
}
}
task delDevJar {
doLast {
def tree = fileTree('build/libs')
tree.include '**/*-dev.jar'
tree.include '**/*-all.jar'
tree.each { it.delete() }
}
}
build.finalizedBy delDevJar
task copyAllArtifacts(type: Copy) {
from "$buildDir/libs"
into "$rootDir/artifacts"
include("*.jar")
}
build.finalizedBy(copyAllArtifacts)
publisher {
apiKeys {
modrinth = System.getenv("MODRINTH_TOKEN")
@@ -168,4 +153,5 @@ publisher {
}
}
publishMod.dependsOn(build)
publishMod.dependsOn(build)

View File

@@ -1,12 +1,9 @@
package com.hypherionmc.craterlib.client;
import com.hypherionmc.craterlib.api.rendering.CustomRenderType;
import com.hypherionmc.craterlib.common.item.BlockItemDyable;
import com.hypherionmc.craterlib.core.platform.ClientPlatform;
import com.hypherionmc.craterlib.core.systems.reg.RegistryObject;
import com.hypherionmc.craterlib.util.ColorPropertyFunction;
import net.fabricmc.api.EnvType;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
@@ -16,13 +13,10 @@ import net.minecraft.network.Connection;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import org.jetbrains.annotations.NotNull;
import java.util.Collection;
/**
* @author HypherionSA
*/
@@ -35,14 +29,14 @@ public class FabricClientPlatform implements ClientPlatform {
}
}
@Override
/*@Override
public void registerCustomRenderTypes(Collection<RegistryObject<Block>> blocks) {
blocks.forEach(blk -> {
if (blk.get() instanceof CustomRenderType type) {
BlockRenderLayerMap.INSTANCE.putBlock(blk.get(), type.getCustomRenderType());
}
});
}
}*/
@Override
public Minecraft getClientInstance() {

View File

@@ -1,7 +1,6 @@
package com.hypherionmc.craterlib.network.impl;
import com.hypherionmc.craterlib.core.network.CraterPacket;
import com.hypherionmc.craterlib.network.FabricNetworkHelper;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
import net.fabricmc.fabric.api.networking.v1.PacketSender;
import net.minecraft.client.Minecraft;