Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
MidnightTale committed Apr 25, 2023
1 parent ab88e14 commit 792c0c5
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/main/java/xyz/hynse/foliaflow/FoliaFlow.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,8 @@ public void onEnable() {
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";
Expand All @@ -102,7 +100,6 @@ public void onEnable() {
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);
Expand Down

0 comments on commit 792c0c5

Please sign in to comment.