GabiJunkes / MultipleBedSpawn

A simple Minecraft plugin to allow players to choose which bed to respawn into.
GNU General Public License v3.0
9 stars 3 forks source link

Fixed malfunction of the /sharebed command when the receiver already has beds #27

Closed DrunkRussianGun closed 8 months ago

DrunkRussianGun commented 8 months ago

There is a bug at the line ShareCommand.java:75 which leads to malfunction of /sharebed command when the receiving player already has registered beds:

receiverBedsData = playerData.get(new NamespacedKey(plugin, "beds"), new BedsDataType());

Here we're trying to get PlayerBedsData of the receiving player by invoking get on playerData which belongs to the owning player actually. Instead we should invoke get on receiverData which really belongs to the receiving player:

receiverBedsData = receiverData.get(new NamespacedKey(plugin, "beds"), new BedsDataType());
GabiJunkes commented 8 months ago

Thank you!!