Jump to content

Recommended Posts

Posted
  On 3/12/2018 at 4:11 PM, Mambo_Dancer said:

when im placing my InfusionAltar my another entity, that should hovering above is stucks to me 

Expand  

What?

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

You are rendering your item outside the pushed matrix. Move it to be rendered inside of it.

TESR's are also singletons. There is only one TESR that does the work for rendering every single tile-entity that it is bound to. If there are several loaded at the same time, then you need to compensate the rotation, either by using a variable from the TE itself, or any other "outside" data, otherwise it'll speed up by +1x times for each tile.

I would also recommend that you start to undo whatever you rendered after you are done. "Artifacts" are a type of behaviour when rendering isn't stopped once you think it has, and starts interfering with other's rendering. OpenGL artifacts are annoying and hard to track down. GLStateManager helps out a bit, but in the end artifacts shouldn't exist.

An example of "undoing" would be to translate your TESR to where you want it, render the item, then translate again with negative values, to reset it. This goes for every action you do with OpenGL.


I have a TESR that spins in all axii, as well as bobbing up and down here. You can take a look and see where your code differentiates. Do note, I'm calling other methods as well so a pure copy/paste will lead to unintended behaviour.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Posted
  On 3/12/2018 at 6:46 PM, Matryoshika said:

You are rendering your item outside the pushed matrix. Move it to be rendered inside of it.

TESR's are also singletons. There is only one TESR that does the work for rendering every single tile-entity that it is bound to. If there are several loaded at the same time, then you need to compensate the rotation, either by using a variable from the TE itself, or any other "outside" data, otherwise it'll speed up by +1x times for each tile.

I would also recommend that you start to undo whatever you rendered after you are done. "Artifacts" are a type of behaviour when rendering isn't stopped once you think it has, and starts interfering with other's rendering. OpenGL artifacts are annoying and hard to track down. GLStateManager helps out a bit, but in the end artifacts shouldn't exist.

An example of "undoing" would be to translate your TESR to where you want it, render the item, then translate again with negative values, to reset it. This goes for every action you do with OpenGL.


I have a TESR that spins in all axii, as well as bobbing up and down here. You can take a look and see where your code differentiates. Do note, I'm calling other methods as well so a pure copy/paste will lead to unintended behaviour.

Expand  

thanks alot, but most of it seems to be hard to understand coz im a beginner, i will appreciate any help with undoing as example

Posted
  On 3/12/2018 at 6:46 PM, Matryoshika said:

You are rendering your item outside the pushed matrix. Move it to be rendered inside of it.

TESR's are also singletons. There is only one TESR that does the work for rendering every single tile-entity that it is bound to. If there are several loaded at the same time, then you need to compensate the rotation, either by using a variable from the TE itself, or any other "outside" data, otherwise it'll speed up by +1x times for each tile.

I would also recommend that you start to undo whatever you rendered after you are done. "Artifacts" are a type of behaviour when rendering isn't stopped once you think it has, and starts interfering with other's rendering. OpenGL artifacts are annoying and hard to track down. GLStateManager helps out a bit, but in the end artifacts shouldn't exist.

An example of "undoing" would be to translate your TESR to where you want it, render the item, then translate again with negative values, to reset it. This goes for every action you do with OpenGL.


I have a TESR that spins in all axii, as well as bobbing up and down here. You can take a look and see where your code differentiates. Do note, I'm calling other methods as well so a pure copy/paste will lead to unintended behaviour.

Expand  

Still cant get rid of no particles, moved to inside matrix (x=0,y=0.4,z=0) and trouble still in

Posted
  On 3/12/2018 at 6:46 PM, Matryoshika said:

You are rendering your item outside the pushed matrix. Move it to be rendered inside of it.

TESR's are also singletons. There is only one TESR that does the work for rendering every single tile-entity that it is bound to. If there are several loaded at the same time, then you need to compensate the rotation, either by using a variable from the TE itself, or any other "outside" data, otherwise it'll speed up by +1x times for each tile.

I would also recommend that you start to undo whatever you rendered after you are done. "Artifacts" are a type of behaviour when rendering isn't stopped once you think it has, and starts interfering with other's rendering. OpenGL artifacts are annoying and hard to track down. GLStateManager helps out a bit, but in the end artifacts shouldn't exist.

An example of "undoing" would be to translate your TESR to where you want it, render the item, then translate again with negative values, to reset it. This goes for every action you do with OpenGL.


I have a TESR that spins in all axii, as well as bobbing up and down here. You can take a look and see where your code differentiates. Do note, I'm calling other methods as well so a pure copy/paste will lead to unintended behaviour.

Expand  

and i will be very happy if you help me with that fast rotation, cant get rid of it too((

Posted
  1. You are constantly creating a new EntityItem every frame. These will stack up, and just cause excessive cleanup for the GarbageCollector (which cleans up used memory).
    Declare a final EntityItem outside the method and just reference whenever you want to render.
  2. You are completely missing a pushMatrix call.
  3. You need to revert the rotation & the translation after you have rendered the EntityItem 

An example of reverting the rotation would be as I did in my code I linked earlier
 

    	GlStateManager.rotate(angle, 1, 1, 1); //Rotating everything
    	renderBody(te, x, y, z, partialTicks, destroyStage); //render the thing
    	GlStateManager.rotate(-angle, 1, 1, 1); //reverting the rotation with an equal but negative angle

 

If you want to use the same logic as I do for calculating the angle, then instead of multiplying by 100 (what you changed) you should divide by a larger number than 40 (what I used).

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Posted
  On 3/12/2018 at 9:25 PM, Matryoshika said:
  1. You are constantly creating a new EntityItem every frame. These will stack up, and just cause excessive cleanup for the GarbageCollector (which cleans up used memory).
    Declare a final EntityItem outside the method and just reference whenever you want to render.
  2. You are completely missing a pushMatrix call.
  3. You need to revert the rotation & the translation after you have rendered the EntityItem 

An example of reverting the rotation would be as I did in my code I linked earlier
 

    	GlStateManager.rotate(angle, 1, 1, 1); //Rotating everything
    	renderBody(te, x, y, z, partialTicks, destroyStage); //render the thing
    	GlStateManager.rotate(-angle, 1, 1, 1); //reverting the rotation with an equal but negative angle

 

If you want to use the same logic as I do for calculating the angle (but slow it down), then instead of multiplying by 100 (what you changed) you should divide by a larger number than 40 (what I used).

Expand  

 

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Posted (edited)
  On 3/12/2018 at 9:25 PM, Matryoshika said:

GlStateManager.rotate(angle, 1, 1, 1); //Rotating everything

renderBody(te, x, y, z, partialTicks, destroyStage); //render the thing

GlStateManager.rotate(-angle, 1, 1, 1); //reverting the rotation with an equal but negative angle

Expand  

This is what pushMatrix and popMatrix do.

GLStateManager.pushMatrix();
GlStateManager.rotate(angle, 1, 1, 1); //Rotating everything
renderBody(te, x, y, z, partialTicks, destroyStage); //render the thing
GLStateManager.popMatrix(); //undo to the last pushMatrix

 

 

Edited by Draco18s

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
  On 3/12/2018 at 9:26 PM, Matryoshika said:

 

Expand  

so it worked, particularry, it doesnt want to rotate, and i have annoying name hovering above block when u lookng on block (container.infusionaltar) tried to look where it is called but my mission failed)
i do not know about forge modding so much stuff, could you recommend me some stuff where i can learn more about? thanks for help btw

Posted (edited)
  On 3/12/2018 at 9:47 PM, Mambo_Dancer said:

so it worked, particularry, it doesnt want to rotate, and i have annoying name hovering above block when u lookng on block (container.infusionaltar) tried to look where it is called but my mission failed)
i do not know about forge modding so much stuff, could you recommend me some stuff where i can learn more about? thanks for help btw

Expand  

Heya, i have taken a quick look at your TESR and you are setting the value in the render method, I would recommenced you to do this for example in the update method in your tileEntity (to update the value) and make setters and getters for that value in your tile.

So then you can call this from your TESR.

But you should also take care of the latency.

Example to explain better :P :

tile.getModelAngle() * partialTickTime  <- if you are actually rotating the model

and if the data (angle) doesn't change you give it just the tile.getModelAngle()

 

real example : 

float rotation = tile.isModelRotating() ? tile.getModelAngle() + (tile.getModelAngle() - tile.getModelPrevAngle()) *partialTickTime : tile.getModelPrevAngle() + ( tile.getModelAngle() - tile.getModelPrevAngle());
GlStateManager.rotate(rotation, 0, 0, 1);

 

Hope this helps you somehow.

 

(NOTE: TESR is as far as i know multi-threaded meaning the same render method is called in "independent" threads so your "angle" in the TESR will have different values, cuss the different threads don't share there values/data to each other.

So your rotation will always be broke.

And the render method is only called when the player is actually looking at the block/tile, so is not rotating which is fine if it's just for aesthetic purpose ) 

 

Greets Sir_titi

Edited by sir_titi

Always looking for new challenges, and happy to help the people where ever I can

Posted
  On 3/14/2018 at 7:02 PM, sir_titi said:

(NOTE: TESR is as far as i know multi-threaded meaning the same render method is called in "independent" threads so your "angle" in the TESR will have different values, cuss the different threads don't share there values/data to each other.

Expand  

What? This is literally nonsense.

"Two instances of the class" and "two threads" are completely and utterly different concepts.

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
  On 3/14/2018 at 7:07 PM, Draco18s said:

What? This is literally nonsense.

"Two instances of the class" and "two threads" are completely and utterly different concepts.

Expand  

Wait what do you mean?

Sorry me for being stupid :P

Always looking for new challenges, and happy to help the people where ever I can

Posted
  On 3/14/2018 at 7:09 PM, sir_titi said:

Wait what do you mean?

Sorry me for being stupid :P

Expand  

https://en.wikipedia.org/wiki/Multithreading_(computer_architecture)

 

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.

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

    • I have used mixins once before, and it was with @At RETURN, so it worked fine. Now im trying to use it as INVOKE, and the compilation is successful, but the client crashes almost on startup (just a couple seconds after running runClient)   Im trying to inject the method finishConversion inside the ZombieVillager class. This is my Mixin class important stuff:   import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.monster.ZombieVillager; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(ZombieVillager.class) public class ZombieVillagerCures { @Inject(method = "finishConversion", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/world/entity/LivingEntity;addEffect(Lnet/minecraft/world/effect/MobEffectInstance;)Z")) private void addZombieVillagerCuredAmmount(ServerLevel level, CallbackInfo info) { System.out.println("The Mixin Worked!!! " + level); } // Lnet/minecraft/world/entity/LivingEntity;addEffect(Lnet/minecraft/world/effect/MobEffectInstance;)Z } I'm sure the issue lies in the @At cuz other @At values work fine. Its probably the fully qualified name thing. idk how to get it in VS code
    • I'm wayy less skilled than you i bet, but maybe u could try to just convert one into the other?
    • wildbackport is not working
    • Through Betafort Recovery, Bitcoin scam victims can retrieve their money. I recommend Betafort Recovery to anyone who has fallen victim to a scam and has been looking for methods and techniques to recover their lost cryptocurrency or wallets. Betafort Recovery is a reliable cryptocurrency recovery firm that assists victims in recovering their stolen cryptocurrency and offers secure solutions to protect your wallets from online scammers. I must admit that I was deeply melancholy and had given up on life until these experts could restore my $23,400 to my wallet. If you've lost your cryptocurrency and you are helpless about it, contact Betafort Recovery to get your money back. One key aspect that makes Betafort Recovery stand out is its focus on providing secure solutions to protect wallets from online scammers. It's not just about recovering lost funds; it's also about preventing future incidents and ensuring that clients' digital assets are safeguarded against potential threats. This proactive approach demonstrates their commitment to the long-term financial security of their clients. Furthermore, for individuals who have lost their cryptocurrency and are feeling helpless, reaching out to Betafort Recovery could be a turning point in their situation. The reassurance that they are legitimate for seeking help and recovering lost funds can provide much-needed relief and a sense of empowerment. Betafort Recovery as a reliable cryptocurrency recovery firm is certainly well-founded. Their ability to assist scam victims in recovering stolen cryptocurrency, their focus on providing secure solutions, and their commitment to supporting clients through challenging situations make them a valuable resource for individuals navigating the complex world of digital currencies. If you or someone you know has fallen victim to a cryptocurrency scam, contacting Betafort Recovery could be the first step towards reclaiming lost funds and regaining peace of mind.  
    • Idk how i didn't notice that, but I deleted it and fixed some other issues and now I get this https://mclo.gs/YsWacqq
  • Topics

×
×
  • Create New...

Important Information

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