tastybento / ASkyBlock-Bugs-N-Features

Bug Tracker for ASkyBlock and AcidIsland - note team is 100% working on next version BentoBox
6 stars 3 forks source link

problem with #getIslandOwnedBy() in api #915

Closed takenakabayashi closed 6 years ago

takenakabayashi commented 6 years ago

Thank you for filing a bug report. Please complete these sections to help speed resolution.

Server version? Remember to say if it is Spigot/Bukkit/Paper etc. PaperSpigot 1.8.8 Plugin version: 3.0.9.4 Is this a new install or upgrade from earlier plugin version? If upgrade, what version did you use before? New install (Optional) What other plugins are you using now? (do /plugins and paste text from the console log here)

Description of issue. What happened? basically im using your api to code a plugin for my server, but i'm running into some problems. whenever i use #getIslandOwnedBy(player) it always returns a different island, which is kinda confusing when its the same player that is using it. Steps to make this happen

System.out.println(plugin.askyblock().getIslandOwnedBy(player.getUniqueId())); System.out.println(plugin.askyblock().getIslandOwnedBy(player.getUniqueId()));

returns com.wasteofplastic.askyblock.Island@10044a7 com.wasteofplastic.askyblock.Island@109d833

even tho its the same player. and its not always those @'s. it's always different @'s What do you think should happen? it should return the same island.

tastybento commented 6 years ago

It's in the Java docs - @return copy of Island object You get a copy of the island object, not the actual island object itself. If you need to get the actual island object, then you'll need to make a direct call, e.g. plugin.getGrid().getIsland(playerUUID); But if you do, be careful with what you change.