fix build tools
This commit is contained in:
parent
2fa0bce6ae
commit
4b6c906c68
File diff suppressed because it is too large
Load Diff
|
@ -20,7 +20,7 @@
|
|||
|
||||
> DELETE 1 @ 1 : 4
|
||||
|
||||
> CHANGE 1 : 56 @ 1 : 4
|
||||
> CHANGE 1 : 57 @ 1 : 4
|
||||
|
||||
~
|
||||
~ import net.eaglerforge.EaglerForge;
|
||||
|
@ -28,6 +28,7 @@
|
|||
~ import net.eaglerforge.api.ModAPI;
|
||||
~ import net.eaglerforge.api.ModData;
|
||||
~ import net.eaglerforge.api.ModLoader;
|
||||
~ import net.eaglerforge.gui.EmptyGui;
|
||||
~ import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
|
||||
~
|
||||
~ import org.apache.commons.lang3.Validate;
|
||||
|
@ -743,11 +744,23 @@
|
|||
|
||||
> CHANGE 2 : 3 @ 2 : 6
|
||||
|
||||
~ return "Definitely Not; You're an eagler";
|
||||
~ return "true";
|
||||
|
||||
> DELETE 36 @ 36 : 41
|
||||
|
||||
> CHANGE 12 : 13 @ 12 : 13
|
||||
> INSERT 11 : 20 @ 11
|
||||
|
||||
+ public static ModData makeModData() {
|
||||
+ ModData mcglobal = new ModData();
|
||||
+ mcglobal.setCallbackString("currentScreen", () -> {
|
||||
+ return getMinecraft().currentScreen.toString();
|
||||
+ });
|
||||
+
|
||||
+ return mcglobal;
|
||||
+ }
|
||||
+
|
||||
|
||||
> CHANGE 1 : 2 @ 1 : 2
|
||||
|
||||
~ return this.addScheduledTaskFuture(new Runnable() {
|
||||
|
||||
|
|
|
@ -1,221 +0,0 @@
|
|||
package net.eaglerforge;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.Keyboard;
|
||||
import net.lax1dude.eaglercraft.v1_8.Mouse;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiNetworkSettingsButton;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenConnectOption;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenLANConnecting;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerList;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServer;
|
||||
import net.lax1dude.eaglercraft.v1_8.vfs.SYS;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiListExtended;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiScreenAddServer;
|
||||
import net.minecraft.client.gui.GuiYesNo;
|
||||
import net.minecraft.client.gui.GuiYesNoCallback;
|
||||
import net.minecraft.client.multiplayer.GuiConnecting;
|
||||
import net.minecraft.client.multiplayer.ServerData;
|
||||
import net.minecraft.client.multiplayer.ServerList;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
/**+
|
||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||
*
|
||||
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
|
||||
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
|
||||
*
|
||||
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. 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 GuiMods extends GuiScreen implements GuiYesNoCallback {
|
||||
private static final Logger logger = LogManager.getLogger();
|
||||
private GuiScreen parentScreen;
|
||||
private ServerList savedServerList;
|
||||
private GuiButton btnEditServer;
|
||||
private GuiButton btnSelectServer;
|
||||
private GuiButton btnDeleteServer;
|
||||
private boolean deletingServer;
|
||||
private boolean addingServer;
|
||||
private boolean editingServer;
|
||||
private boolean directConnect;
|
||||
private String hoveringText;
|
||||
public static int ModsLoaded = 0;
|
||||
|
||||
|
||||
private boolean initialized;
|
||||
private static long lastRefreshCommit = 0l;
|
||||
|
||||
private static LANServerList lanServerList = null;
|
||||
|
||||
public int ticksOpened;
|
||||
|
||||
private final GuiNetworkSettingsButton relaysButton;
|
||||
|
||||
public GuiMods(GuiScreen parentScreen) {
|
||||
this.parentScreen = parentScreen;
|
||||
this.relaysButton = new GuiNetworkSettingsButton(this);
|
||||
}
|
||||
|
||||
/**+
|
||||
* Adds the buttons (and other controls) to the screen in
|
||||
* question. Called when the GUI is displayed and when the
|
||||
* window resizes, the buttonList is cleared beforehand.
|
||||
*/
|
||||
public void initGui() {
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
this.buttonList.clear();
|
||||
if (!this.initialized) {
|
||||
this.initialized = true;
|
||||
} else {
|
||||
}
|
||||
|
||||
this.createButtons();
|
||||
}
|
||||
|
||||
/**+
|
||||
* Handles mouse input.
|
||||
*/
|
||||
public void handleMouseInput() throws IOException {
|
||||
super.handleMouseInput();
|
||||
}
|
||||
|
||||
public void createButtons() {
|
||||
this.buttonList.add(this.btnDeleteServer = new GuiButton(2, this.width / 2 - 230, this.height - 28, 150, 20,
|
||||
I18n.format("eaglerforge.menu.mods.removemod", new Object[0])));
|
||||
this.buttonList.add(new GuiButton(8, this.width / 2 + 4 - 77, this.height - 28, 150, 20,
|
||||
I18n.format("eaglerforge.menu.mods.addmod", new Object[0])));
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 + 4 + 80, this.height - 28, 150, 20,
|
||||
I18n.format("gui.done", new Object[0])));
|
||||
}
|
||||
|
||||
/**+
|
||||
* Called from the main game loop to update the screen.
|
||||
*/
|
||||
public void updateScreen() {
|
||||
super.updateScreen();
|
||||
++ticksOpened;
|
||||
}
|
||||
|
||||
/**+
|
||||
* Called when the screen is unloaded. Used to disable keyboard
|
||||
* repeat events
|
||||
*/
|
||||
public void onGuiClosed() {
|
||||
Keyboard.enableRepeatEvents(false);
|
||||
}
|
||||
|
||||
/**+
|
||||
* Called by the controls from the buttonList when activated.
|
||||
* (Mouse pressed for buttons)
|
||||
*/
|
||||
protected void actionPerformed(GuiButton parGuiButton) {
|
||||
if (parGuiButton.enabled) {
|
||||
if (parGuiButton.id == 2) {
|
||||
|
||||
} else if (parGuiButton.id == 0) {
|
||||
this.mc.displayGuiScreen(this.parentScreen);
|
||||
} else if (parGuiButton.id == 8) {
|
||||
EagRuntime.displayFileChooser("text/javascript", "js");
|
||||
if (EagRuntime.fileChooserHasResult()){
|
||||
ModsLoaded++;
|
||||
EagRuntime.clearFileChooserResult();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void refreshServerList() {
|
||||
this.mc.displayGuiScreen(new GuiMods(this.parentScreen));
|
||||
}
|
||||
|
||||
public void confirmClicked(boolean flag, int var2) {
|
||||
if (this.deletingServer) {
|
||||
this.deletingServer = false;
|
||||
long millis = System.currentTimeMillis();
|
||||
if (millis - lastRefreshCommit > 700l) {
|
||||
lastRefreshCommit = millis;
|
||||
this.refreshServerList();
|
||||
}
|
||||
} else if (this.directConnect) {
|
||||
this.directConnect = false;
|
||||
} else if (this.addingServer) {
|
||||
this.addingServer = false;
|
||||
long millis = System.currentTimeMillis();
|
||||
if (millis - lastRefreshCommit > 700l) {
|
||||
lastRefreshCommit = millis;
|
||||
this.refreshServerList();
|
||||
}
|
||||
} else if (this.editingServer) {
|
||||
this.editingServer = false;
|
||||
long millis = System.currentTimeMillis();
|
||||
if (millis - lastRefreshCommit > 700l) {
|
||||
lastRefreshCommit = millis;
|
||||
this.refreshServerList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**+
|
||||
* Draws the screen and all the components in it. Args : mouseX,
|
||||
* mouseY, renderPartialTicks
|
||||
*/
|
||||
public void drawScreen(int i, int j, float f) {
|
||||
this.hoveringText = null;
|
||||
this.drawDefaultBackground();
|
||||
this.drawCenteredString(this.fontRendererObj, I18n.format("eaglerforge.menu.mods.title", new Object[0]), this.width / 2,
|
||||
20, 16777215);
|
||||
super.drawScreen(i, j, f);
|
||||
if (this.hoveringText != null) {
|
||||
this.drawHoveringText(Lists.newArrayList(Splitter.on("\n").split(this.hoveringText)), i, j);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void connectToServer(ServerData server) {
|
||||
this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, server));
|
||||
}
|
||||
|
||||
|
||||
public void setHoveringText(String parString1) {
|
||||
this.hoveringText = parString1;
|
||||
}
|
||||
|
||||
/**+
|
||||
* Called when the mouse is clicked. Args : mouseX, mouseY,
|
||||
* clickedButton
|
||||
*/
|
||||
protected void mouseClicked(int parInt1, int parInt2, int parInt3) {
|
||||
relaysButton.mouseClicked(parInt1, parInt2, parInt3);
|
||||
super.mouseClicked(parInt1, parInt2, parInt3);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package net.eaglerforge.api;
|
||||
|
||||
import net.eaglerforge.gui.EmptyGui;
|
||||
import net.eaglerforge.gui.ModGUI;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
|
@ -24,6 +25,8 @@ import net.minecraft.client.gui.Gui;
|
|||
public class ModAPI {
|
||||
|
||||
private static Minecraft mc;
|
||||
|
||||
private static Gui gui;
|
||||
public ArrayList<String> requiredList;
|
||||
public static final Logger log = LogManager.getLogger();
|
||||
public static String version = projectForkVersion;
|
||||
|
@ -196,8 +199,8 @@ public class ModAPI {
|
|||
getModAPI().setCallbackVoid("rightClickMouse", () -> {
|
||||
mc.rightClickMouse();
|
||||
});
|
||||
getModAPI().setCallbackVoid("getFPS", () -> {
|
||||
getDebugFPS();
|
||||
getModAPI().setCallbackInt("getFPS", () -> {
|
||||
return getDebugFPS();
|
||||
});
|
||||
getModAPI().set("clientBrand", ClientBrandRetriever.getClientModName());
|
||||
|
||||
|
@ -208,6 +211,8 @@ public class ModAPI {
|
|||
setGlobal("mcinstance", mc);
|
||||
setGlobal("platform", PlatformAPI.makeModData());
|
||||
setGlobal("logger", LoggerAPI.makeModData());
|
||||
setGlobal("emptygui", EmptyGui.makeModData());
|
||||
setGlobal("mc", mc.makeModData());
|
||||
getModAPI().setCallbackInt("getdisplayHeight", () -> {
|
||||
return mc.displayHeight;
|
||||
});
|
||||
|
@ -221,7 +226,7 @@ public class ModAPI {
|
|||
mc.fontRendererObj.drawString(params.getString("msg"), params.getFloat("x"), params.getFloat("y"), params.getInt("color"), false);
|
||||
});
|
||||
getModAPI().setCallbackVoidWithDataArg("drawRect", (BaseData params) -> {
|
||||
Gui.drawRect(params.getInt("left"), params.getInt("top"), params.getInt("right"), params.getInt("bottom"), params.getInt("color"));
|
||||
gui.drawRect(params.getInt("left"), params.getInt("top"), params.getInt("right"), params.getInt("bottom"), params.getInt("color"));
|
||||
});
|
||||
ModGUI.loadFont();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
package net.eaglerforge.gui;
|
||||
|
||||
|
||||
import net.eaglerforge.api.BaseData;
|
||||
import net.eaglerforge.api.ModData;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
|
||||
public class EmptyGui extends GuiScreen {
|
||||
public static boolean initialized;
|
||||
public static boolean drawdefaultbg;
|
||||
|
||||
private static Minecraft mc;
|
||||
|
||||
public void initGui() {
|
||||
if(!this.initialized){
|
||||
this.initialized = true;
|
||||
}
|
||||
}
|
||||
public void onGuiClosed() {
|
||||
this.initialized = false;
|
||||
}
|
||||
|
||||
public static void setdrawdefaultbg(boolean value){
|
||||
drawdefaultbg = value;
|
||||
}
|
||||
|
||||
public void drawScreen(int i, int j, float f) {
|
||||
if(drawdefaultbg) {
|
||||
this.drawDefaultBackground();
|
||||
}
|
||||
|
||||
super.drawScreen(i, j, f);
|
||||
}
|
||||
|
||||
public static ModData makeModData() {
|
||||
ModData emptygui = new ModData();
|
||||
emptygui.set("drawdefaultbg", drawdefaultbg);
|
||||
emptygui.setCallbackVoid("DisplayGUI", () -> {
|
||||
mc.displayGuiScreen(new EmptyGui());
|
||||
});
|
||||
emptygui.setCallbackVoid("CloseGUI", () -> {
|
||||
mc.displayGuiScreen((GuiScreen) null);
|
||||
mc.setIngameFocus();
|
||||
});
|
||||
emptygui.setCallbackBoolean("isInitialized", () -> {
|
||||
return initialized;
|
||||
});
|
||||
return emptygui;
|
||||
}
|
||||
|
||||
public void loadModData(BaseData data) {
|
||||
drawdefaultbg = data.getBoolean("drawdefaultbg");
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
package net.eaglerforge.gui;
|
||||
|
||||
import org.teavm.jso.JSBody;
|
||||
|
||||
public class ModLoader {
|
||||
public static String[] Mods = {};
|
||||
|
||||
@JSBody(params = { "Mods" }, script = "window.ModLoader(Mods);")
|
||||
public static native void loadMods(String[] Mods);
|
||||
|
||||
@JSBody(params = {}, script = "loadLoader();")
|
||||
public static native void loadLoader();
|
||||
|
||||
@JSBody(params = { "Mods" }, script = "localStorage.setItem('ml::Mods', JSON.stringify(Mods))")
|
||||
private static native void saveMods(String[] Mods);
|
||||
|
||||
@JSBody(params = {}, script = "try { return JSON.parse(localStorage.getItem('ml::Mods')||'[]') } catch(err) {return []}")
|
||||
private static native String[] retrieveMods();
|
||||
|
||||
public static void saveModsToLocalStorage() {
|
||||
saveMods(Mods);
|
||||
};
|
||||
|
||||
public static void loadModsFromLocalStorage() {
|
||||
Mods = retrieveMods();
|
||||
};
|
||||
}
|
|
@ -14,7 +14,7 @@ public class EaglercraftVersion {
|
|||
/// Customize these to fit your fork:
|
||||
|
||||
public static final String projectForkName = "EaglerForge";
|
||||
public static final String projectForkVersion = "v1.2";
|
||||
public static final String projectForkVersion = "v1.2.1";
|
||||
public static final String projectForkVendor = "radmanplays";
|
||||
|
||||
public static final String projectForkURL = "https://github.com/eaglerforge/EaglerForge";
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
package net.lax1dude.eaglercraft.v1_8.sp.server;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.HString;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.Block;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.block.state.IBlockState;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.BlockPos;
|
||||
import net.minecraft.crash.CrashReportCategory;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2023-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 CrashReportHelper {
|
||||
|
||||
public static void addIntegratedServerBlockInfo(CrashReportCategory category, final BlockPos pos, final Block blockIn,
|
||||
final int blockData) {
|
||||
final int i = Block.getIdFromBlock(blockIn);
|
||||
category.addCrashSectionCallable("Block type", new Callable<String>() {
|
||||
public String call() throws Exception {
|
||||
try {
|
||||
return HString.format("ID #%d (%s // %s)", new Object[] { Integer.valueOf(i),
|
||||
blockIn.getUnlocalizedName(), blockIn.getClass().getName() });
|
||||
} catch (Throwable var2) {
|
||||
return "ID #" + i;
|
||||
}
|
||||
}
|
||||
});
|
||||
category.addCrashSectionCallable("Block data value", new Callable<String>() {
|
||||
public String call() throws Exception {
|
||||
if (blockData < 0) {
|
||||
return "Unknown? (Got " + blockData + ")";
|
||||
} else {
|
||||
String s = HString.format("%4s", new Object[] { Integer.toBinaryString(blockData) }).replace(" ",
|
||||
"0");
|
||||
return HString.format("%1$d / 0x%1$X / 0b%2$s", new Object[] { Integer.valueOf(blockData), s });
|
||||
}
|
||||
}
|
||||
});
|
||||
category.addCrashSectionCallable("Block location", new Callable<String>() {
|
||||
public String call() throws Exception {
|
||||
return CrashReportCategory.getCoordinateInfo(new net.minecraft.util.BlockPos(pos.getX(), pos.getY(), pos.getZ()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void addIntegratedServerBlockInfo(CrashReportCategory category, final BlockPos pos, final IBlockState state) {
|
||||
category.addCrashSectionCallable("Block", new Callable<String>() {
|
||||
public String call() throws Exception {
|
||||
return state.toString();
|
||||
}
|
||||
});
|
||||
category.addCrashSectionCallable("Block location", new Callable<String>() {
|
||||
public String call() throws Exception {
|
||||
return CrashReportCategory.getCoordinateInfo(new net.minecraft.util.BlockPos(pos.getX(), pos.getY(), pos.getZ()));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
package net.lax1dude.eaglercraft.v1_8.sp.server.classes;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2022-2024 lax1dude, ayunami2000. 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 ContextUtil {
|
||||
|
||||
public static final Logger LOGGER = LogManager.getLogger("ContextUtil");
|
||||
|
||||
private static boolean GUARD_CONTEXT = false; // disable guard, for stability
|
||||
|
||||
public static void enterContext() {
|
||||
if(!GUARD_CONTEXT) {
|
||||
GUARD_CONTEXT = true;
|
||||
LOGGER.info("Entered context");
|
||||
}
|
||||
}
|
||||
|
||||
public static void exitContext() {
|
||||
if(GUARD_CONTEXT) {
|
||||
GUARD_CONTEXT = false;
|
||||
LOGGER.info("Exited context");
|
||||
}
|
||||
}
|
||||
|
||||
public static void __checkIntegratedContextValid(String id) {
|
||||
if(GUARD_CONTEXT) {
|
||||
throw new IllegalContextAccessException("Illegal integrated server class access: " + id);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
package net.lax1dude.eaglercraft.v1_8.sp.server.classes;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.json.JSONTypeProvider;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.ChatStyle;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.util.IChatComponent;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.ChunkProviderSettings;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2022-2024 lax1dude, ayunami2000. 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 EaglerServerBootstrap {
|
||||
|
||||
private static boolean isCLInit = false;
|
||||
|
||||
public static void staticInit() {
|
||||
if(isCLInit) {
|
||||
return;
|
||||
}
|
||||
registerJSONTypes();
|
||||
isCLInit = true;
|
||||
}
|
||||
|
||||
public static void registerJSONTypes() {
|
||||
JSONTypeProvider.registerType(IChatComponent.class, new IChatComponent.Serializer());
|
||||
JSONTypeProvider.registerType(ChatStyle.class, new ChatStyle.Serializer());
|
||||
JSONTypeProvider.registerType(ChunkProviderSettings.Factory.class, new ChunkProviderSettings.Serializer());
|
||||
}
|
||||
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
package net.lax1dude.eaglercraft.v1_8.sp.server.classes;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2022-2024 lax1dude, ayunami2000. 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 IllegalContextAccessException extends RuntimeException {
|
||||
|
||||
public IllegalContextAccessException() {
|
||||
}
|
||||
|
||||
public IllegalContextAccessException(String s) {
|
||||
super(s);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* 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 interface EntityConstructor<T> {
|
||||
|
||||
T createEntity(World world);
|
||||
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
package me.otterdev;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
// OG code by Ran
|
||||
// uwuifies any sentence/word!
|
||||
// Usage:
|
||||
// UwUAPI.uwuify("Your text here");
|
||||
public class UwUAPI {
|
||||
public static String uwuify(String stringToUwuify) {
|
||||
return stringToUwuify.toLowerCase().replaceAll("r|l","w").replaceAll("n([aeiou])", "ny$1").replaceAll("ove", "uve").replaceAll("uck", "uwq").replaceFirst("i", "i-i").replaceFirst("(?s)(.*)" + "i-i-i", "$1" + "i-i") + ((new Random().nextInt(10)) <= 2 ? " >_<" : "");
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue