mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 19:05:16 +00:00
Allow black listing of items via IMC Messages.
This commit is contained in:
1 parent
eb724c9a6b
commit
5961ea6d76
4 files changed
+36
No files matched your search
@@ -67,6 +67,11 @@ public class Botania {
|
||||
ManaNetworkHandler.instance.clear();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void handleIMC(FMLInterModComms.IMCEvent event) {
|
||||
IMCHandler.processMessages(event.getMessages());
|
||||
}
|
||||
|
||||
/*@EventHandler
|
||||
public void missingMappings(FMLMissingMappingsEvent event) {
|
||||
AliasHandler.onMissingMappings(event);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package vazkii.botania.common.core.handler;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemMagnetRing;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
public final class IMCHandler {
|
||||
|
||||
public static void processMessages(ImmutableList<IMCMessage> messageList) {
|
||||
Iterator<IMCMessage> iterator = messageList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
IMCMessage message = iterator.next();
|
||||
if (message.key.equals(LibMisc.BLACKLIST_ITEM) && message.isStringMessage()) {
|
||||
String value = message.getStringValue();
|
||||
ItemMagnetRing.addItemToBlackList(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,6 +130,10 @@ public class ItemMagnetRing extends ItemBauble {
|
||||
public static void setCooldown(ItemStack stack, int cooldown) {
|
||||
ItemNBTHelper.setInt(stack, TAG_COOLDOWN, cooldown);
|
||||
}
|
||||
|
||||
public static void addItemToBlackList(String item) {
|
||||
BLACKLIST.add(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaubleType getBaubleType(ItemStack arg0) {
|
||||
|
||||
@@ -29,6 +29,9 @@ public final class LibMisc {
|
||||
public static final String PROXY_CLIENT = "vazkii.botania.client.core.proxy.ClientProxy";
|
||||
public static final String GUI_FACTORY = "vazkii.botania.client.core.proxy.GuiFactory";
|
||||
|
||||
// IMC Keys
|
||||
public static final String BLACKLIST_ITEM = "blackListItem";
|
||||
|
||||
public static final ForgeDirection[] CARDINAL_DIRECTIONS = new ForgeDirection[] {
|
||||
ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.EAST, ForgeDirection.WEST
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user