mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 08:48:34 +01:00
No Minetweaker.
Not happening.
This commit is contained in:
parent
f71e4d741b
commit
96225522c4
5 changed files with 3 additions and 152 deletions
|
@ -16,8 +16,8 @@ import de.ellpeck.actuallyadditions.blocks.base.BlockStair;
|
||||||
import de.ellpeck.actuallyadditions.blocks.base.BlockWallAA;
|
import de.ellpeck.actuallyadditions.blocks.base.BlockWallAA;
|
||||||
import de.ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks;
|
import de.ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks;
|
||||||
import de.ellpeck.actuallyadditions.config.values.ConfigBoolValues;
|
import de.ellpeck.actuallyadditions.config.values.ConfigBoolValues;
|
||||||
|
import de.ellpeck.actuallyadditions.util.CompatUtil;
|
||||||
import de.ellpeck.actuallyadditions.util.ModUtil;
|
import de.ellpeck.actuallyadditions.util.ModUtil;
|
||||||
import de.ellpeck.actuallyadditions.util.compat.CompatUtil;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.item.EnumRarity;
|
import net.minecraft.item.EnumRarity;
|
||||||
|
|
|
@ -19,9 +19,9 @@ import de.ellpeck.actuallyadditions.items.metalists.TheFoods;
|
||||||
import de.ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
import de.ellpeck.actuallyadditions.items.metalists.TheMiscItems;
|
||||||
import de.ellpeck.actuallyadditions.material.InitArmorMaterials;
|
import de.ellpeck.actuallyadditions.material.InitArmorMaterials;
|
||||||
import de.ellpeck.actuallyadditions.material.InitToolMaterials;
|
import de.ellpeck.actuallyadditions.material.InitToolMaterials;
|
||||||
|
import de.ellpeck.actuallyadditions.util.CompatUtil;
|
||||||
import de.ellpeck.actuallyadditions.util.ModUtil;
|
import de.ellpeck.actuallyadditions.util.ModUtil;
|
||||||
import de.ellpeck.actuallyadditions.util.Util;
|
import de.ellpeck.actuallyadditions.util.Util;
|
||||||
import de.ellpeck.actuallyadditions.util.compat.CompatUtil;
|
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.EnumRarity;
|
import net.minecraft.item.EnumRarity;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* © 2016 Ellpeck
|
* © 2016 Ellpeck
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.util.compat;
|
package de.ellpeck.actuallyadditions.util;
|
||||||
|
|
||||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||||
import de.ellpeck.actuallyadditions.items.ItemSeed;
|
import de.ellpeck.actuallyadditions.items.ItemSeed;
|
|
@ -1,126 +0,0 @@
|
||||||
/*
|
|
||||||
* This file ("Crusher.java") is part of the Actually Additions Mod for Minecraft.
|
|
||||||
* It is created and owned by Ellpeck and distributed
|
|
||||||
* under the Actually Additions License to be found at
|
|
||||||
* http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
|
|
||||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
||||||
*
|
|
||||||
* © 2016 Ellpeck
|
|
||||||
*/
|
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.util.compat.minetweaker;
|
|
||||||
|
|
||||||
import de.ellpeck.actuallyadditions.recipe.CrusherRecipeRegistry;
|
|
||||||
import de.ellpeck.actuallyadditions.util.ItemUtil;
|
|
||||||
import minetweaker.IUndoableAction;
|
|
||||||
import minetweaker.MineTweakerAPI;
|
|
||||||
import minetweaker.api.item.IItemStack;
|
|
||||||
import minetweaker.api.minecraft.MineTweakerMC;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import stanhebben.zenscript.annotations.Optional;
|
|
||||||
import stanhebben.zenscript.annotations.ZenClass;
|
|
||||||
import stanhebben.zenscript.annotations.ZenMethod;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@ZenClass("mods.actuallyadditions.crusher")
|
|
||||||
public class Crusher{
|
|
||||||
|
|
||||||
@ZenMethod
|
|
||||||
public static void addRecipe(IItemStack input, IItemStack outputOne, @Optional IItemStack outputTwo, @Optional int outputTwoChance){
|
|
||||||
CrusherRecipeRegistry.CrusherRecipe recipe = new CrusherRecipeRegistry.CrusherRecipe(MineTweakerMC.getItemStack(input), MineTweakerMC.getItemStack(outputOne), MineTweakerMC.getItemStack(outputTwo), outputTwoChance);
|
|
||||||
MineTweakerAPI.apply(new Add(recipe));
|
|
||||||
}
|
|
||||||
|
|
||||||
@ZenMethod
|
|
||||||
public static void removeRecipe(IItemStack outputOne){
|
|
||||||
MineTweakerAPI.apply(new Remove(MineTweakerMC.getItemStack(outputOne)));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class Add implements IUndoableAction{
|
|
||||||
|
|
||||||
private CrusherRecipeRegistry.CrusherRecipe recipe;
|
|
||||||
|
|
||||||
public Add(CrusherRecipeRegistry.CrusherRecipe recipe){
|
|
||||||
this.recipe = recipe;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void apply(){
|
|
||||||
CrusherRecipeRegistry.recipes.add(this.recipe);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canUndo(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void undo(){
|
|
||||||
CrusherRecipeRegistry.recipes.remove(this.recipe);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String describe(){
|
|
||||||
return "Adding Crusher Recipe for "+this.recipe.getRecipeOutputOnes().get(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String describeUndo(){
|
|
||||||
return "Removing added Crusher Recipe for "+this.recipe.getRecipeOutputOnes().get(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object getOverrideKey(){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class Remove implements IUndoableAction{
|
|
||||||
|
|
||||||
private final ItemStack output;
|
|
||||||
private List<CrusherRecipeRegistry.CrusherRecipe> removedRecipes = new ArrayList<CrusherRecipeRegistry.CrusherRecipe>();
|
|
||||||
|
|
||||||
public Remove(ItemStack output){
|
|
||||||
this.output = output;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void apply(){
|
|
||||||
this.removedRecipes.clear();
|
|
||||||
|
|
||||||
for(CrusherRecipeRegistry.CrusherRecipe recipe : CrusherRecipeRegistry.recipes){
|
|
||||||
if(ItemUtil.contains(recipe.getRecipeOutputOnes(), this.output, true)){
|
|
||||||
this.removedRecipes.add(recipe);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CrusherRecipeRegistry.recipes.removeAll(this.removedRecipes);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canUndo(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void undo(){
|
|
||||||
CrusherRecipeRegistry.recipes.addAll(this.removedRecipes);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String describe(){
|
|
||||||
return "Removing Crusher Recipe for "+this.output.getDisplayName();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String describeUndo(){
|
|
||||||
return "Re-Adding Crusher Recipe for "+this.output.getDisplayName();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object getOverrideKey(){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
/*
|
|
||||||
* This file ("MineTweaker.java") is part of the Actually Additions Mod for Minecraft.
|
|
||||||
* It is created and owned by Ellpeck and distributed
|
|
||||||
* under the Actually Additions License to be found at
|
|
||||||
* http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
|
|
||||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
||||||
*
|
|
||||||
* © 2016 Ellpeck
|
|
||||||
*/
|
|
||||||
|
|
||||||
package de.ellpeck.actuallyadditions.util.compat.minetweaker;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.Loader;
|
|
||||||
import minetweaker.MineTweakerAPI;
|
|
||||||
|
|
||||||
public class MineTweaker{
|
|
||||||
|
|
||||||
public static void init(){
|
|
||||||
if(Loader.isModLoaded("MineTweaker3")){
|
|
||||||
MineTweakerAPI.registerClass(Crusher.class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue