当前位置: 首页>>代码示例>>Java>>正文


Java LootTableLoadEvent类代码示例

本文整理汇总了Java中net.minecraftforge.event.LootTableLoadEvent的典型用法代码示例。如果您正苦于以下问题:Java LootTableLoadEvent类的具体用法?Java LootTableLoadEvent怎么用?Java LootTableLoadEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LootTableLoadEvent类属于net.minecraftforge.event包,在下文中一共展示了LootTableLoadEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: changeVanillaTables

import net.minecraftforge.event.LootTableLoadEvent; //导入依赖的package包/类
private static void changeVanillaTables(LootTableLoadEvent event)
{
	if (event.getName() == LootTableList.ENTITIES_BLAZE) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_CREEPER) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_ELDER_GUARDIAN) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_ENDER_DRAGON) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_ENDERMAN) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_ENDERMITE) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_EVOCATION_ILLAGER) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_GHAST) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_GUARDIAN) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_HUSK) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_MAGMA_CUBE) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_SHULKER) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_SKELETON) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_SLIME) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_SPIDER) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_VEX) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_VINDICATION_ILLAGER) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_WITCH) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_WITHER_SKELETON) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_ZOMBIE) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_ZOMBIE_PIGMAN) addPool(event.getTable());
	else if (event.getName() == LootTableList.ENTITIES_ZOMBIE_VILLAGER) addPool(event.getTable());
}
 
开发者ID:TheXFactor117,项目名称:Loot-Slash-Conquer,代码行数:26,代码来源:EventLoadLootTable.java

示例2: onLootTableLoad

import net.minecraftforge.event.LootTableLoadEvent; //导入依赖的package包/类
@SubscribeEvent
public void onLootTableLoad(LootTableLoadEvent event) {
    if (ConfigHandler.general.enableDungeonLoot) {
        String prefix = "minecraft:chests/";
        String name = event.getName().toString();
        if (name.startsWith(prefix)) {
            String file = name.substring(name.indexOf(prefix) + prefix.length());
            switch (file) {
                case "abandoned_mineshaft":
                case "desert_pyramid":
                case "jungle_temple":
                case "simple_dungeon":
                case "spawn_bonus_chest":
                case "stronghold_corridor":
                case "village_blacksmith":
                    LootEntry entry = new LootEntryTable(RL("inject/simple_dungeon_loot"), 1, 0,  new LootCondition[0], "pneumaticcraft_inject_entry");
                    LootPool pool = new LootPool(new LootEntry[]{entry}, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(0, 1), "pneumaticcraft_inject_pool");
                    event.getTable().addPool(pool);
                    break;
                default:
                    break;
            }
        }
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:26,代码来源:EventHandlerPneumaticCraft.java

示例3: lootTableLoaded

import net.minecraftforge.event.LootTableLoadEvent; //导入依赖的package包/类
@SubscribeEvent
public void lootTableLoaded(LootTableLoadEvent event)
{
	ResourceLocation poolName = event.getName();

	String injectTablePath = "inject/" + poolName.getResourceDomain() + "/" + poolName.getResourcePath();

	if (!LootTableInjector.INJECTED_LOOT_TABLES.contains(injectTablePath))
	{
		return;
	}

	LootTable injectTable = event.getLootTableManager().getLootTableFromLocation(new ResourceLocation(BetterThanWeagles.MODID, injectTablePath));
	for (int i = 0; i < LootTableInjector.MAX_POOLS; i++)
	{
		LootPool pool = injectTable.getPool(String.format("inject%d", i));
		if (pool != null)
		{
			event.getTable().addPool(pool);
		}
	}
}
 
开发者ID:DarkMorford,项目名称:BetterThanWeagles,代码行数:23,代码来源:LootTableInjector.java

示例4: onLootTableLoad

import net.minecraftforge.event.LootTableLoadEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onLootTableLoad(LootTableLoadEvent event) {
    ResourceLocation tableName = event.getName();
    LootPool pool = null;
    int bandage = 0, plaster = 0, morphine = 0;
    if (tableName.equals(LootTableList.CHESTS_SPAWN_BONUS_CHEST)) {
        pool = event.getTable().getPool("main");
        bandage = 8;
        plaster = 16;
        morphine = 4;
    } else if (tableName.equals(LootTableList.CHESTS_STRONGHOLD_CORRIDOR) || tableName.equals(LootTableList.CHESTS_STRONGHOLD_CROSSING) || tableName.equals(LootTableList.CHESTS_ABANDONED_MINESHAFT)) {
        pool = event.getTable().getPool("main");
        bandage = 20;
        plaster = 24;
        morphine = 8;
    }

    if (pool != null) {
        pool.addEntry(new LootEntryItem(FirstAidItems.BANDAGE, bandage, 0, new SetCount[]{new SetCount(new LootCondition[0], new RandomValueRange(1, 3))}, new LootCondition[0], FirstAid.MODID + "bandage"));
        pool.addEntry(new LootEntryItem(FirstAidItems.PLASTER, plaster, 0, new SetCount[]{new SetCount(new LootCondition[0], new RandomValueRange(1, 5))}, new LootCondition[0], FirstAid.MODID + "plaster"));
        pool.addEntry(new LootEntryItem(FirstAidItems.MORPHINE, morphine, 0, new SetCount[]{new SetCount(new LootCondition[0], new RandomValueRange(1, 2))}, new LootCondition[0], FirstAid.MODID + "morphine"));
    }
}
 
开发者ID:ichttt,项目名称:FirstAid,代码行数:24,代码来源:EventHandler.java

示例5: onLootTableEvent

import net.minecraftforge.event.LootTableLoadEvent; //导入依赖的package包/类
@SubscribeEvent
public void onLootTableEvent(LootTableLoadEvent event)
{
    if(Clef.config.lootSpawnRate > 0)
    {
        for(String s : Clef.config.disabledLootChests)
        {
            if(event.getName().toString().equals(s))
            {
                return;
            }
        }
        if(event.getName().getResourcePath().contains("chest"))
        {
            event.getTable().addPool(new LootPool(new LootEntry[] { new LootEntryItem(Clef.itemInstrument, Clef.config.lootSpawnRate, 0, new LootFunction[] { new LootFunction(new LootCondition[0])
            {
                @Override
                public ItemStack apply(ItemStack stack, Random rand, LootContext context)
                {
                    InstrumentLibrary.assignRandomInstrument(stack);
                    return stack;
                }
            } }, new LootCondition[0], "clef_instrument_pool") }, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(0), "clef_instrument"));
        }
    }
}
 
开发者ID:iChun,项目名称:Clef,代码行数:27,代码来源:EventHandlerServer.java

示例6: onLootLoad

import net.minecraftforge.event.LootTableLoadEvent; //导入依赖的package包/类
@SubscribeEvent
public void onLootLoad(LootTableLoadEvent event) {
    if (Config.enhancementBookLootLocationList.contains(event.getName())) {
    	String lootPoolId = LootHelper.VANILLA_LOOT_POOL_ID;        	
        LootHelper.createPoolIfNotExists(event.getTable(), lootPoolId);
        final LootPool lootPool = event.getTable().getPool(lootPoolId);
        lootPool.addEntry(customLootEnhancementBook);
    }
    //TODO Rework this to only be caught in cold biomes
    /*if(event.getName() == LootTableList.GAMEPLAY_FISHING_FISH){
    	String lootPoolId = LootHelper.VANILLA_LOOT_POOL_ID;        	
        LootHelper.createPoolIfNotExists(event.getTable(), lootPoolId);
        final LootPool lootPool = event.getTable().getPool(lootPoolId);
        lootPool.addEntry(customLootWhiteFish);            
    }*/
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:17,代码来源:EventHandler.java

示例7: dungeonLootLoad

import net.minecraftforge.event.LootTableLoadEvent; //导入依赖的package包/类
@SubscribeEvent
public void dungeonLootLoad(LootTableLoadEvent event) {
    String name = event.getName().toString();
    String chests = "minecraft:chests/";
    if(name.startsWith(chests)) {
        String fileName = name.substring(chests.length());
        switch(fileName) {
            case "abandoned_mineshaft":
            case "desert_pyramid":
            case "jungle_temple":
            case "nether_bridge":
            case "simple_dungeon":
            case "stronghold_corridor":
            case "stronghold_crossing":
            case "village_blacksmith":
                event.getTable().addPool(getInjectPool(LootTables.DUNGEON_INJECT));
                break;
            default:
                break;
        }
    }
}
 
开发者ID:CenturionFox,项目名称:wolfarmor,代码行数:23,代码来源:LootHandler.java

示例8: onLootTableLoad

import net.minecraftforge.event.LootTableLoadEvent; //导入依赖的package包/类
@SubscribeEvent
public void onLootTableLoad(LootTableLoadEvent event) {
  LootPool main = event.getTable().getPool(LOOTPOOLNAME);
  if (main == null) {
    //create my own.  EX: mobs that have no drops (bats) also have empty loot table, so i have to inject an entry in the table before I fill it
    event.getTable().addPool(new LootPool(new LootEntry[0], new LootCondition[0], new RandomValueRange(1F, 2F), new RandomValueRange(1F, 1F), LOOTPOOLNAME));
    main = event.getTable().getPool(LOOTPOOLNAME);
    if (main == null) {
      ModCyclic.logger.error("could not insert Loot Pool for table :" + event.getName().toString());
      return;
    }
  }
  if (enableChestLoot) {
    onLootChestTableLoad(main, event);
  }
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:17,代码来源:LootTableModule.java

示例9: onLootTableLoad

import net.minecraftforge.event.LootTableLoadEvent; //导入依赖的package包/类
@SubscribeEvent
public void onLootTableLoad(LootTableLoadEvent event)
{	
	if (event.getName() == ModLootTables.common_chest)
	{
		event.setTable(new CustomLootTable(new LootPool[] { event.getTable().getPool("main") }));
	}
	
	if (event.getName() == ModLootTables.uncommon_chest)
	{
		event.setTable(new CustomLootTable(new LootPool[] { event.getTable().getPool("main") }));
	}
	
	if (event.getName() == ModLootTables.rare_chest)
	{
		event.setTable(new CustomLootTable(new LootPool[] { event.getTable().getPool("main") }));
	}
	
	if (event.getName() == ModLootTables.legendary_chest)
	{
		event.setTable(new CustomLootTable(new LootPool[] { event.getTable().getPool("main") }));
	}
	
	if (event.getName() == ModLootTables.exotic_chest)
	{
		event.setTable(new CustomLootTable(new LootPool[] { event.getTable().getPool("main") }));
	}
	
	changeVanillaTables(event);
}
 
开发者ID:TheXFactor117,项目名称:Loot-Slash-Conquer,代码行数:31,代码来源:EventLoadLootTable.java

示例10: lootLoaded

import net.minecraftforge.event.LootTableLoadEvent; //导入依赖的package包/类
@SubscribeEvent
public static void lootLoaded(LootTableLoadEvent event)
{
	if (event.getName().equals(LootTableList.CHESTS_SIMPLE_DUNGEON))
	{
		LootTable customTable = event.getLootTableManager().getLootTableFromLocation(new ResourceLocation(BetterThanWeagles.MODID, "custom/simple_dungeon_chest"));
		LootPool customPool = customTable.getPool("weagles");
		event.getTable().addPool(customPool);
	}
}
 
开发者ID:DarkMorford,项目名称:BetterThanWeagles,代码行数:11,代码来源:EventHandlerLootTables.java

示例11: addTables

import net.minecraftforge.event.LootTableLoadEvent; //导入依赖的package包/类
@SubscribeEvent
public void addTables(LootTableLoadEvent event){
    String name = event.getName().toString();
    if(Randores.getConfigObj().getModules().isDungeonLoot()) {
        if (is(name, chests)) {
            event.getTable().addPool(new LootPool(new LootEntry[] {new RandoresLootEntry(1, 2, true, 10, 20, new LootCondition[0], "randores_flexible_loot_entry")}, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(0, 1), "randores_flexible_pool"));
        } else if (name.contains("end_city_treasure")) {
            event.getTable().addPool(new LootPool(new LootEntry[] {new RandoresLootEntry(1, 5, true, 20, 50, new LootCondition[0], "randores_flexible_loot_entry")}, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(0, 1), "randores_flexible_pool"));
        } else if (name.contains("spawn_bonus_chest")) {
            event.getTable().addPool(new LootPool(new LootEntry[] {new RandoresLootEntry(1, 1, false, 0, 0, new LootCondition[0], "randores_flexible_loot_entry")}, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(0, 1), "randores_flexible_pool"));
        }
    }
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:14,代码来源:RandoresLoot.java

示例12: onLootTablesLoaded

import net.minecraftforge.event.LootTableLoadEvent; //导入依赖的package包/类
@SubscribeEvent
public void onLootTablesLoaded(LootTableLoadEvent event) {
	if ((event.getName().equals(LootTableList.CHESTS_ABANDONED_MINESHAFT)) || (event.getName().equals(LootTableList.CHESTS_SIMPLE_DUNGEON)) || (event.getName().equals(LootTableList.CHESTS_DESERT_PYRAMID)) || (event.getName().equals(LootTableList.CHESTS_NETHER_BRIDGE)) || (event.getName().equals(LootTableList.CHESTS_STRONGHOLD_LIBRARY)) || (event.getName().equals(LootTableList.CHESTS_END_CITY_TREASURE))) {
		LootPool mainPool = event.getTable().getPool("main");
		if (mainPool != null) {
			if (event.getName().equals(LootTableList.CHESTS_ABANDONED_MINESHAFT) || event.getName().equals(LootTableList.CHESTS_NETHER_BRIDGE) || event.getName().equals(LootTableList.CHESTS_SIMPLE_DUNGEON)) {
				mainPool.addEntry(new LootEntryItem(ModItems.FRIENDER_PEARL, 10, 0, new LootFunction[] {}, new LootCondition[0], ModGlobals.MODID + ":friender_pearl_loot"));
			}
		}
	}

}
 
开发者ID:p455w0rd,项目名称:EndermanEvolution,代码行数:13,代码来源:ModEvents.java

示例13: addTable

import net.minecraftforge.event.LootTableLoadEvent; //导入依赖的package包/类
@SubscribeEvent
public void addTable(LootTableLoadEvent event){
	if(!TF2ConfigVars.disableLoot && (event.getName().equals(LootTableList.CHESTS_SIMPLE_DUNGEON)||event.getName().equals(LootTableList.CHESTS_END_CITY_TREASURE)
			||event.getName().equals(LootTableList.CHESTS_NETHER_BRIDGE)||event.getName().equals(LootTableList.CHESTS_ABANDONED_MINESHAFT)
			||event.getName().equals(LootTableList.CHESTS_STRONGHOLD_CORRIDOR))){
		//System.out.println("loaded: "+new ResourceLocation(TF2weapons.MOD_ID,event.getName().getResourcePath()));
		event.getTable().addPool(getLootPool(new ResourceLocation(TF2weapons.MOD_ID,event.getName().getResourcePath())));
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:10,代码来源:TF2EventsCommon.java

示例14: lootTableLoad

import net.minecraftforge.event.LootTableLoadEvent; //导入依赖的package包/类
@SubscribeEvent
public void lootTableLoad(final LootTableLoadEvent event) {
	if (NemesisConfig.DISCOVERY_ENABLED && isLootTarget(event)) {

		// TODO improve roll settings

		String name = LOOT_TABLE.toString();
		LootEntry entry = new LootEntryTable(LOOT_TABLE, 1, 0, new LootCondition[0], name);

		RandomValueRange rolls = new RandomValueRange(0, 1);
		LootPool pool = new LootPool(new LootEntry[] { entry }, new LootCondition[0], rolls, rolls, name);
		event.getTable().addPool(pool);
	}
}
 
开发者ID:ToroCraft,项目名称:NemesisSystem,代码行数:15,代码来源:LootHandler.java

示例15: isLootTarget

import net.minecraftforge.event.LootTableLoadEvent; //导入依赖的package包/类
private boolean isLootTarget(LootTableLoadEvent event) {
	return event.getName().equals(LootTableList.CHESTS_END_CITY_TREASURE)
			|| event.getName().equals(LootTableList.CHESTS_SIMPLE_DUNGEON)
			|| event.getName().equals(LootTableList.CHESTS_VILLAGE_BLACKSMITH)
			|| event.getName().equals(LootTableList.CHESTS_ABANDONED_MINESHAFT)
			|| event.getName().equals(LootTableList.CHESTS_NETHER_BRIDGE)
			|| event.getName().equals(LootTableList.CHESTS_STRONGHOLD_LIBRARY)
			|| event.getName().equals(LootTableList.CHESTS_STRONGHOLD_CROSSING)
			|| event.getName().equals(LootTableList.CHESTS_STRONGHOLD_CORRIDOR)
			|| event.getName().equals(LootTableList.CHESTS_DESERT_PYRAMID)
			|| event.getName().equals(LootTableList.CHESTS_JUNGLE_TEMPLE)
			|| event.getName().equals(LootTableList.CHESTS_JUNGLE_TEMPLE_DISPENSER)
			|| event.getName().equals(LootTableList.CHESTS_IGLOO_CHEST)
			|| event.getName().equals(LootTableList.CHESTS_WOODLAND_MANSION);
}
 
开发者ID:ToroCraft,项目名称:NemesisSystem,代码行数:16,代码来源:LootHandler.java


注:本文中的net.minecraftforge.event.LootTableLoadEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。