本文整理汇总了Java中net.minecraftforge.event.LootTableLoadEvent.getTable方法的典型用法代码示例。如果您正苦于以下问题:Java LootTableLoadEvent.getTable方法的具体用法?Java LootTableLoadEvent.getTable怎么用?Java LootTableLoadEvent.getTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.event.LootTableLoadEvent
的用法示例。
在下文中一共展示了LootTableLoadEvent.getTable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onLootTableLoad
import net.minecraftforge.event.LootTableLoadEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onLootTableLoad(LootTableLoadEvent evt)
{
LootTable table = evt.getTable();
FyrestonePool lp = new FyrestonePool();
if (evt.getName() == LootTableList.CHESTS_SIMPLE_DUNGEON)
{
lp.addItem(createLootEntry(ItemRegister.itemMysticalOrb, 0, 1, 1, 0.25));
}
if (evt.getName() == LootTableList.CHESTS_JUNGLE_TEMPLE)
{
lp.addItem(createLootEntry(ItemRegister.itemMysticalOrb, 0, 1, 1, 0.3));
}
if (evt.getName() == LootTableList.CHESTS_VILLAGE_BLACKSMITH)
{
lp.addItem(createLootEntry(ItemRegister.itemMysticalOrb, 0, 1, 1, 0.25));
}
if (evt.getName() == LootTableList.ENTITIES_ENDERMAN)
{
lp.addItem(createLootEntry(ItemRegister.itemMysticalOrb, 0, 1, 1, 0.1));
}
if (!lp.isEmpty())
{
table.addPool(lp);
}
}
示例2: onLootTableLoad
import net.minecraftforge.event.LootTableLoadEvent; //导入方法依赖的package包/类
@SubscribeEvent
public static void onLootTableLoad(LootTableLoadEvent e) {
final ResourceLocation rl = e.getName();
if (rl.equals(LootTableList.CHESTS_VILLAGE_BLACKSMITH) || rl.equals(LootTableList.CHESTS_ABANDONED_MINESHAFT) || rl.equals(LootTableList.CHESTS_JUNGLE_TEMPLE)) {
final LootTable lt = e.getTable();
LootPool lp = lt.getPool("pool0");
if (lp == null)
lp = lt.getPool("main");
if (lp != null) {
lp.addEntry(new LootEntryItem(MCFluxResources.UPCHIP, 20, 0, new LootFunction[0], new LootCondition[0], "mcflux:loot/upchip"));
}
}
}
示例3: onLootLoad
import net.minecraftforge.event.LootTableLoadEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority= EventPriority.NORMAL)
public void onLootLoad(LootTableLoadEvent event){
if(event.getName().getResourceDomain().equals("minecraft") == false) return; // loot table from another mod (too fancy for ALT)
String categoryAndEntry = event.getName().getResourcePath(); // e.g. "chests/abandoned_mineshaft"
if(categoryAndEntry.contains("/") == false) return; // not valid
// category is "chests" or "entities"
String category = categoryAndEntry.substring(0,categoryAndEntry.indexOf('/'));
// entry is the name of the loot table (e.g. "abandoned_mineshaft")
String entry = categoryAndEntry.substring(categoryAndEntry.indexOf('/')+1,categoryAndEntry.length());
final Map<String, Map<String, List<LootPool>>> additional_loot = AdditionalLootTables.getAdditionalLootTables();
if(additional_loot.containsKey(category)
&& additional_loot.get(category).containsKey(entry)){
List<LootPool> pools = additional_loot.get(category).get(entry);
if(pools == null || pools.isEmpty()) return; // nothing to add
if(event.getTable() == null) {
// table was removed by another mod
FMLLog.info("%s: creating new loot table %s", MODID, event.getName());
event.setTable(new LootTable(pools.toArray(new LootPool[pools.size()])));
} else {
// table exists, add pools to it
FMLLog.info("%s: adding more loot to loot table %s", MODID, event.getName());
for (LootPool pool : pools) {
event.getTable().addPool(pool);
}
}
}
}
示例4: onLootTableLoad
import net.minecraftforge.event.LootTableLoadEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onLootTableLoad (LootTableLoadEvent event) {
final LootTable table = event.getTable();
if (skeletonDropDust && event.getName().equals(LootTableList.ENTITIES_WITHER_SKELETON)) {
final LootPool pool1 = table.getPool("pool1");
if (pool1 != null) {
pool1.addEntry(new LootEntryItem(itemMaterial, dustDropWeight, 0, new LootFunction[0], new LootCondition[0], DarkUtils.MOD_ID + ":wither_dust"));
}
}
}