Jump to content

Jontom Xire

Members
  • Posts

    46
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Jontom Xire's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. net.minecraftforge.network.NetworkEvent seems to have disappeared between 1.20.1 and 1.20.2. Maybe we need another primer?
  2. Someone please help. I have generated fixes for all the bugs building javadocs for 1.20.x in the MinecraftForge GitHub repository, but it only includes net.minecraftforge.fml.common and net.minecraftforge.fml.javafmlmod. I need to update my mod from 1.19.3 to 1.20.x and I am getting errors like: error: cannot find symbol import net.minecraft.world.level.material.Material; ^ symbol: class Material location: package net.minecraft.world.level.material To start to fix this I need to be able to search the Minecraft documentation. Only there isn't any!
  3. I was using a javadoc published on the internet, but it only goes up to 19.3. I want to migrate my mode to 1.20.1, specifically forge-1.20.1-47.1.46. I cloned https://github.com/MinecraftForge/MinecraftForge.git. I looked around to try and find the exact commit. There is a 1.20.1 branch, but it apparently has tags for 47.1 and 47.2 on it. Isn't version 47.2 for Minecraft 1.20.2? I have tried to generate javadocs with HEAD of the 1.20.x branch (lots of javadoc errors), the 47.1 tagged commit on the 1.20.1 branch, and the head of the 1.20.1 branch. Nothing works. I cannot find any information on how to generate javadocs that is up to date. The commands I have tried are: ./gradlew setup ./gradlew javadocs Please can someone tell me how to generate javadocs. Please can someone document it in a README or something. If I am doing the right steps then please can someone help me work out why it doesn't work for me. I am really confused. Lots of people make mods all the time and they MUST be using javadocs for it, but how do they no how to generate the javadocs when there are no obvious instructions on how, and generating javadocs from the Forge repo seems to always fail. I found a post on this forum from December 2022 that complained of exactly the same thing. I have also raised a bug for the 1.20.x branch since it is clearly errors in the source code that is causing the javadoc generation failure.
  4. You are right, it was the community wiki: https://forge.gemwire.uk/wiki/Model_JSONs examplemod:blocks/test → assets/examplemod/textures/blocks/test.png ... minecraft:block/cube_all, not minecraft:block/cube_all.json And this is a doozy at https://forge.gemwire.uk/wiki/Item_Properties: { "parent": "item/generated", "textures": { "__comment": "Default", "layer0": "examplemod:items/example_partial" }, "overrides": [ { "__comment": "power >= .75", "predicate": { "examplemod:power": 0.75 }, "model": "examplemod:item/example_powered" } ] } The "layer0" definition uses "items" and the "model" in the overrides uses "item". I think there were more using the plural, but it was a while ago and I don't have time to search them all out right now.
  5. I'm not talking about the forge documentation, which has a link to a fairly thorough page on the Minecraft wiki about the model JSON files, but that page in turn is inconsistent in the examples. Specifically, sometimes it uses "block" and sometimes it uses "blocks".
  6. I have added a few more files and modified the JSON one I had. I now have: assets/stats_and_skills/blockstates/bone_altar.json: { "variants": { "": { "model": "stats_and_skills:block/bone_altar" } } } assets/stats_and_skills/models/item/bone_altar.json: { "parent": "item/generated", "textures": { "layer0": "stats_and_skills:block/bone_altar" } } assets/stats_and_skills/models/block/bone_altar.json: { "parent": "block/cube", "textures": { "": "stats_and_skills:block/bone_altar", "inventory": "stats_and_skills:block/bone_altar", "all": "stats_and_skills:block/bone_altar" }, "elements": [ { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "down": { "texture": "#all", "cullface": "down" }, "up": { "texture": "#all", "cullface": "up" }, "north": { "texture": "#all", "cullface": "north" }, "south": { "texture": "#all", "cullface": "south" }, "west": { "texture": "#all", "cullface": "west" }, "east": { "texture": "#all", "cullface": "east" } } } ] } I also renamed the directory from "blocks" to "block" for the textures. The documentation that is available is very inconsistent here. It all seems to work now.
  7. I thought I posted this last night, but it was late and I was tired, so it may be in the wrong forum, or maybe I just didn't click the post button. If there is a duplicate, my apologies. In my main class I have this, as per the example code: public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MODID); public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID); public static final RegistryObject<Block> BONE_ALTAR = BLOCKS.register("bone_altar", () -> new Block(BlockBehaviour.Properties.copy(Material.STONE).requiresCorrectToolForDrops())); public static final RegistryObject<Item> BONE_ALTAR_ITEM = ITEMS.register("bone_altar", () -> new BlockItem(BONE_ALTAR.get(), new Item.Properties())); I figured out how to add it to a creative mode tab, and placed one, and the texture is just a magenta and black check. The texture I want to use is at src/main/resources/assets/stats_and_skills/textures/blocks/bone_altar.png. The model file is at src/main/resources/assets/stats_and_skills/models/blocks/bone_altar.json and looks like: { "parent": "block/cube", "textures": { "particle": "block/bone_altar", "all": "block/bone_altar" }, "elements": [ { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "down": { "texture": "#all", "cullface": "down" }, "up": { "texture": "#all", "cullface": "up" }, "north": { "texture": "#all", "cullface": "north" }, "south": { "texture": "#all", "cullface": "south" }, "west": { "texture": "#all", "cullface": "west" }, "east": { "texture": "#all", "cullface": "east" } } } ] } I am guessing that a file is in the wrong location, or the model file is using the wrong path to the texture. Or something. I have no idea, and the documentation really needs a bit more in the way of examples.
  8. The Advanced XRay Mod has up to date code that really helped me out. Many thanks to the authors whose code provided inspiration. And I only copy and pasted the code to feed the vertices into the vertex buffer. Please don't sue me.
  9. I will second Ash's post since that is EXACTLY the problem I had yesterday when trying to run a dedicated server for the first time. You will need to download the JDK since the JRE is only available for Java 8. Apparently Sun/Oracle/whoever think you will only ever need Java 8 for everything.
  10. I changed "DistExecutor.unsafeRunWhenOn" to "DistExecutor.safeRunWhenOn". No change. However, I also at the same time made "DistExecutor.safeRunWhenOn" call an empty function in another class. Completely empty. However I did not remove/comment out my original safe_handler() function which is no longer being called AT ALL from ANYWHERE! Still got a crash. Code that is simply not being called at all. I renamed the function to NOT_CALLED() to be really really sure it isn't being called at all somehow. Still crashed. Commented out the body of the NOT_CALLED() function and it works just fine. Looks like @OnlyIn is my only option, as long as I can find the import...
  11. And to answer my own question...the documentation, if you read the "Common mistakes" section REALLY closely, holds all the answers, including a hint about race conditions when using static members in a normal client installation. The bit I really needed to read was about: ...@OnlyIn(Dist) annotation.... Now all I need to do is figure out which import that is in. HOWEVER: The documentation also says: There is NO reason for using this annotation directly. Use DistExecutor or a check on FMLEnvironment#dist instead. I am. It doesn't work! Yes my supplied method is in the same class, but I tried putting it in a different class and it didn't work either.
  12. I've tracked down this specific issue to this code, and now I am confused because I am sure I am handling this as per the documentation: public static void handler(SyncMsg msg, Supplier<NetworkEvent.Context> ctx) { ctx.get().enqueueWork(() -> DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> safe_handler(msg))); ctx.get().setPacketHandled(true); } public static void safe_handler(SyncMsg msg) { Player player = (Player)(Minecraft.getInstance().player); PlayerData data = PlayerData.get(player); ... The crash occurs when loading the mod, long before any of this code is executed. Minecraft.getInstance() is a static function, but surely this won't get executed until a message is received by the client.
  13. I have finally got around to setting up a dedicated Minecraft server and my mod crashes. The first crash was easy. It complained about trying to instantiate a Screen. A quick search of my code showed that my client event handler class was "static final" initialising my screen. I changed it to dynamic initialisation, moved client tick event registration into the FMLClientSetupEvent handler and all was well...or so I hoped. I now get this error: [17:03:22] [main/ERROR] [minecraft/Main]: Failed to start the minecraft server net.minecraftforge.fml.LoadingFailedException: Loading errors encountered: [ Stats and Skills (stats_and_skills) has failed to load correctly §7java.lang.RuntimeException: Attempted to load class net/minecraft/client/player/LocalPlayer for invalid dist DEDICATED_SERVER So, I did a search of my code for LocalPlayer...and found nothing. I am not importing that class, not instantiating it, not (apparently) referencing it, anywhere. I am not asking you to solve this problem. There will, I am sure, be others after this. I am asking for tips on how to find the root cause of such problems and would also appreciate tips on avoiding them in the first place.
  14. Awesome tips, thanks. I figured that the camera would be positioned where the player's eyes were I am currently using the LevelRenderer that comes with the event. Should I be using the GameRenderer instead, or are they in fact the same thing.
  15. Like this? centre = centre - player.getEyePosition(); Do I not also need to apply camera view angle rotation or anything? I was hoping that the level renderer would apply all necessary scaling, translation, and rotation.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.