1
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:
TheBusyBiscuit 2018-03-25 10:09:33 +02:00 committed by GitHub
commit 2f2cf7300f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -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() {

View File

@ -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);
} }