Jump to content

JohnnyMccurm

Members
  • Posts

    37
  • Joined

  • Last visited

Everything posted by JohnnyMccurm

  1. I forgot to add a filetype, the texture is still broken, and no error to help out sadly.
  2. Hey. I have kind a weird issue. I was trying to make a 3D block, and I did...kinda. but when the block is placed, it has the weird broken texture (purple/black) In my inventory the item looks how it's supposed to look (a little big, but I can fix that later) and if I throw the block on the ground, it also shows the correct model -- but both seem like the texture is missing. Any tips on how to fix this? I also got this error: [EDIT]: fixed the broken model, but textures are still broken. Also, anyone know how to fix that weird "look through world" thing?
  3. Hey guys, I have a problem with my structure spawn. Problem is it spawns way too high and way too frequently, here's what I mean: Since it's a cave I want the bottom 4 layers of the structure to be below the surface Y but I don't know how to do this. Also, I'd like the structure to not spawn as often as this, any ideas? Code Here's my WorldGen class: http://pastebin.com/rCU7vbBP Sharing the face cave code is a little long and tedious, but here's some of it (it's over 3000 lines long): http://pastebin.com/rKEWncc6
  4. Anyone else got any ideas why my error might be happening?
  5. Well, thing is, now that my code doesn't generate correctly I don't really have a guide to consult -- there's hardly any code guides for this on YT since everyone uses mods to do it for them, and I don't want to do that. I'm sure it was a simple problem to begin with. Hopefully someone will actually explain the process, eventually. Going to work on other parts of my mod while I wait, not spending another night trying to work this one out when I don't understand it.
  6. Twice? I don't multiply both X and Z then? I don't multiply in this line? generateSurface(world, random, chunkX*16, chunkZ*16);? I'm so lost, just going to restart from scratch, at least that'll be better than talking in riddles and replacing my code with code I've never heard of before, to find individual blocks, which I have no idea why I'm even doing to spawn a structure. This obviously makes some sense to you but it makes absolutely none to me.
  7. What do you MEAN? What should I be doing? You said to get blocks from chunks I need to multiply right? I just don't understand what you mean, I mean, why am I even getting individual blocks to generate a structure?
  8. http://pastebin.com/n9QX2PDL Think I'm going to try another method of generating or follow a less "Jumpy" tutorial if I don't get it working this way, I thought I was close, but apparently not. I appreciate the help though
  9. BiomeGenBase biome = world.getBiomeGenForCoords(x / 16 , z / 16);? BiomeGenBase biome = world.getBiomeGenForCoords(x * 16 , z * 16);? If not, I'm completely lost.
  10. So, this? BiomeGenBase biome = world.getBiomeGenForCoords(x, z);? and I can keep my other code?
  11. Can you be more specific? So I need to change my entire generateSurface method? If I change: "BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(x, z);" to "BiomeGenBase biome = world.getBiomeGenForCoords().getBiomeGenAt(x, z);" all I get is an error. I was following this guys tutorial on it, and he used the same code as I have currently, and HIS worked:
  12. I've never heard of MinecraftForge.TERRAIN_GEN_BUS I don't think that's required. Still stumped.
  13. Having an issue with my first generated world structure, I wanted to generate a cave for the block I've been working on over the past few days to sit inside, the problem is the structure isn't spawning in plains biomes, like I want it too, and since I've not seen one yet I'm pretty certain I have an error, somewhere. I can't really see errors in my code, but here's my worldgen class. public class WorldGen implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.dimensionId) { case 0: //surface world generateSurface(world, random, chunkX*16, chunkZ*16); case 1: //end world generateEnd(world, random, chunkX * 16, chunkZ * 16); case -1: //nether world generateNether(world, random, chunkX * 16, chunkZ * 16); } } private void generateSurface(World world, Random random, int x, int z) { this.addSpawn(ModBlocks.johnnyFaceBlockRubble, world, random, x, z,16,16,4 + random.nextInt(6), 25, 38, 100); BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(x, z); if ((biome == BiomeGenBase.plains)) { for(int a = 0; a < 1; a++) { int i = x + random.nextInt(16); int j = z + random.nextInt(16); int k = world.getHeightValue(i, j); new StructureJohnnyFaceCave().generate(world, random, i, k, j); } } } private void generateEnd(World world, Random random, int x, int z) { } private void generateNether(World world, Random random, int x, int z) { } private void addSpawn(Block block, World world, Random random, int blockXPos , int blockZPos, int maxX, int maxZ, int maxVeinSize, int chanceToSpawn, int minY, int maxY) { for(int i = 0; i <chanceToSpawn; i++) { int posX = blockXPos + random.nextInt(maxX); int posY = minY + random.nextInt(maxY - minY); int posZ = blockZPos + random.nextInt(maxZ); (new WorldGenMinable(block, maxVeinSize)).generate(world, random, posX, posY, posZ); } } } I'll link the Structure file if it's actually requested, since that is a large file (Most structures are just the java required to place the blocks, so it's 3000 lines long) pretty confident that if an error does exist it's in my WorldGen class and not the structure class, but I could be wrong, I have been before, and only been doing this stuff for a week If anyone could help out I'd be grateful
  14. Hey, so I have two Techne blocks in my client right now, one of them looks like a Classic Minecraft Block and the other looks like a pile of Rubble. The problem is, when I place the one that looks like a Block, it shares the rubbles model. Despite it looking the same as Rubble when placed? it must still render correctly, because this is what my Block SHOULD look like when placed, but it doesn't I have a logic error somewhere but I don't know exactly where it is. Anyone had this issue before? **UPDATE** So, I created a Base class for Techne Blocks so I could call the BaseTechneBlock class when I was creating a new TechneBlock (Rather than the BaseBlock class for normal blocks) Reason I did this was to cut down on repeated code, and it makes sense not to have loads of un-needed code when I can extend generic information from a Base Class. The problem I have is in my BaseTechneBlock Class and I've narrowed it down to one line. The Method that's causing my issue is the TileEntity method, because it's currently returning a new TileEntityJohnnyBlockRubble, when it should have the ability to return any tileEntity When I change this to my other block (TileEntityJohnnyBlock) I get the exact opposite issue. In my BaseTechneBlock class how would I create this method but return the correct TileEntity in my subclasses? How do I NOT return a TileEntity in my Base class? *UPDATE 2** solved, all I had to do was call the TileEntity and in my subclass just call the correct TileEntity I actually wanted. Looks good
  15. Hey guys, got a question. So yesterday I spent all day trying to get my first Techne block to render correctly and set up the code so the block would drop correctly, so those things work. But, in the future I plan to add way more Techne models and I don't want to use multiple classes repeating the same ode over and over again, I want a way to use clean inheritance: You can see in my Block package that I have a BaseJohnnyBlock that extends block, and then all my other blocks in that package simply extend the BaseBlock, that means I need to put a lot less code in my subsequent block classes since all of the hard work for making a block is done in the Base class, such as registering the Block icon, setting a creative tab and getting unlocalized name. However, in my Model package, I don't have a "Base" I can work from, and this also applies to my Renderer packages and classes. In my current system, I'd need to set everything up again, every time I create a new Techne model I wondered if it was possible to make a "Base" TileEntity class and a "Base" renderer class so most of that code would not need to be rewritten I'm pretty sure I'd need to rewrite everything for the actual model.java code produced by Techne, though. Here's my renderer classes: public class ItemRenderJohnnyBlockRubble implements IItemRenderer { TileEntitySpecialRenderer render; private TileEntity entity; public ItemRenderJohnnyBlockRubble(TileEntitySpecialRenderer render, TileEntity entity) { this.entity = entity; this.render = render; } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return true; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return true; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { if(type == ItemRenderType.ENTITY) GL11.glTranslatef(-0.5F, 0.0F, -0.5F); this.render.renderTileEntityAt(this.entity,0.0D,0.0D,0.0D,0.0F); } } public class RendererJohnnyBlockRubble extends TileEntitySpecialRenderer { private static final ResourceLocation texture = new ResourceLocation(Reference.MOD_ID + ":" + "textures/models/johnnyFaceBlockRubble.png" ); private ModelJohnnyRubble model; public RendererJohnnyBlockRubble() { this.model = new ModelJohnnyRubble(); } public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F,(float)y + 1.5F,(float)z + 0.5F); GL11.glRotatef(180,0F,0F,1F); this.bindTexture(texture); GL11.glPushMatrix(); this.model.renderModel(0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } } and here's my model class public class ModelJohnnyRubble extends ModelBase { //fields ModelRenderer BigChunkOne; ModelRenderer BigChunkOneSideChunkB; ModelRenderer BigChunkTopChunkOne; ModelRenderer BigChunkTwo; ModelRenderer BigChunkOneSideChunkR; ModelRenderer BigChunkTopChunkTwo; public ModelJohnnyRubble() { textureWidth = 64; textureHeight = 64; BigChunkOne = new ModelRenderer(this, 11, 17); BigChunkOne.addBox(0F, 21F, -1F, 5, 3, 5); BigChunkOne.setRotationPoint(0F, 0F, 0F); BigChunkOne.setTextureSize(64, 64); BigChunkOne.mirror = true; setRotation(BigChunkOne, 0F, 0.2602503F, 0F); BigChunkOneSideChunkB = new ModelRenderer(this, 0, 19); BigChunkOneSideChunkB.addBox(0F, 0F, 0F, 4, 2, 1); BigChunkOneSideChunkB.setRotationPoint(1F, 22F, 4F); BigChunkOneSideChunkB.setTextureSize(64, 64); BigChunkOneSideChunkB.mirror = true; setRotation(BigChunkOneSideChunkB, 0F, 0.260246F, 0F); BigChunkTopChunkOne = new ModelRenderer(this, 14, 11); BigChunkTopChunkOne.addBox(0F, 0F, 0F, 3, 2, 3); BigChunkTopChunkOne.setRotationPoint(1F, 19F, 0F); BigChunkTopChunkOne.setTextureSize(64, 64); BigChunkTopChunkOne.mirror = true; setRotation(BigChunkTopChunkOne, 0F, 0.260246F, 0F); BigChunkTwo = new ModelRenderer(this, 44, 47); BigChunkTwo.addBox(0F, 0F, 0F, 2, 4, 2); BigChunkTwo.setRotationPoint(-6F, 20F, -5F); BigChunkTwo.setTextureSize(64, 64); BigChunkTwo.mirror = true; setRotation(BigChunkTwo, 0F, 0.3665191F, 0F); BigChunkOneSideChunkR = new ModelRenderer(this, 17, 26); BigChunkOneSideChunkR.addBox(0F, 0F, 0F, 1, 2, 2); BigChunkOneSideChunkR.setRotationPoint(-1F, 22F, 0F); BigChunkOneSideChunkR.setTextureSize(64, 64); BigChunkOneSideChunkR.mirror = true; setRotation(BigChunkOneSideChunkR, 0F, 0.260246F, 0F); BigChunkTopChunkTwo = new ModelRenderer(this, 17, ; BigChunkTopChunkTwo.addBox(0F, -1F, 0F, 2, 1, 1); BigChunkTopChunkTwo.setRotationPoint(2F, 19F, 0F); BigChunkTopChunkTwo.setTextureSize(64, 64); BigChunkTopChunkTwo.mirror = true; setRotation(BigChunkTopChunkTwo, 0F, 0.260246F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); BigChunkOne.render(f5); BigChunkOneSideChunkB.render(f5); BigChunkTopChunkOne.render(f5); BigChunkTwo.render(f5); BigChunkOneSideChunkR.render(f5); BigChunkTopChunkTwo.render(f5); } public void renderModel(float f) { //the one we made BigChunkOne.render(f); BigChunkOneSideChunkB.render(f); BigChunkTopChunkOne.render(f); BigChunkTwo.render(f); BigChunkOneSideChunkR.render(f); BigChunkTopChunkTwo.render(f); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } } Here's my clientproxy public class ClientProxy extends CommonProxy { public void registerRenderThings() { //rubble TileEntitySpecialRenderer render = new RendererJohnnyBlockRubble(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJohnnyBlockRubble.class, render); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.johnnyFaceBlockRubble), new ItemRenderJohnnyBlockRubble(render, new TileEntityJohnnyBlockRubble())); } public void registerTileEntitySpecialRenderer() { } }
  16. I'm an idiot. I was setting the x,y,z to 0,0,1 instead of using the x,y,z I recieved from the block code is now x + 1, z - 1 etc. problem solved.
  17. I know that I have to do that because right now it spawns at world co-ords, like I said it's not relevant to the destroyed block. Could you elaborate at all? how would I do that?
×
×
  • Create New...

Important Information

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