Jump to content

Recommended Posts

Posted
Quote

CountRangeConfig(5, 5, 20, 20)));

Those values are in order: count, bottomOffset, topOffset, and maximum

 

This call to nextInt must pass a value > 0:

int j = p_212852_1_.nextInt(p_212852_2_.maximum - p_212852_2_.topOffset) + p_212852_2_.bottomOffset;

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
1 hour ago, dagobertdu94 said:

I have changed the values very often and now I don't know where the error could came from.

As a general debugging tip for situations like this in the future: you can comment out something like half of the calls to addFeature() at a time to try and isolate the issue. You've identified that the bug is in this file, and that you've been playing around with the parameters, so it logically follows that the issue is probably to do with one set of those parameters. My approach to isolating the bug would be to comment out like the first four ore types (ditium, minium, etc.) and see if the bug persists with the second half. If it does, I'd try to switch out the commented parts so that you'd keep the first four but not the later ones. The idea being that you significantly cut down the number of lines to check for errors that you need to look at manually. This won't always work (e.g. what if a line in the first set AND a line in the second set are both wrong), but the idea is that you try and make it easier on yourself to find out which one is the bad one.

 

Some general advice to newer coders who might stumble on this thread (not just directed at you, OP): compile often and try not to make too many changes in one go. Sometimes it's tough to deal with longer compile times so there is a balance to strike, but hopefully you're able to identify issues as soon as they come up.

 

Draco has pointed out line 24, which is a line that stands out to me even without knowing what the parameters are for: this line in particular when compared to the others has some repeated values. If you're just using a function call for something you didn't write yourself, it is often good to try and figure out what restrictions on the arguments exist, if any (particularly min, max, whether the second argument must be bigger than the first, etc.). Sometimes the code you're trying to use isn't commented well or documented, so you run into situations like this that can't be avoided. Repeated values, zeros as input, and other potentially noteworthy cases are something to keep in mind just in case of something like a subtraction forcing a zero or a divide by zero that may lead to a crash. Just being aware of things like this is a useful skill to have in your debugging toolkit.

Posted (edited)
1 hour ago, Draco18s said:

Those values are in order: count, bottomOffset, topOffset, and maximum

 

This call to nextInt must pass a value > 0:

int j = p_212852_1_.nextInt(p_212852_2_.maximum - p_212852_2_.topOffset) + p_212852_2_.bottomOffset;

I changed that problematic line of code and know it works very well. Maybe the chunk loading is a little bit slow, but my mod has finally updated to 1.14.4. ?

I don't know what I have to change if I would want to update to 1.15.1... ?

Now I still have the problem that I cannot upload my mod to CurseForge, but that's another story, I think.

 

Thank you for your help!

2020-01-03_21.55.47.png

Edited by dagobertdu94
Writing mistake

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • @Tsuk1 Also, new note, you can use blockbench to make the custom item model for when it is not on the head.   EDIT: Funny story, I am making a mod similar to yours! Mine is called NorseMC.
    • @Nood_dev Could you send a screenshot of your weapon code? Here is the one I made (for a dagger): The specific UUID does not matter, just that it is the same every time, which is why UUID#randomUUID does not work public class DaggerItem extends TieredItem implements Vanishable { protected static final double REACH_MODIFIER = -1.5D; protected final Multimap<Attribute, AttributeModifier> defaultModifiers; protected final UUID BASE_ATTACK_REACH_UUID = UUID.fromString("6fe75b5c-9d1b-4e83-9eea-a1d5a94e8dd5") public DaggerItem(Tier pTier, int pAttackDamageModifier, float pAttackSpeedModifier, Properties pProperties) { super(pTier, pAttackDamageModifier, pAttackSpeedModifier, pProperties); this.attackDamage = (float) pAttackDamageModifier + pTier.getAttackDamageBonus(); ImmutableMultimap.Builder<Attribute, AttributeModifier> builder = ImmutableMultimap.builder(); builder.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(BASE_ATTACK_DAMAGE_UUID, "Weapon modifier", this.attackDamage, AttributeModifier.Operation.ADDITION)); builder.put(Attributes.ATTACK_SPEED, new AttributeModifier(BASE_ATTACK_SPEED_UUID, "Weapon modifier", pAttackSpeedModifier, AttributeModifier.Operation.ADDITION)); // THE ONE YOU WANT: builder.put(ForgeMod.ENTITY_REACH.get(), new AttributeModifier(BASE_ATTACK_REACH_UUID, "Weapon modifier", REACH_MODIFIER, AttributeModifier.Operation.ADDITION)); this.defaultModifiers = builder.build(); } @Override public Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot pEquipmentSlot) { return pEquipmentSlot == EquipmentSlot.MAINHAND ? this.defaultModifiers : super.getDefaultAttributeModifiers(pEquipmentSlot); } }
    • https://images.app.goo.gl/1PxFKdxByTgkxvSu6
    • That's what we'll try out. I could never figure out how to recreate the crash, so I'll just have to wait and see.
    • Ok, I updated to the latest version and now the models are visible, the problem now is that the glowing eyes are not rendered nor any texture I render there when using shaders, even using the default Minecraft eyes RenderType, I use entityTranslucent and entityCutout, but it still won't render. Something I noticed when using shaders is that a texture, instead of appearing at the world position, would appear somewhere on the screen, following a curved path, it was strange, I haven't been able to reproduce it again. I thought it could be that since I render the texture in the AFTER ENTITIES stage which is posted after the batches used for entity rendering are finished, maybe that was the reason why the render types were not being drawn correctly, so I tried injecting code before finishing the batches but it still didn't work, plus the model was invisible when using shaders, there was a bug where if I look at the model from above it is visible but if I look at it from below it is invisible. So in summary, models are now visible but glowing eyes and textures are not rendered, that hasn't changed.
  • Topics

×
×
  • Create New...

Important Information

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