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

@ -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;
}
}