mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-26 07:19:26 -09:00
mods
This commit is contained in:
parent
17d1e4d83e
commit
2ef84bdb64
@ -34,6 +34,7 @@ function button_utility_script(inputArr, bindingClass, actionBindMode) {
|
|||||||
|
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
|
ModAPI.require("player");
|
||||||
var backlog = [];
|
var backlog = [];
|
||||||
var delayState = false;
|
var delayState = false;
|
||||||
|
|
||||||
@ -61,13 +62,13 @@ function button_utility_script(inputArr, bindingClass, actionBindMode) {
|
|||||||
var dupeHuntButtons = [{
|
var dupeHuntButtons = [{
|
||||||
text: "Silently Close",
|
text: "Silently Close",
|
||||||
click: () => {
|
click: () => {
|
||||||
ModAPI.minecraft.currentScreen = null;
|
ModAPI.minecraft.displayGuiScreen(null);
|
||||||
},
|
},
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0,
|
||||||
w: 100,
|
w: 100,
|
||||||
h: 20,
|
h: 20,
|
||||||
uid: 15254
|
uid: 142715254
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "Toggle Delay",
|
text: "Toggle Delay",
|
||||||
@ -86,8 +87,57 @@ function button_utility_script(inputArr, bindingClass, actionBindMode) {
|
|||||||
y: 20,
|
y: 20,
|
||||||
w: 100,
|
w: 100,
|
||||||
h: 20,
|
h: 20,
|
||||||
uid: 15252
|
uid: 142715253
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "Server Close",
|
||||||
|
click: () => {
|
||||||
|
var CloseWindow = ModAPI.reflect.getClassByName("C0DPacketCloseWindow").constructors.find(x => x.length === 1);
|
||||||
|
ModAPI.player.sendQueue.addToSendQueue(CloseWindow(ModAPI.player.openContainer.getCorrective().windowId));
|
||||||
|
},
|
||||||
|
x: 0,
|
||||||
|
y: 40,
|
||||||
|
w: 100,
|
||||||
|
h: 20,
|
||||||
|
uid: 142715252
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "Send & Disconnect",
|
||||||
|
click: () => {
|
||||||
|
delayState = false;
|
||||||
|
for (let i = 0; i < backlog.length; i++) {
|
||||||
|
const backlogItem = backlog[i];
|
||||||
|
originalSend.call(backlogItem.thisArg, backlogItem.data);
|
||||||
|
}
|
||||||
|
backlog = [];
|
||||||
|
ModAPI.mc.getNetHandler().getNetworkManager().doClientDisconnect(ModAPI.hooks._classMap[ModAPI.util.getCompiledName("net.minecraft.util.ChatComponentText")].constructors[0](ModAPI.util.str("Dupe Hunting Utils Disconnect")));
|
||||||
|
},
|
||||||
|
x: 0,
|
||||||
|
y: 60,
|
||||||
|
w: 100,
|
||||||
|
h: 20,
|
||||||
|
uid: 142715251
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "Use Chat",
|
||||||
|
click: () => {
|
||||||
|
var p = window.prompt("Input chat/command:", "Hello World");
|
||||||
|
if (p) {
|
||||||
|
ModAPI.player.sendChatMessage(ModAPI.util.str(p));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
x: 0,
|
||||||
|
y: 80,
|
||||||
|
w: 100,
|
||||||
|
h: 20,
|
||||||
|
uid: 142715250
|
||||||
}];
|
}];
|
||||||
|
|
||||||
button_utility_script(dupeHuntButtons, "net.minecraft.client.gui.inventory.GuiInventory");
|
[
|
||||||
})()
|
"net.minecraft.client.gui.inventory.GuiInventory",
|
||||||
|
"net.minecraft.client.gui.inventory.GuiContainerCreative",
|
||||||
|
"net.minecraft.client.gui.inventory.GuiBeacon"
|
||||||
|
].forEach(ui => {
|
||||||
|
button_utility_script(dupeHuntButtons, ui, 0);
|
||||||
|
});
|
||||||
|
})();
|
12
examplemods/f11fix.js
Normal file
12
examplemods/f11fix.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
(() => {
|
||||||
|
ModAPI.meta.title("Fullscreen Fixer");
|
||||||
|
ModAPI.meta.credits("By ZXMushroom63");
|
||||||
|
var oldF11 = HTMLElement.prototype.requestFullscreen;
|
||||||
|
HTMLElement.prototype.requestFullscreen = function () {
|
||||||
|
if (this instanceof HTMLBodyElement) {
|
||||||
|
oldF11.apply(this, [])
|
||||||
|
} else {
|
||||||
|
document.body.requestFullscreen()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
Loading…
x
Reference in New Issue
Block a user