This commit is contained in:
paulevsGitch 2020-12-04 21:36:43 +03:00
parent 2a0c3ee1e0
commit 77ce5a80a0
7 changed files with 63 additions and 9 deletions

View file

@ -47,4 +47,14 @@ public class BlockBubbleCoral extends BlockUnderwaterPlant {
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ePos) {
return SHAPE;
}
@Override
public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient) {
return false;
}
@Override
public boolean canGrow(World world, Random random, BlockPos pos, BlockState state) {
return false;
}
}

View file

@ -2,6 +2,7 @@ package ru.betterend.blocks;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import com.google.common.collect.Lists;
@ -26,6 +27,7 @@ import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldAccess;
import net.minecraft.world.WorldView;
import ru.betterend.blocks.BlockProperties.TripleShape;
@ -103,4 +105,14 @@ public class BlockEndLily extends BlockUnderwaterPlant {
public ItemStack getPickStack(BlockView world, BlockPos pos, BlockState state) {
return new ItemStack(EndBlocks.END_LILY_SEED);
}
@Override
public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient) {
return false;
}
@Override
public boolean canGrow(World world, Random random, BlockPos pos, BlockState state) {
return false;
}
}

View file

@ -1,12 +1,18 @@
package ru.betterend.blocks;
import java.util.Random;
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;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.EnumProperty;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
import ru.betterend.blocks.BlockProperties.HydraluxShape;
import ru.betterend.blocks.basis.BlockUnderwaterPlant;
@ -24,6 +30,11 @@ public class BlockHydralux extends BlockUnderwaterPlant {
.noCollision());
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> stateManager) {
stateManager.add(SHAPE);
}
@Override
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
BlockState down = world.getBlockState(pos.down());
@ -38,4 +49,14 @@ public class BlockHydralux extends BlockUnderwaterPlant {
return down.isOf(this) && world.getBlockState(pos.up()).isOf(this);
}
}
@Override
public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient) {
return false;
}
@Override
public boolean canGrow(World world, Random random, BlockPos pos, BlockState state) {
return false;
}
}

View file

@ -31,14 +31,19 @@ public class BlockHydraluxSpore extends BlockUnderwaterPlantWithAge {
BlocksHelper.setWithoutUpdate(world, pos, state.with(BlockProperties.HYDRALUX_SHAPE, HydraluxShape.ROOTS));
for (int i = 1; i < h - 2; i++) {
mut.setY(pos.getY() + i);
BlocksHelper.setWithoutUpdate(world, pos, state.with(BlockProperties.HYDRALUX_SHAPE, HydraluxShape.VINE));
BlocksHelper.setWithoutUpdate(world, mut, state.with(BlockProperties.HYDRALUX_SHAPE, HydraluxShape.VINE));
}
mut.setY(mut.getY() + 1);
boolean big = random.nextBoolean();
BlocksHelper.setWithoutUpdate(world, pos, state.with(BlockProperties.HYDRALUX_SHAPE, big ? HydraluxShape.FLOWER_BIG_BOTTOM : HydraluxShape.FLOWER_SMALL_BOTTOM));
BlocksHelper.setWithoutUpdate(world, mut, state.with(BlockProperties.HYDRALUX_SHAPE, big ? HydraluxShape.FLOWER_BIG_BOTTOM : HydraluxShape.FLOWER_SMALL_BOTTOM));
mut.setY(mut.getY() + 1);
BlocksHelper.setWithoutUpdate(world, pos, state.with(BlockProperties.HYDRALUX_SHAPE, big ? HydraluxShape.FLOWER_BIG_TOP : HydraluxShape.FLOWER_SMALL_TOP));
BlocksHelper.setWithoutUpdate(world, mut, state.with(BlockProperties.HYDRALUX_SHAPE, big ? HydraluxShape.FLOWER_BIG_TOP : HydraluxShape.FLOWER_SMALL_TOP));
}
@Override
protected boolean isTerrain(BlockState state) {
return state.isOf(EndBlocks.SULPHURIC_ROCK.stone);
}
}

View file

@ -6,8 +6,8 @@
{ "model": "betterend:block/hydralux_flower_big_3_bottom" }
],
"shape=flower_big_top": { "model": "betterend:block/hydralux_flower_big_top" },
"shape=flower_small_bottom": { "model": "betterend:block/hydrothermal_vent" },
"shape=flower_small_top": { "model": "betterend:block/hydralux_flower_small_bottom" },
"shape=flower_small_bottom": { "model": "betterend:block/hydralux_flower_small_bottom" },
"shape=flower_small_top": { "model": "betterend:block/hydralux_flower_small_top" },
"shape=vine": { "model": "betterend:block/hydralux_vine" },
"shape=roots": { "model": "betterend:block/hydralux_roots" }
}

View file

@ -13,10 +13,10 @@
"shade": false,
"faces": {
"up": { "uv": [ 3, 3, 13, 13 ], "texture": "#petal_top" },
"north": { "uv": [ 3, 8, 13, 16 ], "texture": "#texture" },
"south": { "uv": [ 3, 8, 13, 16 ], "texture": "#texture" },
"west": { "uv": [ 3, 8, 13, 16 ], "texture": "#texture" },
"east": { "uv": [ 3, 8, 13, 16 ], "texture": "#texture" }
"north": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" },
"south": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" },
"west": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" },
"east": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }
}
}
]

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "betterend:item/hydralux_spore"
}
}