Skip to content

Commit

Permalink
Try sending fake operator packets to support non-OP
Browse files Browse the repository at this point in the history
  • Loading branch information
me4502 committed Aug 19, 2018
1 parent 4d0df10 commit a354267
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Expand Up @@ -33,6 +33,7 @@
import com.sk89q.worldedit.util.HandSide;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.gamemode.GameMode;
import com.sk89q.worldedit.world.gamemode.GameModes;
import org.bukkit.Bukkit;
Expand Down Expand Up @@ -252,6 +253,9 @@ public void sendFakeBlock(Vector pos, BlockStateHolder block) {
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
if (adapter != null) {
adapter.sendFakeNBT(player, pos, ((BaseBlock) block).getNbtData());
if (block.getBlockType() == BlockTypes.STRUCTURE_BLOCK) {
adapter.sendFakeOP(player);
}
}
}
}
Expand Down
Expand Up @@ -113,4 +113,12 @@ public interface BukkitImplAdapter {
* @param nbtData The NBT Data
*/
void sendFakeNBT(Player player, Vector pos, CompoundTag nbtData);

/**
* Make the client think it has operator status.
* This does not give them any operator capabilities.
*
* @param player The player
*/
void sendFakeOP(Player player);
}
Binary file not shown.

0 comments on commit a354267

Please sign in to comment.