Move insert/extract usage of wireless grid to method for API consumers
This commit is contained in:
@@ -95,7 +95,7 @@ public class ItemGridHandler implements IItemGridHandler {
|
||||
INetworkItem networkItem = network.getNetworkItemHandler().getItem(player);
|
||||
|
||||
if (networkItem != null && networkItem instanceof NetworkItemWirelessGrid) {
|
||||
((NetworkItemWirelessGrid) networkItem).drainEnergy(RS.INSTANCE.config.wirelessGridExtractUsage);
|
||||
((NetworkItemWirelessGrid) networkItem).drainEnergy(((NetworkItemWirelessGrid) networkItem).getExtractUsage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public class ItemGridHandler implements IItemGridHandler {
|
||||
INetworkItem networkItem = network.getNetworkItemHandler().getItem(player);
|
||||
|
||||
if (networkItem != null && networkItem instanceof NetworkItemWirelessGrid) {
|
||||
((NetworkItemWirelessGrid) networkItem).drainEnergy(RS.INSTANCE.config.wirelessGridInsertUsage);
|
||||
((NetworkItemWirelessGrid) networkItem).drainEnergy(((NetworkItemWirelessGrid) networkItem).getInsertUsage());
|
||||
}
|
||||
|
||||
return remainder;
|
||||
@@ -145,7 +145,7 @@ public class ItemGridHandler implements IItemGridHandler {
|
||||
INetworkItem networkItem = network.getNetworkItemHandler().getItem(player);
|
||||
|
||||
if (networkItem != null && networkItem instanceof NetworkItemWirelessGrid) {
|
||||
((NetworkItemWirelessGrid) networkItem).drainEnergy(RS.INSTANCE.config.wirelessGridInsertUsage);
|
||||
((NetworkItemWirelessGrid) networkItem).drainEnergy(((NetworkItemWirelessGrid) networkItem).getInsertUsage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,4 +67,12 @@ public class NetworkItemWirelessGrid implements INetworkItem {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getInsertUsage() {
|
||||
return RS.INSTANCE.config.wirelessGridInsertUsage;
|
||||
}
|
||||
|
||||
public int getExtractUsage() {
|
||||
return RS.INSTANCE.config.wirelessGridExtractUsage;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user