7
7
import sunsetsatellite .catalyst .core .util .Connection ;
8
8
import sunsetsatellite .catalyst .core .util .Direction ;
9
9
import sunsetsatellite .catalyst .energy .api .IEnergy ;
10
+ import sunsetsatellite .catalyst .energy .api .IEnergyItem ;
10
11
import sunsetsatellite .catalyst .energy .api .IEnergySink ;
11
12
import sunsetsatellite .catalyst .energy .api .IEnergySource ;
12
13
@@ -58,13 +59,13 @@ public int provide(Direction dir, int amount, boolean test) {
58
59
59
60
@ Override
60
61
public int provide (ItemStack stack , int amount , boolean test ){
61
- if (stack .getItem () instanceof ItemEnergyContainer ){
62
+ if (stack .getItem () instanceof IEnergyItem ){
62
63
int provided = Math .min (this .energy , Math .min (this .maxProvide , amount ));
63
- int received = ((ItemEnergyContainer ) stack .getItem ()).receive (stack ,amount ,true );
64
+ int received = ((IEnergyItem ) stack .getItem ()).receive (stack ,amount ,true );
64
65
int actual = Math .min (provided ,received );
65
66
if (!test ){
66
67
energy -= actual ;
67
- ((ItemEnergyContainer ) stack .getItem ()).receive (stack ,actual ,false );
68
+ ((IEnergyItem ) stack .getItem ()).receive (stack ,actual ,false );
68
69
}
69
70
return actual ;
70
71
}
@@ -73,13 +74,13 @@ public int provide(ItemStack stack, int amount, boolean test){
73
74
74
75
@ Override
75
76
public int receive (ItemStack stack , int amount , boolean test ){
76
- if (stack .getItem () instanceof ItemEnergyContainer ){
77
+ if (stack .getItem () instanceof IEnergyItem ){
77
78
int received = Math .min (this .capacity - this .energy , Math .min (this .maxReceive , amount ));
78
- int provided = ((ItemEnergyContainer ) stack .getItem ()).provide (stack ,amount ,true );
79
+ int provided = ((IEnergyItem ) stack .getItem ()).provide (stack ,amount ,true );
79
80
int actual = Math .min (provided ,received );
80
81
if (!test ){
81
82
energy += actual ;
82
- ((ItemEnergyContainer ) stack .getItem ()).provide (stack ,actual ,false );
83
+ ((IEnergyItem ) stack .getItem ()).provide (stack ,actual ,false );
83
84
}
84
85
return actual ;
85
86
}
0 commit comments