LeviLamina
Loading...
Searching...
No Matches
LootTableUtils.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated forward declare list
6// clang-format off
7class Actor;
9class BlockPos;
10class BlockSource;
11class Container;
12class ILevel;
13class ItemStack;
14class Level;
15class LootTable;
17class Player;
18class Random;
19class Spawner;
20struct DimensionType;
21// clang-format on
22
23namespace Util {
24
26public:
27 // static functions
28 // NOLINTBEGIN
29 MCAPI static ::std::string convertFromJavaLootTableName(::std::string const& lootTableName);
30
31 MCAPI static int dropItems(
32 ::BlockSource& region,
33 ::Spawner& spawner,
34 ::Actor* summoner,
35 ::std::vector<::ItemStack> const& items,
36 ::BlockPos const& position
37 );
38
39 MCAPI static int fillContainer(::Container& container, ::std::vector<::ItemStack>& items);
40
41 MCAPI static void fillContainer(
42 ::Level& level,
43 ::Container& container,
44 ::Random& random,
45 ::std::string const& tableName,
46 ::DimensionType dimensionId,
47 ::Actor* entity
48 );
49
50 MCAPI static ::std::vector<::ItemStack> generateRandomDeathLoot(
51 ::LootTable const& table,
52 ::Actor& lootSourceEntity,
53 ::ActorDamageSource const* damageSource,
54 ::ItemStack const* tool,
55 ::Player* killer,
56 float luck
57 );
58
59 MCAPI static ::std::vector<::ItemStack>
60 getRandomItems(::LootTable const& table, ::Random& random, ::LootTableContext& context);
61
62 MCAPI static ::std::vector<::ItemStack>
63 getRandomItems(::std::string const& tableName, ::Random& random, ::LootTableContext& context);
64
65 MCAPI static int givePlayer(::Player& player, ::std::vector<::ItemStack>& items, bool shouldAddWhenFull);
66
67 MCAPI static ::LootTable* lookupLootTable(::std::string const& tableName, ::ILevel& level);
68 // NOLINTEND
69};
70
71} // namespace Util
Definition ActorDamageSource.h:18
Definition Actor.h:125
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition Container.h:34
Definition ILevel.h:219
Definition ItemStack.h:35
Definition Level.h:255
Definition LootTableContext.h:21
Definition LootTable.h:15
Definition Player.h:137
Definition Random.h:10
Definition Spawner.h:43
Definition LootTableUtils.h:25
Definition DimensionType.h:5
Definition context.h:5