Everything posted by Draco18s
-
[1.8][Solved] drawing a simple line
Huh?
-
[Solved] Item Lifespan
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).
-
Controlling direction of Large Fireball projectile [SOLVED]
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).
-
[1.8][Solved] drawing a simple line
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]
-
Rotate block when placed
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.
-
[1.7.10]Gui rendering repeatively
Alot no want your thanks.
-
[1.8][Solved] drawing a simple line
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.
-
[1.7.2] I want right click blockchest during the sneak.
We do not understand you.
-
[1.7.10] bytecode doesn't seem to match sourcecode
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
-
[1.7.2] I want right click blockchest during the sneak.
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.
-
Spawning my entity causes gamecrash[STILL UNSOLVED]
Correction: Use the UUID.
-
[1.7.2] I want right click blockchest during the sneak.
http://jabelarminecraft.blogspot.com/p/minecraft-forge-172-event-handling.html
-
[1.8] Entity model not rotating properly
Math.toRadians(angdeg)
-
Spawning my entity causes gamecrash[STILL UNSOLVED]
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.
-
[1.8] Render not taking into account the world lighting.
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.
-
[1.7.10]Gui openable only for one player
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.
-
Get extact MovingObjectPoition from the Player
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; }
-
[1.8] how would you render an model on a player?
Just to clarify: hats (etc) aren't entities, they're models. Now that you know that, maybe a search will find that information.
-
[1.8] Entity model not rotating properly
Rotations are in radians.
-
Get extact MovingObjectPoition from the Player
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; } ?
-
[1.8] Need SRG names of potionRequirements and potionAmplifiers
The csv files are in: ~/.gradle/caches/minecraft/net/minecraftfirge/forge/[version]/unpacked/conf/ Where ~ is your user directory.
-
[1.7.2] I want right click blockchest during the sneak.
Use your IDE to examine the properties and methods of the event object.
-
Get the partial tick?
Again, why? What are you trying to accomplish that doesn't work on full ticks?
- Get the partial tick?
-
How to make reverse gravity
That's not a good reason. Coremods are [Expert+++] level things. It requires a deep understanding of the Java bytecode and the ASM library.
IPS spam blocked by CleanTalk.