larsgerrits
Members-
Posts
3462 -
Joined
-
Last visited
-
Days Won
17
Everything posted by larsgerrits
-
Thats..... not how events work. You need to make a class and register it with MinecraftForge.EVENT_BUS.register(new YourClass()); . In that class make a method with the event as a parameter. Above the method, put the @SubscribeEvent annotation. Then you can do whatever you want with the event.
-
PlayerInteractEvent is a Forge event, not a ForgeModLoader event. You need to register it using MinecraftForge.EVENT_BUS.register();
-
The integer arrays are null. You need to initialize them.
-
You are missing a @EventHandler above youe FMLPreInitialization method.
-
[1.7.10] BreakBlockEvent doesn't seem to be firing
larsgerrits replied to XeliteXirish's topic in Modder Support
BlockEvent.* are MinecraftForge events, not ForgeModLoader events. You need to register them using MinecraftForge.EVENT_BUS.register(); -
Re: Anyone know how to make an inventory tank? [UNSOLVED]
larsgerrits replied to TheEpicTekkit's topic in Modder Support
In each of the TileEntites of the output blocks, get the masters TileEntity and then the tank you need to get, and cll those methods on that tank. For the input it is almosdt the same. -
Anyone know how to make an inventory tank? [UNSOLVED]
larsgerrits replied to TheEpicTekkit's topic in Modder Support
In the drawGuiContainerForegroundLayer method, the 2 integers that are passed in are the x and y-coordinate of the mouse. You can check if those coords are between certain coords, and if so, you can use the drawHoveringText() method. -
Anyone know how to make an inventory tank? [UNSOLVED]
larsgerrits replied to TheEpicTekkit's topic in Modder Support
The drawTexturedModalRect only accepts textures of which is the full size 256x256. You need to make your own method (copy the vanilla method) and change f and f1 to 1/imageSize (in your case 512), and call that method. -
Anyone know how to make an inventory tank? [UNSOLVED]
larsgerrits replied to TheEpicTekkit's topic in Modder Support
Somewhere in your gui code, you are using GL11.glScalef(). That messes stuff up. -
Anyone know how to make an inventory tank? [UNSOLVED]
larsgerrits replied to TheEpicTekkit's topic in Modder Support
Yes it will. And yes, by direction i mean the ForgeDirection passed, which is the side the block is that inputs the fluid into the tank. If it's a multiblock structure, you can just get the tank from the master, and call the methods in the master TileEntity. -
Anyone know how to make an inventory tank? [UNSOLVED]
larsgerrits replied to TheEpicTekkit's topic in Modder Support
Drawing the fluids is the difficult part. Here's some code that you can use (don'tcopy/paste, you won't learn from it then): In the drawGuiContainerBackgroundLayer method: FluidStack fluid = tileentity.getTankInfo(null)[0].fluid; if (fluid != null) { TextureManager manager = Minecraft.getMinecraft().renderEngine; manager.bindTexture(manager.getResourceLocation(0)); int fluidAmount = (int) (((float) fluid.amount / tileentity.tank.getCapacity()) * 60); drawFluid(guiLeft + xSize - 24, guiTop + 8 + 60 - fluidAmount, fluid.getFluid().getIcon(fluid), 16, fluidAmount); } the drawFluid method: private 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) { for (j = 0; j < height; j += 16) { drawWidth = Math.min(width - i, 16); drawHeight = Math.min(height - j, 16); drawScaledTexturedModelRectFromIcon(x + i, y + j, icon, drawWidth, drawHeight); } } } and the drawScaledTexturedModelRectFromIcon method: private void drawScaledTexturedModelRectFromIcon(int x, int y, IIcon icon, int width, int height) { if (icon == null) { return; } double minU = icon.getMinU(); double maxU = icon.getMaxU(); double minV = icon.getMinV(); double maxV = icon.getMaxV(); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(x + 0, y + height, this.zLevel, minU, minV + (maxV - minV) * height / 16.0D); tessellator.addVertexWithUV(x + width, y + height, this.zLevel, minU + (maxU - minU) * width / 16.0D, minV + (maxV - minV) * height / 16.0D); tessellator.addVertexWithUV(x + width, y + 0, this.zLevel, minU + (maxU - minU) * width / 16.0D, minV); tessellator.addVertexWithUV(x + 0, y + 0, this.zLevel, minU, minV); tessellator.draw(); } -
[1.7.2] Rebind a texture when button pressed?
larsgerrits replied to Bugzoo's topic in Modder Support
Here is a link to another post related to this (Hint: it's yours, don't make multiple threads for the same thing) -
Anyone know how to make an inventory tank? [UNSOLVED]
larsgerrits replied to TheEpicTekkit's topic in Modder Support
You can't have multiple return statements. You need to take a tank based on the direction given. -
Anyone know how to make an inventory tank? [UNSOLVED]
larsgerrits replied to TheEpicTekkit's topic in Modder Support
You only need to implements those if you want to create your own version of FluidTank, but else you can just use the already made FluidTank. -
Anyone know how to make an inventory tank? [UNSOLVED]
larsgerrits replied to TheEpicTekkit's topic in Modder Support
You could, but that makes it so it only has a FluidTank which can store a bucket full of liquid. Your best bet is to copy it, rather then extending it, so you can make the tank bigger, and you can customize it further. -
Anyone know how to make an inventory tank? [UNSOLVED]
larsgerrits replied to TheEpicTekkit's topic in Modder Support
The methods you need to implement by IFluidHandler are basicly wrapper methods for the IFluidTank class. You can just use the provided FluidTank class, which is already filled out, so you don't need to do that. As you can see in the TileFluidHandler class, most of the methods just call tank.aMethod(params), and more you don't need to know. If you really want to know how to fill these methods in, you need to study it yourself. -
Anyone know how to make an inventory tank? [UNSOLVED]
larsgerrits replied to TheEpicTekkit's topic in Modder Support
Take a look at the forge-provided 'TileFluidHandler', it is a reference-implementation. -
[1.7.10] Check if icon of two items is the same
larsgerrits replied to ipsq's topic in Modder Support
MinecraftForge mods can't be run in a Bukkt environment, so you don't have to worry about that. -
[1.7.10] Issues with Pipe connections (mechanical)
larsgerrits replied to Minothor's topic in Modder Support
In your getDescriptionPacket method, your writing twice to NBT. I don't know if that causes the issue, but you might want to fix it. -
SOLVED - Machine model wont face player [1.7.10]
larsgerrits replied to iLegendx98's topic in Modder Support
The onBlockPlacedBy is called if a entity has placed the block, and onBlockAdded will always be called when to block places, so need both if you want the block to be rotated if a machines places it. -
[1.7.10] Prevent pausing the game in the options screen
larsgerrits replied to DrD's topic in Modder Support
You could probably make your own Gui class extending the vanilla class, and override the doesGuiPausGame() method. Than you need to subscribe the the [/code]GuiOpenEvent[/code] and in that methd you set the GuiScreen variable to a new instance of your Gui. -
TileEntity problems!! Please Help! [SOLVED] [MC 1.7.10]
larsgerrits replied to TheEpicTekkit's topic in Modder Support
That's not a actual Java thing, it is used on the forums here to indicate that you need to call that method from a instance of that class, instead of directly like it was a static method. -
You can store it in the ItemStacks stackTagCompound.