mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-28 15:56:14 +00:00
Below 300 errors
This commit is contained in:
1 parent
d0acd5fdb0
commit
27ec1e58fc
70 files changed
+394
-438
No files matched your search
@@ -33,6 +33,8 @@ import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IEnviromentBlockReader;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.storage.loot.LootContext;
|
||||
import net.minecraft.world.storage.loot.LootParameters;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
@@ -45,6 +47,7 @@ import vazkii.botania.common.block.decor.BlockFloatingFlower;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@@ -96,32 +99,16 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
|
||||
((TileEntitySpecialFlower) world.getTileEntity(pos)).onBlockHarvested(world, pos, state, player);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public boolean removedByPlayer(@Nonnull BlockState state, World world, @Nonnull BlockPos pos, @Nonnull PlayerEntity player, boolean willHarvest, IFluidState fluid) {
|
||||
if (willHarvest) {
|
||||
// Copy of super.removedByPlayer but don't set to air yet
|
||||
// This is so getDrops below will have a TE to work with
|
||||
onBlockHarvested(world, pos, state, player);
|
||||
return true;
|
||||
public List<ItemStack> getDrops(@Nonnull BlockState state, @Nonnull LootContext.Builder builder) {
|
||||
List<ItemStack> drops = super.getDrops(state, builder);
|
||||
TileEntity te = builder.get(LootParameters.BLOCK_ENTITY);
|
||||
|
||||
if(te instanceof TileEntitySpecialFlower) {
|
||||
return ((TileEntitySpecialFlower) te).getDrops(drops, builder);
|
||||
} else {
|
||||
return super.removedByPlayer(state, world, pos, player, willHarvest, fluid);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(@Nonnull World world, PlayerEntity player, @Nonnull BlockPos pos, @Nonnull BlockState state, TileEntity te, ItemStack stack) {
|
||||
super.harvestBlock(world, player, pos, state, te, stack);
|
||||
// Now delete the block and TE
|
||||
world.removeBlock(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops(@Nonnull BlockState state, NonNullList<ItemStack> list, World world, BlockPos pos, int fortune) {
|
||||
super.getDrops(state, list, world, pos, fortune);
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
if(tile != null) {
|
||||
((TileEntitySpecialFlower) tile).getDrops(list);
|
||||
return drops;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user