Jump to content

Laseph

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by Laseph

  1. I know that pre 1.9 you just did worldObj.markBlockForupdate but i just can't find the 1.9 alternative. Thanks in advance, Laseph.
  2. Hello, I'm having difficulty finding good and consistent information on how to add sounds to my mod. I would like to have a loopable sound that stops when a smelter is done smelting. But i don't really know what the correct way of doing it is. I know you can play sounds by accessing the sound handler but i don't how to do the smelting sound with the stop condition. I would also want to know how to handle sounds correctly in general.
  3. So i have this variable i want to set when the TileEntity is created based on the metadata from the associated block. I first tried placing it in the constructor but i quickly found out the worldObj of the tileentity isn't created until later. Then i tried doing it in the onLoad method but it loops itself infinitely because of trying to get the blockstate via loading the chunk. Should i just do a check in the update event or is there a better way?
  4. ModBlocks.blockHutBaker.getRegistryName() already has your mod ID included. Removing 'Constants.MOD_ID + ":" +' from you registerRendering should normally do the trick.
  5. Hello, first of all you should set the rotation of the block when the block is added in the block class. Using the furnace as an example. (I added the up and down direction for you.) Block class: In your blockstate you should state all variants. In your blockstate you might need to do different rotations because of how you setup the model. And the .json of the item of your block is in models/item is it? I am not a long time veteran of modding so if you have any further problems just ask them and also if you don't understand some parts ask abotu what they do instead of blindly copying. (Not saying that you do just to make sure.
  6. I have this problem with animating. That although using the partialTickTime it still fastens when with higher fps and lowers with less. AnimTimeRound is what i use for the animation. animTime += partialTickTime; animTimeRound = (float)((Math.round(animTime))*MAX_FRAMES_RATIO); if (animTime >= 1) { animTimeRound = animTimeRound-1; animTime = animTime-MAX_FRAMES; }
  7. When is use this.blockType.rotateBlock(worldObj, pos, facing) my tileentiy gets reorientated but it also removes al data. Should it do that. Or have i done something wrong?
  8. Thank you, that was indeed the problem. It's a bit unclear to me. If you do this for server client syncing what do you use Simple Network Wrapper for ?
  9. How would you do this with Simple Network Wrapper? I currently have this at getDescriptionPacket. PacketHandler.INSTANCE.getPacketFrom(new MessageTileEntityWashingTable(this));
  10. When joining my TESR doesn't update automatically based on the tileentity's values. This also happens when unloading chunks and reloading them again. Is this normal? Should I just check for it to update or should it do this automatically?
  11. Found the problem, i am still really confused. I changed a value on the client side only in onBlockActivated when i do it for both it works. But i don't know why it doesn't want to sync when server side only or client side only because i send a message when updating.
  12. Here it is. @SideOnly(Side.CLIENT) public class RendererWashingTable extends TileEntitySpecialRenderer<TileEntityWashingTable> { private static final ResourceLocation WATER_TEXTURE = new ResourceLocation("textures/blocks/water_still.png"); public void renderTileEntityAt(TileEntityWashingTable tileEntity, double x, double y, double z, float f, int destroyStage) { GL11.glPushMatrix(); GL11.glTranslated((float)x + 0.5f, y, (float)z + 0.5f); GL11.glScaled(0.5f, 0.5f, 0.5f); this.bindTexture(WATER_TEXTURE); renderWater(tileEntity); GL11.glPopMatrix(); } public void renderWater(TileEntityWashingTable tileEntityWashingTable) { int deviceWashTime = tileEntityWashingTable.getDeviceWashTime(); int waterAvailable = tileEntityWashingTable.getWaterAvailable(); if(deviceWashTime > 0) { final double[] beginVertices = {0.75, 2}; final double[] midVertices = {0.75, 1.875}; final double[] endVertices = {0.125, 1.5}; double x ; double y ; double a = (endVertices[1]-midVertices[1]/endVertices[0]-midVertices[0]); double b = (endVertices[0]*midVertices[1]-endVertices[1]*midVertices[0]/endVertices[0]-midVertices[0]); double washScale = (100 - (double)tileEntityWashingTable.getDeviceWashTime())/ 100; double height = beginVertices[1] - endVertices[1]; y = beginVertices[1] - (height * washScale); if(y <= midVertices[1] && y >= endVertices[1]) { x = Math.abs((y-b)/a); } else { x = beginVertices[0]; } RenderHelper.disableStandardItemLighting(); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBegin(GL11.GL_TRIANGLES); GL11.glTexCoord2d(0, 0); GL11.glVertex3d(x, y, x); GL11.glTexCoord2d(0, 0.0234375); GL11.glVertex3d(x, y, -x); GL11.glTexCoord2d(0.75, 0); GL11.glVertex3d(-x, y, x); GL11.glTexCoord2d(0.75, 0); GL11.glVertex3d(-x, y, x); GL11.glTexCoord2d(0, 0.0234375); GL11.glVertex3d(x, y, -x); GL11.glTexCoord2d(0.75, 0.0234375); GL11.glVertex3d(-x, y, -x); GL11.glTexCoord2d(0, 0); GL11.glVertex3d(0.125, 1.5, 0.125); GL11.glTexCoord2d(0.125, 0); GL11.glVertex3d(-0.125, 1.5, 0.125); GL11.glTexCoord2d(0, 0.03125); GL11.glVertex3d(0.125, 0.125, 0.125); GL11.glTexCoord2d(0, 0.03125); GL11.glVertex3d(0.125, 0.125, 0.125); GL11.glTexCoord2d(0.125, 0); GL11.glVertex3d(-0.125, 1.5, 0.125); GL11.glTexCoord2d(0.125, 0.03125); GL11.glVertex3d(-0.125, 0.125, 0.125); GL11.glTexCoord2d(0, 0); GL11.glVertex3d(0.125, 1.5, 0.125); GL11.glTexCoord2d(0, 0.03125); GL11.glVertex3d(0.125, 0.125, 0.125); GL11.glTexCoord2d(0.125, 0); GL11.glVertex3d(0.125, 1.5, -0.125); GL11.glTexCoord2d(0, 0.03125); GL11.glVertex3d(0.125, 0.125, 0.125); GL11.glTexCoord2d(0.125, 0.03125); GL11.glVertex3d(0.125, 0.125, -0.125); GL11.glTexCoord2d(0.125, 0); GL11.glVertex3d(0.125, 1.5, -0.125); GL11.glTexCoord2d(0, 0); GL11.glVertex3d(-0.125, 1.5, -0.125); GL11.glTexCoord2d(0.125, 0); GL11.glVertex3d(0.125, 1.5, -0.125); GL11.glTexCoord2d(0, 0.03125); GL11.glVertex3d(-0.125, 0.125, -0.125); GL11.glTexCoord2d(0, 0.03125); GL11.glVertex3d(-0.125, 0.125, -0.125); GL11.glTexCoord2d(0.125, 0); GL11.glVertex3d(0.125, 1.5, -0.125); GL11.glTexCoord2d(0.125, 0.03125); GL11.glVertex3d(0.125, 0.125, -0.125); GL11.glTexCoord2d(0, 0); GL11.glVertex3d(-0.125, 1.5, -0.125); GL11.glTexCoord2d(0, 0.03125); GL11.glVertex3d(-0.125, 0.125, -0.125); GL11.glTexCoord2d(0.125, 0); GL11.glVertex3d(-0.125, 1.5, 0.125); GL11.glTexCoord2d(0, 0.03125); GL11.glVertex3d(-0.125, 0.125, -0.125); GL11.glTexCoord2d(0.125, 0.03125); GL11.glVertex3d(-0.125, 0.125, 0.125); GL11.glTexCoord2d(0.125, 0); GL11.glVertex3d(-0.125, 1.5, 0.125); GL11.glTexCoord2d(0, 0); GL11.glVertex3d(0.625, 0.125+(height * washScale) , 0.625); GL11.glTexCoord2d(0, 0.01953125); GL11.glVertex3d(0.625, 0.125+(height * washScale), -0.625); GL11.glTexCoord2d(0.625, 0); GL11.glVertex3d(-0.625, 0.125+(height * washScale), 0.625); GL11.glTexCoord2d(0.625, 0); GL11.glVertex3d(-0.625, 0.125+(height * washScale), 0.625); GL11.glTexCoord2d(0, 0.01953125); GL11.glVertex3d(0.625, 0.125+(height * washScale), -0.625); GL11.glTexCoord2d(0.625, 0.01953125); GL11.glVertex3d(-0.625, 0.125+(height * washScale), -0.625); GL11.glEnd(); GL11.glDisable(GL11.GL_BLEND); RenderHelper.enableStandardItemLighting(); } if(waterAvailable == 3) { RenderHelper.disableStandardItemLighting(); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBegin(GL11.GL_TRIANGLES); GL11.glTexCoord2d(0, 0); GL11.glVertex3d(0.625, 0.625, 0.625); GL11.glTexCoord2d(0, 0.01953125); GL11.glVertex3d(0.625, 0.625, -0.625); GL11.glTexCoord2d(0.625, 0); GL11.glVertex3d(-0.625, 0.625, 0.625); GL11.glTexCoord2d(0.625, 0); GL11.glVertex3d(-0.625, 0.625, 0.625); GL11.glTexCoord2d(0, 0.01953125); GL11.glVertex3d(0.625, 0.625, -0.625); GL11.glTexCoord2d(0.625, 0.01953125); GL11.glVertex3d(-0.625, 0.625, -0.625); GL11.glEnd(); GL11.glDisable(GL11.GL_BLEND); RenderHelper.enableStandardItemLighting(); } } }
  13. I have this animation setup in the special renderer and it checks for changes in some variables to see if it should render it. But it only begins to render the animation when opening the GUI. I am sending the variables with a message and I'm also marking the block for update. I've searched around but i can't find the problem.
  14. Choonster was right, after seeing i made a mistake registering the render it worked. Thanks to the both of you.
  15. Well you have the getRenderType function where you set the render type. If you choose TESR, the .json model doesn't render.
  16. I want to render a .json model file in the special renderer because I only need to add a water draining effect. The other part .json model doesn't really need to be specially rendered. Is there a way to do this easily or should I just make the model with the tessellator and gl.
  17. I tried the first suggestion and it worked. I'm pretty new to modding, so thanks for the quick replies you both.
  18. So i tried setting eclipse up for mod developing. But i can't run it because there is no run button.
×
×
  • Create New...

Important Information

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