Jump to content

Enkey

Members
  • Posts

    58
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new modder!

Enkey's Achievements

Stone Miner

Stone Miner (3/8)

2

Reputation

  1. They are missing so I don't think they are downloaded
  2. Thanks, that kinda worked, but it only downloaded CCL and ForgeMultipart I added this to build.gradle maven { name 'CB Repo' url "http://chickenbones.net/maven/" } compile "codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev" compile "codechicken:CodeChickenLib:1.7.10-1.1.3.140:src" compile "codechicken:CodeChickenCore:1.7.10-1.0.7.46:dev" compile "codechicken:CodeChickenCore:1.7.10-1.0.7.46:src" compile "codechicken:NotEnoughItems:1.7.10-1.0.5.111:dev" compile "codechicken:ForgeMultipart:1.7.10-1.1.0.297:dev" compile "codechicken:ForgeMultipart:1.7.10-1.1.0.297:src" and even no errors occured during gradle dependency downloading D:\***\forge_1.7.10>gradlew --refresh-dependencies eclipse **************************** Powered By MCP: http://mcp.ocean-labs.de/ Searge, ProfMobius, Fesh0r, R4wk, ZeuX, IngisKahn, bspkrs MCP Data version : unknown **************************** :eclipseClasspath Download http://files.minecraftforge.net/maven/codechicken/CodeChickenLib/1.7.10-1.1.3.140/CodeChickenLib-1.7.10-1.1.3.140-dev.jar Download http://files.minecraftforge.net/maven/codechicken/CodeChickenLib/1.7.10-1.1.3.140/CodeChickenLib-1.7.10-1.1.3.140-src.jar Download http://files.minecraftforge.net/maven/codechicken/ForgeMultipart/1.7.10-1.1.0.297/ForgeMultipart-1.7.10-1.1.0.297-dev.jar Download http://files.minecraftforge.net/maven/codechicken/ForgeMultipart/1.7.10-1.1.0.297/ForgeMultipart-1.7.10-1.1.0.297-src.jar :eclipseJdt :eclipseProject :eclipse BUILD SUCCESSFUL
  3. I am new to gradle. How do I then use it as library?
  4. I fixed even the second problem. I had to register the materials in Init phase not PreInit *facepalm*
  5. Okay I fixed it now, I didn't know that CCC won't download CCL automaticaly when it's not in /mods folder so I downloaded CCL manualy and added it the same way. Now I need to solve the second problem with the code. I don't know if I am doing it right, I just went trough Mekanism code to see how he's doing it. I tried to find some tutorial on it, but I only found tutorials for making custom microblocks, but I only need the normal ones (Cover, Panel, Slab, etc.)
  6. As I said I already tried that I've put it only in /lib and linked it as Library and it crashed like that. Not sure why is it crashing though, it should work even without the mods.
  7. Hey everyone, I'm making a simple mod which adds blocks and I want to make them cuttable into microblocks using Forge Multipart. From my research I found that all I need to do is register the blocks using MicroMaterialRegistry#registerMaterial, but I'm not sure if that is true. 1. Problem [sOLVED] (CCL must be downloaded manualy) I can't make the needed mods (CodeChickenCore, ForgeMultipart) to work inside eclipse. I followed a tutorial and downloaded the dev and src jars and put the dev jars into folder /eclipse/mods/ and the src jars into /lib folder in eclipse. I ran the Client inside eclipse and the mods were there and it was working, but then I added the dev jars as libraries (Java Build Path > Libraries > Add JARs) so I can make the microblocks. I ran Client again and when it's loading mods it says that CodeChickenCore is duplicate ([Client thread/ERROR]: Found a duplicate mod CodeChickenCore at [minecraft.jar, minecraft.jar]) I also tried putting the dev jars in /lib folder and adding them as libraries, but then it crashed because it couldn't find the mods 2. Problem [sOLVED] (you have to register the materials in Init phase not PreInit) Because I couldn't try the code in eclipse I built my mod into JAR and put it in a modpack with the needed mods (CodeChickenCore, ForgeMultipart) and it crashed because of NullPointerException I tried to make it so it doesn't require the ForgeMultipart, but work with it when it's installed, and that is working well. Without any other mods it works great, but with ForgeMultipart it crashes. Here is the important code: Main Mod class: BlocksInit.java MultipartRegistry.java Any help is appriciated Enkey
  8. Hello guys, I want my block (with custom model) when placed to world to rotate 90 degrees (rendered with TESR), but when I place all of the blocks rotates instead of the one I placed. So how do I make it to rotate only the block I placed? Thanks for help!
  9. [shadow=black,right]Are you tired of rendering each face of a cube separately when using Tessellator? Than use EasyTessellator! [/shadow] Made for 1.6.4, but probable works on earlier versions, too (let me know if you try it on some other version) What does it do? It renders all six sides of a cube with some parameters you give it with just one command! How to use the command: The command: void renderCube(double x, double y, double z, int xDim, int yDim, int zDim, int offsetU, int offsetV, Icon icon, int flag, int textureWidth, int textureHeight) Parameters: x - x position of the block in the world + position of the cube in the block (eg. x + 0.25 means that the cube would be offset by 4 pixels on x axis) y - same as x parameter, but for y axis z - same as x parameter, but for z axis xDim - dimension of the cube on x axis (in pixels) (means how big the cube will be) yDim - dimension of the cube on y axis (in pixels) (means how big the cube will be) zDim - dimension of the cube on z axis (in pixels) (means how big the cube will be) offsetU - horizontal texture offset (in pixels) offsetV - vertical texture offset (in pixels) icon - texture to use to render the cube flags - changes how the texture will be used (more information below) textureWidth - the width of the texture (in pixels) textureHeight - the height of the texture (in pixels) If you are using default 16x16 texture you don't have to give the textureWidth and textureHeight parameters! Explanation of offsetU and offsetV: Img 1 (how it looks in some png texture file) Flags: 0 - all sides with same texture (see Img 1 above) 1 - 1 texture for top and bottom and 1 texture for sides (like bookshelf) Img 2 (the height of the top & bottom texture have to be same as zDim and the blue one as yDim) 2 - uses different texture for each side and when you have rotatable block you can use 3, 4 ,5 flags (rotates textures counterclockwise), but you have to change the position and dimensions of the cube yourself. Img 3 - this is how it is taking the textures from the file If you are rendering item the x,y,z are gonna be 0. How to use: 1. Download (below) 2. Put it somewhere in your src folder 3. When rendering block, item or something with tessellator, use EasyTess.renderCube(....); (You can of course render more cubes in 1 block) 4. Done Download: https://github.com/EnkeyMC/EasyTessellator/releases (green button called "EasyTess.java") GitHub Repository: https://github.com/EnkeyMC/EasyTessellator If you found some bug, have a suggestion or some problem just reply to this post! Author: Enkey (in-game EnkeyMC)
  10. Hello guys, I have a small problem. When I am rendering my block in inventory it's darker then when it's placed: I tried to use tessellator.setBrightness(...); , but it was even darker no matter how big the number was. Can you tell me what range of numbers the brightness has? Or am I doing something else wrong? Renderer class: package morelights.renderers; import org.lwjgl.opengl.GL11; import morelights.lib.Pix; import morelights.proxy.ClientProxy; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; public class ModernDecLampRenderer implements ISimpleBlockRenderingHandler { @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { Tessellator tes = Tessellator.instance; tes.startDrawingQuads(); tes.addTranslation(-0.5F, -0.3F, -0.5F); //tes.setBrightness(16); int x = 0; int y = 0; int z = 0; Icon icon = block.getIcon(0, 0); double minU = icon.getMinU(); double maxU = icon.getMaxU(); double minV = icon.getMinV(); double maxV = icon.getMaxV(); double p = (maxU - minU) / 32; double pv = (maxV - minV) / 32; //STAND this.renderPosZStand(tes, x, y, z, minU, maxU, minV, maxV, p, pv); this.renderNegZStand(tes, x, y, z, minU, maxU, minV, maxV, p, pv); this.renderPosXStand(tes, x, y, z, minU, maxU, minV, maxV, p, pv); this.renderNegXStand(tes, x, y, z, minU, maxU, minV, maxV, p, pv); this.rednerTopStand(tes, x, y, z, minU, maxU, minV, maxV, p, pv); //STAND2 this.renderPosZStand2(tes, x, y, z, minU, minV, p, pv); this.renderNegZStand2(tes, x, y, z, minU, minV, p, pv); this.renderPosXStand2(tes, x, y, z, minU, minV, p, pv); this.renderNegXStand2(tes, x, y, z, minU, minV, p, pv); //LIGHT this.renderPosZLight(tes, x, y, z, minU, minV, p, pv); this.renderNegZLight(tes, x, y, z, minU, minV, p, pv); this.renderPosXLight(tes, x, y, z, minU, minV, p, pv); this.renderNegXLight(tes, x, y, z, minU, minV, p, pv); this.renderTopLight(tes, x, y, z, minU, minV, p, pv); this.renderBottomLight(tes, x, y, z, minU, minV, p, pv); tes.addTranslation(0.5F, 0.3F, 0.5F); tes.draw(); } @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { Tessellator tes = Tessellator.instance; int lightValue = block.getMixedBrightnessForBlock(world, x, y, z); tes.setBrightness(lightValue); tes.setColorOpaque_F(1.0F, 1.0F, 1.0F); Icon icon = block.getIcon(0, 0); double minU = icon.getMinU(); double maxU = icon.getMaxU(); double minV = icon.getMinV(); double maxV = icon.getMaxV(); double p = (maxU - minU) / 32; double pv = (maxV - minV) / 32; //STAND this.renderPosZStand(tes, x, y, z, minU, maxU, minV, maxV, p, pv); this.renderNegZStand(tes, x, y, z, minU, maxU, minV, maxV, p, pv); this.renderPosXStand(tes, x, y, z, minU, maxU, minV, maxV, p, pv); this.renderNegXStand(tes, x, y, z, minU, maxU, minV, maxV, p, pv); this.rednerTopStand(tes, x, y, z, minU, maxU, minV, maxV, p, pv); //STAND2 this.renderPosZStand2(tes, x, y, z, minU, minV, p, pv); this.renderNegZStand2(tes, x, y, z, minU, minV, p, pv); this.renderPosXStand2(tes, x, y, z, minU, minV, p, pv); this.renderNegXStand2(tes, x, y, z, minU, minV, p, pv); //LIGHT this.renderPosZLight(tes, x, y, z, minU, minV, p, pv); this.renderNegZLight(tes, x, y, z, minU, minV, p, pv); this.renderPosXLight(tes, x, y, z, minU, minV, p, pv); this.renderNegXLight(tes, x, y, z, minU, minV, p, pv); this.renderTopLight(tes, x, y, z, minU, minV, p, pv); this.renderBottomLight(tes, x, y, z, minU, minV, p, pv); return true; } private void renderBottomLight(Tessellator tes, int x, int y, int z, double minU, double minV, double p, double pv) { double X = x + Pix.FOUR + (Pix.ONE/2); double Z = z + Pix.FOUR + (Pix.ONE/2); double Y = y + Pix.FIVE; minU += 21*p; minV += 16*pv; double maxU = minU + 7*p; double maxV = minV + 7*pv; tes.addVertexWithUV(X, Y, Z, minU, minV); tes.addVertexWithUV(X + Pix.SEVEN, Y, Z, maxU, minV); tes.addVertexWithUV(X + Pix.SEVEN, Y, Z + Pix.SEVEN, maxU, maxV); tes.addVertexWithUV(X, Y, Z + Pix.SEVEN, minU, maxV); } private void renderTopLight(Tessellator tes, int x, int y, int z, double minU, double minV, double p, double pv) { double X = x + Pix.FOUR + (Pix.ONE/2); double Z = z + Pix.FOUR + (Pix.ONE/2); double Y = y + Pix.TWELVE; minV += 16*pv; double maxU = minU + 7*p; double maxV = minV + 7*pv; tes.addVertexWithUV(X, Y, Z + Pix.SEVEN, minU, maxV); tes.addVertexWithUV(X + Pix.SEVEN, Y, Z + Pix.SEVEN, maxU, maxV); tes.addVertexWithUV(X + Pix.SEVEN, Y, Z, maxU, minV); tes.addVertexWithUV(X, Y, Z, minU, minV); } private void renderNegXLight(Tessellator tes, int x, int y, int z, double minU, double minV, double p, double pv) { double X = x + Pix.ELEVEN + (Pix.ONE/2); double Y = y + Pix.FIVE; double Z = z + Pix.ELEVEN + (Pix.ONE/2); minU += 14*p; minV += 17*pv; double maxU = minU + 7*p; double maxV = minV + 7*pv; tes.addVertexWithUV(X, Y, Z - Pix.SEVEN, maxU, minV); tes.addVertexWithUV(X, Y + Pix.SEVEN, Z - Pix.SEVEN, maxU, maxV); tes.addVertexWithUV(X, Y + Pix.SEVEN, Z, minU, maxV); tes.addVertexWithUV(X, Y, Z, minU, minV); } private void renderPosXLight(Tessellator tes, int x, int y, int z, double minU, double minV, double p, double pv) { double X = x + Pix.FOUR + (Pix.ONE/2); double Y = y + Pix.FIVE; double Z = z + Pix.ELEVEN + (Pix.ONE/2); minU += 7*p; minV += 17*pv; double maxU = minU + 7*p; double maxV = minV + 7*pv; tes.addVertexWithUV(X, Y, Z, minU, minV); tes.addVertexWithUV(X, Y + Pix.SEVEN, Z, minU, maxV); tes.addVertexWithUV(X, Y + Pix.SEVEN, Z - Pix.SEVEN, maxU, maxV); tes.addVertexWithUV(X, Y, Z - Pix.SEVEN, maxU, minV); } private void renderNegZLight(Tessellator tes, int x, int y, int z, double minU, double minV, double p, double pv) { double X = x + Pix.FOUR + (Pix.ONE/2); double Y = y + Pix.FIVE; double Z = z + Pix.ELEVEN + (Pix.ONE/2); minU += 14*p; minV += 10*pv; double maxU = minU + 7*p; double maxV = minV + 7*pv; tes.addVertexWithUV(X + Pix.SEVEN, Y, Z, maxU, minV); tes.addVertexWithUV(X + Pix.SEVEN, Y + Pix.SEVEN, Z, maxU, maxV); tes.addVertexWithUV(X, Y + Pix.SEVEN, Z, minU, maxV); tes.addVertexWithUV(X, Y, Z, minU, minV); } private void renderPosZLight(Tessellator tes, int x, int y, int z, double minU, double minV, double p, double pv) { double X = x + Pix.FOUR + (Pix.ONE/2); double Y = y + Pix.FIVE; double Z = z + Pix.FOUR + (Pix.ONE/2); minU += 7*p; minV += 10*pv; double maxU = minU + 7*p; double maxV = minV + 7*pv; tes.addVertexWithUV(X, Y, Z, minU, minV); tes.addVertexWithUV(X, Y + Pix.SEVEN, Z, minU, maxV); tes.addVertexWithUV(X + Pix.SEVEN, Y + Pix.SEVEN, Z, maxU, maxV); tes.addVertexWithUV(X + Pix.SEVEN, Y, Z, maxU, minV); } private void renderNegXStand2(Tessellator tes, int x, int y, int z, double minU, double minV, double p, double pv) { double X = x + Pix.TEN; double Y = y + Pix.TWO; double Z = z + Pix.TEN; minU += 20*p; minV += 2*pv; double maxU = minU + 4*p; double maxV = minV + 4*pv; tes.addVertexWithUV(X, Y, Z - Pix.FOUR, maxU, minV); tes.addVertexWithUV(X, Y + Pix.FOUR, Z - Pix.FOUR, maxU, maxV); tes.addVertexWithUV(X, Y + Pix.FOUR, Z, minU, maxV); tes.addVertexWithUV(X, Y, Z, minU, minV); } private void renderPosXStand2(Tessellator tes, int x, int y, int z, double minU, double minV, double p, double pv) { double X = x + Pix.SIX; double Y = y + Pix.TWO; double Z = z + Pix.TEN; minU += 12*p; minV += 2*pv; double maxU = minU + 4*p; double maxV = minV + 4*pv; tes.addVertexWithUV(X, Y, Z, minU, minV); tes.addVertexWithUV(X, Y + Pix.FOUR, Z, minU, maxV); tes.addVertexWithUV(X, Y + Pix.FOUR, Z - Pix.FOUR, maxU, maxV); tes.addVertexWithUV(X, Y, Z - Pix.FOUR, maxU, minV); } private void renderNegZStand2(Tessellator tes, int x, int y, int z, double minU, double minV, double p, double pv) { double X = x + Pix.SIX; double Y = y + Pix.TWO; double Z = z + Pix.TEN; minU += 16*p; minV += 2*pv; tes.addVertexWithUV(X + Pix.FOUR, Y, Z, minU + 4*p, minV); tes.addVertexWithUV(X + Pix.FOUR, Y + Pix.FOUR, Z, minU + 4*p, minV + 4*pv); tes.addVertexWithUV(X, Y + Pix.FOUR, Z, minU, minV + 4*pv); tes.addVertexWithUV(X, Y, Z, minU, minV); } private void renderPosZStand2(Tessellator tes, int x, int y, int z, double minU, double minV, double p, double pv) { double X = x + Pix.SIX; double Y = y + Pix.TWO; double Z = z + Pix.SIX; minU += 8*p; minV += 2*pv; tes.addVertexWithUV(X, Y, Z, minU, minV); tes.addVertexWithUV(X, Y + Pix.FOUR, Z, minU, minV + 4*pv); tes.addVertexWithUV(X + Pix.FOUR, Y + Pix.FOUR, Z, minU + 4*p, minV + 4*pv); tes.addVertexWithUV(X + Pix.FOUR, Y, Z, minU + 4*p, minV); } private void rednerTopStand(Tessellator tes, int X, int Y, int Z, double minU, double maxU, double minV, double maxV, double p, double pv) { double x = X + Pix.FOUR; double z = Z + Pix.FOUR; double y = Y + Pix.TWO; minV += 2*pv; tes.addVertexWithUV(x, y, z + Pix.EIGHT, minU + 8*p, minV); tes.addVertexWithUV(x + Pix.EIGHT, y, z + Pix.EIGHT, minU, minV); tes.addVertexWithUV(x + Pix.EIGHT, y, z, minU, minV + 8*pv); tes.addVertexWithUV(x, y, z, minU + 8*p, minV + 8*pv); } private void renderNegXStand(Tessellator tes, int X, int y, int Z, double minU, double maxU, double minV, double maxV, double p, double pv) { double x = X + Pix.FOUR; double z = Z + Pix.TWELVE; minU += 24*p; tes.addVertexWithUV(x, y, z, minU, minV + 2*pv); tes.addVertexWithUV(x, y + Pix.TWO, z, minU, minV); tes.addVertexWithUV(x, y + Pix.TWO, z - Pix.EIGHT, minU + 8*p, minV); tes.addVertexWithUV(x, y, z - Pix.EIGHT, minU + 8*p, minV + 2*pv); } private void renderPosXStand(Tessellator tes, int X, int y, int Z, double minU, double maxU, double minV, double maxV, double p, double pv) { double x = X + Pix.TWELVE; double z = Z + Pix.TWELVE; minU += 8*p; tes.addVertexWithUV(x, y, z - Pix.EIGHT, minU + 8*p, minV + 2*pv); tes.addVertexWithUV(x, y + Pix.TWO, z - Pix.EIGHT, minU + 8*p, minV); tes.addVertexWithUV(x, y + Pix.TWO, z, minU, minV); tes.addVertexWithUV(x, y, z, minU, minV + 2*pv); } private void renderNegZStand(Tessellator tes, int x, int y, int z, double minU, double maxU, double minV, double maxV, double p, double pv) { double offX = x + Pix.FOUR; double offZ = z + Pix.TWELVE; tes.addVertexWithUV(offX + Pix.EIGHT, y, offZ, minU + 8*p, minV +2*pv); tes.addVertexWithUV(offX + Pix.EIGHT, y + Pix.TWO, offZ, minU + 8*p, minV); tes.addVertexWithUV(offX, y + Pix.TWO, offZ, minU, minV); tes.addVertexWithUV(offX, y, offZ, minU, minV + 2*pv); } private void renderPosZStand(Tessellator tes, int x, int y, int z, double minU, double maxU, double minV, double maxV, double p, double pv) { double offX = x + Pix.FOUR; double offZ = z + Pix.FOUR; minU += 16*p; tes.addVertexWithUV(offX, y, offZ, minU, minV + 2*pv); tes.addVertexWithUV(offX, y + Pix.TWO, offZ, minU, minV); tes.addVertexWithUV(offX + Pix.EIGHT, y + Pix.TWO, offZ, minU + 8*p, minV); tes.addVertexWithUV(offX + Pix.EIGHT, y, offZ, minU + 8*p, minV +2*pv); } @Override public boolean shouldRender3DInInventory() { return true; } @Override public int getRenderId() { return ClientProxy.ModernDecLampType; } }
  11. Thats probably, because vanilla portal acts the same way when you place it by hand. Maybe try to look how minecraft generates the portal.
  12. Thanks! I didn't know it works like that EDIT: Can I rename the topic? If not, can someone rename it to [sOLVED] ?
  13. I've already done that Actual code: package morelights.renderers; import org.lwjgl.opengl.GL11; import morelights.lib.Reference; import morelights.proxy.ClientProxy; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.ResourceLocation; import net.minecraft.world.IBlockAccess; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; public class LEDStripRenderer implements ISimpleBlockRenderingHandler { @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { } @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { Tessellator tes = Tessellator.instance; int lightValue = block.getMixedBrightnessForBlock(world, x, y, z); tes.setBrightness(lightValue); tes.setColorOpaque_F(1.0F, 1.0F, 1.0F); ResourceLocation texture = (new ResourceLocation(Reference.modid + ":textures/models/LEDStrip.png")); Minecraft.getMinecraft().getTextureManager().bindTexture(texture); tes.addVertexWithUV(0, 0, 0, 0, 1); tes.addVertexWithUV(0, 1, 0, 0, 0); tes.addVertexWithUV(0, 1, 1, 1, 0); tes.addVertexWithUV(0, 0, 1, 1, 1); Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture); return true; } @Override public boolean shouldRender3DInInventory() { return true; } @Override public int getRenderId() { return ClientProxy.LEDStripRenderType; } }
  14. Well it's almost the same as I did it before and this is binding the texture map for vanilla blocks (and even then there is no texture). But now I know why it was doing that glitch where blocks didn't have texture. It was because I was binding my texture, but then it using it for every block in that chunk. So I have just put Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture); when I finished rendering my block and it's not doing that glitch, but my block is still not rendering (or doesn't have texture)
×
×
  • Create New...

Important Information

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