@@ -59,6 +59,7 @@ public class RelightTheThreePointStrategy implements ModInitializer {
5959 // That way, it's clear which mod wrote info, warnings, and errors.
6060 public static final Logger LOGGER = LoggerFactory .getLogger (MOD_ID );
6161 private boolean isMapBinding = false ;
62+ private int gameStatus = 0 ;
6263 @ Override
6364 public void onInitialize () {
6465 // This code runs as soon as Minecraft is in a mod-load-ready state.
@@ -184,6 +185,7 @@ private void respawnPlayer(ServerPlayerEntity player) {
184185 player .setHealth (player .getMaxHealth ());
185186 player .clearStatusEffects ();
186187 player .setOnFire (false );
188+ player .setFireTicks (0 );
187189 ServerWorld world = player .getServer ().getWorld (player .getWorld ().getRegistryKey ());
188190 player .teleport (world , 0 , 257 , -2 , Collections .emptySet (), 0 , 0 , false );
189191 player .getServer ().getPlayerManager ().getPlayerList ().forEach (Notifiee -> {
@@ -263,21 +265,16 @@ private void changeGameStatus(MinecraftServer server){
263265// }
264266// });
265267 scoreAccess .setScore (-1 );
268+ gameStatus = -1 ;
266269 }
267270 }
268271 private void createScoreboard (MinecraftServer server ) {
269272 Scoreboard scoreboard = server .getScoreboard ();
270273 if (scoreboard .getNullableObjective ("isGameStarted" )==null ){
271274 scoreboard .addObjective ("isGameStarted" , ScoreboardCriterion .DUMMY , Text .of ("游戏是否开始" ), ScoreboardCriterion .RenderType .INTEGER ,true ,null );
272275 }
273- if (scoreboard .getNullableObjective ("genRandom" )==null ){
274- scoreboard .addObjective ("genRandom" , ScoreboardCriterion .DUMMY , Text .of ("生成随机数" ), ScoreboardCriterion .RenderType .INTEGER ,true ,null );
275- }
276276 ScoreboardObjective respawnCountSBO = scoreboard .getNullableObjective ("isGameStarted" );
277277 ScoreAccess scoreAccess = scoreboard .getOrCreateScore (() -> "gameStarted" , respawnCountSBO );
278-
279- ScoreboardObjective randomSBO = scoreboard .getNullableObjective ("genRandom" );
280- ScoreAccess randomScoreAccess = scoreboard .getOrCreateScore (() -> "Random" , respawnCountSBO );
281278 scoreAccess .setScore (0 );
282279 }
283280
@@ -288,6 +285,9 @@ private void useSkill(MinecraftServer server, ServerPlayerEntity player, int slo
288285 RelightTheThreePointStrategy .LOGGER .info ("并非技能物品" );
289286 return ;
290287 }
288+ if (gameStatus !=-1 ){
289+ return ;
290+ }
291291 ActiveSkillable skill = (ActiveSkillable ) skillStack .getItem ();
292292 skill .castSkill (server ,player ,skillStack );
293293 }
0 commit comments