ModTweaker/src/main/java/modtweaker2/mods/botania/lexicon/AddRecipeMapping.java
jaredlll08 ec562b62ea This closes #17 and closes #58, I tested and it worked using the script given
Also changes like all packages
inb4 "jared changes a package name in ModTweaker2 breaking compatability
with everything" drama tweet.
2015-02-20 23:57:32 +02:00

50 lines
1 KiB
Java

package modtweaker2.mods.botania.lexicon;
import minetweaker.IUndoableAction;
import net.minecraft.item.ItemStack;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.LexiconRecipeMappings;
public class AddRecipeMapping implements IUndoableAction {
ItemStack stack;
LexiconEntry entry;
int page;
public AddRecipeMapping(ItemStack stack, LexiconEntry entry, int page) {
this.stack =stack;
this.entry=entry;
this.page=page;
}
@Override
public void apply() {
LexiconRecipeMappings.map(stack, entry, page);
}
@Override
public boolean canUndo() {
return true;
}
@Override
public String describe() {
return "Adding Lexicon Recipe Lookup: " + stack.getUnlocalizedName();
}
@Override
public String describeUndo() {
return "Removing Lexicon Recipe Lookup: " + stack.getUnlocalizedName();
}
@Override
public void undo() {
LexiconRecipeMappings.remove(stack);
}
@Override
public Object getOverrideKey() {
return null;
}
}