Jump to content

drok0920

Forge Modder
  • Posts

    443
  • Joined

  • Last visited

Everything posted by drok0920

  1. Nevermind i figured it out i had to use worldIn.getChunkFromBlockCoords(pos).getBiomeArray()[index] = (byte) Biome.getIdForBiome(Biomes.COLD_TAIGA); instead.
  2. Im an idiot and forgot to post it so here it is http://pastebin.com/Xueb4Fjq
  3. It crashes when i use this code im sure its because of how im setting the biome but im not sure how i should do it. worldIn.getChunkFromBlockCoords(pos).getBiomeArray()[index] = (byte) Biome.getIdForBiome(new BiomeSnow(true, null));
  4. I havent tested it but i dont beleieve you do.
  5. If you want to spawn an entity at a specific position you should use: EntityCow cow = new EntityCow(world); cow.setPosition(x, y, z);
  6. So i am making a mod to make building in survival easier and i am working on an item that changes the biome of the block right clicked. I have searched on google and on the forums but i havent found a way to change the biome after world generation. As far as I know minecraft doesnt normally do this so i dont know if it's even possible. Any suggestions would be nice.
  7. Thanks that was the issue.
  8. I added this to my Init Method but it doesnt seem to work. What am i doing wrong? final BlockColors blockcolors = new BlockColors(); blockcolors.registerBlockColorHandler(new IBlockColor() { public int colorMultiplier(IBlockState state, @Nullable IBlockAccess worldIn, @Nullable BlockPos pos, int tintIndex) { return worldIn != null && pos != null ? BiomeColorHelper.getGrassColorAtPos(worldIn, pos) : ColorizerGrass.getGrassColor(0.5D, 1.0D); } }, new Block[] {ModBlocks.mossyStone});
  9. Hello, I have been working on a mod for a bit now and i have tried to create a custom block that chagned color based on biome. I have gotten the overlay to work but i can't find a way to change the color. Here is what i have so far:
  10. Ok so i tried just using Items.wooden_pickaxe = flint_pickaxe; to override the class it uses with no success. It gives an error: "The final field Items.wooden_pickaxe cannot be assigned". I know this means it cannot be assigned to so is there a better way to do this?
  11. I can't believe i didnt think of doing that thank you! However i would still like to know if there is a way to override it with my own class/add a tile entity to the block.
  12. I'm trying to make a mod that changes the properties of vanilla blocks. I would like to replace them with my own class if possible or at least change thier harvest level. I have read the solution here: http://www.minecraftforge.net/forum/index.php?topic=7866.0 but it doesnt seem to work any more and the only other solution i have found use reflection or some similar method to achieve it. Thanks
  13. Ok so i fixed that issue and i can load the textures of the items being processed but it only uses the texture of the most recently bound texture. Is there a way to fix this? My current code: if(tile.getItemSize() != 0) { for(Item item : tile.getItemArray()) { System.out.println("Adding Item with Index: " + i); float itemx = -(tile.items.size() / 2) + i; float itemy = 0; this.bindTexture(new ResourceLocation("minecraft", "textures/items/" + item.getUnlocalizedName().substring(5) + ".png")); worldRenderer.pos(itemx, 2, 0).tex(0, 0).endVertex(); worldRenderer.pos(itemx + 1, 2, 0).tex(1, 0).endVertex(); worldRenderer.pos(itemx + 1, 3, 0).tex(1, 1).endVertex(); worldRenderer.pos(itemx, 3, 0).tex(0, 1).endVertex(); i++; } }
  14. Well after reading your response it is obvious to me that i dont know what im doing but here is what i have so far:
  15. Any idea what the problem could be?
  16. Thank you i didnt think that it would work on that but I found it. Its a private variable but you can use Minecraft.getMinecraft.getRenderManager() to get it. My new problem is that when i cast the tile entity given to me by the method to my tileentity its not the right instance. I have a list of items stored in it that i can access from onBlockActivated in my block class but the size of it doesnt match the size of the one I get in the TileEntitySpecialRenderer.
  17. I already checked that and it appears to be asigned in the constructor of the Render class and i dont know where that is called for RenderSnowball.
  18. It is RenderManager why? It doesnt help me very much as i dont know what variables to use when making a new instance.
  19. Thanks that worked great but now how can i get the quad to always face the player? I looked at RenderSnowball and found that it uses GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); but i dont see a way to use that in a tile entity renderer(the this.rendermanager part).
  20. Well I believe I found the methods but when i add that second vertex(call putPosition the second time) it crashes and throws an index out of bounds exception My code: @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) { this.bindTexture(TextureMap.locationBlocksTexture); WorldRenderer worldRenderer = new WorldRenderer(256); GL11.glPushMatrix(); GL11.glTranslated(x, y+1, z); // +1 so that our "drawing" appears 1 block over our block (to get a better view); VertexFormat vf = new VertexFormat(); worldRenderer.begin(GL11.GL_QUADS, vf); worldRenderer.putPosition(0, 0, 0); worldRenderer.putPosition(1, 0, 0); worldRenderer.putPosition(1, 0, 1); worldRenderer.putPosition(0, 0, 1); worldRenderer.addVertexData(new int[]{0, 1, 2, 2, 3, 0}); worldRenderer.finishDrawing(); GL11.glPopMatrix(); } Error:
  21. They appear to not be in there either. I get errors on the same lines and cant find anything in that class that could be an equivalent to those methods. Am I doing something wrong? @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) { // locationBlocksTexture is a "ResourceLocation" that points to a texture made of many block "icons". // It will look very ugly, but creating our own ResourceLocation is beyond the scope of this tutorial. this.bindTexture(TextureMap.locationBlocksTexture); WorldRenderer worldRenderer = new WorldRenderer((256)); GL11.glPushMatrix(); GL11.glTranslated(x, y+1, z); // +1 so that our "drawing" appears 1 block over our block (to get a better view) worldRenderer.startDrawingQuads(); worldRenderer.addVertexWithUV(0, 0, 0, 0, 0); worldRenderer.addVertexWithUV(0, 1, 0, 0, 1); worldRenderer.addVertexWithUV(1, 1, 0, 1, 1); worldRenderer.addVertexWithUV(1, 0, 0, 1, 0); worldRenderer.addVertexWithUV(0, 0, 0, 0, 0); worldRenderer.addVertexWithUV(1, 0, 0, 1, 0); worldRenderer.addVertexWithUV(1, 1, 0, 1, 1); worldRenderer.addVertexWithUV(0, 1, 0, 0, 1); worldRenderer.draw(); GL11.glPopMatrix(); }
  22. My issue is that tessellator.startDrawingQuads(); and tessellator.addVertexWithUV(0, 0, 0, 0, 0); give errors. They give a "The method [name] is undefined for the type Tesselator". I know this means the method no longer exists. So my question is what is the equivalent to this/should i use a new approach, if so what.
  23. I believe i understand most of it but i cant tell you exactly how it works:
  24. Here is what i have trie from the wiki mixed with the RenderItemFrame class, i commented out code that i believe i dont need at the moment. Edit: Changed it to what the wiki suggests(modified slightly): @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage) { // locationBlocksTexture is a "ResourceLocation" that points to a texture made of many block "icons". // It will look very ugly, but creating our own ResourceLocation is beyond the scope of this tutorial. this.bindTexture(TextureMap.locationBlocksTexture); Tessellator tessellator = Tessellator.getInstance(); GL11.glPushMatrix(); GL11.glTranslated(x, y+1, z); // +1 so that our "drawing" appears 1 block over our block (to get a better view) tessellator.startDrawingQuads(); tessellator.addVertexWithUV(0, 0, 0, 0, 0); tessellator.addVertexWithUV(0, 1, 0, 0, 1); tessellator.addVertexWithUV(1, 1, 0, 1, 1); tessellator.addVertexWithUV(1, 0, 0, 1, 0); tessellator.addVertexWithUV(0, 0, 0, 0, 0); tessellator.addVertexWithUV(1, 0, 0, 1, 0); tessellator.addVertexWithUV(1, 1, 0, 1, 1); tessellator.addVertexWithUV(0, 1, 0, 0, 1); tessellator.draw(); GL11.glPopMatrix(); }
  25. Ok thank you but i still dont know how to render anything this way. Any tesselator tutorials i find are out dated as well. Could you please explain.
×
×
  • Create New...

Important Information

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