This commit is contained in:
Jesse Boyd 2018-04-17 06:39:58 +10:00
parent 5fdad79469
commit 72d85e0754
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 15 additions and 0 deletions

View File

@ -71,4 +71,8 @@ public class FaweNukkitPlayer extends FawePlayer<Player> {
return new NukkitPlayer((NukkitPlatform) Fawe.<FaweNukkit> imp().getPlugin().getPlatform(), parent); return new NukkitPlayer((NukkitPlatform) Fawe.<FaweNukkit> imp().getPlugin().getPlatform(), parent);
} }
@Override
public boolean isSneaking() {
return parent.isSneaking();
}
} }

View File

@ -8,8 +8,10 @@ import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extension.platform.Platform;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Optional;
import java.util.UUID; import java.util.UUID;
import org.spongepowered.api.Sponge; import org.spongepowered.api.Sponge;
import org.spongepowered.api.data.manipulator.mutable.entity.SneakingData;
import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.text.Text; import org.spongepowered.api.text.Text;
import org.spongepowered.api.text.serializer.TextSerializers; import org.spongepowered.api.text.serializer.TextSerializers;
@ -89,4 +91,13 @@ public class SpongePlayer extends FawePlayer<Player> {
return null; return null;
} }
} }
@Override
public boolean isSneaking() {
Optional<SneakingData> sneak = parent.get(SneakingData.class);
if (sneak.isPresent() && sneak.get().sneaking().get()) {
return true;
}
return false;
}
} }