Jump to content

larsgerrits

Members
  • Posts

    3462
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by larsgerrits

  1. Sorry for that, little unclear. I mean, only if you are holding birch wood, it would go into the if-statement, else it shouldn't.
  2. Ok, that method is called for EVERY time you right click on the block. But it shouldn't go inside the if-statement.
  3. Full method, so including the method name and its signatures.
  4. Show the full method with that if-statement. The method is probably run for EVERYTHING, and if you check for birch wood, it should only go inside that if-statement if so.
  5. You mean, it goes inside the if statements, as it shouldn't. But the method you have that if statement in, of course it will run it for every type of wood because you haven't checked for birch specifically.
  6. Just go into the Reference Libraries section of the project and then look at the forgesrc libraries for all Minecrafts code.
  7. hand.getItemDamage() == birch damage Hard???
  8. If you have a Gui extending GuiScreen, you don't need an inventory at all. Just leave the getServerGuiElement returning null and call player.openGui() on the client side, instead of the server side.
  9. 1) hand can be null, so check if it's not before calling hand.getItem() 2) you can't compare Items to Blocks. Use hand.getItem() == Item.getItemFromBlock(Blocks.log) . 3) if you can check if hand.getItemDamage() is the damage of birch wood.
  10. You can check the surroundings with it, and if there's no block next to it, draw a line on the side, else don't.
  11. Run setupDecompWorkspace instead of setupDevWorkspace .
  12. Put a breakpoint in NetHandlerPlayServer:657, and see which one of the parameters of S2FPacketSetSlot is null.
  13. First, remove the "assets/" piece from your resource location. Second, you want to use the ResourceLocation contructor that requires 2 Strings, the modid and the pth, like so: new ResourceLocation(ModMain.MODID, "textures/gui/GUI_Smasher.png"); .
  14. Right now, you only count the possibilities for 4 sides, like if you look at it from the side, you check for up,down,left,right. But you also want to check for up-right,up-left,down-right,down-left. That makes a lot more textures (47). But of course, an ISBRH, it drops down to 2 textures.
  15. Or you could use an ISBRH, that would significantly drop down the amount of textures needed (from 47 to 2).
  16. I saw a few people have trouble with IntelliJ 14 and Forge. Try downgrading to IntelliJ 13, as that helped for a few people.
  17. Show your main mod file.
  18. The vanilla door uses the 3 pixels on the side of the fron texture for the sides, and as you have 1 row with glass, it draws that on the side. You might be able to just do a side and a top texture, but it would require some knowledge of the BlockDoor class.
  19. For the fluid displaying in the gui, I use this code (from TE3). It is somewhat complicated, but not to hard: public static void drawFluidTank(IFluidTank tank, int x, int y) { FluidStack fluid = tank.getFluid(); //Gets the FluidStack from the tank TextureManager manager = Minecraft.getMinecraft().renderEngine; //Gets the TextureManager if (fluid != null) //Check if the fluid is no null i.e. there is something in the tank { manager.bindTexture(manager.getResourceLocation(0)); //Bind the blocks texture map float amount = fluid.amount; //The amount of fluid in the tank float capacity = tank.getCapacity(); //The max capacity of the tank float scale = amount / capacity; // The 'scale' of the fluid, ranging from 0 to 1, with 0 being empty, and 1 being full int fluidTankHeight = 60; // The max height of which the fluid can be drawed, i use 60, so the fluid is drawn max 60 pixels high int fluidAmount = (int) (scale * fluidTankHeight); // The amount of pixels the fluid has to be drawn on drawFluid(x, y + fluidTankHeight - fluidAmount, fluid.getFluid().getIcon(fluid), 16, fluidAmount); //Actually draw the fluid } } private static void drawFluid(int x, int y, IIcon icon, int width, int height) { int i = 0; int j = 0; int drawHeight = 0; int drawWidth = 0; for (i = 0; i < width; i += 16) // Loop through the width, with steps of 16 { for (j = 0; j < height; j += 16) // Loop through the height, with steps of 16 { drawWidth = Math.min(width - i, 16); // The draw width, for how much of the icon has to be drawn from drawHeight = Math.min(height - j, 16); // The draw height, for how much of the icon has to be drawn from drawRectangleFromIcon(x + i, y + j, icon, drawWidth, drawHeight); //Actually draw (part of) the icon on the gui } } } private static void drawRectangleFromIcon(int x, int y, IIcon icon, int width, int height) { if (icon == null) return; //Make sure the IIcon is nut null double minU = icon.getMinU(); //The minimun U-coordinate double maxU = icon.getMaxU(); //The maximum U-coordinate double minV = icon.getMinV(); //The minimun V-coordinate double maxV = icon.getMaxV(); //The maximum V-coordinate Tessellator tessellator = Tessellator.instance; //Get the Tessellator tessellator.startDrawingQuads(); //Start drawing a rectangle tessellator.addVertexWithUV(x + 0, y + height, 0, minU, minV + (maxV - minV) * height / 16.0D); // First vertex on the screen tessellator.addVertexWithUV(x + width, y + height, 0, minU + (maxU - minU) * width / 16.0D, minV + (maxV - minV) * height / 16.0D);// Secons vertex on the screen tessellator.addVertexWithUV(x + width, y + 0, 0, minU + (maxU - minU) * width / 16.0D, minV);// Third vertex on the screen tessellator.addVertexWithUV(x + 0, y + 0, 0, minU, minV);// Fourth vertex on the screen tessellator.draw(); //Draw everything on the Tessellator (the four vertices) } I suggest you actually read the comments on it, or else you won't learn anything from it.
  20. Show your updated code.
  21. In your fill method, you can check if FluidStack#fluid==FluidRegistry.WATER/tt].
  22. Take a look at the TileFluidHandler class provided as an example by Forge.
  23. Maybe there's something in vanilla that does that? (Hint: coal ore, uses the BlockOre class).
  24. @NetworkMod doesn't exist anymore. You don't need anything in place of it.
×
×
  • Create New...

Important Information

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