mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-21 12:32:29 +00:00
updated to 1.9.4
This commit is contained in:
1 parent
f89919bae7
commit
a7e6f13c60
27 files changed
+291
-118
No files matched your search
@@ -1,15 +1,5 @@
|
||||
package minetweaker;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import minetweaker.annotations.BracketHandler;
|
||||
import minetweaker.annotations.ModOnly;
|
||||
import minetweaker.api.client.IClient;
|
||||
@@ -17,15 +7,15 @@ import minetweaker.api.event.IEventManager;
|
||||
import minetweaker.api.formatting.IFormatter;
|
||||
import minetweaker.api.game.IGame;
|
||||
import minetweaker.api.mods.ILoadedMods;
|
||||
import minetweaker.runtime.ITweaker;
|
||||
import minetweaker.runtime.ILogger;
|
||||
import minetweaker.runtime.MTTweaker;
|
||||
import minetweaker.api.recipes.IRecipeManager;
|
||||
import minetweaker.api.oredict.IOreDict;
|
||||
import minetweaker.api.recipes.IFurnaceManager;
|
||||
import minetweaker.api.recipes.IRecipeManager;
|
||||
import minetweaker.api.server.IServer;
|
||||
import minetweaker.api.vanilla.IVanilla;
|
||||
import minetweaker.runtime.GlobalRegistry;
|
||||
import minetweaker.runtime.ILogger;
|
||||
import minetweaker.runtime.ITweaker;
|
||||
import minetweaker.runtime.MTTweaker;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
import stanhebben.zenscript.symbols.IZenSymbol;
|
||||
@@ -35,6 +25,16 @@ import stanhebben.zenscript.symbols.SymbolJavaStaticMethod;
|
||||
import stanhebben.zenscript.type.natives.IJavaMethod;
|
||||
import stanhebben.zenscript.type.natives.JavaMethod;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* Provides access to the MineTweaker API.
|
||||
*
|
||||
@@ -79,7 +79,8 @@ public class MineTweakerAPI {
|
||||
|
||||
registerGlobalSymbol("logger", getJavaStaticGetterSymbol(MineTweakerAPI.class, "getLogger"));
|
||||
registerGlobalSymbol("recipes", getJavaStaticFieldSymbol(MineTweakerAPI.class, "recipes"));
|
||||
registerGlobalSymbol("furnace", getJavaStaticFieldSymbol(MineTweakerAPI.class, "furnace"));
|
||||
// registerGlobalSymbol("brewing", getJavaStaticFieldSymbol(MineTweakerAPI.class, "brewing"));
|
||||
registerGlobalSymbol("furnace", getJavaStaticFieldSymbol(MineTweakerAPI.class, "furnace"));
|
||||
registerGlobalSymbol("oreDict", getJavaStaticFieldSymbol(MineTweakerAPI.class, "oreDict"));
|
||||
registerGlobalSymbol("events", getJavaStaticFieldSymbol(MineTweakerAPI.class, "events"));
|
||||
registerGlobalSymbol("server", getJavaStaticFieldSymbol(MineTweakerAPI.class, "server"));
|
||||
@@ -91,6 +92,7 @@ public class MineTweakerAPI {
|
||||
}
|
||||
|
||||
private MineTweakerAPI() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,6 +122,11 @@ public class MineTweakerAPI {
|
||||
*/
|
||||
public static IRecipeManager recipes = null;
|
||||
|
||||
// /**
|
||||
// * Access point to the brewing manager.
|
||||
// */
|
||||
// public static IBrewingManager brewing = null;
|
||||
|
||||
/**
|
||||
* Access point to the furnace manager.
|
||||
*/
|
||||
|
||||
@@ -35,6 +35,7 @@ import java.awt.datatransfer.StringSelection;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import static minetweaker.MineTweakerAPI.furnace;
|
||||
import static minetweaker.MineTweakerAPI.server;
|
||||
|
||||
/**
|
||||
@@ -243,7 +244,7 @@ public class MineTweakerImplementationAPI {
|
||||
}
|
||||
|
||||
MineTweakerAPI.logCommand("Furnace Recipes:");
|
||||
for (IFurnaceRecipe recipe : MineTweakerAPI.furnace.getAll()) {
|
||||
for (IFurnaceRecipe recipe : furnace.getAll()) {
|
||||
try {
|
||||
MineTweakerAPI.logCommand(recipe.toCommandString());
|
||||
} catch (Throwable ex) {
|
||||
@@ -761,6 +762,7 @@ public class MineTweakerImplementationAPI {
|
||||
public String describeUndo() {
|
||||
return "tried to remove command: " + command.name + " failed. THIS IS NOT AN ERROR!";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package minetweaker.api.recipes;
|
||||
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
|
||||
/**
|
||||
* Created by Jared on 6/3/2016.
|
||||
*/
|
||||
public class BrewingRecipe implements IBrewingRecipe {
|
||||
|
||||
private final IItemStack output;
|
||||
private final IItemStack input;
|
||||
private final IIngredient ingredient;
|
||||
|
||||
public BrewingRecipe(IItemStack output, IItemStack input, IIngredient ingredient) {
|
||||
this.input = input;
|
||||
this.ingredient = ingredient;
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toCommandString() {
|
||||
return String.format("brewing.add(%s, %s, %s", output, input, ingredient);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package minetweaker.api.recipes;
|
||||
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenGetter;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The BrewingManager adds and removes brewing recipes. The IBrewingManager
|
||||
* instance is available through the recipes global variable.
|
||||
*
|
||||
* @author Jared
|
||||
*/
|
||||
@ZenClass("minetweaker.recipes.IBrewingManager")
|
||||
public interface IBrewingManager {
|
||||
|
||||
/**
|
||||
* Returns all crafting recipes.
|
||||
*
|
||||
* @return all crafting recipes
|
||||
*/
|
||||
@ZenGetter("all")
|
||||
public List<IBrewingRecipe> getAll();
|
||||
|
||||
/**
|
||||
* Removes a brewing recipe from the specified item.
|
||||
*
|
||||
* @param output recipe output pattern
|
||||
* @return number of removed recipes
|
||||
*/
|
||||
@ZenMethod
|
||||
public void remove(IItemStack output);
|
||||
|
||||
/**
|
||||
* Adds a recipe.
|
||||
*
|
||||
* @param output recipe output
|
||||
* @param ingredient recipe ingredient
|
||||
* @param input recipe input
|
||||
*/
|
||||
@ZenMethod
|
||||
public void add(
|
||||
IItemStack output,
|
||||
IItemStack ingredient,
|
||||
IItemStack input);
|
||||
|
||||
/**
|
||||
* Removes recipes.
|
||||
*
|
||||
* @param output recipe output
|
||||
* @param ingredients recipe ingredient
|
||||
* @return number of removed recipes
|
||||
*/
|
||||
@ZenMethod
|
||||
public int remove(
|
||||
IItemStack output,
|
||||
IItemStack ingredients);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package minetweaker.api.recipes;
|
||||
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
|
||||
/**
|
||||
* Created by Jared on 6/2/2016.
|
||||
*/
|
||||
@ZenClass("minetweaker.recipes.IBrewingRecipe")
|
||||
public interface IBrewingRecipe {
|
||||
|
||||
public String toCommandString();
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* The RecipeManager adds and removes crafting recipes. The IRecipeManager
|
||||
* instance is available throug the recipes global variable.
|
||||
* instance is available through the recipes global variable.
|
||||
*
|
||||
* @author Stan Hebben
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package minetweaker.api.vanilla;
|
||||
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import stanhebben.zenscript.annotations.ZenSetter;
|
||||
|
||||
/**
|
||||
* Created by Jared on 6/3/2016.
|
||||
*/
|
||||
@ZenClass("minetweaker.vanilla.ILootFunction")
|
||||
public interface ILootFunction {
|
||||
|
||||
@ZenMethod
|
||||
String getName();
|
||||
|
||||
@ZenSetter
|
||||
void setName();
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -6,31 +6,30 @@
|
||||
|
||||
package minetweaker.api.vanilla;
|
||||
|
||||
import java.util.List;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.WeightedItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenGetter;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Stan
|
||||
*/
|
||||
@ZenClass("vanilla.ILootRegistry")
|
||||
public interface ILootRegistry {
|
||||
@ZenMethod
|
||||
public void addChestLoot(String name, WeightedItemStack item);
|
||||
@ZenMethod
|
||||
public void addChestLoot(String name, WeightedItemStack item);
|
||||
@ZenMethod
|
||||
public void addChestLoot(String name, WeightedItemStack item, int min, int max);
|
||||
|
||||
@ZenMethod
|
||||
public void addChestLoot(String name, WeightedItemStack item, int min, int max);
|
||||
@ZenMethod
|
||||
public void removeChestLoot(String name, IIngredient ingredient);
|
||||
|
||||
@ZenMethod
|
||||
public void removeChestLoot(String name, IIngredient ingredient);
|
||||
@ZenMethod
|
||||
public List<LootEntry> getLoot(String name);
|
||||
|
||||
@ZenMethod
|
||||
public List<LootEntry> getLoot(String name);
|
||||
|
||||
@ZenGetter("lootTypes")
|
||||
public List<String> getLootTypes();
|
||||
@ZenGetter("lootTypes")
|
||||
public List<String> getLootTypes();
|
||||
}
|
||||
Reference in new issue
Block a user