Recipes & leaves fixes
This commit is contained in:
parent
73fb181ffb
commit
be67e059f8
3 changed files with 23 additions and 0 deletions
|
@ -1,16 +1,23 @@
|
|||
package ru.betterend.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.AbstractBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.loot.context.LootContext;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.world.BlockView;
|
||||
import ru.betterend.blocks.basis.BlockPlant;
|
||||
import ru.betterend.registry.BlockRegistry;
|
||||
import ru.betterend.util.MHelper;
|
||||
|
||||
public class BlockEndLotusFlower extends BlockPlant {
|
||||
private static final VoxelShape SHAPE_OUTLINE = Block.createCuboidShape(2, 0, 2, 14, 14, 14);
|
||||
|
@ -39,4 +46,10 @@ public class BlockEndLotusFlower extends BlockPlant {
|
|||
public VoxelShape getCollisionShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ePos) {
|
||||
return SHAPE_COLLISION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder) {
|
||||
int count = MHelper.randRange(1, 2, MHelper.RANDOM);
|
||||
return Lists.newArrayList(new ItemStack(BlockRegistry.END_LOTUS_SEED, count));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
import net.minecraft.fluid.WaterFluid;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.EnumProperty;
|
||||
|
@ -15,6 +16,7 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.WorldView;
|
||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||
import ru.betterend.blocks.basis.BlockBaseNotFull;
|
||||
import ru.betterend.client.ERenderLayer;
|
||||
|
@ -30,6 +32,12 @@ public class BlockEndLotusLeaf extends BlockBaseNotFull implements IRenderTypeab
|
|||
super(FabricBlockSettings.of(Material.PLANT).nonOpaque().sounds(BlockSoundGroup.WET_GRASS));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
|
||||
BlockState down = world.getBlockState(pos.down());
|
||||
return !down.getFluidState().isEmpty() && down.getFluidState().getFluid() instanceof WaterFluid;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
|
||||
builder.add(SHAPE, HORIZONTAL_FACING);
|
||||
|
|
|
@ -81,6 +81,8 @@ public class CraftingRecipes {
|
|||
RecipeBuilder.make("umbrella_moss_tall_dye", Items.YELLOW_DYE).setList("#").addMaterial('#', BlockRegistry.UMBRELLA_MOSS_TALL).build();
|
||||
|
||||
RecipeBuilder.make("paper", Items.PAPER).setShape("###").addMaterial('#', ItemRegistry.END_LILY_LEAF_DRIED).setOutputCount(3).build();
|
||||
|
||||
RecipeBuilder.make("aurora_block", BlockRegistry.AURORA_CRYSTAL).setShape("##", "##").addMaterial('#', ItemRegistry.CRYSTAL_SHARDS).build();
|
||||
}
|
||||
|
||||
private static void registerHelmet(String name, Item material, Item result) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue