- Implemented item renaming

- Did a little bit of work on asset handling
This commit is contained in:
Stan Hebben committed 2014-06-28 19:25:11 +02:00
1 parent 3a9a784084
commit 9b51082c4b
16 files changed
+300

No files matched your search

@@ -19,6 +19,7 @@ import minetweaker.runtime.Tweaker;
import minetweaker.api.recipes.IRecipeManager;
import minetweaker.api.oredict.IOreDict;
import minetweaker.api.recipes.IFurnaceManager;
import minetweaker.api.resource.IResourceManager;
import minetweaker.runtime.GlobalRegistry;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenExpansion;
@@ -36,6 +37,8 @@ import stanhebben.zenscript.type.natives.JavaMethod;
* - Set the ore dictionary
* - Set the recipe manager
* - Set the furnace manager
* - Set event manager
* - Set resource manager
*
* - Register additional global symbols to the GlobalRegistry (recipes,
* minetweaker, oreDict, logger, as well as the official set of functions)
@@ -101,6 +104,19 @@ public class MineTweakerAPI {
*/
public static ILoadedMods loadedMods = null;
/**
* Access point to the global resource manager. Note that each script group also
* has its own local resource manager.
*/
public static IResourceManager resources = null;
/**
* Register a class registry class. Such class must have (at least) a public
* static method called "getClasses" with accepts a List of classes and which
* stores its classes into that list.
*
* @param registryClass
*/
public static void registerClassRegistry(Class registryClass) {
try {
Method method = registryClass.getMethod("getClasses", List.class);
@@ -13,6 +13,7 @@ import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenGetter;
import stanhebben.zenscript.annotations.ZenMethod;
import stanhebben.zenscript.annotations.ZenOperator;
import stanhebben.zenscript.annotations.ZenSetter;
/**
*
@@ -29,6 +30,9 @@ public interface IItemStack extends IIngredient {
@ZenGetter("displayName")
public String getDisplayName();
@ZenSetter("displayName")
public void setDisplayName(String name);
@ZenGetter("damage")
public int getDamage();
@@ -0,0 +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.api.resource;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenGetter;
/**
*
* @author Stan
*/
@ZenClass("minetweaker.resource.IResourceFile")
public interface IResourceFile {
@ZenGetter("name")
public String getName();
}
@@ -0,0 +1,22 @@
/*
* 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.api.resource;
/**
*
* @author Stan
*/
public interface IResourceManager {
/**
* Retrieves a resource file. Returns null if the resource dosen't exist.
*
* @param module
* @param name
* @return
*/
public IResourceFile getResource(String module, String name);
}