Some tree blocks (WIP)

This commit is contained in:
paulevsGitch 2021-01-16 04:17:30 +03:00
parent f9d765bee8
commit 59167a18f7
14 changed files with 58 additions and 3 deletions

View file

@ -16,6 +16,7 @@ public class BlockProperties {
public static final IntProperty ROTATION = IntProperty.of("rotation", 0, 3); public static final IntProperty ROTATION = IntProperty.of("rotation", 0, 3);
public static final BooleanProperty NATURAL = BooleanProperty.of("natural"); public static final BooleanProperty NATURAL = BooleanProperty.of("natural");
public static final IntProperty FULLNESS = IntProperty.of("fullness", 0, 3); public static final IntProperty FULLNESS = IntProperty.of("fullness", 0, 3);
public static final IntProperty COLOR = IntProperty.of("color", 0, 7);
public static enum TripleShape implements StringIdentifiable { public static enum TripleShape implements StringIdentifiable {
TOP("top"), TOP("top"),

View file

@ -0,0 +1,35 @@
package ru.betterend.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.MaterialColor;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.IntProperty;
import ru.betterend.blocks.basis.BaseBlock;
import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.util.MHelper;
public class CapsacisCapBlock extends BaseBlock {
public static final IntProperty COLOR = IntProperty.of("color", 0, 7);
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);
public CapsacisCapBlock(MaterialColor color) {
super(FabricBlockSettings.copyOf(Blocks.NETHER_WART_BLOCK).materialColor(color));
}
@Override
public BlockState getPlacementState(ItemPlacementContext ctx) {
double px = ctx.getBlockPos().getX() * 0.1;
double py = ctx.getBlockPos().getY() * 0.1;
double pz = ctx.getBlockPos().getZ() * 0.1;
return this.getDefaultState().with(COLOR, MHelper.floor(NOISE.eval(px, py, pz) * 3.5 + 4));
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> stateManager) {
stateManager.add(COLOR);
}
}

View file

@ -30,7 +30,7 @@ import ru.betterend.registry.EndBlocks;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
public class HelixTreeLeavesBlock extends BaseBlock implements IColorProvider { public class HelixTreeLeavesBlock extends BaseBlock implements IColorProvider {
public static final IntProperty COLOR = IntProperty.of("color", 0, 7); public static final IntProperty COLOR = BlockProperties.COLOR;
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0); private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);
public HelixTreeLeavesBlock() { public HelixTreeLeavesBlock() {

View file

@ -30,7 +30,7 @@ import ru.betterend.patterns.Patterns;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
public class JellyshroomCapBlock extends SlimeBlock implements IRenderTypeable, BlockPatterned, IColorProvider { public class JellyshroomCapBlock extends SlimeBlock implements IRenderTypeable, BlockPatterned, IColorProvider {
public static final IntProperty COLOR = IntProperty.of("color", 0, 7); public static final IntProperty COLOR = BlockProperties.COLOR;
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0); private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);
private final Vec3i colorStart; private final Vec3i colorStart;
private final Vec3i colorEnd; private final Vec3i colorEnd;

View file

@ -32,7 +32,7 @@ import ru.betterend.registry.EndBlocks;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
public class UmbrellaTreeMembraneBlock extends SlimeBlock implements IRenderTypeable, BlockPatterned { public class UmbrellaTreeMembraneBlock extends SlimeBlock implements IRenderTypeable, BlockPatterned {
public static final IntProperty COLOR = IntProperty.of("color", 0, 7); public static final IntProperty COLOR = BlockProperties.COLOR;
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0); private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);
public UmbrellaTreeMembraneBlock() { public UmbrellaTreeMembraneBlock() {

View file

@ -20,6 +20,7 @@ import ru.betterend.blocks.BulbVineBlock;
import ru.betterend.blocks.BulbVineLanternBlock; import ru.betterend.blocks.BulbVineLanternBlock;
import ru.betterend.blocks.BulbVineLanternColoredBlock; import ru.betterend.blocks.BulbVineLanternColoredBlock;
import ru.betterend.blocks.BulbVineSeedBlock; import ru.betterend.blocks.BulbVineSeedBlock;
import ru.betterend.blocks.CapsacisCapBlock;
import ru.betterend.blocks.CharniaBlock; import ru.betterend.blocks.CharniaBlock;
import ru.betterend.blocks.ChorusGrassBlock; import ru.betterend.blocks.ChorusGrassBlock;
import ru.betterend.blocks.DenseEmeraldIceBlock; import ru.betterend.blocks.DenseEmeraldIceBlock;
@ -192,6 +193,24 @@ public class EndBlocks {
public static final Block JELLYSHROOM_CAP_PURPLE = registerBlock("jellyshroom_cap_purple", new JellyshroomCapBlock(217, 142, 255, 164, 0, 255)); public static final Block JELLYSHROOM_CAP_PURPLE = registerBlock("jellyshroom_cap_purple", new JellyshroomCapBlock(217, 142, 255, 164, 0, 255));
public static final WoodenMaterial JELLYSHROOM = new WoodenMaterial("jellyshroom", MaterialColor.PURPLE, MaterialColor.LIGHT_BLUE); public static final WoodenMaterial JELLYSHROOM = new WoodenMaterial("jellyshroom", MaterialColor.PURPLE, MaterialColor.LIGHT_BLUE);
// Tree from original concept (+ modifications)
public static final Block CAPSACIS_SAPLING = registerBlock("capsacis_sapling", new UmbrellaTreeSaplingBlock());
public static final Block CAPSACIS_CAP_BLACK = registerBlock("capsacis_cap_black", new CapsacisCapBlock(MaterialColor.BLACK));
public static final Block CAPSACIS_CAP_WHITE = registerBlock("capsacis_cap_white", new CapsacisCapBlock(MaterialColor.WHITE));
public static final Block CAPSACIS_CAP_MAGENTA = registerBlock("capsacis_cap_magenta", new CapsacisCapBlock(MaterialColor.MAGENTA));
public static final WoodenMaterial CAPSACIS = new WoodenMaterial("capsacis", MaterialColor.PURPLE, MaterialColor.LIGHT_BLUE);
// Small ecosystem tree
public static final WoodenMaterial INANIS = new WoodenMaterial("inanis", MaterialColor.PURPLE, MaterialColor.LIGHT_BLUE);
// Tree from Yuki's ide
public static final Block CEMINUS_SAPLING = registerBlock("ceminus_sapling", new UmbrellaTreeSaplingBlock());
public static final Block CEMINUS_GRID = registerBlock("ceminus_grid", new UmbrellaTreeMembraneBlock());
public static final WoodenMaterial CEMINUS = new WoodenMaterial("ceminus", MaterialColor.PURPLE, MaterialColor.LIGHT_BLUE);
// For megacolonies
public static final Block VOID_COLONY_MEMBRANE = registerBlock("void_colony_membrane", new UmbrellaTreeMembraneBlock());
// Small Plants // // Small Plants //
public static final Block UMBRELLA_MOSS = registerBlock("umbrella_moss", new UmbrellaMossBlock()); public static final Block UMBRELLA_MOSS = registerBlock("umbrella_moss", new UmbrellaMossBlock());
public static final Block UMBRELLA_MOSS_TALL = registerBlock("umbrella_moss_tall", new UmbrellaMossTallBlock()); public static final Block UMBRELLA_MOSS_TALL = registerBlock("umbrella_moss_tall", new UmbrellaMossTallBlock());

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B