Skip to content

Commit

Permalink
0.6.9
Browse files Browse the repository at this point in the history
  • Loading branch information
burningtnt committed Dec 15, 2024
1 parent e217bca commit a862b52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod_name=Sign Me Up
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=BSD-3-Clause
# The mod version. See https://semver.org/
mod_version=0.6.8
mod_version=0.6.9
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
13 changes: 5 additions & 8 deletions src/main/java/org/teacon/signmeup/config/WaypointSyncHandle.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
import cn.ussshenzhou.t88.network.NetworkHelper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Rotations;
import net.minecraft.server.level.ServerPlayer;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.fml.loading.FMLEnvironment;
import net.neoforged.neoforge.event.entity.player.PlayerEvent;
import org.teacon.signmeup.SignMeUp;
import org.teacon.signmeup.network.SetWaypointPacket;
import org.teacon.signmeup.network.SyncWaypointPacket;

import java.util.List;
import java.util.Objects;

@EventBusSubscriber(value = Dist.DEDICATED_SERVER, modid = SignMeUp.MODID, bus = EventBusSubscriber.Bus.GAME)
Expand All @@ -29,11 +28,9 @@ public static void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) {
}
}

player.server.execute(() -> {
for (Waypoints.WayPoint waypoint : ConfigHelper.getConfigRead(Waypoints.class).waypoints) {
NetworkHelper.sendToPlayer(player, new SetWaypointPacket(waypoint.name, waypoint.description, new BlockPos(waypoint.x, waypoint.y, waypoint.z), new Rotations(waypoint.rx, 0, waypoint.ry)));
}
});
player.server.execute(() -> NetworkHelper.sendToPlayer(player, new SyncWaypointPacket(
List.copyOf(ConfigHelper.getConfigRead(Waypoints.class).waypoints)
)));
}
}
}

0 comments on commit a862b52

Please sign in to comment.