New textures

This commit is contained in:
paulevsGitch 2020-12-10 15:36:06 +03:00
parent ee60f73e53
commit b73f0f9972
14 changed files with 77 additions and 3 deletions

View file

@ -4,6 +4,7 @@ import java.util.Collections;
import java.util.List;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
@ -28,6 +29,7 @@ public class BlockHelixTreeLeaves extends BlockBase implements IColorProvider {
public BlockHelixTreeLeaves() {
super(FabricBlockSettings.of(Material.LEAVES)
.strength(0.2F)
.breakByTool(FabricToolTags.SHEARS)
.sounds(BlockSoundGroup.GRASS)
.materialColor(MaterialColor.ORANGE));
}

View file

@ -0,0 +1,19 @@
package ru.betterend.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.Material;
import net.minecraft.block.MaterialColor;
import net.minecraft.sound.BlockSoundGroup;
import ru.betterend.blocks.basis.BlockBase;
public class BlockHelixTreeLuminophor extends BlockBase {
public BlockHelixTreeLuminophor() {
super(FabricBlockSettings.of(Material.LEAVES)
.materialColor(MaterialColor.ORANGE)
.breakByTool(FabricToolTags.SHEARS)
.sounds(BlockSoundGroup.GRASS)
.strength(0.2F)
.luminance(15));
}
}

View file

@ -29,6 +29,7 @@ import ru.betterend.blocks.BlockEndLotusStem;
import ru.betterend.blocks.BlockEndstoneDust;
import ru.betterend.blocks.BlockGlowingMoss;
import ru.betterend.blocks.BlockHelixTreeLeaves;
import ru.betterend.blocks.BlockHelixTreeLuminophor;
import ru.betterend.blocks.BlockHelixTreeSapling;
import ru.betterend.blocks.BlockHydralux;
import ru.betterend.blocks.BlockHydraluxPetal;
@ -157,6 +158,7 @@ public class EndBlocks {
public static final Block HELIX_TREE_SAPLING = registerBlock("helix_tree_sapling", new BlockHelixTreeSapling());
public static final Block HELIX_TREE_LEAVES = registerBlock("helix_tree_leaves", new BlockHelixTreeLeaves());
public static final Block HELIX_TREE_LUMINOPHOR = registerBlock("helix_tree_luminophor", new BlockHelixTreeLuminophor());
public static final WoodenMaterial HELIX_TREE = new WoodenMaterial("helix_tree", MaterialColor.GRAY, MaterialColor.ORANGE);
// Small Plants //

View file

@ -31,6 +31,7 @@ public class HelixTreeFeature extends DefaultFeature {
@Override
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
if (!world.getBlockState(pos.down()).getBlock().isIn(EndTags.END_GROUND)) return false;
BlocksHelper.setWithoutUpdate(world, pos, AIR);
float angle = random.nextFloat() * MHelper.PI2;
float radiusRange = MHelper.randRange(4.5F, 6F, random);
@ -137,9 +138,9 @@ public class HelixTreeFeature extends DefaultFeature {
Mutable bPos = new Mutable();
for (int i = 0; i < count; i++) {
bPos.set(x + pos.getX(), y + pos.getY(), z + pos.getZ());
int color = MHelper.floor((float) i / (float) count * 7F + 0.5F) + offset;
color = MathHelper.clamp(color, 0, 7);
bPos.set(x + pos.getX(), y + pos.getY(), z + pos.getZ());
if (world.getBlockState(bPos).getMaterial().isReplaceable()) {
BlocksHelper.setWithoutUpdate(world, bPos, state.with(BlockHelixTreeLeaves.COLOR, color));
}