@@ -181,6 +181,7 @@ public static HologramPage addHologramPage(Hologram hologram, List<String> lines
181181 page .addLine (line );
182182 }
183183 }
184+ hologram .save ();
184185 return page ;
185186 }
186187
@@ -217,6 +218,7 @@ public static HologramPage insertHologramPage(Hologram hologram, int index, List
217218 page .addLine (line );
218219 }
219220 }
221+ hologram .save ();
220222 return page ;
221223 }
222224
@@ -231,7 +233,9 @@ public static HologramPage insertHologramPage(Hologram hologram, int index, List
231233 @ Nullable
232234 public static HologramPage removeHologramPage (Hologram hologram , int index ) throws IllegalArgumentException {
233235 Validate .notNull (hologram );
234- return hologram .removePage (index );
236+ HologramPage page = hologram .removePage (index );
237+ hologram .save ();
238+ return page ;
235239 }
236240
237241 /**
@@ -317,6 +321,7 @@ public static HologramLine addHologramLine(Hologram hologram, int pageIndex, Str
317321 public static HologramLine addHologramLine (HologramPage page , String content ) throws IllegalArgumentException {
318322 HologramLine line = new HologramLine (page , page .getNextLineLocation (), content );
319323 page .addLine (line );
324+ page .getParent ().save ();
320325 return line ;
321326 }
322327
@@ -368,6 +373,7 @@ public static HologramLine insertHologramLine(HologramPage page, int index, Stri
368373 }
369374 HologramLine line = new HologramLine (page , oldLine .getLocation (), content );
370375 page .insertLine (index , line );
376+ page .getParent ().save ();
371377 return line ;
372378 }
373379
@@ -389,6 +395,9 @@ public static void setHologramLine(HologramLine line, String content) throws Ill
389395 line .getParent ().realignLines ();
390396 }
391397 }
398+ if (line .hasParent ()) {
399+ line .getParent ().getParent ().save ();
400+ }
392401 }
393402
394403 /**
@@ -474,7 +483,9 @@ public static HologramLine removeHologramLine(Hologram hologram, int pageIndex,
474483 if (page == null ) {
475484 throw new IllegalArgumentException ("Given page index is out of bounds for the hologram." );
476485 }
477- return page .removeLine (lineIndex );
486+ HologramLine line = page .removeLine (lineIndex );
487+ hologram .save ();
488+ return line ;
478489 }
479490
480491 /**
@@ -488,7 +499,9 @@ public static HologramLine removeHologramLine(Hologram hologram, int pageIndex,
488499 @ Nullable
489500 public static HologramLine removeHologramLine (HologramPage page , int lineIndex ) throws IllegalArgumentException {
490501 Validate .notNull (page );
491- return page .removeLine (lineIndex );
502+ HologramLine line = page .removeLine (lineIndex );
503+ page .getParent ().save ();
504+ return line ;
492505 }
493506
494507 /**
@@ -540,6 +553,7 @@ public static void setHologramLines(Hologram hologram, int pageIndex, List<Strin
540553 }
541554 hologram .realignLines ();
542555 hologram .updateAll ();
556+ hologram .save ();
543557 }
544558
545559
0 commit comments