Various Sponge changes

- many improvements
- inventory utilities broke when updating to Sponge API 6.0.0
This commit is contained in:
MattBDev
2016-11-26 16:49:13 -05:00
parent 8d442f58d4
commit 62b353f82d
13 changed files with 80 additions and 80 deletions

View File

@ -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();
}
}

View File

@ -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);