Java Code Examples for net.minecraft.world.World.getLootTableManager()

The following are Jave code examples for showing how to use getLootTableManager() of the net.minecraft.world.World class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: harshencastle   File: HarshenUtils.java   Source Code and License Vote up 5 votes
public static List<ItemStack> getItemsFromLootPool(World world, ResourceLocation locationOfTable, String poolName)
{
	LootContext context = new LootContext(1f, (WorldServer) world, world.getLootTableManager(), null, null, DamageSource.MAGIC);
	List<ItemStack> list = Lists.<ItemStack>newArrayList();
	world.getLootTableManager().getLootTableFromLocation(locationOfTable).getPool(poolName).generateLoot(list, new Random(), context);
	return exposeList(list);
}
 
Example 2
Project: harshencastle   File: HarshenUtils.java   Source Code and License Vote up 4 votes
public static List<ItemStack> getItemsFromLootTable(World world, ResourceLocation locationOfTable)
{
	LootContext context = new LootContext(1f, (WorldServer) world, world.getLootTableManager(), null, null, DamageSource.MAGIC);
	return exposeList(world.getLootTableManager().getLootTableFromLocation(locationOfTable).generateLootForPools(new Random(), context));
}