mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-18 08:16:58 -04:00
Fix gradle file
This commit is contained in:
parent
33ef03ef71
commit
5a6e1ffcd9
@ -15,11 +15,6 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
plugins {
|
|
||||||
id "edu.sc.seis.macAppBundle" version "2.1.6"
|
|
||||||
//id "me.tatarka.retrolambda" version "3.5.0"
|
|
||||||
id 'edu.sc.seis.launch4j' version '2.3.0'
|
|
||||||
}
|
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
@ -31,6 +26,12 @@ buildscript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id "edu.sc.seis.macAppBundle" version "2.1.6"
|
||||||
|
//id "me.tatarka.retrolambda" version "3.5.0"
|
||||||
|
id 'edu.sc.seis.launch4j' version '2.3.0'
|
||||||
|
}
|
||||||
|
|
||||||
apply plugin: 'me.tatarka.retrolambda'
|
apply plugin: 'me.tatarka.retrolambda'
|
||||||
|
|
||||||
import java.util.jar.JarOutputStream
|
import java.util.jar.JarOutputStream
|
||||||
|
|||||||
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Hello Minecraft! Launcher.
|
||||||
|
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
|
*/
|
||||||
|
package org.jackhuang.hellominecraft.launcher.core.mod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author huang
|
||||||
|
*/
|
||||||
|
public interface ModAdviser {
|
||||||
|
|
||||||
|
ModSuggestion advise(String fileName, boolean isDirectory);
|
||||||
|
|
||||||
|
public static enum ModSuggestion {
|
||||||
|
SUGGESTED,
|
||||||
|
NORMAL,
|
||||||
|
HIDDEN
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -39,7 +39,6 @@ import org.jackhuang.hellominecraft.launcher.core.GameException;
|
|||||||
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftProvider;
|
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftProvider;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
|
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
||||||
import org.jackhuang.hellominecraft.util.func.BiFunction;
|
|
||||||
import org.jackhuang.hellominecraft.util.func.CallbackIO;
|
import org.jackhuang.hellominecraft.util.func.CallbackIO;
|
||||||
import org.jackhuang.hellominecraft.util.sys.CompressingUtils;
|
import org.jackhuang.hellominecraft.util.sys.CompressingUtils;
|
||||||
import org.jackhuang.hellominecraft.util.sys.FileUtils;
|
import org.jackhuang.hellominecraft.util.sys.FileUtils;
|
||||||
@ -208,31 +207,22 @@ public final class ModpackManager {
|
|||||||
public static final List<String> MODPACK_BLACK_LIST = Arrays.asList(new String[] { "usernamecache.json", "asm", "logs", "backups", "versions", "assets", "usercache.json", "libraries", "crash-reports", "launcher_profiles.json", "NVIDIA", "AMD", "TCNodeTracker", "screenshots", "natives", "native", "$native", "pack.json", "launcher.jar", "minetweaker.log", "launcher.pack.lzma", "hmclmc.log" });
|
public static final List<String> MODPACK_BLACK_LIST = Arrays.asList(new String[] { "usernamecache.json", "asm", "logs", "backups", "versions", "assets", "usercache.json", "libraries", "crash-reports", "launcher_profiles.json", "NVIDIA", "AMD", "TCNodeTracker", "screenshots", "natives", "native", "$native", "pack.json", "launcher.jar", "minetweaker.log", "launcher.pack.lzma", "hmclmc.log" });
|
||||||
public static final List<String> MODPACK_SUGGESTED_BLACK_LIST = Arrays.asList(new String[] { "fonts", "saves", "servers.dat", "options.txt", "optionsof.txt", "journeymap", "optionsshaders.txt", "mods/VoxelMods" });
|
public static final List<String> MODPACK_SUGGESTED_BLACK_LIST = Arrays.asList(new String[] { "fonts", "saves", "servers.dat", "options.txt", "optionsof.txt", "journeymap", "optionsshaders.txt", "mods/VoxelMods" });
|
||||||
|
|
||||||
/**
|
public static ModAdviser MODPACK_PREDICATE = (String fileName, boolean isDirectory) -> {
|
||||||
* < String, Boolean, Boolean >: Folder/File name, Is Directory,
|
if (match(MODPACK_BLACK_LIST, fileName, isDirectory))
|
||||||
* Return 0: non blocked, 1: non shown, 2: suggested, checked.
|
return ModAdviser.ModSuggestion.HIDDEN;
|
||||||
*/
|
if (match(MODPACK_SUGGESTED_BLACK_LIST, fileName, isDirectory))
|
||||||
public static final BiFunction<String, Boolean, Integer> MODPACK_PREDICATE = (String x, Boolean y) -> {
|
return ModAdviser.ModSuggestion.NORMAL;
|
||||||
if (ModpackManager.MODPACK_BLACK_LIST_PREDICATE.apply(x, y))
|
return ModAdviser.ModSuggestion.SUGGESTED;
|
||||||
return 1;
|
|
||||||
if (ModpackManager.MODPACK_SUGGESTED_BLACK_LIST_PREDICATE.apply(x, y))
|
|
||||||
return 2;
|
|
||||||
return 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public static final BiFunction<String, Boolean, Boolean> MODPACK_BLACK_LIST_PREDICATE = modpackPredicateMaker(MODPACK_BLACK_LIST);
|
private static boolean match(final List<String> l, String fileName, boolean isDirectory) {
|
||||||
public static final BiFunction<String, Boolean, Boolean> MODPACK_SUGGESTED_BLACK_LIST_PREDICATE = modpackPredicateMaker(MODPACK_SUGGESTED_BLACK_LIST);
|
|
||||||
|
|
||||||
private static BiFunction<String, Boolean, Boolean> modpackPredicateMaker(final List<String> l) {
|
|
||||||
return (String x, Boolean y) -> {
|
|
||||||
for (String s : l)
|
for (String s : l)
|
||||||
if (y) {
|
if (isDirectory) {
|
||||||
if (x.startsWith(s + "/"))
|
if (fileName.startsWith(s + "/"))
|
||||||
return true;
|
return true;
|
||||||
} else if (x.equals(s))
|
} else if (fileName.equals(s))
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -103,7 +103,6 @@ public final class Main implements Runnable {
|
|||||||
|
|
||||||
private static final Logger LOGGER = Logger.getLogger(Main.class.getName());
|
private static final Logger LOGGER = Logger.getLogger(Main.class.getName());
|
||||||
|
|
||||||
@SuppressWarnings({ "CallToPrintStackTrace", "UseSpecificCatch" })
|
|
||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
{
|
{
|
||||||
PluginManager.getPlugin(DefaultPlugin.class);
|
PluginManager.getPlugin(DefaultPlugin.class);
|
||||||
|
|||||||
@ -32,7 +32,6 @@ public class DraggableFrame extends JFrame
|
|||||||
private int dragGripX;
|
private int dragGripX;
|
||||||
private int dragGripY;
|
private int dragGripY;
|
||||||
|
|
||||||
@SuppressWarnings("LeakingThisInConstructor")
|
|
||||||
public DraggableFrame() {
|
public DraggableFrame() {
|
||||||
addMouseListener(this);
|
addMouseListener(this);
|
||||||
addMouseMotionListener(this);
|
addMouseMotionListener(this);
|
||||||
|
|||||||
@ -23,9 +23,9 @@ import java.util.HashSet;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.swing.tree.DefaultTreeModel;
|
import javax.swing.tree.DefaultTreeModel;
|
||||||
|
import org.jackhuang.hellominecraft.launcher.core.mod.ModAdviser;
|
||||||
import org.jackhuang.hellominecraft.util.C;
|
import org.jackhuang.hellominecraft.util.C;
|
||||||
import org.jackhuang.hellominecraft.util.Pair;
|
import org.jackhuang.hellominecraft.util.Pair;
|
||||||
import org.jackhuang.hellominecraft.util.func.BiFunction;
|
|
||||||
import org.jackhuang.hellominecraft.util.sys.FileUtils;
|
import org.jackhuang.hellominecraft.util.sys.FileUtils;
|
||||||
import org.jackhuang.hellominecraft.util.ui.checktree.CheckBoxTreeCellRenderer;
|
import org.jackhuang.hellominecraft.util.ui.checktree.CheckBoxTreeCellRenderer;
|
||||||
import org.jackhuang.hellominecraft.util.ui.checktree.CheckBoxTreeNode;
|
import org.jackhuang.hellominecraft.util.ui.checktree.CheckBoxTreeNode;
|
||||||
@ -40,7 +40,7 @@ public class ModpackFileSelectionPanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
private transient final WizardController controller;
|
private transient final WizardController controller;
|
||||||
private final Map wizardData;
|
private final Map wizardData;
|
||||||
private transient final BiFunction<String, Boolean, Integer> blackList;
|
private transient final ModAdviser blackList;
|
||||||
private final Set<String> bannedFiles = new HashSet<>();
|
private final Set<String> bannedFiles = new HashSet<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,7 +49,7 @@ public class ModpackFileSelectionPanel extends javax.swing.JPanel {
|
|||||||
* @param blackList Return 0: non blocked, 1: non shown, 2: suggested,
|
* @param blackList Return 0: non blocked, 1: non shown, 2: suggested,
|
||||||
* checked
|
* checked
|
||||||
*/
|
*/
|
||||||
public ModpackFileSelectionPanel(WizardController controller, Map wizardData, File gameDir, BiFunction<String, Boolean, Integer> blackList) {
|
public ModpackFileSelectionPanel(WizardController controller, Map wizardData, File gameDir, ModAdviser blackList) {
|
||||||
initComponents();
|
initComponents();
|
||||||
|
|
||||||
this.controller = controller;
|
this.controller = controller;
|
||||||
@ -83,12 +83,12 @@ public class ModpackFileSelectionPanel extends javax.swing.JPanel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
CheckBoxTreeNode create(File file, String basePath) {
|
CheckBoxTreeNode create(File file, String basePath) {
|
||||||
int state = 0;
|
ModAdviser.ModSuggestion state = ModAdviser.ModSuggestion.NORMAL;
|
||||||
if (basePath.length() > "minecraft/".length())
|
if (basePath.length() > "minecraft/".length())
|
||||||
if ((state = blackList.apply(basePath.substring("minecraft/".length()) + (file.isDirectory() ? "/" : ""), file.isDirectory())) == 1)
|
if ((state = blackList.advise(basePath.substring("minecraft/".length()) + (file.isDirectory() ? "/" : ""), file.isDirectory())) == ModAdviser.ModSuggestion.HIDDEN)
|
||||||
return null;
|
return null;
|
||||||
CheckBoxTreeNode node = new CheckBoxTreeNode(TRANSLATION.containsKey(basePath) ? new Pair<>(FileUtils.getName(basePath), TRANSLATION.get(basePath)) : FileUtils.getName(basePath));
|
CheckBoxTreeNode node = new CheckBoxTreeNode(TRANSLATION.containsKey(basePath) ? new Pair<>(FileUtils.getName(basePath), TRANSLATION.get(basePath)) : FileUtils.getName(basePath));
|
||||||
if (state == 2)
|
if (state == ModAdviser.ModSuggestion.SUGGESTED)
|
||||||
node.setSelected(true);
|
node.setSelected(true);
|
||||||
|
|
||||||
if (file.isDirectory()) {
|
if (file.isDirectory()) {
|
||||||
|
|||||||
@ -3528,7 +3528,6 @@ public final class MainWindow extends javax.swing.JFrame
|
|||||||
Server.getInstance().sendCommand("save-all");
|
Server.getInstance().sendCommand("save-all");
|
||||||
}//GEN-LAST:event_btnSaveActionPerformed
|
}//GEN-LAST:event_btnSaveActionPerformed
|
||||||
|
|
||||||
@SuppressWarnings("UseOfObsoleteCollectionType")
|
|
||||||
private void btnSaveExtModActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveExtModActionPerformed
|
private void btnSaveExtModActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveExtModActionPerformed
|
||||||
ArrayList<String> arrayList = new ArrayList<>();
|
ArrayList<String> arrayList = new ArrayList<>();
|
||||||
Vector strings = ((DefaultTableModel) lstExternalMods.getModel()).getDataVector();
|
Vector strings = ((DefaultTableModel) lstExternalMods.getModel()).getDataVector();
|
||||||
@ -3541,7 +3540,6 @@ public final class MainWindow extends javax.swing.JFrame
|
|||||||
SettingsManager.save();
|
SettingsManager.save();
|
||||||
}//GEN-LAST:event_btnSaveExtModActionPerformed
|
}//GEN-LAST:event_btnSaveExtModActionPerformed
|
||||||
|
|
||||||
@SuppressWarnings("UseOfObsoleteCollectionType")
|
|
||||||
private void btnSavePluginsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSavePluginsActionPerformed
|
private void btnSavePluginsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSavePluginsActionPerformed
|
||||||
ArrayList<String> arrayList = new ArrayList<>();
|
ArrayList<String> arrayList = new ArrayList<>();
|
||||||
Vector strings = ((DefaultTableModel) lstCoreMods.getModel()).getDataVector();
|
Vector strings = ((DefaultTableModel) lstCoreMods.getModel()).getDataVector();
|
||||||
|
|||||||
@ -20,7 +20,6 @@ package org.jackhuang.hellominecraft.util.sys;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import org.jackhuang.hellominecraft.util.CollectionUtils;
|
import org.jackhuang.hellominecraft.util.CollectionUtils;
|
||||||
import org.jackhuang.hellominecraft.api.EventHandler;
|
|
||||||
import org.jackhuang.hellominecraft.api.HMCAPI;
|
import org.jackhuang.hellominecraft.api.HMCAPI;
|
||||||
import org.jackhuang.hellominecraft.api.event.process.JVMLaunchFailedEvent;
|
import org.jackhuang.hellominecraft.api.event.process.JVMLaunchFailedEvent;
|
||||||
import org.jackhuang.hellominecraft.api.event.process.JavaProcessExitedAbnormallyEvent;
|
import org.jackhuang.hellominecraft.api.event.process.JavaProcessExitedAbnormallyEvent;
|
||||||
@ -57,7 +56,6 @@ public class JavaProcessMonitor {
|
|||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void start() {
|
public void start() {
|
||||||
HMCAPI.EVENT_BUS.fireChannel(new JavaProcessStartingEvent(this, p));
|
HMCAPI.EVENT_BUS.fireChannel(new JavaProcessStartingEvent(this, p));
|
||||||
ProcessThread a = new ProcessThread(p);
|
ProcessThread a = new ProcessThread(p);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user