2020import  java .util .function .Consumer ;
2121import  java .util .function .Supplier ;
2222
23- /** 
24-  * <p>Represents a GUI configuration for a machine.</p> 
25-  * 
26-  * <p>This is effectively immutable and should be treated as such. Whenever a modification is made, a copy is created 
27-  * and the modification is applied to the copy, rather than the original. This allows for branching of GUI 
28-  * configurations without modifying the original instance. That capability is important for being able to add a steam 
29-  * input slot, for example, without the steam slot also being included in the electric machines.</p> 
30-  */ 
3123public  final  class  MachineGuiConfiguration 
3224{
3325	private  final  boolean            isMultiblock ;
@@ -53,7 +45,7 @@ public final class MachineGuiConfiguration
5345		this .recipeType  = recipeType ;
5446	}
5547
56- 	private  MachineGuiConfiguration  copy ()
48+ 	public  MachineGuiConfiguration  copy ()
5749	{
5850		var  copy  = new  MachineGuiConfiguration (isMultiblock , steamMode , recipeType );
5951		copy .guiHeight  = guiHeight ;
@@ -124,37 +116,32 @@ public MachineRecipePredicate getPredicate()
124116
125117	public  MachineGuiConfiguration  guiHeight (int  guiHeight )
126118	{
127- 		var  copy  = this .copy ();
128- 		copy .guiHeight  = guiHeight ;
129- 		return  copy ;
119+ 		this .guiHeight  = guiHeight ;
120+ 		return  this ;
130121	}
131122
132123	public  MachineGuiConfiguration  lockButton (boolean  lockButton )
133124	{
134- 		var  copy  = this .copy ();
135- 		copy .lockButton  = lockButton ;
136- 		return  copy ;
125+ 		this .lockButton  = lockButton ;
126+ 		return  this ;
137127	}
138128
139129	public  MachineGuiConfiguration  inventoryOnlySlots (Consumer <MachineSlotConfiguration .Builder > builder )
140130	{
141- 		var  copy  = this .copy ();
142- 		builder .accept (copy .inventoryOnlySlots );
143- 		return  copy ;
131+ 		builder .accept (inventoryOnlySlots );
132+ 		return  this ;
144133	}
145134
146135	public  MachineGuiConfiguration  slots (Consumer <MachineSlotConfiguration .Builder > builder )
147136	{
148- 		var  copy  = this .copy ();
149- 		builder .accept (copy .slots );
150- 		return  copy ;
137+ 		builder .accept (slots );
138+ 		return  this ;
151139	}
152140
153141	public  MachineGuiConfiguration  progressBar (int  renderX , int  renderY , String  progressBarType , boolean  isVertical )
154142	{
155- 		var  copy  = this .copy ();
156- 		copy .progressBar  = new  ProgressBar .Parameters (renderX , renderY , progressBarType , isVertical );
157- 		return  copy ;
143+ 		this .progressBar  = new  ProgressBar .Parameters (renderX , renderY , progressBarType , isVertical );
144+ 		return  this ;
158145	}
159146
160147	public  MachineGuiConfiguration  progressBar (int  renderX , int  renderY , String  progressBarType )
@@ -164,24 +151,21 @@ public MachineGuiConfiguration progressBar(int renderX, int renderY, String prog
164151
165152	public  MachineGuiConfiguration  energyBar (int  renderX , int  renderY )
166153	{
167- 		var  copy  = this .copy ();
168- 		copy .energyBar  = new  EnergyBar .Parameters (renderX , renderY );
169- 		return  copy ;
154+ 		this .energyBar  = new  EnergyBar .Parameters (renderX , renderY );
155+ 		return  this ;
170156	}
171157
172158	public  MachineGuiConfiguration  efficiencyBar (int  renderX , int  renderY )
173159	{
174- 		var  copy  = this .copy ();
175- 		copy .efficiencyBar  = new  RecipeEfficiencyBar .Parameters (renderX , renderY );
176- 		return  copy ;
160+ 		this .efficiencyBar  = new  RecipeEfficiencyBar .Parameters (renderX , renderY );
161+ 		return  this ;
177162	}
178163
179164	public  MachineGuiConfiguration  predicate (MachineRecipePredicate  predicate )
180165	{
181166		Assert .notNull (predicate );
182- 		var  copy  = this .copy ();
183- 		copy .predicate  = predicate ;
184- 		return  copy ;
167+ 		this .predicate  = predicate ;
168+ 		return  this ;
185169	}
186170
187171	public  MachineGuiParameters  createGuiParams (ResourceLocation  blockId )
0 commit comments