Mak sure double-tall plants drop (#38)

This commit is contained in:
Frank 2022-10-08 10:46:36 +02:00
parent f13add113b
commit 5af8d3057e

View file

@ -46,19 +46,19 @@ public abstract class BaseDoublePlantBlock extends BaseBlockNotFull implements R
public BaseDoublePlantBlock() { public BaseDoublePlantBlock() {
this( this(
Properties.of(Material.PLANT) Properties.of(Material.PLANT)
.sound(SoundType.GRASS) .sound(SoundType.GRASS)
.noCollission() .noCollission()
.offsetType(BlockBehaviour.OffsetType.NONE) .offsetType(BlockBehaviour.OffsetType.NONE)
); );
} }
public BaseDoublePlantBlock(int light) { public BaseDoublePlantBlock(int light) {
this( this(
Properties.of(Material.PLANT) Properties.of(Material.PLANT)
.sound(SoundType.GRASS) .sound(SoundType.GRASS)
.lightLevel((state) -> state.getValue(TOP) ? light : 0) .lightLevel((state) -> state.getValue(TOP) ? light : 0)
.noCollission() .noCollission()
.offsetType(BlockBehaviour.OffsetType.NONE) .offsetType(BlockBehaviour.OffsetType.NONE)
); );
} }
@ -114,10 +114,6 @@ public abstract class BaseDoublePlantBlock extends BaseBlockNotFull implements R
@Override @Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) { public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
if (state.getValue(TOP)) {
return Lists.newArrayList();
}
ItemStack tool = builder.getParameter(LootContextParams.TOOL); ItemStack tool = builder.getParameter(LootContextParams.TOOL);
if (tool != null && BaseShearsItem.isShear(tool) || EnchantmentHelper.getItemEnchantmentLevel( if (tool != null && BaseShearsItem.isShear(tool) || EnchantmentHelper.getItemEnchantmentLevel(
Enchantments.SILK_TOUCH, Enchantments.SILK_TOUCH,