Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotswapping with JBR #137

Merged
merged 5 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions develop/getting-started/launching-the-game.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: Launching the Game
description: Learn how to utilize the various launch profiles to start and debug your mods in a live game environment.
authors:
- IMB11
- Tenneb22
---

# Launching the Game {#launching-the-game}
Expand Down Expand Up @@ -36,6 +37,14 @@ You're still quite limited though:
- You can't change method parameters
- You can't add or remove fields

However, with the use the [JetBrains Runtime](https://github.com/JetBrains/JetBrainsRuntime), you are able to circumvent most of the limitations, even adding and removing classes and methods. This should allow for most changes without restarting the game.

Also, add in your Minecraft run configuration the following to the VM Arguments option:
Tenneb22 marked this conversation as resolved.
Show resolved Hide resolved

```:no-line-numbers
-XX:+AllowEnhancedClassRedefinition
```

## Hotswapping Mixins {#hotswapping-mixins}

If you're using Mixins, you can hotswap your Mixin classes without restarting the game. This is useful for quickly testing changes to your Mixins.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: Starten des Spiels
description: Lerne, wie du die verschiedenen Startprofile verwendest, um deine Mods in einer Live-Spielumgebung zu starten und zu debuggen.
authors:
- IMB11
- Tenneb22
---

# Starten des Spiels
Expand Down Expand Up @@ -36,6 +37,14 @@ Du bist aber immer noch ziemlich eingeschränkt:
- Du kannst die Methodenparameter nicht ändern
- Du kannst keine Attribute hinzufügen oder entfernen

Mit der Nutzung der [JetBrains Runtime](https://github.com/JetBrains/JetBrainsRuntime) hingegen, kannst du die meisten Einschränkungen umgehen, wie das Erstellen und Löschen von Klassen und Methoden. Dadurch sollten die meisten Änderungen möglich sein, ohne das Spiel neu zu starten.

Füge außerdem in deine Minecraft Start Konfigurationen Folgendes zu den VM Argumenten hinzu:

```:no-line-numbers
-XX:+AllowEnhancedClassRedefinition
```

## Hotswapping von Mixins

Wenn du Mixins verwendest, kannst du deine Mixin-Klassen per Hotswap austauschen, ohne das Spiel neu zu starten. Dies ist nützlich, um Änderungen an deinen Mixins schnell zu testen.
Expand Down