mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45:51 +00:00
Merge pull request #629 from meiamsome/nuclear-reactor-fix
Fix AReactor Issue
This commit is contained in:
commit
2f2cf7300f
@ -299,10 +299,11 @@ public abstract class AReactor extends SlimefunItem {
|
|||||||
extraTick(l);
|
extraTick(l);
|
||||||
int timeleft = progress.get(l);
|
int timeleft = progress.get(l);
|
||||||
if (timeleft > 0) {
|
if (timeleft > 0) {
|
||||||
if (ChargableBlock.getMaxCharge(l) - ChargableBlock.getCharge(l) >= getEnergyProduction()) {
|
boolean should_charge = ChargableBlock.getMaxCharge(l) - ChargableBlock.getCharge(l) >= getEnergyProduction();
|
||||||
|
if (should_charge) {
|
||||||
ChargableBlock.addCharge(l, getEnergyProduction());
|
ChargableBlock.addCharge(l, getEnergyProduction());
|
||||||
}
|
}
|
||||||
if (ChargableBlock.getMaxCharge(l) - ChargableBlock.getCharge(l) >= getEnergyProduction() || !BlockStorage.getBlockInfo(l, "reactor-mode").equals("generator")) {
|
if (should_charge || !BlockStorage.getBlockInfo(l, "reactor-mode").equals("generator")) {
|
||||||
progress.put(l, timeleft - 1);
|
progress.put(l, timeleft - 1);
|
||||||
|
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
|
||||||
|
@ -114,9 +114,6 @@ public class EnergyNet {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
supply = supply + energy;
|
supply = supply + energy;
|
||||||
if (ChargableBlock.isChargable(source)) {
|
|
||||||
supply = DoubleHandler.fixDouble(supply + ChargableBlock.getCharge(source));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
TickerTask.block_timings.put(source, System.currentTimeMillis() - timestamp);
|
TickerTask.block_timings.put(source, System.currentTimeMillis() - timestamp);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user