mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-24 22:04:23 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5044de32dd | ||
|
|
7b75ffb679 | ||
|
|
4787672b6e | ||
|
|
22502ff016 | ||
|
|
7c060cb624 | ||
|
|
b6a27cb150 | ||
|
|
6ffcca483f | ||
|
|
dc78b2b39e | ||
|
|
436ad039ca | ||
|
|
a348865dda | ||
|
|
86b4108e4f | ||
|
|
4d4fed2482 | ||
|
|
1796484e7c | ||
|
|
8fff244d95 | ||
|
|
e4a0cc8f35 | ||
|
|
7c0eb67215 | ||
|
|
9167cd1f1d | ||
|
|
af79e56481 |
No files matched your search
@@ -0,0 +1,6 @@
|
||||
|
||||
# CraftTweaker
|
||||
|
||||
Changelog of CraftTweaker.
|
||||
|
||||
|
||||
@@ -7,12 +7,11 @@ version = ext.mineTweakerVersion
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
task makeRegistry(type: RegisterZenClassesTask) {
|
||||
inputDir = file('build/classes/main')
|
||||
outputDir = file('build/classes/main')
|
||||
dependsOn tasks.compileJava
|
||||
inputDir = file('build/classes/java/main')
|
||||
outputDir = file('build/classes/java/main')
|
||||
className = 'minetweaker.ClassRegistry'
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import minetweaker.api.world.IBiome;
|
||||
import minetweaker.runtime.IScriptProvider;
|
||||
import minetweaker.util.EventList;
|
||||
import minetweaker.util.IEventHandler;
|
||||
import sun.awt.HeadlessToolkit;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.datatransfer.Clipboard;
|
||||
@@ -58,6 +57,7 @@ public class MineTweakerImplementationAPI {
|
||||
private static final ListenPlayerLoggedIn LISTEN_LOGIN = new ListenPlayerLoggedIn();
|
||||
private static final ListenPlayerLoggedOut LISTEN_LOGOUT = new ListenPlayerLoggedOut();
|
||||
private static final ListenBlockInfo LISTEN_BLOCK_INFO = new ListenBlockInfo();
|
||||
private static final EventList<ReloadEvent> ONROLLBACK = new EventList<>();
|
||||
private static final EventList<ReloadEvent> ONRELOAD = new EventList<>();
|
||||
private static final EventList<ReloadEvent> ONPOSTRELOAD = new EventList<>();
|
||||
|
||||
@@ -573,6 +573,9 @@ public class MineTweakerImplementationAPI {
|
||||
* @param handler
|
||||
* @return
|
||||
*/
|
||||
public static IEventHandle onRollbackEvent(IEventHandler<ReloadEvent> handler) {
|
||||
return ONROLLBACK.add(handler);
|
||||
}
|
||||
public static IEventHandle onReloadEvent(IEventHandler<ReloadEvent> handler) {
|
||||
return ONRELOAD.add(handler);
|
||||
}
|
||||
@@ -623,6 +626,8 @@ public class MineTweakerImplementationAPI {
|
||||
}
|
||||
|
||||
MineTweakerAPI.tweaker.rollback();
|
||||
ONROLLBACK.publish(new ReloadEvent());
|
||||
|
||||
if (MineTweakerAPI.server != null) {
|
||||
if (!MineTweakerAPI.server.isCommandAdded("minetweaker")) {
|
||||
server.addCommand("minetweaker", "", new String[]{"mt", "crafttweaker", "ct"}, new ICommandFunction() {
|
||||
@@ -686,7 +691,7 @@ public class MineTweakerImplementationAPI {
|
||||
|
||||
private static void copyToClipboard(String value) {
|
||||
StringSelection stringSelection = new StringSelection(value);
|
||||
if (!(Toolkit.getDefaultToolkit() instanceof HeadlessToolkit)) {
|
||||
if (Desktop.isDesktopSupported()) {
|
||||
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
|
||||
clipboard.setContents(stringSelection, null);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,9 @@ public interface IRecipeManager {
|
||||
*/
|
||||
@ZenMethod
|
||||
int remove(IIngredient output, @Optional boolean nbtMatch);
|
||||
|
||||
|
||||
int remove(IIngredient output);
|
||||
|
||||
/**
|
||||
* Adds a shaped recipe.
|
||||
*
|
||||
@@ -51,7 +53,12 @@ public interface IRecipeManager {
|
||||
*/
|
||||
@ZenMethod
|
||||
void addShaped(IItemStack output, IIngredient[][] ingredients, @Optional IRecipeFunction function, @Optional IRecipeAction action);
|
||||
|
||||
|
||||
void addShaped(IItemStack output, IIngredient[][] ingredients, IRecipeFunction function);
|
||||
|
||||
void addShaped(IItemStack output, IIngredient[][] ingredients, IRecipeAction action);
|
||||
|
||||
void addShaped(IItemStack output, IIngredient[][] ingredients);
|
||||
/**
|
||||
* Adds a mirrored shaped recipe.
|
||||
*
|
||||
@@ -61,7 +68,12 @@ public interface IRecipeManager {
|
||||
*/
|
||||
@ZenMethod
|
||||
void addShapedMirrored(IItemStack output, IIngredient[][] ingredients, @Optional IRecipeFunction function, @Optional IRecipeAction action);
|
||||
|
||||
|
||||
void addShapedMirrored(IItemStack output, IIngredient[][] ingredients, IRecipeFunction function);
|
||||
|
||||
void addShapedMirrored(IItemStack output, IIngredient[][] ingredients, IRecipeAction action);
|
||||
|
||||
void addShapedMirrored(IItemStack output, IIngredient[][] ingredients);
|
||||
/**
|
||||
* Adds a shapeless recipe.
|
||||
*
|
||||
@@ -71,7 +83,13 @@ public interface IRecipeManager {
|
||||
*/
|
||||
@ZenMethod
|
||||
void addShapeless(IItemStack output, IIngredient[] ingredients, @Optional IRecipeFunction function, @Optional IRecipeAction action);
|
||||
|
||||
|
||||
void addShapeless(IItemStack output, IIngredient[] ingredients, IRecipeFunction function);
|
||||
|
||||
void addShapeless(IItemStack output, IIngredient[] ingredients, IRecipeAction action);
|
||||
|
||||
void addShapeless(IItemStack output, IIngredient[] ingredients);
|
||||
|
||||
/**
|
||||
* Removes shaped recipes.
|
||||
*
|
||||
@@ -82,7 +100,8 @@ public interface IRecipeManager {
|
||||
*/
|
||||
@ZenMethod
|
||||
int removeShaped(IIngredient output, @Optional IIngredient[][] ingredients);
|
||||
|
||||
|
||||
int removeShaped(IIngredient output);
|
||||
/**
|
||||
* Removes shapeless recipes.
|
||||
*
|
||||
@@ -95,7 +114,13 @@ public interface IRecipeManager {
|
||||
*/
|
||||
@ZenMethod
|
||||
int removeShapeless(IIngredient output, @Optional IIngredient[] ingredients, @Optional boolean wildcard);
|
||||
|
||||
|
||||
int removeShapeless(IIngredient output, boolean wildcard);
|
||||
|
||||
int removeShapeless(IIngredient output, IIngredient[] ingredients);
|
||||
|
||||
int removeShapeless(IIngredient output);
|
||||
|
||||
/**
|
||||
* Performs a crafting with the specified ingredients. Returns null if no
|
||||
* crafting recipe exists.
|
||||
|
||||
@@ -52,6 +52,7 @@ public class MTTweaker implements ITweaker {
|
||||
|
||||
Object overrideKey = action.getOverrideKey();
|
||||
if (wereStuck.contains(action)) {
|
||||
MineTweakerAPI.logInfo("WAS STUCK");
|
||||
wereStuck.remove(action);
|
||||
|
||||
if (overrideKey != null) {
|
||||
@@ -76,7 +77,8 @@ public class MTTweaker implements ITweaker {
|
||||
|
||||
@Override
|
||||
public List<IUndoableAction> rollback() {
|
||||
List<IUndoableAction> stuck = new ArrayList<IUndoableAction>();
|
||||
// Note: Requires a OnRollback event to be fired. If this is called from MineTweakerImplementationAPI it's handled there.
|
||||
List<IUndoableAction> stuck = new ArrayList<>();
|
||||
for (int i = actions.size() - 1; i >= 0; i--) {
|
||||
IUndoableAction action = actions.get(i);
|
||||
if (action.canUndo()) {
|
||||
|
||||
+2
-8
@@ -12,13 +12,7 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.zip.DeflaterOutputStream;
|
||||
import java.util.zip.InflaterInputStream;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
@@ -74,7 +68,7 @@ public class ScriptProviderMemory implements IScriptProvider {
|
||||
private final Map<String, MemoryModule> modules;
|
||||
|
||||
public ScriptProviderMemory(byte[] scripts) {
|
||||
modules = new HashMap<String, MemoryModule>();
|
||||
modules = new TreeMap<String, MemoryModule>();
|
||||
|
||||
try {
|
||||
InflaterInputStream inflater = new InflaterInputStream(new ByteArrayInputStream(scripts));
|
||||
|
||||
@@ -1,29 +1,10 @@
|
||||
import minetweaker.tasks.RegisterZenClassesTask;
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
apply plugin: 'maven'
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
version = "1.7.10-" + ext.mineTweakerVersion
|
||||
archivesBaseName = project.projectDir.name
|
||||
@@ -40,8 +21,9 @@ dependencies {
|
||||
}
|
||||
|
||||
task makeRegistry(type: RegisterZenClassesTask) {
|
||||
inputDir = file('build/classes/main')
|
||||
outputDir = file('build/classes/main')
|
||||
dependsOn tasks.compileJava
|
||||
inputDir = file('build/classes/java/main')
|
||||
outputDir = file('build/classes/java/main')
|
||||
className = 'minetweaker.mc1710.MineTweakerRegistry'
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
public class FMLEventHandler {
|
||||
@SubscribeEvent
|
||||
public void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent ev) {
|
||||
if (ev.player instanceof EntityPlayerMP) {
|
||||
if (ev.player instanceof EntityPlayerMP && MineTweakerConfig.sendLoadScripts) {
|
||||
EntityPlayerMP player = (EntityPlayerMP) ev.player;
|
||||
MineTweakerMod.NETWORK.sendTo(new MineTweakerLoadScriptsPacket(MineTweakerAPI.tweaker.getScriptData()), player);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
package minetweaker.mc1710;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import minetweaker.*;
|
||||
import minetweaker.api.entity.*;
|
||||
import minetweaker.api.formatting.IFormattedText;
|
||||
@@ -15,10 +17,12 @@ import minetweaker.api.minecraft.MineTweakerMC;
|
||||
import minetweaker.api.tooltip.IngredientTooltips;
|
||||
import minetweaker.mc1710.formatting.IMCFormattedString;
|
||||
import minetweaker.mc1710.item.*;
|
||||
import net.minecraft.client.multiplayer.GuiConnecting;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.item.*;
|
||||
import net.minecraft.entity.player.*;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraftforge.client.event.GuiOpenEvent;
|
||||
import net.minecraftforge.event.entity.living.*;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
@@ -42,6 +46,12 @@ public class ForgeEventHandler {
|
||||
MineTweakerImplementationAPI.events.publishPlayerInteract(event);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onPlayerGuiOpen(GuiOpenEvent ev) {
|
||||
if (ev.gui != null && ev.gui instanceof GuiConnecting) MineTweakerMod.INSTANCE.onClientAboutToConnect();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onItemTooltip(ItemTooltipEvent ev) {
|
||||
if(ev.itemStack!= null) {
|
||||
|
||||
@@ -32,7 +32,7 @@ public class MCPlatformFunctions implements IPlatformFunctions {
|
||||
|
||||
@Override
|
||||
public void distributeScripts(byte[] data) {
|
||||
MineTweakerMod.NETWORK.sendToAll(new MineTweakerLoadScriptsPacket(data));
|
||||
if (MineTweakerConfig.sendScriptsOnReloading) MineTweakerMod.NETWORK.sendToAll(new MineTweakerLoadScriptsPacket(data));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package minetweaker.mc1710;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
public class MineTweakerConfig {
|
||||
private MineTweakerConfig() { }
|
||||
public static boolean handleDesktopPackets = false, handleLoadScripts = true, sendLoadScripts = true,
|
||||
sendScriptsOnReloading = true, loadScriptsBeforeConnection = false, antiStuck = true;
|
||||
static File file;
|
||||
|
||||
public static void load() {
|
||||
Configuration config = new Configuration(file, "1");
|
||||
config.load();
|
||||
handleDesktopPackets = config.getBoolean("handleDesktopPackets",
|
||||
"network", false, "Handle OpenBrowser and CopyClipboard packets? Insecure.");
|
||||
handleLoadScripts = config.getBoolean("handleLoadScripts", "network", true,
|
||||
"Proccess LoadScripts packet on client? Insecure, takes time, but update scripts on the fly...");
|
||||
|
||||
sendLoadScripts = config.getBoolean("sendLoadScripts",
|
||||
"network", true, "Send scripts to players on logging in");
|
||||
sendScriptsOnReloading = config.getBoolean("sendScriptsOnReloading",
|
||||
"network", true, "Send scripts to players on command \"mt reload\"");
|
||||
|
||||
loadScriptsBeforeConnection = config.getBoolean("loadScriptsBeforeConnection",
|
||||
"core", false, "Load scripts before connect to server? Save time and traffic. Requires server with disabled sendLoadScripts.");
|
||||
antiStuck = config.getBoolean("antiStuck",
|
||||
"core", false, "Do not reload scripts when relogging, saves time. Usable when playing on one server/singleplayer...");
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,7 @@ import minetweaker.runtime.*;
|
||||
import minetweaker.runtime.providers.ScriptProviderCascade;
|
||||
import minetweaker.runtime.providers.ScriptProviderCustom;
|
||||
import minetweaker.runtime.providers.ScriptProviderDirectory;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -82,6 +83,7 @@ public class MineTweakerMod {
|
||||
|
||||
private final IScriptProvider scriptsGlobal;
|
||||
private final ScriptProviderCustom scriptsIMC;
|
||||
private volatile boolean loaded = false;
|
||||
|
||||
public MineTweakerMod() {
|
||||
MCRecipeManager.recipes = (List<IRecipe>) CraftingManager.getInstance().getRecipeList();
|
||||
@@ -127,6 +129,8 @@ public class MineTweakerMod {
|
||||
|
||||
@EventHandler
|
||||
public void onLoad(FMLPreInitializationEvent ev) {
|
||||
MineTweakerConfig.file = new File(ev.getModConfigurationDirectory(), MODID + ".cfg");
|
||||
MineTweakerConfig.load();
|
||||
MinecraftForge.EVENT_BUS.register(new ForgeEventHandler());
|
||||
FMLCommonHandler.instance().bus().register(new FMLEventHandler());
|
||||
}
|
||||
@@ -148,17 +152,13 @@ public class MineTweakerMod {
|
||||
ItemBracketHandler.rebuildItemRegistry();
|
||||
LiquidBracketHandler.rebuildLiquidRegistry();
|
||||
MineTweakerAPI.logInfo("MineTweaker: Sucessfully built item registry");
|
||||
if (MineTweakerPlatformUtils.isClient()) {
|
||||
MineTweakerAPI.client = new MCClient();
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onServerAboutToStart(FMLServerAboutToStartEvent ev) {
|
||||
// starts before loading worlds
|
||||
// perfect place to start MineTweaker!
|
||||
|
||||
if (MineTweakerPlatformUtils.isClient()) {
|
||||
MineTweakerAPI.client = new MCClient();
|
||||
}
|
||||
|
||||
File scriptsDir = new File(MineTweakerHacks.getWorldDirectory(ev.getServer()), "scripts");
|
||||
if (!scriptsDir.exists()) {
|
||||
scriptsDir.mkdir();
|
||||
@@ -168,12 +168,21 @@ public class MineTweakerMod {
|
||||
IScriptProvider cascaded = new ScriptProviderCascade(scriptsIMC, scriptsGlobal,scriptsLocal);
|
||||
|
||||
MineTweakerImplementationAPI.setScriptProvider(cascaded);
|
||||
MineTweakerImplementationAPI.onServerStart(new MCServer(ev.getServer()));
|
||||
MCServer srv = new MCServer(ev.getServer());
|
||||
if (loaded && MineTweakerConfig.antiStuck) MineTweakerAPI.server = srv;
|
||||
else {
|
||||
MineTweakerImplementationAPI.onServerStart(srv);
|
||||
loaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onServerStarting(FMLServerStartingEvent ev) {
|
||||
|
||||
public void onClientAboutToConnect() {
|
||||
if (!MineTweakerConfig.loadScriptsBeforeConnection) return;
|
||||
IScriptProvider cascaded = new ScriptProviderCascade(scriptsIMC, scriptsGlobal);
|
||||
MineTweakerImplementationAPI.setScriptProvider(cascaded);
|
||||
if (loaded && MineTweakerConfig.antiStuck) return;
|
||||
MineTweakerImplementationAPI.reload();
|
||||
loaded = true;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
||||
+3
-1
@@ -9,6 +9,8 @@ package minetweaker.mc1710.network;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import minetweaker.mc1710.MineTweakerConfig;
|
||||
|
||||
import java.awt.Desktop;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.datatransfer.Clipboard;
|
||||
@@ -21,7 +23,7 @@ import java.awt.datatransfer.StringSelection;
|
||||
public class MineTweakerCopyClipboardHandler implements IMessageHandler<MineTweakerCopyClipboardPacket, IMessage> {
|
||||
@Override
|
||||
public IMessage onMessage(MineTweakerCopyClipboardPacket message, MessageContext ctx) {
|
||||
if (Desktop.isDesktopSupported()) {
|
||||
if (Desktop.isDesktopSupported() && MineTweakerConfig.handleDesktopPackets) {
|
||||
StringSelection stringSelection = new StringSelection(message.getData());
|
||||
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
|
||||
clipboard.setContents(stringSelection, null);
|
||||
|
||||
+2
-5
@@ -11,7 +11,7 @@ import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.MineTweakerImplementationAPI;
|
||||
import minetweaker.mc1710.client.MCClient;
|
||||
import minetweaker.mc1710.MineTweakerConfig;
|
||||
import minetweaker.runtime.providers.ScriptProviderMemory;
|
||||
|
||||
/**
|
||||
@@ -21,13 +21,10 @@ import minetweaker.runtime.providers.ScriptProviderMemory;
|
||||
public class MineTweakerLoadScriptsHandler implements IMessageHandler<MineTweakerLoadScriptsPacket, IMessage> {
|
||||
@Override
|
||||
public IMessage onMessage(MineTweakerLoadScriptsPacket message, MessageContext ctx) {
|
||||
if (MineTweakerAPI.server == null) {
|
||||
MineTweakerAPI.client = new MCClient();
|
||||
|
||||
if (MineTweakerAPI.server == null && MineTweakerConfig.handleLoadScripts) {
|
||||
MineTweakerImplementationAPI.setScriptProvider(new ScriptProviderMemory(message.getData()));
|
||||
MineTweakerImplementationAPI.reload();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -9,6 +9,8 @@ package minetweaker.mc1710.network;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import minetweaker.mc1710.MineTweakerConfig;
|
||||
|
||||
import java.awt.Desktop;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
@@ -21,15 +23,13 @@ import java.net.URISyntaxException;
|
||||
public class MineTweakerOpenBrowserHandler implements IMessageHandler<MineTweakerOpenBrowserPacket, IMessage> {
|
||||
@Override
|
||||
public IMessage onMessage(MineTweakerOpenBrowserPacket message, MessageContext ctx) {
|
||||
if (Desktop.isDesktopSupported()) {
|
||||
if (Desktop.isDesktopSupported() && MineTweakerConfig.handleDesktopPackets) {
|
||||
Desktop desktop = Desktop.getDesktop();
|
||||
try {
|
||||
desktop.browse(new URI(message.getUrl()));
|
||||
} catch (IOException e) {
|
||||
} catch (URISyntaxException e) {
|
||||
}
|
||||
} else {
|
||||
System.out.println("Desktop not supported");
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -12,6 +12,7 @@ import minetweaker.api.data.IData;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.minecraft.MineTweakerMC;
|
||||
import minetweaker.api.player.IPlayer;
|
||||
import minetweaker.mc1710.MineTweakerConfig;
|
||||
import minetweaker.mc1710.MineTweakerMod;
|
||||
import minetweaker.mc1710.data.NBTConverter;
|
||||
import minetweaker.mc1710.network.MineTweakerCopyClipboardPacket;
|
||||
@@ -126,7 +127,7 @@ public class MCPlayer implements IPlayer {
|
||||
|
||||
@Override
|
||||
public void openBrowser(String url) {
|
||||
if (player instanceof EntityPlayerMP) {
|
||||
if (player instanceof EntityPlayerMP && MineTweakerConfig.handleDesktopPackets) {
|
||||
MineTweakerMod.NETWORK.sendTo(
|
||||
new MineTweakerOpenBrowserPacket(url),
|
||||
(EntityPlayerMP) player);
|
||||
@@ -135,7 +136,7 @@ public class MCPlayer implements IPlayer {
|
||||
|
||||
@Override
|
||||
public void copyToClipboard(String value) {
|
||||
if (player instanceof EntityPlayerMP) {
|
||||
if (player instanceof EntityPlayerMP && MineTweakerConfig.handleDesktopPackets) {
|
||||
MineTweakerMod.NETWORK.sendTo(
|
||||
new MineTweakerCopyClipboardPacket(value),
|
||||
(EntityPlayerMP) player);
|
||||
|
||||
+139
-29
@@ -48,12 +48,14 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
public static final List<ActionBaseAddRecipe> recipesToAdd = new ArrayList<>();
|
||||
public static final List<ActionBaseRemoveRecipes> recipesToRemove = new ArrayList<>();
|
||||
public static final ActionRemoveRecipesNoIngredients actionRemoveRecipesNoIngredients = new ActionRemoveRecipesNoIngredients();
|
||||
public static final List<IRecipe> recipesToUndo = new ArrayList<>();
|
||||
|
||||
public static List<IRecipe> recipes;
|
||||
public static final List<ICraftingRecipe> transformerRecipes = new ArrayList<>();
|
||||
|
||||
public MCRecipeManager() {
|
||||
MineTweakerImplementationAPI.onPostReload(new HandlePostReload());
|
||||
MineTweakerImplementationAPI.onPostReload(new HandleLateAdditionsAndRemovals());
|
||||
MineTweakerImplementationAPI.onRollbackEvent(new HandleLateAdditionsAndRemovals());
|
||||
}
|
||||
|
||||
public static boolean hasTransformerRecipes() {
|
||||
@@ -109,6 +111,11 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
return results;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int remove(IIngredient output) {
|
||||
return remove(output, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int remove(IIngredient output, @Optional boolean nbtMatch) {
|
||||
if(output == null) {
|
||||
@@ -119,11 +126,41 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addShaped(IItemStack output, IIngredient[][] ingredients, IRecipeFunction function) {
|
||||
recipesToAdd.add(new ActionAddShapedRecipe(output, ingredients, function, null, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addShaped(IItemStack output, IIngredient[][] ingredients, IRecipeAction action) {
|
||||
recipesToAdd.add(new ActionAddShapedRecipe(output, ingredients, null, action, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addShaped(IItemStack output, IIngredient[][] ingredients) {
|
||||
recipesToAdd.add(new ActionAddShapedRecipe(output, ingredients, null, null, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addShaped(IItemStack output, IIngredient[][] ingredients, IRecipeFunction function, IRecipeAction action) {
|
||||
recipesToAdd.add(new ActionAddShapedRecipe(output, ingredients, function, action, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addShapedMirrored(IItemStack output, IIngredient[][] ingredients, IRecipeFunction function) {
|
||||
recipesToAdd.add(new ActionAddShapedRecipe(output, ingredients, function, null, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addShapedMirrored(IItemStack output, IIngredient[][] ingredients) {
|
||||
recipesToAdd.add(new ActionAddShapedRecipe(output, ingredients, null, null, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addShapedMirrored(IItemStack output, IIngredient[][] ingredients, IRecipeAction action) {
|
||||
recipesToAdd.add(new ActionAddShapedRecipe(output, ingredients, null, action, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addShapedMirrored(IItemStack output, IIngredient[][] ingredients, IRecipeFunction function, IRecipeAction action) {
|
||||
recipesToAdd.add(new ActionAddShapedRecipe(output, ingredients, function, action, true));
|
||||
@@ -137,6 +174,21 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
recipesToAdd.add(new ActionAddShapelessRecipe(output, ingredients, function, action));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addShapeless(IItemStack output, IIngredient[] ingredients, IRecipeFunction function){
|
||||
addShapeless(output, ingredients, function, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addShapeless(IItemStack output, IIngredient[] ingredients, IRecipeAction action){
|
||||
addShapeless(output, ingredients, null, action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addShapeless(IItemStack output, IIngredient[] ingredients){
|
||||
addShapeless(output, ingredients, null, null);
|
||||
}
|
||||
|
||||
private boolean checkShapelessNulls(IItemStack output, IIngredient[] ingredients) {
|
||||
if(output != null && Arrays.stream(ingredients).allMatch(Objects::isNull)) {
|
||||
MineTweakerAPI.logError("Null not allowed in shapeless recipes! Recipe for: " + output + " not created!");
|
||||
@@ -155,6 +207,11 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int removeShaped(IIngredient output) {
|
||||
return removeShaped(output, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int removeShapeless(IIngredient output, IIngredient[] ingredients, boolean wildcard) {
|
||||
if(output == null) {
|
||||
@@ -165,6 +222,21 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int removeShapeless(IIngredient output, IIngredient[] ingredients) {
|
||||
return removeShapeless(output, ingredients, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int removeShapeless(IIngredient output, boolean wildcard) {
|
||||
return removeShapeless(output, null, wildcard);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int removeShapeless(IIngredient output) {
|
||||
return removeShapeless(output, null, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemStack craft(IItemStack[][] contents) {
|
||||
Container container = new ContainerVirtual();
|
||||
@@ -205,14 +277,19 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
public static class ActionRemoveRecipesNoIngredients extends ActionBaseRemoveRecipes implements IUndoableAction {
|
||||
// pair of output, nbtMatch
|
||||
private final List<Pair<IIngredient, Boolean>> outputs = new ArrayList<>();
|
||||
private final Set<IRecipe> toRemove = new HashSet<>();
|
||||
|
||||
public void addOutput(IIngredient output, @Optional boolean nbtMatch) {
|
||||
outputs.add(Pair.of(output, nbtMatch));
|
||||
}
|
||||
|
||||
public void clearOutputs() {
|
||||
outputs.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
Set<IRecipe> toRemove = new HashSet<>();
|
||||
toRemove.clear();
|
||||
|
||||
for (final IRecipe recipe : recipes) {
|
||||
final ItemStack recipeOutput = recipe.getRecipeOutput();
|
||||
@@ -228,12 +305,14 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return false;
|
||||
return !toRemove.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
|
||||
for(IRecipe recipe: toRemove) {
|
||||
recipesToAdd.add(new ActionBaseAddRecipe(recipe));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -243,7 +322,7 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return null;
|
||||
return "Trying to restore " + toRemove.size() + " recipes.";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -268,7 +347,8 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
final IIngredient output;
|
||||
final IIngredient[] ingredients;
|
||||
final boolean wildcard;
|
||||
|
||||
Set<IRecipe> toRemove = new HashSet<>();
|
||||
|
||||
public ActionRemoveShapelessRecipes(IIngredient output, IIngredient[] ingredients, boolean wildcard) {
|
||||
this.output = output;
|
||||
this.ingredients = ingredients;
|
||||
@@ -277,7 +357,7 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
Set<IRecipe> toRemove = new HashSet<>();
|
||||
toRemove.clear();
|
||||
|
||||
outer:
|
||||
for (IRecipe recipe : recipes) {
|
||||
@@ -342,12 +422,14 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return false;
|
||||
return !toRemove.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
|
||||
for(IRecipe recipe: toRemove) {
|
||||
recipesToAdd.add(new ActionBaseAddRecipe(recipe));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -361,7 +443,7 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return null;
|
||||
return "Trying to restore " + toRemove.size() + " shapeless recipes.";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -373,6 +455,8 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
public static class ActionRemoveShapedRecipes extends ActionBaseRemoveRecipes implements IUndoableAction {
|
||||
final IIngredient output;
|
||||
final IIngredient[][] ingredients;
|
||||
final Set<IRecipe> toRemove = new HashSet<>();
|
||||
|
||||
|
||||
|
||||
public ActionRemoveShapedRecipes(IIngredient output, IIngredient[][] ingredients) {
|
||||
@@ -384,6 +468,7 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
public void apply() {
|
||||
int ingredientsWidth = 0;
|
||||
int ingredientsHeight = 0;
|
||||
toRemove.clear();
|
||||
|
||||
if (ingredients != null) {
|
||||
ingredientsHeight = ingredients.length;
|
||||
@@ -393,8 +478,6 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
}
|
||||
}
|
||||
|
||||
final Set<IRecipe> toRemove = new HashSet<>();
|
||||
|
||||
outer:
|
||||
for (final IRecipe recipe : recipes) {
|
||||
final ItemStack output = recipe.getRecipeOutput();
|
||||
@@ -438,22 +521,28 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return false;
|
||||
return !toRemove.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
|
||||
for(IRecipe recipe: toRemove) {
|
||||
recipesToAdd.add(new ActionBaseAddRecipe(recipe));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return null;
|
||||
if(output != null) {
|
||||
return "Removing Shaped recipes for " + output.toString();
|
||||
} else {
|
||||
return "Trying to remove recipes for invalid output";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return null;
|
||||
return "Trying to restore " + toRemove.size() + " shaped recipes.";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -468,39 +557,49 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
|
||||
protected final IItemStack output;
|
||||
protected final boolean isShaped;
|
||||
protected final boolean isRestoring;
|
||||
|
||||
private ActionBaseAddRecipe(IRecipe iRecipe) {
|
||||
this.iRecipe = iRecipe;
|
||||
this.craftingRecipe = null;
|
||||
this.isRestoring = true;
|
||||
|
||||
this.isShaped = iRecipe instanceof ShapedRecipes;
|
||||
this.output = new MCItemStack(iRecipe.getRecipeOutput());
|
||||
}
|
||||
|
||||
private ActionBaseAddRecipe(ICraftingRecipe craftingRecipe, IItemStack output, boolean isShaped) {
|
||||
this.iRecipe = RecipeConverter.convert(craftingRecipe);
|
||||
this.craftingRecipe = craftingRecipe;
|
||||
this.isRestoring = false;
|
||||
|
||||
this.output = output;
|
||||
this.isShaped = isShaped;
|
||||
|
||||
// if(craftingRecipe.hasTransformers())
|
||||
// transformerRecipes.add(craftingRecipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
recipes.add(iRecipe);
|
||||
if (craftingRecipe.hasTransformers())
|
||||
if (craftingRecipe != null && craftingRecipe.hasTransformers())
|
||||
transformerRecipes.add(craftingRecipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return false;
|
||||
return iRecipe != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
|
||||
recipesToUndo.add(iRecipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
|
||||
if(output != null) {
|
||||
return "Adding " + (isShaped ? "shaped" : "shapeless") + " recipe for " + output.getDisplayName();
|
||||
return "" + (this.isRestoring ? "Restoring" : "Adding ") + (isShaped ? "shaped" : "shapeless") + " recipe for " + output.getDisplayName();
|
||||
} else {
|
||||
return "Trying to add " + (isShaped ? "shaped" : "shapeless") + "recipe without correct output";
|
||||
}
|
||||
@@ -508,7 +607,7 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return null;
|
||||
return "Undoing addition of " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -528,17 +627,28 @@ public final class MCRecipeManager implements IRecipeManager {
|
||||
super(new ShapelessRecipe(output, ingredients, function, action), output, false);
|
||||
}
|
||||
}
|
||||
|
||||
public static void applyAdditionsAndRemovals() {
|
||||
System.out.println("MineTweaker: Applying additions and removals");
|
||||
MineTweakerAPI.apply(MCRecipeManager.actionRemoveRecipesNoIngredients);
|
||||
if(recipesToUndo.size() > 0) {
|
||||
recipes.removeIf(recipesToUndo::contains);
|
||||
}
|
||||
MCRecipeManager.recipesToRemove.forEach(MineTweakerAPI::apply);
|
||||
MCRecipeManager.recipesToAdd.forEach(MineTweakerAPI::apply);
|
||||
|
||||
actionRemoveRecipesNoIngredients.clearOutputs();
|
||||
recipesToRemove.clear();;
|
||||
recipesToAdd.clear();
|
||||
recipesToUndo.clear();
|
||||
}
|
||||
|
||||
public static class HandlePostReload implements IEventHandler<MineTweakerImplementationAPI.ReloadEvent>
|
||||
public static class HandleLateAdditionsAndRemovals implements IEventHandler<MineTweakerImplementationAPI.ReloadEvent>
|
||||
{
|
||||
@Override
|
||||
public void handle(MineTweakerImplementationAPI.ReloadEvent event)
|
||||
{
|
||||
System.out.println("MineTweaker: Applying additions and removals");
|
||||
MineTweakerAPI.apply(MCRecipeManager.actionRemoveRecipesNoIngredients);
|
||||
MCRecipeManager.recipesToRemove.forEach(MineTweakerAPI::apply);
|
||||
MCRecipeManager.recipesToAdd.forEach(MineTweakerAPI::apply);
|
||||
|
||||
MCRecipeManager.applyAdditionsAndRemovals();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,28 +1,9 @@
|
||||
import minetweaker.tasks.RegisterZenClassesTask;
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
minecraft {
|
||||
version = forgeVersion1710
|
||||
@@ -39,8 +20,9 @@ dependencies {
|
||||
}
|
||||
|
||||
task makeRegistry(type: RegisterZenClassesTask) {
|
||||
inputDir = file('build/classes/main')
|
||||
outputDir = file('build/classes/main')
|
||||
dependsOn tasks.compileJava
|
||||
inputDir = file('build/classes/java/main')
|
||||
outputDir = file('build/classes/java/main')
|
||||
className = 'minetweaker.mods.ic2.ClassRegistry'
|
||||
}
|
||||
|
||||
|
||||
@@ -1,28 +1,9 @@
|
||||
import minetweaker.tasks.RegisterZenClassesTask;
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "https://files.minecraftforge.net/maven"
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
minecraft {
|
||||
version = forgeVersion1710
|
||||
@@ -40,8 +21,9 @@ dependencies {
|
||||
}
|
||||
|
||||
task makeRegistry(type: RegisterZenClassesTask) {
|
||||
inputDir = file('build/classes/main')
|
||||
outputDir = file('build/classes/main')
|
||||
dependsOn tasks.compileJava
|
||||
inputDir = file('build/classes/java/main')
|
||||
outputDir = file('build/classes/java/main')
|
||||
className = 'minetweaker.mods.nei.ClassRegistry'
|
||||
}
|
||||
|
||||
|
||||
+29
-9
@@ -1,16 +1,41 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
maven {
|
||||
name = "gt"
|
||||
url = "https://gregtech.overminddl1.com/"
|
||||
}
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
maven {
|
||||
name = "jitpack"
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath "com.github.GTNH2:ForgeGradle:FG_1.2-SNAPSHOT"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'base' // To add "clean" task to the root project.
|
||||
apply from: 'configuration.gradle'
|
||||
apply plugin: "maven"
|
||||
|
||||
|
||||
|
||||
subprojects {
|
||||
apply from: rootProject.file('common.gradle')
|
||||
apply plugin: 'eclipse'
|
||||
}
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven {
|
||||
/*maven {
|
||||
name "Tesla"
|
||||
url 'http://maven.epoxide.xyz'
|
||||
}
|
||||
@@ -21,7 +46,7 @@ repositories {
|
||||
maven {
|
||||
name 'JEI'
|
||||
url "http://dvs1.progwml6.com/files/maven"
|
||||
}
|
||||
} unused */
|
||||
}
|
||||
configurations {
|
||||
deployerJars
|
||||
@@ -30,11 +55,6 @@ dependencies {
|
||||
deployerJars 'org.apache.maven.wagon:wagon-ftp:2.2'
|
||||
}
|
||||
|
||||
|
||||
task wrapper(type: Wrapper, description: 'Creates and deploys the Gradle wrapper to the current directory.') {
|
||||
gradleVersion = '3.0'
|
||||
}
|
||||
|
||||
subprojects.each { subproject -> evaluationDependsOn( subproject.path ) }
|
||||
|
||||
task setupDecompWorkspaceAll(dependsOn: projects1710.collect { ':' + it + ":setupDecompWorkspace" }) {}
|
||||
|
||||
@@ -37,7 +37,15 @@ public class RegisterZenClassesTask extends DefaultTask {
|
||||
|
||||
@OutputDirectory
|
||||
public File outputDir = null;
|
||||
|
||||
|
||||
public void setInputDir(File inputDir) {
|
||||
this.inputDir = inputDir;
|
||||
}
|
||||
|
||||
public void setOutputDir(File inputDir) {
|
||||
this.outputDir = inputDir;
|
||||
}
|
||||
|
||||
@Input
|
||||
public String className;
|
||||
|
||||
|
||||
+15
-2
@@ -7,13 +7,26 @@ apply from: rootProject.file('configuration.gradle')
|
||||
// -- end of configurable properties
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name = "chickenbones"
|
||||
url = "http://chickenbones.net/maven/"
|
||||
}
|
||||
maven {
|
||||
name = "gt"
|
||||
url = "https://gregtech.overminddl1.com/"
|
||||
}
|
||||
maven {
|
||||
name = "jitpack"
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import javax.tools.ToolProvider
|
||||
// ### Global settings ###
|
||||
// #######################
|
||||
|
||||
ext.mineTweakerVersion = "3.2.1-GTNH"
|
||||
ext.mineTweakerVersion = "3.2.3-GTNH"
|
||||
if (System.getenv('BUILD_NUMBER') != null)
|
||||
project.mineTweakerVersion += "."+System.getenv('BUILD_NUMBER')
|
||||
else {
|
||||
|
||||
+3
-1
@@ -1,2 +1,4 @@
|
||||
org.gradle.daemon=false
|
||||
org.gradle.parallel=true
|
||||
org.gradle.configureondemand=true
|
||||
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError
|
||||
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError
|
||||
Vendored
BIN
Binary file not shown.
+1
-2
@@ -1,6 +1,5 @@
|
||||
#Wed Oct 16 21:11:58 CEST 2019
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
@@ -154,19 +154,11 @@ if $cygwin ; then
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
Vendored
+6
@@ -49,6 +49,7 @@ goto fail
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
@@ -59,6 +60,11 @@ set _SKIP=2
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
Reference in new issue
Block a user