diff --git a/common/build.gradle b/common/build.gradle index 3c0a98e39..1eaa02269 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -20,7 +20,7 @@ dependencies { def ENV = System.getenv(); architectury { - common(false) + common() } tasks.withType(dokkaHtmlPartial.getClass()).configureEach { diff --git a/common/src/main/java/org/samo_lego/taterzens/Taterzens.java b/common/src/main/java/org/samo_lego/taterzens/Taterzens.java index 6e4c42455..1dd361e80 100644 --- a/common/src/main/java/org/samo_lego/taterzens/Taterzens.java +++ b/common/src/main/java/org/samo_lego/taterzens/Taterzens.java @@ -71,7 +71,7 @@ public class Taterzens { public Taterzens(Platform platform) { INSTANCE = this; - TATERZEN_TYPE = platform.registerTaterzenType(); + platform.registerTaterzenType(); ModDiscovery.checkLoadedMods(platform); diff --git a/common/src/main/java/org/samo_lego/taterzens/platform/Platform.java b/common/src/main/java/org/samo_lego/taterzens/platform/Platform.java index 7908b486c..cbadb61ee 100644 --- a/common/src/main/java/org/samo_lego/taterzens/platform/Platform.java +++ b/common/src/main/java/org/samo_lego/taterzens/platform/Platform.java @@ -1,8 +1,6 @@ package org.samo_lego.taterzens.platform; import net.minecraft.commands.CommandSourceStack; -import net.minecraft.world.entity.EntityType; -import org.samo_lego.taterzens.npc.TaterzenNPC; import java.nio.file.Path; @@ -43,5 +41,5 @@ public abstract class Platform { * Registers the taterzen entity type. * @return the taterzen entity type that was registered. */ - public abstract EntityType registerTaterzenType(); + public abstract void registerTaterzenType(); } diff --git a/fabric/src/main/java/org/samo_lego/taterzens/fabric/platform/FabricPlatform.java b/fabric/src/main/java/org/samo_lego/taterzens/fabric/platform/FabricPlatform.java index d6c053c66..7ff47b726 100644 --- a/fabric/src/main/java/org/samo_lego/taterzens/fabric/platform/FabricPlatform.java +++ b/fabric/src/main/java/org/samo_lego/taterzens/fabric/platform/FabricPlatform.java @@ -6,7 +6,6 @@ import net.minecraft.commands.CommandSourceStack; import net.minecraft.core.Registry; import net.minecraft.world.entity.EntityDimensions; -import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MobCategory; import org.samo_lego.taterzens.fabric.mixin.MappedRegistryAccessor; import org.samo_lego.taterzens.npc.TaterzenNPC; @@ -16,6 +15,7 @@ import static net.minecraft.core.Registry.ITEM; import static org.samo_lego.taterzens.Taterzens.NPC_ID; +import static org.samo_lego.taterzens.Taterzens.TATERZEN_TYPE; public class FabricPlatform extends Platform { @@ -55,8 +55,8 @@ public boolean checkPermission(CommandSourceStack commandSource, String permissi @Override - public EntityType registerTaterzenType() { - return Registry.register( + public void registerTaterzenType() { + TATERZEN_TYPE = Registry.register( Registry.ENTITY_TYPE, NPC_ID, FabricEntityTypeBuilder diff --git a/forge/build.gradle b/forge/build.gradle index 2d7733f6d..ce940e681 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -38,8 +38,9 @@ dependencies { shadowCommon("com.github.samolego.Config2Brigadier:config2brigadier-forge:${rootProject.c2b_version}") { transitive false } // SGUI - modImplementation("com.github.samolego:forgified-sgui:${project.fsgui_version}") - shadowCommon("com.github.samolego:forgified-sgui:${project.fsgui_version}") { transitive false } + //modImplementation("com.github.samolego:forgified-sgui:${project.fsgui_version}") + //shadowCommon("com.github.samolego:forgified-sgui:${project.fsgui_version}") { transitive false } + modImplementation(shadowCommon("eu.pb4:sgui:${rootProject.sgui_version}") { transitive false }) common(project(path: ":common", configuration: "namedElements")) { transitive false } diff --git a/forge/src/main/java/org/samo_lego/taterzens/forge/TaterzensForge.java b/forge/src/main/java/org/samo_lego/taterzens/forge/TaterzensForge.java index a3d176212..114cf8c32 100644 --- a/forge/src/main/java/org/samo_lego/taterzens/forge/TaterzensForge.java +++ b/forge/src/main/java/org/samo_lego/taterzens/forge/TaterzensForge.java @@ -1,6 +1,7 @@ package org.samo_lego.taterzens.forge; import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.MobCategory; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.event.entity.EntityAttributeCreationEvent; @@ -12,6 +13,7 @@ import org.samo_lego.taterzens.npc.TaterzenNPC; import static org.samo_lego.taterzens.Taterzens.MOD_ID; +import static org.samo_lego.taterzens.Taterzens.NPC_ID; import static org.samo_lego.taterzens.Taterzens.TATERZEN_TYPE; @Mod.EventBusSubscriber(modid = MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) @@ -33,6 +35,11 @@ public static void entityAttributes(EntityAttributeCreationEvent event) { @SubscribeEvent public static void registerEntities(RegistryEvent.Register> event) { + TATERZEN_TYPE = (EntityType) EntityType.Builder + .of(TaterzenNPC::new, MobCategory.MISC) + .sized(0.6F, 1.8F) + .build(NPC_ID.toString()) + .setRegistryName(NPC_ID.toString()); event.getRegistry().registerAll(TATERZEN_TYPE); } } \ No newline at end of file diff --git a/forge/src/main/java/org/samo_lego/taterzens/forge/platform/ForgePlatform.java b/forge/src/main/java/org/samo_lego/taterzens/forge/platform/ForgePlatform.java index 4a724a6f9..436c32d89 100644 --- a/forge/src/main/java/org/samo_lego/taterzens/forge/platform/ForgePlatform.java +++ b/forge/src/main/java/org/samo_lego/taterzens/forge/platform/ForgePlatform.java @@ -2,18 +2,13 @@ import net.minecraft.commands.CommandSourceStack; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.EntityType; -import net.minecraft.world.entity.MobCategory; import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.loading.FMLPaths; import net.minecraftforge.registries.RegistryManager; -import org.samo_lego.taterzens.npc.TaterzenNPC; import org.samo_lego.taterzens.platform.Platform; import java.nio.file.Path; -import static org.samo_lego.taterzens.Taterzens.NPC_ID; - public class ForgePlatform extends Platform { private static final ResourceLocation ITEM_ID = new ResourceLocation("item"); @@ -41,11 +36,11 @@ public boolean checkPermission(CommandSourceStack source, String permissionNode, @SuppressWarnings("unchecked") @Override - public EntityType registerTaterzenType() { - return (EntityType) EntityType.Builder + public void registerTaterzenType() { + /*return (EntityType) EntityType.Builder .of(TaterzenNPC::new, MobCategory.MISC) .sized(0.6F, 1.8F) .build(NPC_ID.toString()) - .setRegistryName(NPC_ID.toString()); + .setRegistryName(NPC_ID.toString());*/ } } diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 1cba403c2..c22463b91 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -27,60 +27,3 @@ mandatory = true versionRange = "[1.18,)" ordering = "NONE" side = "SERVER" - -# C2B Lib -modLoader = "javafml" -loaderVersion = "[37,)" -license = "LGPL-v3.0" - -[[mods]] -modId = "config2brigadier" -version = "${c2b_version}" -displayName = "Config to Brigadier" -authors = "samo_lego" -description = ''' -A library to automagically generate in-game command for config editing. -''' - -[[dependencies.config2brigadier]] -modId = "forge" -mandatory = true -versionRange = "[37,)" -ordering = "NONE" -side = "BOTH" - -[[dependencies.config2brigadier]] -modId = "minecraft" -mandatory = true -versionRange = "[1.17.1,)" -ordering = "NONE" -side = "BOTH" - -# Forgified SGUI -modLoader = "javafml" -loaderVersion = "[35,)" -license = "LGPL-v3.0" - -[[mods]] -modId = "sgui" -version = "${sgui_version}" -displayName = "Server GUI lib" -authors = "patbox" -contributors="aws404, samo_lego" -description = ''' -Library for creating server side guis! -''' - -[[dependencies.sgui]] -modId = "forge" -mandatory = true -versionRange = "[35,)" -ordering = "NONE" -side = "BOTH" - -[[dependencies.sgui]] -modId = "minecraft" -mandatory = true -versionRange = "[1.17.1,)" -ordering = "NONE" -side = "BOTH" diff --git a/gradle.properties b/gradle.properties index 578c85204..921d0422a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,15 +2,15 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties -minecraft_version=1.18.2-pre2 -yarn_mappings=1.18.2-pre2+build.7 +minecraft_version=1.18.2 +yarn_mappings=1.18.2+build.2 loader_version=0.13.3 #Fabric api -fabric_version=0.47.6+1.18.2 +fabric_version=0.48.0+1.18.2 #Forge -forge_version=39.0.10 +forge_version=40.0.19 # Mod Properties mod_version = 1.8.4 @@ -20,4 +20,4 @@ archives_base_name = taterzens # Dependencies disguiselib_version = 1.2.1 c2b_version = 1.1.1 -sgui_version = 1.0.0-rc5+1.18+pre5 +sgui_version = 1.0.0+1.18.1 diff --git a/settings.gradle b/settings.gradle index dd1b08692..b00a6d8ee 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,4 +9,4 @@ pluginManagement { include("common") include("fabric") -//include("forge") +include("forge")