Update forge, fully fix loot generation

This commit is contained in:
Vincent Lee committed 2016-05-11 11:50:06 -05:00
1 parent 6b55f97a44
commit 6a5e37b632
10 files changed
+84 -36

No files matched your search

+1 -1
View File
@@ -4,6 +4,6 @@ version=r1.8
dir_output=../Build Output/Botania/
dir_repo=./
mc_version=1.9
forge_version=12.16.1.1898
forge_version=12.16.1.1901
build_number=305
mod_name=Botania
@@ -1,6 +1,7 @@
package vazkii.botania.common.core.loot;
import com.google.common.collect.ImmutableList;
import net.minecraft.entity.item.EntityMinecartChest;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.storage.loot.LootEntry;
import net.minecraft.world.storage.loot.LootEntryTable;
@@ -11,6 +12,7 @@ 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.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import vazkii.botania.common.lib.LibMisc;
@@ -38,19 +40,38 @@ public final class 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;
String prefix = "minecraft:chests/";
String name = evt.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": evt.getTable().addPool(getInjectPool(file)); break;
default: break;
}
}
}
private LootEntryTable getInjectEntry(String name) {
return new LootEntryTable(new ResourceLocation(LibMisc.MOD_ID, "inject/" + name), 1, 0, new LootCondition[0], "botania_inject");
@SubscribeEvent
public void lootTest(PlayerInteractEvent.EntityInteract evt) {
if (!evt.getWorld().isRemote && evt.getTarget() instanceof EntityMinecartChest) {
((EntityMinecartChest) evt.getTarget()).clear();
((EntityMinecartChest) evt.getTarget()).setLootTable(new ResourceLocation("minecraft", "chests/village_blacksmith"), evt.getTarget().worldObj.rand.nextLong());
}
}
private LootPool getInjectPool(String entryName) {
return new LootPool(new LootEntry[] { getInjectEntry(entryName, 1) }, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(0, 1), "botania_inject_pool");
}
private LootEntryTable getInjectEntry(String name, int weight) {
return new LootEntryTable(new ResourceLocation(LibMisc.MOD_ID, "inject/" + name), weight, 0, new LootCondition[0], "botania_inject_entry");
}
}
@@ -29,7 +29,6 @@
{
"type": "item",
"entryName": "superBlackLotus",
"EntryName": "superBlackLotus",
"name": "botania:blackLotus",
"weight": 3,
"quality": 1,
@@ -40,7 +39,6 @@
},
{
"type": "item",
"EntryName": "normalBlackLotus",
"entryName": "normalBlackLotus",
"name": "botania:blackLotus",
"weight": 7,
@@ -1,5 +1,5 @@
{
"__comment": "This table is injected into minecraft:chests/abandoned_mineshaft",
"__comment": "This table is injected as its own pool into minecraft:chests/abandoned_mineshaft",
"pools": [{
"name": "main",
"rolls": 1,
@@ -7,12 +7,16 @@
{
"type": "item",
"name": "botania:blackLotus",
"weight": 6
"weight": 35
},
{
"type": "item",
"name": "botania:overgrowthSeed",
"weight": 2
"weight": 5
},
{
"type": "empty",
"weight": 60
}
]
}]
@@ -1,5 +1,5 @@
{
"__comment": "This table is injected into minecraft:chests/desert_pyramid",
"__comment": "This table is injected as its own pool into minecraft:chests/desert_pyramid",
"pools": [{
"name": "main",
"rolls": 1,
@@ -7,12 +7,16 @@
{
"type": "item",
"name": "botania:blackLotus",
"weight": 6
"weight": 35
},
{
"type": "item",
"name": "botania:overgrowthSeed",
"weight": 2
"weight": 5
},
{
"type": "empty",
"weight": 60
}
]
}]
@@ -1,5 +1,5 @@
{
"__comment": "This table is injected into minecraft:chests/jungle_temple",
"__comment": "This table is injected as its own pool into minecraft:chests/jungle_temple",
"pools": [{
"name": "main",
"rolls": 1,
@@ -7,12 +7,16 @@
{
"type": "item",
"name": "botania:blackLotus",
"weight": 6
"weight": 25
},
{
"type": "item",
"name": "botania:overgrowthSeed",
"weight": 2
"weight": 5
},
{
"type": "empty",
"weight": 70
}
]
}]
@@ -1,5 +1,5 @@
{
"__comment": "This table is injected into minecraft:chests/simple_dungeon",
"__comment": "This table is injected as its own pool into minecraft:chests/simple_dungeon",
"pools": [{
"name": "main",
"rolls": 1,
@@ -7,28 +7,32 @@
{
"type": "item",
"name": "botania:manaResource",
"weight": 9,
"weight": 50,
"functions": [{ "function": "set_count", "count": { "min": 1, "max": 5 } }]
},
{
"type": "item",
"name": "botania:lexicon",
"weight": 6
"weight": 20
},
{
"type": "item",
"name": "botania:manaBottle",
"weight": 5
"weight": 10
},
{
"type": "item",
"name": "botania:blackLotus",
"weight": 6
"weight": 5
},
{
"type": "item",
"name": "botania:overgrowthSeed",
"weight": 2
},
{
"type": "empty",
"weight": 13
}
]
}]
@@ -1,5 +1,5 @@
{
"__comment": "This table is injected into minecraft:chests/spawn_bonus_chest",
"__comment": "This table is injected as its own pool into minecraft:chests/spawn_bonus_chest",
"pools": [{
"name": "main",
"rolls": 1,
@@ -7,12 +7,16 @@
{
"type": "item",
"name": "botania:lexicon",
"weight": 7
"weight": 80
},
{
"type": "item",
"name": "botania:blackLotus",
"weight": 1
"weight": 10
},
{
"type": "empty",
"weight": 10
}
]
}]
@@ -1,5 +1,5 @@
{
"__comment": "This table is injected into minecraft:chests/stronghold_corridor",
"__comment": "This table is injected as its own pool into minecraft:chests/stronghold_corridor",
"pools": [{
"name": "main",
"rolls": 1,
@@ -7,18 +7,22 @@
{
"type": "item",
"name": "botania:manaResource",
"weight": 10,
"weight": 45,
"functions": [{ "function": "set_count", "count": { "min": 1, "max": 3 } }]
},
{
"type": "item",
"name": "botania:blackLotus",
"weight": 6
"weight": 10
},
{
"type": "item",
"name": "botania:overgrowthSeed",
"weight": 2
"weight": 5
},
{
"type": "empty",
"weight": 40
}
]
}]
@@ -1,12 +1,17 @@
{
"__comment": "This table is injected into minecraft:chests/village_blacksmith",
"__comment": "This table is injected as its own pool into minecraft:chests/village_blacksmith",
"pools": [{
"name": "main",
"rolls": 1,
"entries": [
{
"type": "item",
"name": "botania:blackLotus"
"name": "botania:blackLotus",
"weight": 10
},
{
"type": "empty",
"weight": 90
}
]
}]