
KeeganDeathman
Forge Modder-
Posts
434 -
Joined
-
Last visited
Everything posted by KeeganDeathman
-
What happened to IFluidHandler? It's deprecated now, should I use the one in capabilities or is there a new system?
-
Oh, okay. Thank you.
-
In the leaves block class. As seen here: @Override public EnumType getWoodType(int meta) { // TODO Auto-generated method stub return (EnumType)BlockRubberLog.EnumType.Rubber; }
-
Create your own enum... I don't think I quite understand I did this public static enum EnumType implements IStringSerializable { Rubber(0, "rubber", MapColor.WOOD); private static final EnumType[] META_LOOKUP = new EnumType[values().length]; private final int meta; private final String name; private final String unlocalizedName; /** The color that represents this entry on a map. */ private final MapColor mapColor; private EnumType(int metaIn, String nameIn, MapColor mapColorIn) { this(metaIn, nameIn, nameIn, mapColorIn); } private EnumType(int metaIn, String nameIn, String unlocalizedNameIn, MapColor mapColorIn) { this.meta = metaIn; this.name = nameIn; this.unlocalizedName = unlocalizedNameIn; this.mapColor = mapColorIn; } public int getMetadata() { return this.meta; } /** * The color which represents this entry on a map. */ public MapColor getMapColor() { return this.mapColor; } public String toString() { return this.name; } public static EnumType byMetadata(int meta) { if (meta < 0 || meta >= META_LOOKUP.length) { meta = 0; } return META_LOOKUP[meta]; } public String getName() { return this.name; } public String getUnlocalizedName() { return this.unlocalizedName; } static { for (EnumType blockplanks$enumtype : values()) { META_LOOKUP[blockplanks$enumtype.getMetadata()] = blockplanks$enumtype; } } And I can't return from this enum because the method is looking for the one in BlockPlanks, and I can't cast it because it throws an error
-
In updating my mod from 1.7 to 1.10, I am faced with setting a wood EnumType in my leaves class. How can I set it to a custom enum? Is this just me being terrible at Enums?
-
[1.7.10] Call Tile Entity method on inventory update
KeeganDeathman posted a topic in Modder Support
Is there a way to have a method in the te run when there's a change in the container? Not like onClick in the gui. I need whenever something changes, like if a hopper connected. Any help? -
Recently(Half an hour ago) got back into modding. I left my main mod in a stateof ehhh though, as I was trying to make a TESR based fluid pipe. Simple right? Not really, as I can't get the fluid texture from the sprite sheet. I remember I have to bind the block sheet, and use the fluid iicon's UV coords But how do I tell the renderer to use those UV coords? Currently, I have Minecraft.getMinecraft().getTextureManager().bindTexture(Minecraft.getMinecraft().getTextureManager().getResourceLocation(fluid.getSpriteNumber())); Which is close, but no cigar(shows the fluid, the block to it's left, and the two below them.)
-
I had this in my 1.7.10 mod if(metadata > 3) To see if my furnace was burning. How would I do this in blockstate form?
-
Oh, I've done this recently! Basically, in your TESR and Block classes, in the rendering functions(renderTileEntityAt, isOpaqueCube, shouldSideBeRendered,etc) check the tile entity for a boolean method called isMultiblock or something. This will use worldObj.getBlock to check if the required blocks are not null, and the right blocks. Then, return if it is. Make sure you don't render the obj if it isn't multiblock, and you do render the blocks. Remember also to translate the model! Don't forget to also update the fake blocks. I'd suggest doing something along the lines of: if(te.isMultiblock() || te.isToldMultiblock) //don't render sides if(isMultiblock()) //render OBJ if(multiblockcode) //set blocks isToldMulitblock() And the model can be huge! But be careful on scale and don't go overboard with the vertices
-
As a result of a previous thread, I received: renderer.setRenderBounds(0,0,0,1,1,1); renderer.renderAllFaces = true; renderer.renderStandardBlock(fluid.getBlock(), entity.xCoord, entity.yCoord, entity.zCoord); as a way to create a fake block of water, I could shrink and position.However, I can't get it to work! The renderer variable is a instance of RenderBlocks I created in a method named func_147496_a. However, while when I wrap that last line of code in a println, it says it's rendering it, it isn't! Not that I see. Where do I put this? Also, I am planning on making some item transport pipes. Is there a method similar to the above to render items?
-
I've tried it before rendering the pipe, after, with and without binding TextureMap.locationBlocksTexture, and even commented out the pipe model rendering matrix. No fluid. Funny thing is, if I wrap the renderer.renderStandardBlock(...) in System.out.println(...), it prints true. So, where is it?
-
Okay. The configureSides function actually sets booleans that control whether a section is rendered.
-
The pipe's texture? Okay. BTW, they pipe isn't restricted to being straight, as you seem to have inferred.
-
You are a life saver. May the goddess be with you in your endevors. That said, your code doesn't appear to do much. Everything's synced on github if you want to find where I went horribly wrong.
-
Found out you can just do RenderBlocks renderer = new RenderBlocks(); So I did that, but I now get java.lang.NullPointerException: Rendering Block Entity at net.minecraft.block.BlockLiquid.colorMultiplier(BlockLiquid.java:77) at net.minecraft.client.renderer.RenderBlocks.renderBlockLiquid(RenderBlocks.java:4141) at keegan.labstuff.render.TileEntityRenderLiquidPipe.renderPipe(TileEntityRenderLiquidPipe.java:75) at keegan.labstuff.render.TileEntityRenderLiquidPipe.renderTileEntityAt(TileEntityRenderLiquidPipe.java:139) at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.renderTileEntityAt(TileEntityRendererDispatcher.java:141) at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.renderTileEntity(TileEntityRendererDispatcher.java:126) at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:539) at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1300) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1087) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067) at net.minecraft.client.Minecraft.run(Minecraft.java:962) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source)
-
I have looked every which way to sunday, and I can't figure out where that renderer variable comes from in your snippet. I think it's renderblocks.
-
What is the renderer variable refering to?
-
Yeah, i figured that out when i made a giant wall of water. Whoops.
-
That would suggest your trying to draw the whole texture rather than just the 16x16 image in the texture. The UV Coordinates determine the area of the texture that is used. How do I select the texture from the sheet?
-
https://github.com/KeeganDeathman/LabStuff/blob/82c42e5be99deb76eb5c5f7f7461791c2316c87a/main/java/keegan/LabStuff/render/TileEntityRenderLiquidPipe.java
-
I tried what the code you linked to did, but it renders as a smushed up sprite sheet in game still.
-
I ended up replacing the code with the east code and changed a few values. It's fixed now.
-
In my efforts to make a pipe, I am attempting to do a multi-layered texure. A pipe texture and a fluid texture. Since my pipe is open to all fluids, I am trying to be as vague as possible. I use the code mc.renderEngine.bindTexture(...); to set the texture of my TESR models. However, all I can find in the fluid is an IIcon. Is there a way to convert this to resource location, or a different version of bindTexture that excepts IIcons?
-
[CHAT] Network is holding -1540044424 [16:21:19] [Client thread/INFO]: [CHAT] Network is holding -1540044424 [16:21:19] [Client thread/INFO]: [CHAT] Network is holding -403279352 [16:21:20] [Client thread/INFO]: [CHAT] Network is holding -171803008