Program: 165698
Project: 165698
Buggy source:
@Override public IFormula createFormula(){
  return new IFormula(){
    private BlockPos thisCoord;
    private BlockPos dimension;
    private BlockPos offset;
    private IBlockState blockState;
    private List<IFormula> formulas=new ArrayList<>();
    private List<Bounds> bounds=new ArrayList<>();
    private List<ShapeModifier> modifiers=new ArrayList<>();
    private List<IBlockState> blockStates=new ArrayList<>();
    @Override public void setup(    BlockPos thisCoord,    BlockPos dimension,    BlockPos offset,    NBTTagCompound card){
      this.thisCoord=thisCoord;
      this.dimension=dimension;
      this.offset=offset;
      if (card == null) {
        return;
      }
      NBTTagList children=card.getTagList("String_Node_Str",Constants.NBT.TAG_COMPOUND);
      for (int i=0; i < children.tagCount(); i++) {
        NBTTagCompound childTag=children.getCompoundTagAt(i);
        IFormula formula=ShapeCardItem.createCorrectFormula(childTag);
        String op=childTag.getString("String_Node_Str");
        ShapeOperation operation=ShapeOperation.getByName(op);
        boolean flip=childTag.getBoolean("String_Node_Str");
        String rot=childTag.getString("String_Node_Str");
        ShapeRotation rotation=ShapeRotation.getByName(rot);
        modifiers.add(new ShapeModifier(operation,flip,rotation));
        BlockPos dim=ShapeCardItem.getClampedDimension(childTag,ShieldConfiguration.maxShieldDimension);
        BlockPos off=ShapeCardItem.getClampedOffset(childTag,ShieldConfiguration.maxShieldOffset);
        BlockPos o=off.add(offset);
        formula.setup(thisCoord,dim,o,childTag);
        formulas.add(formula);
        dim=rotation.transformDimension(dim);
        BlockPos tl=new BlockPos(o.getX() - dim.getX() / 2,o.getY() - dim.getY() / 2,o.getZ() - dim.getZ() / 2);
        bounds.add(new Bounds(tl,tl.add(dim),o));
        IBlockState state=null;
        if (childTag.hasKey("String_Node_Str")) {
          Block block=ForgeRegistries.BLOCKS.getValue(new ResourceLocation(childTag.getString("String_Node_Str")));
          if (block != null) {
            int meta=childTag.getInteger("String_Node_Str");
            state=block.getStateFromMeta(meta);
          }
        }
        blockStates.add(state);
      }
    }
    @Override public IBlockState getLastState(){
      return blockState;
    }
    @Override public int isInside(    int x,    int y,    int z){
      blockState=null;
      x-=thisCoord.getX();
      y-=thisCoord.getY();
      z-=thisCoord.getZ();
      int ok=0;
      for (int i=0; i < formulas.size(); i++) {
        IFormula formula=formulas.get(i);
        Bounds bounds=this.bounds.get(i);
        ShapeModifier modifier=modifiers.get(i);
        int inside=0;
        if (bounds.in(x,y,z)) {
          int tx=x;
          int ty=y;
          int tz=z;
          BlockPos o=bounds.getOffset();
switch (modifier.getRotation()) {
default :
case NONE:
            break;
case X:
          tx=x;
        ty=(z - o.getZ()) + o.getY();
      tz=(y - o.getY()) + o.getZ();
    break;
case Y:
  tx=(z - o.getZ()) + o.getX();
;
ty=y;
tz=(x - o.getX()) + o.getZ();
break;
case Z:
tx=(y - o.getY()) + o.getX();
;
ty=(x - o.getX()) + o.getY();
tz=z;
break;
}
if (modifier.isFlipY()) {
ty=o.getY() - (ty - o.getY());
}
inside=formula.isInside(tx + thisCoord.getX(),ty + thisCoord.getY(),tz + thisCoord.getZ());
}
switch (modifier.getOperation()) {
case UNION:
if (inside == 1) {
ok=1;
blockState=blockStates.get(i);
if (blockState == null) {
blockState=formula.getLastState();
}
}
break;
case SUBTRACT:
if (inside == 1) {
ok=0;
}
break;
case INTERSECT:
if (inside == 1 && ok == 1) {
ok=1;
blockState=blockStates.get(i);
if (blockState == null) {
blockState=formula.getLastState();
}
}
 else {
ok=0;
}
break;
}
}
return ok;
}
@Override public boolean isCustom(){
return true;
}
}
;
}

Fixed version (ground truth):
@Override public IFormula createFormula(){
  return new IFormula(){
    private BlockPos thisCoord;
    private BlockPos dimension;
    private BlockPos offset;
    private IBlockState blockState;
    private List<IFormula> formulas=new ArrayList<>();
    private List<Bounds> bounds=new ArrayList<>();
    private List<ShapeModifier> modifiers=new ArrayList<>();
    private List<IBlockState> blockStates=new ArrayList<>();
    @Override public void setup(    BlockPos thisCoord,    BlockPos dimension,    BlockPos offset,    NBTTagCompound card){
      this.thisCoord=thisCoord;
      this.dimension=dimension;
      this.offset=offset;
      if (card == null) {
        return;
      }
      int dx=dimension.getX();
      int dy=dimension.getY();
      int dz=dimension.getZ();
      if (dx <= 0 || dy <= 0 || dz <= 0) {
        return;
      }
      NBTTagList children=card.getTagList("String_Node_Str",Constants.NBT.TAG_COMPOUND);
      for (int i=0; i < children.tagCount(); i++) {
        NBTTagCompound childTag=children.getCompoundTagAt(i);
        IFormula formula=ShapeCardItem.createCorrectFormula(childTag);
        String op=childTag.getString("String_Node_Str");
        ShapeOperation operation=ShapeOperation.getByName(op);
        boolean flip=childTag.getBoolean("String_Node_Str");
        String rot=childTag.getString("String_Node_Str");
        ShapeRotation rotation=ShapeRotation.getByName(rot);
        modifiers.add(new ShapeModifier(operation,flip,rotation));
        BlockPos dim=ShapeCardItem.getClampedDimension(childTag,ShieldConfiguration.maxShieldDimension);
        BlockPos off=ShapeCardItem.getClampedOffset(childTag,ShieldConfiguration.maxShieldOffset);
        BlockPos o=off.add(offset);
        formula.setup(thisCoord,dim,o,childTag);
        formulas.add(formula);
        dim=rotation.transformDimension(dim);
        BlockPos tl=new BlockPos(o.getX() - dim.getX() / 2,o.getY() - dim.getY() / 2,o.getZ() - dim.getZ() / 2);
        bounds.add(new Bounds(tl,tl.add(dim),o));
        IBlockState state=null;
        if (childTag.hasKey("String_Node_Str")) {
          Block block=ForgeRegistries.BLOCKS.getValue(new ResourceLocation(childTag.getString("String_Node_Str")));
          if (block != null) {
            int meta=childTag.getInteger("String_Node_Str");
            state=block.getStateFromMeta(meta);
          }
        }
        blockStates.add(state);
      }
    }
    @Override public IBlockState getLastState(){
      return blockState;
    }
    @Override public int isInside(    int x,    int y,    int z){
      blockState=null;
      x-=thisCoord.getX();
      y-=thisCoord.getY();
      z-=thisCoord.getZ();
      int ok=0;
      for (int i=0; i < formulas.size(); i++) {
        IFormula formula=formulas.get(i);
        Bounds bounds=this.bounds.get(i);
        ShapeModifier modifier=modifiers.get(i);
        int inside=0;
        if (bounds.in(x,y,z)) {
          int tx=x;
          int ty=y;
          int tz=z;
          BlockPos o=bounds.getOffset();
switch (modifier.getRotation()) {
default :
case NONE:
            break;
case X:
          tx=x;
        ty=(z - o.getZ()) + o.getY();
      tz=(y - o.getY()) + o.getZ();
    break;
case Y:
  tx=(z - o.getZ()) + o.getX();
;
ty=y;
tz=(x - o.getX()) + o.getZ();
break;
case Z:
tx=(y - o.getY()) + o.getX();
;
ty=(x - o.getX()) + o.getY();
tz=z;
break;
}
if (modifier.isFlipY()) {
ty=o.getY() - (ty - o.getY());
}
inside=formula.isInside(tx + thisCoord.getX(),ty + thisCoord.getY(),tz + thisCoord.getZ());
}
switch (modifier.getOperation()) {
case UNION:
if (inside == 1) {
ok=1;
blockState=blockStates.get(i);
if (blockState == null) {
blockState=formula.getLastState();
}
}
break;
case SUBTRACT:
if (inside == 1) {
ok=0;
}
break;
case INTERSECT:
if (inside == 1 && ok == 1) {
ok=1;
if (blockState == null) {
blockState=blockStates.get(i);
if (blockState == null) {
blockState=formula.getLastState();
}
}
}
 else {
ok=0;
}
break;
}
}
return ok;
}
@Override public boolean isCustom(){
return true;
}
}
;
}