Skip to content

Commit

Permalink
Players: Fixed a problem with getting the vector for where the player…
Browse files Browse the repository at this point in the history
… is looking. The actual vector was getting lost so the result was that nothing was able to be properly calculated.

This was fixed by creating an internal prison vector which could be used instead.
  • Loading branch information
rbluer committed Dec 14, 2024
1 parent 1ebbbc2 commit 56af7b1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
4 changes: 4 additions & 0 deletions docs/changelog_v3.3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ These change logs represent the work that has been going on within prison.
# 3.3.0-alpha.19d 2024-10-11


* **Players: Fixed a problem with getting the vector for where the player is looking. The actual vector was getting lost so the result was that nothing was able to be properly calculated.**
This was fixed by creating an internal prison vector which could be used instead.


2024-12-14

* **Prison was gifted over 46,000 players!!!**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import tech.mcprison.prison.spigot.integrations.IntegrationMinepacksPlugin;
import tech.mcprison.prison.util.Location;
import tech.mcprison.prison.util.Text;
import tech.mcprison.prison.util.Vector;

/**
* Utilities for converting Prison-Core types to Spigot types.
Expand Down Expand Up @@ -1095,10 +1096,20 @@ private static void logTestBlocks( StringBuilder sb, String message ) {

public static Location bukkitLocationToPrison(org.bukkit.Location bukkitLocation) {

return new Location(new SpigotWorld(bukkitLocation.getWorld()), bukkitLocation.getX(),
Location loc = new Location(new SpigotWorld(bukkitLocation.getWorld()), bukkitLocation.getX(),
bukkitLocation.getY(), bukkitLocation.getZ(), bukkitLocation.getPitch(),
bukkitLocation.getYaw() );

double x = bukkitLocation.getDirection().getX();
double y = bukkitLocation.getDirection().getY();
double z = bukkitLocation.getDirection().getZ();

Vector direction = new Vector( x, y, z );

loc.setDirection( direction );

return loc;

// org.bukkit.util.Vector v = bukkitLocation.getDirection();
// Vector direction = new Vector( v.getX(), v.getY(), v.getZ() );
//
Expand Down Expand Up @@ -1248,14 +1259,15 @@ public static InventoryView.Property prisonPropertyToBukkit(Viewable.Property pr
* @return OfflinePlayer
*/
public static OfflinePlayer getBukkitOfflinePlayer( UUID uuid ) {
OfflinePlayer results = null;

for ( OfflinePlayer offP : Bukkit.getOfflinePlayers() ) {
if ( uuid != null && offP.getUniqueId().equals(uuid) ) {
results = offP;
break;
}
}
OfflinePlayer results = Bukkit.getOfflinePlayer(uuid);

// for ( OfflinePlayer offP : Bukkit.getOfflinePlayers() ) {
// if ( uuid != null && offP.getUniqueId().equals(uuid) ) {
// results = offP;
// break;
// }
// }

return results;
}
Expand Down

0 comments on commit 56af7b1

Please sign in to comment.