2024-01-18 20:52:59 +01:00
|
|
|
package com.minelittlepony.unicopia.block;
|
|
|
|
|
|
|
|
import java.util.function.Supplier;
|
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
import net.minecraft.block.BlockState;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.util.math.random.Random;
|
|
|
|
|
|
|
|
public class GoldenOakLeavesBlock extends FruitBearingBlock {
|
|
|
|
|
|
|
|
public GoldenOakLeavesBlock(Settings settings, int overlay, Supplier<Block> fruit,
|
|
|
|
Supplier<ItemStack> rottenFruitSupplier) {
|
|
|
|
super(settings, overlay, fruit, rottenFruitSupplier);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected boolean shouldAdvance(Random random) {
|
|
|
|
return random.nextInt(1000) == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2024-02-10 19:16:15 +01:00
|
|
|
public BlockState getPlacedFruitState(Random random) {
|
2024-01-18 20:52:59 +01:00
|
|
|
return super.getPlacedFruitState(random).with(EnchantedFruitBlock.ENCHANTED, random.nextInt(1000) == 0);
|
|
|
|
}
|
|
|
|
}
|