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.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. Items in ItemFrames basically don't exist as far as Minecraft is concerned. There's no code that triggers when an item is placed into the frame (seriously, the item stack isn't told, the item isn't told, and there's no Forge event, and no update methods are called) or when the item frame is broken (although that causes it to drop, and now that the item is an ItemEntity, there is the onEntityItemUpdate method, which runs every tick, so you could check there).
  2. Changing the acceleration is easy, just divide or multiply the vec3 values when you assign them. As for buggy, I don't know. I do know that there's a vanilla bug that the motion/acceleration values aren't saved when the game unloads, causing fireballs to get stuck mid-air (despite being reported to Mojang back in 1.4.4, they didn't fix it until last week's snapshot, 15w36c).
  3. Vec3 pos = event.player.getPosition(event.partialTicks); Which event (from net.minecraftforge.client.event package e.g.) should I use? Oh yeah, sorry. I was using the DrawBlockHighlightEvent , but there's a handful of render events that would all be appropriate. And of course, this should be in a client side only event handler, for obvious reasons. I picked DrawBlockHighlightEvent because I was interested in the block that the player was looking at, and that event gave it to me, I didn't have to ray-trace it. That will draw a very specific line in the world, from the block at (0,5,0) to (5,5,0). Every world you create, no matter where you go, that line will be drawn in the same place in the world. But for testing? Sure, it'll work. That's left over from code I removed that determined what color to draw my line. For me, the distance was important, for you it isn't. You can remove that. Here's a pic of what I was doing: http://vignette1.wikia.nocookie.net/reasonable-realism/images/b/b2/2015-08-13_01.44.38.png/revision/latest?cb=20150814171720[/img]
  4. theBest108's post is useless, as the OP isn't getting a metadata value by which to rotate by. Anyway, take a look at BlockFurnace's onBlockPlaced method.
  5. Alot no want your thanks.
  6. This isn't going to give you everything, but it will give you enough to get started. You're still going to need to get the coorridinates you want to draw to/from yourself as well as modify this code to draw bounding boxes, rather than center to center. (The tessellator, by the way, is just a wrapper and helper class that uses GL commands under the hood). GL11.glPushMatrix(); GL11.glPushAttrib(GL11.GL_ENABLE_BIT); Vec3 pos = event.player.getPosition(event.partialTicks); //because of the way 3D rendering is done, all coordinates are relative to the camera. This "resets" the "0,0,0" position to the location that is (0,0,0) in the world. GL11.glTranslated(-pos.xCoord, -pos.yCoord, -pos.zCoord); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_TEXTURE_2D); //you will need to supply your own position vectors drawLineWithGL(pos1, pos2); GL11.glPopAttrib(); GL11.glPopMatrix(); //... private void drawLineWithGL(Vec3 blockA, Vec3 blockB) { int d = Math.round((float)blockA.distanceTo(blockB)+0.2f); GL11.glColor3f(0F, 1F, 0F); float oz = (blockA.xCoord - blockB.xCoord == 0?0:-1f/16f); float ox = (blockA.zCoord - blockB.zCoord == 0?0:1f/16f); GL11.glBegin(GL11.GL_LINE_STRIP); //you will want to modify these offsets. GL11.glVertex3d(blockA.xCoord + 0.5,blockA.yCoord - 0.01,blockA.zCoord + 0.5); GL11.glVertex3d(blockB.xCoord + 0.5,blockB.yCoord - 0.01,blockB.zCoord + 0.5); GL11.glEnd(); } This will draw a line from the underside-center to the underside-center in green. Your "the yellow bits don't need to be visible" in this code sample would be true, the lines drawn will be hidden by geometry. IIRC, in order to draw on top of geometry (the yellow bits visible) you need to call GL11.glDisable(GL11.GL_DEPTH_TEST); I have most of the GL commands outside the function because I was drawing multiple lines, so I did not need to set my settings, and then unset them, between each line. Line_strip was inside, because my actual use uses QUADS, so my LINE_STRIP drawing function had to specify. LINE_STRIP. Not STIPPLE. GL_LINE_STIPPLE is an enable/disable parameter that makes lines drawn with GL_LINES or GL_LINE_STRIP to be dashed.
  7. See my post here. You should be able to follow the folder path and find the original jar files nearby. http://www.minecraftforge.net/forum/index.php/topic,33642.0.html
  8. It is already or not sir ? Why want create it ? You need to USE the event, not create it, instantiate it, or anything else. You need to create a LISTENER.
  9. http://jabelarminecraft.blogspot.com/p/minecraft-forge-172-event-handling.html
  10. Math.toRadians(angdeg)
  11. More than one constructor: more than one place that the file needs to be specified. The EntityVehicle(World) constructor will be called at some point.
  12. Random guess: Have you tried GL11.glDisable(GL11.GL_TEXTURE_2D); ? I was doing some GL work a few weeks back and not having that disabled was causing what looked like lighting glitches.
  13. Look at how a chest works. It knows how many people are in it so it can animate open and closed. You should do something similar, only then disallow the interaction when the player attempts to open the GUI if there's already someone in it.
  14. Is not magic, but I did miss a line. Vec3 vecPlayer = new Vec3 (entityplayer.posX,entityplayer.posY+entityplayer.eyeHeight,entityplayer.posZ); Edit: Also misnamed one var. I am on my tablet atm. So it should look like this public static MovingObjectPosition getMovingObjectPositionFromPlayer(World world, EntityPlayer entityplayer, boolean flag, double reach) { Vec3 vecPoint = entityplsuer.getLookVec(); Vec3 vecPlayer = new Vec3 (entityplayer.posX,entityplayer.posY+entityplayer.eyeHeight,entityplayer.posZ); MovingObjectPosition movingobjectposition = world.rayTraceBlocks(vecPlayer, vecPoint, false, false, true); return movingobjectposition; }
  15. Just to clarify: hats (etc) aren't entities, they're models. Now that you know that, maybe a search will find that information.
  16. Rotations are in radians.
  17. public static MovingObjectPosition getMovingObjectPositionFromPlayer(World world, EntityPlayer entityplayer, boolean flag, double reach) { Vec3 vecPlayer = entityplsuer.getLookVec(); MovingObjectPosition movingobjectposition = world.rayTraceBlocks(vecPlayer, vecPoint, false, false, true); return movingobjectposition; } ?
  18. The csv files are in: ~/.gradle/caches/minecraft/net/minecraftfirge/forge/[version]/unpacked/conf/ Where ~ is your user directory.
  19. Use your IDE to examine the properties and methods of the event object.
  20. Again, why? What are you trying to accomplish that doesn't work on full ticks?
  21. That's not a good reason. Coremods are [Expert+++] level things. It requires a deep understanding of the Java bytecode and the ASM library.

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.