warjort
Members-
Posts
5420 -
Joined
-
Last visited
-
Days Won
175
Everything posted by warjort
-
I am no expert on the SoundManager, but I don't believe the sound manager has any general support to monitor for when something stops playing. But, if you are just interested in music disks. You might be able to listen for GameEvent.JUKEBOX_STOP_PLAYING using this? https://github.com/MinecraftForge/MinecraftForge/blob/1.19.x/src/main/java/net/minecraftforge/event/VanillaGameEvent.java That and the start playing event, is what the Allays use to know when they should dance.
-
The getObject() associated the Entity might be an ItemEntity, it will never be an ItemStack.
-
LinkageError when trying to add capability to ItemStack
warjort replied to Silvertide's topic in Modder Support
The error appears to be at this line of code: https://github.com/MinecraftForge/EventBus/blob/84663719be842aedaddabf9cd8d46a2450959c9d/src/main/java/net/minecraftforge/eventbus/EventBus.java#L329 Where it is trying to use a lambda expression to create a log4j MessageSupplier and for some reason this is causing the linkage error? The actual error is not very informative about why there is a linkage error. I don't see any mention of log4j in your build so it doesn't look like you are downloading a conflicting version? Or any other dependency that might transitively do that. If you run the gradle build with --debug in amongst all the other rubbish, you should be able to see the command line used to start minecraft. This should say where it is getting log4j from and whether there might be more than one on the classpath or something. I assume you are actually using the gradle build and not some IDE launch configuration? Obviously, your attach capabilities is throwing an error for it to reach that error handler. But then it crashes trying to report the error. I tried deliberately, throwing an exception from a similar event handler and I don't see any problem with reporting the error. Beyond that, you are going to need to put your project on github to see if we can reproduce the problem using it. -
That's not the 1.19.4 version of wthit: https://www.curseforge.com/minecraft/mc-mods/wthit-forge/files
-
LinkageError when trying to add capability to ItemStack
warjort replied to Silvertide's topic in Modder Support
The class that gives the error: org.apache.logging.log4j.util.MessageSupplier e.g. compile over version 1 public class ClassFromLibrary implements A {} public class MyClass extends ClassFromLibrary {} runtime is over version 2 public class ClassFromLibrary implements B {} // ClassFromLibrary no longer implements A which breaks MyClass As I said above, it could also be a classloading issue where runtime is still over A but from different classloaders. public class ClassFromLibrary { public void consume(A a) {} // A from classloader1 } public class MyClass implements A {} // A from classloader2 new ClassFromLibrary().consume(new MyClass()); // Error not the same A Linkage errors are usually a bit more subtle than the examples above. But, since you don't show the full error, debug.log, your build file or any other way for me to see what is really going on, I can only give you a general explanation of the error under the assumption that it is enough for you to debug the problem for yourself. As I have said many times in this forum. If you want help, you need to provide all the information. Not code snippets out of context or truncated error messages. Otherwise unless the problem is immediately obvious, you will likely just get ignored. Something I almost did with your original question since it is a java question not a forge question anyway. -
-
It isn't necessarily create related. All I can tell you is something has broken recipe (de)serialization logic, that is messing up the transfer of recipes from the server to the client. Without an error identifying the mod, the only way you will find it is to experiment with removing mods until the problem goes away. Backup your world(s) before removing mods.
-
I know nothing about multipart entities, but your ParentEntityCopy.hurt() does nothing. Your part entity is just a basic entity that has no health attribute. Compare your code with DragonEntityPart.hurt() that forwards the damage to the parent which does have a health attribute.
-
One of your mods has broken networking. Neither the error you posted or the log says which one. Since you are adding mods, it is likely one of the mods you just added. You can try adding to the "additional arguments" in curseforge's minecraft settings. This will print the full error to the debug.log which might have more information? But usually errors at the protocol level like the one you have, don't show which mod is causing the problem.
-
LinkageError when trying to add capability to ItemStack
warjort replied to Silvertide's topic in Modder Support
https://javadoc.scijava.org/Java6/java/lang/LinkageError.html The usual cause is you compiled over a different version and the api changed. But, you can also get this error when the same jar/version is loaded by different classloaders. This leads to 2 different classes even if they are the same bytecode. -
[1.19.4] How to properly add a custom trimming material?
warjort replied to JimiIT92's topic in Modder Support
Looks like it is using the purple/black missingno texture (i.e. not found). I bet you have a warning in the log? I guess you need to configure the atlases to load your textures. https://github.com/misode/mcmeta/blob/assets/assets/minecraft/atlases/armor_trims.json https://github.com/misode/mcmeta/blob/assets/assets/minecraft/atlases/blocks.json I would recommend reading the release notes: https://www.minecraft.net/da-dk/article/minecraft-java-edition-1-19-4 to see how Mojang intend this to work. At least until they change it again for 1.20 🙂 -
[1.19.4] How to properly add a custom trimming material?
warjort replied to JimiIT92's topic in Modder Support
I know virually nothing about trim materials. But I do know; * They are 1.20 feature (experimental in 1.19.4) * Trim materials are in the datapack not the resource pack so they should be in data/ not assets/ https://github.com/misode/mcmeta/tree/data/data/minecraft/trim_material Also, if you just post snippets of code and error messages out of context like the above, you will likely just get ignored unless the error is immediately obvious. Post full logs and code on github so we can see everything in context. -
Here you register your items. https://github.com/elytraByte/Boulanger/blob/15054c1a152cc780467459ab57860602090684a2/src/main/java/org/l3e/Boulanger/Boulanger.java#L35 Where do you do the same thing for your blocks?
-
Correct there are no recipes for the anvil. The logic is hardwired, see AnvilMenu.createResult() Forge does not have one. I guess you could try to implement this yourself? You would need a RecipeSerializer that lets you parse and load recipes for the Anvil using a new RecipeType. You would then check these recipes in the AnvilUpdateEvent using RecipeManager.getRecipeFor(). To get the recipe manager: player.level -> ServerLevel -> Server -> RecipeManager The devil is always in the detail. There is probably a reason why Mojang or Forge haven't already done this? 🙂
-
There is no error in that log, post a link to your launcher_log.txt (directly after the crash). But given the last line in the log is: This is likely a hard crash in your graphics driver. Check you have the latest version.
-
Looks like something is breaking a mob ai by incorrectly modifying it in the wrong place. The likely candidate mods are the underlined ones above. Check you have the latest versions then contact the mod authors. If it is not these mods then probably the only way you are going to find the problem mod is to experiment with removing mods until the problem goes away. Backup your world(s) before removing mods.
-
You use EntityRenderers/Layers. Registration: https://github.com/MinecraftForge/MinecraftForge/blob/1.19.x/src/main/java/net/minecraftforge/client/event/EntityRenderersEvent.java#L52 For examples, look at vanilla code or other mods. Most use entity models rather than direct rendering. Things like Wurst (hacks) are not supported in this forum.
-
Add NBT data to an item just picked up in the ItemPickupEvent
warjort replied to Silvertide's topic in Modder Support
The event.getStack() is just a copy of the items that were picked up so you can see how many were picked up (e.g. if the player didn't have room to pickup the whole stack). The real items will already be in the player's inventory at this point and might have been merged into another ItemStack of the same items. See ItemEntity.playerTouch() for the full logic. -
When you draw things in minecraft you do it in "world co-ordinates" not screen co-ordinates. Minecraft will later translate the finish image into screen co-ordinates. In a lot of cases you use "relative world co-ordinates" i.e. minecraft calls your rendering code with the PoseStack already translated to the block/entity co-ordinates. So you can just draw as though the block or entity was at 0, 0, 0 There are some specialist cases where you need to draw relative to the camera position (drawing custom block outlines is one IIRC?). But these are the exceptions. In those cases forge passes you the data you need: https://github.com/MinecraftForge/MinecraftForge/blob/b5655b0ddc93ee0c02c9ad1b3a9a4dbd9bd3c572/src/main/java/net/minecraftforge/client/event/RenderHighlightEvent.java#L60