@@ -82,9 +82,9 @@ protected NetworkCapability<ICraftingNetwork> getNetworkCapability() {
8282 protected void addTargetToNetwork (INetwork network , PartTarget pos , S state , boolean initialize ) {
8383 network .getCapability (getNetworkCapability ())
8484 .ifPresent (craftingNetwork -> {
85- int channelCrafting = state .getChannelCrafting ();
85+ int channel = state .getChannel ();
8686 state .setTarget (pos );
87- state .setNetworks (network , craftingNetwork , NetworkHelpers .getPartNetworkChecked (network ), channelCrafting , ValueDeseralizationContext .of (pos .getCenter ().getPos ().getLevel (true )), initialize );
87+ state .setNetworks (network , craftingNetwork , NetworkHelpers .getPartNetworkChecked (network ), channel , ValueDeseralizationContext .of (pos .getCenter ().getPos ().getLevel (true )), initialize );
8888 state .setShouldAddToCraftingNetwork (true );
8989 });
9090 }
@@ -138,12 +138,12 @@ public void update(INetwork network, IPartNetwork partNetwork, PartTarget target
138138 addTargetToNetwork (network , target , state , false );
139139 }
140140
141- int channel = state .getChannelCrafting ();
141+ int channelCrafting = state .getChannelCrafting ();
142142
143143 // Update the network data in the part state
144144 if (state .shouldAddToCraftingNetwork ()) {
145145 ICraftingNetwork craftingNetwork = network .getCapability (getNetworkCapability ()).orElse (null );
146- craftingNetwork .addCraftingInterface (channel , state );
146+ craftingNetwork .addCraftingInterface (channelCrafting , state );
147147 state .setShouldAddToCraftingNetwork (false );
148148 }
149149
@@ -154,7 +154,7 @@ public void update(INetwork network, IPartNetwork partNetwork, PartTarget target
154154 if (state .getInventoryOutputBuffer ().isEmpty ()) {
155155 // Tick the job handler
156156 PartPos targetPos = state .getTarget ().getTarget ();
157- state .getCraftingJobHandler ().update (network , channel , targetPos );
157+ state .getCraftingJobHandler ().update (network , channelCrafting , targetPos );
158158 }
159159 }
160160
@@ -189,7 +189,6 @@ public static abstract class State<P extends PartTypeInterfaceCraftingBase<P, S>
189189 protected INetwork network = null ;
190190 protected IPartNetwork partNetwork = null ;
191191 protected ICraftingNetwork craftingNetwork = null ;
192- private int channel = -1 ;
193192 protected ValueDeseralizationContext valueDeseralizationContext ;
194193 private boolean shouldAddToCraftingNetwork = false ;
195194 protected Player lastPlayer ;
@@ -274,7 +273,7 @@ public void setNetworks(@Nullable INetwork network, @Nullable ICraftingNetwork c
274273 this .network = network ;
275274 this .craftingNetwork = craftingNetwork ;
276275 this .partNetwork = partNetwork ;
277- this .channel = channel ;
276+ this .setChannel ( channel ) ;
278277 this .valueDeseralizationContext = valueDeseralizationContext ;
279278 reloadRecipes (initialize );
280279 }
@@ -291,11 +290,6 @@ public ICraftingNetwork getCraftingNetwork() {
291290 return craftingNetwork ;
292291 }
293292
294- @ Override
295- public int getChannel () {
296- return channel ;
297- }
298-
299293 @ Override
300294 public boolean canScheduleCraftingJobs () {
301295 return getCraftingJobHandler ().canScheduleCraftingJobs ();
0 commit comments