From 7f419618ccf37b113ad16d08812cf44287c53cfe Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sat, 18 Aug 2018 15:22:49 +1000 Subject: [PATCH] Switch to using fake blocks, no more world pollution --- .../sk89q/worldedit/bukkit/BukkitPlayer.java | 18 ++++++++++++++++++ .../bukkit/adapter/BukkitImplAdapter.java | 12 ++++++++++++ .../bukkit/adapter/impl/Spigot_v1_13_R1.class | Bin 20257 -> 21176 bytes .../com/sk89q/worldedit/LocalSession.java | 15 ++------------- .../com/sk89q/worldedit/entity/Player.java | 14 ++++++++++++++ .../platform/AbstractPlayerActor.java | 4 ++++ .../extension/platform/PlayerProxy.java | 6 ++++++ .../internal/cui/ServerCUIHandler.java | 7 ++++++- 8 files changed, 62 insertions(+), 14 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java index 7066da770..f21b8a340 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldEditException; +import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.entity.BaseEntity; @@ -31,6 +32,7 @@ import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.gamemode.GameMode; import com.sk89q.worldedit.world.gamemode.GameModes; import org.bukkit.Bukkit; @@ -239,4 +241,20 @@ public class BukkitPlayer extends AbstractPlayerActor { } + @Override + public void sendFakeBlock(Vector pos, BlockStateHolder block) { + System.out.println("Setting " + (block == null ? "reset" : block.getAsString()) + " as " + pos.toString()); + Location loc = new Location(player.getWorld(), pos.getX(), pos.getY(), pos.getZ()); + if (block == null) { + player.sendBlockChange(loc, player.getWorld().getBlockAt(loc).getBlockData()); + } else { + 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()); + } + } + } + } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java index 4a30a11c0..344eca9d9 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.bukkit.adapter; +import com.sk89q.jnbt.CompoundTag; +import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.registry.state.Property; @@ -27,6 +29,7 @@ import com.sk89q.worldedit.world.block.BlockType; import org.bukkit.Location; import org.bukkit.block.Biome; import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; import java.util.Map; @@ -101,4 +104,13 @@ public interface BukkitImplAdapter { * @return The properties map */ Map getProperties(BlockType blockType); + + /** + * Send the given NBT data to the player. + * + * @param player The player + * @param pos The position + * @param nbtData The NBT Data + */ + void sendFakeNBT(Player player, Vector pos, CompoundTag nbtData); } diff --git a/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_13_R1.class b/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_13_R1.class index 9655a35a6d5e15fdcb7d712e127fb6aef5b7ceea..adda1cf85d1a0bd6e716514bd8b309c0fd66d7f3 100644 GIT binary patch delta 7146 zcmZWu30zgh_dn;%dvD;ri?Rp;3QF#PA-I%~;+C3;OPE`lA(AO3E?8OSYtOPYy}6L4 zl$NHcDE6L;C6<+~YNhSjuI>F=&0PN9xev+u>xa2#&di)S%lDj_d*5TLc*heQc=gP# z=ZL72+H29T{ETUW7DaQ&;vKv*l1}k1%{3P9=4TE2In8?_xYm$+&EWGEzrg!6zZk(U zX?{79_wy@e@KrPTn#Hg4K8xSrH%)WE;)8t1qD%QLL%nVBI~+J{QByvm`CapT&#>M% zgCCd%3qItJEdH23G0joa{nX;m_;ZWD;4d|QWu9M~=9p=Yo8}uof6L!l{5}6*Q5*hI z^G_CK@y{0jkAKnpt3^4+%v1cEX#&4%{=?!w`GjfyGRsaH0e@>gWlE2D0KOBq%@F*ewr=Oeu*rHQr21fCN83GEK5+n!q8_G*VI|6_!Y|SR!dFf_ssdVw9$+qMox!9uXrK^@) zEqP|*C9%Yk@0T9Z(~@4&+faS9Tx!uwGp(>R?0*z*J+t#(Q27&QKgh>nWE)- zi`K|gi`Gh+mT4xK(=7_D6Vft6%S?+lNV!EDWtNs3wA^UXX1U3tEi&80Z(!5BZw z7`xG!4T~egW<71R*<=jbY{?d>GWOkL?AdC`HmNq|-4AnQyG1V;o1QVM1d;X<(y}8$ zc52z>rxP;RqC%;$WVbx41+3$R5A8#N&Ew3Pvk=|Nft^OctrbNA_ z<#jD@xKMx786CZ_oquM@)CqlyN=pXy8pd>G+ks^>CT5MFRa!c!Jga1C`K0pMSwp52 z%`TbYO!p_~;U&f8Wi#@e4>D4$;ZS#4-H@FS9iElPq^6b4WNPa4wBlpx<}>N3if2QARpTD5mzy_br$(rI=93}#eFQF*i6h? zj@t66e8$uYV`u~z>R_5|)8wd*w(4Y>&Z>)67uzaV<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$3Y@a;NONGgw7m`yEqd4aWV|$SUiAJVH!RJvvC@y;dFQsXTY=gFuZ^> zp%iC9IX(hMaW;I!4F4AAz%Mu#{^biZ;e5WwJcbrNj&ZoahpD&-o8l8p+r`)gmvE{r z#lg4?$6!8A!sYld7C1ES%H-|L6>BPQ8Un4kW=&(>x;b%r;B<$HiO>;eunGJb21z)R zjo{k@uC3(mT6~1pVkJ9erEfahNDy4=!Rxi#rF(VMdlqWxAu?{PxBss1xUkc9+7N zeA6q3@T`#Z)VPoUv@C_U2>Q);})a;@0LMS2S#L@z=vzT|+`hmWBaJZruKS|XpJk2xnS8ybW~&Zhp1%j29}9_YEBMD5`G$5fdsEN)zC)$(Hu9})F@oeZf8G^B26y@(l*8dHS9+YQ z6yA}Syj1DFE8QajXzPcZt=EpF3*Yk#A-W8fNp9r(;XOYb4ZtxOu$`nSkOA8d#{+Oe zq^q6jt3nw2GO*4W$d-Y1e)z->p9Y}43~X|C z*eC;={P0--J{Rd0N4i<0Tl{b;0AGl7dm-eMK`5uo5xsaID{e z0(=vm!?)l?JjmzTA>g0JxpEwaQ}_;7j(7P- z=evt<6*u%m1og1n&$4d9=WrE2osm97XU1{_vox V{2xhCRL$vSP$SBy=-omY{{sOeYFq#S diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java index 4e9f56cf2..18e1d40c6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -48,7 +48,6 @@ import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.session.request.Request; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BaseBlock; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.snapshot.Snapshot; @@ -637,12 +636,7 @@ public class LocalSession { // Remove the old block. if (cuiTemporaryBlock != null) { - // TODO Tell server to reset fake block. - try { - createEditSession(player).setBlock(cuiTemporaryBlock, BlockTypes.AIR.getDefaultState()); - } catch (MaxChangedBlocksException e) { - e.printStackTrace(); - } + player.sendFakeBlock(cuiTemporaryBlock, null); cuiTemporaryBlock = null; } @@ -656,12 +650,7 @@ public class LocalSession { ((IntTag) tags.get("z")).getValue() ); - // TODO Send temporary block at that pos to the player. - try { - createEditSession(player).setBlock(cuiTemporaryBlock, block); - } catch (MaxChangedBlocksException e) { - e.printStackTrace(); - } + player.sendFakeBlock(cuiTemporaryBlock, block); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java index b803e93f5..ac2fc81ed 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java @@ -29,8 +29,11 @@ import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.gamemode.GameMode; +import javax.annotation.Nullable; + /** * Represents a player */ @@ -262,4 +265,15 @@ public interface Player extends Entity, Actor { */ void setPosition(Vector pos); + /** + * Sends a fake block to the client. + * + *

+ * This block isn't real. + *

+ * + * @param pos The position of the block + * @param block The block to send, null to reset + */ + void sendFakeBlock(Vector pos, @Nullable BlockStateHolder block); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java index 4c3ced012..0bcb8e24e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java @@ -497,4 +497,8 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { return false; } + @Override + public void sendFakeBlock(Vector pos, BlockStateHolder block) { + + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java index 27da6be8a..adb5e2e83 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java @@ -31,6 +31,7 @@ import com.sk89q.worldedit.session.SessionKey; import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.gamemode.GameMode; import java.util.UUID; @@ -155,4 +156,9 @@ class PlayerProxy extends AbstractPlayerActor { public void setGameMode(GameMode gameMode) { basePlayer.setGameMode(gameMode); } + + @Override + public void sendFakeBlock(Vector pos, BlockStateHolder block) { + basePlayer.sendFakeBlock(pos, block); + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/cui/ServerCUIHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/cui/ServerCUIHandler.java index da78668c7..7535041e0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/cui/ServerCUIHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/cui/ServerCUIHandler.java @@ -127,7 +127,12 @@ public class ServerCUIHandler { posY -= y; posZ -= z; - structureTag.put("name", new StringTag(player.getUniqueId().toString())); +// if (Math.abs(posX) > 32 || Math.abs(posY) > 32 || Math.abs(posZ) > 32) { +// // Structure blocks have a limit +// return null; +// } + + structureTag.put("name", new StringTag("worldedit:" + player.getName())); structureTag.put("author", new StringTag(player.getName())); structureTag.put("metadata", new StringTag("")); structureTag.put("x", new IntTag(x));