
matezz
Members-
Posts
61 -
Joined
-
Last visited
Everything posted by matezz
-
1.18.1 How to add external dependency to ForgeGradle.
matezz replied to matezz's topic in Modder Support
Oo that could work, I resolved my problem already but for future it'd be brilliant -
Minecraft supplies provider.create(<spriteset>) on registry, I can't create my own spriteset. I'm just asking why I can't cast this mixin to the target class - only after build. It could be a different class, not the ParticleEngine one. If one doesn't work, the rest wouldn't work too.
-
Hi, I'm trying to get the particle providers of my newly registered particles. Because the method in ParticleEngine is private, I used mixin accessor to get the field of `net.minecraft.client.particle.ParticleEngine#providers`: @Mixin(ParticleEngine.class) public interface ParticleEngineMixin { @Accessor Map<ResourceLocation, ParticleProvider<?>> getProviders(); } and to register a new particle and get the provider I use: Minecraft.getInstance().particleEngine.register(particleType, PARTICLE_FACTORIES.get(registryName)); if (((ParticleEngineMixin) Minecraft.getInstance().particleEngine).getProviders().get(registryName) instanceof WNParticleProvider<?> provider) { PARTICLE_PROVIDERS.put(registryName, provider); } And now, when I launch it in the IDE, everything works fine, particles are registered and I have providers. But when I try to launch the mod in Minecraft after build, it throws me an exception: net.minecraftforge.fml.ModLoadingException: xxx Mod (xxx) encountered an error during the common_setup event phase §7java.lang.ClassCastException: class net.minecraft.client.particle.ParticleEngine cannot be cast to class net.matez.xxx.mixin.ParticleEngineMixin (net.minecraft.client.particle.ParticleEngine is in module minecraft@1.18.1 of loader 'TRANSFORMER' @6c5ddccd; net.matez.xxx.mixin.ParticleEngineMixin is in module xxx@3.1_indev_4 of loader 'TRANSFORMER' @6c5ddccd) at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:124) ~[javafmllanguage-1.18.1-39.0.66.jar%2356!/:?] {} at net.minecraftforge.fml.ModLoader.lambda$postEvent$31(ModLoader.java:298) ~[fmlcore-1.18.1-39.0.66.jar%2355!/:?] {} at java.util.HashMap.forEach(HashMap.java:1421) ~[?:?] {} at net.minecraftforge.fml.ModList.forEachModContainer(ModList.java:232) ~[fmlcore-1.18.1-39.0.66.jar%2355!/:?] {} at net.minecraftforge.fml.ModLoader.postEvent(ModLoader.java:298) ~[fmlcore-1.18.1-39.0.66.jar%2355!/:?] {} at net.minecraft.client.Minecraft.<init>(Minecraft.java:507) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:169) ~[client-1.18.1-20211210.034407-srg.jar%2354!/:?] {re:classloading,pl:runtimedistcleaner:A} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {} at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {} at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {} at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:45) ~[fmlloader-1.18.1-39.0.66.jar%2323!/:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.1.0.jar%235!/:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.1.0.jar%235!/:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.1.0.jar%235!/:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.1.0.jar%235!/:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.1.0.jar%235!/:?] {} at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.1.0.jar%235!/:?] {} at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.1.0.jar%235!/:?] {} at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:149) [bootstraplauncher-1.0.0.jar:?] {} Caused by: java.lang.ClassCastException: class net.minecraft.client.particle.ParticleEngine cannot be cast to class net.matez.xxx.mixin.ParticleEngineMixin (net.minecraft.client.particle.ParticleEngine is in module minecraft@1.18.1 of loader 'TRANSFORMER' @6c5ddccd; net.matez.xxx.mixin.ParticleEngineMixin is in module xxx@3.1_indev_4 of loader 'TRANSFORMER' @6c5ddccd) at net.matez.xxx.common.registry.particles.WNParticles.lambda$registerFactories$0(WNParticles.java:56) ~[xxx-3.1_indev_4.jar%2353!/:3.1_indev_4] {re:classloading} at java.util.LinkedHashMap.forEach(LinkedHashMap.java:721) ~[?:?] {} at net.matez.xxx.common.registry.particles.WNParticles.registerFactories(WNParticles.java:53) ~[xxx-3.1_indev_4.jar%2353!/:3.1_indev_4] {re:classloading} at net.matez.xxx.client.registry.setup.WNClientRegistry.registerParticleFactories(WNClientRegistry.java:29) ~[xxx-3.1_indev_4.jar%2353!/:3.1_indev_4] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:247) ~[eventbus-5.0.3.jar%232!/:?] {} at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:239) ~[eventbus-5.0.3.jar%232!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-5.0.3.jar%232!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-5.0.3.jar%232!/:?] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:120) ~[javafmllanguage-1.18.1-39.0.66.jar%2356!/:?] {} ... 19 more which is actually weird, as all the tutorials say that I can cast my target class with a mixin to access @Accessor. Maybe I'm doing something wrong? Mixin config: refmap enabled, mixin added to "client" in config, mixin version `org.spongepowered:mixingradle:0.7-SNAPSHOT`, forge `1.18.1-39.0.63`, annotationProcessor `org.spongepowered:mixin:0.8.5:processor` I couldn't use AccessTransformers, they didn't work.
-
Yeah I just in the same time discovered, instead TERRAIN_SHEET use PARTICLE_SHEET_OPAQUE. No idea why vanilla used terrain sheet.
-
Hi there, I've tried to register a custom particle, just like the docs say, but instead of a valid texture I get: It uses my block textures, not the particle ones. assets/modid/particles/crystal.json: { "textures": [ "modid:crystal/crystal_0", "modid:crystal/crystal_1", "modid:crystal/crystal_2", "modid:crystal/crystal_3", "modid:crystal/crystal_4", "modid:crystal/crystal_5", "modid:crystal/crystal_6", "modid:crystal/crystal_7" ] } ParticleTypes registered via RegistryEvent.Register<ParticleType<?>> event (SubscribeEvent) ParticleProviders registered via Minecraft.getInstance().particleEngine.register(ParticleType<T>, ParticleEngine.SpriteParticleRegistration<T>) My particle class is a copy of SuspendedParticle with some additions: So probably all should be fine, but it is not. Any ideas why? Thanks.
-
1.18.1 How to add external dependency to ForgeGradle.
matezz replied to matezz's topic in Modder Support
How? I did the same thing. Transistive + reobfShadowJar + runClient and same error occurs. Yeah that's how I figured it out later -
1.18.1 How to add external dependency to ForgeGradle.
matezz replied to matezz's topic in Modder Support
Excluded like so: include ('org.reflections:reflections:0.10.2') { transitive = false } Still the same problem. Anyway I will use FML yeah, just wanted to figure it out for future, cause I already had problems adding Apache Async HTTP dependency. -
1.18.1 How to add external dependency to ForgeGradle.
matezz replied to matezz's topic in Modder Support
Alright, makes sense. How can I solve this then? -
1.18.1 How to add external dependency to ForgeGradle.
matezz replied to matezz's topic in Modder Support
Here: https://github.com/zmatez/dependency_mod_problem -
1.18.1 How to add external dependency to ForgeGradle.
matezz replied to matezz's topic in Modder Support
Ah, I didn't read the whole sentence. Yes it is in my jar. org/reflections/... -
1.18.1 How to add external dependency to ForgeGradle.
matezz replied to matezz's topic in Modder Support
Hmmm, interesting. I can use it. However would be cool if it would be fixed/documented, because I can't really add ANY dependency to my project. Future wise. -
1.18.1 How to add external dependency to ForgeGradle.
matezz replied to matezz's topic in Modder Support
I tried other libraries too, also didn't work. From Apache, so code should be valid. I need this to scan all classes and find annotated ones. From here: https://stackoverflow.com/a/50955914/15411013 -
1.18.1 How to add external dependency to ForgeGradle.
matezz replied to matezz's topic in Modder Support
I was trying to find in other mods' source code, but everything that worked there didn't work in my project. Now I stand with: buildscript { repositories { maven { url = 'https://maven.minecraftforge.net' } maven {url='https://repo.spongepowered.org/repository/maven-public/'} mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT' } } plugins { id 'java-library' id "com.github.johnrengelman.shadow" version "7.1.0" } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' apply plugin: 'org.spongepowered.mixin' version = '3.1' group = 'net.matez.wildnature' archivesBaseName = 'wildnature' java.toolchain.languageVersion = JavaLanguageVersion.of(17) compileJava.options.encoding = 'UTF-8' println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) minecraft { // The mappings can be changed at any time and must be in the following format. // Channel: Version: // snapshot YYYYMMDD Snapshot are built nightly. // stable # Stables are built at the discretion of the MCP team. // official MCVersion Official field/method names from Mojang mapping files // // You must be aware of the Mojang license when using the 'official' mappings. // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md // // Use non-default mappings at your own risk. They may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. mappings channel: 'official', version: '1.18.1' // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default. runs { client { workingDirectory project.file('run') arg "-mixin.config="+archivesBaseName+".mixins.json" property 'mixin.env.disableRefMap', 'true' // Recommended logging data for a userdev environment // The markers can be added/remove as needed separated by commas. // "SCAN": For mods scan. // "REGISTRIES": For firing of registry events. // "REGISTRYDUMP": For getting the contents of all registries. property 'forge.logging.markers', 'REGISTRIES' // Recommended logging level for the console // You can set various levels here. // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels property 'forge.logging.console.level', 'debug' mods { wildnature { source sourceSets.main } } } server { workingDirectory project.file('run') arg "-mixin.config="+archivesBaseName+".mixins.json" property 'mixin.env.disableRefMap', 'true' property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' mods { wildnature { source sourceSets.main } } } data { workingDirectory project.file('run') arg "-mixin.config="+archivesBaseName+".mixins.json" property 'mixin.env.disableRefMap', 'true' property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' args '--mod', 'wildnature', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') mods { wildnature { source sourceSets.main } } } } } sourceSets.main.resources { srcDir 'src/generated/resources' } configurations { include implementation.extendsFrom(include) } repositories { // Put repositories for dependencies here // ForgeGradle automatically adds the Forge maven and Maven Central for you // If you have mod jar dependencies in ./libs, you can declare them as a repository like so: // flatDir { // dir 'libs' // } } dependencies { // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied. // The userdev artifact is a special name and will get all sorts of transformations applied to it. minecraft 'net.minecraftforge:forge:1.18.1-39.0.9' annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' include 'org.reflections:reflections:0.10.2' // Real mod deobf dependency examples - these get remapped to your current mappings // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency // implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency // Examples using mod jars from ./libs // implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}") // For more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } // Example for how to get properties into the manifest for reading at runtime. jar { manifest { attributes([ "Specification-Title" : "wildnature", "Specification-Vendor" : "matez", "Specification-Version" : "1", // We are version 1 of ourselves "Implementation-Title" : project.name, "Implementation-Version" : project.jar.archiveVersion, "Implementation-Vendor" : "matez", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } jar.finalizedBy('reobfJar') publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file://${project.projectDir}/mcmodsrepo" } } } shadowJar { archiveFileName = jar.archiveFileName configurations = [project.configurations.include] } reobf { shadowJar {} } jar.dependsOn("shadowJar") And it's okay in my dev environment, means IntelliJ says that this dependency exists. But when I launch runClient, throws error: Caused by: java.lang.NoClassDefFoundError: org/reflections/Reflections and Caused by: java.lang.ClassNotFoundException: org.reflections.Reflections I'm trying to solve it for the whole day and nothing works. -
Hello, how can I add external dependency to my 1.18.1 project? Implementation and other things like compile don't works and I need to do: dependencies { implementation 'org.reflections:reflections:0.10.2' } Tried everything - shadowJar, shade, nothing works, or just I am doing something wrong. And there is no documentation about it anywhere. Thanks
-
1.18 NoClassDefFoundError on gradle implementation
matezz replied to matezz's topic in Modder Support
Bump Still not works, with different dependencies (tried now "reflections") on a fresh MDK installation. Any ideas again? I can't move on with my project without adding external dependencies. -
Hi, On 1.18, when I add dependency to my build.gradle, everything seem to work fine. IDE properly indexes library, no errors. Just when I run runClient or runServer task, after a while it throws me error: [13:30:15] [modloading-worker-0/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Failed to create mod instance. ModID: polnamod, class net.matez.polna.setup.PolnaMod java.lang.reflect.InvocationTargetException: null at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] {} at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?] {} at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] {} at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] {} at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:81) ~[javafmllanguage-1.18-38.0.16.jar%2378!:?] {} at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:120) ~[fmlcore-1.18-38.0.16.jar%2380!:?] {} at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) [?:?] {} at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) [?:?] {} at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) [?:?] {} at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) [?:?] {} at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) [?:?] {} at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) [?:?] {} at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) [?:?] {} Caused by: java.lang.NoClassDefFoundError: org/apache/http/impl/nio/client/HttpAsyncClients at net.matez.polna.util.HTTPClient.<init>(HTTPClient.java:31) ~[%2381!:?] {re:classloading} at net.matez.polna.setup.PolnaMod.<init>(PolnaMod.java:39) ~[%2381!:?] {re:classloading} ... 14 more Caused by: java.lang.ClassNotFoundException: org.apache.http.impl.nio.client.HttpAsyncClients at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[?:?] {} at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?] {} at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:132) ~[securejarhandler-0.9.54.jar:?] {} at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?] {} at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:132) ~[securejarhandler-0.9.54.jar:?] {} at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?] {} at net.matez.polna.util.HTTPClient.<init>(HTTPClient.java:31) ~[%2381!:?] {re:classloading} at net.matez.polna.setup.PolnaMod.<init>(PolnaMod.java:39) ~[%2381!:?] {re:classloading} ... 14 more My implementation script: dependencies { minecraft 'net.minecraftforge:forge:1.18-38.0.16' implementation 'com.google.code.gson:gson:2.8.9' implementation 'org.apache.httpcomponents:httpasyncclient:4.1.4' implementation 'org.apache.httpcomponents:httpcore:4.4.1.5' } Forge version: 1.18-38.0.16 Gradlew version: 7.3 JDK: Oracle OpenJDK 17 Full logs: https://gist.github.com/80559b62f58c68ca7c0d96c84c3077e4 Crashing class: https://gist.github.com/b849e7b8128d07ba865e258aaeb15abd I was testing the same thing in a newly created Gradle project and it worked fine. Any clue why is this happening?
-
mostly to keep formatting Catch the code https://gist.github.com/e53a0f34afa79b80aef9909047c43ac5 https://gist.github.com/75d4e37e8367fd644db8fd1cf83a1738
-
Hello, I want to fix my mod's mappings, because I've updated some block and item ID's. Configured event RegistryEvent.MissingMappings<Block> event and it is working. My code is: and I'm getting weird error after completing this event. It tells me "Remapped...", 0 errors. But the error is: So the error comes not from my class, but from GameData.Tells me that com.matez.wildnature.common.blocks.BlockSlabVertical cannot be cast to net.minecraft.item.Item. And i'm even not doing anything with items yet! Sometimes it tells also Exception reading .\saves\World\level.dat_old java.lang.ClassCastException: net.minecraft.item.BlockItem cannot be cast to net.minecraft.block.Block What's the matter?
-
Hello, i'm here with bug I don't know how to solve: The item of leaf block has broken transparency (looks like on Fast graphic setting), when vanilla ones look normal (with transparency) I've set the RenderType to cutout mipped, but that seem to work only with blocks: Should the items render be registered independed of blocks then? Thanks
-
Ahaaa thanks!
-
Hi there I'm doing block that after click will send message to player. And that message is being sent two times, however if i wouldn't check for being world remote it would be sent four times. Whats happening? Code: Debug logs: Thanks
-
Hello I have a problem with my mod, sometimes terrain is getting strange.. is that minecraft issue or i did something wrong? I have no ideas. I don't know what code could i provide so ask for it if needed.
-
So no way to make it from code? Cuz i want to make it compatible with blocks from other mods as well
-
So for example i want to add blockstate stick_block.json but instead doing it in file (so when i want to add 500 blocks with same blockstate and model, but with another texture i dont have to add file for each) i can do it in code and put blockstate json to String. Then just i can replace "texture" json tag with another for each block. And then use that in new blocks registered like i written earlier
-
I just want to add new blockstate and model WITHOUT creating new file in assets. Only in code, maybe from String