mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-20 03:59:38 +00:00
Tons of changes:
- Added interface to game, client and server - Added transformations - Made ingredient conditions more practical to use, no longer requires imports - Started implementation of event handling - Moved commands and logic to the common API code - Added common interface to MineTweaker recipes - Added string methods - Moved the logger from static value to static getter - Fixed crashes on dedicated servers - Fixed bracket resolution for <id:meta> values in 1.6.4 - Fixed scripts not being sent to multiplayer clients in 1.6.4
This commit is contained in:
1 parent
7f6235f30d
commit
115593efa5
131 files changed
+3215
-1930
No files matched your search
@@ -11,15 +11,18 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import minetweaker.annotations.BracketHandler;
|
||||
import minetweaker.annotations.ModOnly;
|
||||
import minetweaker.api.client.IClient;
|
||||
import minetweaker.api.event.IEventManager;
|
||||
import minetweaker.api.game.IGame;
|
||||
import minetweaker.api.mods.ILoadedMods;
|
||||
import minetweaker.runtime.IMineTweaker;
|
||||
import minetweaker.runtime.ITweaker;
|
||||
import minetweaker.runtime.ILogger;
|
||||
import minetweaker.runtime.Tweaker;
|
||||
import minetweaker.runtime.MTTweaker;
|
||||
import minetweaker.api.recipes.IRecipeManager;
|
||||
import minetweaker.api.oredict.IOreDict;
|
||||
import minetweaker.api.recipes.IFurnaceManager;
|
||||
import minetweaker.api.resource.IResourceManager;
|
||||
import minetweaker.api.server.IServer;
|
||||
import minetweaker.runtime.GlobalRegistry;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
@@ -57,12 +60,13 @@ public class MineTweakerAPI {
|
||||
registerClass(cls);
|
||||
}
|
||||
|
||||
registerGlobalSymbol("logger", getJavaStaticFieldSymbol(MineTweakerAPI.class, "logger"));
|
||||
registerGlobalSymbol("logger", getJavaStaticGetterSymbol(MineTweakerAPI.class, "getLogger"));
|
||||
registerGlobalSymbol("tweaker", getJavaStaticFieldSymbol(MineTweakerAPI.class, "tweaker"));
|
||||
registerGlobalSymbol("recipes", getJavaStaticFieldSymbol(MineTweakerAPI.class, "recipes"));
|
||||
registerGlobalSymbol("furnace", getJavaStaticFieldSymbol(MineTweakerAPI.class, "furnace"));
|
||||
registerGlobalSymbol("oreDict", getJavaStaticFieldSymbol(MineTweakerAPI.class, "oreDict"));
|
||||
registerGlobalSymbol("events", getJavaStaticFieldSymbol(MineTweakerAPI.class, "events"));
|
||||
registerGlobalSymbol("server", getJavaStaticFieldSymbol(MineTweakerAPI.class, "server"));
|
||||
}
|
||||
|
||||
private MineTweakerAPI() {}
|
||||
@@ -71,13 +75,17 @@ public class MineTweakerAPI {
|
||||
* The Tweaker is where you apply undoable actions. Any kind of action that
|
||||
* reloads with the scripts should always be submitted to the tweaker.
|
||||
*/
|
||||
public static final IMineTweaker tweaker = new Tweaker();
|
||||
public static final ITweaker tweaker = new MTTweaker();
|
||||
|
||||
/**
|
||||
* The logger can be used to write logging messages to the client. Error and
|
||||
* warning messages should be relayed to admins for further handling.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static ILogger logger = null;
|
||||
public static final ILogger getLogger() {
|
||||
return MineTweakerImplementationAPI.logger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access point to the ore dictionary.
|
||||
@@ -97,7 +105,22 @@ public class MineTweakerAPI {
|
||||
/**
|
||||
* Access point to the events manager.
|
||||
*/
|
||||
public static IEventManager events = null;
|
||||
public static final IEventManager events = MineTweakerImplementationAPI.events;
|
||||
|
||||
/**
|
||||
* Access point to the server, if any.
|
||||
*/
|
||||
public static IServer server = null;
|
||||
|
||||
/**
|
||||
* Access point to the client, if any.
|
||||
*/
|
||||
public static IClient client = null;
|
||||
|
||||
/**
|
||||
* Access point to general game data, such as items.
|
||||
*/
|
||||
public static IGame game = null;
|
||||
|
||||
/**
|
||||
* Access point to mods list.
|
||||
@@ -110,11 +133,6 @@ public class MineTweakerAPI {
|
||||
*/
|
||||
public static IResourceManager resources = null;
|
||||
|
||||
/**
|
||||
* Access point to general platform functions.
|
||||
*/
|
||||
public static IPlatformFunctions platform = 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
|
||||
|
||||
Reference in new issue
Block a user