Jump to content

tiffit

Forge Modder
  • Posts

    242
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Personal Text
    Nope

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

tiffit's Achievements

Creeper Killer

Creeper Killer (4/8)

9

Reputation

  1. I was able to get it to work by rotating on the x and y axis. Thanks for the help!
  2. I was able to get it to work by rotating on the x and y axis. Thanks for the help!
  3. I am trying to make my custom block model rotate on the z axis for certain blockstates but it doesn't seem to be working. The other rotations seem to be working and it places down the block with the blockstates east and west. So only the rotations isn't working and just placing down the normal model. { "variants": { "active=false,facing=up": { "model": "talecraft:spikeblock", "x": 180 }, "active=false,facing=down": { "model": "talecraft:spikeblock"}, "active=false,facing=south": { "model": "talecraft:spikeblock", "x": 90 }, "active=false,facing=north": { "model": "talecraft:spikeblock", "x": 270 }, "active=false,facing=east": { "model": "talecraft:spikeblock", "z": 90}, "active=false,facing=west": { "model": "talecraft:spikeblock", "z": 270 }, "active=true,facing=up": { "model": "talecraft:spikeblock", "x": 180 }, "active=true,facing=down": { "model": "talecraft:spikeblock"}, "active=true,facing=south": { "model": "talecraft:spikeblock", "x": 90 }, "active=true,facing=north": { "model": "talecraft:spikeblock", "x": 270 }, "active=true,facing=east": { "model": "talecraft:spikeblock", "z": 90}, "active=true,facing=west": { "model": "talecraft:spikeblock", "z": 270 } } }
  4. I am trying to make my custom block model rotate on the z axis for certain blockstates but it doesn't seem to be working. The other rotations seem to be working and it places down the block with the blockstates east and west. So only the rotations isn't working and just placing down the normal model. { "variants": { "active=false,facing=up": { "model": "talecraft:spikeblock", "x": 180 }, "active=false,facing=down": { "model": "talecraft:spikeblock"}, "active=false,facing=south": { "model": "talecraft:spikeblock", "x": 90 }, "active=false,facing=north": { "model": "talecraft:spikeblock", "x": 270 }, "active=false,facing=east": { "model": "talecraft:spikeblock", "z": 90}, "active=false,facing=west": { "model": "talecraft:spikeblock", "z": 270 }, "active=true,facing=up": { "model": "talecraft:spikeblock", "x": 180 }, "active=true,facing=down": { "model": "talecraft:spikeblock"}, "active=true,facing=south": { "model": "talecraft:spikeblock", "x": 90 }, "active=true,facing=north": { "model": "talecraft:spikeblock", "x": 270 }, "active=true,facing=east": { "model": "talecraft:spikeblock", "z": 90}, "active=true,facing=west": { "model": "talecraft:spikeblock", "z": 270 } } }
  5. Thanks, that worked
  6. Thanks, that worked
  7. I am trying to render a custom block for my mod but when the block gets rendered, the places where its supposed to be transparent is black. SpikeBlock.java SpikeBlock.json
  8. I am trying to render a custom block for my mod but when the block gets rendered, the places where its supposed to be transparent is black. SpikeBlock.java SpikeBlock.json
  9. How Would I make a chunk generator generate with less noise for the noise. I don't want it to generate mountains or anything like that. package tiffit.JASM.worldProvider; import java.util.ArrayList; import java.util.List; import java.util.Random; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EnumCreatureType; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import net.minecraft.world.WorldType; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.ChunkPrimer; import net.minecraft.world.chunk.IChunkGenerator; import net.minecraft.world.gen.ChunkProviderSettings; import net.minecraft.world.gen.NoiseGeneratorOctaves; import net.minecraft.world.gen.NoiseGeneratorPerlin; import net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextOverworld; import net.minecraftforge.event.terraingen.TerrainGen; import tiffit.JASM.JASMBlocks; public class MoonChunkGenerator implements IChunkGenerator { protected static final IBlockState moonRock = JASMBlocks.moonRock.getDefaultState(); private final Random rand; private NoiseGeneratorOctaves octavePerlin1; private NoiseGeneratorOctaves octavePerlin2; private NoiseGeneratorOctaves octavePerlin; private NoiseGeneratorPerlin perlinHeight; public NoiseGeneratorOctaves octaveScale; public NoiseGeneratorOctaves octaveDepth; public NoiseGeneratorOctaves octaveForest; private final World worldObj; private final double[] heightMap; private final float[] float_array; private ChunkProviderSettings settings; private IBlockState oceanBlock = Blocks.stone.getDefaultState(); private double[] biomeArray = new double[256]; private BiomeGenBase[] biomesForGeneration; double[] field_185986_e; double[] field_185987_f; double[] field_185988_g; double[] field_185989_h; public MoonChunkGenerator(World world, long seed, String data){ this.worldObj = world; this.rand = new Random(seed); this.octavePerlin1 = new NoiseGeneratorOctaves(rand, 16); this.octavePerlin2 = new NoiseGeneratorOctaves(rand, 16); this.octavePerlin = new NoiseGeneratorOctaves(rand, ; this.perlinHeight = new NoiseGeneratorPerlin(rand, 4); this.octaveScale = new NoiseGeneratorOctaves(rand, 10); this.octaveDepth = new NoiseGeneratorOctaves(rand, 16); this.octaveForest = new NoiseGeneratorOctaves(rand, ; this.heightMap = new double[825]; this.float_array = new float[25]; for (int i = -2; i <= 2; ++i) { for (int j = -2; j <= 2; ++j) { float f = 10.0F / MathHelper.sqrt_float((float)(i * i + j * j) + 0.2F); this.float_array[i + 2 + (j + 2) * 5] = f; } } if (data != null){ ChunkProviderSettings.Factory factory = ChunkProviderSettings.Factory.jsonToFactory(data); this.settings = factory.func_177864_b(); world.setSeaLevel(this.settings.seaLevel); } ContextOverworld ctx = new ContextOverworld(octavePerlin1, octavePerlin2, octavePerlin, perlinHeight, octaveScale, octaveDepth, octaveForest); ctx = TerrainGen.getModdedNoiseGenerators(world, this.rand, ctx); this.octavePerlin1 = ctx.getLPerlin1(); this.octavePerlin2 = ctx.getLPerlin2(); this.octavePerlin = ctx.getPerlin(); this.perlinHeight = ctx.getHeight(); this.octaveScale = ctx.getScale(); this.octaveDepth = ctx.getDepth(); this.octaveForest = ctx.getForest(); } public void setBlocksInChunk(int x, int z, ChunkPrimer primer) { this.biomesForGeneration = this.worldObj.getBiomeProvider().getBiomesForGeneration(this.biomesForGeneration, x * 4 - 2, z * 4 - 2, 10, 10); this.generateHeightmap(x * 4, 0, z * 4); for (int i = 0; i < 4; ++i) { int j = i * 5; int k = (i + 1) * 5; for (int l = 0; l < 4; ++l) { int i1 = (j + l) * 33; int j1 = (j + l + 1) * 33; int k1 = (k + l) * 33; int l1 = (k + l + 1) * 33; for (int i2 = 0; i2 < 32; ++i2) { double d0 = 0.125D; double d1 = this.heightMap[i1 + i2]; double d2 = this.heightMap[j1 + i2]; double d3 = this.heightMap[k1 + i2]; double d4 = this.heightMap[l1 + i2]; double d5 = (this.heightMap[i1 + i2 + 1] - d1) * d0; double d6 = (this.heightMap[j1 + i2 + 1] - d2) * d0; double d7 = (this.heightMap[k1 + i2 + 1] - d3) * d0; double d8 = (this.heightMap[l1 + i2 + 1] - d4) * d0; for (int j2 = 0; j2 < 8; ++j2) { double d9 = 0.25D; double d10 = d1; double d11 = d2; double d12 = (d3 - d1) * d9; double d13 = (d4 - d2) * d9; for (int k2 = 0; k2 < 4; ++k2) { double d14 = 0.25D; double d16 = (d11 - d10) * d14; double lvt_45_1_ = d10 - d16; for (int l2 = 0; l2 < 4; ++l2) { if ((lvt_45_1_ += d16) > 0.0D) { primer.setBlockState(i * 4 + k2, i2 * 8 + j2, l * 4 + l2, moonRock); } else if (i2 * 8 + j2 < this.settings.seaLevel) { primer.setBlockState(i * 4 + k2, i2 * 8 + j2, l * 4 + l2, moonRock); } } d10 += d12; d11 += d13; } d1 += d5; d2 += d6; d3 += d7; d4 += d8; } } } } } public void replaceBiomeBlocks(int x, int z, ChunkPrimer primer, BiomeGenBase[] biomesIn){ if (!net.minecraftforge.event.ForgeEventFactory.onReplaceBiomeBlocks(this, x, z, primer, this.worldObj)) return; double d0 = 0.03125D; this.biomeArray = this.perlinHeight.func_151599_a(this.biomeArray, (double)(x * 16), (double)(z * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D); for (int i = 0; i < 16; ++i) { for (int j = 0; j < 16; ++j) { BiomeGenBase biomegenbase = biomesIn[j + i * 16]; biomegenbase.genTerrainBlocks(this.worldObj, this.rand, primer, x * 16 + i, z * 16 + j, this.biomeArray[j + i * 16]); } } } public Chunk provideChunk(int x, int z){ this.rand.setSeed((long)x * 341873128712L + (long)z * 132897987541L); ChunkPrimer chunkprimer = new ChunkPrimer(); this.setBlocksInChunk(x, z, chunkprimer); this.biomesForGeneration = this.worldObj.getBiomeProvider().loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16, 16); this.replaceBiomeBlocks(x, z, chunkprimer, this.biomesForGeneration); Chunk chunk = new Chunk(this.worldObj, chunkprimer, x, z); byte[] abyte = chunk.getBiomeArray(); for (int i = 0; i < abyte.length; ++i) { abyte[i] = (byte)BiomeGenBase.getIdForBiome(this.biomesForGeneration[i]); } chunk.generateSkylightMap(); return chunk; } private void generateHeightmap(int p_185978_1_, int p_185978_2_, int p_185978_3_){ this.field_185989_h = this.octaveDepth.generateNoiseOctaves(this.field_185989_h, p_185978_1_, p_185978_3_, 5, 5, (double)this.settings.depthNoiseScaleX, (double)this.settings.depthNoiseScaleZ, (double)this.settings.depthNoiseScaleExponent); float f = this.settings.coordinateScale; float f1 = this.settings.heightScale; this.field_185986_e = this.octavePerlin.generateNoiseOctaves(this.field_185986_e, p_185978_1_, p_185978_2_, p_185978_3_, 5, 33, 5, (double)(f / this.settings.mainNoiseScaleX), (double)(f1 / this.settings.mainNoiseScaleY), (double)(f / this.settings.mainNoiseScaleZ)); this.field_185987_f = this.octavePerlin1.generateNoiseOctaves(this.field_185987_f, p_185978_1_, p_185978_2_, p_185978_3_, 5, 33, 5, (double)f, (double)f1, (double)f); this.field_185988_g = this.octavePerlin2.generateNoiseOctaves(this.field_185988_g, p_185978_1_, p_185978_2_, p_185978_3_, 5, 33, 5, (double)f, (double)f1, (double)f); p_185978_3_ = 0; p_185978_1_ = 0; int i = 0; int j = 0; for (int k = 0; k < 5; ++k) { for (int l = 0; l < 5; ++l) { float f2 = 0.0F; float f3 = 0.0F; float f4 = 0.0F; int i1 = 2; BiomeGenBase biomegenbase = this.biomesForGeneration[k + 2 + (l + 2) * 10]; for (int j1 = -i1; j1 <= i1; ++j1) { for (int k1 = -i1; k1 <= i1; ++k1) { BiomeGenBase biomegenbase1 = this.biomesForGeneration[k + j1 + 2 + (l + k1 + 2) * 10]; float f5 = this.settings.biomeDepthOffSet + biomegenbase1.getBaseHeight() * this.settings.biomeDepthWeight; float f6 = this.settings.biomeScaleOffset + biomegenbase1.getHeightVariation() * this.settings.biomeScaleWeight; float f7 = this.float_array[j1 + 2 + (k1 + 2) * 5] / (f5 + 2.0F); if (biomegenbase1.getBaseHeight() > biomegenbase.getBaseHeight()) { f7 /= 2.0F; } f2 += f6 * f7; f3 += f5 * f7; f4 += f7; } } f2 = f2 / f4; f3 = f3 / f4; f2 = f2 * 0.9F + 0.1F; f3 = (f3 * 4.0F - 1.0F) / 8.0F; double d7 = this.field_185989_h[j] / 8000.0D; if (d7 < 0.0D) { d7 = -d7 * 0.3D; } d7 = d7 * 3.0D - 2.0D; if (d7 < 0.0D) { d7 = d7 / 2.0D; if (d7 < -1.0D) { d7 = -1.0D; } d7 = d7 / 1.4D; d7 = d7 / 2.0D; } else { if (d7 > 1.0D) { d7 = 1.0D; } d7 = d7 / 8.0D; } ++j; double d8 = (double)f3; double d9 = (double)f2; d8 = d8 + d7 * 0.2D; d8 = d8 * (double)this.settings.baseSize / 8.0D; double d0 = (double)this.settings.baseSize + d8 * 4.0D; for (int l1 = 0; l1 < 33; ++l1) { double d1 = ((double)l1 - d0) * (double)this.settings.stretchY * 128.0D / 256.0D / d9; if (d1 < 0.0D) { d1 *= 4.0D; } double d2 = this.field_185987_f[i] / (double)this.settings.lowerLimitScale; double d3 = this.field_185988_g[i] / (double)this.settings.upperLimitScale; double d4 = (this.field_185986_e[i] / 10.0D + 1.0D) / 2.0D; double d5 = MathHelper.denormalizeClamp(d2, d3, d4) - d1; if (l1 > 29) { double d6 = (double)((float)(l1 - 29) / 3.0F); d5 = d5 * (1.0D - d6) + -10.0D * d6; } this.heightMap[i] = d5; ++i; } } } } public void populate(int x, int z){ } public boolean generateStructures(Chunk chunkIn, int x, int z){ return false; } public List<SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos){ return new ArrayList<SpawnListEntry>(); } public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position) { return null; } public void recreateStructures(Chunk chunkIn, int x, int z) { } }
  10. Dear diary, It has been 6 days without a response. I am running low on food and water. The bucket is almost full. Bump
  11. sigh.... bump again.
  12. [move]bump[/move]
  13. I can help you out. I sent you a PM
  14. Bump Here are some images of the problem
×
×
  • Create New...

Important Information

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