Jump to content

LeonBlade

Members
  • Posts

    5
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Location
    Blossvale, NY

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

LeonBlade's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I ended up solving my problem. I couldn't figure out what was happening, but my bounding box was completely screwing up because of the entity tracking so removing the code from the setPositionAndRotation2 is my temporary solution which I don't mind. As for the black entity problem, I added this to my rendering: int fX = MathHelper.floor_double(entity.posX); int fY = MathHelper.floor_double(entity.posY + (double)(y / 16.0F)); int fZ = MathHelper.floor_double(entity.posZ); And then where I check for hanging direction on the render I change the fX or fZ depending on what side it's hanging like this: if (entity.hangingDirection == 2) { fX = MathHelper.floor_double(entity.posX + (double)(x / 16.0F)); } if (entity.hangingDirection == 1) { fZ = MathHelper.floor_double(entity.posZ - (double)(x / 16.0F)); } if (entity.hangingDirection == 0) { fX = MathHelper.floor_double(entity.posX - (double)(x / 16.0F)); } if (entity.hangingDirection == 3) { fZ = MathHelper.floor_double(entity.posZ + (double)(x / 16.0F)); } Then finally this: // get the proper light value int light = this.renderManager.worldObj.getLightBrightnessForSkyBlocks(fX, fY, fZ, 0); // get the x bit int lightX = light % 65536; // get the y bit int lightY = light / 65536; // set the lightmap texture coords OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)lightX, (float)lightY); // ensure gl color is white GL11.glColor3f(1.0F, 1.0F, 1.0F); You can view the commit for these changes here. I hope this helps someone who has this problem in the future.
  2. You may also need to create custom packets as well depending on what you want to do with the entity once you've created it. Do what diesieben07 said and add the implements IEntityAdditionalSpawnData and the two methods required to read and write spawn data. You basically just write in an order which pieces of data you want to load on the spawn and then read in the same order like writeInt writeInt writeUTF you need to read it the same order readInt readInt readUTF
  3. This is a very useful piece of code, thank you.
  4. Take a look at "ISimpleBlockRenderingHandler", you'll want to create a block rendering handler inheriting this class and using "registerBlockHandler" in the "RenderingRegistry" class. You may instead need to create a Tile Entity, this post might be of some assistance. http://www.minecraftforge.net/forum/index.php?topic=3411.0
  5. Hello everyone, I apologize for this being my first post on the forums being a question seeking assistance, I normally try to work out my issues myself, but I know that you all more familiar with Forge than I am. While playing Minecraft with my friend on my private server I had the idea of creating custom paintings but without using a texture pack. The result of this was a mod that allows you to place paintings on the wall specifying a URL and blocks wide and high and it will display the picture on the wall after loading. It works almost perfectly, there's only one issue I found and I'm not sure what to do about it. I found that my entity would move up periodically on the EntityTracking updates a certain distance depending on varying factors and then move back down on the force teleport section. I found that by overriding the setPositionAndRotation2 method and just having it do nothing at all it fixed the problem and I was okay with that for a while. The problem I found though that was if the painting has a block in the center of it at the very top it will display completely black (or if GL lighting is turned off it will dim). Here are a few snapshots of it in action: Note in this image above the painting on the right working perfectly fine. To remedy this, I found that it was actually the fault of me overriding setPositionAndRotation2, and so by adding the code found in the EntityPainting for this method, it displayed the picture fine for a moment, until it then moved up like it once did before. Here are some snapshots of how it works (please note the image is stretched on purpose): Here you can see the picture actually moves up half of a block space initially. Here you can see once it receives the forced teleport it shifts up a full block from the half it originally moved up. I'm not sure what is causing this, but it is also causing my bounding box to screw up as well, and by looking slightly away from the painting it will be seen as out of view in the frustum and disappear, also this makes trying to hit it off the wall impossible only in the "center". Here is a picture of the image not being black once you remove the center block at the top: Here is a picture of the middle block not blocked, you'll note that you can actually block off any other block except this one: You can view the entire mod's source code here. Edit: One final note, if you actually set the bounding box size to be 16 for width and height, it will actually render just fine, even if you put it flush with the top of a block, however, because of this it wont render in the frustum correctly, and you cannot hit it off the wall unless in the center of the entity. I hope that someone can be of assistance, it's a fun idea to be able to put images in Minecraft like this, my friend and I both have laughed at the funny pictures put up, and making bilboards with ads on them as a joke. I hope that I can get this small problem fixed so that it will be perfect. Thanks.
×
×
  • Create New...

Important Information

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