mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 18:24:43 +02:00
Various Sponge changes
- many improvements - inventory utilities broke when updating to Sponge API 6.0.0
This commit is contained in:
@ -1,24 +1,30 @@
|
||||
package com.plotsquared.sponge.object;
|
||||
|
||||
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
|
||||
import org.spongepowered.api.entity.living.player.User;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class SpongeOfflinePlayer implements OfflinePlotPlayer {
|
||||
|
||||
private User user;
|
||||
|
||||
public SpongeOfflinePlayer(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
@Override public UUID getUUID() {
|
||||
return null;
|
||||
return user.getUniqueId();
|
||||
}
|
||||
|
||||
@Override public long getLastPlayed() {
|
||||
return 0;
|
||||
return 0; //todo
|
||||
}
|
||||
|
||||
@Override public boolean isOnline() {
|
||||
return false;
|
||||
return user.isOnline();
|
||||
}
|
||||
|
||||
@Override public String getName() {
|
||||
return null;
|
||||
return user.getName();
|
||||
}
|
||||
}
|
||||
|
@ -159,9 +159,6 @@ public class SpongePlayer extends PlotPlayer {
|
||||
return;
|
||||
case NOT_SET:
|
||||
this.player.offer(Keys.GAME_MODE, GameModes.NOT_SET);
|
||||
return;
|
||||
default:
|
||||
this.player.offer(Keys.GAME_MODE, GameModes.NOT_SET);
|
||||
}
|
||||
}
|
||||
|
||||
@ -186,7 +183,8 @@ public class SpongePlayer extends PlotPlayer {
|
||||
public void playMusic(Location location, int id) {
|
||||
switch (id) {
|
||||
case 0:
|
||||
this.player.playSound(null, SpongeUtil.getLocation(location).getPosition(), 1);
|
||||
//Placeholder because Sponge doesn't have a stopSound() implemented yet.
|
||||
this.player.playSound(SoundTypes.BLOCK_CLOTH_PLACE, SpongeUtil.getLocation(location).getPosition(), 0);
|
||||
break;
|
||||
case 2256:
|
||||
this.player.playSound(SoundTypes.RECORD_11, SpongeUtil.getLocation(location).getPosition(), 1);
|
||||
|
Reference in New Issue
Block a user