Force create the canvas if needed to prevent a NPE.

This commit is contained in:
ProfMobius committed 2013-12-06 23:51:46 +01:00
1 parent 2de4ffd1ea
commit a4694d4554
3 files changed
+12

No files matched your search

@@ -232,6 +232,9 @@ public class OverlayLoadedChunks implements IMwDataProvider {
@SideOnly(Side.CLIENT)
public void setupTable(HashSet<TicketData> tickets){
if (this.canvas == null)
this.canvas = new LayoutCanvas();
LayoutBase layout = (LayoutBase)this.canvas.addWidget("Table", new LayoutBase(null));
//layout.setGeometry(new WidgetGeometry(100.0,0.0,300.0,100.0,CType.RELXY, CType.REL_Y, WAlign.RIGHT, WAlign.TOP));
layout.setGeometry(new WidgetGeometry(100.0,0.0,30.0,100.0,CType.RELXY, CType.RELXY, WAlign.RIGHT, WAlign.TOP));
@@ -258,6 +258,9 @@ public class OverlayMeanTime implements IMwDataProvider {
@SideOnly(Side.CLIENT)
public void setupTable(ArrayList<TileEntityStats> entities){
if (this.canvas == null)
this.canvas = new LayoutCanvas();
LayoutBase layout = (LayoutBase)this.canvas.addWidget("Table", new LayoutBase(null));
//layout.setGeometry(new WidgetGeometry(100.0,0.0,300.0,100.0,CType.RELXY, CType.REL_Y, WAlign.RIGHT, WAlign.TOP));
layout.setGeometry(new WidgetGeometry(100.0,0.0,30.0,100.0,CType.RELXY, CType.RELXY, WAlign.RIGHT, WAlign.TOP));
@@ -178,6 +178,9 @@ public class OverlayEntityPerChunk implements IMwDataProvider {
@SideOnly(Side.CLIENT)
public void setupChunkTable(){
if (this.canvas == null)
this.canvas = new LayoutCanvas();
if (this.canvas.hasWidget("Table"))
this.canvas.delWidget("Table");
@@ -208,6 +211,9 @@ public class OverlayEntityPerChunk implements IMwDataProvider {
@SideOnly(Side.CLIENT)
public void setupEntTable(){
if (this.canvas == null)
this.canvas = new LayoutCanvas();
if (this.canvas.hasWidget("Table"))
this.canvas.delWidget("Table");