Tavi007
Members-
Posts
145 -
Joined
-
Last visited
Everything posted by Tavi007
-
Create a class that implements TooltipComponent, which holds the data necessary for the rendering. Create a class that implements ClientTooltipComponent. This class should have a public constructor with only your TooltipComponent implementation as argument. Use RegisterClientTooltipComponentFactoriesEvent, so the game knows which ClientTooltipComponentneeds to be created, when an item has the TooltipComponent added to it. You can use the previosly mentioned constructor as your factory method. Add your TooltipComponent to the tooltip render pipeline with RenderTooltipEvent.GatherComponents. This is at least how I solved it. Anyone can correct me, if I made an error.
-
Hey. I'm updating my mod to the newer minecraft version and I now have to register damage type for my custom damage sources. As far as I know forge doesn't provide a DeferredRegister nor a register event (at least i did not find one yet). All I found was this other thread here, with basically the same question and I tried to code the same approach. Here is the link to my code where I try to register the damage types https://github.com/Tavi007/ElementalCombat/blob/master/src/main/java/Tavi007/ElementalCombat/init/DamageTypeList.java I know, that I'm not calling the bootstrap method myself anywhere, mostly because I don't know where and when to call it and how to get the needed BootstapContext. Does anybody know more or can guide me to a proper implementation of the damage type registering?
-
Hey! Thank you for the help. I could resolve the issue described in my opening post, but now have a different issue (something along the lines of main mod class not found. I get the same error for a fresh project with forge 45.1.2. The funny thing is, that I don't get any problems when running the dev environment with intellij. Even the issue from the opening post doesn't happen with intellij... So for now I will have to learn a new IDE so I won't get annoyed to much lol.
-
Bump, since I still need help. Out of curiosity I tried to run the example mod provided in a fresh new mod setup for forge 45.1.2 and I ended up with the exact same stacktrace. Now I'm quite puzzled since the fresh setup should be working, I suppose, but it isn't for me. I have no idea how to start debugging, since I don't even know what minecraft/forge is trying to do here. Down below you can find the full debug log.
-
Hey all, I'm currently updating my mod from 19.3 to 19.4 and after fixing all the normal issues like changes to the DamageSource and so on I was finally ready to run the mod. However on start I encounter following the RuntimeException: Exception in thread "main" java.lang.module.ResolutionException: Module elementalcombat contains package Tavi007.ElementalCombat.api, module main exports package Tavi007.ElementalCombat.api to elementalcombat at java.base/java.lang.module.Resolver.resolveFail(Resolver.java:901) at java.base/java.lang.module.Resolver.failTwoSuppliers(Resolver.java:807) at java.base/java.lang.module.Resolver.checkExportSuppliers(Resolver.java:736) at java.base/java.lang.module.Resolver.finish(Resolver.java:380) at java.base/java.lang.module.Configuration.<init>(Configuration.java:140) at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:494) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.ModuleLayerHandler.buildLayer(ModuleLayerHandler.java:75) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.TransformationServicesHandler.buildTransformingClassLoader(TransformationServicesHandler.java:60) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:106) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:78) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) I suppose something is wrong with my gradle setup, but I didn't really change anything here except update the version. In 19.3 everything was working fine... Does anybody know where I messed up? The link to the gradle file: https://github.com/Tavi007/ElementalCombat/blob/master/build.gradle
-
Hey all, I'm currently updating my mod from 19.3 to 19.4 and after fixing all the normal issues like changes to the DamageSource and so on I was finally ready to run the mod. However on start I encounter following the RuntimeException: Exception in thread "main" java.lang.module.ResolutionException: Module elementalcombat contains package Tavi007.ElementalCombat.api, module main exports package Tavi007.ElementalCombat.api to elementalcombat at java.base/java.lang.module.Resolver.resolveFail(Resolver.java:901) at java.base/java.lang.module.Resolver.failTwoSuppliers(Resolver.java:807) at java.base/java.lang.module.Resolver.checkExportSuppliers(Resolver.java:736) at java.base/java.lang.module.Resolver.finish(Resolver.java:380) at java.base/java.lang.module.Configuration.<init>(Configuration.java:140) at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:494) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.ModuleLayerHandler.buildLayer(ModuleLayerHandler.java:75) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.TransformationServicesHandler.buildTransformingClassLoader(TransformationServicesHandler.java:60) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:106) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:78) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) I suppose something is wrong with my gradle setup, but I didn't really change anything here except update the version. In 19.3 everything was working fine... Does anybody know where I messed up? The link to the gradle file: https://github.com/Tavi007/ElementalCombat/blob/master/build.gradle
-
Problem with adding 'wthit' as dependency [solved]
Tavi007 replied to Tavi007's topic in ForgeGradle
So after a lot of trial and error and using google i actually found a solution here: https://github.com/SpongePowered/MixinGradle/issues/40 Apparently it's a known problem and for now the best work around is to apply the plugin in a certain order: apply plugin: 'net.minecraftforge.gradle' apply plugin: 'org.spongepowered.mixin' apply plugin: 'eclipse' At least that worked for me -
Problem with adding 'wthit' as dependency [solved]
Tavi007 replied to Tavi007's topic in ForgeGradle
I always run 'gradlew genEclipseRuns --refresh-dependencies' and 'gradlew eclipse' to create a working eclipse project. But you might be right, that I also need badpackets, since I can't find it in the Referenced Libraries. Well i was not sure, what causes the error and this forum is the best place to get any advice. So thanks for the hint anyway -
I'm in the process of updating my mod to newer minecraft versions. Part of the mod is interacting with the mod wthit (the newest fork of waila), so of cause I added the mod api as compileOnly dependency while the actual mod itself is a runtimeOnly dependency. (You can see the dependency part of my build.gradle file here and the properties file here). This set up did work fine up to minecraft version 1.17.1, but since the 1.18.2 and 1.19.3 version I run into exception when running the mod with eclipse. Exception in thread "main" java.lang.module.ResolutionException: Modules wthit and wthit_api export package mcp.mobius.waila.api.__internal__ to module minecraft at java.base/java.lang.module.Resolver.resolveFail(Resolver.java:901) at java.base/java.lang.module.Resolver.failTwoSuppliers(Resolver.java:815) at java.base/java.lang.module.Resolver.checkExportSuppliers(Resolver.java:736) at java.base/java.lang.module.Resolver.finish(Resolver.java:380) at java.base/java.lang.module.Configuration.<init>(Configuration.java:140) at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:494) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.ModuleLayerHandler.buildLayer(ModuleLayerHandler.java:75) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.TransformationServicesHandler.buildTransformingClassLoader(TransformationServicesHandler.java:60) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:104) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:77) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) I can build the mod jar just fine and test it by running it directly with forge launcher (aka adding it to custom modpack), but debugging like this is annoying af. So is my gradle set up incorrectly or is the wthit dependency faulty? Anyhow what can I do to fix it?
-
Nevermind. Someone on discord helped me out. The Solution is to use a DerefferdRegister, that uses the minecraft namespace public static final DeferredRegister<Enchantment> VANILLA_ENCHANTMENTS = DeferredRegister.create(ForgeRegistries.ENCHANTMENTS, "minecraft"); public static final RegistryObject<Enchantment> FIRE_PROTECTION = VANILLA_ENCHANTMENTS.register("fire_protection", () -> new ElementalResistanceEnchantment(ElementalResistanceEnchantment.Type.FIRE)); public static final RegistryObject<Enchantment> PROJECTILE_PROTECTION = VANILLA_ENCHANTMENTS.register("projectile_protection", () -> new StyleResistanceEnchantment(StyleResistanceEnchantment.Type.PROJECTILE)); public static final RegistryObject<Enchantment> BLAST_PROTECTION = VANILLA_ENCHANTMENTS.register("blast_protection", () -> new StyleResistanceEnchantment(StyleResistanceEnchantment.Type.EXPLOSION));
-
Hello. I'm currently updating my mod to 1.19 and have trouble with overriding vanilla enchantments by registering my own enchantment with the same ResourceLocation as the vanilla one. Previously I was using @SubscribeEvent public static void registerEnchantments(Register<Enchantment> event) { // overwriting of vanilla enchantments ElementalCombat.LOGGER.info("Expected overrides"); event.getRegistry() .register( new ElementalResistanceEnchantment(ElementalResistanceEnchantment.Type.FIRE).setRegistryName(Enchantments.FIRE_PROTECTION.getRegistryName())); event.getRegistry() .register(new StyleResistanceEnchantment(StyleResistanceEnchantment.Type.PROJECTILE) .setRegistryName(Enchantments.PROJECTILE_PROTECTION.getRegistryName())); event.getRegistry() .register( new StyleResistanceEnchantment(StyleResistanceEnchantment.Type.EXPLOSION).setRegistryName(Enchantments.BLAST_PROTECTION.getRegistryName())); } but apparently this event was removed. I found the a general RegisterEvent class, but I'm not sure how to properly use it. Also the method Enchantment#getRegistryName from the vanilla class seems to be removed, so I won't get the correct ResourceLocation from it anymore... Can someone help me please?
-
Ahhh. I understand now what you mean. This clears my confusion.
-
Thanks. I will look into it. Do all particle with BasicParticleType have this brown tint? This is kinda unexpected...
-
Registriation: https://github.com/Tavi007/ElementalCombat/blob/master/src/main/java/Tavi007/ElementalCombat/init/ParticleList.java I use the BasicParticleType from vanilla Minecraft.
-
Hello. I added my own particle to the game, but it got a brown tint (see pictures). The particle in question is a simple BasicParticleType, which gets spawned via ParticleManager particles = Minecraft.getInstance().particles; particles.addParticle(particle, entity.getPosX(), entity.getPosY() + entity.getEyeHeight(), entity.getPosZ(), vx, vy, vz); (this is all definitely happening on the client side). So far everything looks hopefully correct, but why does my particle end up with this brown color even though the actual texture is gray only?
-
[1.16.5] How to get Biome from BlockPos on client?
Tavi007 replied to Tavi007's topic in Modder Support
Alright. Thank you. I should be able to figure stuff out myself now -
[1.16.5] How to get Biome from BlockPos on client?
Tavi007 replied to Tavi007's topic in Modder Support
Is the quoted line able to run both on server and client? And can I simply copy it or are there better methods available? I am able to change BasePropertiesAPI#getDefenseLayer(biome) and it would be great, if I can adjust this api method without it breaking on either side. -
Hey all. Question in the title. I have a special armor item, that has defense properties, which depend on the current biome. I overrode the onArmorTick method like this: @Override public void onArmorTick(ItemStack stack, World world, PlayerEntity player) { if(world.getDayTime() % 20 == 0) { Biome biome = world.getBiome(player.getPosition()); DefenseLayer layer = BasePropertiesAPI.getDefenseLayer(biome); DefenseDataAPI.putLayer(stack, layer, ElementalCombatWeaponry.ARMOR_RESOURCE_LOCATION); if(world.isRemote) { ElementalCombatWeaponry.LOGGER.info("Biome: " + biome.getRegistryName()); } } } This code produces the indented behavior, if run in single player. But when I am running the same code in a multiplayer setting I run into trouble on the client side. On server everything runs as expected, but on the client side the biome has the registryName = null (I know this because of the logging). The BasePropertiesAPI#getDefenseLayer checks a Map<ResourceLocation, DefenseLayer> with the registryName of the biome. Since the registryName is null, only a default value is returned. This means, I also have desyncronzied data... (at the end the method from DefenseDataAPI will update my itemstack capability.) Gameplaywise everything is fine (the defense properties are used for calculation on the server side anyway). But the properties should be the same on client for display purpose. I tried to look at the DebugOverlayGUI class, because this obviously works and can show the registryName of the current biome. The important line of this class is the following: list.add("Biome: " + this.mc.world.func_241828_r().getRegistry(Registry.BIOME_KEY).getKey(this.mc.world.getBiome(blockpos))); Could anyone please explain, what 'this.mc.world.func_241828_r().getRegistry(Registry.BIOME_KEY).getKey()' does and why the simple world.getBiome(blockpos) doesn't suffice? Thank you and with best regards Tavi
-
Hey all, A little bit of context first: I'm trying to implement the Materia system from Final Fantasy 7. Basically the player can equip and combine items, that can result in some effect. I already have the effects in place (Each effect is a class which implements certain interfaces, that I defined previously), but now I would like to have some sort of 'crafting' system for the effects. I need a mapping, that maps up to 4 items to an effect. Short example to clear things up: I have the FireMateria and the AreaMateria. Equipping the FireMateria on a pick will result in an autosmelt, while the AreaMateria will increase the amount of mined blocks (like TC hammer). Combining these 2 materias will result in a hammer-like mining with autosmelt. For each of these effect I have seperate classes (FireEffect, AreaEffect, FireAreaEffect) These are necessary, because some effects will be more abstract then just an autosmelt Should I write my own recipe type or can those only map items to a resulting item? If a recipe type is not the answer, what could I do instead? Some kind of HashMap<customKey, Effect>? I just need some general direction and maybe some example code (for a custom recipe type) that I could analyze
-
I've posted my question already, but I still don't know what to do. I have a mod finished (lets call it mod A), which I want to distribute via mavenCentral so other devs can use its API. Before I upload the jar I would like to test it locally with another mod (mod B). Thats why I have this in the build.gradle file of mod B: dependencies { minecraft "net.minecraftforge:forge:${version_forge}" implementation fg.deobf(files('C:/Minecraft Modding/ElementalCombat/build/libs/elementalcombat-forge-1.16.5-1.1.1.jar')) } This will import the jar into the project succesfully. However when I try to run mod B mod A will run into a FieldNotFound exception in its init phase. The field from the exception has an obfuscated name, which it didn't had before building the jar. So my best guess is, that something went wrong when (de-)obfuscating the jar. But I don't know how I can fix this. My repositories can be found here: https://github.com/Tavi007/ElementalCombat (aka mod A) https://github.com/Tavi007/ElementalCombat-Weaponry (aka mod B) The line, that causes the exception: https://github.com/Tavi007/ElementalCombat/blob/b562cba34d2bee7a647aa4d088372c917d67a3d4/src/main/java/Tavi007/ElementalCombat/init/EnchantmentList.java#L39 I really hope, someone can help me. This is the last issue, that I need to fix, before I can release my mod
-
You are completly right. Swapping Block to GlazedTerracottaBlock fixed the problem (No need to create a new Block type, since the block should behave excatly like the terracotta block anyway). Thank you!
-
bump I sill need help
-
You are right. I forgot to revert it back (I was testing, if minecraft:block/stone was working, which it was not. I had the same problem: itemstack is looking fine (display a stone block), but the actual block was missing its texture). I changed the namespace to elementalcombat_weaponry, which should be the correct one. Sadly the issue with the texture persist.