DecentSoftware-eu / DecentHolograms

A lightweight but powerful hologram plugin with many features and configuration options.
https://www.spigotmc.org/resources/96927/
GNU General Public License v3.0
183 stars 82 forks source link

DHAPI creates empty files #197

Closed FortuneMidnight closed 3 months ago

FortuneMidnight commented 4 months ago

Just making sure

Reproduction

  1. Install DecentHolograms...
  2. create new holograms via api
  3. after creation, set savetoFile false
  4. in the decentholograms plugin folder, in holograms folder are the empty hologram files idea64_GqHGuS7LqB

Although saveToFile is set to false, empty files are created in the Holograms folder of DecentHolograms

Solution

No response

Server Version

1.20.4

Client Version

1.20.4

Plugin Version

v2.8.6

Log

not needed

Andre601 commented 4 months ago

You use the API wrong.

To create a new Hologram, use DHAPI.createHologram(String, Location)

The way you do it is not recommended nor a proper way of doing it.

Andre601 commented 4 months ago

And to clarify further: In the Hologram(String, Location, boolean) constructor does a true boolean value cause new FileConfig(...) to be called, which creates a new file, since it assumes the Hologram to be saved later on.

And calling Hologram(String, Location) is calling the other constructor with the boolean argument set to true.

FortuneMidnight commented 3 months ago

Yes, now it works properly xD, my bad