├── settings.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── src └── main │ ├── resources │ ├── pack.mcmeta │ ├── mixins.lightfall.json │ └── META-INF │ │ └── mods.toml │ └── java │ └── io │ └── izzel │ └── lightfall │ └── client │ ├── bridge │ └── ClientLoginNetHandlerBridge.java │ ├── mixin │ ├── ClientPacketListenerAccessor.java │ └── ClientLoginNetHandlerMixin.java │ ├── gui │ └── LightfallHandshakeScreen.java │ └── LightfallClient.java ├── README.md ├── .github └── workflows │ └── gradle.yml ├── LICENSE ├── .gitignore ├── gradlew.bat └── gradlew /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'lightfallclient' 2 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx3G 2 | org.gradle.daemon=false 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArclightPowered/lightfall-client/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "lightfallclient resources", 4 | "pack_format": 8 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## lightfall-client 2 | 3 | Support Minecraft 1.16.X - 1.12.1. Versions after 1.20.2 no longer requires this mod. 4 | 5 | Use this with https://github.com/ArclightPowered/lightfall 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /src/main/java/io/izzel/lightfall/client/bridge/ClientLoginNetHandlerBridge.java: -------------------------------------------------------------------------------- 1 | package io.izzel.lightfall.client.bridge; 2 | 3 | 4 | import net.minecraft.client.multiplayer.ClientPacketListener; 5 | 6 | public interface ClientLoginNetHandlerBridge { 7 | 8 | void bridge$reusePlayHandler(ClientPacketListener handler); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/resources/mixins.lightfall.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "io.izzel.lightfall.client.mixin", 5 | "target": "@env(DEFAULT)", 6 | "refmap": "mixins.lightfall.refmap.json", 7 | "injectors": { 8 | "defaultRequire": 1 9 | }, 10 | "client": [ 11 | "ClientLoginNetHandlerMixin", 12 | "ClientPacketListenerAccessor" 13 | ] 14 | } -------------------------------------------------------------------------------- /src/main/java/io/izzel/lightfall/client/mixin/ClientPacketListenerAccessor.java: -------------------------------------------------------------------------------- 1 | package io.izzel.lightfall.client.mixin; 2 | 3 | import net.minecraft.client.multiplayer.ClientPacketListener; 4 | import net.minecraft.client.multiplayer.ServerData; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(ClientPacketListener.class) 9 | public interface ClientPacketListenerAccessor { 10 | 11 | @Accessor("serverData") 12 | ServerData accessor$getServerData(); 13 | } 14 | -------------------------------------------------------------------------------- /.github/workflows/gradle.yml: -------------------------------------------------------------------------------- 1 | 2 | name: Java CI with Gradle 3 | 4 | on: 5 | push: 6 | branches: 7 | - '**' 8 | pull_request: 9 | branches: 10 | - '**' 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Set up JDK 1.8 20 | uses: actions/setup-java@v1 21 | with: 22 | java-version: 1.8 23 | - name: Grant execute permission for gradlew 24 | run: chmod +x gradlew 25 | - name: Build with Gradle 26 | run: ./gradlew build 27 | - name: Upload Artifact 28 | uses: actions/upload-artifact@v2 29 | with: 30 | name: lightfall client jars 31 | path: ./build/libs/*.jar -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 IzzelAliz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /src/main/java/io/izzel/lightfall/client/mixin/ClientLoginNetHandlerMixin.java: -------------------------------------------------------------------------------- 1 | package io.izzel.lightfall.client.mixin; 2 | 3 | import io.izzel.lightfall.client.bridge.ClientLoginNetHandlerBridge; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.client.multiplayer.ClientHandshakePacketListenerImpl; 6 | import net.minecraft.client.multiplayer.ClientPacketListener; 7 | import net.minecraft.network.PacketListener; 8 | import net.minecraft.network.chat.Component; 9 | import net.minecraftforge.registries.GameData; 10 | import org.spongepowered.asm.mixin.Final; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.Shadow; 13 | import org.spongepowered.asm.mixin.injection.At; 14 | import org.spongepowered.asm.mixin.injection.Inject; 15 | import org.spongepowered.asm.mixin.injection.ModifyArg; 16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 17 | 18 | @Mixin(ClientHandshakePacketListenerImpl.class) 19 | public class ClientLoginNetHandlerMixin implements ClientLoginNetHandlerBridge { 20 | 21 | @Shadow @Final private Minecraft minecraft; 22 | 23 | private ClientPacketListener lightfall$reuse; 24 | 25 | @Override 26 | public void bridge$reusePlayHandler(ClientPacketListener handler) { 27 | this.lightfall$reuse = handler; 28 | } 29 | 30 | @ModifyArg(method = "handleGameProfile", index = 0, at = @At(value = "INVOKE", target = "Lnet/minecraft/network/Connection;setListener(Lnet/minecraft/network/PacketListener;)V")) 31 | private PacketListener lightfall$reuse(PacketListener origin) { 32 | if (lightfall$reuse != null) { 33 | this.minecraft.level = lightfall$reuse.getLevel(); 34 | } 35 | return lightfall$reuse == null ? origin : lightfall$reuse; 36 | } 37 | 38 | @Inject(method = "onDisconnect", at = @At("HEAD")) 39 | private void lightfall$resetState(Component p_104543_, CallbackInfo ci) { 40 | if (lightfall$reuse != null && lightfall$reuse.getLevel() != null) { 41 | this.minecraft.level = lightfall$reuse.getLevel(); 42 | this.minecraft.clearLevel(); 43 | } else { 44 | GameData.revertToFrozen(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # User-specific stuff 2 | .idea/ 3 | 4 | *.iml 5 | *.ipr 6 | *.iws 7 | 8 | # IntelliJ 9 | out/ 10 | # mpeltonen/sbt-idea plugin 11 | .idea_modules/ 12 | 13 | # JIRA plugin 14 | atlassian-ide-plugin.xml 15 | 16 | # Compiled class file 17 | *.class 18 | 19 | # Log file 20 | *.log 21 | 22 | # BlueJ files 23 | *.ctxt 24 | 25 | # Package Files # 26 | *.jar 27 | *.war 28 | *.nar 29 | *.ear 30 | *.zip 31 | *.tar.gz 32 | *.rar 33 | 34 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 35 | hs_err_pid* 36 | 37 | *~ 38 | 39 | # temporary files which can be created if a process still has a handle open of a deleted file 40 | .fuse_hidden* 41 | 42 | # KDE directory preferences 43 | .directory 44 | 45 | # Linux trash folder which might appear on any partition or disk 46 | .Trash-* 47 | 48 | # .nfs files are created when an open file is removed but is still being accessed 49 | .nfs* 50 | 51 | # General 52 | .DS_Store 53 | .AppleDouble 54 | .LSOverride 55 | 56 | # Icon must end with two \r 57 | Icon 58 | 59 | # Thumbnails 60 | ._* 61 | 62 | # Files that might appear in the root of a volume 63 | .DocumentRevisions-V100 64 | .fseventsd 65 | .Spotlight-V100 66 | .TemporaryItems 67 | .Trashes 68 | .VolumeIcon.icns 69 | .com.apple.timemachine.donotpresent 70 | 71 | # Directories potentially created on remote AFP share 72 | .AppleDB 73 | .AppleDesktop 74 | Network Trash Folder 75 | Temporary Items 76 | .apdisk 77 | 78 | # Windows thumbnail cache files 79 | Thumbs.db 80 | Thumbs.db:encryptable 81 | ehthumbs.db 82 | ehthumbs_vista.db 83 | 84 | # Dump file 85 | *.stackdump 86 | 87 | # Folder config file 88 | [Dd]esktop.ini 89 | 90 | # Recycle Bin used on file shares 91 | $RECYCLE.BIN/ 92 | 93 | # Windows Installer files 94 | *.cab 95 | *.msi 96 | *.msix 97 | *.msm 98 | *.msp 99 | 100 | # Windows shortcuts 101 | *.lnk 102 | 103 | .gradle 104 | build/ 105 | 106 | # Ignore Gradle GUI config 107 | gradle-app.setting 108 | 109 | # Cache of project 110 | .gradletasknamecache 111 | 112 | **/build/ 113 | 114 | # Common working directory 115 | run/ 116 | 117 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 118 | !gradle-wrapper.jar 119 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /src/main/java/io/izzel/lightfall/client/gui/LightfallHandshakeScreen.java: -------------------------------------------------------------------------------- 1 | package io.izzel.lightfall.client.gui; 2 | 3 | import com.mojang.blaze3d.vertex.PoseStack; 4 | import net.minecraft.client.GameNarrator; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.client.gui.GuiGraphics; 7 | import net.minecraft.client.gui.components.Button; 8 | import net.minecraft.client.gui.screens.Screen; 9 | import net.minecraft.client.gui.screens.TitleScreen; 10 | import net.minecraft.client.gui.screens.multiplayer.JoinMultiplayerScreen; 11 | import net.minecraft.network.Connection; 12 | import net.minecraft.network.chat.CommonComponents; 13 | import net.minecraft.network.chat.Component; 14 | import org.jetbrains.annotations.NotNull; 15 | 16 | public class LightfallHandshakeScreen extends Screen { 17 | 18 | private final Connection networkManager; 19 | private Component component; 20 | 21 | public LightfallHandshakeScreen(Connection netManager) { 22 | super(GameNarrator.NO_TITLE); 23 | this.networkManager = netManager; 24 | } 25 | 26 | @Override 27 | public void tick() { 28 | if (this.networkManager.isConnected()) { 29 | this.networkManager.tick(); 30 | } else { 31 | this.networkManager.handleDisconnection(); 32 | if (Minecraft.getInstance().screen == this) { 33 | Minecraft.getInstance().setScreen(new JoinMultiplayerScreen(new TitleScreen())); 34 | } 35 | } 36 | } 37 | 38 | @Override 39 | protected void init() { 40 | this.addRenderableWidget( 41 | Button.builder(CommonComponents.GUI_CANCEL, 42 | button -> { 43 | if (this.networkManager.isConnected()) { 44 | this.networkManager.disconnect(Component.translatable("connect.aborted")); 45 | } 46 | this.minecraft.setScreen(new JoinMultiplayerScreen(new TitleScreen())); 47 | }).bounds(this.width / 2 - 100, this.height / 4 + 120 + 12, 200, 20).build() 48 | ); 49 | } 50 | 51 | public void setComponent(Component component) { 52 | this.component = component; 53 | } 54 | 55 | public void render(@NotNull GuiGraphics gui, int p_96531_, int p_96532_, float p_96533_) { 56 | this.renderDirtBackground(gui); 57 | gui.drawCenteredString(this.font, component != null ? component : Component.translatable("connect.connecting"), 58 | this.width / 2, this.height / 2 - 50, 16777215); 59 | super.render(gui, p_96531_, p_96532_, p_96533_); 60 | } 61 | 62 | @Override 63 | public boolean shouldCloseOnEsc() { 64 | return false; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/mods.toml: -------------------------------------------------------------------------------- 1 | # This is an example mods.toml file. It contains the data relating to the loading mods. 2 | # There are several mandatory fields (#mandatory), and many more that are optional (#optional). 3 | # The overall format is standard TOML format, v0.5.0. 4 | # Note that there are a couple of TOML lists in this file. 5 | # Find more information on toml format here: https://github.com/toml-lang/toml 6 | # The name of the mod loader type to load - for regular FML @Mod mods it should be javafml 7 | modLoader = "javafml" #mandatory 8 | # A version range to match for said mod loader - for regular FML @Mod it will be the forge version 9 | loaderVersion = "[42,)" #mandatory (26 is current forge version) 10 | license="MIT License" 11 | # A list of mods - how many allowed here is determined by the individual mod loader 12 | [[mods]] #mandatory 13 | # The modid of the mod 14 | modId = "lightfallclient" #mandatory 15 | # The version number of the mod - there's a few well known ${} variables useable here or just hardcode it 16 | version = "${version}" #mandatory 17 | # A display name for the mod 18 | displayName = "LightfallClient" #mandatory 19 | # A URL to query for updates for this mod. See the JSON update specification 20 | #updateJSONURL="http://myurl.me/" #optional 21 | # A URL for the "homepage" for this mod, displayed in the mod UI 22 | #displayURL="http://example.com/" #optional 23 | # A file name (in the root of the mod JAR) containing a logo for display 24 | #logoFile="lightfallclient.png" #optional 25 | # A text field displayed in the mod UI 26 | #credits="Thanks for this example mod goes to Java" #optional 27 | # A text field displayed in the mod UI 28 | #authors="Love, Cheese and small house plants" #optional 29 | # The description text for the mod (multi line!) (#mandatory) 30 | description = ''' 31 | Forge BungeeCord support 32 | ''' 33 | # A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional. 34 | #[[dependencies.lightfallclient]] #optional 35 | # # the modid of the dependency 36 | # modId="forge" #mandatory 37 | # # Does this dependency have to exist - if not, ordering below must be specified 38 | # mandatory=true #mandatory 39 | # # The version range of the dependency 40 | # versionRange="[28,)" #mandatory 41 | # # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory 42 | # ordering="NONE" 43 | # # Side this dependency is applied on - BOTH, CLIENT or SERVER 44 | # side="BOTH" 45 | # Here's another dependency 46 | #[[dependencies.lightfallclient]] 47 | # modId="minecraft" 48 | # mandatory=true 49 | # versionRange="[1.14.4]" 50 | # ordering="NONE" 51 | # side="BOTH" 52 | -------------------------------------------------------------------------------- /src/main/java/io/izzel/lightfall/client/LightfallClient.java: -------------------------------------------------------------------------------- 1 | package io.izzel.lightfall.client; 2 | 3 | import io.izzel.lightfall.client.bridge.ClientLoginNetHandlerBridge; 4 | import io.izzel.lightfall.client.gui.LightfallHandshakeScreen; 5 | import io.izzel.lightfall.client.mixin.ClientPacketListenerAccessor; 6 | import io.netty.buffer.Unpooled; 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraft.client.gui.screens.TitleScreen; 9 | import net.minecraft.client.gui.screens.multiplayer.JoinMultiplayerScreen; 10 | import net.minecraft.client.multiplayer.ClientHandshakePacketListenerImpl; 11 | import net.minecraft.client.multiplayer.ClientPacketListener; 12 | import net.minecraft.network.ConnectionProtocol; 13 | import net.minecraft.network.FriendlyByteBuf; 14 | import net.minecraft.network.protocol.game.ClientGamePacketListener; 15 | import net.minecraft.network.protocol.login.ServerboundCustomQueryPacket; 16 | import net.minecraft.resources.ResourceLocation; 17 | import net.minecraftforge.api.distmarker.Dist; 18 | import net.minecraftforge.fml.DistExecutor; 19 | import net.minecraftforge.fml.IExtensionPoint; 20 | import net.minecraftforge.fml.ModLoadingContext; 21 | import net.minecraftforge.fml.common.Mod; 22 | import net.minecraftforge.network.NetworkConstants; 23 | import net.minecraftforge.network.NetworkEvent; 24 | import net.minecraftforge.network.NetworkRegistry; 25 | import net.minecraftforge.registries.GameData; 26 | 27 | import java.nio.charset.StandardCharsets; 28 | 29 | @Mod("lightfallclient") 30 | public class LightfallClient { 31 | 32 | private static final byte[] RESET_ACK = "lightfall:ack".getBytes(StandardCharsets.UTF_8); 33 | 34 | public LightfallClient() { 35 | DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> ClientSetup::registerChannel); 36 | ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, 37 | () -> new IExtensionPoint.DisplayTest(() -> NetworkConstants.IGNORESERVERONLY, (a, b) -> true)); 38 | } 39 | 40 | public static class ClientSetup { 41 | 42 | private static void registerChannel() { 43 | var channel = NetworkRegistry.newEventChannel( 44 | new ResourceLocation("lightfall", "reset"), 45 | () -> "1", s -> true, s -> true 46 | ); 47 | channel.addListener(ClientSetup::handleReset); 48 | } 49 | 50 | private static void handleReset(NetworkEvent.ServerCustomPayloadEvent event) { 51 | var context = event.getSource().get(); 52 | var netManager = context.getNetworkManager(); 53 | if (netManager == null || !(netManager.getPacketListener() instanceof ClientGamePacketListener)) { 54 | return; 55 | } 56 | context.enqueueWork(() -> { 57 | var client = Minecraft.getInstance(); 58 | var screen = new LightfallHandshakeScreen(netManager); 59 | client.setScreen(screen); 60 | if (client.level != null) { 61 | GameData.revertToFrozen(); 62 | client.level = null; 63 | } 64 | netManager.setProtocol(ConnectionProtocol.LOGIN); 65 | var buffer = new FriendlyByteBuf(Unpooled.wrappedBuffer(RESET_ACK)); 66 | netManager.send(new ServerboundCustomQueryPacket(0x11FFA1, buffer)); 67 | var packetListener = (ClientPacketListener) netManager.getPacketListener(); 68 | var netHandler = new ClientHandshakePacketListenerImpl(netManager, client, 69 | ((ClientPacketListenerAccessor) packetListener).accessor$getServerData(), 70 | new JoinMultiplayerScreen(new TitleScreen()), false, null, screen::setComponent); 71 | ((ClientLoginNetHandlerBridge) netHandler).bridge$reusePlayHandler(packetListener); 72 | netManager.setListener(netHandler); 73 | }).join(); 74 | context.setPacketHandled(true); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | --------------------------------------------------------------------------------