mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Added a blacklist for the Loonium to the API.
This commit is contained in:
1 parent
a552bef7a8
commit
51c4abf858
2 files changed
+15
-2
No files matched your search
@@ -72,8 +72,8 @@ public final class BotaniaAPI {
|
||||
public static Set<String> subtilesForCreativeMenu = new LinkedHashSet();
|
||||
|
||||
public static Map<String, Integer> oreWeights = new HashMap<String, Integer>();
|
||||
|
||||
public static Map<Item, Block> seeds = new HashMap();
|
||||
public static Set<Item> looniumBlacklist = new LinkedHashSet();
|
||||
|
||||
public static ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", 16, new int[] { 2, 6, 5, 2 }, 18);
|
||||
public static ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20);
|
||||
@@ -405,6 +405,13 @@ public final class BotaniaAPI {
|
||||
seeds.put(item, block);
|
||||
}
|
||||
|
||||
/**
|
||||
* Blacklists an item from the Loonium drop table.
|
||||
*/
|
||||
public static void blackListItemFromLoonium(Item item) {
|
||||
looniumBlacklist.add(item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the last recipe to have been added to the recipe list.
|
||||
*/
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.Random;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor.Square;
|
||||
@@ -31,7 +32,12 @@ public class SubTileLoonuim extends SubTileFunctional {
|
||||
super.onUpdate();
|
||||
if(redstoneSignal == 0 && ticksExisted % 200 == 0 && mana >= COST) {
|
||||
Random rand = supertile.getWorldObj().rand;
|
||||
ItemStack stack = ChestGenHooks.getOneItem(ChestGenHooks.DUNGEON_CHEST, rand);
|
||||
|
||||
ItemStack stack;
|
||||
do {
|
||||
stack = ChestGenHooks.getOneItem(ChestGenHooks.DUNGEON_CHEST, rand);
|
||||
} while(stack == null || BotaniaAPI.looniumBlacklist.contains(stack.getItem()));
|
||||
|
||||
int bound = RANGE * 2 + 1;
|
||||
EntityItem entity = new EntityItem(supertile.getWorldObj(), supertile.xCoord - RANGE + rand.nextInt(bound) , supertile.yCoord + 1, supertile.zCoord - RANGE + rand.nextInt(bound), stack);
|
||||
entity.motionX = 0;
|
||||
|
||||
Reference in new issue
Block a user