LootContext
-> LootParams
This commit is contained in:
parent
cfd9994233
commit
e8cddbda54
32 changed files with 63 additions and 63 deletions
|
@ -17,7 +17,7 @@ import net.minecraft.world.item.enchantment.Enchantments;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
@ -72,7 +72,7 @@ public class AncientEmeraldIceBlock extends BaseBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
ItemStack tool = builder.getOptionalParameter(LootContextParams.TOOL);
|
||||
if (tool != null && EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) != 0) {
|
||||
return Collections.singletonList(new ItemStack(this));
|
||||
|
|
|
@ -22,7 +22,7 @@ import net.minecraft.world.level.block.AbstractGlassBlock;
|
|||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
@ -99,7 +99,7 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements RenderLaye
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
ItemStack tool = builder.getParameter(LootContextParams.TOOL);
|
||||
if (tool != null && tool.isCorrectToolForDrops(state)) {
|
||||
int count = 0;
|
||||
|
|
|
@ -12,7 +12,7 @@ import net.minecraft.world.level.LevelReader;
|
|||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
|
@ -49,7 +49,7 @@ public class BoluxMushroomBlock extends EndPlantBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
return Lists.newArrayList(new ItemStack(this));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.material.Fluids;
|
||||
|
||||
import net.minecraft.world.level.material.PushReaction;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class BuddingSmaragdantCrystalBlock extends LitPillarBlock implements Add
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
|
@ -22,7 +22,7 @@ public class BulbVineBlock extends BaseVineBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
if (state.getValue(SHAPE) == TripleShape.BOTTOM) {
|
||||
return Lists.newArrayList(new ItemStack(EndItems.GLOWING_BULB));
|
||||
} else if (MHelper.RANDOM.nextInt(8) == 0) {
|
||||
|
|
|
@ -14,7 +14,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
@ -51,7 +51,7 @@ public class CavePumpkinBlock extends BaseBlockNotFull implements RenderLayerPro
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
return state.getValue(SMALL)
|
||||
? Collections.singletonList(new ItemStack(EndBlocks.CAVE_PUMPKIN_SEED))
|
||||
: Collections
|
||||
|
|
|
@ -9,7 +9,7 @@ import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
|||
import net.minecraft.world.item.enchantment.Enchantments;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
@ -28,7 +28,7 @@ public class DenseEmeraldIceBlock extends BaseBlock implements RenderLayerProvid
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
ItemStack tool = builder.getOptionalParameter(LootContextParams.TOOL);
|
||||
if (tool != null && EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) != 0) {
|
||||
return Collections.singletonList(new ItemStack(this));
|
||||
|
|
|
@ -20,7 +20,7 @@ import net.minecraft.world.level.block.HalfTransparentBlock;
|
|||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
|
@ -85,7 +85,7 @@ public class EmeraldIceBlock extends HalfTransparentBlock implements RenderLayer
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
ItemStack tool = builder.getOptionalParameter(LootContextParams.TOOL);
|
||||
if (tool != null && EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) != 0) {
|
||||
return Collections.singletonList(new ItemStack(this));
|
||||
|
|
|
@ -23,7 +23,7 @@ import net.minecraft.world.level.block.state.StateDefinition;
|
|||
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
@ -97,7 +97,7 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock implements AddMineable
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
if (state.getValue(SHAPE) == TripleShape.TOP) {
|
||||
return Lists.newArrayList(
|
||||
new ItemStack(EndItems.END_LILY_LEAF, MHelper.randRange(1, 2, MHelper.RANDOM_SOURCE)),
|
||||
|
|
|
@ -10,7 +10,7 @@ import net.minecraft.world.level.BlockGetter;
|
|||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
|
@ -46,7 +46,7 @@ public class EndLotusFlowerBlock extends EndPlantBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
int count = MHelper.randRange(1, 2, MHelper.RANDOM_SOURCE);
|
||||
return Lists.newArrayList(new ItemStack(EndBlocks.END_LOTUS_SEED, count));
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
|||
import net.minecraft.world.level.block.state.properties.DirectionProperty;
|
||||
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
|
||||
|
@ -92,7 +92,7 @@ public class EndStoneSmelter extends BaseBlockWithEntity implements AlloyingReci
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
List<ItemStack> drop = Lists.newArrayList(new ItemStack(this));
|
||||
BlockEntity blockEntity = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY);
|
||||
if (blockEntity instanceof EndStoneSmelterBlockEntity) {
|
||||
|
|
|
@ -14,7 +14,7 @@ import net.minecraft.world.level.block.Block;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.FallingBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
@ -36,7 +36,7 @@ public class EndstoneDustBlock extends FallingBlock implements TagProvider, AddM
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
return Collections.singletonList(new ItemStack(this));
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import net.minecraft.world.level.block.entity.BlockEntity;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
@ -109,7 +109,7 @@ public class EternalPedestal extends PedestalBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
if (state.is(this)) {
|
||||
EndBlockProperties.PedestalState currentState = state.getValue(EndBlockProperties.PEDESTAL_STATE);
|
||||
if (currentState.equals(EndBlockProperties.PedestalState.BOTTOM) || currentState.equals(EndBlockProperties.PedestalState.PILLAR)) {
|
||||
|
|
|
@ -16,7 +16,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
|
@ -45,7 +45,7 @@ public class FlamaeaBlock extends EndPlantBlock implements CustomItemProvider, A
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
return Lists.newArrayList(new ItemStack(this));
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ import net.minecraft.world.level.block.SaplingBlock;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
import net.minecraft.world.level.storage.loot.LootContext.Builder;
|
||||
import net.minecraft.world.level.storage.loot.LootParams.Builder;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
|
|
|
@ -23,7 +23,7 @@ import net.minecraft.world.level.block.state.StateDefinition;
|
|||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
|
||||
import net.minecraft.world.level.material.MapColor;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
|
@ -78,7 +78,7 @@ public class HelixTreeLeavesBlock extends BaseBlock implements CustomColorProvid
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
return BaseLeavesBlock.getLeaveDrops(this, EndBlocks.HELIX_TREE_SAPLING, builder, 16, 32);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import net.minecraft.world.level.block.Block;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
@ -78,7 +78,7 @@ public class HydraluxBlock extends UnderwaterPlantBlock implements AddMineableSh
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
HydraluxShape shape = state.getValue(SHAPE);
|
||||
if (shape == HydraluxShape.FLOWER_BIG_BOTTOM || shape == HydraluxShape.FLOWER_SMALL_BOTTOM) {
|
||||
return Lists.newArrayList(new ItemStack(
|
||||
|
|
|
@ -24,7 +24,7 @@ import net.minecraft.world.level.block.SlimeBlock;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
@ -70,7 +70,7 @@ public class JellyshroomCapBlock extends SlimeBlock implements RenderLayerProvid
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
return Lists.newArrayList(new ItemStack(this));
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
@ -66,7 +66,7 @@ public class LanceleafBlock extends EndPlantBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
if (state.getValue(SHAPE) == PentaShape.BOTTOM) {
|
||||
return Collections.singletonList(new ItemStack(EndBlocks.LANCELEAF_SEED));
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
|
@ -91,7 +91,7 @@ public class LumecornBlock extends BaseBlockNotFull implements RenderLayerProvid
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
EndBlockProperties.LumecornShape shape = state.getValue(SHAPE);
|
||||
if (shape == EndBlockProperties.LumecornShape.BOTTOM_BIG || shape == EndBlockProperties.LumecornShape.BOTTOM_SMALL || shape == EndBlockProperties.LumecornShape.MIDDLE) {
|
||||
return Collections.singletonList(new ItemStack(
|
||||
|
|
|
@ -15,7 +15,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.SnowLayerBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.lighting.LayerLightEngine;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
@ -30,7 +30,7 @@ public class MossyDragonBoneBlock extends BaseRotatedPillarBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
ItemStack tool = builder.getParameter(LootContextParams.TOOL);
|
||||
if (tool != null && EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) {
|
||||
return Collections.singletonList(new ItemStack(this));
|
||||
|
|
|
@ -14,7 +14,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.SnowLayerBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.lighting.LayerLightEngine;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
@ -28,7 +28,7 @@ public class MossyObsidian extends BaseBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
ItemStack tool = builder.getParameter(LootContextParams.TOOL);
|
||||
if (tool != null && EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) > 0) {
|
||||
return Collections.singletonList(new ItemStack(this));
|
||||
|
|
|
@ -16,7 +16,7 @@ import net.minecraft.world.level.BlockGetter;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.pathfinder.PathComputationType;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
@ -33,7 +33,7 @@ public class NeedlegrassBlock extends EndPlantBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
ItemStack tool = builder.getParameter(LootContextParams.TOOL);
|
||||
if (tool != null && BaseShearsItem.isShear(tool) || EnchantmentHelper.getItemEnchantmentLevel(
|
||||
Enchantments.SILK_TOUCH,
|
||||
|
|
|
@ -36,7 +36,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
@ -142,7 +142,7 @@ public class RespawnObeliskBlock extends BaseBlock implements CustomColorProvide
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
if (state.getValue(SHAPE) == TripleShape.BOTTOM) {
|
||||
return Lists.newArrayList(new ItemStack(this));
|
||||
} else {
|
||||
|
|
|
@ -12,7 +12,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class RunedFlavolite extends BaseBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
if (BlocksHelper.isInvulnerableUnsafe(this.defaultBlockState())) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
|||
import net.minecraft.world.level.block.state.properties.DirectionProperty;
|
||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
@ -119,7 +119,7 @@ public class SilkMothNestBlock extends BaseBlock implements RenderLayerProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
return state.getValue(ACTIVE) ? Collections.singletonList(new ItemStack(this)) : Collections.emptyList();
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import net.minecraft.world.level.block.SoundType;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
|
@ -57,7 +57,7 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLa
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
ItemStack tool = builder.getParameter(LootContextParams.TOOL);
|
||||
if (tool != null && BaseShearsItem.isShear(tool) || EnchantmentHelper.getItemEnchantmentLevel(
|
||||
Enchantments.SILK_TOUCH,
|
||||
|
|
|
@ -25,7 +25,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
|||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
import net.minecraft.world.level.material.*;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
@ -65,7 +65,7 @@ public class SulphurCrystalBlock extends BaseAttachedBlock implements AddMineabl
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
return state.getValue(AGE) < 2 ? Collections.emptyList() : Lists.newArrayList(new ItemStack(
|
||||
EndItems.CRYSTALLINE_SULPHUR,
|
||||
MHelper.randRange(1, 3, MHelper.RANDOM_SOURCE)
|
||||
|
|
|
@ -20,7 +20,7 @@ import net.minecraft.world.level.block.SlimeBlock;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
@ -59,7 +59,7 @@ public class UmbrellaTreeMembraneBlock extends SlimeBlock implements RenderLayer
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
if (state.getValue(COLOR) > 0) {
|
||||
return Lists.newArrayList(new ItemStack(this));
|
||||
} else {
|
||||
|
|
|
@ -19,7 +19,7 @@ import net.minecraft.world.level.ItemLike;
|
|||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
|
@ -65,7 +65,7 @@ public class FurBlock extends BaseAttachedBlock implements RenderLayerProvider,
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
ItemStack tool = builder.getParameter(LootContextParams.TOOL);
|
||||
if (tool != null && BaseShearsItem.isShear(tool) || EnchantmentHelper.getItemEnchantmentLevel(
|
||||
Enchantments.SILK_TOUCH,
|
||||
|
|
|
@ -34,7 +34,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
|
@ -249,7 +249,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
|
||||
List<ItemStack> drop = Lists.newArrayList(super.getDrops(state, builder));
|
||||
if (state.is(this)) {
|
||||
if (isPlaceable(state)) {
|
||||
|
|
|
@ -11,7 +11,7 @@ import net.minecraft.world.item.enchantment.Enchantments;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.LootParams;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
@ -27,7 +27,7 @@ public abstract class BlockBehaviourMixin {
|
|||
@Inject(method = "getDrops", at = @At("HEAD"), cancellable = true)
|
||||
public void be_getDroppedStacks(
|
||||
BlockState state,
|
||||
LootContext.Builder builder,
|
||||
LootParams.Builder builder,
|
||||
CallbackInfoReturnable<List<ItemStack>> info
|
||||
) {
|
||||
if (state.is(Blocks.GLOWSTONE)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue