fix fixwater/lava + tile paste

This commit is contained in:
Jesse Boyd 2018-10-13 19:50:13 +11:00
parent bc25b76ac0
commit 7cf7c0712f
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
3 changed files with 6 additions and 6 deletions

View File

@ -252,11 +252,11 @@ public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements Bukkit
existing = section.getType(x & 15, y & 15, z & 15);
}
BlockPosition pos = null;
if (existing instanceof TileEntityBlock || blockData instanceof TileEntityBlock) {
CompoundTag nativeTag = state.getNbtData();
if (nativeTag != null || existing instanceof TileEntityBlock) {
pos = new BlockPosition(x, y, z);
nmsWorld.setTypeAndData(pos, blockData, 0);
// remove tile
CompoundTag nativeTag = state.getNbtData();
if (nativeTag != null) {
// We will assume that the tile entity was created for us,
// though we do not do this on the Forge version

View File

@ -2010,7 +2010,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
* @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed
*/
public int fixLiquid(final Vector origin, final double radius, Mask liquidMask) {
public int fixLiquid(final Vector origin, final double radius, Mask liquidMask, Pattern pattern) {
checkNotNull(origin);
checkArgument(radius >= 0, "radius >= 0 required");
@ -2020,7 +2020,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
new RegionMask(new EllipsoidRegion(null, origin, new Vector(radius, radius, radius))),
liquidMask);
BlockReplace replace = new BlockReplace(this, BlockTypes.AIR.getDefaultState());
BlockReplace replace = new BlockReplace(this, pattern);
NonRisingVisitor visitor = new NonRisingVisitor(mask, replace, (int) (radius * 2 + 1), this);
// Around the origin in a 3x3 block

View File

@ -305,7 +305,7 @@ public class UtilityCommands extends MethodCommands {
public void fixLava(Player player, LocalSession session, EditSession editSession, double radius) throws WorldEditException {
worldEdit.checkMaxRadius(radius);
int affected = editSession.fixLiquid(
session.getPlacementPosition(player), radius, BlockTypes.LAVA.toMask(editSession));
session.getPlacementPosition(player), radius, BlockTypes.LAVA.toMask(editSession), BlockTypes.LAVA.getDefaultState());
player.print(BBC.getPrefix() + affected + " block(s) have been changed.");
}
@ -321,7 +321,7 @@ public class UtilityCommands extends MethodCommands {
public void fixWater(Player player, LocalSession session, EditSession editSession, double radius) throws WorldEditException {
worldEdit.checkMaxRadius(radius);
int affected = editSession.fixLiquid(
session.getPlacementPosition(player), radius, BlockTypes.WATER.toMask(editSession));
session.getPlacementPosition(player), radius, BlockTypes.WATER.toMask(editSession), BlockTypes.WATER.getDefaultState());
player.print(BBC.getPrefix() + affected + " block(s) have been changed.");
}