Continue mapping migration

This commit is contained in:
Aleksey 2021-04-12 21:38:22 +03:00
parent 99ade39404
commit f03fd03bd0
499 changed files with 12567 additions and 12723 deletions

View file

@ -1,15 +1,13 @@
package ru.betterend.blocks;
import java.util.List;
import com.google.common.collect.Lists;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.core.BlockPos;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.WorldView;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.loot.LootContext;
import com.google.common.collect.Lists;
import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.blocks.basis.VineBlock;
import ru.betterend.registry.EndBlocks;
@ -20,27 +18,28 @@ public class BulbVineBlock extends VineBlock {
public BulbVineBlock() {
super(15, true);
}
@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
if (state.getValue(SHAPE) == TripleShape.BOTTOM) {
return Lists.newArrayList(new ItemStack(EndItems.GLOWING_BULB));
} else if (MHelper.RANDOM.nextInt(8) == 0) {
}
else if (MHelper.RANDOM.nextInt(8) == 0) {
return Lists.newArrayList(new ItemStack(EndBlocks.BULB_VINE_SEED));
} else {
}
else {
return Lists.newArrayList();
}
}
@Override
public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient) {
public boolean isValidBonemealTarget(BlockGetter 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.is(this) && state.getValue(SHAPE) == TripleShape.BOTTOM) ? canPlace
: canPlace && world.getBlockState(pos.below()).is(this);
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
boolean canPlace = super.canSurvive(state, world, pos);
return (state.is(this) && state.getValue(SHAPE) == TripleShape.BOTTOM) ? canPlace : canPlace && world.getBlockState(pos.below()).is(this);
}
}