0
0
mirror of https://github.com/Wurst-Imperium/Wurst7.git synced 2024-09-19 17:02:13 +02:00

Update Fabric stuff

This commit is contained in:
Alexander01998 2021-08-04 19:50:56 +02:00
parent 3e6a0af07f
commit 9abdf8d251
47 changed files with 91 additions and 91 deletions

View File

@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.8.3'
id 'fabric-loom' version '0.9.+'
id 'maven-publish'
}

View File

@ -5,11 +5,11 @@ org.gradle.jvmargs=-Xmx1G
# check these on https://modmuss50.me/fabric.html and
# https://www.curseforge.com/minecraft/mc-mods/fabric-api
minecraft_version=1.17.1
yarn_mappings=1.17.1+build.1
yarn_mappings=1.17.1+build.32
loader_version=0.11.6
#Fabric api
fabric_version=0.36.1+1.17
fabric_version=0.37.1+1.17
# Mod Properties
mod_version = v7.16-MC1.17.1

View File

@ -31,6 +31,6 @@ public final class AddAltScreen extends AltEditorScreen
protected void pressDoneButton()
{
altManager.add(getEmail(), getPassword(), false);
client.openScreen(prevScreen);
client.setScreen(prevScreen);
}
}

View File

@ -78,7 +78,7 @@ public abstract class AltEditorScreen extends Screen
addDrawableChild(
new ButtonWidget(width / 2 - 100, height / 4 + 120 + 12, 200, 20,
new LiteralText("Cancel"), b -> client.openScreen(prevScreen)));
new LiteralText("Cancel"), b -> client.setScreen(prevScreen)));
addDrawableChild(new ButtonWidget(width / 2 - 100, height / 4 + 96 + 12,
200, 20, new LiteralText("Random Name"),

View File

@ -80,7 +80,7 @@ public final class AltManagerScreen extends Screen
listGui = new ListGui(client, this, altManager.getList());
if(altManager.getList().isEmpty() && shouldAsk)
client.openScreen(new ConfirmScreen(this::confirmGenerate,
client.setScreen(new ConfirmScreen(this::confirmGenerate,
new LiteralText("Your alt list is empty."), new LiteralText(
"Would you like some random alts to get started?")));
@ -89,11 +89,11 @@ public final class AltManagerScreen extends Screen
addDrawableChild(new ButtonWidget(width / 2 - 50, height - 52, 100, 20,
new LiteralText("Direct Login"),
b -> client.openScreen(new DirectLoginScreen(this))));
b -> client.setScreen(new DirectLoginScreen(this))));
addDrawableChild(new ButtonWidget(width / 2 + 54, height - 52, 100, 20,
new LiteralText("Add"),
b -> client.openScreen(new AddAltScreen(this, altManager))));
b -> client.setScreen(new AddAltScreen(this, altManager))));
addDrawableChild(
starButton = new ButtonWidget(width / 2 - 154, height - 28, 75, 20,
@ -107,7 +107,7 @@ public final class AltManagerScreen extends Screen
new LiteralText("Delete"), b -> pressDelete()));
addDrawableChild(new ButtonWidget(width / 2 + 80, height - 28, 75, 20,
new LiteralText("Cancel"), b -> client.openScreen(prevScreen)));
new LiteralText("Cancel"), b -> client.setScreen(prevScreen)));
addDrawableChild(importButton = new ButtonWidget(8, 8, 50, 20,
new LiteralText("Import"), b -> pressImportAlts()));
@ -184,7 +184,7 @@ public final class AltManagerScreen extends Screen
if(alt.isCracked())
{
LoginManager.changeCrackedName(alt.getEmail());
client.openScreen(prevScreen);
client.setScreen(prevScreen);
return;
}
@ -198,7 +198,7 @@ public final class AltManagerScreen extends Screen
altManager.setChecked(listGui.selected,
client.getSession().getUsername());
client.openScreen(prevScreen);
client.setScreen(prevScreen);
}
private void pressFavorite()
@ -217,7 +217,7 @@ public final class AltManagerScreen extends Screen
if(alt == null)
return;
client.openScreen(new EditAltScreen(this, altManager, alt));
client.setScreen(new EditAltScreen(this, altManager, alt));
}
private void pressDelete()
@ -235,7 +235,7 @@ public final class AltManagerScreen extends Screen
ConfirmScreen screen = new ConfirmScreen(this::confirmRemove, text,
message, new LiteralText("Delete"), new LiteralText("Cancel"));
client.openScreen(screen);
client.setScreen(screen);
}
private void pressImportAlts()
@ -368,7 +368,7 @@ public final class AltManagerScreen extends Screen
}
shouldAsk = false;
client.openScreen(this);
client.setScreen(this);
}
private void confirmRemove(boolean confirmed)
@ -376,7 +376,7 @@ public final class AltManagerScreen extends Screen
if(confirmed)
altManager.remove(listGui.selected);
client.openScreen(this);
client.setScreen(this);
}
@Override

View File

@ -37,7 +37,7 @@ public final class DirectLoginScreen extends AltEditorScreen
message = LoginManager.login(getEmail(), getPassword());
if(message.isEmpty())
client.openScreen(new TitleScreen());
client.setScreen(new TitleScreen());
else
doErrorEffect();
}

View File

@ -47,6 +47,6 @@ public final class EditAltScreen extends AltEditorScreen
protected void pressDoneButton()
{
altManager.edit(editedAlt, getEmail(), getPassword());
client.openScreen(prevScreen);
client.setScreen(prevScreen);
}
}

View File

@ -56,7 +56,7 @@ public final class BlockComponent extends Component
Screen currentScreen = WurstClient.MC.currentScreen;
EditBlockScreen editScreen =
new EditBlockScreen(currentScreen, setting);
WurstClient.MC.openScreen(editScreen);
WurstClient.MC.setScreen(editScreen);
}else if(mouseButton == 1)
setting.resetToDefault();

View File

@ -51,7 +51,7 @@ public final class BlockListEditButton extends Component
if(mouseX < getX() + getWidth() - buttonWidth - 4)
return;
WurstClient.MC.openScreen(
WurstClient.MC.setScreen(
new EditBlockListScreen(WurstClient.MC.currentScreen, setting));
}

View File

@ -50,7 +50,7 @@ public final class FileComponent extends Component
if(mouseX < getX() + getWidth() - buttonWidth - 4)
return;
WurstClient.MC.openScreen(
WurstClient.MC.setScreen(
new SelectFileScreen(WurstClient.MC.currentScreen, setting));
}

View File

@ -49,7 +49,7 @@ public final class ItemListEditButton extends Component
if(mouseX < getX() + getWidth() - buttonWidth - 4)
return;
WurstClient.MC.openScreen(
WurstClient.MC.setScreen(
new EditItemListScreen(WurstClient.MC.currentScreen, setting));
}

View File

@ -65,7 +65,7 @@ public final class SliderComponent extends Component
private void handleLeftClick()
{
if(Screen.hasControlDown())
MC.openScreen(new EditSliderScreen(MC.currentScreen, setting));
MC.setScreen(new EditSliderScreen(MC.currentScreen, setting));
else
dragging = true;
}

View File

@ -79,16 +79,16 @@ public final class EditBlockListScreen extends Screen
addDrawableChild(new ButtonWidget(width - 108, 8, 100, 20,
new LiteralText("Reset to Defaults"),
b -> client.openScreen(new ConfirmScreen(b2 -> {
b -> client.setScreen(new ConfirmScreen(b2 -> {
if(b2)
blockList.resetToDefaults();
client.openScreen(EditBlockListScreen.this);
client.setScreen(EditBlockListScreen.this);
}, new LiteralText("Reset to Defaults"),
new LiteralText("Are you sure?")))));
addDrawableChild(
doneButton = new ButtonWidget(width / 2 - 100, height - 28, 200, 20,
new LiteralText("Done"), b -> client.openScreen(prevScreen)));
new LiteralText("Done"), b -> client.setScreen(prevScreen)));
}
@Override

View File

@ -81,7 +81,7 @@ public final class EditBlockScreen extends Screen
if(block != null)
setting.setBlock(block);
client.openScreen(prevScreen);
client.setScreen(prevScreen);
}
@Override
@ -94,7 +94,7 @@ public final class EditBlockScreen extends Screen
break;
case GLFW.GLFW_KEY_ESCAPE:
client.openScreen(prevScreen);
client.setScreen(prevScreen);
break;
}

View File

@ -78,16 +78,16 @@ public final class EditItemListScreen extends Screen
addDrawableChild(new ButtonWidget(width - 108, 8, 100, 20,
new LiteralText("Reset to Defaults"),
b -> client.openScreen(new ConfirmScreen(b2 -> {
b -> client.setScreen(new ConfirmScreen(b2 -> {
if(b2)
itemList.resetToDefaults();
client.openScreen(EditItemListScreen.this);
client.setScreen(EditItemListScreen.this);
}, new LiteralText("Reset to Defaults"),
new LiteralText("Are you sure?")))));
addDrawableChild(
doneButton = new ButtonWidget(width / 2 - 100, height - 28, 200, 20,
new LiteralText("Done"), b -> client.openScreen(prevScreen)));
new LiteralText("Done"), b -> client.setScreen(prevScreen)));
}
@Override

View File

@ -66,7 +66,7 @@ public final class EditSliderScreen extends Screen
if(MathUtils.isDouble(value))
slider.setValue(Double.parseDouble(value));
client.openScreen(prevScreen);
client.setScreen(prevScreen);
}
@Override
@ -79,7 +79,7 @@ public final class EditSliderScreen extends Screen
break;
case GLFW.GLFW_KEY_ESCAPE:
client.openScreen(prevScreen);
client.setScreen(prevScreen);
break;
}

View File

@ -69,7 +69,7 @@ public final class SelectFileScreen extends Screen
private void openPrevScreen()
{
client.openScreen(prevScreen);
client.setScreen(prevScreen);
}
private void done()
@ -94,7 +94,7 @@ public final class SelectFileScreen extends Screen
+ "Are you sure you want to do this?");
client
.openScreen(new ConfirmScreen(this::confirmReset, title, message));
.setScreen(new ConfirmScreen(this::confirmReset, title, message));
}
private void confirmReset(boolean confirmed)
@ -102,7 +102,7 @@ public final class SelectFileScreen extends Screen
if(confirmed)
setting.resetFolder();
client.openScreen(SelectFileScreen.this);
client.setScreen(SelectFileScreen.this);
}
@Override

View File

@ -42,6 +42,6 @@ public final class AuthorCmd extends Command
"You must hold a written book in your main hand.");
String author = String.join(" ", args);
heldItem.putSubTag("author", NbtString.of(author));
heldItem.setSubNbt("author", NbtString.of(author));
}
}

View File

@ -83,7 +83,7 @@ public final class GiveCmd extends Command
try
{
NbtCompound tag = StringNbtReader.parse(nbt);
stack.setTag(tag);
stack.setNbt(tag);
}catch(CommandSyntaxException e)
{

View File

@ -59,7 +59,7 @@ public final class InvseeCmd extends Command implements RenderListener
continue;
ChatUtils.message("Showing inventory of " + otherPlayerName + ".");
MC.openScreen(new InventoryScreen(player));
MC.setScreen(new InventoryScreen(player));
found = true;
break;
}

View File

@ -80,13 +80,13 @@ public final class ModifyCmd extends Command
String nbt = String.join(" ", Arrays.copyOfRange(args, 1, args.length));
nbt = nbt.replace("$", "\u00a7").replace("\u00a7\u00a7", "$");
if(!stack.hasTag())
stack.setTag(new NbtCompound());
if(!stack.hasNbt())
stack.setNbt(new NbtCompound());
try
{
NbtCompound tag = StringNbtReader.parse(nbt);
stack.getTag().copyFrom(tag);
stack.getNbt().copyFrom(tag);
}catch(CommandSyntaxException e)
{
@ -103,7 +103,7 @@ public final class ModifyCmd extends Command
try
{
NbtCompound tag = StringNbtReader.parse(nbt);
stack.setTag(tag);
stack.setNbt(tag);
}catch(CommandSyntaxException e)
{
@ -117,7 +117,7 @@ public final class ModifyCmd extends Command
if(args.length > 2)
throw new CmdSyntaxError();
NbtPath path = parseNbtPath(stack.getTag(), args[1]);
NbtPath path = parseNbtPath(stack.getNbt(), args[1]);
if(path == null)
throw new CmdError("The path does not exist.");

View File

@ -89,7 +89,7 @@ public final class PotionCmd extends Command
NbtCompound nbt = new NbtCompound();
nbt.put("CustomPotionEffects", effects);
stack.setTag(nbt);
stack.setNbt(nbt);
ChatUtils.message("Potion modified.");
}
@ -141,7 +141,7 @@ public final class PotionCmd extends Command
NbtCompound nbt = new NbtCompound();
nbt.put("CustomPotionEffects", newEffects);
stack.setTag(nbt);
stack.setNbt(nbt);
ChatUtils.message("Effect removed.");
}

View File

@ -34,7 +34,7 @@ public final class ViewNbtCmd extends Command
if(stack.isEmpty())
throw new CmdError("You must hold an item in your main hand.");
NbtCompound tag = stack.getTag();
NbtCompound tag = stack.getNbt();
String nbt = tag == null ? "" : tag.asString();
switch(String.join(" ", args).toLowerCase())

View File

@ -37,6 +37,6 @@ public final class AutoRespawnHack extends Hack implements DeathListener
public void onDeath()
{
MC.player.requestRespawn();
MC.openScreen(null);
MC.setScreen(null);
}
}

View File

@ -52,7 +52,7 @@ public final class ClickGuiHack extends Hack
@Override
public void onEnable()
{
MC.openScreen(new ClickGuiScreen(WURST.getGui()));
MC.setScreen(new ClickGuiScreen(WURST.getGui()));
setEnabled(false);
}

View File

@ -57,7 +57,7 @@ public final class CrashChestHack extends Hack
for(int i = 0; i < 40000; i++)
nbtList.add(new NbtList());
nbtCompound.put("www.wurstclient.net", nbtList);
stack.setTag(nbtCompound);
stack.setNbt(nbtCompound);
stack.setCustomName(new LiteralText("Copy Me"));
// give item

View File

@ -53,7 +53,7 @@ public final class KillPotionHack extends Hack
effects.add(effect);
NbtCompound nbt = new NbtCompound();
nbt.put("CustomPotionEffects", effects);
stack.setTag(nbt);
stack.setNbt(nbt);
String name = "\u00a7rSplash Potion of \u00a74\u00a7lINSTANT DEATH";
stack.setCustomName(new LiteralText(name));

View File

@ -29,7 +29,7 @@ public final class NavigatorHack extends Hack
public void onEnable()
{
if(!(MC.currentScreen instanceof NavigatorMainScreen))
MC.openScreen(new NavigatorMainScreen());
MC.setScreen(new NavigatorMainScreen());
setEnabled(false);
}

View File

@ -45,7 +45,7 @@ public final class ServerCrasherHack extends Hack
Item item = Registry.ITEM.get(new Identifier("creeper_spawn_egg"));
ItemStack stack = new ItemStack(item, 1);
stack.setTag(createNBT());
stack.setNbt(createNBT());
placeStackInHotbar(stack);
setEnabled(false);

View File

@ -52,7 +52,7 @@ public final class TrollPotionHack extends Hack
}
NbtCompound nbt = new NbtCompound();
nbt.put("CustomPotionEffects", effects);
stack.setTag(nbt);
stack.setNbt(nbt);
String name = "\u00a7rSplash Potion of Trolling";
stack.setCustomName(new LiteralText(name));

View File

@ -168,7 +168,7 @@ public final class XRayHack extends Hack implements UpdateListener,
public void openBlockListEditor(Screen prevScreen)
{
MC.openScreen(new EditBlockListScreen(prevScreen, ores));
MC.setScreen(new EditBlockListScreen(prevScreen, ores));
}
private boolean isVisible(Block block)

View File

@ -62,7 +62,7 @@ public abstract class GameMenuScreenMixin extends Screen
private void openWurstOptions()
{
client.openScreen(new WurstOptionsScreen(this));
client.setScreen(new WurstOptionsScreen(this));
}
private void removeFeedbackAndBugReportButtons()

View File

@ -63,11 +63,11 @@ public class MultiplayerScreenMixin extends Screen implements IMultiplayerScreen
.joinLastServer((MultiplayerScreen)(Object)this)));
addDrawableChild(new ButtonWidget(width / 2 + 154 + 4, height - 52, 100,
20, new LiteralText("Server Finder"), b -> client.openScreen(
20, new LiteralText("Server Finder"), b -> client.setScreen(
new ServerFinderScreen((MultiplayerScreen)(Object)this))));
addDrawableChild(new ButtonWidget(width / 2 + 154 + 4, height - 28, 100,
20, new LiteralText("Clean Up"), b -> client.openScreen(
20, new LiteralText("Clean Up"), b -> client.setScreen(
new CleanUpScreen((MultiplayerScreen)(Object)this))));
}

View File

@ -40,7 +40,7 @@ public abstract class TitleScreenMixin extends Screen
addDrawableChild(new ButtonWidget(width / 2 + 2, y + spacingY * 2, 98,
20, new LiteralText("Alt Manager"),
b -> client.openScreen(new AltManagerScreen(this,
b -> client.setScreen(new AltManagerScreen(this,
WurstClient.INSTANCE.getAltManager()))));
for(Drawable d : ((IScreen)this).getButtons())

View File

@ -172,7 +172,7 @@ public final class NavigatorFeatureScreen extends NavigatorScreen
public void press()
{
// add keybind
WurstClient.MC.openScreen(new NavigatorNewKeybindScreen(
WurstClient.MC.setScreen(new NavigatorNewKeybindScreen(
possibleKeybinds, NavigatorFeatureScreen.this));
}
};
@ -234,7 +234,7 @@ public final class NavigatorFeatureScreen extends NavigatorScreen
public void press()
{
// remove keybind
client.openScreen(new NavigatorRemoveKeybindScreen(
client.setScreen(new NavigatorRemoveKeybindScreen(
existingKeybinds, NavigatorFeatureScreen.this));
}
});
@ -293,7 +293,7 @@ public final class NavigatorFeatureScreen extends NavigatorScreen
private void goBack()
{
parent.setExpanding(false);
client.openScreen(parent);
client.setScreen(parent);
}
@Override

View File

@ -115,7 +115,7 @@ public final class NavigatorMainScreen extends NavigatorScreen
// back button
if(button == GLFW.GLFW_MOUSE_BUTTON_4)
{
WurstClient.MC.openScreen((Screen)null);
WurstClient.MC.setScreen((Screen)null);
return;
}
@ -212,7 +212,7 @@ public final class NavigatorMainScreen extends NavigatorScreen
if(clickTimer < 4)
clickTimer++;
else
WurstClient.MC.openScreen(
WurstClient.MC.setScreen(
new NavigatorFeatureScreen(expandingFeature, this));
else if(!expanding && clickTimer > -1)
clickTimer--;

View File

@ -62,7 +62,7 @@ public class NavigatorNewKeybindScreen extends NavigatorScreen
WurstClient.INSTANCE.getNavigator()
.addPreference(parent.getFeature().getName());
WurstClient.MC.openScreen(parent);
WurstClient.MC.setScreen(parent);
}else
{
choosingKey = true;
@ -74,7 +74,7 @@ public class NavigatorNewKeybindScreen extends NavigatorScreen
// cancel button
addDrawableChild(new ButtonWidget(width / 2 + 2, height - 65, 149, 18,
new LiteralText("Cancel"), b -> WurstClient.MC.openScreen(parent)));
new LiteralText("Cancel"), b -> WurstClient.MC.setScreen(parent)));
}
@Override
@ -87,7 +87,7 @@ public class NavigatorNewKeybindScreen extends NavigatorScreen
okButton.active = !selectedKey.equals("key.keyboard.unknown");
}else if(keyCode == 1)
WurstClient.MC.openScreen(parent);
WurstClient.MC.setScreen(parent);
}
@Override

View File

@ -54,7 +54,7 @@ public class NavigatorRemoveKeybindScreen extends NavigatorScreen
// cancel button
addDrawableChild(new ButtonWidget(width / 2 + 2, height - 65, 149, 18,
new LiteralText("Cancel"), b -> client.openScreen(parent)));
new LiteralText("Cancel"), b -> client.setScreen(parent)));
}
private void remove()
@ -87,14 +87,14 @@ public class NavigatorRemoveKeybindScreen extends NavigatorScreen
WurstClient.INSTANCE.getNavigator()
.addPreference(parent.getFeature().getName());
client.openScreen(parent);
client.setScreen(parent);
}
@Override
protected void onKeyPress(int keyCode, int scanCode, int int_3)
{
if(keyCode == 1)
client.openScreen(parent);
client.setScreen(parent);
}
@Override

View File

@ -62,7 +62,7 @@ public final class EnterProfileNameScreen extends Screen
if(!value.isEmpty())
callback.accept(value);
client.openScreen(prevScreen);
client.setScreen(prevScreen);
}
@Override
@ -75,7 +75,7 @@ public final class EnterProfileNameScreen extends Screen
break;
case GLFW.GLFW_KEY_ESCAPE:
client.openScreen(prevScreen);
client.setScreen(prevScreen);
break;
}

View File

@ -50,13 +50,13 @@ public final class KeybindEditorScreen extends Screen
{
addDrawableChild(new ButtonWidget(width / 2 - 100, 60, 200, 20,
new LiteralText("Change Key"),
b -> client.openScreen(new PressAKeyScreen(this))));
b -> client.setScreen(new PressAKeyScreen(this))));
addDrawableChild(new ButtonWidget(width / 2 - 100, height / 4 + 72, 200,
20, new LiteralText("Save"), b -> save()));
addDrawableChild(new ButtonWidget(width / 2 - 100, height / 4 + 96, 200,
20, new LiteralText("Cancel"), b -> client.openScreen(prevScreen)));
20, new LiteralText("Cancel"), b -> client.setScreen(prevScreen)));
commandField = new TextFieldWidget(textRenderer, width / 2 - 100, 100,
200, 20, new LiteralText(""));
@ -75,7 +75,7 @@ public final class KeybindEditorScreen extends Screen
WurstClient.INSTANCE.getKeybinds().remove(oldKey);
WurstClient.INSTANCE.getKeybinds().add(key, commandField.getText());
client.openScreen(prevScreen);
client.setScreen(prevScreen);
}
@Override

View File

@ -43,7 +43,7 @@ public final class KeybindManagerScreen extends Screen
addDrawableChild(addButton = new ButtonWidget(width / 2 - 102,
height - 52, 100, 20, new LiteralText("Add"),
b -> client.openScreen(new KeybindEditorScreen(this))));
b -> client.setScreen(new KeybindEditorScreen(this))));
addDrawableChild(editButton = new ButtonWidget(width / 2 + 2,
height - 52, 100, 20, new LiteralText("Edit"), b -> edit()));
@ -53,29 +53,29 @@ public final class KeybindManagerScreen extends Screen
addDrawableChild(
backButton = new ButtonWidget(width / 2 + 2, height - 28, 100, 20,
new LiteralText("Back"), b -> client.openScreen(prevScreen)));
new LiteralText("Back"), b -> client.setScreen(prevScreen)));
addDrawableChild(
new ButtonWidget(8, 8, 100, 20, new LiteralText("Reset Keybinds"),
b -> client.openScreen(new ConfirmScreen(confirmed -> {
b -> client.setScreen(new ConfirmScreen(confirmed -> {
if(confirmed)
WurstClient.INSTANCE.getKeybinds()
.setKeybinds(KeybindList.DEFAULT_KEYBINDS);
client.openScreen(this);
client.setScreen(this);
}, new LiteralText(
"Are you sure you want to reset your keybinds?"),
new LiteralText("This cannot be undone!")))));
addDrawableChild(new ButtonWidget(width - 108, 8, 100, 20,
new LiteralText("Profiles..."),
b -> client.openScreen(new KeybindProfilesScreen(this))));
b -> client.setScreen(new KeybindProfilesScreen(this))));
}
private void edit()
{
Keybind keybind = WurstClient.INSTANCE.getKeybinds().getAllKeybinds()
.get(listGui.selected);
client.openScreen(new KeybindEditorScreen(this, keybind.getKey(),
client.setScreen(new KeybindEditorScreen(this, keybind.getKey(),
keybind.getCommands()));
}

View File

@ -49,7 +49,7 @@ public final class KeybindProfilesScreen extends Screen
new LiteralText("Open Folder"), b -> openFolder()));
addDrawableChild(new ButtonWidget(width / 2 - 154, height - 48, 100, 20,
new LiteralText("New Profile"), b -> client.openScreen(
new LiteralText("New Profile"), b -> client.setScreen(
new EnterProfileNameScreen(this, this::newProfile))));
loadButton =
@ -106,7 +106,7 @@ public final class KeybindProfilesScreen extends Screen
private void openPrevScreen()
{
client.openScreen(prevScreen);
client.setScreen(prevScreen);
}
@Override

View File

@ -34,7 +34,7 @@ public class PressAKeyScreen extends Screen
if(keyCode != GLFW.GLFW_KEY_ESCAPE)
prevScreen.setKey(getKeyName(keyCode, scanCode));
client.openScreen((Screen)prevScreen);
client.setScreen((Screen)prevScreen);
return super.keyPressed(keyCode, scanCode, int_3);
}

View File

@ -44,7 +44,7 @@ public class WurstOptionsScreen extends Screen
{
addDrawableChild(
new ButtonWidget(width / 2 - 100, height / 4 + 144 - 16, 200, 20,
new LiteralText("Back"), b -> client.openScreen(prevScreen)));
new LiteralText("Back"), b -> client.setScreen(prevScreen)));
addSettingButtons();
addManagerButtons();
@ -92,7 +92,7 @@ public class WurstOptionsScreen extends Screen
new WurstOptionsButton(-50, 24, () -> "Keybinds",
"Keybinds allow you to toggle any hack\n"
+ "or command by simply pressing a\n" + "button.",
b -> client.openScreen(new KeybindManagerScreen(this)));
b -> client.setScreen(new KeybindManagerScreen(this)));
new WurstOptionsButton(-50, 48, () -> "X-Ray Blocks",
"Manager for the blocks\n" + "that X-Ray will show.",
@ -102,7 +102,7 @@ public class WurstOptionsScreen extends Screen
"The Zoom Manager allows you to\n"
+ "change the zoom key, how far it\n"
+ "will zoom in and more.",
b -> client.openScreen(new ZoomManagerScreen(this)));
b -> client.setScreen(new ZoomManagerScreen(this)));
}
private void addLinkButtons()

View File

@ -41,12 +41,12 @@ public class ZoomManagerScreen extends Screen implements PressAKeyCallback
addDrawableChild(
new ButtonWidget(width / 2 - 100, height / 4 + 144 - 16, 200, 20,
new LiteralText("Back"), b -> client.openScreen(prevScreen)));
new LiteralText("Back"), b -> client.setScreen(prevScreen)));
addDrawableChild(
keyButton = new ButtonWidget(width / 2 - 79, height / 4 + 24 - 16,
158, 20, new LiteralText("Zoom Key: " + zoomKeyName),
b -> client.openScreen(new PressAKeyScreen(this))));
b -> client.setScreen(new PressAKeyScreen(this))));
addDrawableChild(new ButtonWidget(width / 2 - 79, height / 4 + 72 - 16,
50, 20, new LiteralText("More"), b -> level.increaseValue()));

View File

@ -50,7 +50,7 @@ public class CleanUpScreen extends Screen
{
addDrawableChild(
new CleanUpButton(width / 2 - 100, height / 4 + 168 + 12,
() -> "Cancel", "", b -> client.openScreen(prevScreen)));
() -> "Cancel", "", b -> client.setScreen(prevScreen)));
addDrawableChild(cleanUpButton = new CleanUpButton(width / 2 - 100,
height / 4 + 144 + 12, () -> "Clean Up",
@ -130,7 +130,7 @@ public class CleanUpScreen extends Screen
}
saveServerList();
client.openScreen(prevScreen);
client.setScreen(prevScreen);
}
private boolean shouldRemove(ServerInfo server)

View File

@ -57,7 +57,7 @@ public class ServerFinderScreen extends Screen
addDrawableChild(
new ButtonWidget(width / 2 - 100, height / 4 + 144 + 12, 200, 20,
new LiteralText("Back"), b -> client.openScreen(prevScreen)));
new LiteralText("Back"), b -> client.setScreen(prevScreen)));
ipBox = new TextFieldWidget(textRenderer, width / 2 - 100,
height / 4 + 34, 200, 20, new LiteralText(""));