mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-13 07:15:10 +01:00
Compare commits
5 Commits
114a72cdde
...
architectu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e022fd1827 | ||
|
|
fbecfd5642 | ||
|
|
036be42bec | ||
|
|
4cfee5ba2e | ||
|
|
d753641fa9 |
@@ -86,12 +86,16 @@ public class MidnightControlsClient extends MidnightControls {
|
||||
int period = 1; // repeat every 0.001 sec. (1000 times a second)
|
||||
Timer timer = new Timer();
|
||||
timer.scheduleAtFixedRate(new TimerTask() {
|
||||
public void run() { // TODO: Add a try/catch here after the alpha testing period
|
||||
if (lateInitDone && client.isRunning()) {
|
||||
if (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER && (client.isWindowFocused() || MidnightControlsConfig.unfocusedInput)) {
|
||||
input.tickCameraStick();
|
||||
input.updateCamera();
|
||||
public void run() {
|
||||
try {
|
||||
if (lateInitDone && client.isRunning()) {
|
||||
if (MidnightControlsConfig.controlsMode != ControlsMode.DEFAULT && (client.isWindowFocused() || MidnightControlsConfig.unfocusedInput)) {
|
||||
input.tickCameraStick();
|
||||
input.updateCamera();
|
||||
}
|
||||
}
|
||||
} catch (Exception | Error e) {
|
||||
MidnightControls.logger.error("Exception encountered in camera loop: ",e);
|
||||
}
|
||||
}
|
||||
}, delay, period);
|
||||
|
||||
@@ -8,7 +8,7 @@ yarn_mappings=1.21+build.2
|
||||
enabled_platforms=fabric,neoforge
|
||||
|
||||
archives_base_name=midnightcontrols
|
||||
mod_version=1.10.0
|
||||
mod_version=1.10.0.1
|
||||
maven_group=eu.midnightdust
|
||||
release_type=beta
|
||||
modrinth_id = bXX9h73M
|
||||
|
||||
@@ -3,7 +3,7 @@ package eu.midnightdust.midnightcontrols.client.util.platform.neoforge;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.network.packet.CustomPayload;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.packet.c2s.common.CustomPayloadC2SPacket;
|
||||
import net.neoforged.neoforge.network.PacketDistributor;
|
||||
|
||||
import static eu.midnightdust.midnightcontrols.client.MidnightControlsClient.client;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class NetworkUtilImpl {
|
||||
handler.send(packet);
|
||||
}
|
||||
public static void sendPayloadC2S(CustomPayload payload) {
|
||||
if (handler != null && client.world != null)
|
||||
handler.send(new CustomPayloadC2SPacket(payload));
|
||||
if (handler != null && client.world != null && handler.hasChannel(payload.getId().id()))
|
||||
PacketDistributor.sendToServer(payload);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user