generated from neoforged/MDK
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempted to load class net/minecraft/client/player/LocalPlayer for i…
…nvalid dist DEDICATED_SERVER
- Loading branch information
1 parent
64bcfe0
commit 862e2c2
Showing
5 changed files
with
22 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
src/main/java/com/leclowndu93150/modular_angelring/networking/PayloadActions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
package com.leclowndu93150.modular_angelring.networking; | ||
|
||
import com.leclowndu93150.modular_angelring.AngelRingMain; | ||
import com.leclowndu93150.modular_angelring.registry.KeyBindRegistry; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.level.Level; | ||
import net.neoforged.neoforge.network.handling.IPayloadContext; | ||
|
||
public final class PayloadActions { | ||
public static boolean inertiaEnabled = true; | ||
public static boolean speedEnabled = true; | ||
|
||
public static void keyPressedAction(KeyPressedPayload payload, IPayloadContext ctx) { | ||
// SERVER-SIDE | ||
Player player = ctx.player(); | ||
Level level = player.level(); | ||
int key = payload.key(); | ||
if (key == KeyBindRegistry.INERTIA_MODULE.get().getKey().getValue()) { | ||
// do stuff if inertia module key was pressed | ||
System.out.println("Inertia pressed"); | ||
inertiaEnabled = !inertiaEnabled; | ||
} | ||
|
||
if (key == KeyBindRegistry.SPEED_MODULE.get().getKey().getValue()) { | ||
speedEnabled = !speedEnabled; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters