mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Fix a NPE with brush using a global mask and no brush mask
This commit is contained in:
parent
fcd792191a
commit
d82111a4fc
@ -177,15 +177,17 @@ public class BrushTool implements TraceTool {
|
|||||||
BlockBag bag = session.getBlockBag(player);
|
BlockBag bag = session.getBlockBag(player);
|
||||||
|
|
||||||
EditSession editSession = session.createEditSession(player);
|
EditSession editSession = session.createEditSession(player);
|
||||||
Mask existingMask = editSession.getMask();
|
if (mask != null) {
|
||||||
if (existingMask == null) {
|
Mask existingMask = editSession.getMask();
|
||||||
editSession.setMask(mask);
|
if (existingMask == null) {
|
||||||
} else if (existingMask instanceof CombinedMask) {
|
editSession.setMask(mask);
|
||||||
((CombinedMask) existingMask).add(mask);
|
} else if (existingMask instanceof CombinedMask) {
|
||||||
} else {
|
((CombinedMask) existingMask).add(mask);
|
||||||
CombinedMask newMask = new CombinedMask(existingMask);
|
} else {
|
||||||
newMask.add(mask);
|
CombinedMask newMask = new CombinedMask(existingMask);
|
||||||
editSession.setMask(newMask);
|
newMask.add(mask);
|
||||||
|
editSession.setMask(newMask);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user