mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Add base of sendFakeBlock to Sponge and Forge impls
This commit is contained in:
@ -30,6 +30,7 @@ import com.sk89q.worldedit.internal.cui.CUIEvent;
|
||||
import com.sk89q.worldedit.session.SessionKey;
|
||||
import com.sk89q.worldedit.util.HandSide;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.gamemode.GameMode;
|
||||
import com.sk89q.worldedit.world.gamemode.GameModes;
|
||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||
@ -183,6 +184,23 @@ public class SpongePlayer extends AbstractPlayerActor {
|
||||
gameMode.getId()).get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendFakeBlock(Vector pos, BlockStateHolder block) {
|
||||
org.spongepowered.api.world.Location<World> loc = player.getWorld().getLocation(pos.getX(), pos.getY(), pos.getZ());
|
||||
if (block == null) {
|
||||
player.sendBlockChange(loc.getBlockPosition(), loc.getBlock());
|
||||
} else {
|
||||
// TODO
|
||||
// player.sendBlockChange(loc, BukkitAdapter.adapt(block));
|
||||
// if (block instanceof BaseBlock && ((BaseBlock) block).hasNbtData()) {
|
||||
// BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
|
||||
// if (adapter != null) {
|
||||
// adapter.sendFakeNBT(player, pos, ((BaseBlock) block).getNbtData());
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SessionKey getSessionKey() {
|
||||
return new SessionKeyImpl(player.getUniqueId(), player.getName());
|
||||
|
Reference in New Issue
Block a user