Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
d0by1 committed Dec 3, 2021
1 parent 4ca48d3 commit efe67e0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ protected void enable() {

PluginManager pm = Bukkit.getPluginManager();
pm.registerEvents(new PlayerListener(this), plugin);
pm.registerEvents(hologramManager.getOffsetListener(), plugin);

// Setup metrics
Metrics metrics = new Metrics(plugin, 12797);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public HologramManager() {
S.sync(this::reload);
}

public OffsetListener getOffsetListener() {
return offsetListener;
}

@Override
public void tick() {
for (Hologram hologram : Hologram.getCachedHolograms()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void updateOffsets(Player player, Hologram hologram) {
Location prevLocation = line.getLocation();
OffsetCalculator.Loc2D result = OffsetCalculator.calculateOffSet(
new OffsetCalculator.Loc2D(playerLoc.getX(), playerLoc.getZ()),
new OffsetCalculator.Loc2D(-line.getOffsetX(), -line.getOffsetZ()),
new OffsetCalculator.Loc2D(line.getOffsetX(), line.getOffsetZ()),
new OffsetCalculator.Loc2D(holoLoc.getX(), holoLoc.getZ())
);
Location finalOffsetLoc = new Location(holoLoc.getWorld(), result.getX(), line.getLocation().getY(), result.getZ());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,4 @@ public void onRespawn(PlayerRespawnEvent e) {
Hologram.getCachedHolograms().forEach(hologram -> hologram.hide(player));
}

// @EventHandler
// public void onTeleport(PlayerChangedWorldEvent e) {
// Player player = e.getPlayer();
// Hologram.getCachedHolograms().forEach(hologram -> hologram.hide(player));
// }

}

0 comments on commit efe67e0

Please sign in to comment.