11package dev .ryanhcode .sable .sublevel .tracking_points ;
22
33import dev .ryanhcode .sable .Sable ;
4- import dev .ryanhcode .sable .api .SubLevelHelper ;
5- import dev .ryanhcode .sable .api .entity .EntitySubLevelUtil ;
64import dev .ryanhcode .sable .api .sublevel .ServerSubLevelContainer ;
75import dev .ryanhcode .sable .api .sublevel .SubLevelContainer ;
86import dev .ryanhcode .sable .api .sublevel .SubLevelObserver ;
2624import net .minecraft .server .level .ServerPlayer ;
2725import net .minecraft .world .level .saveddata .SavedData ;
2826import net .minecraft .world .phys .Vec3 ;
27+ import org .jetbrains .annotations .NotNull ;
2928import org .jetbrains .annotations .Nullable ;
3029import org .joml .Vector3d ;
3130import org .joml .Vector3dc ;
@@ -43,17 +42,13 @@ private SubLevelTrackingPointSavedData(final ServerLevel level) {
4342 }
4443
4544 public static SubLevelTrackingPointSavedData getOrLoad (final ServerLevel level ) {
46- final SubLevelTrackingPointSavedData data = level .getDataStorage ().computeIfAbsent (
45+ return level .getDataStorage ().computeIfAbsent (
4746 new Factory <>(
48- () -> {
49- return new SubLevelTrackingPointSavedData (level );
50- },
47+ () -> new SubLevelTrackingPointSavedData (level ),
5148 (tag , provider ) -> SubLevelTrackingPointSavedData .load (level , tag ),
5249 null
5350 ),
5451 SubLevelTrackingPointSavedData .FILE_ID );
55-
56- return data ;
5752 }
5853
5954 private static SubLevelTrackingPointSavedData load (final ServerLevel level , final CompoundTag tag ) {
@@ -91,7 +86,7 @@ private static SubLevelTrackingPointSavedData load(final ServerLevel level, fina
9186 }
9287
9388 @ Override
94- public CompoundTag save (final CompoundTag compoundTag , final HolderLookup .Provider provider ) {
89+ public @ NotNull CompoundTag save (final @ NotNull CompoundTag compoundTag , final HolderLookup .@ NotNull Provider provider ) {
9590 final SubLevelContainer container = SubLevelContainer .getContainer (this .level );
9691 assert container != null : "Sub-level container is null" ;
9792
@@ -259,7 +254,6 @@ public void removeTrackingPoint(final UUID key) {
259254
260255 @ Nullable
261256 public TrackingPoint getTrackingPoint (final UUID uuid ) {
262- final TrackingPoint point = this .trackingPoints .get (uuid );
263- return point ;
257+ return this .trackingPoints .get (uuid );
264258 }
265259}
0 commit comments