diff --git a/.gradle/9.2.0/fileHashes/fileHashes.lock b/.gradle/9.2.0/fileHashes/fileHashes.lock index 7c1c176..83931e4 100644 Binary files a/.gradle/9.2.0/fileHashes/fileHashes.lock and b/.gradle/9.2.0/fileHashes/fileHashes.lock differ diff --git a/.gradle/9.2.1/executionHistory/executionHistory.bin b/.gradle/9.2.1/executionHistory/executionHistory.bin index 4522198..e501941 100644 Binary files a/.gradle/9.2.1/executionHistory/executionHistory.bin and b/.gradle/9.2.1/executionHistory/executionHistory.bin differ diff --git a/.gradle/9.2.1/executionHistory/executionHistory.lock b/.gradle/9.2.1/executionHistory/executionHistory.lock index e1e2dd2..934449d 100644 Binary files a/.gradle/9.2.1/executionHistory/executionHistory.lock and b/.gradle/9.2.1/executionHistory/executionHistory.lock differ diff --git a/.gradle/9.2.1/fileHashes/fileHashes.bin b/.gradle/9.2.1/fileHashes/fileHashes.bin index 0ca9535..fadcf5a 100644 Binary files a/.gradle/9.2.1/fileHashes/fileHashes.bin and b/.gradle/9.2.1/fileHashes/fileHashes.bin differ diff --git a/.gradle/9.2.1/fileHashes/fileHashes.lock b/.gradle/9.2.1/fileHashes/fileHashes.lock index 6eef89f..e12a5bd 100644 Binary files a/.gradle/9.2.1/fileHashes/fileHashes.lock and b/.gradle/9.2.1/fileHashes/fileHashes.lock differ diff --git a/.gradle/9.2.1/fileHashes/resourceHashesCache.bin b/.gradle/9.2.1/fileHashes/resourceHashesCache.bin index 66cda5d..dd8091a 100644 Binary files a/.gradle/9.2.1/fileHashes/resourceHashesCache.bin and b/.gradle/9.2.1/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index f0458fd..3507775 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties index 40a996c..890b9a1 100644 --- a/.gradle/buildOutputCleanup/cache.properties +++ b/.gradle/buildOutputCleanup/cache.properties @@ -1,2 +1,2 @@ -#Sun Jan 18 15:17:29 CET 2026 +#Sun Jan 18 17:20:38 CET 2026 gradle.version=9.2.1 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin index b9ff0ef..238f549 100644 Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe index 03003d1..c7e384c 100644 Binary files a/.gradle/file-system.probe and b/.gradle/file-system.probe differ diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..950f276 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +HyStuff \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build/docs/javadoc/index-all.html b/build/docs/javadoc/index-all.html index 76055f2..fe453a7 100644 --- a/build/docs/javadoc/index-all.html +++ b/build/docs/javadoc/index-all.html @@ -100,6 +100,10 @@ loadScripts(document, 'script');
 
getHomeCount() - Method in class net.miarma.hystuff.common.HomeManager
 
+
getInstance() - Static method in class net.miarma.hystuff.common.LastPositionManager
+
 
+
getInstance(Path, HytaleLogger) - Static method in class net.miarma.hystuff.common.HomeManager
+
 
getQuery() - Method in class net.miarma.hystuff.events.PlayerDeathListener
 
@@ -119,8 +123,6 @@ loadScripts(document, 'script');
 
HomeManager - Class in net.miarma.hystuff.common
 
-
HomeManager(Path, HytaleLogger) - Constructor for class net.miarma.hystuff.common.HomeManager
-
 
HyStuff - Class in net.miarma.hystuff
This class serves as the entrypoint for your plugin.
@@ -132,8 +134,6 @@ loadScripts(document, 'script');
LastPositionManager - Class in net.miarma.hystuff.common
 
-
LastPositionManager() - Constructor for class net.miarma.hystuff.common.LastPositionManager
-
 
Location - Record Class in net.miarma.hystuff.common
 
Location(String, double, double, double, float, float) - Constructor for record class net.miarma.hystuff.common.Location
diff --git a/build/docs/javadoc/member-search-index.js b/build/docs/javadoc/member-search-index.js index be002a3..55339d2 100644 --- a/build/docs/javadoc/member-search-index.js +++ b/build/docs/javadoc/member-search-index.js @@ -1 +1 @@ -memberSearchIndex = [{"p":"net.miarma.hystuff.commands","c":"BackCommand","l":"BackCommand(LastPositionManager)","u":"%3Cinit%3E(net.miarma.hystuff.common.LastPositionManager)","k":"3"},{"p":"net.miarma.hystuff.commands","c":"BackCommand","l":"canGeneratePermission()"},{"p":"net.miarma.hystuff.commands","c":"HomeCommand","l":"canGeneratePermission()"},{"p":"net.miarma.hystuff.commands","c":"SetHomeCommand","l":"canGeneratePermission()"},{"p":"net.miarma.hystuff.common","c":"LastPositionManager","l":"clear(UUID)","u":"clear(java.util.UUID)"},{"p":"net.miarma.hystuff.events","c":"PlayerDeathListener","l":"componentType()"},{"p":"net.miarma.hystuff.commands","c":"DisposalCommand","l":"DisposalCommand()","u":"%3Cinit%3E()","k":"3"},{"p":"net.miarma.hystuff.common","c":"Location","l":"equals(Object)","u":"equals(java.lang.Object)"},{"p":"net.miarma.hystuff.commands","c":"BackCommand","l":"execute(CommandContext, Store, Ref, PlayerRef, World)","u":"execute(com.hypixel.hytale.server.core.command.system.CommandContext,com.hypixel.hytale.component.Store,com.hypixel.hytale.component.Ref,com.hypixel.hytale.server.core.universe.PlayerRef,com.hypixel.hytale.server.core.universe.world.World)"},{"p":"net.miarma.hystuff.commands","c":"DisposalCommand","l":"execute(CommandContext, Store, Ref, PlayerRef, World)","u":"execute(com.hypixel.hytale.server.core.command.system.CommandContext,com.hypixel.hytale.component.Store,com.hypixel.hytale.component.Ref,com.hypixel.hytale.server.core.universe.PlayerRef,com.hypixel.hytale.server.core.universe.world.World)"},{"p":"net.miarma.hystuff.commands","c":"HomeCommand","l":"execute(CommandContext, Store, Ref, PlayerRef, World)","u":"execute(com.hypixel.hytale.server.core.command.system.CommandContext,com.hypixel.hytale.component.Store,com.hypixel.hytale.component.Ref,com.hypixel.hytale.server.core.universe.PlayerRef,com.hypixel.hytale.server.core.universe.world.World)"},{"p":"net.miarma.hystuff.commands","c":"SetHomeCommand","l":"execute(CommandContext, Store, Ref, PlayerRef, World)","u":"execute(com.hypixel.hytale.server.core.command.system.CommandContext,com.hypixel.hytale.component.Store,com.hypixel.hytale.component.Ref,com.hypixel.hytale.server.core.universe.PlayerRef,com.hypixel.hytale.server.core.universe.world.World)"},{"p":"net.miarma.hystuff.common","c":"LastPositionManager","l":"get(UUID)","u":"get(java.util.UUID)"},{"p":"net.miarma.hystuff.common","c":"HomeManager","l":"getHome(UUID)","u":"getHome(java.util.UUID)"},{"p":"net.miarma.hystuff.common","c":"HomeManager","l":"getHomeCount()"},{"p":"net.miarma.hystuff.events","c":"PlayerDeathListener","l":"getQuery()"},{"p":"net.miarma.hystuff.common","c":"LastPositionManager","l":"has(UUID)","u":"has(java.util.UUID)"},{"p":"net.miarma.hystuff.common","c":"Location","l":"hashCode()"},{"p":"net.miarma.hystuff.common","c":"HomeManager","l":"hasHome(UUID)","u":"hasHome(java.util.UUID)"},{"p":"net.miarma.hystuff.commands","c":"HomeCommand","l":"HomeCommand(HomeManager)","u":"%3Cinit%3E(net.miarma.hystuff.common.HomeManager)","k":"3"},{"p":"net.miarma.hystuff.common","c":"HomeManager","l":"HomeManager(Path, HytaleLogger)","u":"%3Cinit%3E(java.nio.file.Path,com.hypixel.hytale.logger.HytaleLogger)","k":"3"},{"p":"net.miarma.hystuff","c":"HyStuff","l":"HyStuff(JavaPluginInit)","u":"%3Cinit%3E(com.hypixel.hytale.server.core.plugin.JavaPluginInit)","k":"3"},{"p":"net.miarma.hystuff.common","c":"LastPositionManager","l":"LastPositionManager()","u":"%3Cinit%3E()","k":"3"},{"p":"net.miarma.hystuff.common","c":"Location","l":"Location(String, double, double, double, float, float)","u":"%3Cinit%3E(java.lang.String,double,double,double,float,float)","k":"3"},{"p":"net.miarma.hystuff.events","c":"PlayerDeathListener","l":"onComponentAdded(Ref, DeathComponent, Store, CommandBuffer)","u":"onComponentAdded(com.hypixel.hytale.component.Ref,com.hypixel.hytale.server.core.modules.entity.damage.DeathComponent,com.hypixel.hytale.component.Store,com.hypixel.hytale.component.CommandBuffer)"},{"p":"net.miarma.hystuff.events","c":"PlayerDeathListener","l":"onComponentRemoved(Ref, DeathComponent, Store, CommandBuffer)","u":"onComponentRemoved(com.hypixel.hytale.component.Ref,com.hypixel.hytale.server.core.modules.entity.damage.DeathComponent,com.hypixel.hytale.component.Store,com.hypixel.hytale.component.CommandBuffer)"},{"p":"net.miarma.hystuff.events","c":"PlayerDeathListener","l":"onComponentSet(Ref, DeathComponent, DeathComponent, Store, CommandBuffer)","u":"onComponentSet(com.hypixel.hytale.component.Ref,com.hypixel.hytale.server.core.modules.entity.damage.DeathComponent,com.hypixel.hytale.server.core.modules.entity.damage.DeathComponent,com.hypixel.hytale.component.Store,com.hypixel.hytale.component.CommandBuffer)"},{"p":"net.miarma.hystuff.common","c":"Location","l":"pitch()"},{"p":"net.miarma.hystuff.events","c":"PlayerDeathListener","l":"PlayerDeathListener(LastPositionManager, HytaleLogger)","u":"%3Cinit%3E(net.miarma.hystuff.common.LastPositionManager,com.hypixel.hytale.logger.HytaleLogger)","k":"3"},{"p":"net.miarma.hystuff.common","c":"HomeManager","l":"removeHome(UUID)","u":"removeHome(java.util.UUID)"},{"p":"net.miarma.hystuff.common","c":"HomeManager","l":"save()"},{"p":"net.miarma.hystuff.common","c":"LastPositionManager","l":"set(UUID, Location)","u":"set(java.util.UUID,net.miarma.hystuff.common.Location)"},{"p":"net.miarma.hystuff.common","c":"HomeManager","l":"setHome(UUID, World, Vector3d, Vector3f)","u":"setHome(java.util.UUID,com.hypixel.hytale.server.core.universe.world.World,com.hypixel.hytale.math.vector.Vector3d,com.hypixel.hytale.math.vector.Vector3f)"},{"p":"net.miarma.hystuff.commands","c":"SetHomeCommand","l":"SetHomeCommand(HomeManager)","u":"%3Cinit%3E(net.miarma.hystuff.common.HomeManager)","k":"3"},{"p":"net.miarma.hystuff","c":"HyStuff","l":"setup()"},{"p":"net.miarma.hystuff","c":"HyStuff","l":"shutdown()"},{"p":"net.miarma.hystuff","c":"HyStuff","l":"start()"},{"p":"net.miarma.hystuff.common","c":"Location","l":"toPosition()"},{"p":"net.miarma.hystuff.common","c":"Location","l":"toRotation()"},{"p":"net.miarma.hystuff.common","c":"Location","l":"toString()"},{"p":"net.miarma.hystuff.common","c":"Location","l":"worldName()"},{"p":"net.miarma.hystuff.common","c":"Location","l":"x()"},{"p":"net.miarma.hystuff.common","c":"Location","l":"y()"},{"p":"net.miarma.hystuff.common","c":"Location","l":"yaw()"},{"p":"net.miarma.hystuff.common","c":"Location","l":"z()"}];updateSearchResults(); \ No newline at end of file +memberSearchIndex = [{"p":"net.miarma.hystuff.commands","c":"BackCommand","l":"BackCommand(LastPositionManager)","u":"%3Cinit%3E(net.miarma.hystuff.common.LastPositionManager)","k":"3"},{"p":"net.miarma.hystuff.commands","c":"BackCommand","l":"canGeneratePermission()"},{"p":"net.miarma.hystuff.commands","c":"HomeCommand","l":"canGeneratePermission()"},{"p":"net.miarma.hystuff.commands","c":"SetHomeCommand","l":"canGeneratePermission()"},{"p":"net.miarma.hystuff.common","c":"LastPositionManager","l":"clear(UUID)","u":"clear(java.util.UUID)"},{"p":"net.miarma.hystuff.events","c":"PlayerDeathListener","l":"componentType()"},{"p":"net.miarma.hystuff.commands","c":"DisposalCommand","l":"DisposalCommand()","u":"%3Cinit%3E()","k":"3"},{"p":"net.miarma.hystuff.common","c":"Location","l":"equals(Object)","u":"equals(java.lang.Object)"},{"p":"net.miarma.hystuff.commands","c":"BackCommand","l":"execute(CommandContext, Store, Ref, PlayerRef, World)","u":"execute(com.hypixel.hytale.server.core.command.system.CommandContext,com.hypixel.hytale.component.Store,com.hypixel.hytale.component.Ref,com.hypixel.hytale.server.core.universe.PlayerRef,com.hypixel.hytale.server.core.universe.world.World)"},{"p":"net.miarma.hystuff.commands","c":"DisposalCommand","l":"execute(CommandContext, Store, Ref, PlayerRef, World)","u":"execute(com.hypixel.hytale.server.core.command.system.CommandContext,com.hypixel.hytale.component.Store,com.hypixel.hytale.component.Ref,com.hypixel.hytale.server.core.universe.PlayerRef,com.hypixel.hytale.server.core.universe.world.World)"},{"p":"net.miarma.hystuff.commands","c":"HomeCommand","l":"execute(CommandContext, Store, Ref, PlayerRef, World)","u":"execute(com.hypixel.hytale.server.core.command.system.CommandContext,com.hypixel.hytale.component.Store,com.hypixel.hytale.component.Ref,com.hypixel.hytale.server.core.universe.PlayerRef,com.hypixel.hytale.server.core.universe.world.World)"},{"p":"net.miarma.hystuff.commands","c":"SetHomeCommand","l":"execute(CommandContext, Store, Ref, PlayerRef, World)","u":"execute(com.hypixel.hytale.server.core.command.system.CommandContext,com.hypixel.hytale.component.Store,com.hypixel.hytale.component.Ref,com.hypixel.hytale.server.core.universe.PlayerRef,com.hypixel.hytale.server.core.universe.world.World)"},{"p":"net.miarma.hystuff.common","c":"LastPositionManager","l":"get(UUID)","u":"get(java.util.UUID)"},{"p":"net.miarma.hystuff.common","c":"HomeManager","l":"getHome(UUID)","u":"getHome(java.util.UUID)"},{"p":"net.miarma.hystuff.common","c":"HomeManager","l":"getHomeCount()"},{"p":"net.miarma.hystuff.common","c":"LastPositionManager","l":"getInstance()","k":"6"},{"p":"net.miarma.hystuff.common","c":"HomeManager","l":"getInstance(Path, HytaleLogger)","u":"getInstance(java.nio.file.Path,com.hypixel.hytale.logger.HytaleLogger)","k":"6"},{"p":"net.miarma.hystuff.events","c":"PlayerDeathListener","l":"getQuery()"},{"p":"net.miarma.hystuff.common","c":"LastPositionManager","l":"has(UUID)","u":"has(java.util.UUID)"},{"p":"net.miarma.hystuff.common","c":"Location","l":"hashCode()"},{"p":"net.miarma.hystuff.common","c":"HomeManager","l":"hasHome(UUID)","u":"hasHome(java.util.UUID)"},{"p":"net.miarma.hystuff.commands","c":"HomeCommand","l":"HomeCommand(HomeManager)","u":"%3Cinit%3E(net.miarma.hystuff.common.HomeManager)","k":"3"},{"p":"net.miarma.hystuff","c":"HyStuff","l":"HyStuff(JavaPluginInit)","u":"%3Cinit%3E(com.hypixel.hytale.server.core.plugin.JavaPluginInit)","k":"3"},{"p":"net.miarma.hystuff.common","c":"Location","l":"Location(String, double, double, double, float, float)","u":"%3Cinit%3E(java.lang.String,double,double,double,float,float)","k":"3"},{"p":"net.miarma.hystuff.events","c":"PlayerDeathListener","l":"onComponentAdded(Ref, DeathComponent, Store, CommandBuffer)","u":"onComponentAdded(com.hypixel.hytale.component.Ref,com.hypixel.hytale.server.core.modules.entity.damage.DeathComponent,com.hypixel.hytale.component.Store,com.hypixel.hytale.component.CommandBuffer)"},{"p":"net.miarma.hystuff.events","c":"PlayerDeathListener","l":"onComponentRemoved(Ref, DeathComponent, Store, CommandBuffer)","u":"onComponentRemoved(com.hypixel.hytale.component.Ref,com.hypixel.hytale.server.core.modules.entity.damage.DeathComponent,com.hypixel.hytale.component.Store,com.hypixel.hytale.component.CommandBuffer)"},{"p":"net.miarma.hystuff.events","c":"PlayerDeathListener","l":"onComponentSet(Ref, DeathComponent, DeathComponent, Store, CommandBuffer)","u":"onComponentSet(com.hypixel.hytale.component.Ref,com.hypixel.hytale.server.core.modules.entity.damage.DeathComponent,com.hypixel.hytale.server.core.modules.entity.damage.DeathComponent,com.hypixel.hytale.component.Store,com.hypixel.hytale.component.CommandBuffer)"},{"p":"net.miarma.hystuff.common","c":"Location","l":"pitch()"},{"p":"net.miarma.hystuff.events","c":"PlayerDeathListener","l":"PlayerDeathListener(LastPositionManager, HytaleLogger)","u":"%3Cinit%3E(net.miarma.hystuff.common.LastPositionManager,com.hypixel.hytale.logger.HytaleLogger)","k":"3"},{"p":"net.miarma.hystuff.common","c":"HomeManager","l":"removeHome(UUID)","u":"removeHome(java.util.UUID)"},{"p":"net.miarma.hystuff.common","c":"HomeManager","l":"save()"},{"p":"net.miarma.hystuff.common","c":"LastPositionManager","l":"set(UUID, Location)","u":"set(java.util.UUID,net.miarma.hystuff.common.Location)"},{"p":"net.miarma.hystuff.common","c":"HomeManager","l":"setHome(UUID, World, Vector3d, Vector3f)","u":"setHome(java.util.UUID,com.hypixel.hytale.server.core.universe.world.World,com.hypixel.hytale.math.vector.Vector3d,com.hypixel.hytale.math.vector.Vector3f)"},{"p":"net.miarma.hystuff.commands","c":"SetHomeCommand","l":"SetHomeCommand(HomeManager)","u":"%3Cinit%3E(net.miarma.hystuff.common.HomeManager)","k":"3"},{"p":"net.miarma.hystuff","c":"HyStuff","l":"setup()"},{"p":"net.miarma.hystuff","c":"HyStuff","l":"shutdown()"},{"p":"net.miarma.hystuff","c":"HyStuff","l":"start()"},{"p":"net.miarma.hystuff.common","c":"Location","l":"toPosition()"},{"p":"net.miarma.hystuff.common","c":"Location","l":"toRotation()"},{"p":"net.miarma.hystuff.common","c":"Location","l":"toString()"},{"p":"net.miarma.hystuff.common","c":"Location","l":"worldName()"},{"p":"net.miarma.hystuff.common","c":"Location","l":"x()"},{"p":"net.miarma.hystuff.common","c":"Location","l":"y()"},{"p":"net.miarma.hystuff.common","c":"Location","l":"yaw()"},{"p":"net.miarma.hystuff.common","c":"Location","l":"z()"}];updateSearchResults(); \ No newline at end of file diff --git a/build/docs/javadoc/net/miarma/hystuff/common/HomeManager.html b/build/docs/javadoc/net/miarma/hystuff/common/HomeManager.html index 44c5701..5735c5d 100644 --- a/build/docs/javadoc/net/miarma/hystuff/common/HomeManager.html +++ b/build/docs/javadoc/net/miarma/hystuff/common/HomeManager.html @@ -53,15 +53,10 @@ loadScripts(document, 'script');
Contents 
  1. Description
  2. -
  3. Constructor Summary
  4. Method Summary
  5. -
  6. Constructor Details -
      -
    1. HomeManager(Path, HytaleLogger)
    2. -
    -
  7. Method Details
      +
    1. getInstance(Path, HytaleLogger)
    2. save()
    3. setHome(UUID, World, Vector3d, Vector3f)
    4. getHome(UUID)
    5. @@ -89,26 +84,12 @@ loadScripts(document, 'script');
        - -
      • -
        -

        Constructor Summary

        -
        Constructors
        -
        -
        Constructor
        -
        Description
        -
        HomeManager(Path dataDir, - com.hypixel.hytale.logger.HytaleLogger logger)
        -
         
        -
        -
        -
      • Method Summary

        -
        +
        Modifier and Type
        @@ -120,21 +101,25 @@ loadScripts(document, 'script');
        int
         
        -
        boolean
        -
        hasHome(UUID playerUuid)
        -
         
        -
        void
        -
        removeHome(UUID playerUuid)
        + +
        getInstance(Path dataDir, + com.hypixel.hytale.logger.HytaleLogger logger)
        +
         
        +
        boolean
        +
        hasHome(UUID playerUuid)
         
        void
        - +
        removeHome(UUID playerUuid)
         
        void
        -
        setHome(UUID playerUuid, + +
         
        +
        void
        +
        setHome(UUID playerUuid, com.hypixel.hytale.server.core.universe.world.World world, com.hypixel.hytale.math.vector.Vector3d position, com.hypixel.hytale.math.vector.Vector3f rotation)
        -
         
        +
         
        @@ -147,30 +132,22 @@ loadScripts(document, 'script');
          - +
        • -
          -

          Constructor Details

          +
          +

          Method Details

          • -
            -

            HomeManager

            +
            +

            getInstance

            -
            public HomeManager(@Nonnull +
            public static HomeManager getInstance(@Nonnull Path dataDir, @Nonnull com.hypixel.hytale.logger.HytaleLogger logger)
          • -
          -
          -
        • - -
        • -
          -

          Method Details

          -
          • save

            diff --git a/build/docs/javadoc/net/miarma/hystuff/common/LastPositionManager.html b/build/docs/javadoc/net/miarma/hystuff/common/LastPositionManager.html index caeb1f3..4ffdf98 100644 --- a/build/docs/javadoc/net/miarma/hystuff/common/LastPositionManager.html +++ b/build/docs/javadoc/net/miarma/hystuff/common/LastPositionManager.html @@ -53,15 +53,10 @@ loadScripts(document, 'script');
            Contents 
            1. Description
            2. -
            3. Constructor Summary
            4. Method Summary
            5. -
            6. Constructor Details -
                -
              1. LastPositionManager()
              2. -
              -
            7. Method Details
                +
              1. getInstance()
              2. set(UUID, Location)
              3. get(UUID)
              4. has(UUID)
              5. @@ -87,25 +82,12 @@ loadScripts(document, 'script');
              - -
            • -
              -

              Constructor Summary

              -
              Constructors
              -
              -
              Constructor
              -
              Description
              - -
               
              -
              -
              -
            • Method Summary

              -
              +
              Modifier and Type
              @@ -117,13 +99,16 @@ loadScripts(document, 'script');
              get(UUID uuid)
               
              -
              boolean
              -
              has(UUID uuid)
              -
               
              -
              void
              -
              set(UUID uuid, - Location pos)
              + + +
               
              +
              boolean
              +
              has(UUID uuid)
               
              +
              void
              +
              set(UUID uuid, + Location pos)
              +
               
              @@ -136,28 +121,20 @@ loadScripts(document, 'script');
                - -
              • -
                -

                Constructor Details

                -
                  -
                • -
                  -

                  LastPositionManager

                  -
                  -
                  public LastPositionManager()
                  -
                  -
                  -
                • -
                -
                -
              • Method Details

                • +
                  +

                  getInstance

                  +
                  +
                  public static LastPositionManager getInstance()
                  +
                  +
                  +
                • +
                • set

                  diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/HomeCommand.class.uniqueId2 b/build/tmp/compileJava/compileTransaction/stash-dir/HomeCommand.class.uniqueId2 new file mode 100644 index 0000000..540b301 Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/HomeCommand.class.uniqueId2 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/HyStuff.class.uniqueId0 b/build/tmp/compileJava/compileTransaction/stash-dir/HyStuff.class.uniqueId0 index 47fad80..dbcb087 100644 Binary files a/build/tmp/compileJava/compileTransaction/stash-dir/HyStuff.class.uniqueId0 and b/build/tmp/compileJava/compileTransaction/stash-dir/HyStuff.class.uniqueId0 differ diff --git a/build/tmp/compileJava/compileTransaction/stash-dir/SetHomeCommand.class.uniqueId1 b/build/tmp/compileJava/compileTransaction/stash-dir/SetHomeCommand.class.uniqueId1 new file mode 100644 index 0000000..f617894 Binary files /dev/null and b/build/tmp/compileJava/compileTransaction/stash-dir/SetHomeCommand.class.uniqueId1 differ diff --git a/build/tmp/compileJava/previous-compilation-data.bin b/build/tmp/compileJava/previous-compilation-data.bin index 43baa75..29c8bc2 100644 Binary files a/build/tmp/compileJava/previous-compilation-data.bin and b/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/build/tmp/javadoc/javadoc.options b/build/tmp/javadoc/javadoc.options index f84f3d2..24107e2 100644 --- a/build/tmp/javadoc/javadoc.options +++ b/build/tmp/javadoc/javadoc.options @@ -1,16 +1,16 @@ --classpath '/home/jomaa/IdeaProjects/HyStuff/build/classes/java/main:/home/jomaa/IdeaProjects/HyStuff/build/resources/main:/home/jomaa/.var/app/com.hypixel.HytaleLauncher/data/Hytale/install/release/package/game/latest/Server/HytaleServer.jar' +-classpath '/home/jomaa/git/hystuff/build/classes/java/main:/home/jomaa/git/hystuff/build/resources/main:/home/jomaa/.var/app/com.hypixel.HytaleLauncher/data/Hytale/install/release/package/game/latest/Server/HytaleServer.jar' -quiet --d '/home/jomaa/IdeaProjects/HyStuff/build/docs/javadoc' +-d '/home/jomaa/git/hystuff/build/docs/javadoc' -windowtitle 'HyStuff 1.0.1 API' -doctitle 'HyStuff 1.0.1 API' -notimestamp -Xdoclint:-missing '-quiet' -'/home/jomaa/IdeaProjects/HyStuff/src/main/java/net/miarma/hystuff/common/LastPositionManager.java' -'/home/jomaa/IdeaProjects/HyStuff/src/main/java/net/miarma/hystuff/common/Location.java' -'/home/jomaa/IdeaProjects/HyStuff/src/main/java/net/miarma/hystuff/common/HomeManager.java' -'/home/jomaa/IdeaProjects/HyStuff/src/main/java/net/miarma/hystuff/HyStuff.java' -'/home/jomaa/IdeaProjects/HyStuff/src/main/java/net/miarma/hystuff/events/PlayerDeathListener.java' -'/home/jomaa/IdeaProjects/HyStuff/src/main/java/net/miarma/hystuff/commands/BackCommand.java' -'/home/jomaa/IdeaProjects/HyStuff/src/main/java/net/miarma/hystuff/commands/SetHomeCommand.java' -'/home/jomaa/IdeaProjects/HyStuff/src/main/java/net/miarma/hystuff/commands/HomeCommand.java' -'/home/jomaa/IdeaProjects/HyStuff/src/main/java/net/miarma/hystuff/commands/DisposalCommand.java' +'/home/jomaa/git/hystuff/src/main/java/net/miarma/hystuff/common/LastPositionManager.java' +'/home/jomaa/git/hystuff/src/main/java/net/miarma/hystuff/common/Location.java' +'/home/jomaa/git/hystuff/src/main/java/net/miarma/hystuff/common/HomeManager.java' +'/home/jomaa/git/hystuff/src/main/java/net/miarma/hystuff/HyStuff.java' +'/home/jomaa/git/hystuff/src/main/java/net/miarma/hystuff/events/PlayerDeathListener.java' +'/home/jomaa/git/hystuff/src/main/java/net/miarma/hystuff/commands/BackCommand.java' +'/home/jomaa/git/hystuff/src/main/java/net/miarma/hystuff/commands/SetHomeCommand.java' +'/home/jomaa/git/hystuff/src/main/java/net/miarma/hystuff/commands/HomeCommand.java' +'/home/jomaa/git/hystuff/src/main/java/net/miarma/hystuff/commands/DisposalCommand.java' diff --git a/src/main/java/net/miarma/hystuff/HyStuff.java b/src/main/java/net/miarma/hystuff/HyStuff.java index 0558d10..24169f9 100644 --- a/src/main/java/net/miarma/hystuff/HyStuff.java +++ b/src/main/java/net/miarma/hystuff/HyStuff.java @@ -40,8 +40,8 @@ public class HyStuff extends JavaPlugin { @Override protected void setup() { LOGGER.atInfo().log("------ HYSTUFF PLUGIN SETUP BEGIN ------"); - this.homeManager = new HomeManager(this.getDataDirectory(), LOGGER); - this.lastPositionManager = new LastPositionManager(); + this.homeManager = HomeManager.getInstance(this.getDataDirectory(), LOGGER); + this.lastPositionManager = LastPositionManager.getInstance(); this.playerDeathListener = new PlayerDeathListener(lastPositionManager, LOGGER); LOGGER.atInfo().log("------- HYSTUFF PLUGIN SETUP END -------"); } diff --git a/src/main/java/net/miarma/hystuff/commands/BackCommand.java b/src/main/java/net/miarma/hystuff/commands/BackCommand.java index b1ce80d..6fa0a9d 100644 --- a/src/main/java/net/miarma/hystuff/commands/BackCommand.java +++ b/src/main/java/net/miarma/hystuff/commands/BackCommand.java @@ -38,19 +38,25 @@ public class BackCommand extends AbstractPlayerCommand { UUID playerUuid = playerRef.getUuid(); Location lastPosition = this.lastPositionManager.get(playerUuid); - final World targetWorld = Universe.get().getWorld(lastPosition.worldName()) != null ? - Universe.get().getWorld(lastPosition.worldName()) : world; + if (!this.lastPositionManager.has(playerUuid)) { + ctx.sendMessage(Message.raw("You don't have a last position to return to.")); + } else { + final World targetWorld = Universe.get().getWorld(lastPosition.worldName()) != null ? + Universe.get().getWorld(lastPosition.worldName()) : world; - world.execute(() -> { - Teleport teleport = Teleport.createForPlayer( - targetWorld, - lastPosition.toPosition(), - lastPosition.toRotation() - ); + world.execute(() -> { + Teleport teleport = Teleport.createForPlayer( + targetWorld, + lastPosition.toPosition(), + lastPosition.toRotation() + ); - store.addComponent(ref, Teleport.getComponentType(), teleport); - ctx.sendMessage(Message.raw(String.format("Teleporting to your last position at %.1f, %.1f, %.1f", - lastPosition.x(), lastPosition.y(), lastPosition.z()))); - }); + store.addComponent(ref, Teleport.getComponentType(), teleport); + ctx.sendMessage(Message.raw(String.format("Teleporting to your last position at %.1f, %.1f, %.1f", + lastPosition.x(), lastPosition.y(), lastPosition.z()))); + }); + + this.lastPositionManager.clear(playerUuid); + } } } diff --git a/src/main/java/net/miarma/hystuff/commands/HomeCommand.java b/src/main/java/net/miarma/hystuff/commands/HomeCommand.java index 0315bf3..4356d01 100644 --- a/src/main/java/net/miarma/hystuff/commands/HomeCommand.java +++ b/src/main/java/net/miarma/hystuff/commands/HomeCommand.java @@ -2,6 +2,8 @@ package net.miarma.hystuff.commands; import com.hypixel.hytale.component.Ref; import com.hypixel.hytale.component.Store; +import com.hypixel.hytale.math.vector.Vector3d; +import com.hypixel.hytale.math.vector.Vector3f; import com.hypixel.hytale.protocol.GameMode; import com.hypixel.hytale.server.core.Message; import com.hypixel.hytale.server.core.command.system.CommandContext; @@ -13,6 +15,7 @@ import com.hypixel.hytale.server.core.universe.Universe; import com.hypixel.hytale.server.core.universe.world.World; import com.hypixel.hytale.server.core.universe.world.storage.EntityStore; import net.miarma.hystuff.common.HomeManager; +import net.miarma.hystuff.common.LastPositionManager; import net.miarma.hystuff.common.Location; import javax.annotation.Nonnull; @@ -20,10 +23,12 @@ import java.util.UUID; public class HomeCommand extends AbstractPlayerCommand { private final HomeManager homeManager; + private final LastPositionManager lastPositionManager; public HomeCommand(HomeManager homeManager) { super("home", "Teleports you to your home"); this.homeManager = homeManager; + this.lastPositionManager = LastPositionManager.getInstance(); } @Override @@ -42,14 +47,21 @@ public class HomeCommand extends AbstractPlayerCommand { if (home == null) { ctx.sendMessage(Message.raw("You don't have a home set. Use /sethome first.")); } else { + World currentWorld = Universe.get().getWorld(playerRef.getWorldUuid()); + Vector3d pos = playerRef.getTransform().getPosition(); + Vector3f rotation = playerRef.getHeadRotation(); + Location currentLocation = new Location(currentWorld.getName(), pos.getX(), pos.getY(), + pos.getZ(), rotation.getYaw(), rotation.getPitch()); + this.lastPositionManager.set(playerUuid, currentLocation); + final World homeWorld = Universe.get().getWorld(home.worldName()) != null ? Universe.get().getWorld(home.worldName()) : world; world.execute(() -> { Teleport teleport = Teleport.createForPlayer( - homeWorld, - home.toPosition(), - home.toRotation() + homeWorld, + home.toPosition(), + home.toRotation() ); store.addComponent(ref, Teleport.getComponentType(), teleport); ctx.sendMessage(Message.raw(String.format("Teleporting to your home at %.1f, %.1f, %.1f", diff --git a/src/main/java/net/miarma/hystuff/commands/SetHomeCommand.java b/src/main/java/net/miarma/hystuff/commands/SetHomeCommand.java index e70038e..8aa20af 100644 --- a/src/main/java/net/miarma/hystuff/commands/SetHomeCommand.java +++ b/src/main/java/net/miarma/hystuff/commands/SetHomeCommand.java @@ -41,7 +41,7 @@ public class SetHomeCommand extends AbstractPlayerCommand { ctx.sendMessage(Message.raw("Could not get your position.")); } else { HeadRotation headRotation = store.getComponent(ref, HeadRotation.getComponentType()); - Vector3f rotation = headRotation != null ? headRotation.getRotation() : new Vector3f(0.0f, 0.0f, 0.0f); + Vector3f rotation = headRotation.getRotation(); Vector3d position = transform.getPosition(); UUID playerUuid = playerRef.getUuid(); this.homeManager.setHome(playerUuid, world, position, rotation); diff --git a/src/main/java/net/miarma/hystuff/common/HomeManager.java b/src/main/java/net/miarma/hystuff/common/HomeManager.java index 9175faa..0649e39 100644 --- a/src/main/java/net/miarma/hystuff/common/HomeManager.java +++ b/src/main/java/net/miarma/hystuff/common/HomeManager.java @@ -27,13 +27,20 @@ public class HomeManager { private final Path dataDir; private final HytaleLogger LOGGER; private final Map homes = new ConcurrentHashMap<>(); + private static HomeManager _instance; - public HomeManager(@Nonnull Path dataDir, @Nonnull HytaleLogger logger) { + private HomeManager(@Nonnull Path dataDir, @Nonnull HytaleLogger logger) { this.dataDir = dataDir; this.LOGGER = logger; this.load(); } + public static HomeManager getInstance(@Nonnull Path dataDir, @Nonnull HytaleLogger logger) { + if(_instance == null) + _instance = new HomeManager(dataDir, logger); + return _instance; + } + private void load() { Path homesFile = this.dataDir.resolve(HOMES_FILE); if(!Files.exists(homesFile)) { diff --git a/src/main/java/net/miarma/hystuff/common/LastPositionManager.java b/src/main/java/net/miarma/hystuff/common/LastPositionManager.java index 9068a1c..7e5aba1 100644 --- a/src/main/java/net/miarma/hystuff/common/LastPositionManager.java +++ b/src/main/java/net/miarma/hystuff/common/LastPositionManager.java @@ -9,6 +9,18 @@ import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; public class LastPositionManager { + private static LastPositionManager _instance; + + private LastPositionManager() { + + } + + public static LastPositionManager getInstance() { + if(_instance == null) + _instance = new LastPositionManager(); + return _instance; + } + private final Map lastPositions = new ConcurrentHashMap<>(); public void set(UUID uuid, Location pos) {