• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Look at how vanilla makes models, or use a model creator like Blockbench. Remember that your model won't render if you don't override createSpawnPacket and return NetworksHooks.getEntitySpawningPacket(this).
    • i just create an ArrowEntity Extended from AbstractArrowEntity. how can i add custom model to it??
    • Would it be necessary to create a structure? I'll certainly look into how structure generation works, however my goal is to simply create a lake in the desert with vegetation (grass, flowers, and trees) spawning around it on the grass.  Here's what I have so far, I generate a lake of water with dirt and grass surrounding it and then I set the chunk's biome to my custom Oasis biome. I was hoping that by doing that my tree features would just generate, but unfortunately that's not the case. At least it causes the Grass to be green though, which was the main point of the biome.    package killerjdog51.biomeEnhancementsMod.world.gen.feature; import java.util.Random; import java.util.Set; import java.util.function.Function; import com.mojang.datafixers.Dynamic; import killerjdog51.biomeEnhancementsMod.init.WorldGeneration; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.material.Material; import net.minecraft.tags.BlockTags; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.MutableBoundingBox; import net.minecraft.world.IWorld; import net.minecraft.world.LightType; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biomes; import net.minecraft.world.chunk.ChunkStatus; import net.minecraft.world.gen.ChunkGenerator; import net.minecraft.world.gen.GenerationSettings; import net.minecraft.world.gen.IWorldGenerationReader; import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.NoFeatureConfig; public class OasisFeature extends Feature<NoFeatureConfig> { private static final BlockState AIR = Blocks.AIR.getDefaultState(); private static final BlockState WATER = Blocks.WATER.getDefaultState(); private static final BlockState GRASS = Blocks.GRASS_BLOCK.getDefaultState(); private static final BlockState DIRT = Blocks.Dirt.getDefaultState(); private Static final BlockState SAND = Blocks.Sand.getDefaultState(); private int size; public OasisFeature(Function<Dynamic<?>, ? extends NoFeatureConfig> configFactoryIn) { super(configFactoryIn); } @Override public boolean place(IWorld worldIn, ChunkGenerator<? extends GenerationSettings> generator, Random rand, BlockPos pos, NoFeatureConfig config) { int x = pos.getX(); int z = pos.getZ(); size = 1 + rand.nextInt(3); while(pos.getY() > 65 && worldIn.isAirBlock(pos)) { pos = pos.down(); } while(!(worldIn.getLightFor(LightType.SKY, pos) > 0)) { pos = pos.up(); } if (pos.getY() <= 65) { return false; } else { ChunkPos chunkpos = new ChunkPos(pos); if (!worldIn.getChunk(chunkpos.x, chunkpos.z, ChunkStatus.STRUCTURE_REFERENCES).getStructureReferences(Feature.VILLAGE.getStructureName()).isEmpty()) { return false; } for (int xPos = -(11*size); xPos <= (12*size); ++xPos) { for (int zPos = -(11*size); zPos <= (12*size); ++zPos) { for (int yPos = -(8*size); yPos <0; ++yPos) { if (xPos * xPos + zPos * zPos >= (11*(size*size)) && !worldIn.getBlockState(pos.add(xPos, yPos, zPos)).isSolid()) { return false; } } } } Layer(worldIn, pos, (11*size), SAND); Layer(worldIn, pos, (10*size), GRASS); for (int depth = 1; depth <= (4*size); depth++) { Layer(worldIn, pos.down(depth), (10*size), DIRT); } for (int depth = 0; depth < (3*size); depth++) { Layer(worldIn, pos.down(depth), ((8-depth)*size), WATER); } for (int air = 1; air <= 4; air++) { Layer(worldIn, pos.up(air), (10*size), AIR); } return true; } } private void Layer(IWorld worldIn, BlockPos layerCenter, int width, BlockState state) { int max = width * width; for (int x = -width; x <= width; ++x) { for (int z = -width; z <= width; ++z) { if (x * x + z * z <= max) { BlockPos blockpos = layerCenter.add(x, 0, z); worldIn.setBlockState(blockpos, state, 2); worldIn.getChunk(blockpos).getBiomes()[(blockpos.getX() & 15) << 4 | (blockpos.getZ() & 15)] = WorldGeneration.OASIS; } } } } }   public class WorldFeatures { public static AbstractTreeFeature<NoFeatureConfig> PALM_TREE = new PalmTreeFeature(NoFeatureConfig::deserialize); public static Feature<NoFeatureConfig> OASIS = new OasisFeature(NoFeatureConfig::deserialize); }   I want to trigger the palm tree feature to generate after I've created the lake portion. 
    • It appears that this requires both `RenderSystem.disableDepthTest()` and `RenderSystem.depthMask(false)`.   
  • Topics

  • Who's Online (See full list)