2525
2626import io .github .opencubicchunks .cubicchunks .cubicgen .preset .wrapper .BlockStateDesc ;
2727import net .malisis .core .client .gui .component .container .UIContainer ;
28- import net .malisis . core . client .gui .component . decoration . UISeparator ;
28+ import net .minecraft . client .gui .GuiTextField ;
2929import net .minecraft .init .Blocks ;
3030
3131import static io .github .opencubicchunks .cubicchunks .cubicgen .common .gui .CwgGuiFactory .makeButton ;
32+ import static io .github .opencubicchunks .cubicchunks .cubicgen .common .gui .CwgGuiFactory .makeIntTextField ;
3233import static io .github .opencubicchunks .cubicchunks .cubicgen .common .gui .CwgGuiFactory .makeLabel ;
34+ import static io .github .opencubicchunks .cubicchunks .cubicgen .common .gui .CwgGuiFactory .makeSeparator ;
3335import static io .github .opencubicchunks .cubicchunks .cubicgen .common .gui .CwgGuiFactory .wrap ;
3436
3537import io .github .opencubicchunks .cubicchunks .cubicgen .preset .FlatLayer ;
@@ -49,9 +51,9 @@ public final class UIFlatTerrainLayer extends UIVerticalTableLayout<UIFlatTerrai
4951 private final CwgGuiLabel blockProperties ;
5052 private final CwgGuiLabel from ;
5153 private final CwgGuiLabel to ;
52- private final UISeparator separator ;
53- private final UIIntegerInputField fromField ;
54- private final UIIntegerInputField toField ;
54+ private final CwgGuiSeparator separator ;
55+ private final GuiTextField fromField ;
56+ private final GuiTextField toField ;
5557
5658 private final FlatCubicGui gui ;
5759
@@ -81,10 +83,10 @@ public UIFlatTerrainLayer(FlatCubicGui guiFor, FlatLayersTab flatLayersTabFor, F
8183 from = makeLabel ("from" );
8284 to = makeLabel ("to_exclusively" );
8385
84- fromField = new UIIntegerInputField ( gui , layer .fromY );
85- toField = new UIIntegerInputField ( gui , layer .toY );
86+ fromField = makeIntTextField ( layer .fromY );
87+ toField = makeIntTextField ( layer .toY );
8688
87- separator = new UISeparator ( gui , false ). setColor ( 0x767676 );
89+ separator = makeSeparator ( );
8890
8991 /*
9092 The layout:
@@ -113,14 +115,14 @@ public UIFlatTerrainLayer(FlatCubicGui guiFor, FlatLayersTab flatLayersTabFor, F
113115 .userResizable (false ).setSizeOf (UISplitLayout .Pos .SECOND , BTN_WIDTH ).autoFitToContent (true );
114116
115117 UISplitLayout <?> fromLayout = new UISplitLayout <>(gui , UISplitLayout .Type .SIDE_BY_SIDE ,
116- wrap (gui , from ), fromField ).setSizeOf (UISplitLayout .Pos .FIRST , 50 ).autoFitToContent (true );
118+ wrap (gui , from ), wrap ( gui , fromField ) ).setSizeOf (UISplitLayout .Pos .FIRST , 50 ).autoFitToContent (true );
117119 UISplitLayout <?> toLayout = new UISplitLayout <>(gui , UISplitLayout .Type .SIDE_BY_SIDE ,
118- wrap (gui , to ), toField ).setSizeOf (UISplitLayout .Pos .FIRST , 90 ).autoFitToContent (true );
120+ wrap (gui , to ), wrap ( gui , toField ) ).setSizeOf (UISplitLayout .Pos .FIRST , 90 ).autoFitToContent (true );
119121
120122 this .add (blockstateButtonsSplit , new GridLocation (0 , 0 , 2 ));
121123 this .add (fromLayout , new GridLocation (0 , 1 , 1 ));
122124 this .add (toLayout , new GridLocation (1 , 1 , 1 ));
123- this .add (separator , new GridLocation (0 , 2 , 2 ));
125+ this .add (wrap ( gui , separator ) , new GridLocation (0 , 2 , 2 ));
124126 this .autoFitToContent (true );
125127
126128 }
@@ -135,12 +137,12 @@ protected void removeLayer() {
135137 }
136138
137139 protected void addLayer () {
138- int to = this .toField .getValue ( );
140+ int to = Integer . parseInt ( this .toField .getText () );
139141 FlatLayer newLayer = new FlatLayer (to , to + 1 , new BlockStateDesc (Blocks .SANDSTONE .getDefaultState ()));
140142 this .flatLayersTab .add (this , newLayer );
141143 }
142144
143145 public FlatLayer toLayer () {
144- return new FlatLayer (fromField .getValue (), toField .getValue ( ), block .getBlockState ());
146+ return new FlatLayer (Integer . parseInt ( fromField .getText ()), Integer . parseInt ( toField .getText () ), block .getBlockState ());
145147 }
146148}
0 commit comments