Block class rename
This commit is contained in:
parent
4b55bf30a8
commit
5f3547de8e
157 changed files with 748 additions and 756 deletions
47
src/main/java/ru/betterend/blocks/BulbVineBlock.java
Normal file
47
src/main/java/ru/betterend/blocks/BulbVineBlock.java
Normal file
|
@ -0,0 +1,47 @@
|
|||
package ru.betterend.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.loot.context.LootContext;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.WorldView;
|
||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||
import ru.betterend.blocks.basis.VineBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndItems;
|
||||
import ru.betterend.util.MHelper;
|
||||
|
||||
public class BulbVineBlock extends VineBlock {
|
||||
public BulbVineBlock() {
|
||||
super(15, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder) {
|
||||
if (state.get(SHAPE) == TripleShape.BOTTOM) {
|
||||
return Lists.newArrayList(new ItemStack(EndItems.GLOWING_BULB));
|
||||
}
|
||||
else if (MHelper.RANDOM.nextInt(8) == 0) {
|
||||
return Lists.newArrayList(new ItemStack(EndBlocks.BULB_VINE_SEED));
|
||||
}
|
||||
else {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
|
||||
boolean canPlace = super.canPlaceAt(state, world, pos);
|
||||
return (state.isOf(this) && state.get(SHAPE) == TripleShape.BOTTOM) ? canPlace : canPlace && world.getBlockState(pos.down()).isOf(this);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue