mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Preliminary work on new loot system
This commit is contained in:
14 files changed
+206
-73
No files matched your search
@@ -1,50 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Jul 15, 2014, 3:17:00 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.core.handler;
|
||||
|
||||
public final class ChestGenHandler {
|
||||
|
||||
public static void init() {
|
||||
/* todo loot tables
|
||||
String c = ChestGenHooks.BONUS_CHEST;
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.lexicon), 1, 1, 7));
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.blackLotus), 1, 1, 1));
|
||||
|
||||
c = ChestGenHooks.STRONGHOLD_CORRIDOR;
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.manaResource, 1, 1), 1, 1, 8));
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.manaResource, 1, 1), 1, 3, 2));
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.blackLotus), 1, 1, 6));
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.overgrowthSeed), 1, 1, 2));
|
||||
|
||||
c = ChestGenHooks.DUNGEON_CHEST;
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.manaResource, 1, 0), 1, 5, 9));
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.lexicon), 1, 1, 6));
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.manaBottle), 1, 1, 5));
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.blackLotus), 1, 1, 6));
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.overgrowthSeed), 1, 1, 2));
|
||||
|
||||
c = ChestGenHooks.PYRAMID_DESERT_CHEST;
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.blackLotus), 1, 1, 6));
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.overgrowthSeed), 1, 1, 2));
|
||||
|
||||
c = ChestGenHooks.MINESHAFT_CORRIDOR;
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.blackLotus), 1, 1, 6));
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.overgrowthSeed), 1, 1, 2));
|
||||
|
||||
c = ChestGenHooks.PYRAMID_JUNGLE_CHEST;
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.blackLotus), 1, 1, 6));
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.overgrowthSeed), 1, 1, 2));
|
||||
|
||||
c = ChestGenHooks.VILLAGE_BLACKSMITH;
|
||||
ChestGenHooks.addItem(c, new WeightedRandomChestContent(new ItemStack(ModItems.blackLotus), 1, 1, 6));*/
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +1,56 @@
|
||||
package vazkii.botania.common.core.loot;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.storage.loot.LootEntry;
|
||||
import net.minecraft.world.storage.loot.LootEntryTable;
|
||||
import net.minecraft.world.storage.loot.LootPool;
|
||||
import net.minecraft.world.storage.loot.LootTableList;
|
||||
import net.minecraft.world.storage.loot.RandomValueRange;
|
||||
import net.minecraft.world.storage.loot.conditions.LootCondition;
|
||||
import net.minecraft.world.storage.loot.conditions.LootConditionManager;
|
||||
import net.minecraft.world.storage.loot.functions.LootFunctionManager;
|
||||
import net.minecraftforge.event.LootTableLoadEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public final class LootHandler {
|
||||
|
||||
public static void init() {
|
||||
LootTableList.register(new ResourceLocation(LibMisc.MOD_ID, "gaia_guardian"));
|
||||
LootTableList.register(new ResourceLocation(LibMisc.MOD_ID, "gaia_guardian_2"));
|
||||
private static final List<String> TABLES = ImmutableList.of(
|
||||
"gaia_guardian", "gaia_guardian_2",
|
||||
"inject/abandoned_mineshaft", "inject/desert_pyramid",
|
||||
"inject/jungle_temple", "inject/simple_dungeon",
|
||||
"inject/spawn_bonus_chest", "inject/stronghold_corridor",
|
||||
"inject/village_blacksmith"
|
||||
);
|
||||
|
||||
public LootHandler() {
|
||||
for (String s : TABLES) {
|
||||
LootTableList.register(new ResourceLocation(LibMisc.MOD_ID, s));
|
||||
}
|
||||
|
||||
LootConditionManager.registerCondition(new TrueGuardianKiller.Serializer());
|
||||
LootConditionManager.registerCondition(new EnableRelics.Serializer());
|
||||
LootFunctionManager.registerFunction(new BindUuid.Serializer());
|
||||
}
|
||||
|
||||
private LootHandler() {}
|
||||
@SubscribeEvent
|
||||
public void lootLoad(LootTableLoadEvent evt) {
|
||||
switch (evt.getName().toString()) {
|
||||
case "minecraft:chests/spawn_bonus_chest": break;
|
||||
case "minecraft:chests/stronghold_corridor": break;
|
||||
case "minecraft:chests/simple_dungeon": break;
|
||||
case "minecraft:chests/desert_pyramid": break;
|
||||
case "minecraft:chests/abandoned_mineshaft": break;
|
||||
case "minecraft:chests/jungle_temple": break;
|
||||
case "minecraft:chests/village_blacksmith": break;
|
||||
}
|
||||
}
|
||||
|
||||
private LootEntryTable getInjectEntry(String name) {
|
||||
return new LootEntryTable(new ResourceLocation(LibMisc.MOD_ID, "inject/" + name), 1, 0, new LootCondition[0], "botania_inject");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -56,7 +56,6 @@ import vazkii.botania.common.core.command.CommandOpen;
|
||||
import vazkii.botania.common.core.command.CommandShare;
|
||||
import vazkii.botania.common.core.command.CommandSkyblockSpread;
|
||||
import vazkii.botania.common.core.handler.BiomeDecorationHandler;
|
||||
import vazkii.botania.common.core.handler.ChestGenHandler;
|
||||
import vazkii.botania.common.core.handler.CommonTickHandler;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.handler.InternalMethodHandler;
|
||||
@@ -114,9 +113,6 @@ public class CommonProxy {
|
||||
ModMultiblocks.init();
|
||||
ModBanners.init();
|
||||
|
||||
ChestGenHandler.init();
|
||||
LootHandler.init();
|
||||
|
||||
if(Botania.gardenOfGlassLoaded)
|
||||
new WorldTypeSkyblock();
|
||||
}
|
||||
@@ -142,6 +138,7 @@ public class CommonProxy {
|
||||
MinecraftForge.EVENT_BUS.register(new SheddingHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new SubTileNarslimmus.SpawnIntercepter());
|
||||
MinecraftForge.EVENT_BUS.register(TileCorporeaIndex.getInputHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new LootHandler());
|
||||
|
||||
if(Botania.gardenOfGlassLoaded)
|
||||
MinecraftForge.EVENT_BUS.register(new SkyblockWorldEvents());
|
||||
|
||||
@@ -17,7 +17,7 @@ public final class LibMisc {
|
||||
public static final String MOD_NAME = MOD_ID;
|
||||
public static final String BUILD = "GRADLE:BUILD";
|
||||
public static final String VERSION = "GRADLE:VERSION-" + BUILD;
|
||||
public static final String DEPENDENCIES = "required-after:Forge@[12.16.0.1874,];required-after:Baubles;after:Thaumcraft";
|
||||
public static final String DEPENDENCIES = "required-after:Forge@[12.16.1.1898,];required-after:Baubles;after:Thaumcraft";
|
||||
public static final String MC_VERSIONS = "[1.9]";
|
||||
|
||||
// Network Contants
|
||||
|
||||
Reference in new issue
Block a user