Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by Danickar

  1. I can assure you that if an easier way existed he would have suggested that first.
  2. Yes, I know it isn't saving it, I wasn't concerned with this particular version with that part. I meant keeping track so that when one cube is activated it is X and the next cube is O, etc.
  3. My thought behind the Entity itself was a central place to keep track of the game. For TTT, a rather simple game for sure, it is keeping track of whose turn it is, so that clicking on any of the blocks creates the appropriate X or O. I wasn't sure of the best way to get a blocks to find a TileEntity to figure out whose turn it was.
  4. So I just finished a simple mod that creates and plays a game of Tic Tac Toe in the world. The board, made of 9 blocks containing their tile entities is created by using a ttt item. This is my first attempt at something more complicated than a block or item and with code that requires multiple parts talking to each other. I am sure there are better ways to do a lot of what I have done, so I am posting all of the code here for anyone to review and critique. Main file: Block files: Entity: Tile Entity: Item:
  5. Ok. So I finally got my model rendering, using Techne and creating a model that way rather than trying to figure out every vertex and UV point with the addVertexWithUV method. Since it is a circurlar object Techne seemed like the easier way to go (at least with my skill/knowledge level). So, the question now is: I know with the "pure code" approach using the Tessellator approach you can do some things like change lighting values and color without having to have a lot of textures. Is there a way to do this when rendering with a model?
  6. Ok. I got my vehicle to move in the directions I was trying to get it to work. Now, the only problem is, the movement is extremely choppy and "warp" like. I am sure someone here has experienced this and can point me in the right direction to solving this.
  7. Also, along similar lines. I want my player to always face forward in the vehicle. I thought something like: this.riddenByEntity.rotationYaw = this.rotationYaw; in the onUpdate() method of the vehicle would do the trick, however it appears to make no difference at all.
  8. In my custom vehicle I am creating I want to change the character position from a seated (the default) position to one where he is lying down on his stomach, like in a hang glider. My first thought is that this would involved extending RenderPlayer and setting up some custom code in there, perhaps modifying parts of sleeping and rotateplayer. Is this the best way to go? If so, what do I need to register so the player gets my new renderer instead of the default one?
  9. You have both been very helpful, thank you. I think I have a pretty good idea now how to tackle what I was trying to accomplish.
  10. I guess what I am really having a hard time figure out is how the UV numbers are telling the pixel what part of the texture file to render. Since the UV are floats, are they percentages where .5 .5 would represent half the texture file? Or maybe 1/4 of the texture file if it is half of the U(x) direction and half of the V(y) direction so the bottom left 1/4th of the texture file?
  11. At the risk of sounding stupid, can anyone help me understand this method better? I have been searching for opengl tutorials and looking through all sorts of code people have in their renderers trying to figure this out. I know the first 3 arguments it takes are x,y,z coordinates of the given vertex, and that the last 2 are u,v for that vertex. I know, or at least I think I know, that u and v refer to the texture. What I am really unclear on is how exactly the u and v refer to the texture and how that relates to its vertex.
  12. Well, I suppose I meant more feasible than possible. I know most things can be done with the right amount of code. The goal being a slot for a specific item, but one that could be easily accessed by scrolling the mouse wheel, etc.
  13. Is this something that can be done?
  14. I've tried all sorts of combinations of numbers messing with rotateY and rotateX. I can get "close" to what I would be looking for, but no real success. Part of the problem seems to be that the item is completely flat when thrown. Is there a way to give it thickness so that when it is flat like a frisbee you can still see it?
  15. private void func_77026_a(Tessellator par1Tessellator, Icon par2Icon) { float f = par2Icon.getMinU(); float f1 = par2Icon.getMaxU(); float f2 = par2Icon.getMinV(); float f3 = par2Icon.getMaxV(); float f4 = 1.0F; float f5 = 0.5F; float f6 = 0.25F; GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(0.0F, 1.0F, 0.0F); par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3); par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3); par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2); par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2); par1Tessellator.draw(); } So, if I take out the 180.0F from the rotateY I was able to get it to go flat. I seem to get the same response if I add 180.0F in front of the rotateX. I am not sure this is the best method or not. I took this render code from the RenderSnowball code.
  16. So I have a Disc item (basically a Frisbee) that I can throw. It has its own ThrownEntity and Renderer files. My problem is when I throw the disc it looks just like a circle getting smaller as it moves away. I want it to look more flat, like a Frisbee would when you throw it. I messed around with some of the values in the renderer and got it to "go flat" but then it also becomes impossible to see as it has no thickness. Anyone have any experience with doing this?
  17. http://www.minecraftforum.net/topic/1797143-152-16-forge-dimension-tutorial-multi-biome-dimension-ore-gen-basic-house-gen-tree-gen-skyrenderer-githubsrc-code/
  18. In the chunk provider make the change in two of the methods: In generate terrain: public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte) { byte b0 = 4; byte b1 = 16; byte b2 = 63; int k = b0 + 1; byte b3 = 17; int l = b0 + 1; this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, par1 * 4 - 2, par2 * 4 - 2, k + 5, l + 5); this.noiseArray = this.initializeNoiseField(this.noiseArray, par1 * b0, 0, par2 * b0, k, b3, l); for (int i1 = 0; i1 < b0; ++i1) { for (int j1 = 0; j1 < b0; ++j1) { for (int k1 = 0; k1 < b1; ++k1) { double d0 = 0.125D; double d1 = this.noiseArray[((i1 + 0) * l + j1 + 0) * b3 + k1 + 0]; double d2 = this.noiseArray[((i1 + 0) * l + j1 + 1) * b3 + k1 + 0]; double d3 = this.noiseArray[((i1 + 1) * l + j1 + 0) * b3 + k1 + 0]; double d4 = this.noiseArray[((i1 + 1) * l + j1 + 1) * b3 + k1 + 0]; double d5 = (this.noiseArray[((i1 + 0) * l + j1 + 0) * b3 + k1 + 1] - d1) * d0; double d6 = (this.noiseArray[((i1 + 0) * l + j1 + 1) * b3 + k1 + 1] - d2) * d0; double d7 = (this.noiseArray[((i1 + 1) * l + j1 + 0) * b3 + k1 + 1] - d3) * d0; double d8 = (this.noiseArray[((i1 + 1) * l + j1 + 1) * b3 + k1 + 1] - d4) * d0; for (int l1 = 0; l1 < 8; ++l1) { double d9 = 0.25D; double d10 = d1; double d11 = d2; double d12 = (d3 - d1) * d9; double d13 = (d4 - d2) * d9; for (int i2 = 0; i2 < 4; ++i2) { int j2 = i2 + i1 * 4 << 11 | 0 + j1 * 4 << 7 | k1 * 8 + l1; short short1 = 128; j2 -= short1; double d14 = 0.25D; double d15 = (d11 - d10) * d14; double d16 = d10 - d15; //requires change in both methods to properly generate custom dimension blocks under biomes for (int k2 = 0; k2 < 4; ++k2) { if ((d16 += d15) > 0.0D) { par3ArrayOfByte[j2 += short1] = (byte) Block.glowStone.blockID;//Block.stone.blockID; } else if (k1 * 8 + l1 < b2) { par3ArrayOfByte[j2 += short1] = (byte) Fluids.blockRasterWasser.blockID; } else { par3ArrayOfByte[j2 += short1] = 0; } } d10 += d12; d11 += d13; } d1 += d5; d2 += d6; d3 += d7; d4 += d8; } } } } } And replace block: public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase) { ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, par1, par2, par3ArrayOfByte, par4ArrayOfBiomeGenBase); MinecraftForge.EVENT_BUS.post(event); if (event.getResult() == Result.DENY) return; byte b0 = 63; double d0 = 0.03125D; this.stoneNoise = this.noiseGen4.generateNoiseOctaves(this.stoneNoise, par1 * 16, par2 * 16, 0, 16, 16, 1, d0 * 2.0D, d0 * 2.0D, d0 * 2.0D); for (int k = 0; k < 16; ++k) { for (int l = 0; l < 16; ++l) { BiomeGenBase biomegenbase = par4ArrayOfBiomeGenBase[l + k * 16]; float f = biomegenbase.getFloatTemperature(); int i1 = (int) (this.stoneNoise[k + l * 16] / 3.0D + 3.0D + this.rand.nextDouble() * 0.25D); int j1 = -1; byte b1 = biomegenbase.topBlock; byte b2 = biomegenbase.fillerBlock; for (int k1 = 127; k1 >= 0; --k1) { int l1 = (l * 16 + k) * 128 + k1; if (k1 <= 0 + this.rand.nextInt(5)) { par3ArrayOfByte[l1] = (byte) Block.bedrock.blockID; } else { byte b3 = par3ArrayOfByte[l1]; if (b3 == 0) { j1 = -1; } else if (b3 == Block.glowStone.blockID) { if (j1 == -1) { if (i1 <= 0) { b1 = 0; b2 = (byte) Block.dirt.blockID;//was dirt } else if (k1 >= b0 - 4 && k1 <= b0 + 1) { b1 = biomegenbase.topBlock; b2 = biomegenbase.fillerBlock; } if (k1 < b0 && b1 == 0) { if (f < 0.15F) { b1 = (byte) Block.ice.blockID; } else { b1 = (byte) Fluids.blockRasterWasser.blockID; } } j1 = i1; if (k1 >= b0 - 1) { par3ArrayOfByte[l1] = b1; } else { par3ArrayOfByte[l1] = b2; } } else if (j1 > 0) { --j1; par3ArrayOfByte[l1] = b2; if (j1 == 0 && b2 == Block.sand.blockID) { j1 = this.rand.nextInt(4); b2 = (byte) Block.sandStone.blockID; } } } } } } } } I made mine create glowstone while I was testing the dimension.
  19. Before I went the current route I am on, I tried creating my own Village files (really just overwriting the part that talks about viable biomes to spawn in) without much success. I was able to get it to tell me that it had found viable biomes to generate villages in, yet no villages were ever actually created. I am not sure how I would use the BiomeEvent you mentioned as I have not really gotten too far into specific event modding yet.
  20. I personally prefer going off the item slot: public String getArmorTexture (ItemStack stack, Entity entity, int slot, int layer) { if (slot == 2) return "cellarium:textures/models/armor/" + armorTexture + "_layer_2.png"; else return "cellarium:textures/models/armor/" + armorTexture + "_layer_1.png"; }
  21. To try and address the structure issue I have done the following: In the main mod class I added GameRegistry.registerWorldGenerator(new RasterWorldStructureGenerator()); The generator file looks like: import java.util.Random; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.IChunkProvider; import powell.rasterland.Rasterland; import powell.rasterland.biome.Biomes; import powell.rasterland.biome.YellowBiome; import powell.rasterland.structure.RasterTestStructure; import cpw.mods.fml.common.IWorldGenerator; public class RasterWorldStructureGenerator implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.dimensionId) { case Rasterland.DIMENSIONID: generateRasterland(world, random, chunkX*16, chunkZ*16); break; } } private void generateRasterland(World world, Random rand, int chunkX, int chunkZ) { BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ); if((biome instanceof YellowBiome))// then add ||BiomeGenXYZ if you want more. { System.out.println("inside the yellow generate"); for(int x = 0;x<2;x++) { int i = chunkX + rand.nextInt(16); int k = chunkZ + rand.nextInt(16); int j = world.getHeightValue(i, k); new RasterTestStructure().generate(world, rand, i, j, k); } } } } The test structure it generates is just a random building (and for the moment I am using a random structure code I found online just to see if it works). It is creating the structure and only in the correct biome. The problem is it is creating it all over the place and often on top of itself. So my next task is to try and get it to generate a little more randomly and hopefully not when it can't create the whole thing, like villages (mostly) do in vanilla code. I have spent a good amount of time trying to pour through the village vanilla code, a lot of which seems to still be obfuscated. Any thoughts on where to look or what to change to get the generation itself more inline with what I am trying to do?
  22. After looking at the link you provided and doing some further research I modified my world provider class to the following: public class RasterlandWorldProvider extends WorldProvider { @Override public void registerWorldChunkManager() { this.worldChunkMgr = new RasterlandChunkManager(worldObj.getSeed(), terrainType); this.hasNoSky = true; } @Override public String getDimensionName() { return "Rasterland"; } public static WorldProvider getProviderForDimension(int id) { return DimensionManager.createProviderFor(Rasterland.DIMENSIONID); } @Override public String getWelcomeMessage() { return "Welcome to the Rasterland"; } @Override public IChunkProvider createChunkGenerator() { return new RasterlandChunkProvider(worldObj, worldObj.getSeed(), true); } @Override public boolean canRespawnHere() { return true; } @SideOnly(Side.CLIENT) public boolean isSkyColored() { return false; } public float getCloudHeight() { return 0.0F; } public boolean isSurfaceWorld() { return false; } public float[] calcSunriseSunsetColors(float par1, float par2) { return null; } public Vec3 getFogColor(float par1, float par2) { return this.worldObj.getWorldVec3Pool().getVecFromPool(0.0, 0.0, 0.0); } } It works pretty close to what I want. The only thing I am not happy about right now is there is still a color variation (based off light I am guessing) between day and night time.
  23. So I got my custom dimension working in at least a testable state. Have multiple custom biomes spawning that I need to tweek, but they are at least there. So the two big questions I currently am looking at: 1) Custom Sky I know this will probably involve a custom SkyRenderer, especially because I want to take out the sun and moon all together. I basically want it to always be dark as night (I really am not worried about stars at this point). Any thoughts/suggestions or helpful hints on where to look? 2) Custom Stucture Generation It does not appear that towns or the like are spawning in my custom dimension, which I am sure has something to do with the fact that there are no Vanilla biomes in it. I would like to create custom structures so that the towns not only spawn, but do so with a look relative to the biome they are in. I also would like one of the biomes to generate a Nether Stronghold type structure. I've been doing some searching but haven't really come across much on these two particular topics.
  • Create New...

Important Information

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