Port forge and finally fix build scripts
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -12,7 +12,7 @@
|
|||||||
<component name="FrameworkDetectionExcludesConfiguration">
|
<component name="FrameworkDetectionExcludesConfiguration">
|
||||||
<file type="web" url="file://$PROJECT_DIR$" />
|
<file type="web" url="file://$PROJECT_DIR$" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="temurin-17" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="corretto-17" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@@ -1,24 +1,27 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'org.quiltmc.loom' version '1.3.+'
|
||||||
id 'fabric-loom' version '0.12-SNAPSHOT'
|
|
||||||
id 'maven-publish'
|
|
||||||
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
apply plugin: 'com.github.johnrengelman.shadow'
|
||||||
|
apply plugin: 'maven-publish'
|
||||||
|
|
||||||
archivesBaseName = "${mod_name}-common-${minecraft_version}"
|
archivesBaseName = "${mod_name}-common-${minecraft_version}"
|
||||||
|
|
||||||
loom {
|
loom {
|
||||||
shareCaches()
|
|
||||||
accessWidenerPath = project.file("src/main/resources/craterlib.aw")
|
accessWidenerPath = project.file("src/main/resources/craterlib.aw")
|
||||||
remapArchives = false
|
|
||||||
mixin {
|
mixin {
|
||||||
useLegacyMixinAp = false
|
useLegacyMixinAp = false
|
||||||
}
|
}
|
||||||
|
runConfigs.configureEach {
|
||||||
|
ideConfigGenerated = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
minecraft "com.mojang:minecraft:${minecraft_version}"
|
minecraft "com.mojang:minecraft:${minecraft_version}"
|
||||||
mappings loom.officialMojangMappings()
|
mappings loom.officialMojangMappings()
|
||||||
|
modImplementation "org.quiltmc:quilt-loader:0.19.4"
|
||||||
|
|
||||||
compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5'
|
compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5'
|
||||||
implementation "com.hypherionmc:rpcsdk:1.0"
|
implementation "com.hypherionmc:rpcsdk:1.0"
|
||||||
}
|
}
|
||||||
@@ -31,19 +34,31 @@ processResources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shadowjar Config
|
||||||
|
*/
|
||||||
shadowJar {
|
shadowJar {
|
||||||
|
exclude 'mappings/*'
|
||||||
dependencies {
|
dependencies {
|
||||||
include(dependency("me.hypherionmc.moon-config:core:${moon_config}"))
|
include(dependency("me.hypherionmc.moon-config:core:${moon_config}"))
|
||||||
include(dependency("me.hypherionmc.moon-config:toml:${moon_config}"))
|
include(dependency("me.hypherionmc.moon-config:toml:${moon_config}"))
|
||||||
|
|
||||||
relocate 'me.hypherionmc.moonconfig', 'shadow.hypherionmc.moonconfig'
|
relocate 'me.hypherionmc.moonconfig', 'shadow.hypherionmc.moonconfig'
|
||||||
}
|
}
|
||||||
setArchiveClassifier('')
|
setArchiveClassifier('dev-shadow')
|
||||||
}
|
}
|
||||||
|
|
||||||
build.dependsOn shadowJar
|
remapJar {
|
||||||
reg.configureJarTask(shadowJar)
|
input.set shadowJar.archiveFile
|
||||||
|
dependsOn shadowJar
|
||||||
|
setArchiveClassifier(null)
|
||||||
|
}
|
||||||
|
|
||||||
|
//reg.configureJarTask(shadowJar)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Publishing Config
|
||||||
|
*/
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
mavenJava(MavenPublication) {
|
mavenJava(MavenPublication) {
|
||||||
|
2
Common/gradle.properties
Normal file
2
Common/gradle.properties
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# We don't need the common jar to be remapped
|
||||||
|
fabric.loom.dontRemap = true
|
@@ -19,9 +19,9 @@ import net.minecraft.network.chat.Component;
|
|||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.util.Mth;
|
import net.minecraft.util.Mth;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.joml.Matrix4f;
|
import org.joml.Matrix4f;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
@@ -6,8 +6,8 @@ import net.minecraft.client.gui.GuiGraphics;
|
|||||||
import net.minecraft.client.gui.components.events.AbstractContainerEventHandler;
|
import net.minecraft.client.gui.components.events.AbstractContainerEventHandler;
|
||||||
import net.minecraft.client.gui.components.events.GuiEventListener;
|
import net.minecraft.client.gui.components.events.GuiEventListener;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
@@ -1,15 +1,7 @@
|
|||||||
package com.hypherionmc.craterlib.client.registry;
|
package com.hypherionmc.craterlib.client.registry;
|
||||||
|
|
||||||
import com.hypherionmc.craterlib.api.rendering.DyableBlock;
|
|
||||||
import com.hypherionmc.craterlib.api.rendering.ItemDyable;
|
|
||||||
import com.hypherionmc.craterlib.client.rendering.ItemColorHandler;
|
|
||||||
import com.hypherionmc.craterlib.core.platform.ClientPlatform;
|
import com.hypherionmc.craterlib.core.platform.ClientPlatform;
|
||||||
import com.hypherionmc.craterlib.core.systems.reg.RegistrationProvider;
|
|
||||||
import net.minecraft.client.color.block.BlockColors;
|
|
||||||
import net.minecraft.client.color.item.ItemColors;
|
|
||||||
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
|
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
|
||||||
import net.minecraft.world.item.Item;
|
|
||||||
import net.minecraft.world.level.block.Block;
|
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -26,13 +18,13 @@ public class ClientRegistry {
|
|||||||
* @param colors Existing block colors obtained from {@link com.hypherionmc.craterlib.api.event.client.ColorRegistrationEvent}
|
* @param colors Existing block colors obtained from {@link com.hypherionmc.craterlib.api.event.client.ColorRegistrationEvent}
|
||||||
* @param blocks The blocks registered for the module
|
* @param blocks The blocks registered for the module
|
||||||
*/
|
*/
|
||||||
public static void registerBlockColors(@NotNull BlockColors colors, @NotNull RegistrationProvider<Block> blocks) {
|
/*public static void registerBlockColors(@NotNull BlockColors colors, @NotNull RegistrationProvider<Block> blocks) {
|
||||||
blocks.getEntries().forEach(blockRegistryObject -> {
|
blocks.getEntries().forEach(blockRegistryObject -> {
|
||||||
if (blockRegistryObject.get() instanceof DyableBlock dyableBlock) {
|
if (blockRegistryObject.get() instanceof DyableBlock dyableBlock) {
|
||||||
colors.register(dyableBlock.dyeHandler(), (Block) dyableBlock);
|
colors.register(dyableBlock.dyeHandler(), (Block) dyableBlock);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register Item Color Handlers
|
* Register Item Color Handlers
|
||||||
@@ -40,13 +32,13 @@ public class ClientRegistry {
|
|||||||
* @param colors Existing item colors obtained from {@link com.hypherionmc.craterlib.api.event.client.ColorRegistrationEvent}
|
* @param colors Existing item colors obtained from {@link com.hypherionmc.craterlib.api.event.client.ColorRegistrationEvent}
|
||||||
* @param items The items registered for the module
|
* @param items The items registered for the module
|
||||||
*/
|
*/
|
||||||
public static void registerItemColors(@NotNull ItemColors colors, @NotNull RegistrationProvider<Item> items) {
|
/*public static void registerItemColors(@NotNull ItemColors colors, @NotNull RegistrationProvider<Item> items) {
|
||||||
items.getEntries().forEach(itemRegistryObject -> {
|
items.getEntries().forEach(itemRegistryObject -> {
|
||||||
if (itemRegistryObject.get() instanceof ItemDyable itemDyable) {
|
if (itemRegistryObject.get() instanceof ItemDyable itemDyable) {
|
||||||
colors.register(new ItemColorHandler(), (Item) itemDyable);
|
colors.register(new ItemColorHandler(), (Item) itemDyable);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register a {@link net.minecraft.client.renderer.blockentity.BlockEntityRenderer} for a BlockEntity
|
* Register a {@link net.minecraft.client.renderer.blockentity.BlockEntityRenderer} for a BlockEntity
|
||||||
|
@@ -1,20 +1,16 @@
|
|||||||
package com.hypherionmc.craterlib.core.platform;
|
package com.hypherionmc.craterlib.core.platform;
|
||||||
|
|
||||||
import com.hypherionmc.craterlib.common.item.BlockItemDyable;
|
import com.hypherionmc.craterlib.common.item.BlockItemDyable;
|
||||||
import com.hypherionmc.craterlib.core.systems.reg.RegistryObject;
|
|
||||||
import com.hypherionmc.craterlib.util.ServiceUtil;
|
import com.hypherionmc.craterlib.util.ServiceUtil;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
|
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
|
||||||
import net.minecraft.network.Connection;
|
import net.minecraft.network.Connection;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.level.Level;
|
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.BlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author HypherionSA
|
* @author HypherionSA
|
||||||
*/
|
*/
|
||||||
@@ -24,7 +20,7 @@ public interface ClientPlatform {
|
|||||||
|
|
||||||
void registerItemProperty(@NotNull BlockItemDyable item, @NotNull String property);
|
void registerItemProperty(@NotNull BlockItemDyable item, @NotNull String property);
|
||||||
|
|
||||||
void registerCustomRenderTypes(@NotNull Collection<RegistryObject<Block>> blocks);
|
//void registerCustomRenderTypes(@NotNull Collection<RegistryObject<Block>> blocks);
|
||||||
|
|
||||||
Minecraft getClientInstance();
|
Minecraft getClientInstance();
|
||||||
|
|
||||||
|
@@ -13,8 +13,8 @@ import net.minecraft.world.inventory.AbstractContainerMenu;
|
|||||||
import net.minecraft.world.inventory.MenuType;
|
import net.minecraft.world.inventory.MenuType;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import org.apache.commons.lang3.function.TriFunction;
|
import org.apache.commons.lang3.function.TriFunction;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
@@ -3,7 +3,6 @@ package com.hypherionmc.craterlib.mixin.events.client;
|
|||||||
import com.hypherionmc.craterlib.api.event.client.CraterSinglePlayerEvent;
|
import com.hypherionmc.craterlib.api.event.client.CraterSinglePlayerEvent;
|
||||||
import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||||
import net.minecraft.client.multiplayer.ClientLevel;
|
import net.minecraft.client.multiplayer.ClientLevel;
|
||||||
import net.minecraft.client.player.AbstractClientPlayer;
|
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
@@ -4,18 +4,18 @@ import com.hypherionmc.craterlib.api.event.client.ScreenEvent;
|
|||||||
import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@Mixin(Minecraft.class)
|
@Mixin(Minecraft.class)
|
||||||
public class MinecraftMixin {
|
public class MinecraftMixin {
|
||||||
|
|
||||||
@Shadow @Nullable public Screen screen;
|
@Shadow @Nullable
|
||||||
|
public Screen screen;
|
||||||
|
|
||||||
@Inject(method = "setScreen", at = @At(value = "TAIL"))
|
@Inject(method = "setScreen", at = @At(value = "TAIL"))
|
||||||
private void injectScreenOpeningEvent(Screen screen, CallbackInfo ci) {
|
private void injectScreenOpeningEvent(Screen screen, CallbackInfo ci) {
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
accessWidener v1 named
|
accessWidener v1 named
|
||||||
|
|
||||||
accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo
|
|
||||||
accessible method net/minecraft/client/renderer/item/ItemProperties register (Lnet/minecraft/world/item/Item;Lnet/minecraft/resources/ResourceLocation;Lnet/minecraft/client/renderer/item/ClampedItemPropertyFunction;)V
|
accessible method net/minecraft/client/renderer/item/ItemProperties register (Lnet/minecraft/world/item/Item;Lnet/minecraft/resources/ResourceLocation;Lnet/minecraft/client/renderer/item/ClampedItemPropertyFunction;)V
|
||||||
|
@@ -1,16 +1,16 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version '0.12-SNAPSHOT'
|
id 'fabric-loom' version '1.3-SNAPSHOT'
|
||||||
id 'maven-publish'
|
|
||||||
id 'idea'
|
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}"
|
archivesBaseName = "${mod_name}-fabric-${minecraft_version}"
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
shade
|
shade
|
||||||
implementation.extendsFrom shade
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -30,7 +30,6 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
loom {
|
loom {
|
||||||
shareCaches()
|
|
||||||
accessWidenerPath = project(":Common").file("src/main/resources/craterlib.aw")
|
accessWidenerPath = project(":Common").file("src/main/resources/craterlib.aw")
|
||||||
runs {
|
runs {
|
||||||
client {
|
client {
|
||||||
@@ -48,7 +47,6 @@ loom {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
from project(":Common").sourceSets.main.resources
|
from project(":Common").sourceSets.main.resources
|
||||||
inputs.property "version", project.version
|
inputs.property "version", project.version
|
||||||
@@ -72,23 +70,28 @@ jar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shadowjar Config
|
||||||
|
*/
|
||||||
shadowJar {
|
shadowJar {
|
||||||
from sourceSets.main.output
|
|
||||||
|
|
||||||
configurations = [project.configurations.shade]
|
configurations = [project.configurations.shade]
|
||||||
dependencies {
|
dependencies {
|
||||||
relocate 'me.hypherionmc.moonconfig', 'shadow.hypherionmc.moonconfig'
|
relocate 'me.hypherionmc.moonconfig', 'shadow.hypherionmc.moonconfig'
|
||||||
}
|
}
|
||||||
|
setArchiveClassifier("dev-shadow")
|
||||||
}
|
}
|
||||||
|
|
||||||
remapJar {
|
remapJar {
|
||||||
dependsOn(shadowJar)
|
input.set shadowJar.archiveFile
|
||||||
shouldRunAfter(shadowJar)
|
dependsOn shadowJar
|
||||||
input.set shadowJar.archiveFile.get()
|
setArchiveClassifier(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
reg.configureJarTask(shadowJar)
|
//reg.configureJarTask(shadowJar)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Publishing Config
|
||||||
|
*/
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
mavenJava(MavenPublication) {
|
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 {
|
publisher {
|
||||||
apiKeys {
|
apiKeys {
|
||||||
modrinth = System.getenv("MODRINTH_TOKEN")
|
modrinth = System.getenv("MODRINTH_TOKEN")
|
||||||
@@ -169,3 +154,4 @@ publisher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
publishMod.dependsOn(build)
|
publishMod.dependsOn(build)
|
||||||
|
|
||||||
|
@@ -1,12 +1,9 @@
|
|||||||
package com.hypherionmc.craterlib.client;
|
package com.hypherionmc.craterlib.client;
|
||||||
|
|
||||||
import com.hypherionmc.craterlib.api.rendering.CustomRenderType;
|
|
||||||
import com.hypherionmc.craterlib.common.item.BlockItemDyable;
|
import com.hypherionmc.craterlib.common.item.BlockItemDyable;
|
||||||
import com.hypherionmc.craterlib.core.platform.ClientPlatform;
|
import com.hypherionmc.craterlib.core.platform.ClientPlatform;
|
||||||
import com.hypherionmc.craterlib.core.systems.reg.RegistryObject;
|
|
||||||
import com.hypherionmc.craterlib.util.ColorPropertyFunction;
|
import com.hypherionmc.craterlib.util.ColorPropertyFunction;
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
|
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
|
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
|
||||||
@@ -16,13 +13,10 @@ import net.minecraft.network.Connection;
|
|||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.level.Level;
|
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.BlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author HypherionSA
|
* @author HypherionSA
|
||||||
*/
|
*/
|
||||||
@@ -35,14 +29,14 @@ public class FabricClientPlatform implements ClientPlatform {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/*@Override
|
||||||
public void registerCustomRenderTypes(Collection<RegistryObject<Block>> blocks) {
|
public void registerCustomRenderTypes(Collection<RegistryObject<Block>> blocks) {
|
||||||
blocks.forEach(blk -> {
|
blocks.forEach(blk -> {
|
||||||
if (blk.get() instanceof CustomRenderType type) {
|
if (blk.get() instanceof CustomRenderType type) {
|
||||||
BlockRenderLayerMap.INSTANCE.putBlock(blk.get(), type.getCustomRenderType());
|
BlockRenderLayerMap.INSTANCE.putBlock(blk.get(), type.getCustomRenderType());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Minecraft getClientInstance() {
|
public Minecraft getClientInstance() {
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
package com.hypherionmc.craterlib.network.impl;
|
package com.hypherionmc.craterlib.network.impl;
|
||||||
|
|
||||||
import com.hypherionmc.craterlib.core.network.CraterPacket;
|
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.client.networking.v1.ClientPlayNetworking;
|
||||||
import net.fabricmc.fabric.api.networking.v1.PacketSender;
|
import net.fabricmc.fabric.api.networking.v1.PacketSender;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
@@ -1,22 +1,10 @@
|
|||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
maven { url = 'https://mcentral.firstdark.dev/releases' }
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
|
|
||||||
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
plugins {
|
|
||||||
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
|
||||||
id "me.hypherionmc.modutils.modpublisher" version "1.0.+"
|
|
||||||
}
|
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'net.minecraftforge.gradle'
|
apply plugin: 'net.minecraftforge.gradle'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
apply plugin: 'org.spongepowered.mixin'
|
apply plugin: 'org.spongepowered.mixin'
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
|
apply plugin: 'me.hypherionmc.modutils.modpublisher'
|
||||||
|
apply plugin: 'com.github.johnrengelman.shadow'
|
||||||
|
|
||||||
archivesBaseName = "${mod_name}-forge-${minecraft_version}"
|
archivesBaseName = "${mod_name}-forge-${minecraft_version}"
|
||||||
|
|
||||||
@@ -31,8 +19,6 @@ minecraft {
|
|||||||
mappings channel: 'official', version: minecraft_version
|
mappings channel: 'official', version: minecraft_version
|
||||||
|
|
||||||
if (project.hasProperty('forge_ats_enabled') && project.findProperty('forge_ats_enabled').toBoolean()) {
|
if (project.hasProperty('forge_ats_enabled') && project.findProperty('forge_ats_enabled').toBoolean()) {
|
||||||
// This location is hardcoded in Forge and can not be changed.
|
|
||||||
// https://github.com/MinecraftForge/MinecraftForge/blob/be1698bb1554f9c8fa2f58e32b9ab70bc4385e60/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java#L123
|
|
||||||
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
||||||
project.logger.debug('Forge Access Transformers are enabled for this project.')
|
project.logger.debug('Forge Access Transformers are enabled for this project.')
|
||||||
}
|
}
|
||||||
@@ -109,23 +95,28 @@ processResources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shadowjar Config
|
||||||
|
*/
|
||||||
shadowJar {
|
shadowJar {
|
||||||
configurations = [project.configurations.shade]
|
configurations = [project.configurations.shade]
|
||||||
dependencies {
|
dependencies {
|
||||||
relocate 'me.hypherionmc.moonconfig', 'shadow.hypherionmc.moonconfig'
|
relocate 'me.hypherionmc.moonconfig', 'shadow.hypherionmc.moonconfig'
|
||||||
}
|
}
|
||||||
|
setArchiveClassifier('')
|
||||||
classifier = ''
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assemble.dependsOn(shadowJar)
|
||||||
|
|
||||||
reobf {
|
reobf {
|
||||||
shadowJar {}
|
shadowJar {}
|
||||||
}
|
}
|
||||||
|
|
||||||
build.dependsOn reobfShadowJar
|
//reg.configureJarTask(shadowJar)
|
||||||
reg.configureJarTask(shadowJar)
|
|
||||||
jar.finalizedBy('reobfJar')
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Publishing Config
|
||||||
|
*/
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
mavenJava(MavenPublication) {
|
mavenJava(MavenPublication) {
|
||||||
@@ -156,14 +147,6 @@ publishing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task copyAllArtifacts(type: Copy) {
|
|
||||||
from "$buildDir/libs"
|
|
||||||
into "$rootDir/artifacts"
|
|
||||||
include("*.jar")
|
|
||||||
}
|
|
||||||
|
|
||||||
build.finalizedBy(copyAllArtifacts)
|
|
||||||
|
|
||||||
publisher {
|
publisher {
|
||||||
apiKeys {
|
apiKeys {
|
||||||
modrinth = System.getenv("MODRINTH_TOKEN")
|
modrinth = System.getenv("MODRINTH_TOKEN")
|
||||||
@@ -182,3 +165,4 @@ publisher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
publishMod.dependsOn(build)
|
publishMod.dependsOn(build)
|
||||||
|
jar.finalizedBy('reobfJar')
|
@@ -1,12 +1,9 @@
|
|||||||
package com.hypherionmc.craterlib.client;
|
package com.hypherionmc.craterlib.client;
|
||||||
|
|
||||||
import com.hypherionmc.craterlib.api.rendering.CustomRenderType;
|
|
||||||
import com.hypherionmc.craterlib.common.item.BlockItemDyable;
|
import com.hypherionmc.craterlib.common.item.BlockItemDyable;
|
||||||
import com.hypherionmc.craterlib.core.platform.ClientPlatform;
|
import com.hypherionmc.craterlib.core.platform.ClientPlatform;
|
||||||
import com.hypherionmc.craterlib.core.systems.reg.RegistryObject;
|
|
||||||
import com.hypherionmc.craterlib.util.ColorPropertyFunction;
|
import com.hypherionmc.craterlib.util.ColorPropertyFunction;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.ItemBlockRenderTypes;
|
|
||||||
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
|
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
|
||||||
import net.minecraft.client.renderer.blockentity.BlockEntityRenderers;
|
import net.minecraft.client.renderer.blockentity.BlockEntityRenderers;
|
||||||
import net.minecraft.client.renderer.item.ItemProperties;
|
import net.minecraft.client.renderer.item.ItemProperties;
|
||||||
@@ -14,12 +11,10 @@ import net.minecraft.network.Connection;
|
|||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.level.Level;
|
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.BlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraftforge.fml.loading.FMLEnvironment;
|
import net.minecraftforge.fml.loading.FMLEnvironment;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,14 +32,14 @@ public class ForgeClientHelper implements ClientPlatform {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/*@Override
|
||||||
public void registerCustomRenderTypes(Collection<RegistryObject<Block>> blocks) {
|
public void registerCustomRenderTypes(Collection<RegistryObject<Block>> blocks) {
|
||||||
blocks.forEach(blk -> {
|
blocks.forEach(blk -> {
|
||||||
if (blk.get() instanceof CustomRenderType type) {
|
if (blk.get() instanceof CustomRenderType type) {
|
||||||
ItemBlockRenderTypes.setRenderLayer(blk.get(), type.getCustomRenderType());
|
ItemBlockRenderTypes.setRenderLayer(blk.get(), type.getCustomRenderType());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Minecraft getClientInstance() {
|
public Minecraft getClientInstance() {
|
||||||
|
@@ -21,7 +21,6 @@ import net.minecraft.world.item.CreativeModeTab;
|
|||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraftforge.common.capabilities.ForgeCapabilities;
|
import net.minecraftforge.common.capabilities.ForgeCapabilities;
|
||||||
import net.minecraftforge.common.extensions.IForgeMenuType;
|
import net.minecraftforge.common.extensions.IForgeMenuType;
|
||||||
import net.minecraftforge.network.NetworkHooks;
|
|
||||||
import net.minecraftforge.server.ServerLifecycleHooks;
|
import net.minecraftforge.server.ServerLifecycleHooks;
|
||||||
import org.apache.commons.lang3.function.TriFunction;
|
import org.apache.commons.lang3.function.TriFunction;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@@ -54,9 +53,9 @@ public class ForgeCommonHelper implements CommonPlatform {
|
|||||||
@Override
|
@Override
|
||||||
public void openMenu(ServerPlayer player, MenuProvider menu, @Nullable Consumer<FriendlyByteBuf> initialData) {
|
public void openMenu(ServerPlayer player, MenuProvider menu, @Nullable Consumer<FriendlyByteBuf> initialData) {
|
||||||
if (initialData != null) {
|
if (initialData != null) {
|
||||||
NetworkHooks.openScreen(player, menu, initialData);
|
player.openMenu(menu, initialData);
|
||||||
} else {
|
} else {
|
||||||
NetworkHooks.openScreen(player, menu, player.getOnPos());
|
player.openMenu(menu, player.getOnPos());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,17 +5,21 @@ import com.hypherionmc.craterlib.core.network.CraterNetworkHandler;
|
|||||||
import com.hypherionmc.craterlib.core.network.CraterPacket;
|
import com.hypherionmc.craterlib.core.network.CraterPacket;
|
||||||
import com.hypherionmc.craterlib.core.network.PacketDirection;
|
import com.hypherionmc.craterlib.core.network.PacketDirection;
|
||||||
import com.hypherionmc.craterlib.core.platform.ClientPlatform;
|
import com.hypherionmc.craterlib.core.platform.ClientPlatform;
|
||||||
|
import io.netty.buffer.Unpooled;
|
||||||
import net.minecraft.network.FriendlyByteBuf;
|
import net.minecraft.network.FriendlyByteBuf;
|
||||||
import net.minecraft.network.protocol.Packet;
|
import net.minecraft.network.protocol.Packet;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraftforge.common.util.LogicalSidedProvider;
|
import net.minecraftforge.common.util.LogicalSidedProvider;
|
||||||
|
import net.minecraftforge.event.network.CustomPayloadEvent;
|
||||||
import net.minecraftforge.fml.LogicalSide;
|
import net.minecraftforge.fml.LogicalSide;
|
||||||
|
import net.minecraftforge.network.Channel;
|
||||||
|
import net.minecraftforge.network.ChannelBuilder;
|
||||||
import net.minecraftforge.network.NetworkDirection;
|
import net.minecraftforge.network.NetworkDirection;
|
||||||
import net.minecraftforge.network.NetworkEvent;
|
import net.minecraftforge.network.SimpleChannel;
|
||||||
import net.minecraftforge.network.NetworkRegistry;
|
|
||||||
import net.minecraftforge.network.simple.SimpleChannel;
|
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
@@ -29,7 +33,6 @@ import java.util.function.Supplier;
|
|||||||
public class ForgeNetworkHandler implements CraterNetworkHandler {
|
public class ForgeNetworkHandler implements CraterNetworkHandler {
|
||||||
|
|
||||||
private static final Map<String, ForgeNetworkHandler> NETWORK_HANDLERS = Maps.newConcurrentMap();
|
private static final Map<String, ForgeNetworkHandler> NETWORK_HANDLERS = Maps.newConcurrentMap();
|
||||||
private static final String PROTOCOL = Integer.toString(1);
|
|
||||||
|
|
||||||
private final SimpleChannel channel;
|
private final SimpleChannel channel;
|
||||||
|
|
||||||
@@ -39,6 +42,8 @@ public class ForgeNetworkHandler implements CraterNetworkHandler {
|
|||||||
|
|
||||||
private final AtomicInteger packetID = new AtomicInteger();
|
private final AtomicInteger packetID = new AtomicInteger();
|
||||||
|
|
||||||
|
private HashMap<Class<?>, Integer> packetMap = new LinkedHashMap<>();
|
||||||
|
|
||||||
private ForgeNetworkHandler(SimpleChannel channel, boolean clientRequired, boolean serverRequired) {
|
private ForgeNetworkHandler(SimpleChannel channel, boolean clientRequired, boolean serverRequired) {
|
||||||
this.channel = channel;
|
this.channel = channel;
|
||||||
this.clientRequired = clientRequired;
|
this.clientRequired = clientRequired;
|
||||||
@@ -54,37 +59,47 @@ public class ForgeNetworkHandler implements CraterNetworkHandler {
|
|||||||
return packet;
|
return packet;
|
||||||
};
|
};
|
||||||
|
|
||||||
BiConsumer<T, Supplier<NetworkEvent.Context>> handler = (packet, sup) -> {
|
BiConsumer<T, CustomPayloadEvent.Context> handler = (packet, sup) -> {
|
||||||
NetworkEvent.Context context = sup.get();
|
|
||||||
LogicalSide expectedSide = getSideFromDirection(packetDirection);
|
LogicalSide expectedSide = getSideFromDirection(packetDirection);
|
||||||
LogicalSide currentSide = context.getDirection().getReceptionSide();
|
LogicalSide currentSide = sup.getDirection().getReceptionSide();
|
||||||
|
|
||||||
if (expectedSide != currentSide) {
|
if (expectedSide != currentSide) {
|
||||||
throw new IllegalStateException(String.format("Received message on wrong side, expected %s, was %s", expectedSide, currentSide));
|
throw new IllegalStateException(String.format("Received message on wrong side, expected %s, was %s", expectedSide, currentSide));
|
||||||
}
|
}
|
||||||
|
|
||||||
context.enqueueWork(() -> {
|
sup.enqueueWork(() -> {
|
||||||
Player player;
|
Player player;
|
||||||
if (packetDirection == PacketDirection.TO_CLIENT) {
|
if (packetDirection == PacketDirection.TO_CLIENT) {
|
||||||
player = ClientPlatform.INSTANCE.getClientPlayer();
|
player = ClientPlatform.INSTANCE.getClientPlayer();
|
||||||
} else {
|
} else {
|
||||||
player = context.getSender();
|
player = sup.getSender();
|
||||||
}
|
}
|
||||||
packet.handle(player, LogicalSidedProvider.WORKQUEUE.get(expectedSide));
|
packet.handle(player, LogicalSidedProvider.WORKQUEUE.get(expectedSide));
|
||||||
});
|
});
|
||||||
context.setPacketHandled(true);
|
sup.setPacketHandled(true);
|
||||||
};
|
};
|
||||||
this.channel.registerMessage(this.packetID.getAndIncrement(), (Class<T>) clazz, encoder, decoder, handler);
|
|
||||||
|
int id = packetID.getAndIncrement();
|
||||||
|
packetMap.put(clazz, id);
|
||||||
|
|
||||||
|
this.channel
|
||||||
|
.messageBuilder((Class<T>) clazz, id)
|
||||||
|
.encoder(encoder)
|
||||||
|
.decoder(decoder)
|
||||||
|
.consumerNetworkThread(handler)
|
||||||
|
.add();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Packet<?> toServerBound(CraterPacket<?> packet) {
|
public Packet<?> toServerBound(CraterPacket<?> packet) {
|
||||||
return this.channel.toVanillaPacket(packet, NetworkDirection.PLAY_TO_SERVER);
|
return NetworkDirection.PLAY_TO_SERVER.buildPacket(toBuffer(packet), channel.getName()).getThis();
|
||||||
|
//return this.channel.toVanillaPacket(packet, NetworkDirection.PLAY_TO_SERVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Packet<?> toClientBound(CraterPacket<?> packet) {
|
public Packet<?> toClientBound(CraterPacket<?> packet) {
|
||||||
return this.channel.toVanillaPacket(packet, NetworkDirection.PLAY_TO_CLIENT);
|
return NetworkDirection.PLAY_TO_CLIENT.buildPacket(toBuffer(packet), channel.getName()).getThis();
|
||||||
|
//return this.channel.toVanillaPacket(packet, NetworkDirection.PLAY_TO_CLIENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -100,15 +115,24 @@ public class ForgeNetworkHandler implements CraterNetworkHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static SimpleChannel buildSimpleChannel(String modId, boolean clientAcceptsVanillaOrMissing, boolean serverAcceptsVanillaOrMissing) {
|
private static SimpleChannel buildSimpleChannel(String modId, boolean clientAcceptsVanillaOrMissing, boolean serverAcceptsVanillaOrMissing) {
|
||||||
return NetworkRegistry.ChannelBuilder
|
return ChannelBuilder
|
||||||
.named(new ResourceLocation(modId, "crater_network"))
|
.named(new ResourceLocation(modId, "crater_network"))
|
||||||
.networkProtocolVersion(() -> PROTOCOL)
|
.networkProtocolVersion(1)
|
||||||
.clientAcceptedVersions(clientAcceptsVanillaOrMissing ? NetworkRegistry.acceptMissingOr(PROTOCOL) : PROTOCOL::equals)
|
.clientAcceptedVersions(clientAcceptsVanillaOrMissing ? Channel.VersionTest.ACCEPT_MISSING : Channel.VersionTest.exact(1))
|
||||||
.serverAcceptedVersions(serverAcceptsVanillaOrMissing ? NetworkRegistry.acceptMissingOr(PROTOCOL) : PROTOCOL::equals)
|
.serverAcceptedVersions(serverAcceptsVanillaOrMissing ? Channel.VersionTest.ACCEPT_MISSING : Channel.VersionTest.exact(1))
|
||||||
.simpleChannel();
|
.simpleChannel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private LogicalSide getSideFromDirection(PacketDirection direction) {
|
private LogicalSide getSideFromDirection(PacketDirection direction) {
|
||||||
return direction == PacketDirection.TO_CLIENT ? LogicalSide.CLIENT : LogicalSide.SERVER;
|
return direction == PacketDirection.TO_CLIENT ? LogicalSide.CLIENT : LogicalSide.SERVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected FriendlyByteBuf toBuffer(CraterPacket<?> message) {
|
||||||
|
var msg = packetMap.get(message.getClass());
|
||||||
|
|
||||||
|
var ret = new FriendlyByteBuf(Unpooled.buffer());
|
||||||
|
ret.writeVarInt(msg);
|
||||||
|
message.write(ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
36
build.gradle
36
build.gradle
@@ -1,17 +1,21 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java'
|
||||||
id 'com.matyrobbrt.mc.registrationutils' version '1.20-1.1.0'
|
//id 'com.matyrobbrt.mc.registrationutils' version '1.20.1-1.0.0'
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
|
id 'net.minecraftforge.gradle' version '[6.0,6.2)' apply false
|
||||||
|
id 'org.spongepowered.mixin' version '0.7-SNAPSHOT' apply false
|
||||||
|
id 'com.github.johnrengelman.shadow' version '7.0.0' apply false
|
||||||
|
id "me.hypherionmc.modutils.modpublisher" version "1.0.+" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
registrationUtils {
|
/*registrationUtils {
|
||||||
group 'com.hypherionmc.craterlib.core.systems.reg'
|
group 'com.hypherionmc.craterlib.core.systems.reg'
|
||||||
projects {
|
projects {
|
||||||
Common { type 'common'; project ':Common' }
|
Common { type 'common'; project ':Common' }
|
||||||
Fabric { type 'fabric'; project ':Fabric' }
|
Fabric { type 'fabric'; project ':Fabric' }
|
||||||
//Forge { type 'forge'; project ':Forge' }
|
Forge { type 'forge'; project ':Forge' }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
release = project.properties['release'] ?: false
|
release = project.properties['release'] ?: false
|
||||||
@@ -38,6 +42,8 @@ subprojects {
|
|||||||
//java.withJavadocJar()
|
//java.withJavadocJar()
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
|
archiveClassifier = 'slim'
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes([
|
attributes([
|
||||||
'Specification-Title' : mod_name,
|
'Specification-Title' : mod_name,
|
||||||
@@ -86,6 +92,28 @@ subprojects {
|
|||||||
clean {
|
clean {
|
||||||
delete "$rootDir/artifacts"
|
delete "$rootDir/artifacts"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (project.name !== 'Common') {
|
||||||
|
task delDevJar {
|
||||||
|
doLast {
|
||||||
|
def tree = fileTree('build/libs')
|
||||||
|
tree.include '**/*-dev.jar'
|
||||||
|
tree.include '**/*-dev-shadow.jar'
|
||||||
|
tree.include '**/*-all.jar'
|
||||||
|
tree.include '**/*-slim.jar'
|
||||||
|
tree.each { it.delete() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
build.finalizedBy delDevJar
|
||||||
|
|
||||||
|
task copyAllArtifacts(type: Copy) {
|
||||||
|
from "$buildDir/libs"
|
||||||
|
into "$rootDir/artifacts"
|
||||||
|
include("*.jar")
|
||||||
|
}
|
||||||
|
|
||||||
|
build.finalizedBy(copyAllArtifacts)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Standalone or Module JARS
|
// Standalone or Module JARS
|
||||||
|
@@ -1,3 +1,6 @@
|
|||||||
|
# Gradle
|
||||||
|
fabric.loom.multiProjectOptimisation = true
|
||||||
|
|
||||||
# Project
|
# Project
|
||||||
version_major=1
|
version_major=1
|
||||||
version_minor=0
|
version_minor=0
|
||||||
@@ -11,7 +14,7 @@ common_client_run_name=Common Client
|
|||||||
common_server_run_name=Common Server
|
common_server_run_name=Common Server
|
||||||
|
|
||||||
# Forge
|
# Forge
|
||||||
forge_version=46.0.1
|
forge_version=48.0.6
|
||||||
forge_ats_enabled=true
|
forge_ats_enabled=true
|
||||||
|
|
||||||
# Fabric
|
# Fabric
|
||||||
@@ -28,7 +31,7 @@ org.gradle.jvmargs=-Xmx3G
|
|||||||
org.gradle.daemon=false
|
org.gradle.daemon=false
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
mod_menu_version=7.0.0-beta.2
|
mod_menu_version=8.0.0-beta.2
|
||||||
moon_config=1.0.9
|
moon_config=1.0.9
|
||||||
|
|
||||||
# Publishing
|
# Publishing
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@@ -11,4 +11,4 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = 'CraterLib'
|
rootProject.name = 'CraterLib'
|
||||||
include("Common", "Fabric"/*, "Forge"*/)
|
include("Common", "Fabric", "Forge")
|
||||||
|
Reference in New Issue
Block a user