Added a SolidBlockMask (#solid).

Dieser Commit ist enthalten in:
TomyLobo 2013-10-29 08:04:52 +01:00
Ursprung 02de320980
Commit 627e029fbb
2 geänderte Dateien mit 18 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -84,6 +84,7 @@ import com.sk89q.worldedit.masks.InvertedMask;
import com.sk89q.worldedit.masks.Mask;
import com.sk89q.worldedit.masks.RandomMask;
import com.sk89q.worldedit.masks.RegionMask;
import com.sk89q.worldedit.masks.SolidBlockMask;
import com.sk89q.worldedit.masks.UnderOverlayMask;
import com.sk89q.worldedit.patterns.BlockChance;
import com.sk89q.worldedit.patterns.ClipboardPattern;
@ -731,6 +732,8 @@ public class WorldEdit {
case '#':
if (component.equalsIgnoreCase("#existing")) {
return new ExistingBlockMask();
} else if (component.equalsIgnoreCase("#solid")) {
return new SolidBlockMask();
} else if (component.equalsIgnoreCase("#dregion")
|| component.equalsIgnoreCase("#dselection")
|| component.equalsIgnoreCase("#dsel")) {

Datei anzeigen

@ -0,0 +1,15 @@
package com.sk89q.worldedit.masks;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.blocks.BlockType;
/**
* Works like {@link ExistingBlockMask}, except also dealing with non-solid non-air blocks the same way as with air.
*/
public class SolidBlockMask extends AbstractMask {
@Override
public boolean matches(EditSession editSession, Vector pos) {
return !BlockType.canPassThrough(editSession.getBlockType(pos), editSession.getBlockData(pos));
}
}