Skip to content

Commit

Permalink
Split Deadwood Forest into Dense and Sparse Woods
Browse files Browse the repository at this point in the history
Added Tall Dry Grass
Renamed Dead Grass to Dry Grass
  • Loading branch information
GirafiStudios committed Nov 5, 2020
1 parent 27572f7 commit 115946f
Show file tree
Hide file tree
Showing 20 changed files with 211 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import javax.annotation.Nonnull;

public class DeadGrassBlock extends OasisGrassBlock {
public class DryGrassBlock extends OasisGrassBlock {

@Override
@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public boolean canSustainPlant(@Nonnull BlockState state, @Nonnull IBlockReader
world.getBlockState(pos.north()).getFluidState().isTagged(FluidTags.WATER) ||
world.getBlockState(pos.south()).getFluidState().isTagged(FluidTags.WATER);

if (plantType.equals(PlantType.PLAINS)) {
if (plantType.equals(PlantType.PLAINS) || plantType.equals(PlantType.DESERT)) {
return true;
} else if (plantType.equals(PlantType.BEACH)) {
return hasWater;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public OasisGrassBlock() {

@Override
@Nonnull
public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) {
public VoxelShape getShape(@Nonnull BlockState state, @Nonnull IBlockReader world, @Nonnull BlockPos pos, @Nonnull ISelectionContext context) {
return SHAPE;
}

@Override
public boolean isReplaceable(BlockState state, @Nonnull BlockItemUseContext context) {
public boolean isReplaceable(@Nonnull BlockState state, @Nonnull BlockItemUseContext context) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.teammetallurgy.atum.blocks.vegetation;

import net.minecraft.block.AbstractBlock;
import net.minecraft.block.DoublePlantBlock;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraftforge.common.PlantType;

public class TallDryGrass extends DoublePlantBlock {

public TallDryGrass() {
super(AbstractBlock.Properties.create(Material.TALL_PLANTS).doesNotBlockMovement().zeroHardnessAndResistance().sound(SoundType.PLANT));
}

@Override
public PlantType getPlantType(IBlockReader world, BlockPos pos) {
return PlantType.DESERT;
}
}
10 changes: 5 additions & 5 deletions src/main/java/com/teammetallurgy/atum/client/ClientHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,15 @@ public static void init() {
itemColor.register((stack, tintIndex) -> tintIndex > 0 ? -1 : ((DyeableTexturedArmor) stack.getItem()).getColor(stack), AtumItems.WANDERER_HELMET, AtumItems.WANDERER_CHEST, AtumItems.WANDERER_LEGS, AtumItems.WANDERER_BOOTS, AtumItems.DESERT_HELMET_IRON, AtumItems.DESERT_CHEST_IRON, AtumItems.DESERT_LEGS_IRON, AtumItems.DESERT_BOOTS_IRON, AtumItems.DESERT_HELMET_GOLD, AtumItems.DESERT_CHEST_GOLD, AtumItems.DESERT_LEGS_GOLD, AtumItems.DESERT_BOOTS_GOLD, AtumItems.DESERT_HELMET_DIAMOND, AtumItems.DESERT_CHEST_DIAMOND, AtumItems.DESERT_LEGS_DIAMOND, AtumItems.DESERT_BOOTS_DIAMOND);
//Dead Grass
itemColor.register((stack, tintIndex) -> {
BlockState blockState = ((BlockItem) stack.getItem()).getBlock().getDefaultState();
return blockColors.getColor(blockState, null, null, tintIndex);
}, AtumBlocks.DEAD_GRASS);
return 12889745;
}, AtumBlocks.DRY_GRASS, AtumBlocks.TALL_DRY_GRASS);
blockColors.register((state, world, pos, tintIndex) -> {
if (world != null && pos != null) {
return BiomeColors.getGrassColor(world, pos);
} else {
return 12889745;
}
}, AtumBlocks.DEAD_GRASS);
}, AtumBlocks.DRY_GRASS, AtumBlocks.TALL_DRY_GRASS);
ItemModelsProperties.registerProperty(AtumItems.ANUBIS_WRATH, new ResourceLocation("tier"), (stack, world, entity) -> AnubisWrathItem.getTier(stack));
ItemModelsProperties.registerProperty(AtumItems.TEFNUTS_CALL, new ResourceLocation("throwing"), (stack, world, entity) -> entity != null && entity.isHandActive() && entity.getActiveItemStack() == stack ? 1.0F : 0.0F);
registerBowModelProperties(AtumItems.SHORT_BOW);
Expand All @@ -111,7 +110,8 @@ public static void registerModels(ModelRegistryEvent event) {
RenderType translucent = RenderType.getTranslucent();
RenderTypeLookup.setRenderLayer(AtumBlocks.ANPUTS_FINGERS, cutoutMipped);
RenderTypeLookup.setRenderLayer(AtumBlocks.OASIS_GRASS, cutoutMipped);
RenderTypeLookup.setRenderLayer(AtumBlocks.DEAD_GRASS, cutoutMipped);
RenderTypeLookup.setRenderLayer(AtumBlocks.DRY_GRASS, cutoutMipped);
RenderTypeLookup.setRenderLayer(AtumBlocks.TALL_DRY_GRASS, cutoutMipped);
RenderTypeLookup.setRenderLayer(AtumBlocks.SHRUB, cutoutMipped);
RenderTypeLookup.setRenderLayer(AtumBlocks.WEED, cutoutMipped);
RenderTypeLookup.setRenderLayer(AtumBlocks.OPHIDIAN_TONGUE, cutoutMipped);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected int getRandomRabbitType(IWorld world) {
return i <= 30 ? 2 : 3;
} else if (biomeKey.equals(AtumBiomes.LIMESTONE_CRAGS)) {
return i <= 30 ? 3 : 4;
} else if (biomeKey.equals(AtumBiomes.DEADWOOD_FOREST)) {
} else if (biomeKey.equals(AtumBiomes.SPARSE_WOODS) || biomeKey.equals(AtumBiomes.DENSE_WOODS)) {
return i <= 50 ? 2 : 3;
} else if (biomeKey.equals(AtumBiomes.OASIS)) {
return i <= 50 ? 2 : 3;
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/teammetallurgy/atum/init/AtumBiomes.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
@Mod.EventBusSubscriber(modid = Atum.MOD_ID)
public class AtumBiomes {
public static final RegistryKey<Biome> DEAD_OASIS = registerBiome(AtumBiomeMaker.makeDeadOasis("dead_oasis"), "dead_oasis", BiomeRegion.STRANGE_SANDS);
public static final RegistryKey<Biome> DEADWOOD_FOREST = registerBiome(AtumBiomeMaker.makeDeadwoodForest("deadwood_forest"), "deadwood_forest", 10, BiomeRegion.DESSICATED_WOODS);
public static final RegistryKey<Biome> DENSE_WOODS = registerBiome(AtumBiomeMaker.makeDenseWoods("dense_woods"), "dense_woods", 10, BiomeRegion.DESSICATED_WOODS);
public static final RegistryKey<Biome> SPARSE_WOODS = registerBiome(AtumBiomeMaker.makeSparseWoods("sparse_woods"), "sparse_woods", 10, BiomeRegion.DESSICATED_WOODS);
public static final RegistryKey<Biome> DRIED_RIVER = registerBiome(AtumBiomeMaker.makeDriedRiver("dried_river"), "dried_river", BiomeRegion.STRANGE_SANDS);
public static final RegistryKey<Biome> LIMESTONE_CRAGS = registerBiome(AtumBiomeMaker.makeLimestoneCrags("limestone_crags"), "limestone_crags", 3, BiomeRegion.LIMESTONE_PEAKS);
public static final RegistryKey<Biome> LIMESTONE_MOUNTAINS = registerBiome(AtumBiomeMaker.makeLimestoneMountain("limestone_mountains"), "limestone_mountains", 5, BiomeRegion.LIMESTONE_PEAKS);
Expand Down Expand Up @@ -42,7 +43,8 @@ public static void addBiomeTags() {
}
}
BiomeDictionary.addTypes(DEAD_OASIS, BiomeTags.OASIS, BiomeDictionary.Type.DEAD, BiomeDictionary.Type.RARE);
BiomeDictionary.addTypes(DEADWOOD_FOREST, BiomeDictionary.Type.FOREST);
BiomeDictionary.addTypes(DENSE_WOODS, BiomeDictionary.Type.FOREST);
BiomeDictionary.addTypes(SPARSE_WOODS, BiomeDictionary.Type.FOREST);
BiomeDictionary.addTypes(DRIED_RIVER, BiomeDictionary.Type.RIVER);
BiomeDictionary.addTypes(LIMESTONE_CRAGS, BiomeDictionary.Type.HILLS, BiomeDictionary.Type.RARE);
BiomeDictionary.addTypes(LIMESTONE_MOUNTAINS, BiomeDictionary.Type.MOUNTAIN);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/teammetallurgy/atum/init/AtumBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public class AtumBlocks {
public static final Block EMMER_WHEAT = registerBlock(new EmmerBlock(), null, "emmer_wheat");
public static final Block ANPUTS_FINGERS = registerBlock(new AnputsFingersBlock(), null, "anputs_fingers");
public static final Block OASIS_GRASS = registerBlock(new OasisGrassBlock(), "oasis_grass");
public static final Block DEAD_GRASS = registerBlock(new DeadGrassBlock(), "dead_grass");
public static final Block DRY_GRASS = registerBlock(new DryGrassBlock(), "dry_grass");
public static final Block TALL_DRY_GRASS = registerBlock(new TallDryGrass(), "tall_dry_grass");
public static final Block SHRUB = registerBlock(new ShrubBlock(), "shrub");
public static final Block WEED = registerBlock(new ShrubBlock(), "weed");
public static final Block PAPYRUS = registerBlock(new PapyrusBlock(), null, "papyrus");
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/com/teammetallurgy/atum/init/AtumFeatures.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.fluid.Fluids;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.gen.blockplacer.ColumnBlockPlacer;
import net.minecraft.world.gen.blockplacer.DoublePlantBlockPlacer;
import net.minecraft.world.gen.blockplacer.SimpleBlockPlacer;
import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider;
import net.minecraft.world.gen.feature.*;
Expand Down Expand Up @@ -37,9 +38,12 @@ public class AtumFeatures {

//Feature Configs
public static final BlockClusterFeatureConfig OASIS_GRASS_CONFIG = (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(AtumBlocks.OASIS_GRASS.getDefaultState()), new SimpleBlockPlacer())).tries(64).build();
public static final BlockClusterFeatureConfig DEAD_GRASS_CONFIG = (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(AtumBlocks.DEAD_GRASS.getDefaultState()), new SimpleBlockPlacer())).tries(2).build();
public static final BlockClusterFeatureConfig ANPUTS_FINGERS_CONFIG = (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(AtumBlocks.ANPUTS_FINGERS.getDefaultState()), new SimpleBlockPlacer())).build();
public static final BlockClusterFeatureConfig PAPYRUS_CONFIG = (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(AtumBlocks.PAPYRUS.getDefaultState()), new ColumnBlockPlacer(1, 2))).tries(32).xSpread(2).ySpread(0).zSpread(2).func_227317_b_().requiresWater().build();
public static final BlockClusterFeatureConfig DENSE_DRY_GRASS_CONFIG = (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(AtumBlocks.DRY_GRASS.getDefaultState()), new SimpleBlockPlacer())).tries(30).build();
public static final BlockClusterFeatureConfig SPARSE_DRY_GRASS_CONFIG = (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(AtumBlocks.DRY_GRASS.getDefaultState()), new SimpleBlockPlacer())).tries(16).build();
public static final BlockClusterFeatureConfig DRY_TALL_GRASS_CONFIG = (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(AtumBlocks.TALL_DRY_GRASS.getDefaultState()), new DoublePlantBlockPlacer())).tries(20).build();
public static final BlockClusterFeatureConfig SPARSE_TALL_GRASS_CONFIG = (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(AtumBlocks.TALL_DRY_GRASS.getDefaultState()), new DoublePlantBlockPlacer())).tries(2).build();
public static final BlockClusterFeatureConfig ANPUTS_FINGERS_CONFIG = (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(AtumBlocks.ANPUTS_FINGERS.getDefaultState()), new SimpleBlockPlacer())).tries(10).build();
public static final BlockClusterFeatureConfig PAPYRUS_CONFIG = (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(AtumBlocks.PAPYRUS.getDefaultState()), new ColumnBlockPlacer(1, 2))).tries(8).xSpread(2).ySpread(0).zSpread(2).requiresWater().build();
public static final BaseTreeFeatureConfig PALM_TREE_CONFIG = (new BaseTreeFeatureConfig.Builder(new SimpleBlockStateProvider(AtumBlocks.PALM_LOG.getDefaultState()), new SimpleBlockStateProvider(AtumBlocks.PALM_LEAVES.getDefaultState()), new PalmFoliagePlacer(0.1F), new PalmTrunkPlacer(4, 1, 5, 0.25F), new TwoLayerFeature(0, 0, 0))).setIgnoreVines().build();
public static final BaseTreeFeatureConfig PALM_TREE_CONFIG_SAPLING = (new BaseTreeFeatureConfig.Builder(new SimpleBlockStateProvider(AtumBlocks.PALM_LOG.getDefaultState()), new SimpleBlockStateProvider(AtumBlocks.PALM_LEAVES.getDefaultState()), new PalmFoliagePlacer(0.1F), new PalmTrunkPlacer(4, 1, 5, 0.0F), new TwoLayerFeature(0, 0, 0))).setIgnoreVines().build();
public static final BaseTreeFeatureConfig DEAD_PALM_TREE_CONFIG = (new BaseTreeFeatureConfig.Builder(new SimpleBlockStateProvider(AtumBlocks.DEADWOOD_LOG.getDefaultState().with(DeadwoodLogBlock.HAS_SCARAB, true)), new SimpleBlockStateProvider(AtumBlocks.DEADWOOD_LEAVES.getDefaultState()), new PalmFoliagePlacer(0.0F), new PalmTrunkPlacer(4, 1, 5, 0.0F), new TwoLayerFeature(0, 0, 0))).setIgnoreVines().build();
Expand Down

0 comments on commit 115946f

Please sign in to comment.