From 792c0c5f1d8a33ccece23aecebf689ba783891be Mon Sep 17 00:00:00 2001 From: MidnightTale Date: Tue, 25 Apr 2023 23:18:42 +0700 Subject: [PATCH] optimize code --- src/main/java/xyz/hynse/foliaflow/FoliaFlow.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/xyz/hynse/foliaflow/FoliaFlow.java b/src/main/java/xyz/hynse/foliaflow/FoliaFlow.java index 58b6036..bcbc5c5 100644 --- a/src/main/java/xyz/hynse/foliaflow/FoliaFlow.java +++ b/src/main/java/xyz/hynse/foliaflow/FoliaFlow.java @@ -75,10 +75,8 @@ public class FoliaFlow extends JavaPlugin implements Listener { File dataFile = new File(getDataFolder(), "data.yml"); YamlConfiguration config = YamlConfiguration.loadConfiguration(dataFile); - // Get the existing flag value, or default to false if it doesn't exist boolean entitySpawned = config.getBoolean("entity_spawned", false); - // If the entity has not already been spawned, spawn it and set the flag to true if (!entitySpawned) { RegionScheduler schedulerdisplay = getServer().getRegionScheduler(); String tag = "FoliaFlow_Display"; @@ -102,7 +100,6 @@ public class FoliaFlow extends JavaPlugin implements Listener { display.addScoreboardTag(tag); getLogger().info("Setup BlockDisplay" + "(" + tag + ") " + display); - // Set the flag to indicate that the entity has been spawned config.set("entity_spawned", true); try { config.save(dataFile);