File tree Expand file tree Collapse file tree
src/main/java/com/circulation/random_complement/mixin/ae2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import appeng .me .GridNode ;
55import appeng .tile .networking .TileCreativeEnergyCell ;
66import com .circulation .random_complement .common .interfaces .RCGrid ;
7- import it .unimi .dsi .fastutil .objects .ObjectOpenHashSet ;
8- import it .unimi .dsi .fastutil .objects .ObjectSet ;
97import org .spongepowered .asm .mixin .Mixin ;
108import org .spongepowered .asm .mixin .Unique ;
119import org .spongepowered .asm .mixin .injection .At ;
1614public class MixinGrid implements RCGrid {
1715
1816 @ Unique
19- private ObjectSet < TileCreativeEnergyCell > rc$ce = new ObjectOpenHashSet <>() ;
17+ private int rc$ce = 0 ;
2018
2119 @ Inject (method = "add" , at = @ At ("HEAD" ))
2220 public void add (GridNode gridNode , CallbackInfo ci ) {
23- if (gridNode .getMachine () instanceof TileCreativeEnergyCell t ) {
24- rc$ce . add ( t ) ;
21+ if (gridNode .getMachine () instanceof TileCreativeEnergyCell ) {
22+ ++ rc$ce ;
2523 }
2624 }
2725
2826 @ Inject (method = "remove" , at = @ At ("HEAD" ))
2927 public void remove (GridNode gridNode , CallbackInfo ci ) {
30- if (gridNode .getMachine () instanceof TileCreativeEnergyCell t ) {
31- rc$ce . remove ( t ) ;
28+ if (gridNode .getMachine () instanceof TileCreativeEnergyCell ) {
29+ -- rc$ce ;
3230 }
3331 }
3432
3533 @ Override
3634 public boolean r$hasCreativeEnergyCell () {
37- return ! rc$ce . isEmpty () ;
35+ return rc$ce > 0 ;
3836 }
3937}
You can’t perform that action at this time.
0 commit comments