mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-02 02:47:11 +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);
|
||||
|
||||
EditSession editSession = session.createEditSession(player);
|
||||
Mask existingMask = editSession.getMask();
|
||||
if (existingMask == null) {
|
||||
editSession.setMask(mask);
|
||||
} else if (existingMask instanceof CombinedMask) {
|
||||
((CombinedMask) existingMask).add(mask);
|
||||
} else {
|
||||
CombinedMask newMask = new CombinedMask(existingMask);
|
||||
newMask.add(mask);
|
||||
editSession.setMask(newMask);
|
||||
if (mask != null) {
|
||||
Mask existingMask = editSession.getMask();
|
||||
if (existingMask == null) {
|
||||
editSession.setMask(mask);
|
||||
} else if (existingMask instanceof CombinedMask) {
|
||||
((CombinedMask) existingMask).add(mask);
|
||||
} else {
|
||||
CombinedMask newMask = new CombinedMask(existingMask);
|
||||
newMask.add(mask);
|
||||
editSession.setMask(newMask);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user