Package net.minecraft.server.command
Class LootCommand
java.lang.Object
net.minecraft.server.command.LootCommand
public class LootCommand extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interface
LootCommand.FeedbackMessage
(package private) static interface
LootCommand.SourceConstructor
(package private) static interface
LootCommand.Target
-
Field Summary
Fields Modifier and Type Field Description private static com.mojang.brigadier.exceptions.DynamicCommandExceptionType
NO_HELD_ITEMS_EXCEPTION
private static com.mojang.brigadier.exceptions.DynamicCommandExceptionType
NO_LOOT_TABLE_EXCEPTION
static com.mojang.brigadier.suggestion.SuggestionProvider<ServerCommandSource>
SUGGESTION_PROVIDER
-
Constructor Summary
Constructors Constructor Description LootCommand()
-
Method Summary
Modifier and Type Method Description private static <T extends com.mojang.brigadier.builder.ArgumentBuilder<ServerCommandSource, T>>
TaddTargetArguments(T rootArgument, LootCommand.SourceConstructor sourceConstructor)
private static int
executeBlock(ServerCommandSource source, BlockPos targetPos, int slot, int stackCount, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender)
private static int
executeFish(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Identifier lootTable, BlockPos pos, ItemStack stack, LootCommand.Target constructor)
private static int
executeGive(Collection<ServerPlayerEntity> players, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender)
private static int
executeInsert(ServerCommandSource source, BlockPos targetPos, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender)
private static int
executeKill(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Entity entity, LootCommand.Target constructor)
private static int
executeLoot(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Identifier lootTable, LootCommand.Target constructor)
private static int
executeMine(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, BlockPos pos, ItemStack stack, LootCommand.Target constructor)
private static int
executeReplace(Collection<? extends Entity> targets, int slot, int stackCount, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender)
private static int
executeSpawn(ServerCommandSource source, Vec3d pos, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender)
private static Inventory
getBlockInventory(ServerCommandSource source, BlockPos pos)
private static int
getFeedbackMessageSingle(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Identifier lootTable, LootContext lootContext, LootCommand.Target constructor)
private static ItemStack
getHeldItem(ServerCommandSource source, EquipmentSlot slot)
private static boolean
insert(Inventory inventory, ItemStack stack)
private static boolean
itemsMatch(ItemStack first, ItemStack second)
static void
register(com.mojang.brigadier.CommandDispatcher<ServerCommandSource> dispatcher)
private static void
replace(Entity entity, List<ItemStack> stacks, int slot, int stackCount, List<ItemStack> addedStacks)
private static void
sendDroppedFeedback(ServerCommandSource source, List<ItemStack> stacks)
private static void
sendDroppedFeedback(ServerCommandSource source, List<ItemStack> stacks, Identifier lootTable)
-
Field Details
-
SUGGESTION_PROVIDER
public static final com.mojang.brigadier.suggestion.SuggestionProvider<ServerCommandSource> SUGGESTION_PROVIDER -
NO_HELD_ITEMS_EXCEPTION
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType NO_HELD_ITEMS_EXCEPTION -
NO_LOOT_TABLE_EXCEPTION
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType NO_LOOT_TABLE_EXCEPTION
-
-
Constructor Details
-
LootCommand
public LootCommand()
-
-
Method Details
-
register
public static void register(com.mojang.brigadier.CommandDispatcher<ServerCommandSource> dispatcher) -
addTargetArguments
private static <T extends com.mojang.brigadier.builder.ArgumentBuilder<ServerCommandSource, T>> T addTargetArguments(T rootArgument, LootCommand.SourceConstructor sourceConstructor) -
getBlockInventory
private static Inventory getBlockInventory(ServerCommandSource source, BlockPos pos) throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
executeInsert
private static int executeInsert(ServerCommandSource source, BlockPos targetPos, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender) -
insert
-
executeBlock
private static int executeBlock(ServerCommandSource source, BlockPos targetPos, int slot, int stackCount, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender) -
itemsMatch
-
executeGive
private static int executeGive(Collection<ServerPlayerEntity> players, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender) -
replace
-
executeReplace
private static int executeReplace(Collection<? extends Entity> targets, int slot, int stackCount, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender) -
executeSpawn
private static int executeSpawn(ServerCommandSource source, Vec3d pos, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender) -
sendDroppedFeedback
-
sendDroppedFeedback
private static void sendDroppedFeedback(ServerCommandSource source, List<ItemStack> stacks, Identifier lootTable) -
getHeldItem
private static ItemStack getHeldItem(ServerCommandSource source, EquipmentSlot slot) throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
executeMine
private static int executeMine(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, BlockPos pos, ItemStack stack, LootCommand.Target constructor) -
executeKill
private static int executeKill(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Entity entity, LootCommand.Target constructor) -
executeLoot
private static int executeLoot(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Identifier lootTable, LootCommand.Target constructor) -
executeFish
private static int executeFish(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Identifier lootTable, BlockPos pos, ItemStack stack, LootCommand.Target constructor) -
getFeedbackMessageSingle
private static int getFeedbackMessageSingle(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Identifier lootTable, LootContext lootContext, LootCommand.Target constructor)
-