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