Botania Lexicon control features

This commit is contained in:
unknown committed 2015-01-18 16:00:43 -06:00
1 parent e237301cbe
commit 0e4011aa6d
16 files changed
+830

No files matched your search

@@ -0,0 +1,45 @@
package modtweaker.mods.botania.lexicon;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.LexiconPage;
import minetweaker.IUndoableAction;
public class AddEntry implements IUndoableAction {
LexiconEntry Entry;
public AddEntry(LexiconEntry Entry) {
this.Entry=Entry;
}
@Override
public void apply() {
BotaniaAPI.addEntry(Entry, Entry.category);
}
@Override
public boolean canUndo() {
return Entry != null;
}
@Override
public String describe() {
return "Adding Lexicon Entry: " + Entry.getUnlocalizedName();
}
@Override
public String describeUndo() {
return "Removing Lexicon Entry: " + Entry.getUnlocalizedName();
}
@Override
public void undo() {
Entry.category.entries.remove(Entry);
}
@Override
public Object getOverrideKey() {
return null;
}
}