Package net.glowstone.generator.objects
Class RandomItemsContent
java.lang.Object
net.glowstone.generator.objects.RandomItemsContent
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addItem
(RandomItemsContent.RandomAmountItem item, int weight) boolean
fillContainer
(Random random, org.bukkit.block.BlockState state, int maxStacks) Populates a container with random items.getRandomItem
(Random random) Choose a randomRandomItemsContent.RandomAmountItem
.
-
Constructor Details
-
RandomItemsContent
public RandomItemsContent()
-
-
Method Details
-
addItem
-
fillContainer
Populates a container with random items.- Parameters:
random
- the PRNG to usestate
- the block state for a container blockmaxStacks
- the maximum number of slots to fill- Returns:
- true if successful (currently always true)
-
getRandomItem
Choose a randomRandomItemsContent.RandomAmountItem
.- Parameters:
random
- the PRNG to use- Returns:
- the random item
-