Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-24 18:10:08 +01:00
fix fixwater/lava + tile paste
Dieser Commit ist enthalten in:
Ursprung
bc25b76ac0
Commit
7cf7c0712f
@ -252,11 +252,11 @@ public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements Bukkit
|
|||||||
existing = section.getType(x & 15, y & 15, z & 15);
|
existing = section.getType(x & 15, y & 15, z & 15);
|
||||||
}
|
}
|
||||||
BlockPosition pos = null;
|
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);
|
pos = new BlockPosition(x, y, z);
|
||||||
nmsWorld.setTypeAndData(pos, blockData, 0);
|
nmsWorld.setTypeAndData(pos, blockData, 0);
|
||||||
// remove tile
|
// remove tile
|
||||||
CompoundTag nativeTag = state.getNbtData();
|
|
||||||
if (nativeTag != null) {
|
if (nativeTag != null) {
|
||||||
// We will assume that the tile entity was created for us,
|
// We will assume that the tile entity was created for us,
|
||||||
// though we do not do this on the Forge version
|
// though we do not do this on the Forge version
|
||||||
|
@ -2010,7 +2010,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue,
|
|||||||
* @return number of blocks affected
|
* @return number of blocks affected
|
||||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
* @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);
|
checkNotNull(origin);
|
||||||
checkArgument(radius >= 0, "radius >= 0 required");
|
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))),
|
new RegionMask(new EllipsoidRegion(null, origin, new Vector(radius, radius, radius))),
|
||||||
liquidMask);
|
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);
|
NonRisingVisitor visitor = new NonRisingVisitor(mask, replace, (int) (radius * 2 + 1), this);
|
||||||
|
|
||||||
// Around the origin in a 3x3 block
|
// Around the origin in a 3x3 block
|
||||||
|
@ -305,7 +305,7 @@ public class UtilityCommands extends MethodCommands {
|
|||||||
public void fixLava(Player player, LocalSession session, EditSession editSession, double radius) throws WorldEditException {
|
public void fixLava(Player player, LocalSession session, EditSession editSession, double radius) throws WorldEditException {
|
||||||
worldEdit.checkMaxRadius(radius);
|
worldEdit.checkMaxRadius(radius);
|
||||||
int affected = editSession.fixLiquid(
|
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.");
|
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 {
|
public void fixWater(Player player, LocalSession session, EditSession editSession, double radius) throws WorldEditException {
|
||||||
worldEdit.checkMaxRadius(radius);
|
worldEdit.checkMaxRadius(radius);
|
||||||
int affected = editSession.fixLiquid(
|
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.");
|
player.print(BBC.getPrefix() + affected + " block(s) have been changed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren