Use the first set value as original.
[demoscenemusic.git] / src / main / java / net / pterodactylus / demoscenemusic / data / AbstractBase.java
index 4a35db1..6a21081 100644 (file)
@@ -51,6 +51,8 @@ public class AbstractBase {
 
                private T original;
 
+               private boolean originalSet;
+
                private T current;
 
                public T get() {
@@ -58,6 +60,10 @@ public class AbstractBase {
                }
 
                public Value<T> set(T value) {
+                       if (!originalSet) {
+                               original = value;
+                               originalSet = true;
+                       }
                        current = value;
                        return this;
                }