Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

hydroflame

Members
  • Joined

  • Last visited

Everything posted by hydroflame

  1. it would be a possibility, but openGL (specially version 1) has some utility method to do that remember when we said you need to translate the iamge to the position of the mob ? well you can also translate it from there after that (and rotate it) //setup code to get the matrxi to the right position GL11.glTranslated(0, 0.5, 0);//move the whole thing 0.5 unit in the air GL11.glRotated(90, 0, 1, 0);//rotate around the y axis by 90 degree //WATCHOUT, doing translate THEN rotate wil not give the same result as rotate THEN translate (also, it might be -90 instead of +90, not sure what your specific case needs) //resotre core
  2. "portions" like stop rendering the arms ? if yes then you will need ASM btw RenderPlayerEvent works but you have to use one of its sub event (RenderPlayerEvent.Post or Pre)
  3. no, not d3dx ... ahahah just kidding *stfu hydroflame* yes cylindrical billboarding would be just aroudn the y axis, if that what you want remove: GL11.glRotatef(player.rotationPitch, 1.0F, 0.0F, 0.0F); this line tell openGL to rotate to face you on a "up-down" way while the other one makes the billboard face you in a "left-right" way what do you mean by that ? it "jumps/ lag ? or some other visual bug if its the lag you want to do the same as you did with the position using "partialTicks" partialTick hold the current "percentage" of the frame completed, what happens if that you are rendering the screen many more times then you are updating the position and orientation of the characters. so partialTicks tell you how much of the frame is done so far, 25%? 50? 75? 90? by using it you can interpolate between the last known position and the "current position" (1) (2) (3) (4) villager.prevPosX + (villager.posX - villager.prevPosX) * partialTicks so you take the difference between 2 and 3, thsi gives you the movement different that the character did in the last frame multiply by 4 gives you how much of the frame we are done, then add 1 will give you technicly where the character was ~20 tick ago (since position is updated every 20 tick) so yes technicly what you are seeing is always the past of the actual player mouvement. but this isnt call of duty or another fast space game so this method is somewhat ok to use off-topic a real method would be to try to predict player movement, aka, if the player is going foward in a tunnel, chances are hes not goign to suddently stop and look at the wall
  4. no but the interface could force the Item and Block to implement a method called "getMod" or wtv and then youd have access super easy btw your mod is a f***ing great idea can i haz ?
  5. heu lets not get started with this because i actually prefer openGL to d3dx but lets say that d3dx has more noob-friendly tools and openGL has more access to your ressource..... GL11.glRotatef(-RenderManager.instance.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(RenderManager.instance.playerViewX, 1.0F, 0.0F, 0.0F); you want spherical billboarding or cylindrical billboarding ? what you did is for spherical also i think using i saw in some other thread that RenderManager values were messed up i think its better to use entityPlayer.rotationYaw (for Y) entityPlayer.rotationPitch (for X) next: tessellator.addVertexWithUV(1, 1, 0, 0, 0); tessellator.addVertexWithUV(1, 1, 0+2, 0, 1); tessellator.addVertexWithUV(1+1, 1+2, 0, 1, 1); tessellator.addVertexWithUV(1, 1+1, 0, 1, 0); you have a bunch of extra 1 there after you did glTranslated(x, y, z) you are directly at the position of the villager so adding 1 (in the x column, the extra 1 in the y column will make the image be right above the entity,not in it ) will move your quad by 1 unit in the x direction something centered would look like thsi: tessellator.addVertexWithUV(-1, 1, 1, 0, 0); tessellator.addVertexWithUV(-1, 1, -1, 0, 1); tessellator.addVertexWithUV(1, 1, -1, 1, 1); tessellator.addVertexWithUV(1, 1, 1, 1, 0); not saying its the right orientation, jsut saying it would be more centered dont forget to put both planes (and remove the useless one later) tessellator.addVertexWithUV(-1, 1, 1, 0, 0); tessellator.addVertexWithUV(-1, 1, -1, 0, 1); tessellator.addVertexWithUV(1, 1, -1, 1, 1); tessellator.addVertexWithUV(1, 1, 1, 1, 0); tessellator.addVertexWithUV(-1, 1, 1, 0, 0); tessellator.addVertexWithUV(1, 1, 1, 1, 0); tessellator.addVertexWithUV(1, 1, -1, 1, 1); tessellator.addVertexWithUV(-1, 1, -1, 0, 1);
  6. you do , but dont worry we know a lot of people prefer to learn+mod at the same time so they often arrive in problem like this but basicly everything in java (except primitive type: int, float, double, byte, long, boolean) is child of Object. Whenever you do "new Soemthing()" you are creating an object that is a child of the class Object (yup confusing i know) but a == null can be done with anything ! Item s = wtv; if (s == null){ //hello } Block b = some other stuff; if (b == null){ //hello again } now in the specific case you have, you want to check if the stackTagCompound is null , if it is you want to create it if(itemStack.stackTagCompound == null){ //here we know the nbt is null itemStack.stackTagCompoung = new NBTTagCompound(); } //and here we can continue to use it becasue we know that if it was null it was also created
  7. then you should really learn a bit more java (either while you continue to make your mod or wtv) because itll help you a LOT but a null check is like this: Object a; //more code if(a == null){ //do or dont do something depending on the logic }
  8. i jsut realised this ..im using ASM to insert stuff into the ItemInWorldManager class and that class is only used server side, so it would work if you're playing single player, but not if you're playing on a server :\, still want it ?
  9. its actually a very powerfull tool if you know how to use it it doesn't, but it's lot like openGL takes care of it either (you have to take that into account manually)
  10. @Moritz, you realise you're creating a tagcompound inside a tagcompound right? that exactly like using hashmap to store hashmaps
  11. yes, congrats now this happens because when you are rendering the quad, opengl still thinks that you want to render at the current position, it doesnt move the things around for you so you need to translate the openGL matrix to the position of the villager now when you're drawing, 0, 0, 0 is considered the position of the main player, so you need to translate by the difference between you and the target entity GL11.glPushMatrix();//save current gl transform state GL11.glTranslated(diffX, diffY, diffZ); //usual render bubble code GL11.glPopMatrix();//restore saved gl transform state
  12. if you dont knwo what : java.lang.NullPointerException mean, i suggest you google that but you need to make a null check before using the stackTagCompound and create it if its null
  13. the tessellator is an api build on top of opengl , when you're using the tessellator, you're using opengl directly also, hes trying to draw triangles (2 to make a quad) GL11.glEnable(GL11.GL_LINE_SMOOTH); GL11.glHint( GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST ); GL11.glBegin(GL11.GL_LINE_STRIP); not lines yet it reassures me to see someone else with openGL knowledge.
  14. the nbt is not stored in the Item class but in a variable contained by the ItemStack most function that Item has will give you a ItemStack as argument aka (name may vary because i dont remember by heart) public void onItemRightClick(ItemStack itemStack, and a bunch of other argument){ //here you can use the information about the itemstack nbt //ex: int theRandom = itemStack.stackTagCompound.getInteger("myRandomNumber"); if(theRandom == 0){ //here we DONT have anythin on the stack compound itemStack.stackTagCompound.setInteger("myRandomNumber", (int)(Math.random()*100));//generate a number between 0-100 and place it on the nbt }else{ System.out.println("the number of thsi item is: "+theRandom); } }
  15. get the list of player, pick one at random must be executed server side: List playerList = MinecraftServer.getServer().getConfigurationManager().playerEntityList; int selectedPlayer = (int)(Math.random()*playerList.size()); EntityPlayer theChosenOne = playerList.get(selectedPlayer); //do stuff with the chosen one
  16. aaaaaaaaahhhhhhhhhhhh nvm i foudn it, turn out you cannot make a RenderLivingEvent because its an abstract class you must either make a RenderLivingEvent.Pre or RenderLivingEvent.Post (use pre) aka @ForgeSubscribe public void handlerRenderLiving(RenderLivingEvent.Pre event){ //usual render code }
  17. before i dig in further, can you move it from preinit to init ? and try again ? (specially look out for the error in the logs ) it wouldnt be bad trying it but in my case it didnt trigger any error :\
  18. about the size, youll see when it renders for real, but it might be too big anyway, but its deffinitelly in the "reasonable size" well then now you knwo that you dont register it correctly did you change something there ? make a println before MinecraftForge.EVENT_BUS.register(Object); if it doesnt print, then you know the method that is SUPPOSE to register it isnt being called, try to see why (if you cant find anything, use code tag to paste your main mod class, common proxy and client proxy
  19. yeah i feel you, this is also why i made my own version and didnt use essentials (also because shop sucks but thats another story) btw i didnt forget you its just i dont have access to my dev env right now and i also need to make SURE it works before sending it to you (like work in dev env, real client and real server)
  20. 3 things first: tessellator.addVertexWithUV(1, 1, 0, 0, 0); tessellator.addVertexWithUV(1, 1, 0+600, 0, 1); tessellator.addVertexWithUV(1+776, 1+600, 0, 1, 1); tessellator.addVertexWithUV(1, 1+776, 0, 1, 0); this square is WAY too big, basicly this would mean 776 block long in minecraft world by 600 block long 2 try System.out.println("i executed from "+*insert class name*); try to see if: - the event handler is being registered correctly -the event is called --your code makes it to the render code change this: public void updateTradeBubble(Minecraft minecraft) { Tessellator tessellator = Tessellator.instance; minecraft.renderEngine.bindTexture("/village/images/speech.png"); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(1, 1, 0, 0, 0); tessellator.addVertexWithUV(1, 1, 0+600, 0, 1); tessellator.addVertexWithUV(1+776, 1+600, 0, 1, 1); tessellator.addVertexWithUV(1, 1+776, 0, 1, 0); tessellator.draw(); } to this: (it will allow you to see both side of the quad) public void updateTradeBubble(Minecraft minecraft) { Tessellator tessellator = Tessellator.instance; minecraft.renderEngine.bindTexture("/village/images/speech.png"); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(1, 1, 0, 0, 0); tessellator.addVertexWithUV(1, 1, 0+600, 0, 1); tessellator.addVertexWithUV(1+776, 1+600, 0, 1, 1); tessellator.addVertexWithUV(1, 1+776, 0, 1, 0); tessellator.addVertexWithUV(1, 1, 0, 0, 0); tessellator.addVertexWithUV(1, 1+776, 0, 1, 0); tessellator.addVertexWithUV(1+776, 1+600, 0, 1, 1); tessellator.addVertexWithUV(1, 1, 0+600, 0, 1); tessellator.draw(); }
  21. hmm, but i could imagine some case where you wouldnt be able to use Icons.. they're very specific but i can see some i usually use TESR anyway becasue MOST of my custom blocks have animations anyway
  22. revert back to the "messed up" phase and press f5, is it above your head ? or just on the screen ?
  23. @pelep, what would you do if you need to draw more complex models ? ones cant use icons
  24. yeah, but draw() returns an int which is used by MC afterward. according to the comments, it gets sent to the gpu. and i honestly don't know enough about how to handle gpu/hardware related stuff, so i decided not to mess with it and opted to use icons instead yeah but if you follow the call hierarchy you realise that this int isn't used anywhere (for some reason) so my method describe above wont affect anythign in that sens
  25. didnt know :\ i tought that it was actually good (i use my own version of "essentials" and i dont have any problems on my server let me pack up the coremod and ill send it to you (either PM if it accept files or in this thread, or mediafire/dropbox/etc)

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.