mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-21 12:32:29 +00:00
- Refactored code into different packages
- Fixed some non-static expansion methods - Fixed scripts not reloading properly - Implemented mod support build system - Fixed recipe removal breaking on recipes without predefined output - Fixed NPE on parsing a bracket expression that doesn't exist - now prints an appropriate error
This commit is contained in:
1 parent
1789aa74b5
commit
2de467d7d8
93 files changed
+321
-262
No files matched your search
@@ -1,6 +1,6 @@
|
||||
package minetweaker;
|
||||
|
||||
import minetweaker.minecraft.item.IIngredient;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
|
||||
/**
|
||||
* Used to register removable mod recipes for mod machines. Once registered,
|
||||
|
||||
@@ -4,9 +4,9 @@ import java.lang.reflect.Field;
|
||||
import minetweaker.runtime.IMineTweaker;
|
||||
import minetweaker.runtime.ILogger;
|
||||
import minetweaker.runtime.Tweaker;
|
||||
import minetweaker.minecraft.recipes.IRecipeManager;
|
||||
import minetweaker.minecraft.oredict.IOreDict;
|
||||
import minetweaker.minecraft.recipes.IFurnaceManager;
|
||||
import minetweaker.api.recipes.IRecipeManager;
|
||||
import minetweaker.api.oredict.IOreDict;
|
||||
import minetweaker.api.recipes.IFurnaceManager;
|
||||
import minetweaker.runtime.GlobalRegistry;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.data;
|
||||
package minetweaker.api.data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.data;
|
||||
package minetweaker.api.data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.data;
|
||||
package minetweaker.api.data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.data;
|
||||
package minetweaker.api.data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.data;
|
||||
package minetweaker.api.data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.data;
|
||||
package minetweaker.api.data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.data;
|
||||
package minetweaker.api.data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.data;
|
||||
package minetweaker.api.data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.data;
|
||||
package minetweaker.api.data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.data;
|
||||
package minetweaker.api.data;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.data;
|
||||
package minetweaker.api.data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.data;
|
||||
package minetweaker.api.data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.data;
|
||||
package minetweaker.api.data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -21,7 +21,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
||||
*
|
||||
* @author Stan
|
||||
*/
|
||||
@ZenClass("minecraft.data.IData")
|
||||
@ZenClass("minetweaker.data.IData")
|
||||
public interface IData {
|
||||
@ZenOperator(OperatorType.ADD)
|
||||
public IData add(IData other);
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.data;
|
||||
package minetweaker.api.data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
+3
-3
@@ -4,9 +4,9 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.item;
|
||||
package minetweaker.api.item;
|
||||
|
||||
import minetweaker.minecraft.data.IData;
|
||||
import minetweaker.api.data.IData;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenGetter;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
@@ -18,7 +18,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
||||
*
|
||||
* @author Stan Hebben
|
||||
*/
|
||||
@ZenClass("minecraft.item.Condition")
|
||||
@ZenClass("minetweaker.item.Condition")
|
||||
public class Condition {
|
||||
/**
|
||||
* Requires the item to be damaged. A damage value of 1 is enough.
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package minetweaker.minecraft.item;
|
||||
package minetweaker.api.item;
|
||||
|
||||
import java.util.List;
|
||||
import stanhebben.zenscript.annotations.OperatorType;
|
||||
@@ -17,7 +17,7 @@ import stanhebben.zenscript.annotations.ZenOperator;
|
||||
*
|
||||
* @author Stan Hebben
|
||||
*/
|
||||
@ZenClass("minecraft.item.IIngredient")
|
||||
@ZenClass("minetweaker.item.IIngredient")
|
||||
public interface IIngredient {
|
||||
/**
|
||||
* Gets the mark of the ingredient. Ingredients can be marked so they can
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package minetweaker.minecraft.item;
|
||||
package minetweaker.api.item;
|
||||
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
|
||||
@@ -10,7 +10,7 @@ import stanhebben.zenscript.annotations.ZenClass;
|
||||
*
|
||||
* @author Stan Hebben
|
||||
*/
|
||||
@ZenClass("minecraft.item.IItemCondition")
|
||||
@ZenClass("minetweaker.item.IItemCondition")
|
||||
public interface IItemCondition {
|
||||
/**
|
||||
* Returns true if the given stack matches the required conditions.
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.item;
|
||||
package minetweaker.api.item;
|
||||
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
|
||||
@@ -12,7 +12,7 @@ import stanhebben.zenscript.annotations.ZenClass;
|
||||
*
|
||||
* @author Stan
|
||||
*/
|
||||
@ZenClass("minecraft.item.IItemDefinition")
|
||||
@ZenClass("minetweaker.item.IItemDefinition")
|
||||
public interface IItemDefinition {
|
||||
|
||||
}
|
||||
+4
-4
@@ -4,10 +4,10 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.item;
|
||||
package minetweaker.api.item;
|
||||
|
||||
import minetweaker.minecraft.data.IData;
|
||||
import minetweaker.minecraft.liquid.ILiquidStack;
|
||||
import minetweaker.api.data.IData;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import stanhebben.zenscript.annotations.OperatorType;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenGetter;
|
||||
@@ -18,7 +18,7 @@ import stanhebben.zenscript.annotations.ZenOperator;
|
||||
*
|
||||
* @author Stan
|
||||
*/
|
||||
@ZenClass("minecraft.item.IItemStack")
|
||||
@ZenClass("minetweaker.item.IItemStack")
|
||||
public interface IItemStack extends IIngredient {
|
||||
@ZenGetter("definition")
|
||||
public IItemDefinition getDefinition();
|
||||
+2
-8
@@ -1,10 +1,4 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.item;
|
||||
package minetweaker.api.item;
|
||||
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
@@ -16,7 +10,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
||||
*
|
||||
* @author Stan Hebben
|
||||
*/
|
||||
@ZenClass("minecraft.item.IItemTransformer")
|
||||
@ZenClass("minetweaker.item.IItemTransformer")
|
||||
public interface IItemTransformer {
|
||||
/**
|
||||
* Transforms the specified item. May modify this item (and return it)
|
||||
+2
-2
@@ -4,10 +4,10 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.item;
|
||||
package minetweaker.api.item;
|
||||
|
||||
import java.util.List;
|
||||
import minetweaker.minecraft.util.ArrayUtil;
|
||||
import minetweaker.util.ArrayUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
+2
-2
@@ -4,10 +4,10 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.item;
|
||||
package minetweaker.api.item;
|
||||
|
||||
import java.util.List;
|
||||
import minetweaker.minecraft.util.ArrayUtil;
|
||||
import minetweaker.util.ArrayUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
+2
-2
@@ -4,11 +4,11 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.item;
|
||||
package minetweaker.api.item;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import minetweaker.minecraft.util.ArrayUtil;
|
||||
import minetweaker.util.ArrayUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.item;
|
||||
package minetweaker.api.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.item;
|
||||
package minetweaker.api.item;
|
||||
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
@@ -13,7 +13,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
||||
*
|
||||
* @author Stan
|
||||
*/
|
||||
@ZenClass("minecraft.item.Transform")
|
||||
@ZenClass("minetweaker.item.Transform")
|
||||
public class Transform {
|
||||
/**
|
||||
* Makes the item reusable. Prevents consumption of the item upon crafting.
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.liquid;
|
||||
package minetweaker.api.liquid;
|
||||
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenGetter;
|
||||
@@ -16,7 +16,7 @@ import stanhebben.zenscript.annotations.ZenSetter;
|
||||
*
|
||||
* @author Stanneke
|
||||
*/
|
||||
@ZenClass("minecraft.liquid.ILiquidDefinition")
|
||||
@ZenClass("minetweaker.liquid.ILiquidDefinition")
|
||||
public interface ILiquidDefinition {
|
||||
@ZenOperator(OperatorType.MUL)
|
||||
public ILiquidStack asStack(int millibuckets);
|
||||
+3
-3
@@ -4,9 +4,9 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.liquid;
|
||||
package minetweaker.api.liquid;
|
||||
|
||||
import minetweaker.minecraft.data.IData;
|
||||
import minetweaker.api.data.IData;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenGetter;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
@@ -15,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
||||
*
|
||||
* @author Stanneke
|
||||
*/
|
||||
@ZenClass("minecraft.liquid.ILiquidStack")
|
||||
@ZenClass("minetweaker.liquid.ILiquidStack")
|
||||
public interface ILiquidStack {
|
||||
@ZenGetter("definition")
|
||||
public ILiquidDefinition getDefinition();
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.oredict;
|
||||
package minetweaker.api.oredict;
|
||||
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMemberGetter;
|
||||
@@ -13,7 +13,7 @@ import stanhebben.zenscript.annotations.ZenMemberGetter;
|
||||
*
|
||||
* @author Stan
|
||||
*/
|
||||
@ZenClass("minecraft.oredict.IOreDict")
|
||||
@ZenClass("minetweaker.oredict.IOreDict")
|
||||
public interface IOreDict {
|
||||
@ZenMemberGetter
|
||||
public IOreDictEntry get(String name);
|
||||
+4
-4
@@ -4,10 +4,10 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.oredict;
|
||||
package minetweaker.api.oredict;
|
||||
|
||||
import minetweaker.minecraft.item.IIngredient;
|
||||
import minetweaker.minecraft.item.IItemStack;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
@@ -15,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
||||
*
|
||||
* @author Stan
|
||||
*/
|
||||
@ZenClass("minecraft.oredict.IOreDictEntry")
|
||||
@ZenClass("minetweaker.oredict.IOreDictEntry")
|
||||
public interface IOreDictEntry extends IIngredient {
|
||||
@ZenMethod
|
||||
public void add(IItemStack item);
|
||||
+7
-7
@@ -4,15 +4,15 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.oredict;
|
||||
package minetweaker.api.oredict;
|
||||
|
||||
import java.util.List;
|
||||
import minetweaker.minecraft.item.IIngredient;
|
||||
import minetweaker.minecraft.item.IItemCondition;
|
||||
import minetweaker.minecraft.item.IItemStack;
|
||||
import minetweaker.minecraft.item.IItemTransformer;
|
||||
import minetweaker.minecraft.item.IngredientStack;
|
||||
import minetweaker.minecraft.util.ArrayUtil;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemCondition;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.item.IItemTransformer;
|
||||
import minetweaker.api.item.IngredientStack;
|
||||
import minetweaker.util.ArrayUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
+3
-3
@@ -4,9 +4,9 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.player;
|
||||
package minetweaker.api.player;
|
||||
|
||||
import minetweaker.minecraft.data.IData;
|
||||
import minetweaker.api.data.IData;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenGetter;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
@@ -15,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
||||
*
|
||||
* @author Stan
|
||||
*/
|
||||
@ZenClass("minecraft.player.IPlayer")
|
||||
@ZenClass("minetweaker.player.IPlayer")
|
||||
public interface IPlayer {
|
||||
@ZenGetter("name")
|
||||
public String getName();
|
||||
+3
-3
@@ -4,9 +4,9 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.recipes;
|
||||
package minetweaker.api.recipes;
|
||||
|
||||
import minetweaker.minecraft.item.IItemStack;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenGetter;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
@@ -15,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
||||
*
|
||||
* @author Stan
|
||||
*/
|
||||
@ZenClass("minecraft.recipes.ICraftingInventory")
|
||||
@ZenClass("minetweaker.recipes.ICraftingInventory")
|
||||
public interface ICraftingInventory {
|
||||
@ZenGetter("size")
|
||||
public int getSize();
|
||||
+4
-4
@@ -4,10 +4,10 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.recipes;
|
||||
package minetweaker.api.recipes;
|
||||
|
||||
import minetweaker.minecraft.item.IIngredient;
|
||||
import minetweaker.minecraft.item.IItemStack;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.Optional;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
@@ -16,7 +16,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
||||
*
|
||||
* @author Stan
|
||||
*/
|
||||
@ZenClass("minecraft.recipes.IFurnaceManager")
|
||||
@ZenClass("minetweaker.recipes.IFurnaceManager")
|
||||
public interface IFurnaceManager {
|
||||
@ZenMethod
|
||||
public void remove(IIngredient ingredient);
|
||||
+3
-3
@@ -4,17 +4,17 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.recipes;
|
||||
package minetweaker.api.recipes;
|
||||
|
||||
import java.util.Map;
|
||||
import minetweaker.minecraft.item.IItemStack;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Stan
|
||||
*/
|
||||
@ZenClass("minecraft.recipes.IRecipeFunction")
|
||||
@ZenClass("minetweaker.recipes.IRecipeFunction")
|
||||
public interface IRecipeFunction {
|
||||
public IItemStack process(IItemStack output, Map<String, IItemStack> inputs);
|
||||
}
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
package minetweaker.minecraft.recipes;
|
||||
package minetweaker.api.recipes;
|
||||
|
||||
import minetweaker.minecraft.item.IIngredient;
|
||||
import minetweaker.minecraft.item.IItemStack;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.Optional;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
@@ -12,7 +12,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
||||
*
|
||||
* @author Stan Hebben
|
||||
*/
|
||||
@ZenClass("minecraft.recipes.IRecipeManager")
|
||||
@ZenClass("minetweaker.recipes.IRecipeManager")
|
||||
public interface IRecipeManager {
|
||||
/**
|
||||
* Removes all crafting recipes crafting the specified item.
|
||||
+4
-4
@@ -4,12 +4,12 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.recipes;
|
||||
package minetweaker.api.recipes;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import minetweaker.minecraft.item.IIngredient;
|
||||
import minetweaker.minecraft.item.IItemStack;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -66,7 +66,7 @@ public class ShapedRecipe {
|
||||
|
||||
System.out.println("ShapedRecipe width=" + width + ", height=" + height);
|
||||
System.out.println("Ingredients: ");
|
||||
for (int i = 0; i < ingredients.length; i++) {
|
||||
for (int i = 0; i < this.ingredients.length; i++) {
|
||||
System.out.println("(" + posx[i] + ", " + posy[i] + "): " + this.ingredients[i]);
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -4,12 +4,12 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.recipes;
|
||||
package minetweaker.api.recipes;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import minetweaker.minecraft.item.IIngredient;
|
||||
import minetweaker.minecraft.item.IItemStack;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1,25 +1,20 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.expand;
|
||||
|
||||
import java.util.Arrays;
|
||||
import minetweaker.minecraft.data.DataList;
|
||||
import minetweaker.minecraft.data.IData;
|
||||
import minetweaker.api.data.DataList;
|
||||
import minetweaker.api.data.IData;
|
||||
import stanhebben.zenscript.annotations.ZenCaster;
|
||||
import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Stanneke
|
||||
* Makes arrays convertable to IData.
|
||||
*
|
||||
* @author Stan Hebben
|
||||
*/
|
||||
@ZenExpansion("any[]")
|
||||
public class ExpandAnyArray {
|
||||
@ZenCaster
|
||||
public IData asData(IData[] values) {
|
||||
public static IData asData(IData[] values) {
|
||||
return new DataList(Arrays.asList(values), true);
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,8 @@
|
||||
package minetweaker.expand;
|
||||
|
||||
import java.util.Map;
|
||||
import minetweaker.minecraft.data.DataMap;
|
||||
import minetweaker.minecraft.data.IData;
|
||||
import minetweaker.api.data.DataMap;
|
||||
import minetweaker.api.data.IData;
|
||||
import stanhebben.zenscript.annotations.ZenCaster;
|
||||
import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
|
||||
@@ -19,7 +19,7 @@ import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
@ZenExpansion("any[any]")
|
||||
public class ExpandAnyDict {
|
||||
@ZenCaster
|
||||
public IData asData(Map<String, IData> values) {
|
||||
public static IData asData(Map<String, IData> values) {
|
||||
return new DataMap(values, true);
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
package minetweaker.expand;
|
||||
|
||||
import minetweaker.minecraft.data.DataBool;
|
||||
import minetweaker.minecraft.data.IData;
|
||||
import minetweaker.api.data.DataBool;
|
||||
import minetweaker.api.data.IData;
|
||||
import stanhebben.zenscript.annotations.ZenCaster;
|
||||
import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
|
||||
@@ -18,7 +18,7 @@ import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
@ZenExpansion("bool")
|
||||
public class ExpandBool {
|
||||
@ZenCaster
|
||||
public IData asData(boolean value) {
|
||||
public static IData asData(boolean value) {
|
||||
return new DataBool(value);
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
package minetweaker.expand;
|
||||
|
||||
import minetweaker.minecraft.data.DataByte;
|
||||
import minetweaker.minecraft.data.IData;
|
||||
import minetweaker.api.data.DataByte;
|
||||
import minetweaker.api.data.IData;
|
||||
import stanhebben.zenscript.annotations.ZenCaster;
|
||||
import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
|
||||
@@ -18,7 +18,7 @@ import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
@ZenExpansion("byte")
|
||||
public class ExpandByte {
|
||||
@ZenCaster
|
||||
public IData asData(byte value) {
|
||||
public static IData asData(byte value) {
|
||||
return new DataByte(value);
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
package minetweaker.expand;
|
||||
|
||||
import minetweaker.minecraft.data.DataDouble;
|
||||
import minetweaker.minecraft.data.IData;
|
||||
import minetweaker.api.data.DataDouble;
|
||||
import minetweaker.api.data.IData;
|
||||
import stanhebben.zenscript.annotations.ZenCaster;
|
||||
import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
|
||||
@@ -18,7 +18,7 @@ import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
@ZenExpansion("double")
|
||||
public class ExpandDouble {
|
||||
@ZenCaster
|
||||
public IData asData(double value) {
|
||||
public static IData asData(double value) {
|
||||
return new DataDouble(value);
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
package minetweaker.expand;
|
||||
|
||||
import minetweaker.minecraft.data.DataFloat;
|
||||
import minetweaker.minecraft.data.IData;
|
||||
import minetweaker.api.data.DataFloat;
|
||||
import minetweaker.api.data.IData;
|
||||
import stanhebben.zenscript.annotations.ZenCaster;
|
||||
import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
|
||||
@@ -18,7 +18,7 @@ import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
@ZenExpansion("float")
|
||||
public class ExpandFloat {
|
||||
@ZenCaster
|
||||
public IData asData(float value) {
|
||||
public static IData asData(float value) {
|
||||
return new DataFloat(value);
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
package minetweaker.expand;
|
||||
|
||||
import minetweaker.minecraft.data.DataInt;
|
||||
import minetweaker.minecraft.data.IData;
|
||||
import minetweaker.api.data.DataInt;
|
||||
import minetweaker.api.data.IData;
|
||||
import stanhebben.zenscript.annotations.ZenCaster;
|
||||
import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
|
||||
@@ -18,7 +18,7 @@ import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
@ZenExpansion("int")
|
||||
public class ExpandInt {
|
||||
@ZenCaster
|
||||
public IData toData(int value) {
|
||||
public static IData toData(int value) {
|
||||
return new DataInt(value);
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
package minetweaker.expand;
|
||||
|
||||
import minetweaker.minecraft.data.DataLong;
|
||||
import minetweaker.minecraft.data.IData;
|
||||
import minetweaker.api.data.DataLong;
|
||||
import minetweaker.api.data.IData;
|
||||
import stanhebben.zenscript.annotations.ZenCaster;
|
||||
import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
|
||||
@@ -18,7 +18,7 @@ import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
@ZenExpansion("long")
|
||||
public class ExpandLong {
|
||||
@ZenCaster
|
||||
public IData asData(long value) {
|
||||
public static IData asData(long value) {
|
||||
return new DataLong(value);
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
package minetweaker.expand;
|
||||
|
||||
import minetweaker.minecraft.data.DataShort;
|
||||
import minetweaker.minecraft.data.IData;
|
||||
import minetweaker.api.data.DataShort;
|
||||
import minetweaker.api.data.IData;
|
||||
import stanhebben.zenscript.annotations.ZenCaster;
|
||||
import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
|
||||
@@ -18,7 +18,7 @@ import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
@ZenExpansion("short")
|
||||
public class ExpandShort {
|
||||
@ZenCaster
|
||||
public IData asNBT(short value) {
|
||||
public static IData asNBT(short value) {
|
||||
return new DataShort(value);
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
package minetweaker.expand;
|
||||
|
||||
import minetweaker.minecraft.data.DataString;
|
||||
import minetweaker.minecraft.data.IData;
|
||||
import minetweaker.api.data.DataString;
|
||||
import minetweaker.api.data.IData;
|
||||
import stanhebben.zenscript.annotations.ZenCaster;
|
||||
import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
|
||||
@@ -18,7 +18,7 @@ import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
@ZenExpansion("string")
|
||||
public class ExpandString {
|
||||
@ZenCaster
|
||||
public IData asData(String value) {
|
||||
public static IData asData(String value) {
|
||||
return new DataString(value);
|
||||
}
|
||||
}
|
||||
@@ -18,21 +18,33 @@ import java.util.logging.Logger;
|
||||
import minetweaker.IBracketHandler;
|
||||
import minetweaker.IRecipeRemover;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.minecraft.data.IData;
|
||||
import minetweaker.minecraft.item.Condition;
|
||||
import minetweaker.minecraft.item.IIngredient;
|
||||
import minetweaker.minecraft.item.IItemCondition;
|
||||
import minetweaker.minecraft.item.IItemDefinition;
|
||||
import minetweaker.minecraft.item.IItemStack;
|
||||
import minetweaker.minecraft.item.IItemTransformer;
|
||||
import minetweaker.minecraft.item.Transform;
|
||||
import minetweaker.minecraft.liquid.ILiquidDefinition;
|
||||
import minetweaker.minecraft.liquid.ILiquidStack;
|
||||
import minetweaker.minecraft.oredict.IOreDict;
|
||||
import minetweaker.minecraft.oredict.IOreDictEntry;
|
||||
import minetweaker.minecraft.recipes.ICraftingInventory;
|
||||
import minetweaker.minecraft.recipes.IFurnaceManager;
|
||||
import minetweaker.minecraft.recipes.IRecipeFunction;
|
||||
import minetweaker.expand.ExpandAnyArray;
|
||||
import minetweaker.expand.ExpandAnyDict;
|
||||
import minetweaker.expand.ExpandBool;
|
||||
import minetweaker.expand.ExpandByte;
|
||||
import minetweaker.expand.ExpandDouble;
|
||||
import minetweaker.expand.ExpandFloat;
|
||||
import minetweaker.expand.ExpandInt;
|
||||
import minetweaker.expand.ExpandLong;
|
||||
import minetweaker.expand.ExpandShort;
|
||||
import minetweaker.expand.ExpandString;
|
||||
import minetweaker.api.data.IData;
|
||||
import minetweaker.api.item.Condition;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemCondition;
|
||||
import minetweaker.api.item.IItemDefinition;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.item.IItemTransformer;
|
||||
import minetweaker.api.item.Transform;
|
||||
import minetweaker.api.liquid.ILiquidDefinition;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import minetweaker.api.oredict.IOreDict;
|
||||
import minetweaker.api.oredict.IOreDictEntry;
|
||||
import minetweaker.api.player.IPlayer;
|
||||
import minetweaker.api.recipes.ICraftingInventory;
|
||||
import minetweaker.api.recipes.IFurnaceManager;
|
||||
import minetweaker.api.recipes.IRecipeFunction;
|
||||
import minetweaker.api.recipes.IRecipeManager;
|
||||
import stanhebben.zenscript.IZenErrorLogger;
|
||||
import stanhebben.zenscript.TypeExpansion;
|
||||
import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
@@ -77,7 +89,7 @@ public class GlobalRegistry {
|
||||
registerGlobal("furnace", getStaticField(MineTweakerAPI.class, "furnace"));
|
||||
registerGlobal("oreDict", getStaticField(MineTweakerAPI.class, "oreDict"));
|
||||
|
||||
/*registerExpansion(ExpandAnyArray.class);
|
||||
registerExpansion(ExpandAnyArray.class);
|
||||
registerExpansion(ExpandAnyDict.class);
|
||||
registerExpansion(ExpandBool.class);
|
||||
registerExpansion(ExpandByte.class);
|
||||
@@ -86,10 +98,12 @@ public class GlobalRegistry {
|
||||
registerExpansion(ExpandInt.class);
|
||||
registerExpansion(ExpandLong.class);
|
||||
registerExpansion(ExpandShort.class);
|
||||
registerExpansion(ExpandString.class);*/
|
||||
registerExpansion(ExpandString.class);
|
||||
|
||||
// minetweaker.api.data
|
||||
registerNativeClass(IData.class);
|
||||
|
||||
// minetweaker.api.item
|
||||
registerNativeClass(IIngredient.class);
|
||||
registerNativeClass(IItemCondition.class);
|
||||
registerNativeClass(IItemDefinition.class);
|
||||
@@ -98,15 +112,22 @@ public class GlobalRegistry {
|
||||
registerNativeClass(Condition.class);
|
||||
registerNativeClass(Transform.class);
|
||||
|
||||
// minetweaker.api.liquid
|
||||
registerNativeClass(ILiquidDefinition.class);
|
||||
registerNativeClass(ILiquidStack.class);
|
||||
|
||||
// minetweaker.api.oredict
|
||||
registerNativeClass(IOreDict.class);
|
||||
registerNativeClass(IOreDictEntry.class);
|
||||
|
||||
// minetweaker.api.player
|
||||
registerNativeClass(IPlayer.class);
|
||||
|
||||
// minetweaker.api.recipes
|
||||
registerNativeClass(ICraftingInventory.class);
|
||||
registerNativeClass(IFurnaceManager.class);
|
||||
registerNativeClass(IRecipeFunction.class);
|
||||
registerNativeClass(IRecipeManager.class);
|
||||
}
|
||||
|
||||
private GlobalRegistry() {}
|
||||
|
||||
@@ -9,7 +9,7 @@ package minetweaker.runtime;
|
||||
import java.io.Closeable;
|
||||
import java.util.List;
|
||||
import minetweaker.IUndoableAction;
|
||||
import minetweaker.minecraft.item.IIngredient;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import minetweaker.IUndoableAction;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.minecraft.item.IIngredient;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.runtime.providers.ScriptProviderMemory;
|
||||
import stanhebben.zenscript.ZenModule;
|
||||
import static stanhebben.zenscript.ZenModule.compileScripts;
|
||||
@@ -62,6 +62,7 @@ public class Tweaker implements IMineTweaker {
|
||||
MineTweakerAPI.logger.logInfo(action.describeUndo());
|
||||
action.undo();
|
||||
} else {
|
||||
MineTweakerAPI.logger.logInfo("[Stuck] " + action.describe());
|
||||
stuck.add(0, action);
|
||||
wereStuck.add(action);
|
||||
}
|
||||
@@ -108,7 +109,7 @@ public class Tweaker implements IMineTweaker {
|
||||
} catch (ParseException ex) {
|
||||
MineTweakerAPI.logger.logError("Error parsing " + ex.getFile() + ":" + ex.getLine() + " -- " + ex.getExplanation());
|
||||
} catch (Exception ex) {
|
||||
MineTweakerAPI.logger.logError("Error loading " + script.getName() + ": " + ex.getMessage());
|
||||
MineTweakerAPI.logger.logError("Error loading " + script.getName() + ": " + ex.toString());
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ import java.util.Set;
|
||||
import java.util.zip.DeflaterOutputStream;
|
||||
import java.util.zip.InflaterInputStream;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.minecraft.util.FileUtil;
|
||||
import minetweaker.util.FileUtil;
|
||||
import minetweaker.runtime.IScriptIterator;
|
||||
import minetweaker.runtime.IScriptProvider;
|
||||
|
||||
|
||||
+3
-3
@@ -4,11 +4,11 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.util;
|
||||
package minetweaker.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
import minetweaker.minecraft.item.IItemCondition;
|
||||
import minetweaker.minecraft.item.IItemTransformer;
|
||||
import minetweaker.api.item.IItemCondition;
|
||||
import minetweaker.api.item.IItemTransformer;
|
||||
|
||||
/**
|
||||
*
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.util;
|
||||
package minetweaker.util;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.minecraft.util;
|
||||
package minetweaker.util;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
Reference in new issue
Block a user