stuff
This commit is contained in:
parent
ce0c54cabb
commit
e19b260b8c
|
@ -1,4 +1,4 @@
|
||||||
@echo off
|
@echo off
|
||||||
title MakeOfflineDownload
|
title MakeOfflineDownload
|
||||||
java -cp "resources/MakeOfflineDownload.jar;resources/CompileEPK.jar" net.lax1dude.eaglercraft.v1_8.buildtools.workspace.MakeOfflineDownload "javascript/OfflineDownloadTemplate.txt" "javascript/classes.js" "javascript/assets.epk" "javascript/EaglercraftL_1.9_Offline_en_US.html" "javascript/EaglercraftX_1.8_Offline_International.html" "javascript/lang"
|
java -cp "resources/MakeOfflineDownload.jar;resources/CompileEPK.jar" net.lax1dude.eaglercraft.v1_8.buildtools.workspace.MakeOfflineDownload "javascript/OfflineDownloadTemplate.txt" "javascript/classes.js" "javascript/assets.epk" "javascript/EaglercraftL_1.9_Offline_en_US.html" "javascript/EaglercraftL_1.9_Offline_International.html" "javascript/lang"
|
||||||
pause
|
pause
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -74,6 +74,10 @@ public class PlatformApplication {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setLocalStorage(String name, byte[] data) {
|
public static void setLocalStorage(String name, byte[] data) {
|
||||||
|
setLocalStorage(name, data, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setLocalStorage(String name, byte[] data, boolean hooks) {
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
(new File("_eagstorage." + name + ".dat")).delete();
|
(new File("_eagstorage." + name + ".dat")).delete();
|
||||||
} else {
|
} else {
|
||||||
|
@ -86,6 +90,10 @@ public class PlatformApplication {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] getLocalStorage(String data) {
|
public static byte[] getLocalStorage(String data) {
|
||||||
|
return getLocalStorage(data, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static byte[] getLocalStorage(String data, boolean hooks) {
|
||||||
File f = new File("_eagstorage." + data + ".dat");
|
File f = new File("_eagstorage." + data + ".dat");
|
||||||
if (!f.isFile()) {
|
if (!f.isFile()) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -238,6 +238,10 @@ public class PlatformInput {
|
||||||
glfwSwapBuffers(win);
|
glfwSwapBuffers(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isVSyncSupported() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean wasResized() {
|
public static boolean wasResized() {
|
||||||
boolean b = windowResized;
|
boolean b = windowResized;
|
||||||
windowResized = false;
|
windowResized = false;
|
||||||
|
|
|
@ -8,19 +8,27 @@ import org.json.JSONObject;
|
||||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
|
||||||
import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion;
|
import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion;
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapter;
|
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapter;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapterHooks;
|
||||||
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayEntry;
|
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayEntry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
* Copyright (c) 2022 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -31,6 +39,8 @@ public class DesktopClientConfigAdapter implements IClientConfigAdapter {
|
||||||
|
|
||||||
public final List<DefaultServer> defaultServers = new ArrayList();
|
public final List<DefaultServer> defaultServers = new ArrayList();
|
||||||
|
|
||||||
|
private final DesktopClientConfigAdapterHooks hooks = new DesktopClientConfigAdapterHooks();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDefaultLocale() {
|
public String getDefaultLocale() {
|
||||||
return "en_US";
|
return "en_US";
|
||||||
|
@ -128,4 +138,33 @@ public class DesktopClientConfigAdapter implements IClientConfigAdapter {
|
||||||
public boolean isAllowVoiceClient() {
|
public boolean isAllowVoiceClient() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAllowFNAWSkins() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLocalStorageNamespace() {
|
||||||
|
return EaglercraftVersion.localStorageNamespace;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IClientConfigAdapterHooks getHooks() {
|
||||||
|
return hooks;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class DesktopClientConfigAdapterHooks implements IClientConfigAdapterHooks {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void callLocalStorageSavedHook(String key, String base64) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String callLocalStorageLoadHook(String key) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,10 +21,6 @@ public class Config {
|
||||||
return Minecraft.getMinecraft().gameSettings.disableAlpha && !Minecraft.getMinecraft().gameSettings.shaders;
|
return Minecraft.getMinecraft().gameSettings.disableAlpha && !Minecraft.getMinecraft().gameSettings.shaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean skipRenderUpdate() {
|
|
||||||
return Minecraft.getMinecraft().gameSettings.skipHandRender && !Minecraft.getMinecraft().gameSettings.shaders;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean audioEnabled() {
|
public static boolean audioEnabled() {
|
||||||
return Minecraft.getMinecraft().gameSettings.enableSound;
|
return Minecraft.getMinecraft().gameSettings.enableSound;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,10 @@ public class Display {
|
||||||
PlatformInput.setVSync(enable);
|
PlatformInput.setVSync(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isVSyncSupported() {
|
||||||
|
return PlatformInput.isVSyncSupported();
|
||||||
|
}
|
||||||
|
|
||||||
public static void update() {
|
public static void update() {
|
||||||
PlatformInput.update();
|
PlatformInput.update();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,8 @@ public class EaglercraftVersion {
|
||||||
/// Customize these to fit your fork:
|
/// Customize these to fit your fork:
|
||||||
|
|
||||||
public static final String projectForkName = "Eaglercraft Lambda";
|
public static final String projectForkName = "Eaglercraft Lambda";
|
||||||
public static final String projectForkVersion = "0.3.1";
|
public static final String projectForkVersion = "0.3.5";
|
||||||
public static final String projectForkVendor = "hoosiertransfer";
|
public static final String projectForkVendor = "HoosierTransfer";
|
||||||
|
|
||||||
public static final String projectForkURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8";
|
public static final String projectForkURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8";
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@ public class EaglercraftVersion {
|
||||||
|
|
||||||
public static final String projectOriginName = "EaglercraftX";
|
public static final String projectOriginName = "EaglercraftX";
|
||||||
public static final String projectOriginAuthor = "lax1dude";
|
public static final String projectOriginAuthor = "lax1dude";
|
||||||
public static final String projectOriginRevision = "1.9";
|
public static final String projectOriginRevision = "1.9.4";
|
||||||
public static final String projectOriginVersion = "u29";
|
public static final String projectOriginVersion = "u30";
|
||||||
|
|
||||||
public static final String projectOriginURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; // rest in peace
|
public static final String projectOriginURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; // rest in peace
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ public class EaglercraftVersion {
|
||||||
public static final boolean enableUpdateService = false;
|
public static final boolean enableUpdateService = false;
|
||||||
|
|
||||||
public static final String updateBundlePackageName = "net.lax1dude.eaglercraft.v1_8.client";
|
public static final String updateBundlePackageName = "net.lax1dude.eaglercraft.v1_8.client";
|
||||||
public static final int updateBundlePackageVersionInt = 29;
|
public static final int updateBundlePackageVersionInt = 30;
|
||||||
|
|
||||||
public static final String updateLatestLocalStorageKey = "latestUpdate_" + updateBundlePackageName;
|
public static final String updateLatestLocalStorageKey = "latestUpdate_" + updateBundlePackageName;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ public class EaglercraftVersion {
|
||||||
|
|
||||||
// Miscellaneous variables:
|
// Miscellaneous variables:
|
||||||
|
|
||||||
public static final String mainMenuStringA = "Minecraft 1.8.8";
|
public static final String mainMenuStringA = "Minecraft 1.9.4";
|
||||||
public static final String mainMenuStringB = projectOriginName + " " +
|
public static final String mainMenuStringB = projectOriginName + " " +
|
||||||
projectOriginRevision + "-" + projectOriginVersion + " ultimate";
|
projectOriginRevision + "-" + projectOriginVersion + " ultimate";
|
||||||
public static final String mainMenuStringC = "";
|
public static final String mainMenuStringC = "";
|
||||||
|
@ -56,4 +56,6 @@ public class EaglercraftVersion {
|
||||||
|
|
||||||
public static final boolean forceDemoMode = false;
|
public static final boolean forceDemoMode = false;
|
||||||
|
|
||||||
|
public static final String localStorageNamespace = "_eaglercraftX";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,14 +8,21 @@ import org.json.JSONObject;
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -69,4 +76,10 @@ public interface IClientConfigAdapter {
|
||||||
boolean isEnableSignatureBadge();
|
boolean isEnableSignatureBadge();
|
||||||
|
|
||||||
boolean isAllowVoiceClient();
|
boolean isAllowVoiceClient();
|
||||||
|
|
||||||
|
boolean isAllowFNAWSkins();
|
||||||
|
|
||||||
|
String getLocalStorageNamespace();
|
||||||
|
|
||||||
|
IClientConfigAdapterHooks getHooks();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,30 +1,31 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8.internal.teavm.opts;
|
package net.lax1dude.eaglercraft.v1_8.internal;
|
||||||
|
|
||||||
import org.teavm.jso.JSIndexer;
|
|
||||||
import org.teavm.jso.JSObject;
|
|
||||||
import org.teavm.jso.JSProperty;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface JSEaglercraftXOptsRelaysArray extends JSObject {
|
public interface IClientConfigAdapterHooks {
|
||||||
|
|
||||||
@JSIndexer
|
void callLocalStorageSavedHook(String key, String base64);
|
||||||
JSEaglercraftXOptsRelay get(int idx);
|
|
||||||
|
|
||||||
@JSProperty
|
String callLocalStorageLoadHook(String key);
|
||||||
int getLength();
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -13,6 +13,29 @@ import net.minecraft.client.resources.IResourceManager;
|
||||||
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2023 lax1dude. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED.
|
||||||
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
* DIRECT,
|
||||||
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
public class BlockVertexIDs implements IResourceManagerReloadListener {
|
public class BlockVertexIDs implements IResourceManagerReloadListener {
|
||||||
|
|
||||||
private static final Logger logger = LogManager.getLogger("BlockVertexIDsCSV");
|
private static final Logger logger = LogManager.getLogger("BlockVertexIDsCSV");
|
||||||
|
|
|
@ -72,7 +72,8 @@ public class EaglerSkinTexture implements ITextureObject {
|
||||||
}
|
}
|
||||||
System.arraycopy(pixels, 0, this.pixels, 0, pixels.length);
|
System.arraycopy(pixels, 0, this.pixels, 0, pixels.length);
|
||||||
if (textureId != -1) {
|
if (textureId != -1) {
|
||||||
TextureUtil.uploadTextureImageAllocate(textureId, new ImageData(width, height, pixels, true), false, false);
|
TextureUtil.uploadTextureImageSub(textureId, new ImageData(width, height, pixels, true), 0, 0, false,
|
||||||
|
false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,7 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 lax1dude, hoosiertransfer, ayunami2000. All Rights
|
* Copyright (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
* Reserved.
|
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
* AND
|
* AND
|
||||||
|
@ -83,14 +82,20 @@ public class GuiScreenEditProfile extends GuiScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateOptions() {
|
private void updateOptions() {
|
||||||
|
DefaultSkins[] arr = DefaultSkins.defaultSkinsMap;
|
||||||
|
if (!EagRuntime.getConfiguration().isAllowFNAWSkins()) {
|
||||||
|
DefaultSkins[] arrNoFNAW = new DefaultSkins[arr.length - 5];
|
||||||
|
System.arraycopy(arr, 0, arrNoFNAW, 0, arrNoFNAW.length);
|
||||||
|
arr = arrNoFNAW;
|
||||||
|
}
|
||||||
int numCustom = EaglerProfile.customSkins.size();
|
int numCustom = EaglerProfile.customSkins.size();
|
||||||
String[] n = new String[numCustom + DefaultSkins.defaultSkinsMap.length];
|
String[] n = new String[numCustom + arr.length];
|
||||||
for (int i = 0; i < numCustom; ++i) {
|
for (int i = 0; i < numCustom; ++i) {
|
||||||
n[i] = EaglerProfile.customSkins.get(i).name;
|
n[i] = EaglerProfile.customSkins.get(i).name;
|
||||||
}
|
}
|
||||||
int numDefault = DefaultSkins.defaultSkinsMap.length;
|
int numDefault = arr.length;
|
||||||
for (int j = 0; j < numDefault; ++j) {
|
for (int j = 0; j < numDefault; ++j) {
|
||||||
n[numCustom + j] = DefaultSkins.defaultSkinsMap[j].name;
|
n[numCustom + j] = arr[j].name;
|
||||||
}
|
}
|
||||||
dropDownOptions = n;
|
dropDownOptions = n;
|
||||||
}
|
}
|
||||||
|
@ -116,6 +121,10 @@ public class GuiScreenEditProfile extends GuiScreen {
|
||||||
GlStateManager.translate(skinX + 2, skinY - 9, 0.0f);
|
GlStateManager.translate(skinX + 2, skinY - 9, 0.0f);
|
||||||
GlStateManager.scale(0.75f, 0.75f, 0.75f);
|
GlStateManager.scale(0.75f, 0.75f, 0.75f);
|
||||||
|
|
||||||
|
if (selectedSlot > dropDownOptions.length - 1) {
|
||||||
|
selectedSlot = 0;
|
||||||
|
}
|
||||||
|
|
||||||
int numberOfCustomSkins = EaglerProfile.customSkins.size();
|
int numberOfCustomSkins = EaglerProfile.customSkins.size();
|
||||||
int skid = selectedSlot - numberOfCustomSkins;
|
int skid = selectedSlot - numberOfCustomSkins;
|
||||||
SkinModel selectedSkinModel = skid < 0 ? EaglerProfile.customSkins.get(selectedSlot).model
|
SkinModel selectedSkinModel = skid < 0 ? EaglerProfile.customSkins.get(selectedSlot).model
|
||||||
|
|
|
@ -12,14 +12,21 @@ import net.minecraft.client.resources.I18n;
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -34,8 +41,10 @@ public class GuiScreenImportExportProfile extends GuiScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initGui() {
|
public void initGui() {
|
||||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 40, I18n.format("settingsBackup.importExport.import")));
|
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 40,
|
||||||
this.buttonList.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 65, I18n.format("settingsBackup.importExport.export")));
|
I18n.format("settingsBackup.importExport.import")));
|
||||||
|
this.buttonList.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 65,
|
||||||
|
I18n.format("settingsBackup.importExport.export")));
|
||||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 130, I18n.format("gui.cancel")));
|
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 130, I18n.format("gui.cancel")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,13 +65,18 @@ public class GuiScreenImportExportProfile extends GuiScreen {
|
||||||
FileChooserResult result = EagRuntime.getFileChooserResult();
|
FileChooserResult result = EagRuntime.getFileChooserResult();
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
mc.loadingScreen.eaglerShow(I18n.format("settingsBackup.importing.1"), "settingsBackup.importing.2");
|
mc.loadingScreen.eaglerShow(I18n.format("settingsBackup.importing.1"), "settingsBackup.importing.2");
|
||||||
try {
|
|
||||||
ProfileImporter importer = new ProfileImporter(result.fileData);
|
ProfileImporter importer = new ProfileImporter(result.fileData);
|
||||||
|
try {
|
||||||
importer.readHeader();
|
importer.readHeader();
|
||||||
mc.displayGuiScreen(new GuiScreenImportProfile(importer, back));
|
mc.displayGuiScreen(new GuiScreenImportProfile(importer, back));
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
try {
|
||||||
|
importer.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
}
|
||||||
EagRuntime.debugPrintStackTrace(ex);
|
EagRuntime.debugPrintStackTrace(ex);
|
||||||
mc.displayGuiScreen(new GuiScreenGenericErrorMessage("settingsBackup.importing.failed.1", "settingsBackup.importing.failed.2", back));
|
mc.displayGuiScreen(new GuiScreenGenericErrorMessage("settingsBackup.importing.failed.1",
|
||||||
|
"settingsBackup.importing.failed.2", back));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,7 +85,8 @@ public class GuiScreenImportExportProfile extends GuiScreen {
|
||||||
public void drawScreen(int par1, int par2, float par3) {
|
public void drawScreen(int par1, int par2, float par3) {
|
||||||
this.drawDefaultBackground();
|
this.drawDefaultBackground();
|
||||||
|
|
||||||
this.drawCenteredString(this.fontRendererObj, I18n.format("settingsBackup.importExport.title"), this.width / 2, this.height / 4, 16777215);
|
this.drawCenteredString(this.fontRendererObj, I18n.format("settingsBackup.importExport.title"), this.width / 2,
|
||||||
|
this.height / 4, 16777215);
|
||||||
|
|
||||||
super.drawScreen(par1, par2, par3);
|
super.drawScreen(par1, par2, par3);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,14 +14,21 @@ import net.minecraft.client.resources.I18n;
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -50,29 +57,49 @@ public class GuiScreenImportProfile extends GuiScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initGui() {
|
public void initGui() {
|
||||||
this.buttonList.add(importProfile = new GuiButton(2, this.width / 2 - 100, this.height / 4, I18n.format("settingsBackup.import.option.profile") + " " + I18n.format(doImportProfile ? "gui.yes" : "gui.no")));
|
this.buttonList.add(importProfile = new GuiButton(2, this.width / 2 - 100, this.height / 4,
|
||||||
|
I18n.format("settingsBackup.import.option.profile") + " "
|
||||||
|
+ I18n.format(doImportProfile ? "gui.yes" : "gui.no")));
|
||||||
importProfile.enabled = importer.hasProfile();
|
importProfile.enabled = importer.hasProfile();
|
||||||
this.buttonList.add(importSettings = new GuiButton(3, this.width / 2 - 100, this.height / 4 + 25, I18n.format("settingsBackup.import.option.settings") + " " + I18n.format(doImportSettings ? "gui.yes" : "gui.no")));
|
this.buttonList.add(importSettings = new GuiButton(3, this.width / 2 - 100, this.height / 4 + 25,
|
||||||
|
I18n.format("settingsBackup.import.option.settings") + " "
|
||||||
|
+ I18n.format(doImportSettings ? "gui.yes" : "gui.no")));
|
||||||
importSettings.enabled = importer.hasProfile();
|
importSettings.enabled = importer.hasProfile();
|
||||||
this.buttonList.add(importServers = new GuiButton(4, this.width / 2 - 100, this.height / 4 + 50, I18n.format("settingsBackup.import.option.servers") + " " + I18n.format(doImportServers ? "gui.yes" : "gui.no")));
|
this.buttonList.add(importServers = new GuiButton(4, this.width / 2 - 100, this.height / 4 + 50,
|
||||||
|
I18n.format("settingsBackup.import.option.servers") + " "
|
||||||
|
+ I18n.format(doImportServers ? "gui.yes" : "gui.no")));
|
||||||
importServers.enabled = importer.hasServers();
|
importServers.enabled = importer.hasServers();
|
||||||
this.buttonList.add(importResourcePacks = new GuiButton(5, this.width / 2 - 100, this.height / 4 + 75, I18n.format("settingsBackup.import.option.resourcePacks") + " " + I18n.format(doImportResourcePacks ? "gui.yes" : "gui.no")));
|
this.buttonList.add(importResourcePacks = new GuiButton(5, this.width / 2 - 100, this.height / 4 + 75,
|
||||||
|
I18n.format("settingsBackup.import.option.resourcePacks") + " "
|
||||||
|
+ I18n.format(doImportResourcePacks ? "gui.yes" : "gui.no")));
|
||||||
importResourcePacks.enabled = importer.hasResourcePacks() && EaglerFolderResourcePack.isSupported();
|
importResourcePacks.enabled = importer.hasResourcePacks() && EaglerFolderResourcePack.isSupported();
|
||||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 115, I18n.format("settingsBackup.import.option.import")));
|
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 115,
|
||||||
|
I18n.format("settingsBackup.import.option.import")));
|
||||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 140, I18n.format("gui.cancel")));
|
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 140, I18n.format("gui.cancel")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onGuiClosed() {
|
||||||
|
try {
|
||||||
|
importer.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||||
if (par1GuiButton.id == 0) {
|
if (par1GuiButton.id == 0) {
|
||||||
if (!doImportProfile && !doImportSettings && !doImportServers && !doImportResourcePacks) {
|
if (!doImportProfile && !doImportSettings && !doImportServers && !doImportResourcePacks) {
|
||||||
mc.displayGuiScreen(back);
|
mc.displayGuiScreen(back);
|
||||||
} else {
|
} else {
|
||||||
mc.loadingScreen.eaglerShow(I18n.format("settingsBackup.importing.1"), I18n.format("settingsBackup.importing.2"));
|
mc.loadingScreen.eaglerShow(I18n.format("settingsBackup.importing.1"),
|
||||||
|
I18n.format("settingsBackup.importing.2"));
|
||||||
try {
|
try {
|
||||||
List<String> list1 = new ArrayList(mc.gameSettings.resourcePacks);
|
List<String> list1 = new ArrayList(mc.gameSettings.resourcePacks);
|
||||||
List<String> list2 = new ArrayList(mc.gameSettings.field_183018_l);
|
List<String> list2 = new ArrayList(mc.gameSettings.field_183018_l);
|
||||||
importer.importProfileAndSettings(doImportProfile, doImportSettings, doImportServers, doImportResourcePacks);
|
importer.importProfileAndSettings(doImportProfile, doImportSettings, doImportServers,
|
||||||
boolean resourcePacksChanged = !mc.gameSettings.resourcePacks.equals(list1) || !mc.gameSettings.field_183018_l.equals(list2);
|
doImportResourcePacks);
|
||||||
|
boolean resourcePacksChanged = !mc.gameSettings.resourcePacks.equals(list1)
|
||||||
|
|| !mc.gameSettings.field_183018_l.equals(list2);
|
||||||
if (resourcePacksChanged || (doImportResourcePacks && (list1.size() > 0 || list2.size() > 0))) {
|
if (resourcePacksChanged || (doImportResourcePacks && (list1.size() > 0 || list2.size() > 0))) {
|
||||||
mc.loadingScreen.eaglerShow(I18n.format("resourcePack.load.refreshing"),
|
mc.loadingScreen.eaglerShow(I18n.format("resourcePack.load.refreshing"),
|
||||||
I18n.format("resourcePack.load.pleaseWait"));
|
I18n.format("resourcePack.load.pleaseWait"));
|
||||||
|
@ -82,29 +109,35 @@ public class GuiScreenImportProfile extends GuiScreen {
|
||||||
mc.displayGuiScreen(back);
|
mc.displayGuiScreen(back);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
EagRuntime.debugPrintStackTrace(e);
|
EagRuntime.debugPrintStackTrace(e);
|
||||||
mc.displayGuiScreen(new GuiScreenGenericErrorMessage("settingsBackup.importing.failed.1", "settingsBackup.importing.failed.2", back));
|
mc.displayGuiScreen(new GuiScreenGenericErrorMessage("settingsBackup.importing.failed.1",
|
||||||
|
"settingsBackup.importing.failed.2", back));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (par1GuiButton.id == 1) {
|
} else if (par1GuiButton.id == 1) {
|
||||||
mc.displayGuiScreen(back);
|
mc.displayGuiScreen(back);
|
||||||
} else if (par1GuiButton.id == 2) {
|
} else if (par1GuiButton.id == 2) {
|
||||||
doImportProfile = !doImportProfile;
|
doImportProfile = !doImportProfile;
|
||||||
importProfile.displayString = I18n.format("settingsBackup.import.option.profile") + " " + I18n.format(doImportProfile ? "gui.yes" : "gui.no");
|
importProfile.displayString = I18n.format("settingsBackup.import.option.profile") + " "
|
||||||
|
+ I18n.format(doImportProfile ? "gui.yes" : "gui.no");
|
||||||
} else if (par1GuiButton.id == 3) {
|
} else if (par1GuiButton.id == 3) {
|
||||||
doImportSettings = !doImportSettings;
|
doImportSettings = !doImportSettings;
|
||||||
importSettings.displayString = I18n.format("settingsBackup.import.option.settings") + " " + I18n.format(doImportSettings ? "gui.yes" : "gui.no");
|
importSettings.displayString = I18n.format("settingsBackup.import.option.settings") + " "
|
||||||
|
+ I18n.format(doImportSettings ? "gui.yes" : "gui.no");
|
||||||
} else if (par1GuiButton.id == 4) {
|
} else if (par1GuiButton.id == 4) {
|
||||||
doImportServers = !doImportServers;
|
doImportServers = !doImportServers;
|
||||||
importServers.displayString = I18n.format("settingsBackup.import.option.servers") + " " + I18n.format(doImportServers ? "gui.yes" : "gui.no");
|
importServers.displayString = I18n.format("settingsBackup.import.option.servers") + " "
|
||||||
|
+ I18n.format(doImportServers ? "gui.yes" : "gui.no");
|
||||||
} else if (par1GuiButton.id == 5) {
|
} else if (par1GuiButton.id == 5) {
|
||||||
doImportResourcePacks = !doImportResourcePacks;
|
doImportResourcePacks = !doImportResourcePacks;
|
||||||
importResourcePacks.displayString = I18n.format("settingsBackup.import.option.resourcePacks") + " " + I18n.format(doImportResourcePacks ? "gui.yes" : "gui.no");
|
importResourcePacks.displayString = I18n.format("settingsBackup.import.option.resourcePacks") + " "
|
||||||
|
+ I18n.format(doImportResourcePacks ? "gui.yes" : "gui.no");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawScreen(int par1, int par2, float par3) {
|
public void drawScreen(int par1, int par2, float par3) {
|
||||||
this.drawDefaultBackground();
|
this.drawDefaultBackground();
|
||||||
this.drawCenteredString(this.fontRendererObj, I18n.format("settingsBackup.import.title"), this.width / 2, this.height / 4 - 25, 16777215);
|
this.drawCenteredString(this.fontRendererObj, I18n.format("settingsBackup.import.title"), this.width / 2,
|
||||||
|
this.height / 4 - 25, 16777215);
|
||||||
super.drawScreen(par1, par2, par3);
|
super.drawScreen(par1, par2, par3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,14 +26,21 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.export.EPKCompiler.*;
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -46,8 +53,10 @@ public class ProfileExporter {
|
||||||
boolean doExportServers, boolean doExportResourcePacks) throws IOException {
|
boolean doExportServers, boolean doExportResourcePacks) throws IOException {
|
||||||
doExportResourcePacks &= EaglerFolderResourcePack.isSupported();
|
doExportResourcePacks &= EaglerFolderResourcePack.isSupported();
|
||||||
EaglerOutputStream osb = new EaglerOutputStream();
|
EaglerOutputStream osb = new EaglerOutputStream();
|
||||||
osb.write(new byte[]{(byte)69,(byte)65,(byte)71,(byte)80,(byte)75,(byte)71,(byte)36,(byte)36}); // EAGPKG$$
|
osb.write(
|
||||||
osb.write(new byte[]{(byte)6,(byte)118,(byte)101,(byte)114,(byte)50,(byte)46,(byte)48}); // 6 + ver2.0
|
new byte[] { (byte) 69, (byte) 65, (byte) 71, (byte) 80, (byte) 75, (byte) 71, (byte) 36, (byte) 36 }); // EAGPKG$$
|
||||||
|
osb.write(new byte[] { (byte) 6, (byte) 118, (byte) 101, (byte) 114, (byte) 50, (byte) 46, (byte) 48 }); // 6 +
|
||||||
|
// ver2.0
|
||||||
Date d = new Date();
|
Date d = new Date();
|
||||||
|
|
||||||
byte[] filename = "profile.epk".getBytes(StandardCharsets.UTF_8);
|
byte[] filename = "profile.epk".getBytes(StandardCharsets.UTF_8);
|
||||||
|
@ -66,25 +75,30 @@ public class ProfileExporter {
|
||||||
writeLong(d.getTime(), osb);
|
writeLong(d.getTime(), osb);
|
||||||
|
|
||||||
int lengthIntegerOffset = osb.size();
|
int lengthIntegerOffset = osb.size();
|
||||||
osb.write(new byte[]{(byte)255,(byte)255,(byte)255,(byte)255}); // this will be replaced with the file count
|
osb.write(new byte[] { (byte) 255, (byte) 255, (byte) 255, (byte) 255 }); // this will be replaced with the file
|
||||||
|
// count
|
||||||
|
|
||||||
osb.write('G');
|
osb.write('G');
|
||||||
OutputStream os = EaglerZLIB.newGZIPOutputStream(osb);
|
|
||||||
|
|
||||||
os.write(new byte[]{(byte)72,(byte)69,(byte)65,(byte)68}); // HEAD
|
|
||||||
os.write(new byte[]{(byte)9,(byte)102,(byte)105,(byte)108,(byte)101,(byte)45,(byte)116,(byte)121,
|
|
||||||
(byte)112,(byte)101}); // 9 + file-type
|
|
||||||
os.write(new byte[]{(byte)0,(byte)0,(byte)0,(byte)14,(byte)101,(byte)112,(byte)107,(byte)47,(byte)112,(byte)114,(byte)111,
|
|
||||||
(byte)102,(byte)105,(byte)108,(byte)101,(byte)49,(byte)56,(byte)56}); // 14 + epk/profile188
|
|
||||||
os.write('>');
|
|
||||||
|
|
||||||
os.write(new byte[]{(byte)72,(byte)69,(byte)65,(byte)68}); // HEAD
|
|
||||||
os.write(new byte[]{(byte)12,(byte)102,(byte)105,(byte)108,(byte)101,(byte)45,(byte)101,(byte)120,
|
|
||||||
(byte)112,(byte)111,(byte)114,(byte)116,(byte)115,(byte)0,(byte)0,(byte)0,(byte)1}); // 12 + file-exports + 1
|
|
||||||
os.write((doExportProfile ? 1 : 0) | (doExportSettings ? 2 : 0) | (doExportServers ? 4 : 0) | (doExportResourcePacks ? 8 : 0));
|
|
||||||
os.write('>');
|
|
||||||
|
|
||||||
int fileCount = 2;
|
int fileCount = 2;
|
||||||
|
try (OutputStream os = EaglerZLIB.newGZIPOutputStream(osb)) {
|
||||||
|
os.write(new byte[] { (byte) 72, (byte) 69, (byte) 65, (byte) 68 }); // HEAD
|
||||||
|
os.write(new byte[] { (byte) 9, (byte) 102, (byte) 105, (byte) 108, (byte) 101, (byte) 45, (byte) 116,
|
||||||
|
(byte) 121,
|
||||||
|
(byte) 112, (byte) 101 }); // 9 + file-type
|
||||||
|
os.write(new byte[] { (byte) 0, (byte) 0, (byte) 0, (byte) 14, (byte) 101, (byte) 112, (byte) 107,
|
||||||
|
(byte) 47, (byte) 112, (byte) 114, (byte) 111,
|
||||||
|
(byte) 102, (byte) 105, (byte) 108, (byte) 101, (byte) 49, (byte) 56, (byte) 56 }); // 14 +
|
||||||
|
// epk/profile188
|
||||||
|
os.write('>');
|
||||||
|
|
||||||
|
os.write(new byte[] { (byte) 72, (byte) 69, (byte) 65, (byte) 68 }); // HEAD
|
||||||
|
os.write(new byte[] { (byte) 12, (byte) 102, (byte) 105, (byte) 108, (byte) 101, (byte) 45, (byte) 101,
|
||||||
|
(byte) 120,
|
||||||
|
(byte) 112, (byte) 111, (byte) 114, (byte) 116, (byte) 115, (byte) 0, (byte) 0, (byte) 0,
|
||||||
|
(byte) 1 }); // 12 + file-exports + 1
|
||||||
|
os.write((doExportProfile ? 1 : 0) | (doExportSettings ? 2 : 0) | (doExportServers ? 4 : 0)
|
||||||
|
| (doExportResourcePacks ? 8 : 0));
|
||||||
|
os.write('>');
|
||||||
|
|
||||||
if (doExportProfile) {
|
if (doExportProfile) {
|
||||||
byte[] profileData = EaglerProfile.write();
|
byte[] profileData = EaglerProfile.write();
|
||||||
|
@ -137,7 +151,8 @@ public class ProfileExporter {
|
||||||
|
|
||||||
if (doExportResourcePacks) {
|
if (doExportResourcePacks) {
|
||||||
logger.info("Exporting resource packs...");
|
logger.info("Exporting resource packs...");
|
||||||
byte[] packManifest = (new VFile2(EaglerFolderResourcePack.RESOURCE_PACKS + "/manifest.json")).getAllBytes();
|
byte[] packManifest = (new VFile2(EaglerFolderResourcePack.RESOURCE_PACKS + "/manifest.json"))
|
||||||
|
.getAllBytes();
|
||||||
if (packManifest != null) {
|
if (packManifest != null) {
|
||||||
exportFileToEPK(EaglerFolderResourcePack.RESOURCE_PACKS + "/manifest.json", packManifest, os);
|
exportFileToEPK(EaglerFolderResourcePack.RESOURCE_PACKS + "/manifest.json", packManifest, os);
|
||||||
++fileCount;
|
++fileCount;
|
||||||
|
@ -159,9 +174,10 @@ public class ProfileExporter {
|
||||||
}
|
}
|
||||||
|
|
||||||
os.write(new byte[] { (byte) 69, (byte) 78, (byte) 68, (byte) 36 }); // END$
|
os.write(new byte[] { (byte) 69, (byte) 78, (byte) 68, (byte) 36 }); // END$
|
||||||
os.close();
|
}
|
||||||
|
|
||||||
osb.write(new byte[]{(byte)58,(byte)58,(byte)58,(byte)89,(byte)69,(byte)69,(byte)58,(byte)62}); // :::YEE:>
|
osb.write(
|
||||||
|
new byte[] { (byte) 58, (byte) 58, (byte) 58, (byte) 89, (byte) 69, (byte) 69, (byte) 58, (byte) 62 }); // :::YEE:>
|
||||||
|
|
||||||
byte[] ret = osb.toByteArray();
|
byte[] ret = osb.toByteArray();
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8.profile;
|
package net.lax1dude.eaglercraft.v1_8.profile;
|
||||||
|
|
||||||
|
import java.io.Closeable;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||||
|
@ -17,19 +18,26 @@ import net.minecraft.client.multiplayer.ServerList;
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ProfileImporter {
|
public class ProfileImporter implements Closeable {
|
||||||
|
|
||||||
private static final Logger logger = LogManager.getLogger("ProfileImporter");
|
private static final Logger logger = LogManager.getLogger("ProfileImporter");
|
||||||
|
|
||||||
|
@ -128,7 +136,8 @@ public class ProfileImporter {
|
||||||
} else if (etr.name.startsWith(EaglerFolderResourcePack.RESOURCE_PACKS + "/")) {
|
} else if (etr.name.startsWith(EaglerFolderResourcePack.RESOURCE_PACKS + "/")) {
|
||||||
if (doImportResourcePacks) {
|
if (doImportResourcePacks) {
|
||||||
logger.info("Deleting old resource packs...");
|
logger.info("Deleting old resource packs...");
|
||||||
(new VFile2(EaglerFolderResourcePack.RESOURCE_PACKS)).listFiles(true).forEach(VFile2::delete);
|
(new VFile2(EaglerFolderResourcePack.RESOURCE_PACKS)).listFiles(true)
|
||||||
|
.forEach(VFile2::delete);
|
||||||
logger.info("Importing resource packs...");
|
logger.info("Importing resource packs...");
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
do {
|
do {
|
||||||
|
@ -148,4 +157,9 @@ public class ProfileImporter {
|
||||||
}
|
}
|
||||||
logger.info("Import complete!");
|
logger.info("Import complete!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void close() throws IOException {
|
||||||
|
epkDecompiler.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,14 +27,21 @@ import net.minecraft.util.MathHelper;
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -69,14 +76,17 @@ public class RenderHighPoly extends RenderPlayer {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Minecraft mc = Minecraft.getMinecraft();
|
Minecraft mc = Minecraft.getMinecraft();
|
||||||
float f2 = this.interpolateRotation(abstractclientplayer.prevRenderYawOffset, abstractclientplayer.renderYawOffset,
|
float f2 = this.interpolateRotation(abstractclientplayer.prevRenderYawOffset,
|
||||||
|
abstractclientplayer.renderYawOffset,
|
||||||
f1);
|
f1);
|
||||||
float f3 = this.interpolateRotation(abstractclientplayer.prevRotationYawHead, abstractclientplayer.rotationYawHead,
|
float f3 = this.interpolateRotation(abstractclientplayer.prevRotationYawHead,
|
||||||
|
abstractclientplayer.rotationYawHead,
|
||||||
f1);
|
f1);
|
||||||
float f4 = f3 - f2;
|
float f4 = f3 - f2;
|
||||||
if (abstractclientplayer.isRiding() && abstractclientplayer.ridingEntity instanceof EntityLivingBase) {
|
if (abstractclientplayer.isRiding() && abstractclientplayer.ridingEntity instanceof EntityLivingBase) {
|
||||||
EntityLivingBase entitylivingbase1 = (EntityLivingBase) abstractclientplayer.ridingEntity;
|
EntityLivingBase entitylivingbase1 = (EntityLivingBase) abstractclientplayer.ridingEntity;
|
||||||
f2 = this.interpolateRotation(entitylivingbase1.prevRenderYawOffset, entitylivingbase1.renderYawOffset,
|
f2 = this.interpolateRotation(entitylivingbase1.prevRenderYawOffset,
|
||||||
|
entitylivingbase1.renderYawOffset,
|
||||||
f1);
|
f1);
|
||||||
f4 = f3 - f2;
|
f4 = f3 - f2;
|
||||||
float f5 = MathHelper.wrapAngleTo180_float(f4);
|
float f5 = MathHelper.wrapAngleTo180_float(f4);
|
||||||
|
@ -100,7 +110,8 @@ public class RenderHighPoly extends RenderPlayer {
|
||||||
GlStateManager.enableRescaleNormal();
|
GlStateManager.enableRescaleNormal();
|
||||||
this.preRenderCallback(abstractclientplayer, f1);
|
this.preRenderCallback(abstractclientplayer, f1);
|
||||||
float f6 = 0.0625F;
|
float f6 = 0.0625F;
|
||||||
GlStateManager.scale(HighPolySkin.highPolyScale, HighPolySkin.highPolyScale, HighPolySkin.highPolyScale);
|
GlStateManager.scale(HighPolySkin.highPolyScale, HighPolySkin.highPolyScale,
|
||||||
|
HighPolySkin.highPolyScale);
|
||||||
mc.getTextureManager().bindTexture(highPolySkin.texture);
|
mc.getTextureManager().bindTexture(highPolySkin.texture);
|
||||||
|
|
||||||
if (abstractclientplayer.isPlayerSleeping()) {
|
if (abstractclientplayer.isPlayerSleeping()) {
|
||||||
|
@ -113,7 +124,8 @@ public class RenderHighPoly extends RenderPlayer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float var15 = abstractclientplayer.prevLimbSwingAmount + (abstractclientplayer.limbSwingAmount - abstractclientplayer.prevLimbSwingAmount) * f1;
|
float var15 = abstractclientplayer.prevLimbSwingAmount
|
||||||
|
+ (abstractclientplayer.limbSwingAmount - abstractclientplayer.prevLimbSwingAmount) * f1;
|
||||||
float var16 = abstractclientplayer.limbSwing - abstractclientplayer.limbSwingAmount * (1.0F - f1);
|
float var16 = abstractclientplayer.limbSwing - abstractclientplayer.limbSwingAmount * (1.0F - f1);
|
||||||
|
|
||||||
if (highPolySkin == HighPolySkin.LONG_ARMS) {
|
if (highPolySkin == HighPolySkin.LONG_ARMS) {
|
||||||
|
@ -159,9 +171,11 @@ public class RenderHighPoly extends RenderPlayer {
|
||||||
if (highPolySkin.headModel != null) {
|
if (highPolySkin.headModel != null) {
|
||||||
if (highPolySkin == HighPolySkin.BABY_CHARLES) {
|
if (highPolySkin == HighPolySkin.BABY_CHARLES) {
|
||||||
long millis = System.currentTimeMillis();
|
long millis = System.currentTimeMillis();
|
||||||
float partialTicks = (float) ((millis - abstractclientplayer.eaglerHighPolyAnimationTick) * 0.02);
|
float partialTicks = (float) ((millis - abstractclientplayer.eaglerHighPolyAnimationTick)
|
||||||
|
* 0.02);
|
||||||
// long l50 = millis / 50l * 50l;
|
// long l50 = millis / 50l * 50l;
|
||||||
//boolean runTick = par1EntityPlayer.eaglerHighPolyAnimationTick < l50 && millis >= l50;
|
// boolean runTick = par1EntityPlayer.eaglerHighPolyAnimationTick < l50 &&
|
||||||
|
// millis >= l50;
|
||||||
abstractclientplayer.eaglerHighPolyAnimationTick = millis;
|
abstractclientplayer.eaglerHighPolyAnimationTick = millis;
|
||||||
|
|
||||||
if (partialTicks < 0.0f) {
|
if (partialTicks < 0.0f) {
|
||||||
|
@ -188,7 +202,8 @@ public class RenderHighPoly extends RenderPlayer {
|
||||||
}
|
}
|
||||||
jumpFac *= 10.0f;
|
jumpFac *= 10.0f;
|
||||||
|
|
||||||
abstractclientplayer.eaglerHighPolyAnimationFloat3 += (jumpFac / (jumpFac + 1.0f)) * 6.0f * partialTicks;
|
abstractclientplayer.eaglerHighPolyAnimationFloat3 += (jumpFac / (jumpFac + 1.0f)) * 6.0f
|
||||||
|
* partialTicks;
|
||||||
|
|
||||||
if (Float.isInfinite(abstractclientplayer.eaglerHighPolyAnimationFloat3)) {
|
if (Float.isInfinite(abstractclientplayer.eaglerHighPolyAnimationFloat3)) {
|
||||||
abstractclientplayer.eaglerHighPolyAnimationFloat3 = 1.0f;
|
abstractclientplayer.eaglerHighPolyAnimationFloat3 = 1.0f;
|
||||||
|
@ -198,7 +213,8 @@ public class RenderHighPoly extends RenderPlayer {
|
||||||
abstractclientplayer.eaglerHighPolyAnimationFloat3 = -1.0f;
|
abstractclientplayer.eaglerHighPolyAnimationFloat3 = -1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
abstractclientplayer.eaglerHighPolyAnimationFloat2 += abstractclientplayer.eaglerHighPolyAnimationFloat3 * partialTicks;
|
abstractclientplayer.eaglerHighPolyAnimationFloat2 += abstractclientplayer.eaglerHighPolyAnimationFloat3
|
||||||
|
* partialTicks;
|
||||||
|
|
||||||
abstractclientplayer.eaglerHighPolyAnimationFloat5 += partialTicks;
|
abstractclientplayer.eaglerHighPolyAnimationFloat5 += partialTicks;
|
||||||
while (abstractclientplayer.eaglerHighPolyAnimationFloat5 > 0.05f) {
|
while (abstractclientplayer.eaglerHighPolyAnimationFloat5 > 0.05f) {
|
||||||
|
@ -207,7 +223,11 @@ public class RenderHighPoly extends RenderPlayer {
|
||||||
abstractclientplayer.eaglerHighPolyAnimationFloat2 *= 0.9f;
|
abstractclientplayer.eaglerHighPolyAnimationFloat2 *= 0.9f;
|
||||||
}
|
}
|
||||||
|
|
||||||
jumpFactor = abstractclientplayer.eaglerHighPolyAnimationFloat2; //(abstractclientplayer.eaglerHighPolyAnimationFloat1 - abstractclientplayer.eaglerHighPolyAnimationFloat2) * partialTicks + abstractclientplayer.eaglerHighPolyAnimationFloat2;
|
jumpFactor = abstractclientplayer.eaglerHighPolyAnimationFloat2; // (abstractclientplayer.eaglerHighPolyAnimationFloat1
|
||||||
|
// -
|
||||||
|
// abstractclientplayer.eaglerHighPolyAnimationFloat2)
|
||||||
|
// * partialTicks +
|
||||||
|
// abstractclientplayer.eaglerHighPolyAnimationFloat2;
|
||||||
jumpFactor -= 0.12f;
|
jumpFactor -= 0.12f;
|
||||||
if (jumpFactor < 0.0f) {
|
if (jumpFactor < 0.0f) {
|
||||||
jumpFactor = 0.0f;
|
jumpFactor = 0.0f;
|
||||||
|
@ -255,13 +275,17 @@ public class RenderHighPoly extends RenderPlayer {
|
||||||
|
|
||||||
if (highPolySkin == HighPolySkin.LONG_ARMS) {
|
if (highPolySkin == HighPolySkin.LONG_ARMS) {
|
||||||
if (abstractclientplayer.isSwingInProgress) {
|
if (abstractclientplayer.isSwingInProgress) {
|
||||||
float var17 = MathHelper.cos(-abstractclientplayer.getSwingProgress(f1) * (float)Math.PI * 2.0f - 1.2f) - 0.362f;
|
float var17 = MathHelper
|
||||||
|
.cos(-abstractclientplayer.getSwingProgress(f1) * (float) Math.PI * 2.0f - 1.2f)
|
||||||
|
- 0.362f;
|
||||||
var17 *= var17;
|
var17 *= var17;
|
||||||
GlStateManager.rotate(-var17 * 20.0f, 1.0f, 0.0f, 0.0f);
|
GlStateManager.rotate(-var17 * 20.0f, 1.0f, 0.0f, 0.0f);
|
||||||
}
|
}
|
||||||
} else if (highPolySkin == HighPolySkin.WEIRD_CLIMBER_DUDE) {
|
} else if (highPolySkin == HighPolySkin.WEIRD_CLIMBER_DUDE) {
|
||||||
if (abstractclientplayer.isSwingInProgress) {
|
if (abstractclientplayer.isSwingInProgress) {
|
||||||
float var17 = MathHelper.cos(-abstractclientplayer.getSwingProgress(f1) * (float)Math.PI * 2.0f - 1.2f) - 0.362f;
|
float var17 = MathHelper
|
||||||
|
.cos(-abstractclientplayer.getSwingProgress(f1) * (float) Math.PI * 2.0f - 1.2f)
|
||||||
|
- 0.362f;
|
||||||
var17 *= var17;
|
var17 *= var17;
|
||||||
GlStateManager.rotate(var17 * 60.0f, 1.0f, 0.0f, 0.0f);
|
GlStateManager.rotate(var17 * 60.0f, 1.0f, 0.0f, 0.0f);
|
||||||
}
|
}
|
||||||
|
@ -272,7 +296,9 @@ public class RenderHighPoly extends RenderPlayer {
|
||||||
float swing2 = (MathHelper.cos(f10 % 100000.0f) * fff * 0.5f + 0.0f) * var15;
|
float swing2 = (MathHelper.cos(f10 % 100000.0f) * fff * 0.5f + 0.0f) * var15;
|
||||||
GlStateManager.rotate(swing * 25.0f, 1.0f, 0.0f, 0.0f);
|
GlStateManager.rotate(swing * 25.0f, 1.0f, 0.0f, 0.0f);
|
||||||
if (abstractclientplayer.isSwingInProgress) {
|
if (abstractclientplayer.isSwingInProgress) {
|
||||||
float var17 = MathHelper.cos(-abstractclientplayer.getSwingProgress(f1) * (float)Math.PI * 2.0f - 1.2f) - 0.362f;
|
float var17 = MathHelper
|
||||||
|
.cos(-abstractclientplayer.getSwingProgress(f1) * (float) Math.PI * 2.0f - 1.2f)
|
||||||
|
- 0.362f;
|
||||||
var17 *= var17;
|
var17 *= var17;
|
||||||
GlStateManager.rotate(-var17 * 25.0f, 1.0f, 0.0f, 0.0f);
|
GlStateManager.rotate(-var17 * 25.0f, 1.0f, 0.0f, 0.0f);
|
||||||
}
|
}
|
||||||
|
@ -308,7 +334,8 @@ public class RenderHighPoly extends RenderPlayer {
|
||||||
if (itm == Items.bow) {
|
if (itm == Items.bow) {
|
||||||
GlStateManager.translate(-0.22f, 0.8f, 0.6f);
|
GlStateManager.translate(-0.22f, 0.8f, 0.6f);
|
||||||
GlStateManager.rotate(-90.0f, 1.0f, 0.0f, 0.0f);
|
GlStateManager.rotate(-90.0f, 1.0f, 0.0f, 0.0f);
|
||||||
}else if(itm instanceof ItemBlock && !((ItemBlock)itm).getBlock().isNormalCube()) {
|
} else if (itm instanceof ItemBlock
|
||||||
|
&& !((ItemBlock) itm).getBlock().isNormalCube()) {
|
||||||
GlStateManager.translate(0.0f, -0.1f, 0.13f);
|
GlStateManager.translate(0.0f, -0.1f, 0.13f);
|
||||||
} else if (!itm.isFull3D()) {
|
} else if (!itm.isFull3D()) {
|
||||||
GlStateManager.translate(-0.08f, -0.1f, 0.16f);
|
GlStateManager.translate(-0.08f, -0.1f, 0.16f);
|
||||||
|
@ -320,7 +347,9 @@ public class RenderHighPoly extends RenderPlayer {
|
||||||
GlStateManager.rotate(-5.0f, 0.0f, 1.0f, 0.0f);
|
GlStateManager.rotate(-5.0f, 0.0f, 1.0f, 0.0f);
|
||||||
float var17 = -1.2f * var15;
|
float var17 = -1.2f * var15;
|
||||||
if (abstractclientplayer.isSwingInProgress) {
|
if (abstractclientplayer.isSwingInProgress) {
|
||||||
float vvar17 = MathHelper.cos(-abstractclientplayer.getSwingProgress(f1) * (float)Math.PI * 2.0f - 1.2f) - 0.362f;
|
float vvar17 = MathHelper.cos(
|
||||||
|
-abstractclientplayer.getSwingProgress(f1) * (float) Math.PI * 2.0f - 1.2f)
|
||||||
|
- 0.362f;
|
||||||
var17 = vvar17 < var17 ? vvar17 : var17;
|
var17 = vvar17 < var17 ? vvar17 : var17;
|
||||||
}
|
}
|
||||||
GlStateManager.translate(-0.02f * var17, 0.42f * var17, var17 * 0.35f);
|
GlStateManager.translate(-0.02f * var17, 0.42f * var17, var17 * 0.35f);
|
||||||
|
@ -333,7 +362,8 @@ public class RenderHighPoly extends RenderPlayer {
|
||||||
if (itm == Items.bow) {
|
if (itm == Items.bow) {
|
||||||
GlStateManager.translate(-0.18f, 1.0f, 0.4f);
|
GlStateManager.translate(-0.18f, 1.0f, 0.4f);
|
||||||
GlStateManager.rotate(-95.0f, 1.0f, 0.0f, 0.0f);
|
GlStateManager.rotate(-95.0f, 1.0f, 0.0f, 0.0f);
|
||||||
}else if(itm instanceof ItemBlock && !((ItemBlock)itm).getBlock().isNormalCube()) {
|
} else if (itm instanceof ItemBlock
|
||||||
|
&& !((ItemBlock) itm).getBlock().isNormalCube()) {
|
||||||
GlStateManager.translate(0.0f, -0.1f, 0.13f);
|
GlStateManager.translate(0.0f, -0.1f, 0.13f);
|
||||||
} else if (!itm.isFull3D()) {
|
} else if (!itm.isFull3D()) {
|
||||||
GlStateManager.translate(-0.08f, -0.1f, 0.16f);
|
GlStateManager.translate(-0.08f, -0.1f, 0.16f);
|
||||||
|
@ -351,7 +381,8 @@ public class RenderHighPoly extends RenderPlayer {
|
||||||
GlStateManager.translate(-0.65f, 1.3f, -0.1f);
|
GlStateManager.translate(-0.65f, 1.3f, -0.1f);
|
||||||
GlStateManager.rotate(180.0f, 0.0f, 0.0f, 1.0f);
|
GlStateManager.rotate(180.0f, 0.0f, 0.0f, 1.0f);
|
||||||
GlStateManager.rotate(20.0f, 1.0f, 0.0f, 0.0f);
|
GlStateManager.rotate(20.0f, 1.0f, 0.0f, 0.0f);
|
||||||
}else if(itm instanceof ItemBlock && !((ItemBlock)itm).getBlock().isNormalCube()) {
|
} else if (itm instanceof ItemBlock
|
||||||
|
&& !((ItemBlock) itm).getBlock().isNormalCube()) {
|
||||||
GlStateManager.translate(0.0f, -0.35f, 0.4f);
|
GlStateManager.translate(0.0f, -0.35f, 0.4f);
|
||||||
} else if (!itm.isFull3D()) {
|
} else if (!itm.isFull3D()) {
|
||||||
GlStateManager.translate(-0.1f, -0.1f, 0.16f);
|
GlStateManager.translate(-0.1f, -0.1f, 0.16f);
|
||||||
|
@ -374,8 +405,11 @@ public class RenderHighPoly extends RenderPlayer {
|
||||||
int brightness = abstractclientplayer.getBrightnessForRender(0.0f);
|
int brightness = abstractclientplayer.getBrightnessForRender(0.0f);
|
||||||
float blockLight = (brightness % 65536) * ff;
|
float blockLight = (brightness % 65536) * ff;
|
||||||
float skyLight = (brightness / 65536) * ff;
|
float skyLight = (brightness / 65536) * ff;
|
||||||
float sunCurve = (float)((abstractclientplayer.worldObj.getWorldTime() + 4000l) % 24000) / 24000.0f;
|
float sunCurve = (float) ((abstractclientplayer.worldObj.getWorldTime() + 4000l) % 24000)
|
||||||
sunCurve = MathHelper.clamp_float(9.8f - MathHelper.abs(sunCurve * 5.0f + sunCurve * sunCurve * 45.0f - 14.3f) * 0.7f, 0.0f, 1.0f);
|
/ 24000.0f;
|
||||||
|
sunCurve = MathHelper.clamp_float(
|
||||||
|
9.8f - MathHelper.abs(sunCurve * 5.0f + sunCurve * sunCurve * 45.0f - 14.3f) * 0.7f, 0.0f,
|
||||||
|
1.0f);
|
||||||
skyLight = skyLight * (sunCurve * 0.85f + 0.15f);
|
skyLight = skyLight * (sunCurve * 0.85f + 0.15f);
|
||||||
blockLight = blockLight * (sunCurve * 0.3f + 0.7f);
|
blockLight = blockLight * (sunCurve * 0.3f + 0.7f);
|
||||||
float eyeBrightness = blockLight;
|
float eyeBrightness = blockLight;
|
||||||
|
@ -393,7 +427,8 @@ public class RenderHighPoly extends RenderPlayer {
|
||||||
} else {
|
} else {
|
||||||
GlStateManager.enableBlend();
|
GlStateManager.enableBlend();
|
||||||
GlStateManager.blendFunc(GL_ONE, GL_ONE);
|
GlStateManager.blendFunc(GL_ONE, GL_ONE);
|
||||||
GlStateManager.color(eyeBrightness * 7.0f, eyeBrightness * 7.0f, eyeBrightness * 7.0f, 1.0f);
|
GlStateManager.color(eyeBrightness * 7.0f, eyeBrightness * 7.0f, eyeBrightness * 7.0f,
|
||||||
|
1.0f);
|
||||||
if (jumpFactor > 0.0f) {
|
if (jumpFactor > 0.0f) {
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.translate(0.0f, jumpFactor * 3.0f, 0.0f);
|
GlStateManager.translate(0.0f, jumpFactor * 3.0f, 0.0f);
|
||||||
|
@ -468,4 +503,13 @@ public class RenderHighPoly extends RenderPlayer {
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void renderLivingAt(AbstractClientPlayer abstractclientplayer, double d0, double d1, double d2) {
|
||||||
|
if (abstractclientplayer.isEntityAlive() && abstractclientplayer.isPlayerSleeping()) {
|
||||||
|
super.renderLivingAt(abstractclientplayer, d0 - (double) abstractclientplayer.renderOffsetX,
|
||||||
|
d1 - (double) abstractclientplayer.renderOffsetY, d2 - (double) abstractclientplayer.renderOffsetZ);
|
||||||
|
} else {
|
||||||
|
super.renderLivingAt(abstractclientplayer, d0, d1, d2);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -54,7 +54,7 @@ public enum SkinModel {
|
||||||
private SkinModel(int id, HighPolySkin highPoly) {
|
private SkinModel(int id, HighPolySkin highPoly) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.width = 256;
|
this.width = 256;
|
||||||
this.height = 128;
|
this.height = 256;
|
||||||
this.profileSkinType = "eagler";
|
this.profileSkinType = "eagler";
|
||||||
this.sanitize = true;
|
this.sanitize = true;
|
||||||
this.highPoly = highPoly;
|
this.highPoly = highPoly;
|
||||||
|
|
|
@ -429,11 +429,6 @@ public class ConnectionHandshake {
|
||||||
RateLimitTracker.registerLockOut(PlatformNetworking.getCurrentURI());
|
RateLimitTracker.registerLockOut(PlatformNetworking.getCurrentURI());
|
||||||
mc.displayGuiScreen(GuiDisconnected.createRateLimitKick(scr));
|
mc.displayGuiScreen(GuiDisconnected.createRateLimitKick(scr));
|
||||||
} else if (errorCode == HandshakePacketTypes.SERVER_ERROR_CUSTOM_MESSAGE) {
|
} else if (errorCode == HandshakePacketTypes.SERVER_ERROR_CUSTOM_MESSAGE) {
|
||||||
if (IChatComponent.Serializer.jsonToComponent(errStr).getUnformattedText().toLowerCase()
|
|
||||||
.contains("banned from this server")) {
|
|
||||||
EaglerProfile.updateUsernameCookies();
|
|
||||||
reloadPage();
|
|
||||||
}
|
|
||||||
if (IChatComponent.Serializer.jsonToComponent(errStr).getUnformattedText().toLowerCase()
|
if (IChatComponent.Serializer.jsonToComponent(errStr).getUnformattedText().toLowerCase()
|
||||||
.contains("reload page")) {
|
.contains("reload page")) {
|
||||||
EaglerProfile.updateUsernameCookieFromLocalStorage();
|
EaglerProfile.updateUsernameCookieFromLocalStorage();
|
||||||
|
|
|
@ -92,10 +92,6 @@ public class EaglercraftNetworkManager {
|
||||||
}
|
}
|
||||||
clientDisconnected = true;
|
clientDisconnected = true;
|
||||||
System.out.println("Closed channel: " + reason.getUnformattedText());
|
System.out.println("Closed channel: " + reason.getUnformattedText());
|
||||||
if (reason.getUnformattedText().toLowerCase().contains("banned from this server")) {
|
|
||||||
EaglerProfile.updateUsernameCookies();
|
|
||||||
reloadPage();
|
|
||||||
}
|
|
||||||
if (reason.getUnformattedText().toLowerCase().contains("reload page")) {
|
if (reason.getUnformattedText().toLowerCase().contains("reload page")) {
|
||||||
EaglerProfile.updateUsernameCookieFromLocalStorage();
|
EaglerProfile.updateUsernameCookieFromLocalStorage();
|
||||||
reloadPage();
|
reloadPage();
|
||||||
|
|
|
@ -13,14 +13,21 @@ import net.minecraft.client.resources.I18n;
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -58,8 +65,12 @@ public class GuiScreenNameWorldImport extends GuiScreen {
|
||||||
}
|
}
|
||||||
if (definetlyTimeToImport && !isImporting) {
|
if (definetlyTimeToImport && !isImporting) {
|
||||||
isImporting = true;
|
isImporting = true;
|
||||||
SingleplayerServerController.importWorld(GuiCreateWorld.func_146317_a(mc.getSaveLoader(), this.theGuiTextField.getText().trim()), world.fileData, importFormat, (byte) ((loadSpawnChunks ? 2 : 0) | (enhancedGameRules ? 1 : 0)));
|
SingleplayerServerController.importWorld(
|
||||||
mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(parentGuiScreen, "singleplayer.busy.importing." + (importFormat + 1), "singleplayer.failed.importing." + (importFormat + 1), SingleplayerServerController::isReady));
|
GuiCreateWorld.func_146317_a(mc.getSaveLoader(), this.theGuiTextField.getText().trim()),
|
||||||
|
world.fileData, importFormat, (byte) ((loadSpawnChunks ? 2 : 0) | (enhancedGameRules ? 1 : 0)));
|
||||||
|
mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(parentGuiScreen,
|
||||||
|
"singleplayer.busy.importing." + (importFormat + 1),
|
||||||
|
"singleplayer.failed.importing." + (importFormat + 1), SingleplayerServerController::isReady));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,13 +81,20 @@ public class GuiScreenNameWorldImport extends GuiScreen {
|
||||||
if (!timeToImport) {
|
if (!timeToImport) {
|
||||||
Keyboard.enableRepeatEvents(true);
|
Keyboard.enableRepeatEvents(true);
|
||||||
this.buttonList.clear();
|
this.buttonList.clear();
|
||||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("singleplayer.import.continue")));
|
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12,
|
||||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel")));
|
I18n.format("singleplayer.import.continue")));
|
||||||
this.theGuiTextField = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 100, this.height / 4 + 3, 200, 20);
|
this.buttonList
|
||||||
|
.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel")));
|
||||||
|
this.theGuiTextField = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 100, this.height / 4 + 3,
|
||||||
|
200, 20);
|
||||||
this.theGuiTextField.setFocused(true);
|
this.theGuiTextField.setFocused(true);
|
||||||
this.theGuiTextField.setText(name);
|
this.theGuiTextField.setText(name);
|
||||||
this.buttonList.add(loadSpawnChunksBtn = new GuiButton(2, this.width / 2 - 100, this.height / 4 + 24 + 12, I18n.format("singleplayer.import.loadSpawnChunks", loadSpawnChunks ? I18n.format("gui.yes") : I18n.format("gui.no"))));
|
this.buttonList.add(loadSpawnChunksBtn = new GuiButton(2, this.width / 2 - 100, this.height / 4 + 24 + 12,
|
||||||
this.buttonList.add(enhancedGameRulesBtn = new GuiButton(3, this.width / 2 - 100, this.height / 4 + 48 + 12, I18n.format("singleplayer.import.enhancedGameRules", enhancedGameRules ? I18n.format("gui.yes") : I18n.format("gui.no"))));
|
I18n.format("singleplayer.import.loadSpawnChunks",
|
||||||
|
loadSpawnChunks ? I18n.format("gui.yes") : I18n.format("gui.no"))));
|
||||||
|
this.buttonList.add(enhancedGameRulesBtn = new GuiButton(3, this.width / 2 - 100, this.height / 4 + 48 + 12,
|
||||||
|
I18n.format("singleplayer.import.enhancedGameRules",
|
||||||
|
enhancedGameRules ? I18n.format("gui.yes") : I18n.format("gui.no"))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,10 +119,12 @@ public class GuiScreenNameWorldImport extends GuiScreen {
|
||||||
timeToImport = true;
|
timeToImport = true;
|
||||||
} else if (par1GuiButton.id == 2) {
|
} else if (par1GuiButton.id == 2) {
|
||||||
loadSpawnChunks = !loadSpawnChunks;
|
loadSpawnChunks = !loadSpawnChunks;
|
||||||
loadSpawnChunksBtn.displayString = I18n.format("singleplayer.import.loadSpawnChunks", loadSpawnChunks ? I18n.format("gui.yes") : I18n.format("gui.no"));
|
loadSpawnChunksBtn.displayString = I18n.format("singleplayer.import.loadSpawnChunks",
|
||||||
|
loadSpawnChunks ? I18n.format("gui.yes") : I18n.format("gui.no"));
|
||||||
} else if (par1GuiButton.id == 3) {
|
} else if (par1GuiButton.id == 3) {
|
||||||
enhancedGameRules = !enhancedGameRules;
|
enhancedGameRules = !enhancedGameRules;
|
||||||
enhancedGameRulesBtn.displayString = I18n.format("singleplayer.import.enhancedGameRules", enhancedGameRules ? I18n.format("gui.yes") : I18n.format("gui.no"));
|
enhancedGameRulesBtn.displayString = I18n.format("singleplayer.import.enhancedGameRules",
|
||||||
|
enhancedGameRules ? I18n.format("gui.yes") : I18n.format("gui.no"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,15 +158,20 @@ public class GuiScreenNameWorldImport extends GuiScreen {
|
||||||
public void drawScreen(int par1, int par2, float par3) {
|
public void drawScreen(int par1, int par2, float par3) {
|
||||||
this.drawDefaultBackground();
|
this.drawDefaultBackground();
|
||||||
if (!timeToImport) {
|
if (!timeToImport) {
|
||||||
this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.import.title"), this.width / 2, this.height / 4 - 60 + 20, 16777215);
|
this.drawCenteredString(this.fontRendererObj, I18n.format("singleplayer.import.title"), this.width / 2,
|
||||||
this.drawString(this.fontRendererObj, I18n.format("singleplayer.import.enterName"), this.width / 2 - 100, this.height / 4 - 60 + 50, 10526880);
|
this.height / 4 - 60 + 20, 16777215);
|
||||||
this.drawCenteredString(this.fontRendererObj, I18n.format("createWorld.seedNote"), this.width / 2, this.height / 4 + 90, -6250336);
|
this.drawString(this.fontRendererObj, I18n.format("singleplayer.import.enterName"), this.width / 2 - 100,
|
||||||
|
this.height / 4 - 60 + 50, 10526880);
|
||||||
|
this.drawCenteredString(this.fontRendererObj, I18n.format("createWorld.seedNote"), this.width / 2,
|
||||||
|
this.height / 4 + 90, -6250336);
|
||||||
this.theGuiTextField.drawTextBox();
|
this.theGuiTextField.drawTextBox();
|
||||||
} else {
|
} else {
|
||||||
definetlyTimeToImport = true;
|
definetlyTimeToImport = true;
|
||||||
long dots = (System.currentTimeMillis() / 500l) % 4l;
|
long dots = (System.currentTimeMillis() / 500l) % 4l;
|
||||||
String str = I18n.format("singleplayer.import.reading", world.fileName);
|
String str = I18n.format("singleplayer.import.reading", world.fileName);
|
||||||
this.drawString(fontRendererObj, str + (dots > 0 ? "." : "") + (dots > 1 ? "." : "") + (dots > 2 ? "." : ""), (this.width - this.fontRendererObj.getStringWidth(str)) / 2, this.height / 3 + 10, 0xFFFFFF);
|
this.drawString(fontRendererObj,
|
||||||
|
str + (dots > 0 ? "." : "") + (dots > 1 ? "." : "") + (dots > 2 ? "." : ""),
|
||||||
|
(this.width - this.fontRendererObj.getStringWidth(str)) / 2, this.height / 3 + 10, 0xFFFFFF);
|
||||||
}
|
}
|
||||||
super.drawScreen(par1, par2, par3);
|
super.drawScreen(par1, par2, par3);
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,7 +165,6 @@ public class GuiShareToLan extends GuiScreen {
|
||||||
this.mc.ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(I18n.format("lanServer.opened")
|
this.mc.ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(I18n.format("lanServer.opened")
|
||||||
.replace("$relay$", LANServerController.getCurrentURI()).replace("$code$", code)));
|
.replace("$relay$", LANServerController.getCurrentURI()).replace("$code$", code)));
|
||||||
} else {
|
} else {
|
||||||
SingleplayerServerController.configureLAN(mc.theWorld.getWorldInfo().getGameType(), false);
|
|
||||||
this.mc.displayGuiScreen(new GuiScreenNoRelays(this, "noRelay.titleFail"));
|
this.mc.displayGuiScreen(new GuiScreenNoRelays(this, "noRelay.titleFail"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2024 lax1dude, hoosiertransfer, ayunami2000. All Rights
|
* Copyright (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
* Reserved.
|
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
* AND
|
* AND
|
||||||
|
@ -358,9 +357,11 @@ public class LANClientNetworkManager extends EaglercraftNetworkManager {
|
||||||
}
|
}
|
||||||
EaglerInputStream bi = new EaglerInputStream(fullData);
|
EaglerInputStream bi = new EaglerInputStream(fullData);
|
||||||
int i = (bi.read() << 24) | (bi.read() << 16) | (bi.read() << 8) | bi.read();
|
int i = (bi.read() << 24) | (bi.read() << 16) | (bi.read() << 8) | bi.read();
|
||||||
InputStream inflaterInputStream = EaglerZLIB.newInflaterInputStream(bi);
|
|
||||||
fullData = new byte[i];
|
fullData = new byte[i];
|
||||||
int r = IOUtils.readFully(inflaterInputStream, fullData);
|
int r;
|
||||||
|
try (InputStream inflaterInputStream = EaglerZLIB.newInflaterInputStream(bi)) {
|
||||||
|
r = IOUtils.readFully(inflaterInputStream, fullData);
|
||||||
|
}
|
||||||
if (i != r) {
|
if (i != r) {
|
||||||
logger.warn("Decompressed packet expected size {} differs from actual size {}!", i, r);
|
logger.warn("Decompressed packet expected size {} differs from actual size {}!", i, r);
|
||||||
}
|
}
|
||||||
|
|
|
@ -501,7 +501,7 @@ public class EaglerIntegratedServerWorker {
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
mainLoop();
|
mainLoop();
|
||||||
EagUtils.sleep(1l);
|
EagUtils.sleep(0l);
|
||||||
}
|
}
|
||||||
} catch (Throwable tt) {
|
} catch (Throwable tt) {
|
||||||
if (tt instanceof ReportedException) {
|
if (tt instanceof ReportedException) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8.sp.server.export;
|
package net.lax1dude.eaglercraft.v1_8.sp.server.export;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.Closeable;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -12,24 +13,32 @@ import net.lax1dude.eaglercraft.v1_8.IOUtils;
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EPKDecompiler {
|
public class EPKDecompiler implements Closeable {
|
||||||
|
|
||||||
public static class FileEntry {
|
public static class FileEntry {
|
||||||
public final String type;
|
public final String type;
|
||||||
public final String name;
|
public final String name;
|
||||||
public final byte[] data;
|
public final byte[] data;
|
||||||
|
|
||||||
protected FileEntry(String type, String name, byte[] data) {
|
protected FileEntry(String type, String name, byte[] data) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -49,7 +58,8 @@ public class EPKDecompiler {
|
||||||
byte[] header = new byte[8];
|
byte[] header = new byte[8];
|
||||||
IOUtils.readFully(in2, header);
|
IOUtils.readFully(in2, header);
|
||||||
|
|
||||||
if(Arrays.equals(header, new byte[]{(byte)69,(byte)65,(byte)71,(byte)80,(byte)75,(byte)71,(byte)36,(byte)36})) {
|
if (Arrays.equals(header, new byte[] { (byte) 69, (byte) 65, (byte) 71, (byte) 80, (byte) 75, (byte) 71,
|
||||||
|
(byte) 36, (byte) 36 })) {
|
||||||
byte[] endCode = new byte[] { (byte) ':', (byte) ':', (byte) ':', (byte) 'Y',
|
byte[] endCode = new byte[] { (byte) ':', (byte) ':', (byte) ':', (byte) 'Y',
|
||||||
(byte) 'E', (byte) 'E', (byte) ':', (byte) '>' };
|
(byte) 'E', (byte) 'E', (byte) ':', (byte) '>' };
|
||||||
for (int i = 0; i < 8; ++i) {
|
for (int i = 0; i < 8; ++i) {
|
||||||
|
@ -88,7 +98,8 @@ public class EPKDecompiler {
|
||||||
}
|
}
|
||||||
|
|
||||||
crc32 = new CRC32();
|
crc32 = new CRC32();
|
||||||
}else if(Arrays.equals(header, new byte[]{(byte)69,(byte)65,(byte)71,(byte)80,(byte)75,(byte)71,(byte)33,(byte)33})) {
|
} else if (Arrays.equals(header, new byte[] { (byte) 69, (byte) 65, (byte) 71, (byte) 80, (byte) 75, (byte) 71,
|
||||||
|
(byte) 33, (byte) 33 })) {
|
||||||
throw new IOException("FILE IS AN UNSUPPORTED LEGACY FORMAT!");
|
throw new IOException("FILE IS AN UNSUPPORTED LEGACY FORMAT!");
|
||||||
} else {
|
} else {
|
||||||
throw new IOException("FILE IS NOT AN EPK FILE!");
|
throw new IOException("FILE IS NOT AN EPK FILE!");
|
||||||
|
@ -178,4 +189,9 @@ public class EPKDecompiler {
|
||||||
return new String(charIn);
|
return new String(charIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void close() throws IOException {
|
||||||
|
zis.close();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,7 @@ import net.minecraft.nbt.CompressedStreamTools;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2024 lax1dude, hoosiertransfer, ayunami2000. All Rights
|
* Copyright (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
* Reserved.
|
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
* AND
|
* AND
|
||||||
|
@ -48,7 +47,7 @@ public class WorldConverterEPK {
|
||||||
folderName += "_";
|
folderName += "_";
|
||||||
worldDir = EaglerIntegratedServerWorker.saveFormat.getSaveLoader(folderName, false).getWorldDirectory();
|
worldDir = EaglerIntegratedServerWorker.saveFormat.getSaveLoader(folderName, false).getWorldDirectory();
|
||||||
}
|
}
|
||||||
EPKDecompiler dc = new EPKDecompiler(archiveContents);
|
try (EPKDecompiler dc = new EPKDecompiler(archiveContents)) {
|
||||||
EPKDecompiler.FileEntry f = null;
|
EPKDecompiler.FileEntry f = null;
|
||||||
int lastProgUpdate = 0;
|
int lastProgUpdate = 0;
|
||||||
int prog = 0;
|
int prog = 0;
|
||||||
|
@ -89,6 +88,7 @@ public class WorldConverterEPK {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
logger.info("EPK was successfully extracted into directory \"{}\"", worldDir.getPath());
|
logger.info("EPK was successfully extracted into directory \"{}\"", worldDir.getPath());
|
||||||
String[] worldsTxt = EaglerSaveFormat.worldsList.getAllLines();
|
String[] worldsTxt = EaglerSaveFormat.worldsList.getAllLines();
|
||||||
if (worldsTxt == null || worldsTxt.length <= 0
|
if (worldsTxt == null || worldsTxt.length <= 0
|
||||||
|
|
|
@ -24,8 +24,7 @@ import net.minecraft.nbt.CompressedStreamTools;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2024 lax1dude, hoosiertransfer, ayunami2000. All Rights
|
* Copyright (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
|
||||||
* Reserved.
|
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
* AND
|
* AND
|
||||||
|
@ -58,9 +57,9 @@ public class WorldConverterMCA {
|
||||||
folderName += "_";
|
folderName += "_";
|
||||||
worldDir = EaglerIntegratedServerWorker.saveFormat.getSaveLoader(folderName, false).getWorldDirectory();
|
worldDir = EaglerIntegratedServerWorker.saveFormat.getSaveLoader(folderName, false).getWorldDirectory();
|
||||||
}
|
}
|
||||||
ZipInputStream zis = new ZipInputStream(new EaglerInputStream(archiveContents));
|
|
||||||
ZipEntry folderNameFile = null;
|
|
||||||
List<char[]> fileNames = new ArrayList<>();
|
List<char[]> fileNames = new ArrayList<>();
|
||||||
|
try (ZipInputStream zis = new ZipInputStream(new EaglerInputStream(archiveContents))) {
|
||||||
|
ZipEntry folderNameFile = null;
|
||||||
while ((folderNameFile = zis.getNextEntry()) != null) {
|
while ((folderNameFile = zis.getNextEntry()) != null) {
|
||||||
if (folderNameFile.getName().contains("__MACOSX/"))
|
if (folderNameFile.getName().contains("__MACOSX/"))
|
||||||
continue;
|
continue;
|
||||||
|
@ -72,11 +71,12 @@ public class WorldConverterMCA {
|
||||||
continue;
|
continue;
|
||||||
fileNames.add(folderNameFile.getName().toCharArray());
|
fileNames.add(folderNameFile.getName().toCharArray());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
final int[] i = new int[] { 0 };
|
final int[] i = new int[] { 0 };
|
||||||
while (fileNames.get(0).length > i[0] && fileNames.stream().allMatch(w -> w[i[0]] == fileNames.get(0)[i[0]]))
|
while (fileNames.get(0).length > i[0] && fileNames.stream().allMatch(w -> w[i[0]] == fileNames.get(0)[i[0]]))
|
||||||
i[0]++;
|
i[0]++;
|
||||||
int folderPrefixOffset = i[0];
|
int folderPrefixOffset = i[0];
|
||||||
zis = new ZipInputStream(new EaglerInputStream(archiveContents));
|
try (ZipInputStream zis = new ZipInputStream(new EaglerInputStream(archiveContents))) {
|
||||||
ZipEntry f = null;
|
ZipEntry f = null;
|
||||||
int lastProgUpdate = 0;
|
int lastProgUpdate = 0;
|
||||||
int prog = 0;
|
int prog = 0;
|
||||||
|
@ -121,8 +121,8 @@ public class WorldConverterMCA {
|
||||||
prog += b.length;
|
prog += b.length;
|
||||||
} else if ((fileName.endsWith(".mcr") || fileName.endsWith(".mca")) && (fileName.startsWith("region/")
|
} else if ((fileName.endsWith(".mcr") || fileName.endsWith(".mca")) && (fileName.startsWith("region/")
|
||||||
|| fileName.startsWith("DIM1/region/") || fileName.startsWith("DIM-1/region/"))) {
|
|| fileName.startsWith("DIM1/region/") || fileName.startsWith("DIM-1/region/"))) {
|
||||||
VFile2 chunkFolder = new VFile2(worldDir,
|
VFile2 chunkFolder = new VFile2(worldDir, fileName.startsWith("DIM1") ? "level1"
|
||||||
fileName.startsWith("DIM1") ? "level1" : (fileName.startsWith("DIM-1") ? "level-1" : "level0"));
|
: (fileName.startsWith("DIM-1") ? "level-1" : "level0"));
|
||||||
RegionFile mca = new RegionFile(new RandomAccessMemoryFile(b, b.length));
|
RegionFile mca = new RegionFile(new RandomAccessMemoryFile(b, b.length));
|
||||||
int loadChunksCount = 0;
|
int loadChunksCount = 0;
|
||||||
for (int j = 0; j < 32; ++j) {
|
for (int j = 0; j < 32; ++j) {
|
||||||
|
@ -178,6 +178,7 @@ public class WorldConverterMCA {
|
||||||
EaglerIntegratedServerWorker.sendProgress("singleplayer.busy.importing.2", prog);
|
EaglerIntegratedServerWorker.sendProgress("singleplayer.busy.importing.2", prog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
logger.info("MCA was successfully extracted into directory \"{}\"", worldDir.getPath());
|
logger.info("MCA was successfully extracted into directory \"{}\"", worldDir.getPath());
|
||||||
String[] worldsTxt = EaglerSaveFormat.worldsList.getAllLines();
|
String[] worldsTxt = EaglerSaveFormat.worldsList.getAllLines();
|
||||||
if (worldsTxt == null || worldsTxt.length <= 0
|
if (worldsTxt == null || worldsTxt.length <= 0
|
||||||
|
@ -194,10 +195,10 @@ public class WorldConverterMCA {
|
||||||
|
|
||||||
public static byte[] exportWorld(String folderName) throws IOException {
|
public static byte[] exportWorld(String folderName) throws IOException {
|
||||||
EaglerOutputStream bao = new EaglerOutputStream();
|
EaglerOutputStream bao = new EaglerOutputStream();
|
||||||
ZipOutputStream zos = new ZipOutputStream(bao);
|
VFile2 worldFolder;
|
||||||
|
try (ZipOutputStream zos = new ZipOutputStream(bao)) {
|
||||||
zos.setComment("contains backup of world '" + folderName + "'");
|
zos.setComment("contains backup of world '" + folderName + "'");
|
||||||
VFile2 worldFolder = EaglerIntegratedServerWorker.saveFormat.getSaveLoader(folderName, false)
|
worldFolder = EaglerIntegratedServerWorker.saveFormat.getSaveLoader(folderName, false).getWorldDirectory();
|
||||||
.getWorldDirectory();
|
|
||||||
logger.info("Exporting world directory \"{}\" as MCA", worldFolder.getPath());
|
logger.info("Exporting world directory \"{}\" as MCA", worldFolder.getPath());
|
||||||
VFile2 vf = new VFile2(worldFolder, "level.dat");
|
VFile2 vf = new VFile2(worldFolder, "level.dat");
|
||||||
byte[] b;
|
byte[] b;
|
||||||
|
@ -317,7 +318,7 @@ public class WorldConverterMCA {
|
||||||
EaglerIntegratedServerWorker.sendProgress("singleplayer.busy.exporting.2", prog);
|
EaglerIntegratedServerWorker.sendProgress("singleplayer.busy.exporting.2", prog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
zos.close();
|
}
|
||||||
logger.info("World directory \"{}\" was successfully exported as MCA", worldFolder.getPath());
|
logger.info("World directory \"{}\" was successfully exported as MCA", worldFolder.getPath());
|
||||||
return bao.toByteArray();
|
return bao.toByteArray();
|
||||||
}
|
}
|
||||||
|
|
|
@ -257,9 +257,9 @@ public class IntegratedServerPlayerNetworkManager {
|
||||||
temporaryOutputStream.write((len >> 16) & 0xFF);
|
temporaryOutputStream.write((len >> 16) & 0xFF);
|
||||||
temporaryOutputStream.write((len >> 8) & 0xFF);
|
temporaryOutputStream.write((len >> 8) & 0xFF);
|
||||||
temporaryOutputStream.write(len & 0xFF);
|
temporaryOutputStream.write(len & 0xFF);
|
||||||
OutputStream os = EaglerZLIB.newDeflaterOutputStream(temporaryOutputStream);
|
try (OutputStream os = EaglerZLIB.newDeflaterOutputStream(temporaryOutputStream)) {
|
||||||
temporaryBuffer.readBytes(os, len);
|
temporaryBuffer.readBytes(os, len);
|
||||||
os.close();
|
}
|
||||||
compressedData = temporaryOutputStream.toByteArray();
|
compressedData = temporaryOutputStream.toByteArray();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.error("Failed to compress packet {}!", pkt.getClass().getSimpleName());
|
logger.error("Failed to compress packet {}!", pkt.getClass().getSimpleName());
|
||||||
|
|
|
@ -19,14 +19,21 @@ import net.minecraft.client.Minecraft;
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -64,7 +71,7 @@ public class RelayUpdateChecker {
|
||||||
for (net.lax1dude.eaglercraft.v1_8.sp.relay.RelayEntry etr : EagRuntime.getConfiguration().getRelays()) {
|
for (net.lax1dude.eaglercraft.v1_8.sp.relay.RelayEntry etr : EagRuntime.getConfiguration().getRelays()) {
|
||||||
relaysList.add(new RelayEntry(etr.address));
|
relaysList.add(new RelayEntry(etr.address));
|
||||||
}
|
}
|
||||||
byte[] b = PlatformApplication.getLocalStorage("lastRelayUpdate");
|
byte[] b = PlatformApplication.getLocalStorage("lastRelayUpdate", false);
|
||||||
if (b != null) {
|
if (b != null) {
|
||||||
try {
|
try {
|
||||||
lastUpdateCheck = (new DataInputStream(new EaglerInputStream(b))).readLong();
|
lastUpdateCheck = (new DataInputStream(new EaglerInputStream(b))).readLong();
|
||||||
|
@ -79,7 +86,7 @@ public class RelayUpdateChecker {
|
||||||
try {
|
try {
|
||||||
EaglerOutputStream bao = new EaglerOutputStream(8);
|
EaglerOutputStream bao = new EaglerOutputStream(8);
|
||||||
(new DataOutputStream(bao)).writeLong(lastUpdateCheck);
|
(new DataOutputStream(bao)).writeLong(lastUpdateCheck);
|
||||||
PlatformApplication.setLocalStorage("lastRelayUpdate", bao.toByteArray());
|
PlatformApplication.setLocalStorage("lastRelayUpdate", bao.toByteArray(), false);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
for (int i = 0, l = relaysList.size(); i < l; ++i) {
|
for (int i = 0, l = relaysList.size(); i < l; ++i) {
|
||||||
|
@ -125,7 +132,8 @@ public class RelayUpdateChecker {
|
||||||
} else if (socket.currentSocket.isOpen()) {
|
} else if (socket.currentSocket.isOpen()) {
|
||||||
if (!socket.handshake) {
|
if (!socket.handshake) {
|
||||||
socket.handshake = true;
|
socket.handshake = true;
|
||||||
socket.currentSocket.writePacket(new IPacket00Handshake(0x02, RelayManager.preferredRelayVersion, magic));
|
socket.currentSocket
|
||||||
|
.writePacket(new IPacket00Handshake(0x02, RelayManager.preferredRelayVersion, magic));
|
||||||
} else {
|
} else {
|
||||||
// close immediately
|
// close immediately
|
||||||
if (socket.currentSocket.nextPacket() != null) {
|
if (socket.currentSocket.nextPacket() != null) {
|
||||||
|
|
|
@ -19,14 +19,21 @@ import net.lax1dude.eaglercraft.v1_8.crypto.SHA256Digest;
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -37,6 +44,7 @@ public class UpdateCertificate {
|
||||||
|
|
||||||
public final String type;
|
public final String type;
|
||||||
public final String addr;
|
public final String addr;
|
||||||
|
|
||||||
private DLSource(String type, String addr) {
|
private DLSource(String type, String addr) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.addr = addr;
|
this.addr = addr;
|
||||||
|
@ -78,9 +86,11 @@ public class UpdateCertificate {
|
||||||
|
|
||||||
public final DLSource[] bundleDataSources;
|
public final DLSource[] bundleDataSources;
|
||||||
|
|
||||||
public static UpdateCertificate parseAndVerifyCertificate(byte[] certData) throws IOException, CertificateInvalidException {
|
public static UpdateCertificate parseAndVerifyCertificate(byte[] certData)
|
||||||
|
throws IOException, CertificateInvalidException {
|
||||||
InputStream is = new EaglerInputStream(certData);
|
InputStream is = new EaglerInputStream(certData);
|
||||||
if(is.read() != 'E' || is.read() != 'A' || is.read() != 'G' || is.read() != 'S' || is.read() != 'I' || is.read() != 'G') {
|
if (is.read() != 'E' || is.read() != 'A' || is.read() != 'G' || is.read() != 'S' || is.read() != 'I'
|
||||||
|
|| is.read() != 'G') {
|
||||||
throw new IOException("Data is not a certificate!");
|
throw new IOException("Data is not a certificate!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +103,8 @@ public class UpdateCertificate {
|
||||||
byte[] rsa2048sum = new byte[256];
|
byte[] rsa2048sum = new byte[256];
|
||||||
IOUtils.readFully(is, rsa2048sum);
|
IOUtils.readFully(is, rsa2048sum);
|
||||||
|
|
||||||
byte[] rsa2048sumDec = (new BigInteger(rsa2048sum)).modPow(new BigInteger("65537"), EaglercraftVersion.updateSignatureModulus).toByteArray();
|
byte[] rsa2048sumDec = (new BigInteger(rsa2048sum))
|
||||||
|
.modPow(new BigInteger("65537"), EaglercraftVersion.updateSignatureModulus).toByteArray();
|
||||||
|
|
||||||
if (rsa2048sumDec.length > 256) {
|
if (rsa2048sumDec.length > 256) {
|
||||||
throw new IOException("Invalid decrypted hash length: " + rsa2048sum.length);
|
throw new IOException("Invalid decrypted hash length: " + rsa2048sum.length);
|
||||||
|
@ -115,7 +126,8 @@ public class UpdateCertificate {
|
||||||
sha256.update(new byte[] { (byte) 170, (byte) 191, (byte) 203, (byte) 188, (byte) 47, (byte) 37, (byte) 17,
|
sha256.update(new byte[] { (byte) 170, (byte) 191, (byte) 203, (byte) 188, (byte) 47, (byte) 37, (byte) 17,
|
||||||
(byte) 187, (byte) 169, (byte) 225, (byte) 247, (byte) 193, (byte) 100, (byte) 101, (byte) 233,
|
(byte) 187, (byte) 169, (byte) 225, (byte) 247, (byte) 193, (byte) 100, (byte) 101, (byte) 233,
|
||||||
(byte) 106, (byte) 80, (byte) 204, (byte) 192, (byte) 140, (byte) 19, (byte) 18, (byte) 165, (byte) 252,
|
(byte) 106, (byte) 80, (byte) 204, (byte) 192, (byte) 140, (byte) 19, (byte) 18, (byte) 165, (byte) 252,
|
||||||
(byte) 138, (byte) 187, (byte) 229, (byte) 148, (byte) 118, (byte) 208, (byte) 179, (byte) 233 }, 0, 32);
|
(byte) 138, (byte) 187, (byte) 229, (byte) 148, (byte) 118, (byte) 208, (byte) 179, (byte) 233 }, 0,
|
||||||
|
32);
|
||||||
sha256.update(signaturePayload, 0, signaturePayload.length);
|
sha256.update(signaturePayload, 0, signaturePayload.length);
|
||||||
byte[] hash2048 = new byte[256];
|
byte[] hash2048 = new byte[256];
|
||||||
sha256.doFinal(hash2048, 0);
|
sha256.doFinal(hash2048, 0);
|
||||||
|
@ -148,7 +160,16 @@ public class UpdateCertificate {
|
||||||
throw new CertificateInvalidException("SHA256 checksum of signature payload is invalid!");
|
throw new CertificateInvalidException("SHA256 checksum of signature payload is invalid!");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new UpdateCertificate(certData, EaglerZLIB.newGZIPInputStream(new EaglerInputStream(signaturePayload)), vers);
|
UpdateCertificate cert;
|
||||||
|
try (InputStream gis = EaglerZLIB.newGZIPInputStream(new EaglerInputStream(signaturePayload))) {
|
||||||
|
cert = new UpdateCertificate(certData, gis, vers);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (System.currentTimeMillis() < cert.sigTimestamp) {
|
||||||
|
throw new CertificateInvalidException("Update certificate timestamp is from the future!?");
|
||||||
|
}
|
||||||
|
|
||||||
|
return cert;
|
||||||
}
|
}
|
||||||
|
|
||||||
private UpdateCertificate(byte[] certData, InputStream is, int sigVers) throws IOException {
|
private UpdateCertificate(byte[] certData, InputStream is, int sigVers) throws IOException {
|
||||||
|
|
|
@ -17,14 +17,21 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -58,12 +65,14 @@ public class UpdateService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
return o != null && (o == this || ((o instanceof RawKnownCertHolder) && Arrays.equals(((RawKnownCertHolder)o).data, data)));
|
return o != null && (o == this
|
||||||
|
|| ((o instanceof RawKnownCertHolder) && Arrays.equals(((RawKnownCertHolder) o).data, data)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean supported() {
|
public static boolean supported() {
|
||||||
return EaglercraftVersion.enableUpdateService && EagRuntime.getConfiguration().allowUpdateSvc() && PlatformUpdateSvc.supported();
|
return EaglercraftVersion.enableUpdateService && EagRuntime.getConfiguration().allowUpdateSvc()
|
||||||
|
&& PlatformUpdateSvc.supported();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initialize() {
|
public static void initialize() {
|
||||||
|
@ -77,10 +86,12 @@ public class UpdateService {
|
||||||
try {
|
try {
|
||||||
myUpdateCert = UpdateCertificate.parseAndVerifyCertificate(PlatformUpdateSvc.getClientSignatureData());
|
myUpdateCert = UpdateCertificate.parseAndVerifyCertificate(PlatformUpdateSvc.getClientSignatureData());
|
||||||
if (!EaglercraftVersion.updateBundlePackageName.equalsIgnoreCase(myUpdateCert.bundlePackageName)) {
|
if (!EaglercraftVersion.updateBundlePackageName.equalsIgnoreCase(myUpdateCert.bundlePackageName)) {
|
||||||
throw new CertificateInvalidException("Certificate package name does not match current client package name!");
|
throw new CertificateInvalidException(
|
||||||
|
"Certificate package name does not match current client package name!");
|
||||||
}
|
}
|
||||||
if (EaglercraftVersion.updateBundlePackageVersionInt != myUpdateCert.bundleVersionInteger) {
|
if (EaglercraftVersion.updateBundlePackageVersionInt != myUpdateCert.bundleVersionInteger) {
|
||||||
throw new CertificateInvalidException("Certificate client version does not match current client version!");
|
throw new CertificateInvalidException(
|
||||||
|
"Certificate client version does not match current client version!");
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
myUpdateCert = null;
|
myUpdateCert = null;
|
||||||
|
@ -90,11 +101,13 @@ public class UpdateService {
|
||||||
if (myUpdateCert != null && PlatformUpdateSvc.getClientBundleData() != null) {
|
if (myUpdateCert != null && PlatformUpdateSvc.getClientBundleData() != null) {
|
||||||
isBundleDataValid = myUpdateCert.isBundleDataValid(PlatformUpdateSvc.getClientBundleData());
|
isBundleDataValid = myUpdateCert.isBundleDataValid(PlatformUpdateSvc.getClientBundleData());
|
||||||
if (!isBundleDataValid) {
|
if (!isBundleDataValid) {
|
||||||
logger.error("Client checksum does not match certificate! \"Download Offline\" button will download a fresh client");
|
logger.error(
|
||||||
|
"Client checksum does not match certificate! \"Download Offline\" button will download a fresh client");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
byte[] latestUpdate = PlatformApplication.getLocalStorage(EaglercraftVersion.updateLatestLocalStorageKey);
|
byte[] latestUpdate = PlatformApplication.getLocalStorage(EaglercraftVersion.updateLatestLocalStorageKey,
|
||||||
|
false);
|
||||||
if (latestUpdate != null) {
|
if (latestUpdate != null) {
|
||||||
addCertificateToSet(latestUpdate, false);
|
addCertificateToSet(latestUpdate, false);
|
||||||
}
|
}
|
||||||
|
@ -127,11 +140,13 @@ public class UpdateService {
|
||||||
synchronized (availableUpdates) {
|
synchronized (availableUpdates) {
|
||||||
try {
|
try {
|
||||||
if (certificateData.length > 32767) {
|
if (certificateData.length > 32767) {
|
||||||
throw new CertificateInvalidException("Certificate is too large! (" + certificateData.length + " bytes)");
|
throw new CertificateInvalidException(
|
||||||
|
"Certificate is too large! (" + certificateData.length + " bytes)");
|
||||||
}
|
}
|
||||||
if (!fastUpdateKnownCheckSet.add(new RawKnownCertHolder(certificateData))) {
|
if (!fastUpdateKnownCheckSet.add(new RawKnownCertHolder(certificateData))) {
|
||||||
if (EagRuntime.getConfiguration().isLogInvalidCerts()) {
|
if (EagRuntime.getConfiguration().isLogInvalidCerts()) {
|
||||||
logger.info("Ignoring {} byte certificate that has already been processed", certificateData.length);
|
logger.info("Ignoring {} byte certificate that has already been processed",
|
||||||
|
certificateData.length);
|
||||||
}
|
}
|
||||||
freeMemory();
|
freeMemory();
|
||||||
return;
|
return;
|
||||||
|
@ -140,7 +155,8 @@ public class UpdateService {
|
||||||
if (EaglercraftVersion.updateBundlePackageName.equalsIgnoreCase(cert.bundlePackageName)) {
|
if (EaglercraftVersion.updateBundlePackageName.equalsIgnoreCase(cert.bundlePackageName)) {
|
||||||
if (myUpdateCert == null || !Arrays.equals(cert.bundleDataHash, myUpdateCert.bundleDataHash)) {
|
if (myUpdateCert == null || !Arrays.equals(cert.bundleDataHash, myUpdateCert.bundleDataHash)) {
|
||||||
if (availableUpdates.add(cert)) {
|
if (availableUpdates.add(cert)) {
|
||||||
logger.info("Found new update: {} - {}", cert.bundleDisplayName, cert.bundleDisplayVersion);
|
logger.info("Found new update: {} - {}", cert.bundleDisplayName,
|
||||||
|
cert.bundleDisplayVersion);
|
||||||
if (cert.bundleVersionInteger > EaglercraftVersion.updateBundlePackageVersionInt
|
if (cert.bundleVersionInteger > EaglercraftVersion.updateBundlePackageVersionInt
|
||||||
&& (latestUpdateFound == null
|
&& (latestUpdateFound == null
|
||||||
|| cert.bundleVersionInteger > latestUpdateFound.bundleVersionInteger
|
|| cert.bundleVersionInteger > latestUpdateFound.bundleVersionInteger
|
||||||
|
@ -149,12 +165,14 @@ public class UpdateService {
|
||||||
&& !dismissedUpdates.contains(cert)) {
|
&& !dismissedUpdates.contains(cert)) {
|
||||||
latestUpdateFound = cert;
|
latestUpdateFound = cert;
|
||||||
if (saveLatest) {
|
if (saveLatest) {
|
||||||
PlatformApplication.setLocalStorage(EaglercraftVersion.updateLatestLocalStorageKey,
|
PlatformApplication.setLocalStorage(
|
||||||
certificateData);
|
EaglercraftVersion.updateLatestLocalStorageKey,
|
||||||
|
certificateData, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (EagRuntime.getConfiguration().isLogInvalidCerts()) {
|
} else if (EagRuntime.getConfiguration().isLogInvalidCerts()) {
|
||||||
logger.info("Ignoring already indexed update: {} - {}", cert.bundleDisplayName, cert.bundleDisplayVersion);
|
logger.info("Ignoring already indexed update: {} - {}", cert.bundleDisplayName,
|
||||||
|
cert.bundleDisplayVersion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -166,7 +184,8 @@ public class UpdateService {
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
if (EagRuntime.getConfiguration().isLogInvalidCerts()) {
|
if (EagRuntime.getConfiguration().isLogInvalidCerts()) {
|
||||||
logger.error("Invalid update certificate recieved! The certificate may be from a different client");
|
logger.error(
|
||||||
|
"Invalid update certificate recieved! The certificate may be from a different client");
|
||||||
logger.error(t);
|
logger.error(t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -178,7 +197,9 @@ public class UpdateService {
|
||||||
if (fastUpdateKnownCheckSet.size() > 127) {
|
if (fastUpdateKnownCheckSet.size() > 127) {
|
||||||
List<RawKnownCertHolder> lst = new ArrayList(fastUpdateKnownCheckSet);
|
List<RawKnownCertHolder> lst = new ArrayList(fastUpdateKnownCheckSet);
|
||||||
fastUpdateKnownCheckSet.clear();
|
fastUpdateKnownCheckSet.clear();
|
||||||
lst.sort((c1, c2) -> { return (int)(c2.age - c1.age); });
|
lst.sort((c1, c2) -> {
|
||||||
|
return (int) (c2.age - c1.age);
|
||||||
|
});
|
||||||
for (int i = 0; i < 64; ++i) {
|
for (int i = 0; i < 64; ++i) {
|
||||||
fastUpdateKnownCheckSet.add(lst.get(i));
|
fastUpdateKnownCheckSet.add(lst.get(i));
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ import net.hoosiertransfer.Config;
|
||||||
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.Display;
|
import net.lax1dude.eaglercraft.v1_8.Display;
|
||||||
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.EagUtils;
|
||||||
import net.lax1dude.eaglercraft.v1_8.EaglerXBungeeVersion;
|
import net.lax1dude.eaglercraft.v1_8.EaglerXBungeeVersion;
|
||||||
import net.lax1dude.eaglercraft.v1_8.HString;
|
import net.lax1dude.eaglercraft.v1_8.HString;
|
||||||
import net.lax1dude.eaglercraft.v1_8.IOUtils;
|
import net.lax1dude.eaglercraft.v1_8.IOUtils;
|
||||||
|
@ -819,8 +820,18 @@ public class Minecraft implements IThreadListener {
|
||||||
long l = System.nanoTime();
|
long l = System.nanoTime();
|
||||||
this.mcProfiler.startSection("tick");
|
this.mcProfiler.startSection("tick");
|
||||||
|
|
||||||
|
if (this.timer.elapsedTicks > 1) {
|
||||||
|
long watchdog = System.currentTimeMillis();
|
||||||
for (int j = 0; j < this.timer.elapsedTicks; ++j) {
|
for (int j = 0; j < this.timer.elapsedTicks; ++j) {
|
||||||
this.runTick();
|
this.runTick();
|
||||||
|
long millis = System.currentTimeMillis();
|
||||||
|
if (millis - watchdog > 50l) {
|
||||||
|
watchdog = millis;
|
||||||
|
EagUtils.sleep(0l);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (this.timer.elapsedTicks == 1) {
|
||||||
|
this.runTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mcProfiler.endStartSection("preRenderErrors");
|
this.mcProfiler.endStartSection("preRenderErrors");
|
||||||
|
@ -907,7 +918,11 @@ public class Minecraft implements IThreadListener {
|
||||||
|
|
||||||
public void updateDisplay() {
|
public void updateDisplay() {
|
||||||
this.mcProfiler.startSection("display_update");
|
this.mcProfiler.startSection("display_update");
|
||||||
|
if (Display.isVSyncSupported()) {
|
||||||
Display.setVSync(this.gameSettings.enableVsync);
|
Display.setVSync(this.gameSettings.enableVsync);
|
||||||
|
} else {
|
||||||
|
this.gameSettings.enableVsync = false;
|
||||||
|
}
|
||||||
Display.update();
|
Display.update();
|
||||||
this.mcProfiler.endSection();
|
this.mcProfiler.endSection();
|
||||||
this.checkWindowResize();
|
this.checkWindowResize();
|
||||||
|
|
|
@ -59,6 +59,7 @@ import net.minecraft.util.ResourceLocation;
|
||||||
*/
|
*/
|
||||||
public class SoundHandler implements IResourceManagerReloadListener, ITickable {
|
public class SoundHandler implements IResourceManagerReloadListener, ITickable {
|
||||||
private static final Logger logger = LogManager.getLogger();
|
private static final Logger logger = LogManager.getLogger();
|
||||||
|
private static final Logger tipLogger = LogManager.getLogger("EaglercraftX");
|
||||||
public static final SoundPoolEntry missing_sound = new SoundPoolEntry(new ResourceLocation("meta:missing_sound"),
|
public static final SoundPoolEntry missing_sound = new SoundPoolEntry(new ResourceLocation("meta:missing_sound"),
|
||||||
0.0D, 0.0D, false);
|
0.0D, 0.0D, false);
|
||||||
private final SoundRegistry sndRegistry = new SoundRegistry();
|
private final SoundRegistry sndRegistry = new SoundRegistry();
|
||||||
|
@ -84,6 +85,12 @@ public class SoundHandler implements IResourceManagerReloadListener, ITickable {
|
||||||
this.loadSoundResource(new ResourceLocation(s, (String) entry.getKey()),
|
this.loadSoundResource(new ResourceLocation(s, (String) entry.getKey()),
|
||||||
(SoundList) entry.getValue());
|
(SoundList) entry.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.sndRegistry
|
||||||
|
.getObject(new ResourceLocation("minecraft:sounds/music/game/calm1.ogg")) == null) {
|
||||||
|
tipLogger.info(
|
||||||
|
"Download this resource pack if you want music: https://bafybeiayojww5jfyzvlmtuk7l5ufkt7nlfto7mhwmzf2vs4bvsjd5ouiuq.ipfs.nftstorage.link/?filename=Music_For_Eaglercraft.zip");
|
||||||
|
}
|
||||||
} catch (RuntimeException runtimeexception) {
|
} catch (RuntimeException runtimeexception) {
|
||||||
logger.warn("Invalid sounds.json", runtimeexception);
|
logger.warn("Invalid sounds.json", runtimeexception);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
package net.minecraft.client.gui;
|
package net.minecraft.client.gui;
|
||||||
|
|
||||||
import net.minecraft.client.settings.GameSettings;
|
import net.minecraft.client.settings.GameSettings;
|
||||||
import net.minecraft.client.settings.KeyBinding;
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
|
|
||||||
|
@ -14,7 +15,8 @@ public class GuiClientSettings extends GuiScreen {
|
||||||
this.options = settings;
|
this.options = settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Adds the buttons (and other controls) to the screen in
|
* Adds the buttons (and other controls) to the screen in
|
||||||
* question. Called when the GUI is displayed and when the
|
* question. Called when the GUI is displayed and when the
|
||||||
* window resizes, the buttonList is cleared beforehand.
|
* window resizes, the buttonList is cleared beforehand.
|
||||||
|
@ -30,14 +32,11 @@ public class GuiClientSettings extends GuiScreen {
|
||||||
this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20,
|
this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20,
|
||||||
this.options.getKeyBinding(GameSettings.Options.ENABLE_SOUND)));
|
this.options.getKeyBinding(GameSettings.Options.ENABLE_SOUND)));
|
||||||
++i;
|
++i;
|
||||||
this.buttonList.add(new GuiButton(GameSettings.Options.SKIP_SOME_RENDERING.returnEnumOrdinal(),
|
|
||||||
this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20,
|
|
||||||
this.options.getKeyBinding(GameSettings.Options.SKIP_SOME_RENDERING)));
|
|
||||||
++i;
|
|
||||||
this.buttonList.add(new GuiButton(GameSettings.Options.DISABLE_ALPHA.returnEnumOrdinal(),
|
this.buttonList.add(new GuiButton(GameSettings.Options.DISABLE_ALPHA.returnEnumOrdinal(),
|
||||||
this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20,
|
this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20,
|
||||||
this.options.getKeyBinding(GameSettings.Options.DISABLE_ALPHA)));
|
this.options.getKeyBinding(GameSettings.Options.DISABLE_ALPHA)));
|
||||||
++i;
|
++i;
|
||||||
|
++i;
|
||||||
this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 24 * (i >> 1),
|
this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 24 * (i >> 1),
|
||||||
I18n.format("gui.done", new Object[0])));
|
I18n.format("gui.done", new Object[0])));
|
||||||
}
|
}
|
||||||
|
@ -58,11 +57,6 @@ public class GuiClientSettings extends GuiScreen {
|
||||||
parGuiButton.displayString = this.options.getKeyBinding(GameSettings.Options.ENABLE_SOUND);
|
parGuiButton.displayString = this.options.getKeyBinding(GameSettings.Options.ENABLE_SOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parGuiButton.id == GameSettings.Options.SKIP_SOME_RENDERING.returnEnumOrdinal()) {
|
|
||||||
this.options.setOptionValue(GameSettings.Options.SKIP_SOME_RENDERING, 1);
|
|
||||||
parGuiButton.displayString = this.options.getKeyBinding(GameSettings.Options.SKIP_SOME_RENDERING);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parGuiButton.id == GameSettings.Options.DISABLE_ALPHA.returnEnumOrdinal()) {
|
if (parGuiButton.id == GameSettings.Options.DISABLE_ALPHA.returnEnumOrdinal()) {
|
||||||
this.options.setOptionValue(GameSettings.Options.DISABLE_ALPHA, 1);
|
this.options.setOptionValue(GameSettings.Options.DISABLE_ALPHA, 1);
|
||||||
parGuiButton.displayString = this.options.getKeyBinding(GameSettings.Options.DISABLE_ALPHA);
|
parGuiButton.displayString = this.options.getKeyBinding(GameSettings.Options.DISABLE_ALPHA);
|
||||||
|
|
|
@ -55,10 +55,6 @@ public class GuiDisconnected extends GuiScreen {
|
||||||
this.parentScreen = screen;
|
this.parentScreen = screen;
|
||||||
this.reason = I18n.format(reasonLocalizationKey, new Object[0]);
|
this.reason = I18n.format(reasonLocalizationKey, new Object[0]);
|
||||||
this.message = chatComp;
|
this.message = chatComp;
|
||||||
if (reason.toLowerCase().contains("banned from this server")) {
|
|
||||||
EaglerProfile.updateUsernameCookies();
|
|
||||||
reloadPage();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reason.toLowerCase().contains("reload page")) {
|
if (reason.toLowerCase().contains("reload page")) {
|
||||||
EaglerProfile.updateUsernameCookieFromLocalStorage();
|
EaglerProfile.updateUsernameCookieFromLocalStorage();
|
||||||
|
|
|
@ -1039,7 +1039,7 @@ public class GuiIngame extends Gui {
|
||||||
ent.prevRenderYawOffset = f5;
|
ent.prevRenderYawOffset = f5;
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
RenderHelper.disableStandardItemLighting();
|
RenderHelper.disableStandardItemLighting();
|
||||||
GlStateManager.disableDepth();
|
// GlStateManager.disableDepth();
|
||||||
GlStateManager.disableRescaleNormal();
|
GlStateManager.disableRescaleNormal();
|
||||||
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
|
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
|
||||||
GlStateManager.disableTexture2D();
|
GlStateManager.disableTexture2D();
|
||||||
|
|
|
@ -38,6 +38,7 @@ import net.lax1dude.eaglercraft.v1_8.update.UpdateCertificate;
|
||||||
import net.lax1dude.eaglercraft.v1_8.update.UpdateService;
|
import net.lax1dude.eaglercraft.v1_8.update.UpdateService;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||||
|
import net.minecraft.client.multiplayer.ServerData;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.texture.DynamicTexture;
|
import net.minecraft.client.renderer.texture.DynamicTexture;
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
|
@ -286,7 +287,8 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback {
|
||||||
*/
|
*/
|
||||||
private void addSingleplayerMultiplayerButtons(int parInt1, int parInt2) {
|
private void addSingleplayerMultiplayerButtons(int parInt1, int parInt2) {
|
||||||
this.buttonList
|
this.buttonList
|
||||||
.add(new GuiButton(1, this.width / 2 - 100, parInt1, I18n.format("menu.singleplayer", new Object[0])));
|
.add(new GuiButton(1, this.width / 2 - 100, parInt1,
|
||||||
|
I18n.format("menu.singleplayer", new Object[0])));
|
||||||
this.buttonList.add(new GuiButton(2, this.width / 2 - 100, parInt1 + parInt2 * 1,
|
this.buttonList.add(new GuiButton(2, this.width / 2 - 100, parInt1 + parInt2 * 1,
|
||||||
I18n.format("menu.multiplayer", new Object[0])));
|
I18n.format("menu.multiplayer", new Object[0])));
|
||||||
if (EaglercraftVersion.mainMenuEnableGithubButton) {
|
if (EaglercraftVersion.mainMenuEnableGithubButton) {
|
||||||
|
@ -567,10 +569,12 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback {
|
||||||
|| (this.openGLWarning2 != null && this.openGLWarning2.length() > 0));
|
|| (this.openGLWarning2 != null && this.openGLWarning2.length() > 0));
|
||||||
|
|
||||||
if (isForkLabel) {
|
if (isForkLabel) {
|
||||||
drawRect(this.field_92022_t - 3, this.field_92021_u - 3, this.field_92020_v + 3, this.field_92019_w,
|
drawRect(this.field_92022_t - 3, this.field_92021_u - 3, this.field_92020_v + 3,
|
||||||
|
this.field_92019_w,
|
||||||
1428160512);
|
1428160512);
|
||||||
if (this.openGLWarning1 != null)
|
if (this.openGLWarning1 != null)
|
||||||
this.drawString(this.fontRendererObj, this.openGLWarning1, this.field_92022_t, this.field_92021_u, -1);
|
this.drawString(this.fontRendererObj, this.openGLWarning1, this.field_92022_t, this.field_92021_u,
|
||||||
|
-1);
|
||||||
if (this.openGLWarning2 != null)
|
if (this.openGLWarning2 != null)
|
||||||
this.drawString(this.fontRendererObj, this.openGLWarning2, (this.width - this.field_92024_r) / 2,
|
this.drawString(this.fontRendererObj, this.openGLWarning2, (this.width - this.field_92024_r) / 2,
|
||||||
this.field_92021_u + 12, -1);
|
this.field_92021_u + 12, -1);
|
||||||
|
|
|
@ -396,7 +396,7 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void connectToServer(ServerData server) {
|
public void connectToServer(ServerData server) {
|
||||||
this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, server));
|
this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, server));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ import net.lax1dude.eaglercraft.v1_8.socket.RateLimitTracker;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.GuiDisconnected;
|
import net.minecraft.client.gui.GuiDisconnected;
|
||||||
|
import net.minecraft.client.gui.GuiMainMenu;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.network.NetHandlerPlayClient;
|
import net.minecraft.client.network.NetHandlerPlayClient;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
|
@ -239,7 +240,7 @@ public class GuiConnecting extends GuiScreen {
|
||||||
this.networkManager.closeChannel(new ChatComponentText("Aborted"));
|
this.networkManager.closeChannel(new ChatComponentText("Aborted"));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mc.displayGuiScreen(this.previousGuiScreen);
|
this.mc.displayGuiScreen(new GuiMainMenu());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -276,17 +276,14 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
||||||
if (this.mc.getRenderViewEntity() == null) {
|
if (this.mc.getRenderViewEntity() == null) {
|
||||||
this.mc.setRenderViewEntity(this.mc.thePlayer);
|
this.mc.setRenderViewEntity(this.mc.thePlayer);
|
||||||
}
|
}
|
||||||
if (!Config.skipRenderUpdate()) {
|
|
||||||
float f3 = this.mc.theWorld.getLightBrightness(
|
float f3 = this.mc.theWorld.getLightBrightness(
|
||||||
DeferredStateManager.isDeferredRenderer() ? new BlockPos(this.mc.getRenderViewEntity()).up()
|
DeferredStateManager.isDeferredRenderer() ? new BlockPos(this.mc.getRenderViewEntity()).up()
|
||||||
: new BlockPos(this.mc.getRenderViewEntity()));
|
: new BlockPos(this.mc.getRenderViewEntity()));
|
||||||
float f4 = (float) this.mc.gameSettings.renderDistanceChunks / 32.0F;
|
float f4 = (float) this.mc.gameSettings.renderDistanceChunks / 32.0F;
|
||||||
float f2 = f3 * (1.0F - f4) + f4;
|
float f2 = f3 * (1.0F - f4) + f4;
|
||||||
this.fogColor1 += (f2 - this.fogColor1) * 0.1F;
|
this.fogColor1 += (f2 - this.fogColor1) * 0.1F;
|
||||||
}
|
|
||||||
++this.rendererUpdateCount;
|
++this.rendererUpdateCount;
|
||||||
this.addRainParticles();
|
this.addRainParticles();
|
||||||
if (!Config.skipRenderUpdate()) {
|
|
||||||
this.itemRenderer.updateEquippedItem();
|
this.itemRenderer.updateEquippedItem();
|
||||||
this.bossColorModifierPrev = this.bossColorModifier;
|
this.bossColorModifierPrev = this.bossColorModifier;
|
||||||
if (BossStatus.hasColorModifier) {
|
if (BossStatus.hasColorModifier) {
|
||||||
|
@ -300,7 +297,6 @@ public class EntityRenderer implements IResourceManagerReloadListener {
|
||||||
this.bossColorModifier -= 0.0125F;
|
this.bossColorModifier -= 0.0125F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void updateShaderGroupSize(int width, int height) {
|
public void updateShaderGroupSize(int width, int height) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.util.Map;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||||
import net.hoosiertransfer.Config;
|
import net.hoosiertransfer.Config;
|
||||||
import net.hoosiertransfer.CullingMod;
|
import net.hoosiertransfer.CullingMod;
|
||||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||||
|
@ -28,7 +29,6 @@ import net.minecraft.client.model.ModelSlime;
|
||||||
import net.minecraft.client.model.ModelSquid;
|
import net.minecraft.client.model.ModelSquid;
|
||||||
import net.minecraft.client.model.ModelWolf;
|
import net.minecraft.client.model.ModelWolf;
|
||||||
import net.minecraft.client.model.ModelZombie;
|
import net.minecraft.client.model.ModelZombie;
|
||||||
import net.minecraft.client.renderer.EntityRenderer;
|
|
||||||
import net.minecraft.client.renderer.RenderGlobal;
|
import net.minecraft.client.renderer.RenderGlobal;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.culling.ICamera;
|
import net.minecraft.client.renderer.culling.ICamera;
|
||||||
|
@ -231,6 +231,12 @@ public class RenderManager {
|
||||||
this.skinMap.put("default", this.playerRenderer);
|
this.skinMap.put("default", this.playerRenderer);
|
||||||
this.skinMap.put("slim", new RenderPlayer(this, true, false));
|
this.skinMap.put("slim", new RenderPlayer(this, true, false));
|
||||||
this.skinMap.put("zombie", new RenderPlayer(this, false, true));
|
this.skinMap.put("zombie", new RenderPlayer(this, false, true));
|
||||||
|
if (EagRuntime.getConfiguration().isAllowFNAWSkins()) {
|
||||||
|
this.eaglerRenderer = new RenderHighPoly(this, this.playerRenderer.getMainModel(),
|
||||||
|
this.playerRenderer.shadowSize);
|
||||||
|
} else {
|
||||||
|
this.eaglerRenderer = this.playerRenderer;
|
||||||
|
}
|
||||||
this.eaglerRenderer = new RenderHighPoly(this, this.playerRenderer.getMainModel(),
|
this.eaglerRenderer = new RenderHighPoly(this, this.playerRenderer.getMainModel(),
|
||||||
this.playerRenderer.shadowSize);
|
this.playerRenderer.shadowSize);
|
||||||
this.skinMap.put("eagler",
|
this.skinMap.put("eagler",
|
||||||
|
|
|
@ -34,7 +34,6 @@ public class LayerElytra implements LayerRenderer<AbstractClientPlayer> {
|
||||||
GlStateManager.enableBlend();
|
GlStateManager.enableBlend();
|
||||||
this.renderPlayer.bindTexture(TEXTURE_ELYTRA);
|
this.renderPlayer.bindTexture(TEXTURE_ELYTRA);
|
||||||
|
|
||||||
// GlStateManager.pushMatrix();
|
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
GlStateManager.translate(0.0F, 0.0F, 0.125F);
|
GlStateManager.translate(0.0F, 0.0F, 0.125F);
|
||||||
this.modelElytra.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw,
|
this.modelElytra.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw,
|
||||||
|
@ -43,15 +42,6 @@ public class LayerElytra implements LayerRenderer<AbstractClientPlayer> {
|
||||||
this.modelElytra.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw,
|
this.modelElytra.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw,
|
||||||
headPitch,
|
headPitch,
|
||||||
scale);
|
scale);
|
||||||
|
|
||||||
if (itemstack.isItemEnchanted()) {
|
|
||||||
LayerArmorBase.renderEnchantedGlint(this.renderPlayer, entitylivingbaseIn,
|
|
||||||
this.modelElytra, limbSwing,
|
|
||||||
limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch,
|
|
||||||
scale);
|
|
||||||
DeferredStateManager.setHDRTranslucentPassBlendFunc();
|
|
||||||
}
|
|
||||||
// GlStateManager.popMatrix();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,8 +231,6 @@ public class GameSettings {
|
||||||
|
|
||||||
public boolean disableAlpha = false;
|
public boolean disableAlpha = false;
|
||||||
|
|
||||||
public boolean skipHandRender = false;
|
|
||||||
|
|
||||||
public GameSettings(Minecraft mcIn) {
|
public GameSettings(Minecraft mcIn) {
|
||||||
this.keyBindings = (KeyBinding[]) ArrayUtils.addAll(new KeyBinding[] { this.keyBindAttack, this.keyBindUseItem,
|
this.keyBindings = (KeyBinding[]) ArrayUtils.addAll(new KeyBinding[] { this.keyBindAttack, this.keyBindUseItem,
|
||||||
this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump,
|
this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump,
|
||||||
|
@ -368,10 +366,6 @@ public class GameSettings {
|
||||||
* through the list i.e. render distances.
|
* through the list i.e. render distances.
|
||||||
*/
|
*/
|
||||||
public void setOptionValue(GameSettings.Options parOptions, int parInt1) {
|
public void setOptionValue(GameSettings.Options parOptions, int parInt1) {
|
||||||
if (parOptions == GameSettings.Options.SKIP_SOME_RENDERING) {
|
|
||||||
this.skipHandRender = !this.skipHandRender;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parOptions == GameSettings.Options.DISABLE_ALPHA) {
|
if (parOptions == GameSettings.Options.DISABLE_ALPHA) {
|
||||||
this.disableAlpha = !this.disableAlpha;
|
this.disableAlpha = !this.disableAlpha;
|
||||||
}
|
}
|
||||||
|
@ -547,8 +541,6 @@ public class GameSettings {
|
||||||
|
|
||||||
public boolean getOptionOrdinalValue(GameSettings.Options parOptions) {
|
public boolean getOptionOrdinalValue(GameSettings.Options parOptions) {
|
||||||
switch (parOptions) {
|
switch (parOptions) {
|
||||||
case SKIP_SOME_RENDERING:
|
|
||||||
return this.skipHandRender;
|
|
||||||
case DISABLE_ALPHA:
|
case DISABLE_ALPHA:
|
||||||
return this.disableAlpha;
|
return this.disableAlpha;
|
||||||
case ENABLE_SOUND:
|
case ENABLE_SOUND:
|
||||||
|
@ -705,10 +697,6 @@ public class GameSettings {
|
||||||
return flag ? "Hide Password: " + I18n.format("options.on", new Object[0])
|
return flag ? "Hide Password: " + I18n.format("options.on", new Object[0])
|
||||||
: "Hide Password: " + I18n.format("options.off", new Object[0]);
|
: "Hide Password: " + I18n.format("options.off", new Object[0]);
|
||||||
}
|
}
|
||||||
if (parOptions == GameSettings.Options.SKIP_SOME_RENDERING) {
|
|
||||||
return flag ? "Skip Some Rendering: " + I18n.format("options.on", new Object[0])
|
|
||||||
: "Skip Some Rendering: " + I18n.format("options.off", new Object[0]);
|
|
||||||
}
|
|
||||||
if (parOptions == GameSettings.Options.DISABLE_ALPHA) {
|
if (parOptions == GameSettings.Options.DISABLE_ALPHA) {
|
||||||
return !flag ? "Render Alpha: " + I18n.format("options.on", new Object[0])
|
return !flag ? "Render Alpha: " + I18n.format("options.on", new Object[0])
|
||||||
: "Render Alpha: " + I18n.format("options.off", new Object[0]);
|
: "Render Alpha: " + I18n.format("options.off", new Object[0]);
|
||||||
|
@ -776,10 +764,6 @@ public class GameSettings {
|
||||||
this.mouseSensitivity = this.parseFloat(astring[1]);
|
this.mouseSensitivity = this.parseFloat(astring[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (astring[0].equals("skipHandRender")) {
|
|
||||||
this.skipHandRender = astring[1].equals("true");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (astring[0].equals("disableAlpha")) {
|
if (astring[0].equals("disableAlpha")) {
|
||||||
this.disableAlpha = astring[1].equals("true");
|
this.disableAlpha = astring[1].equals("true");
|
||||||
}
|
}
|
||||||
|
@ -1173,7 +1157,6 @@ public class GameSettings {
|
||||||
}
|
}
|
||||||
printwriter.println("hidePassword:" + this.hidePassword);
|
printwriter.println("hidePassword:" + this.hidePassword);
|
||||||
printwriter.println("enableSound:" + this.getOptionOrdinalValue(GameSettings.Options.ENABLE_SOUND));
|
printwriter.println("enableSound:" + this.getOptionOrdinalValue(GameSettings.Options.ENABLE_SOUND));
|
||||||
printwriter.println("skipHandRender:" + this.skipHandRender);
|
|
||||||
printwriter.println("disableAlpha:" + this.disableAlpha);
|
printwriter.println("disableAlpha:" + this.disableAlpha);
|
||||||
|
|
||||||
printwriter.println("resourcePacks:" + toJSONArray(this.resourcePacks));
|
printwriter.println("resourcePacks:" + toJSONArray(this.resourcePacks));
|
||||||
|
@ -1325,8 +1308,8 @@ public class GameSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum Options {
|
public static enum Options {
|
||||||
DISABLE_ALPHA("options.alpha", false, true), SKIP_SOME_RENDERING("options.skipHandRender", false, true),
|
DISABLE_ALPHA("options.alpha", false, true), INVERT_MOUSE("options.invertMouse", false, true),
|
||||||
INVERT_MOUSE("options.invertMouse", false, true), SENSITIVITY("options.sensitivity", true, false),
|
SENSITIVITY("options.sensitivity", true, false),
|
||||||
FOV("options.fov", true, false, 30.0F, 110.0F, 1.0F), GAMMA("options.gamma", true, false),
|
FOV("options.fov", true, false, 30.0F, 110.0F, 1.0F), GAMMA("options.gamma", true, false),
|
||||||
SATURATION("options.saturation", true, false),
|
SATURATION("options.saturation", true, false),
|
||||||
RENDER_SCALE("options.renderScale", true, false, 40.0F, 100.0F, 1.0F),
|
RENDER_SCALE("options.renderScale", true, false, 40.0F, 100.0F, 1.0F),
|
||||||
|
|
|
@ -868,7 +868,7 @@ public abstract class ServerConfigurationManager {
|
||||||
|
|
||||||
worldIn.theItemInWorldManager.initializeGameType(parWorld.getWorldInfo().getGameType());
|
worldIn.theItemInWorldManager.initializeGameType(parWorld.getWorldInfo().getGameType());
|
||||||
} else {
|
} else {
|
||||||
parEntityPlayerMP2.theItemInWorldManager.setGameType(lanGamemode);
|
worldIn.theItemInWorldManager.setGameType(lanGamemode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,14 +29,21 @@ import net.lax1dude.eaglercraft.v1_8.internal.teavm.TeaVMUtils;
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -88,31 +95,61 @@ public class PlatformApplication {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@JSBody(params = { "cb" }, script = "if(!window.navigator.clipboard || !window.navigator.clipboard.readText) cb(\"\"); else window.navigator.clipboard.readText().then(function(s) { cb(s); }, function(s) { cb(\"\"); });")
|
@JSBody(params = {
|
||||||
|
"cb" }, script = "if(!window.navigator.clipboard || !window.navigator.clipboard.readText) cb(\"\"); else window.navigator.clipboard.readText().then(function(s) { cb(s); }, function(s) { cb(\"\"); });")
|
||||||
private static native void getClipboard1(StupidFunctionResolveString cb);
|
private static native void getClipboard1(StupidFunctionResolveString cb);
|
||||||
|
|
||||||
@JSBody(params = { "str" }, script = "if(window.navigator.clipboard) window.navigator.clipboard.writeText(str);")
|
@JSBody(params = { "str" }, script = "if(window.navigator.clipboard) window.navigator.clipboard.writeText(str);")
|
||||||
private static native void setClipboard0(String str);
|
private static native void setClipboard0(String str);
|
||||||
|
|
||||||
public static void setLocalStorage(String name, byte[] data) {
|
public static void setLocalStorage(String name, byte[] data) {
|
||||||
|
setLocalStorage(name, data, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setLocalStorage(String name, byte[] data, boolean hooks) {
|
||||||
|
IClientConfigAdapter adapter = PlatformRuntime.getClientConfigAdapter();
|
||||||
|
String eagName = adapter.getLocalStorageNamespace() + "." + name;
|
||||||
|
String b64 = Base64.encodeBase64String(data);
|
||||||
try {
|
try {
|
||||||
Storage s = Window.current().getLocalStorage();
|
Storage s = Window.current().getLocalStorage();
|
||||||
if (s != null) {
|
if (s != null) {
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
s.setItem("_eaglercraftX." + name, Base64.encodeBase64String(data));
|
s.setItem(eagName, b64);
|
||||||
} else {
|
} else {
|
||||||
s.removeItem("_eaglercraftX." + name);
|
s.removeItem(eagName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
}
|
}
|
||||||
|
if (hooks) {
|
||||||
|
adapter.getHooks().callLocalStorageSavedHook(name, b64);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] getLocalStorage(String name) {
|
public static byte[] getLocalStorage(String name) {
|
||||||
|
return getLocalStorage(name, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static byte[] getLocalStorage(String name, boolean hooks) {
|
||||||
|
IClientConfigAdapter adapter = PlatformRuntime.getClientConfigAdapter();
|
||||||
|
String eagName = adapter.getLocalStorageNamespace() + "." + name;
|
||||||
|
byte[] hooked = null;
|
||||||
|
if (hooks) {
|
||||||
|
String hookedStr = adapter.getHooks().callLocalStorageLoadHook(eagName);
|
||||||
|
if (hookedStr != null) {
|
||||||
|
try {
|
||||||
|
hooked = Base64.decodeBase64(hookedStr);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
PlatformRuntime.logger.error("Invalid Base64 recieved from local storage hook!");
|
||||||
|
hooked = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (hooked == null) {
|
||||||
try {
|
try {
|
||||||
Storage s = Window.current().getLocalStorage();
|
Storage s = Window.current().getLocalStorage();
|
||||||
if (s != null) {
|
if (s != null) {
|
||||||
String str = s.getItem("_eaglercraftX." + name);
|
String str = s.getItem(eagName);
|
||||||
if (str != null) {
|
if (str != null) {
|
||||||
return Base64.decodeBase64(str);
|
return Base64.decodeBase64(str);
|
||||||
} else {
|
} else {
|
||||||
|
@ -124,9 +161,13 @@ public class PlatformApplication {
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final DateFormat dateFormatSS = EagRuntime.fixDateFormat(new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss"));
|
private static final DateFormat dateFormatSS = EagRuntime
|
||||||
|
.fixDateFormat(new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss"));
|
||||||
|
|
||||||
public static String saveScreenshot() {
|
public static String saveScreenshot() {
|
||||||
String name = "screenshot_" + dateFormatSS.format(new Date()).toString() + ".png";
|
String name = "screenshot_" + dateFormatSS.format(new Date()).toString() + ".png";
|
||||||
|
@ -141,7 +182,8 @@ public class PlatformApplication {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JSBody(params = { "name", "cvs" }, script = "var a=document.createElement(\"a\");a.href=cvs.toDataURL(\"image/png\");a.download=name;a.click();")
|
@JSBody(params = { "name",
|
||||||
|
"cvs" }, script = "var a=document.createElement(\"a\");a.href=cvs.toDataURL(\"image/png\");a.download=name;a.click();")
|
||||||
private static native void saveScreenshot(String name, HTMLCanvasElement cvs);
|
private static native void saveScreenshot(String name, HTMLCanvasElement cvs);
|
||||||
|
|
||||||
public static void showPopup(final String msg) {
|
public static void showPopup(final String msg) {
|
||||||
|
@ -168,7 +210,8 @@ public class PlatformApplication {
|
||||||
if (name == null) {
|
if (name == null) {
|
||||||
fileChooserResultObject = null;
|
fileChooserResultObject = null;
|
||||||
} else {
|
} else {
|
||||||
fileChooserResultObject = new FileChooserResult(name, TeaVMUtils.wrapUnsignedByteArray(Uint8Array.create(buffer)));
|
fileChooserResultObject = new FileChooserResult(name,
|
||||||
|
TeaVMUtils.wrapUnsignedByteArray(Uint8Array.create(buffer)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,8 +220,7 @@ public class PlatformApplication {
|
||||||
private static volatile boolean fileChooserHasResult = false;
|
private static volatile boolean fileChooserHasResult = false;
|
||||||
private static volatile FileChooserResult fileChooserResultObject = null;
|
private static volatile FileChooserResult fileChooserResultObject = null;
|
||||||
|
|
||||||
@JSBody(params = { "inputElement", "callback" }, script =
|
@JSBody(params = { "inputElement", "callback" }, script = "if(inputElement.files.length > 0) {"
|
||||||
"if(inputElement.files.length > 0) {"
|
|
||||||
+ "const value = inputElement.files[0];"
|
+ "const value = inputElement.files[0];"
|
||||||
+ "value.arrayBuffer().then(function(arr){ callback(value.name, arr); })"
|
+ "value.arrayBuffer().then(function(arr){ callback(value.name, arr); })"
|
||||||
+ ".catch(function(){ callback(null, null); });"
|
+ ".catch(function(){ callback(null, null); });"
|
||||||
|
@ -238,7 +280,8 @@ public class PlatformApplication {
|
||||||
int x = (currentWin.getScreen().getWidth() - w) / 2;
|
int x = (currentWin.getScreen().getWidth() - w) / 2;
|
||||||
int y = (currentWin.getScreen().getHeight() - h) / 2;
|
int y = (currentWin.getScreen().getHeight() - h) / 2;
|
||||||
|
|
||||||
Window newWin = Window.current().open("", "_blank", "top=" + y + ",left=" + x + ",width=" + w + ",height=" + h + ",menubar=0,status=0,titlebar=0,toolbar=0");
|
Window newWin = Window.current().open("", "_blank", "top=" + y + ",left=" + x + ",width=" + w + ",height=" + h
|
||||||
|
+ ",menubar=0,status=0,titlebar=0,toolbar=0");
|
||||||
if (newWin == null) {
|
if (newWin == null) {
|
||||||
Window.alert("ERROR: Popup blocked!\n\nPlease make sure you have popups enabled for this site!");
|
Window.alert("ERROR: Popup blocked!\n\nPlease make sure you have popups enabled for this site!");
|
||||||
return;
|
return;
|
||||||
|
@ -247,7 +290,8 @@ public class PlatformApplication {
|
||||||
newWin.focus();
|
newWin.focus();
|
||||||
documentWrite(newWin.getDocument(), "<!DOCTYPE html><html><head><meta charset=\"UTF-8\" />"
|
documentWrite(newWin.getDocument(), "<!DOCTYPE html><html><head><meta charset=\"UTF-8\" />"
|
||||||
+ "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /><title>EaglercraftX 1.8 Credits</title>"
|
+ "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /><title>EaglercraftX 1.8 Credits</title>"
|
||||||
+ "<link type=\"image/png\" rel=\"shortcut icon\" href=\"" + PlatformApplication.faviconURLTeaVM() + "\" />"
|
+ "<link type=\"image/png\" rel=\"shortcut icon\" href=\"" + PlatformApplication.faviconURLTeaVM()
|
||||||
|
+ "\" />"
|
||||||
+ "</head><body><pre style=\"font:15px Consolas,monospace;\">" + text + "</pre></body></html>");
|
+ "</head><body><pre style=\"font:15px Consolas,monospace;\">" + text + "</pre></body></html>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,8 +300,8 @@ public class PlatformApplication {
|
||||||
fileChooserResultObject = null;
|
fileChooserResultObject = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JSBody(params = { "name", "buf" }, script =
|
@JSBody(params = { "name",
|
||||||
"var hr = window.URL.createObjectURL(new Blob([buf], {type: \"octet/stream\"}));" +
|
"buf" }, script = "var hr = window.URL.createObjectURL(new Blob([buf], {type: \"octet/stream\"}));" +
|
||||||
"var a = document.createElement(\"a\");" +
|
"var a = document.createElement(\"a\");" +
|
||||||
"a.href = hr; a.download = name; a.click();" +
|
"a.href = hr; a.download = name; a.click();" +
|
||||||
"window.URL.revokeObjectURL(hr);")
|
"window.URL.revokeObjectURL(hr);")
|
||||||
|
|
|
@ -30,16 +30,25 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
|
* Copyright (c) 2022-2023 lax1dude, hoosiertransfer. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
* NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED
|
* AND
|
||||||
* TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
*
|
* DISCLAIMED.
|
||||||
* NOT FOR COMMERCIAL OR MALICIOUS USE
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
*
|
* DIRECT,
|
||||||
* (please read the 'LICENSE' file this repo's root directory for more info)
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class PlatformAudio {
|
public class PlatformAudio {
|
||||||
|
@ -135,11 +144,13 @@ public class PlatformAudio {
|
||||||
public void gain(float f) {
|
public void gain(float f) {
|
||||||
if (panner != null) {
|
if (panner != null) {
|
||||||
float v1 = f * 16.0f;
|
float v1 = f * 16.0f;
|
||||||
if(v1 < 16.0f) v1 = 16.0f;
|
if (v1 < 16.0f)
|
||||||
|
v1 = 16.0f;
|
||||||
panner.setMaxDistance(v1);
|
panner.setMaxDistance(v1);
|
||||||
}
|
}
|
||||||
float v2 = f;
|
float v2 = f;
|
||||||
if(v2 > 1.0f) v2 = 1.0f;
|
if (v2 > 1.0f)
|
||||||
|
v2 = 1.0f;
|
||||||
gain.getGain().setValue(v2);
|
gain.getGain().setValue(v2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,7 +190,8 @@ public class PlatformAudio {
|
||||||
private static GainNode micGain;
|
private static GainNode micGain;
|
||||||
|
|
||||||
public static void setMicVol(float vol) {
|
public static void setMicVol(float vol) {
|
||||||
if (micGain == null) return;
|
if (micGain == null)
|
||||||
|
return;
|
||||||
micGain.getGain().setValue(vol);
|
micGain.getGain().setValue(vol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,8 +223,10 @@ public class PlatformAudio {
|
||||||
}
|
}
|
||||||
if (buffer == null) {
|
if (buffer == null) {
|
||||||
byte[] file = PlatformAssets.getResourceBytes(filename);
|
byte[] file = PlatformAssets.getResourceBytes(filename);
|
||||||
if(file == null) return null;
|
if (file == null)
|
||||||
buffer = new BrowserAudioResource(decodeAudioAsync(TeaVMUtils.unwrapUnsignedByteArray(file).getBuffer(), filename));
|
return null;
|
||||||
|
buffer = new BrowserAudioResource(
|
||||||
|
decodeAudioAsync(TeaVMUtils.unwrapUnsignedByteArray(file).getBuffer(), filename));
|
||||||
if (holdInCache) {
|
if (holdInCache) {
|
||||||
synchronized (soundCache) {
|
synchronized (soundCache) {
|
||||||
soundCache.put(filename, buffer);
|
soundCache.put(filename, buffer);
|
||||||
|
@ -238,7 +252,8 @@ public class PlatformAudio {
|
||||||
}
|
}
|
||||||
if (buffer == null) {
|
if (buffer == null) {
|
||||||
byte[] file = loader.loadFile(filename);
|
byte[] file = loader.loadFile(filename);
|
||||||
if(file == null) return null;
|
if (file == null)
|
||||||
|
return null;
|
||||||
Uint8Array buf = Uint8Array.create(file.length);
|
Uint8Array buf = Uint8Array.create(file.length);
|
||||||
buf.set(file);
|
buf.set(file);
|
||||||
buffer = new BrowserAudioResource(decodeAudioAsync(buf.getBuffer(), filename));
|
buffer = new BrowserAudioResource(decodeAudioAsync(buf.getBuffer(), filename));
|
||||||
|
@ -259,7 +274,8 @@ public class PlatformAudio {
|
||||||
@Async
|
@Async
|
||||||
public static native AudioBuffer decodeAudioAsync(ArrayBuffer buffer, String errorFileName);
|
public static native AudioBuffer decodeAudioAsync(ArrayBuffer buffer, String errorFileName);
|
||||||
|
|
||||||
private static void decodeAudioAsync(ArrayBuffer buffer, final String errorFileName, final AsyncCallback<AudioBuffer> cb) {
|
private static void decodeAudioAsync(ArrayBuffer buffer, final String errorFileName,
|
||||||
|
final AsyncCallback<AudioBuffer> cb) {
|
||||||
audioctx.decodeAudioData(buffer, new DecodeSuccessCallback() {
|
audioctx.decodeAudioData(buffer, new DecodeSuccessCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(AudioBuffer decodedData) {
|
public void onSuccess(AudioBuffer decodedData) {
|
||||||
|
@ -311,7 +327,8 @@ public class PlatformAudio {
|
||||||
PannerNode panner = audioctx.createPanner();
|
PannerNode panner = audioctx.createPanner();
|
||||||
panner.setPosition(x, y, z);
|
panner.setPosition(x, y, z);
|
||||||
float v1 = volume * 16.0f;
|
float v1 = volume * 16.0f;
|
||||||
if(v1 < 16.0f) v1 = 16.0f;
|
if (v1 < 16.0f)
|
||||||
|
v1 = 16.0f;
|
||||||
panner.setMaxDistance(v1);
|
panner.setMaxDistance(v1);
|
||||||
panner.setRolloffFactor(1.0f);
|
panner.setRolloffFactor(1.0f);
|
||||||
panner.setDistanceModel("linear");
|
panner.setDistanceModel("linear");
|
||||||
|
@ -323,7 +340,8 @@ public class PlatformAudio {
|
||||||
|
|
||||||
GainNode gain = audioctx.createGain();
|
GainNode gain = audioctx.createGain();
|
||||||
float v2 = volume;
|
float v2 = volume;
|
||||||
if(v2 > 1.0f) v2 = 1.0f;
|
if (v2 > 1.0f)
|
||||||
|
v2 = 1.0f;
|
||||||
gain.getGain().setValue(v2);
|
gain.getGain().setValue(v2);
|
||||||
|
|
||||||
src.connect(panner);
|
src.connect(panner);
|
||||||
|
@ -346,7 +364,8 @@ public class PlatformAudio {
|
||||||
|
|
||||||
GainNode gain = audioctx.createGain();
|
GainNode gain = audioctx.createGain();
|
||||||
float v2 = volume;
|
float v2 = volume;
|
||||||
if(v2 > 1.0f) v2 = 1.0f;
|
if (v2 > 1.0f)
|
||||||
|
v2 = 1.0f;
|
||||||
gain.getGain().setValue(v2);
|
gain.getGain().setValue(v2);
|
||||||
|
|
||||||
src.connect(gain);
|
src.connect(gain);
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.teavm.jso.webgl.WebGLRenderbuffer;
|
||||||
import net.lax1dude.eaglercraft.v1_8.EagUtils;
|
import net.lax1dude.eaglercraft.v1_8.EagUtils;
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.teavm.EarlyLoadScreen;
|
import net.lax1dude.eaglercraft.v1_8.internal.teavm.EarlyLoadScreen;
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.teavm.WebGL2RenderingContext;
|
import net.lax1dude.eaglercraft.v1_8.internal.teavm.WebGL2RenderingContext;
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
|
|
||||||
import static net.lax1dude.eaglercraft.v1_8.internal.teavm.WebGL2RenderingContext.*;
|
import static net.lax1dude.eaglercraft.v1_8.internal.teavm.WebGL2RenderingContext.*;
|
||||||
import static org.teavm.jso.webgl.WebGLRenderingContext.COLOR_ATTACHMENT0;
|
import static org.teavm.jso.webgl.WebGLRenderingContext.COLOR_ATTACHMENT0;
|
||||||
|
@ -33,8 +32,6 @@ import static org.teavm.jso.webgl.WebGLRenderingContext.FRAMEBUFFER;
|
||||||
import static org.teavm.jso.webgl.WebGLRenderingContext.NEAREST;
|
import static org.teavm.jso.webgl.WebGLRenderingContext.NEAREST;
|
||||||
import static org.teavm.jso.webgl.WebGLRenderingContext.RENDERBUFFER;
|
import static org.teavm.jso.webgl.WebGLRenderingContext.RENDERBUFFER;
|
||||||
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.RenderResolution;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2023 lax1dude, hoosiertransfer, ayunami2000. All Rights
|
* Copyright (c) 2022-2023 lax1dude, hoosiertransfer, ayunami2000. All Rights
|
||||||
* Reserved.
|
* Reserved.
|
||||||
|
@ -123,6 +120,7 @@ public class PlatformInput {
|
||||||
public static boolean lockKeys = false;
|
public static boolean lockKeys = false;
|
||||||
|
|
||||||
private static boolean vsync = true;
|
private static boolean vsync = true;
|
||||||
|
private static boolean vsyncSupport = false;
|
||||||
|
|
||||||
@JSBody(params = {}, script = "window.onbeforeunload = () => {return false;};")
|
@JSBody(params = {}, script = "window.onbeforeunload = () => {return false;};")
|
||||||
private static native void onBeforeCloseRegister();
|
private static native void onBeforeCloseRegister();
|
||||||
|
@ -274,7 +272,17 @@ public class PlatformInput {
|
||||||
mouseDY = 0.0D;
|
mouseDY = 0.0D;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
try {
|
||||||
onBeforeCloseRegister();
|
onBeforeCloseRegister();
|
||||||
|
} catch (Throwable t) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
asyncRequestAnimationFrame();
|
||||||
|
vsyncSupport = true;
|
||||||
|
} catch (Throwable t) {
|
||||||
|
PlatformRuntime.logger.error("VSync is not supported on this browser!");
|
||||||
|
}
|
||||||
|
|
||||||
fullscreenQuery = fullscreenMediaQuery();
|
fullscreenQuery = fullscreenMediaQuery();
|
||||||
if (keyboardLockSupported = checkKeyboardLockSupported()) {
|
if (keyboardLockSupported = checkKeyboardLockSupported()) {
|
||||||
|
@ -322,6 +330,9 @@ public class PlatformInput {
|
||||||
vsync = enable;
|
vsync = enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JSBody(params = { "doc" }, script = "return (doc.visibilityState === \"visible\");")
|
||||||
|
private static native boolean getVisibilityState(JSObject doc);
|
||||||
|
|
||||||
public static void update() {
|
public static void update() {
|
||||||
double r = win.getDevicePixelRatio();
|
double r = win.getDevicePixelRatio();
|
||||||
int w = (int) (PlatformRuntime.parent.getClientWidth());
|
int w = (int) (PlatformRuntime.parent.getClientWidth());
|
||||||
|
@ -342,11 +353,15 @@ public class PlatformInput {
|
||||||
PlatformRuntime.lastFrame = t;
|
PlatformRuntime.lastFrame = t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (vsync) {
|
if (getVisibilityState(win.getDocument())) {
|
||||||
|
if (vsyncSupport && vsync) {
|
||||||
asyncRequestAnimationFrame();
|
asyncRequestAnimationFrame();
|
||||||
} else {
|
} else {
|
||||||
EagUtils.sleep(0l);
|
EagUtils.sleep(0l);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
EagUtils.sleep(50l);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Async
|
@Async
|
||||||
|
@ -370,6 +385,10 @@ public class PlatformInput {
|
||||||
}, 50);
|
}, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isVSyncSupported() {
|
||||||
|
return vsyncSupport;
|
||||||
|
}
|
||||||
|
|
||||||
static void initFramebuffer(WebGL2RenderingContext ctx, WebGLFramebuffer fbo, int sw, int sh) {
|
static void initFramebuffer(WebGL2RenderingContext ctx, WebGLFramebuffer fbo, int sw, int sh) {
|
||||||
context = ctx;
|
context = ctx;
|
||||||
mainFramebuffer = fbo;
|
mainFramebuffer = fbo;
|
||||||
|
@ -628,7 +647,7 @@ public class PlatformInput {
|
||||||
keyEvents.clear();
|
keyEvents.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@JSBody(params = {}, script = "return window.matchMedia('(display-mode: fullscreen)');")
|
@JSBody(params = {}, script = "return window.matchMedia(\"(display-mode: fullscreen)\");")
|
||||||
private static native JSObject fullscreenMediaQuery();
|
private static native JSObject fullscreenMediaQuery();
|
||||||
|
|
||||||
@JSBody(params = { "mediaQuery" }, script = "return mediaQuery.matches;")
|
@JSBody(params = { "mediaQuery" }, script = "return mediaQuery.matches;")
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -13,19 +13,27 @@ import org.teavm.jso.dom.html.HTMLDocument;
|
||||||
import org.teavm.jso.dom.html.HTMLElement;
|
import org.teavm.jso.dom.html.HTMLElement;
|
||||||
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.PlatformApplication;
|
import net.lax1dude.eaglercraft.v1_8.internal.PlatformApplication;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
|
||||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -63,13 +71,15 @@ public class DebugConsoleWindow {
|
||||||
destroyWindow();
|
destroyWindow();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if("true".equals(parent.getLocalStorage().getItem("_eaglercraftX.showDebugConsole"))) {
|
if ("true".equals(parent.getLocalStorage()
|
||||||
|
.getItem(PlatformRuntime.getClientConfigAdapter().getLocalStorageNamespace() + ".showDebugConsole"))) {
|
||||||
showDebugConsole0();
|
showDebugConsole0();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showDebugConsole() {
|
public static void showDebugConsole() {
|
||||||
parent.getLocalStorage().setItem("_eaglercraftX.showDebugConsole", "true");
|
parent.getLocalStorage().setItem(
|
||||||
|
PlatformRuntime.getClientConfigAdapter().getLocalStorageNamespace() + ".showDebugConsole", "true");
|
||||||
showDebugConsole0();
|
showDebugConsole0();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,15 +92,18 @@ public class DebugConsoleWindow {
|
||||||
int h = (int) (400 * parent.getDevicePixelRatio());
|
int h = (int) (400 * parent.getDevicePixelRatio());
|
||||||
int x = (parent.getScreen().getWidth() - w) / 2;
|
int x = (parent.getScreen().getWidth() - w) / 2;
|
||||||
int y = (parent.getScreen().getHeight() - h) / 2;
|
int y = (parent.getScreen().getHeight() - h) / 2;
|
||||||
logger = parent.open("", "_blank", "top=" + y + ",left=" + x + ",width=" + w + ",height=" + h + ",menubar=0,status=0,titlebar=0,toolbar=0");
|
logger = parent.open("", "_blank", "top=" + y + ",left=" + x + ",width=" + w + ",height=" + h
|
||||||
|
+ ",menubar=0,status=0,titlebar=0,toolbar=0");
|
||||||
if (logger == null) {
|
if (logger == null) {
|
||||||
LogManager.getLogger("DebugConsoleWindow").error("Logger popup was blocked!");
|
LogManager.getLogger("DebugConsoleWindow").error("Logger popup was blocked!");
|
||||||
Window.alert("ERROR: Popup blocked!\n\nPlease make sure you have popups enabled for this site!");
|
Window.alert("ERROR: Popup blocked!\n\nPlease make sure you have popups enabled for this site!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logger.focus();
|
logger.focus();
|
||||||
documentWrite(logger.getDocument(), "<!DOCTYPE html><html><head><meta charset=\"UTF-8\" /><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />"
|
documentWrite(logger.getDocument(),
|
||||||
+ "<title>Debug Console</title><link type=\"image/png\" rel=\"shortcut icon\" href=\"" + PlatformApplication.faviconURLTeaVM() + "\" />"
|
"<!DOCTYPE html><html><head><meta charset=\"UTF-8\" /><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />"
|
||||||
|
+ "<title>Debug Console</title><link type=\"image/png\" rel=\"shortcut icon\" href=\""
|
||||||
|
+ PlatformApplication.faviconURLTeaVM() + "\" />"
|
||||||
+ "</head><body style=\"overflow-x:hidden;overflow-y:scroll;padding:0px;\"><p id=\"loggerMessageContainer\" style=\"overflow-wrap:break-word;white-space:pre-wrap;font:14px monospace;padding:10px;\"></p></body></html>");
|
+ "</head><body style=\"overflow-x:hidden;overflow-y:scroll;padding:0px;\"><p id=\"loggerMessageContainer\" style=\"overflow-wrap:break-word;white-space:pre-wrap;font:14px monospace;padding:10px;\"></p></body></html>");
|
||||||
loggerDoc = logger.getDocument();
|
loggerDoc = logger.getDocument();
|
||||||
loggerBody = loggerDoc.getBody();
|
loggerBody = loggerDoc.getBody();
|
||||||
|
@ -155,7 +168,8 @@ public class DebugConsoleWindow {
|
||||||
@JSBody(params = { "win", "doc" }, script = "return (win.innerHeight + win.pageYOffset) >= doc.body.offsetHeight;")
|
@JSBody(params = { "win", "doc" }, script = "return (win.innerHeight + win.pageYOffset) >= doc.body.offsetHeight;")
|
||||||
private static native boolean isScrollToEnd(Window win, HTMLDocument doc);
|
private static native boolean isScrollToEnd(Window win, HTMLDocument doc);
|
||||||
|
|
||||||
@JSBody(params = { "win", "doc" }, script = "setTimeout(function(){win.scrollTo(0, doc.body.scrollHeight || doc.body.clientHeight);}, 1);")
|
@JSBody(params = { "win",
|
||||||
|
"doc" }, script = "setTimeout(function(){win.scrollTo(0, doc.body.scrollHeight || doc.body.clientHeight);}, 1);")
|
||||||
private static native void scrollToEnd0(Window win, HTMLDocument doc);
|
private static native void scrollToEnd0(Window win, HTMLDocument doc);
|
||||||
|
|
||||||
public static void destroyWindow() {
|
public static void destroyWindow() {
|
||||||
|
|
|
@ -10,26 +10,34 @@ import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager;
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import org.teavm.jso.JSObject;
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.core.JSArrayReader;
|
||||||
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapter;
|
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapter;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapterHooks;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.teavm.opts.JSEaglercraftXOptsHooks;
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.teavm.opts.JSEaglercraftXOptsRelay;
|
import net.lax1dude.eaglercraft.v1_8.internal.teavm.opts.JSEaglercraftXOptsRelay;
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.teavm.opts.JSEaglercraftXOptsRelaysArray;
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.teavm.opts.JSEaglercraftXOptsRoot;
|
import net.lax1dude.eaglercraft.v1_8.internal.teavm.opts.JSEaglercraftXOptsRoot;
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.teavm.opts.JSEaglercraftXOptsServer;
|
import net.lax1dude.eaglercraft.v1_8.internal.teavm.opts.JSEaglercraftXOptsServer;
|
||||||
import net.lax1dude.eaglercraft.v1_8.internal.teavm.opts.JSEaglercraftXOptsServersArray;
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayEntry;
|
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayEntry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -56,6 +64,9 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter {
|
||||||
private boolean checkRelaysForUpdates = false;
|
private boolean checkRelaysForUpdates = false;
|
||||||
private boolean enableSignatureBadge = false;
|
private boolean enableSignatureBadge = false;
|
||||||
private boolean allowVoiceClient = true;
|
private boolean allowVoiceClient = true;
|
||||||
|
private boolean allowFNAWSkins = true;
|
||||||
|
private String localStorageNamespace = "_eaglercraftX";
|
||||||
|
private final TeaVMClientConfigAdapterHooks hooks = new TeaVMClientConfigAdapterHooks();
|
||||||
|
|
||||||
public void loadNative(JSObject jsObject) {
|
public void loadNative(JSObject jsObject) {
|
||||||
integratedServerOpts = new JSONObject();
|
integratedServerOpts = new JSONObject();
|
||||||
|
@ -67,14 +78,23 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter {
|
||||||
resourcePacksDB = eaglercraftXOpts.getResourcePacksDB("resourcePacks");
|
resourcePacksDB = eaglercraftXOpts.getResourcePacksDB("resourcePacks");
|
||||||
checkShaderGLErrors = eaglercraftXOpts.getCheckShaderGLErrors(false);
|
checkShaderGLErrors = eaglercraftXOpts.getCheckShaderGLErrors(false);
|
||||||
demoMode = EaglercraftVersion.forceDemoMode || eaglercraftXOpts.getDemoMode(false);
|
demoMode = EaglercraftVersion.forceDemoMode || eaglercraftXOpts.getDemoMode(false);
|
||||||
isAllowUpdateSvc = EaglercraftVersion.enableUpdateService && !demoMode && eaglercraftXOpts.getAllowUpdateSvc(true);
|
isAllowUpdateSvc = EaglercraftVersion.enableUpdateService && !demoMode
|
||||||
isAllowUpdateDL = EaglercraftVersion.enableUpdateService && !demoMode && eaglercraftXOpts.getAllowUpdateDL(true);
|
&& eaglercraftXOpts.getAllowUpdateSvc(true);
|
||||||
|
isAllowUpdateDL = EaglercraftVersion.enableUpdateService && !demoMode
|
||||||
|
&& eaglercraftXOpts.getAllowUpdateDL(true);
|
||||||
isEnableDownloadOfflineButton = eaglercraftXOpts.getEnableDownloadOfflineButton(true);
|
isEnableDownloadOfflineButton = eaglercraftXOpts.getEnableDownloadOfflineButton(true);
|
||||||
downloadOfflineButtonLink = eaglercraftXOpts.getDownloadOfflineButtonLink(null);
|
downloadOfflineButtonLink = eaglercraftXOpts.getDownloadOfflineButtonLink(null);
|
||||||
useSpecialCursors = eaglercraftXOpts.getHtml5CursorSupport(false);
|
useSpecialCursors = eaglercraftXOpts.getHtml5CursorSupport(false);
|
||||||
logInvalidCerts = EaglercraftVersion.enableUpdateService && !demoMode && eaglercraftXOpts.getLogInvalidCerts(false);
|
logInvalidCerts = EaglercraftVersion.enableUpdateService && !demoMode
|
||||||
|
&& eaglercraftXOpts.getLogInvalidCerts(false);
|
||||||
enableSignatureBadge = eaglercraftXOpts.getEnableSignatureBadge(false);
|
enableSignatureBadge = eaglercraftXOpts.getEnableSignatureBadge(false);
|
||||||
allowVoiceClient = eaglercraftXOpts.getAllowVoiceClient(true);
|
allowVoiceClient = eaglercraftXOpts.getAllowVoiceClient(true);
|
||||||
|
allowFNAWSkins = eaglercraftXOpts.getAllowFNAWSkins(true);
|
||||||
|
localStorageNamespace = eaglercraftXOpts.getLocalStorageNamespace(EaglercraftVersion.localStorageNamespace);
|
||||||
|
JSEaglercraftXOptsHooks hooksObj = eaglercraftXOpts.getHooks();
|
||||||
|
if (hooksObj != null) {
|
||||||
|
hooks.loadHooks(hooksObj);
|
||||||
|
}
|
||||||
|
|
||||||
integratedServerOpts.put("worldsDB", worldsDB);
|
integratedServerOpts.put("worldsDB", worldsDB);
|
||||||
integratedServerOpts.put("demoMode", demoMode);
|
integratedServerOpts.put("demoMode", demoMode);
|
||||||
|
@ -82,8 +102,9 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter {
|
||||||
integratedServerOpts.put("allowUpdateSvc", isAllowUpdateSvc);
|
integratedServerOpts.put("allowUpdateSvc", isAllowUpdateSvc);
|
||||||
integratedServerOpts.put("allowUpdateDL", isAllowUpdateDL);
|
integratedServerOpts.put("allowUpdateDL", isAllowUpdateDL);
|
||||||
integratedServerOpts.put("allowVoiceClient", allowVoiceClient);
|
integratedServerOpts.put("allowVoiceClient", allowVoiceClient);
|
||||||
|
integratedServerOpts.put("allowFNAWSkins", allowFNAWSkins);
|
||||||
|
|
||||||
JSEaglercraftXOptsServersArray serversArray = eaglercraftXOpts.getServers();
|
JSArrayReader<JSEaglercraftXOptsServer> serversArray = eaglercraftXOpts.getServers();
|
||||||
if (serversArray != null) {
|
if (serversArray != null) {
|
||||||
for (int i = 0, l = serversArray.getLength(); i < l; ++i) {
|
for (int i = 0, l = serversArray.getLength(); i < l; ++i) {
|
||||||
JSEaglercraftXOptsServer serverEntry = serversArray.get(i);
|
JSEaglercraftXOptsServer serverEntry = serversArray.get(i);
|
||||||
|
@ -95,7 +116,7 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JSEaglercraftXOptsRelaysArray relaysArray = eaglercraftXOpts.getRelays();
|
JSArrayReader<JSEaglercraftXOptsRelay> relaysArray = eaglercraftXOpts.getRelays();
|
||||||
if (relaysArray != null) {
|
if (relaysArray != null) {
|
||||||
boolean gotAPrimary = false;
|
boolean gotAPrimary = false;
|
||||||
for (int i = 0, l = relaysArray.getLength(); i < l; ++i) {
|
for (int i = 0, l = relaysArray.getLength(); i < l; ++i) {
|
||||||
|
@ -115,7 +136,8 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean officialUpdates = !demoMode && EaglercraftVersion.updateBundlePackageName.equals("net.lax1dude.eaglercraft.v1_8.client");
|
boolean officialUpdates = !demoMode
|
||||||
|
&& EaglercraftVersion.updateBundlePackageName.equals("net.lax1dude.eaglercraft.v1_8.client");
|
||||||
if (relays.size() <= 0) {
|
if (relays.size() <= 0) {
|
||||||
int choice = ThreadLocalRandom.current().nextInt(3);
|
int choice = ThreadLocalRandom.current().nextInt(3);
|
||||||
relays.add(new RelayEntry("wss://relay.deev.is/", "lax1dude relay #1", choice == 0));
|
relays.add(new RelayEntry("wss://relay.deev.is/", "lax1dude relay #1", choice == 0));
|
||||||
|
@ -126,7 +148,8 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter {
|
||||||
if (officialUpdates) {
|
if (officialUpdates) {
|
||||||
for (int i = 0, l = relays.size(); i < l; ++i) {
|
for (int i = 0, l = relays.size(); i < l; ++i) {
|
||||||
String addr = relays.get(i).address;
|
String addr = relays.get(i).address;
|
||||||
if(!addr.contains("deev.is") && !addr.contains("lax1dude.net") && !addr.contains("shhnowisnottheti.me")) {
|
if (!addr.contains("deev.is") && !addr.contains("lax1dude.net")
|
||||||
|
&& !addr.contains("shhnowisnottheti.me")) {
|
||||||
officialUpdates = false;
|
officialUpdates = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -154,14 +177,20 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter {
|
||||||
eaglercraftOpts.put("demoMode", true);
|
eaglercraftOpts.put("demoMode", true);
|
||||||
}
|
}
|
||||||
demoMode = EaglercraftVersion.forceDemoMode || eaglercraftOpts.optBoolean("demoMode", false);
|
demoMode = EaglercraftVersion.forceDemoMode || eaglercraftOpts.optBoolean("demoMode", false);
|
||||||
isAllowUpdateSvc = EaglercraftVersion.enableUpdateService && !demoMode && eaglercraftOpts.optBoolean("allowUpdateSvc", true);
|
isAllowUpdateSvc = EaglercraftVersion.enableUpdateService && !demoMode
|
||||||
isAllowUpdateDL = EaglercraftVersion.enableUpdateService && !demoMode && eaglercraftOpts.optBoolean("allowUpdateDL", true);
|
&& eaglercraftOpts.optBoolean("allowUpdateSvc", true);
|
||||||
|
isAllowUpdateDL = EaglercraftVersion.enableUpdateService && !demoMode
|
||||||
|
&& eaglercraftOpts.optBoolean("allowUpdateDL", true);
|
||||||
isEnableDownloadOfflineButton = eaglercraftOpts.optBoolean("enableDownloadOfflineButton", true);
|
isEnableDownloadOfflineButton = eaglercraftOpts.optBoolean("enableDownloadOfflineButton", true);
|
||||||
downloadOfflineButtonLink = eaglercraftOpts.optString("downloadOfflineButtonLink", null);
|
downloadOfflineButtonLink = eaglercraftOpts.optString("downloadOfflineButtonLink", null);
|
||||||
useSpecialCursors = eaglercraftOpts.optBoolean("html5CursorSupport", false);
|
useSpecialCursors = eaglercraftOpts.optBoolean("html5CursorSupport", false);
|
||||||
logInvalidCerts = EaglercraftVersion.enableUpdateService && !demoMode && eaglercraftOpts.optBoolean("logInvalidCerts", false);
|
logInvalidCerts = EaglercraftVersion.enableUpdateService && !demoMode
|
||||||
|
&& eaglercraftOpts.optBoolean("logInvalidCerts", false);
|
||||||
enableSignatureBadge = eaglercraftOpts.optBoolean("enableSignatureBadge", false);
|
enableSignatureBadge = eaglercraftOpts.optBoolean("enableSignatureBadge", false);
|
||||||
allowVoiceClient = eaglercraftOpts.optBoolean("allowVoiceClient", true);
|
allowVoiceClient = eaglercraftOpts.optBoolean("allowVoiceClient", true);
|
||||||
|
allowFNAWSkins = eaglercraftOpts.optBoolean("allowFNAWSkins", true);
|
||||||
|
localStorageNamespace = eaglercraftOpts.optString("localStorageNamespace",
|
||||||
|
EaglercraftVersion.localStorageNamespace);
|
||||||
JSONArray serversArray = eaglercraftOpts.optJSONArray("servers");
|
JSONArray serversArray = eaglercraftOpts.optJSONArray("servers");
|
||||||
if (serversArray != null) {
|
if (serversArray != null) {
|
||||||
for (int i = 0, l = serversArray.length(); i < l; ++i) {
|
for (int i = 0, l = serversArray.length(); i < l; ++i) {
|
||||||
|
@ -191,7 +220,8 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean officialUpdates = !demoMode && EaglercraftVersion.updateBundlePackageName.equals("net.lax1dude.eaglercraft.v1_8.client");
|
boolean officialUpdates = !demoMode
|
||||||
|
&& EaglercraftVersion.updateBundlePackageName.equals("net.lax1dude.eaglercraft.v1_8.client");
|
||||||
if (relays.size() <= 0) {
|
if (relays.size() <= 0) {
|
||||||
int choice = ThreadLocalRandom.current().nextInt(3);
|
int choice = ThreadLocalRandom.current().nextInt(3);
|
||||||
relays.add(new RelayEntry("wss://relay.deev.is/", "lax1dude relay #1", choice == 0));
|
relays.add(new RelayEntry("wss://relay.deev.is/", "lax1dude relay #1", choice == 0));
|
||||||
|
@ -202,7 +232,8 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter {
|
||||||
if (officialUpdates) {
|
if (officialUpdates) {
|
||||||
for (int i = 0, l = relays.size(); i < l; ++i) {
|
for (int i = 0, l = relays.size(); i < l; ++i) {
|
||||||
String addr = relays.get(i).address;
|
String addr = relays.get(i).address;
|
||||||
if(!addr.contains("deev.is") && !addr.contains("lax1dude.net") && !addr.contains("shhnowisnottheti.me")) {
|
if (!addr.contains("deev.is") && !addr.contains("lax1dude.net")
|
||||||
|
&& !addr.contains("shhnowisnottheti.me")) {
|
||||||
officialUpdates = false;
|
officialUpdates = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -309,6 +340,21 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter {
|
||||||
return allowVoiceClient;
|
return allowVoiceClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAllowFNAWSkins() {
|
||||||
|
return allowFNAWSkins;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLocalStorageNamespace() {
|
||||||
|
return localStorageNamespace;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IClientConfigAdapterHooks getHooks() {
|
||||||
|
return hooks;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
@ -327,6 +373,8 @@ public class TeaVMClientConfigAdapter implements IClientConfigAdapter {
|
||||||
jsonObject.put("checkRelaysForUpdates", checkRelaysForUpdates);
|
jsonObject.put("checkRelaysForUpdates", checkRelaysForUpdates);
|
||||||
jsonObject.put("enableSignatureBadge", enableSignatureBadge);
|
jsonObject.put("enableSignatureBadge", enableSignatureBadge);
|
||||||
jsonObject.put("allowVoiceClient", allowVoiceClient);
|
jsonObject.put("allowVoiceClient", allowVoiceClient);
|
||||||
|
jsonObject.put("allowFNAWSkins", allowFNAWSkins);
|
||||||
|
jsonObject.put("localStorageNamespace", localStorageNamespace);
|
||||||
JSONArray serversArr = new JSONArray();
|
JSONArray serversArr = new JSONArray();
|
||||||
for (int i = 0, l = defaultServers.size(); i < l; ++i) {
|
for (int i = 0, l = defaultServers.size(); i < l; ++i) {
|
||||||
DefaultServer srv = defaultServers.get(i);
|
DefaultServer srv = defaultServers.get(i);
|
||||||
|
|
|
@ -0,0 +1,108 @@
|
||||||
|
package net.lax1dude.eaglercraft.v1_8.internal.teavm;
|
||||||
|
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
import org.teavm.interop.Async;
|
||||||
|
import org.teavm.interop.AsyncCallback;
|
||||||
|
import org.teavm.jso.JSFunctor;
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.browser.Window;
|
||||||
|
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapterHooks;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.internal.teavm.opts.JSEaglercraftXOptsHooks;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||||
|
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED.
|
||||||
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
* DIRECT,
|
||||||
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class TeaVMClientConfigAdapterHooks implements IClientConfigAdapterHooks {
|
||||||
|
|
||||||
|
private static final Logger logger = LogManager.getLogger("TeaVMClientConfigAdapterHooks");
|
||||||
|
|
||||||
|
private LocalStorageSaveHook saveHook = null;
|
||||||
|
private LocalStorageLoadHook loadHook = null;
|
||||||
|
|
||||||
|
@JSFunctor
|
||||||
|
private static interface LocalStorageSaveHook extends JSObject {
|
||||||
|
void call(String key, String base64);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void callLocalStorageSavedHook(String key, String base64) {
|
||||||
|
if (saveHook != null) {
|
||||||
|
callHookSafe("localStorageSaved", () -> {
|
||||||
|
saveHook.call(key, base64);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@JSFunctor
|
||||||
|
private static interface LocalStorageLoadHook extends JSObject {
|
||||||
|
String call(String key);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String callLocalStorageLoadHook(String key) {
|
||||||
|
if (loadHook != null) {
|
||||||
|
return (String) callHookSafeWithReturn("localStorageLoaded", () -> {
|
||||||
|
return loadHook.call(key);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void callHookSafe(String identifer, Runnable hooker) {
|
||||||
|
Window.setTimeout(() -> {
|
||||||
|
try {
|
||||||
|
hooker.run();
|
||||||
|
} catch (Throwable t) {
|
||||||
|
logger.error("Caught exception while invoking eaglercraftXOpts \"{}\" hook!", identifer);
|
||||||
|
logger.error(t);
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Async
|
||||||
|
private static native Object callHookSafeWithReturn(String identifer, Supplier<Object> hooker);
|
||||||
|
|
||||||
|
private static void callHookSafeWithReturn(String identifer, Supplier<Object> hooker,
|
||||||
|
final AsyncCallback<Object> cb) {
|
||||||
|
Window.setTimeout(() -> {
|
||||||
|
Object res = null;
|
||||||
|
try {
|
||||||
|
res = hooker.get();
|
||||||
|
} catch (Throwable t) {
|
||||||
|
logger.error("Caught exception while invoking eaglercraftXOpts \"{}\" hook!", identifer);
|
||||||
|
logger.error(t);
|
||||||
|
} finally {
|
||||||
|
cb.complete(res);
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadHooks(JSEaglercraftXOptsHooks hooks) {
|
||||||
|
saveHook = (LocalStorageSaveHook) hooks.getLocalStorageSavedHook();
|
||||||
|
loadHook = (LocalStorageLoadHook) hooks.getLocalStorageLoadedHook();
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,14 +7,21 @@ import org.teavm.jso.JSProperty;
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -22,7 +29,7 @@ import org.teavm.jso.JSProperty;
|
||||||
public interface JSEaglercraftXOptsAssetsURIsArray extends JSObject {
|
public interface JSEaglercraftXOptsAssetsURIsArray extends JSObject {
|
||||||
|
|
||||||
@JSIndexer
|
@JSIndexer
|
||||||
JSEaglercraftXOptsAssetsURI get(int idx);
|
JSEaglercraftXOptsHooks get(int idx);
|
||||||
|
|
||||||
@JSProperty
|
@JSProperty
|
||||||
int getLength();
|
int getLength();
|
||||||
|
|
|
@ -1,30 +1,36 @@
|
||||||
package net.lax1dude.eaglercraft.v1_8.internal.teavm.opts;
|
package net.lax1dude.eaglercraft.v1_8.internal.teavm.opts;
|
||||||
|
|
||||||
import org.teavm.jso.JSIndexer;
|
import org.teavm.jso.JSBody;
|
||||||
import org.teavm.jso.JSObject;
|
import org.teavm.jso.JSObject;
|
||||||
import org.teavm.jso.JSProperty;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface JSEaglercraftXOptsServersArray extends JSObject {
|
public abstract class JSEaglercraftXOptsHooks implements JSObject {
|
||||||
|
|
||||||
@JSIndexer
|
@JSBody(script = "return (typeof this.localStorageSaved === \"function\") ? this.localStorageSaved : null;")
|
||||||
JSEaglercraftXOptsServer get(int idx);
|
public native JSObject getLocalStorageSavedHook();
|
||||||
|
|
||||||
@JSProperty
|
@JSBody(script = "return (typeof this.localStorageLoaded === \"function\") ? this.localStorageLoaded : null;")
|
||||||
int getLength();
|
public native JSObject getLocalStorageLoadedHook();
|
||||||
|
|
||||||
}
|
}
|
|
@ -2,18 +2,26 @@ package net.lax1dude.eaglercraft.v1_8.internal.teavm.opts;
|
||||||
|
|
||||||
import org.teavm.jso.JSBody;
|
import org.teavm.jso.JSBody;
|
||||||
import org.teavm.jso.JSObject;
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.core.JSArrayReader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
* Copyright (c) 2024 lax1dude. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -27,7 +35,7 @@ public abstract class JSEaglercraftXOptsRoot implements JSObject {
|
||||||
public native String getAssetsURI();
|
public native String getAssetsURI();
|
||||||
|
|
||||||
@JSBody(script = "return (typeof this.assetsURI === \"object\") ? this.assetsURI : null;")
|
@JSBody(script = "return (typeof this.assetsURI === \"object\") ? this.assetsURI : null;")
|
||||||
public native JSEaglercraftXOptsAssetsURIsArray getAssetsURIArray();
|
public native JSArrayReader<JSEaglercraftXOptsAssetsURI> getAssetsURIArray();
|
||||||
|
|
||||||
@JSBody(params = { "def" }, script = "return (typeof this.lang === \"string\") ? this.lang : def;")
|
@JSBody(params = { "def" }, script = "return (typeof this.lang === \"string\") ? this.lang : def;")
|
||||||
public native String getLang(String defaultValue);
|
public native String getLang(String defaultValue);
|
||||||
|
@ -41,45 +49,68 @@ public abstract class JSEaglercraftXOptsRoot implements JSObject {
|
||||||
@JSBody(params = { "def" }, script = "return (typeof this.worldsDB === \"string\") ? this.worldsDB : def;")
|
@JSBody(params = { "def" }, script = "return (typeof this.worldsDB === \"string\") ? this.worldsDB : def;")
|
||||||
public native String getWorldsDB(String defaultValue);
|
public native String getWorldsDB(String defaultValue);
|
||||||
|
|
||||||
@JSBody(params = { "def" }, script = "return (typeof this.resourcePacksDB === \"string\") ? this.resourcePacksDB : def;")
|
@JSBody(params = {
|
||||||
|
"def" }, script = "return (typeof this.resourcePacksDB === \"string\") ? this.resourcePacksDB : def;")
|
||||||
public native String getResourcePacksDB(String defaultValue);
|
public native String getResourcePacksDB(String defaultValue);
|
||||||
|
|
||||||
@JSBody(params = { "def" }, script = "return (typeof this.demoMode === \"boolean\") ? this.demoMode : def;")
|
@JSBody(params = { "def" }, script = "return (typeof this.demoMode === \"boolean\") ? this.demoMode : def;")
|
||||||
public native boolean getDemoMode(boolean defaultValue);
|
public native boolean getDemoMode(boolean defaultValue);
|
||||||
|
|
||||||
@JSBody(script = "return (typeof this.servers === \"object\") ? this.servers : null;")
|
@JSBody(script = "return (typeof this.servers === \"object\") ? this.servers : null;")
|
||||||
public native JSEaglercraftXOptsServersArray getServers();
|
public native JSArrayReader<JSEaglercraftXOptsServer> getServers();
|
||||||
|
|
||||||
@JSBody(script = "return (typeof this.relays === \"object\") ? this.relays : null;")
|
@JSBody(script = "return (typeof this.relays === \"object\") ? this.relays : null;")
|
||||||
public native JSEaglercraftXOptsRelaysArray getRelays();
|
public native JSArrayReader<JSEaglercraftXOptsRelay> getRelays();
|
||||||
|
|
||||||
@JSBody(params = { "def" }, script = "return (typeof this.checkShaderGLErrors === \"boolean\") ? this.checkShaderGLErrors : def;")
|
@JSBody(params = {
|
||||||
|
"def" }, script = "return (typeof this.checkShaderGLErrors === \"boolean\") ? this.checkShaderGLErrors : def;")
|
||||||
public native boolean getCheckShaderGLErrors(boolean defaultValue);
|
public native boolean getCheckShaderGLErrors(boolean defaultValue);
|
||||||
|
|
||||||
@JSBody(params = { "def" }, script = "return (typeof this.enableDownloadOfflineButton === \"boolean\") ? this.enableDownloadOfflineButton : def;")
|
@JSBody(params = {
|
||||||
|
"def" }, script = "return (typeof this.enableDownloadOfflineButton === \"boolean\") ? this.enableDownloadOfflineButton : def;")
|
||||||
public native boolean getEnableDownloadOfflineButton(boolean defaultValue);
|
public native boolean getEnableDownloadOfflineButton(boolean defaultValue);
|
||||||
|
|
||||||
@JSBody(params = { "def" }, script = "return (typeof this.downloadOfflineButtonLink === \"string\") ? this.downloadOfflineButtonLink : def;")
|
@JSBody(params = {
|
||||||
|
"def" }, script = "return (typeof this.downloadOfflineButtonLink === \"string\") ? this.downloadOfflineButtonLink : def;")
|
||||||
public native String getDownloadOfflineButtonLink(String defaultValue);
|
public native String getDownloadOfflineButtonLink(String defaultValue);
|
||||||
|
|
||||||
@JSBody(params = { "def" }, script = "return (typeof this.html5CursorSupport === \"boolean\") ? this.html5CursorSupport : def;")
|
@JSBody(params = {
|
||||||
|
"def" }, script = "return (typeof this.html5CursorSupport === \"boolean\") ? this.html5CursorSupport : def;")
|
||||||
public native boolean getHtml5CursorSupport(boolean defaultValue);
|
public native boolean getHtml5CursorSupport(boolean defaultValue);
|
||||||
|
|
||||||
@JSBody(params = { "def" }, script = "return (typeof this.allowUpdateSvc === \"boolean\") ? this.allowUpdateSvc : def;")
|
@JSBody(params = {
|
||||||
|
"def" }, script = "return (typeof this.allowUpdateSvc === \"boolean\") ? this.allowUpdateSvc : def;")
|
||||||
public native boolean getAllowUpdateSvc(boolean defaultValue);
|
public native boolean getAllowUpdateSvc(boolean defaultValue);
|
||||||
|
|
||||||
@JSBody(params = { "def" }, script = "return (typeof this.allowUpdateDL === \"boolean\") ? this.allowUpdateDL : def;")
|
@JSBody(params = {
|
||||||
|
"def" }, script = "return (typeof this.allowUpdateDL === \"boolean\") ? this.allowUpdateDL : def;")
|
||||||
public native boolean getAllowUpdateDL(boolean defaultValue);
|
public native boolean getAllowUpdateDL(boolean defaultValue);
|
||||||
|
|
||||||
@JSBody(params = { "def" }, script = "return (typeof this.logInvalidCerts === \"boolean\") ? this.logInvalidCerts : def;")
|
@JSBody(params = {
|
||||||
|
"def" }, script = "return (typeof this.logInvalidCerts === \"boolean\") ? this.logInvalidCerts : def;")
|
||||||
public native boolean getLogInvalidCerts(boolean defaultValue);
|
public native boolean getLogInvalidCerts(boolean defaultValue);
|
||||||
|
|
||||||
@JSBody(params = { "def" }, script = "return (typeof this.enableSignatureBadge === \"boolean\") ? this.enableSignatureBadge : def;")
|
@JSBody(params = {
|
||||||
|
"def" }, script = "return (typeof this.enableSignatureBadge === \"boolean\") ? this.enableSignatureBadge : def;")
|
||||||
public native boolean getEnableSignatureBadge(boolean defaultValue);
|
public native boolean getEnableSignatureBadge(boolean defaultValue);
|
||||||
|
|
||||||
@JSBody(params = { "def" }, script = "return (typeof this.checkRelaysForUpdates === \"boolean\") ? this.checkRelaysForUpdates : def;")
|
@JSBody(params = {
|
||||||
|
"def" }, script = "return (typeof this.checkRelaysForUpdates === \"boolean\") ? this.checkRelaysForUpdates : def;")
|
||||||
public native boolean getCheckRelaysForUpdates(boolean defaultValue);
|
public native boolean getCheckRelaysForUpdates(boolean defaultValue);
|
||||||
|
|
||||||
@JSBody(params = { "def" }, script = "return (typeof this.allowVoiceClient === \"boolean\") ? this.allowVoiceClient : def;")
|
@JSBody(params = {
|
||||||
|
"def" }, script = "return (typeof this.allowVoiceClient === \"boolean\") ? this.allowVoiceClient : def;")
|
||||||
public native boolean getAllowVoiceClient(boolean defaultValue);
|
public native boolean getAllowVoiceClient(boolean defaultValue);
|
||||||
|
|
||||||
|
@JSBody(params = {
|
||||||
|
"def" }, script = "return (typeof this.allowFNAWSkins === \"boolean\") ? this.allowFNAWSkins : def;")
|
||||||
|
public native boolean getAllowFNAWSkins(boolean defaultValue);
|
||||||
|
|
||||||
|
@JSBody(script = "return (typeof this.hooks === \"object\") ? this.hooks : null;")
|
||||||
|
public native JSEaglercraftXOptsHooks getHooks();
|
||||||
|
|
||||||
|
@JSBody(params = {
|
||||||
|
"def" }, script = "return (typeof this.localStorageNamespace === \"string\") ? this.localStorageNamespace : def;")
|
||||||
|
public native String getLocalStorageNamespace(String defaultValue);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,16 +18,24 @@ import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerIntegratedServerWorker;
|
||||||
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.ServerPlatformSingleplayer;
|
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.ServerPlatformSingleplayer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2023-2024 lax1dude, hoosiertransfer, ayunami2000. All Rights Reserved.
|
* Copyright (c) 2023-2024 lax1dude, hoosiertransfer, ayunami2000. All Rights
|
||||||
|
* Reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -57,8 +65,11 @@ public class WorkerMain {
|
||||||
__println(systemErr, true, "WorkerMain: [ERROR] uncaught exception thrown!");
|
__println(systemErr, true, "WorkerMain: [ERROR] uncaught exception thrown!");
|
||||||
EaglerIntegratedServerWorker.sendLogMessagePacket(EagRuntime.getStackTrace(t), true);
|
EaglerIntegratedServerWorker.sendLogMessagePacket(EagRuntime.getStackTrace(t), true);
|
||||||
EagRuntime.debugPrintStackTraceToSTDERR(t);
|
EagRuntime.debugPrintStackTraceToSTDERR(t);
|
||||||
EaglerIntegratedServerWorker.sendIPCPacket(new IPCPacket15Crashed("UNCAUGHT EXCEPTION CAUGHT IN WORKER PROCESS!\n\n" + EagRuntime.getStackTrace(t)));
|
EaglerIntegratedServerWorker.sendIPCPacket(new IPCPacket15Crashed(
|
||||||
EaglerIntegratedServerWorker.sendIPCPacket(new IPCPacketFFProcessKeepAlive(IPCPacketFFProcessKeepAlive.EXITED));
|
"UNCAUGHT EXCEPTION CAUGHT IN WORKER PROCESS!\n\n" + EagRuntime.getStackTrace(t)));
|
||||||
|
EaglerIntegratedServerWorker
|
||||||
|
.sendIPCPacket(new IPCPacketFFProcessKeepAlive(IPCPacketFFProcessKeepAlive.EXITED));
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
__println(systemErr, true, "WorkerMain: [ERROR] eaglercraftx worker thread has exited");
|
__println(systemErr, true, "WorkerMain: [ERROR] eaglercraftx worker thread has exited");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue