Jump to content

Laike_Endaril

Members
  • Posts

    166
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Laike_Endaril

  1. I noticed that if I run the client from MultiMC and open it to LAN, with all the same versioning of all the same mods / forge / mc, it works just fine. And then, just for kicks, I tried deleting the build folder of my mod project. Now it's working from my IDE as well. It sounds like you're not running from an IDE though, so this probably won't help you. Edit: And now it's not working again. I'm not sure if deleting my build folder made it work on the next run, or if I just got lucky somehow. I hate trying to debug this kind of issue.
  2. I just downloaded the source from your repo, but it's missing some critical components (which are part of the standard forge MDK setup), such as... ...all gradle-related files (root folder) ...all git-related files (root folder) ...the mcmod.info file (resources folder) There should have been a .gitignore file included in the forge MDK which correctly handles your repo file filter, and should have included all these things in your repo
  3. I've also been getting this issue lately, and I *only* have 64-bit java 8 installed (jre 191 + jdk 191). Started running into this when running single player from my mod dev environment, then opening to LAN and attempting to connect from MultiMC to test some multiplayer features. This is a process I do quite commonly and normally don't have issues with. I remember getting this error before, and I'm pretty sure I had found some way to prevent it, but now I can't remember how...I'll post here if I figure anything out.
  4. It looks like you're not setting a new registry name for the blocks before remapping them, so they map to their old mappings...if I'm reading it correctly. If I'm right, then changing this... miss.remap(block); ...to this... miss.remap(block.setRegistryName(~~~enter correct registry name here, using new modid and block name~~~)); Should solve the immediate issue. Make sure to do the same for items if that works for the blocks ofc
  5. Looking at the code for PositionedSoundRecord, I only see one spot where a NPE could even occur: private PositionedSoundRecord(SoundEvent soundIn, SoundCategory categoryIn, float volumeIn, float pitchIn, boolean repeatIn, int repeatDelayIn, ISound.AttenuationType attenuationTypeIn, float xIn, float yIn, float zIn) { this(soundIn.getSoundName(), categoryIn, volumeIn, pitchIn, repeatIn, repeatDelayIn, attenuationTypeIn, xIn, yIn, zIn); } ...at... soundIn.getSoundName() ...meaning soundIn is probably null. It looks like this constructor is being called by the one directly above it, which is called by one of the playSound() methods in the WorldClient class...etc... All in all, I'd say that the registration for your sound somehow doesn't match on the client vs the server in that situation. The packet uses an integer id to look for the sound in the sound registry, like so: this.sound = SoundEvent.REGISTRY.getObjectById(buf.readVarInt()); You should probably post the code or a link to it, particularly everything to do with how you register the sounds
  6. If you can link to a repo or post the full code of your class it will be easier to debug. Also, if you're getting an error with a stacktrace, post that as well.
  7. I have potion recipes working quite well...my code correctly targets any thick potion (normal thick, splash thick, lingering thick) and outputs the correct result; you could even put one of each of these in the slots and get a normal, splash, and lingering of whatever your output is. It also correctly does *not* work with any non-thick potion. Btw, we both seem to have had the same idea, using thick potions as a base Code is here: https://github.com/Laike-Endaril/Dynamic-Stealth/tree/1.12.2/src/main/java/com/fantasticsource/dynamicstealth/common/potions/recipes
  8. Try closing your IDE, opening cmd/terminal, going to the project directory, and running gradlew setupDecompWorkspace eclipse Then reopen your IDE and maybe refresh it, see if that helps
  9. After a couple days messing with it, I've decided to cave in and use a normal String[] config with a token parse...so I'm currently writing code for that approach. Edit: My code is working. I've tried to make it a bit simpler than a normal NBT string so I did my own parsing, which means the code itself is much more complex than it would otherwise be, but hopefully it makes things a bit easier on the user...we'll see. Will only post link to code if someone requests it; it is likely more complex than most would want to look at for what it does
  10. In my case, I'm trying to avoid external files, though that may be viable for Kinniken? I'm not sure. In my particular case, I'm attempting to allow users to enter an item with many properties attached to it without the entry getting complex, so I basically need to split it into multiple inputs. I also want the user to be able to enter any number of items this way, all without having to edit an external file, so for now I'll continue trying to manipulate the config menu itself with the goal of making what basically amounts to a category array.
  11. I've unfortunately been unable to figure this out. I had assumed it would be doable in the @Mod tag of the main mod class, but the only gui related thing in there seems to be guiFactory. I tried messing with the guiFactory argument in the @Mod tag since I had stumbled upon it, and ended up with this so far: @Mod(modid = DynamicStealth.MODID, name = DynamicStealth.NAME, version = DynamicStealth.VERSION, guiFactory = "com.fantasticsource.dynamicstealth.config.DynamicStealthConfigFactory") ...and... package com.fantasticsource.dynamicstealth.config; import com.fantasticsource.dynamicstealth.common.DynamicStealth; import net.minecraftforge.fml.client.DefaultGuiFactory; public class DynamicStealthConfigFactory extends DefaultGuiFactory { public DynamicStealthConfigFactory() { super(DynamicStealth.MODID, DynamicStealth.NAME); } } Which does work...it loads the same config files as usual, and everything works as expected. Next I'll try overriding createConfigGui and having it return an instance of a custom class extending GuiConfig and see where that gets me. Side note: I tried making the above class in a general-use context at first, but even though DefaultGuiFactory uses a 2-argument constructor, it seems if you define your own guiFactory in the @Mod tag, it only searches for a 0-argument constructor. Maybe there is some syntax that can be used in the @Mod reference to make it look for a constructor with arguments, bug I haven't the slightest idea how that would be structured if there is. In any case, this possible solution is going to be far more...adventurous...than I would've hoped, if it ends up working, and certainly goes far beyond a "simple" solution for specifying items with NBT in your config in a reasonable manner. Nonetheless I'll try to get it working in as general a way as possible and if I manage it, will post the code.
  12. I take it back; this is probably due to your own mod attempting to access JEI too soon. JEI's classes have probably not been loaded yet. Edit: You may want to add a required-after tag in your mod tag to make sure your mod loads after JEI Edit2: I'm half asleep. According to the report, JEI is loaded...in any case, try closing IDE, deleting build folder, make sure you don't have JEI source code in your project, and if none of that helps/applies, try posting your repo/code.
  13. Nice, I may end up going with this approach, though it will probably take me some time to hammer out the system
  14. Something is indirectly causing JEI to not find one of its own classes when using one of its own methods. Did you happen to add jei source code inside your project? If so, then that's a bad idea. Otherwise, I'd try deleting the build folder (after closing your IDE) in case it has something strange going on.
  15. Aye, my goal is the same (to allow users to specify items with nbt in a config String array input). Alternatively, if there is a good way to do something similar with submenus (categories), that would be even better for my case, as I could allow them to add an entry, which would be a new config button, which they could then click on...and then inside the dynamically-created config menu it sends them to I would have a field for the base item name/meta, a string array input for multiple nbt tags, etc, etc. I don't think this is really a thing or I'd think I would've seen it by now, but I could be wrong. Back to the NBT, it's difficult to decide how to implement it in order to strike a balance between complexity and flexibility for the end-user. I'm trying to avoid external JSON files because I feel many users would be put-off by them. At the same time though, doing a full JSON-format NBT compound in a one-line string input field can get confusing without using an external text editor to write it out first. I started writing my own syntax for a simplified input that just uses tiered string splitting, but even that got very complicated to put entries into...being able to split the entry into multiple different input fields would be ideal, but I need an unknown number of them, thus the want of a config array input. Is that a thing? Edit: I suppose I could accomplish this by writing my own GUI, but I would want to link access to my GUI to the normal forge mod config menu if I did, and I'm not sure how that would be done either.
  16. I actually just started looking into this as well. I'll keep this open in a tab and go check the vanilla classes first as suggested. Egad, somehow I misread the last post date on this thread; sorry about that.
  17. Yes, that was the issue. The potion is synchronizing to the client now, and all I did was make sure the same Potion instance was used in both registration events. My new, working Potions class (which handles the registrations): I have a couple minor changes to make on it still (such as changing it from a debuff to a buff, so milk doesn't remove it), but it works, and both of my icons are displaying. Edit: Forgot that milk removes buffs as well. W/e.
  18. Ah, thank you. This is most likely my issue. At the time, for whatever reason, I was thinking it would do an equivalency check using the `ResourceLocation`s, which was a bad line of thinking on my part since a `PotionType` can contain multiple `Potion`s. The internals of that method simply return world.isRemote. The only reason I made that method is because I kept mixing up whether "isRemote" is true on client or server, and got tired of going back to look at it every time (though I realize my extra method call makes it a bit less efficient; I don't think the compiler is optimizing it out). I'll try fixing my registries and post the results.
  19. First I would delete the generate() method in ModNetherGen, take everything from inside OreGen and move it into ModNetherGen, then delete OreGen. Next, I'd make sure to call GameRegistry.registerWorldGenerator(new ModNetherGen(), 0); In one of the FML init events, such as the FMLPreInitializationEvent, which should already exist in your main mod class. At this point, the generator itself should actually *run*, but won't do anything yet. You can test it if you want by putting a breakpoint or printline inside your runGenerator method, eg. System.out.println("Generator ran"); Now all that's left is to make it actually generate something. If there is a way to make the system do this in a somewhat automated fashion, I don't know it. I've only done worldgen once so far, and had to literally place each block in my own code. In other words, your runGenerator function is going to look pretty beefy by the time you're done. You'll have to program your own logic which uses the arguments you've passed in to conditionally replace existing blocks in the world. I'm not sure I want to show you what I did, because mine is dealing with tile entities, not normal blocks. That being said, here are some useful bits: To get the current chunk you're generating within: world.getChunkFromChunkCoords(chunkX, chunkZ) To get the chunk that a specified BlockPos lives in: world.getChunkFromBlockCoords(blockPos) To get the IBlockState of a block at a specified BlockPos: world.getBlockState(blockPos) To set the IBlockState of a block at a specified BlockPos: world.setBlockState(blockPos, iBlockState); Those bits of code should be enough for basic oregen, along with the arguments you have. If it were me though, I would also change runGenerator() so that it takes an IBlockState instead of a Predicate<IBlockState>, and then pass in Blocks.NETHERRACK instead of BlockMatcher.forBlock(Blocks.NETHERRACK)
  20. Dedicated server* (close enough). I'm guessing that was autocomplete in action right there XD But yeah, in *most cases*, you would want the LivingHurtEvent, on the server side, though I have no idea what you're actually trying to do, so I can't say for sure.
  21. You can almost certainly use the matrix itself...but beyond that I'm not sure exactly which method(s) you'll need to do so correctly. It might be the multMatrix call, but I can't remember for sure. Whatever you do, make sure you pushMatrix exactly once before you do any matrix alterations, and popMatrix exactly once after you render. In GlStateManager: public static void multMatrix(FloatBuffer matrix) { GL11.glMultMatrix(matrix); } And on the openGL docs page: https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glMultMatrix.xml I don't remember what order the matrix data needs to be in when changing from a matrix4f to a float buffer, but I would hope the provided method for doing so would do so correctly, so if you're really lucky... GlStateManager.pushMatrix(); FloatBuffer buf = FloatBuffer.allocate(16); Matrix4f yourMatrix = ???; yourMatrix.store(buf); GlStateManager.multMatrix(buf); //Render stuff here GlStateManager.popMatrix(); Also keep in mind that there are several Matrix4f classes to choose from when importing. LWJGL has one, minecraft has one...I'm not sure what the differences between them are, but the minecraft one may do something special with the data ordering...I have no idea. I don't even have confidence that this will work, but it's something you can try if you feel like.
  22. You'll need to use the ratio of (current ticks / required ticks) as a multiplier for your height for both the drawn...thing (be it a tessellator or whatever else), and the uv coordinates. Both from the top down, of course, so in pseudocode something like... y + (currentTicks / requiredTicks) * height ...for both the drawn area AND the texture uv. It's easy to make mistakes here, but step 1 is making sure you can draw the entire image, with the correct placement and scaling. Making sure you have that much working first will give you a base to work off of. After that, I'd (make a commit / save a backup) before starting work on the progress bar style, just in case. Edit: I wasn't completely clear; the bit of pseudocode is for the effective y/v coordinates for the *bottom* of the drawn area / part of drawn texture
  23. If you already know your way around openGL and matrix transformations, the two main ways of interacting with it when MC modding are... 1. Through the GlStateManager, which is a layer between MC and LWJGL, and caches some openGL state data, then only updates LWJGL (and therefore openGL) when the data has changed (eg. if you set the color to the same color it has cached, it won't send the LWJGL command) 2. Through LWJGL, which sits between GlStateManager and openGL, and has commands very similar to the normal openGL command set If you don't know exactly what to do with the matrix itself...well then I'm not much help because neither do I. I did some direct matrix stuff a long time ago but don't remember any of it. In any case, if you haven't already done so, I suggest looking through the GlStateManager class and the openGL documentation. That's probably about as much as I can say to help, so gl!
×
×
  • Create New...

Important Information

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