Jump to content

DoctorLOGiQ

Members
  • Posts

    34
  • Joined

Everything posted by DoctorLOGiQ

  1. Alright, I was able to attach a TileEntityRenderer to my block, however if I override render() and leave the function empty, it seems to still be rendering the block as default. I checked with logging and it is being called. Why could this be? I'm not calling the super.
  2. Hey modders! I'm looking to find out if it's possible for me to toggle individual parts of a .obj block model via the java code. The block in question will be a TileEntity because it needs to function, so I'm assuming a TESR may be in order? I've been away from the modding scene for a while, and as a result have forgotten how these are set up. Besides, the code has changed significantly since last time and I don't want to assume it's the same, and the documentation is untrustworthy and out-of-date. Not only that, but I don't know if a TESR is the way to go. TLDR: The .obj model comprises of multiple objects, some of which I want to control the visibility of (just a simple toggle on/off) from Java. What would be the best approach to doing this? As an added bonus, is there a way I can control cullable faces? When using "detectCullableFaces": true and placing multiple of my block next to one another, touching faces are culled in a way that doesn't look right, and it's not a backface problem in the model because I always check those. The model isn't super high poly-count so I could get away with disabling cullable faces which leaves the model looking correct, but I would like the block to be optimised if I can. Thanks in advance for any help.
  3. This should fix that problem, the method is marked as deprecated yet the game uses it. *sigh* Mojang... @Override public boolean isSolid(BlockState p_200124_1_) { return false; }
  4. Your logger should be a reference to LogManager.getLogger(); (org.apache.logging.log4j.LogManager)
  5. Try making the event subscriber function static. Also make sure you have registered your event handling class with FML's EVENT_BUS, which you can do with MinecraftForge.EVENT_BUS.register(new YourEventClass()); in your mod's pre-initialization or initialization phase.
  6. Hello, what is the value of ForgeOfIndustries.logger ? And which version of Forge are you working with?
  7. Thank you, I will take a look. It does seem like an incredible amount of classes/work just to send packets to/from a server, but I will *try* to make sense of what's going on there. Thanks for your help!
  8. Yes, that error happens all the time, it is not very likely to be anything on your end, so don't worry about it. I get it too, even with a fresh mod setup. Presumably the world loading just causes a bit of a hang and client requests get buffered up and then come through all at once when the hang ends.
  9. Yes, I guess you've already implemented that then. Looking at some of my old working code, onBlockActivated () did not cause any problems, and we've done things the same way by the looks of it. Are you using GuiContainer for your Gui class? If so then I don't see a reason why it wouldn't work, unless it's not finding the TileEntity - might be worth doing some logging just to make sure it's not null anywhere it shouldn't be.
  10. Try looking into IGuiHandler, I believe you need to register one of those which will return a container on the server side (!world.isRemote) and a GUI on the client side (world.isRemote). Also the "certain amount of requests" error seems to always get posted for me when I load a world up, I've learnt to ignore them.
  11. Ok, I have seemingly got the capability working. Now the problem is, I don't think it's properly synced between the client and server sides, or otherwise something *very strange* is going on. In my Item's addInformation() method, I have a single line; tooltip.add(new TextComponentString(ChatFormatting.DARK_GRAY + "State: " + instance.getStateStringFormatted() + " (" + instance.getState().toString() + ")")); which is meant to print the "state" of the item (just one of my enums). Inside the implementation, getStateStringFormatted() returns: switch (this.state) { default: case Off: return ChatFormatting.RED + "Off"; case Booting: return ChatFormatting.AQUA + "Booting"; case Booted: return ChatFormatting.GREEN + "Booted"; } and getState() returns this.state . So therefore, you would expect, that both these calls should print the same value, but guess what! They don't. Does some kind of synchronisation need to happen?
  12. How would this work with, say, an Item's addInformation() method? I would like to be able to display information retrieved from calling a getter method within the interface, would that be possible, or should I try a different approach? This information should be specific to an ItemStack, and the stacks are limited to a max size of 1. Edit: My sincere apologies, this is me being dumb now. Of course a lambda expression would still be inside the function. For some reason I was thinking of it as a separate thing, heck knows why ? I will adapt and test my code and provided it doesn't continue crashing the issue should be resolved. However, there was a new error occurring a while ago to do with saving NBT data, but I think I know a possible cause of that.
  13. Alright, I didn't realise the code had been changed. Which method in LazyOptional is the best to use to return the interface instance? Yes, the TestMod is an excellent resource and I thank you for that @Choonster.
  14. As per https://github.com/Choonster-Minecraft-Mods/TestMod3/blob/d045f88657816da463adfc631ee2ff1c96599798/src/main/java/choonster/testmod3/capability/pigspawner/CapabilityPigSpawner.java#L111, I have created a LazyOptional function, to return (supposedly) the capability from the ItemStack. The problem is, I can't actually USE the ruddy thing. *Apparently* you can cast to the capability interface as seen here: https://github.com/Choonster-Minecraft-Mods/TestMod3/blob/d045f88657816da463adfc631ee2ff1c96599798/src/main/java/choonster/testmod3/item/ItemPigSpawner.java#L42) (also side-note, typo in the documentation for this function - "...if amy"). But can I actually cast to the capability interface in reality? Not so much... net.minecraftforge.common.util.LazyOptional cannot be cast to ((capability interface)) is being thrown from Item#addInformation() where I have tried to access the capability, as is done in the TestMod, to no avail. How do I cast this to something usable? I have done capabilities in 1.12.(I wanna say... 2), but this system is so weird and changes so often it's hard to keep up. I'm not posting any code because it's unnecessary, I can guarantee I've spent the past 3-4 hours ensuring I've done everything I need to (and no more) pretty much as it was done before, but using the new changes, and referencing the TestMod for ALL OF IT. In other words, the code is *exactly the same* (except for the names, and the actual capability itself, of course. I ain't spawnin' no piglets!). And yes... the capability is being registered.
  15. Alright, thank you. If you have any code you don't mind sharing that would be a huge help; if not I will try look into it myself. But digging through Minecraft's code isn't... the best
  16. lehjr, I would like to know how you've achieved this. I know OBJ models worked in 1.12, but I also know 1.13 was a pretty large rewrite. Trying to load OBJ models I'm getting errors telling me it cannot load a .obj.json file, so it *almost* knows what file to load, but it's getting the extension wrong.
  17. And... you asked me why I'm not using the command.. now you're asking why I'm not using it. Make your mind up! I should've known asking for help on here would result in this whole "Why are you doing this your way? You must do it my way. Your way is wrong, my way is right." line of questioning... happens every time. The project is set up and working (mostly), and with ALL of the project setups in the past, the steps I have taken have worked just fine. I am no longer going to monitor this thread.
  18. Because there is no 'gradlew idea' command in 1.13.2 as far as I can see, certainly not when using the tasks command to list available tasks, as per the prompt. As for my way of doing things, it's how I've always done it, and works just fine in most cases. Either way, it is now somewhat working, and that's good enough for me.
  19. Mkay so... you're going to hate me, but trust me, none of this is my fault. After rinse-and-repeat clearing all files, re-extracting the mdk zip, doing the gradle command, importing the project and testing... a programmer's worst nightmare occurred: it just started working. I did not change anything, I don't know why it now works and why it didn't before, but... well, it's working now. The Forge examplemod included in the ZIP has an incorrect version number, causing it to error during initialization, but that was an easy enough fix. This would not have changed anything, the tasks were generated first time each time, that wasn't part of the problem. The exact process I followed over and over and over (and over!) again is: Extract MDK ZIP Rename the folder (non important) Open Cmder, 'cd' to the folder Run 'gradlew eclipse' Wait Wait some more, until the task completes Close Cmder, open IDEA Open project, browse to and select the folder When prompted, 'import gradle project' Wait for indexing and project sync to complete Run Gradle task 'genIntellijRuns' Rename tasks because "runClient" and "runServer" are not very eyecandy-friendly (non important) Select the module under 'use classpath of module' for both server and client run tasks Alter mods.toml file to support version 1.13.2 instead of 1.13 Run This task has been the same each time. "Magical fix is magical" *DING!* I'm sorry I can't say what happened here, if only I knew. But there you go, I suppose something was missing and now isn't. I am still getting floods of errors about sound files being missing, however. Mods: I don't know if this should be classed as resolved, on the one hand my development environment is (minimally) working, but on the other hand I do not know how or why the issue fixed itself.
  20. This is still unresolved. It is also worth noting that my mod development environment works for previous versions of Minecraft Forge, so whatever this issue is, it's 1.13-related. This is now holding me back completely.
  21. Yes, from my experience working with .OBJ models in Forge, the texture has to be a square texture, or rectangular (with a height which is a multiple of the width) with a .png.mcmeta file for animated textures. You also seem to have to flip the texture vertically in the blockstate JSON file using: "custom": { "flip-v": true } , which I usually place under the "model": definition. If you don't do this, you may find that your texture is upside-down. Edit: This is true when exporting a .OBJ file from Blender, I cannot confirm if this is the case when exporting your model from another application.
  22. You only need to run "gradlew eclipse" now. setupDecompWorkspace seems to have been deprecated.
  23. The com.example.examplemod package? That's there for your convenience, so you can get an idea of how to get started. When you decide you don't need it any more you can safely delete it, or if you're using IntelliJ IDEA, right click the package, browse to "Mark Directory As > Excluded". Of course make sure to go through the resources files and change "examplemod" to your mod ID.
  24. Oh, you have to re-import the project? I'm using IntelliJ IDEA. What do you mean by "running user dev"? I've done things the same way I usually do, except without the need for the deprecated setupDecompWorkspace command, of course. When asked to import the Gradle project I told it to use auto-import, since I don't need it asking me for permission each time, and told it not to create separate modules per source set, since that breaks things. The project set up correctly, and it seems the example code (which I have not modified yet, in any way) compiles, it just does not let the game run.
×
×
  • Create New...

Important Information

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