-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/main/java/dev/dewy/nbt/tags/primitive/NumericalTag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package dev.dewy.nbt.tags.primitive; | ||
|
||
import dev.dewy.nbt.Tag; | ||
|
||
public abstract class NumericalTag<T extends Number> extends Tag { | ||
@Override | ||
public abstract T getValue(); | ||
|
||
public byte byteValue() { | ||
return this.getValue().byteValue(); | ||
} | ||
|
||
public short shortValue() { | ||
return this.getValue().shortValue(); | ||
} | ||
|
||
public int intValue() { | ||
return this.getValue().intValue(); | ||
} | ||
|
||
public long longValue() { | ||
return this.getValue().longValue(); | ||
} | ||
|
||
public float floatValue() { | ||
return this.getValue().floatValue(); | ||
} | ||
|
||
public double doubleValue() { | ||
return this.getValue().doubleValue(); | ||
} | ||
} |