diff --git a/changelog b/changelog index 9bd0efd23..d23e7d596 100644 --- a/changelog +++ b/changelog @@ -1,28 +1,4 @@ -## The new power network -The entire energy transfer system has been rewritten which should hopefully fix a few things -* Energy should no longer be voided (at least voiding is minimized due to timeouts for unloaded receivers) -* Transfers should be way less resource intensive, as the expected iteration count is now `max(providers, receivers)` instead of `providers * receivers` -The new system should respect priorities and diodes just like the old system did. Batteries still have their original three priority settings, diodes got two additional modes: LOWEST and HIGHEST. -A bunch of tests have been done using the most important machines, however not all machines that had to be changed for the new system have been fully tested. Expect some things to not work, in which case please file a bug report on the issues board. -Just like with the old system, grids going though unloaded chunks should still work so long as the endpoints are loaded. Grids should be less janky when changing while having unloaded parts, wwhich is likely the main cause for energy voiding. -The system can potentially support saving to the world, i.e. keeping unloaded grids functional even after the entire world is unloaded, although the functionality hasn't been implemented yet. - -## Added -* New medium sized electricity pylons - * Come in wood and steel flavor - * The regular ones don't connect to cable blocks, the variants with transformers do (i.e. they act like substations for huge pylons) - -## Changed -* Updated russian localization -* Condensers now need cast plates instead of welded plates -* Tweaked the substation recipe, it now yields two substations -* There is now a config option for steam clouds from cooling towers -* Nuclear explosions no longer play thunder and explosion sounds in a loop, instead they play one singular sound once the shockwave passes the player - * The HUD shake is now also synced up with the shockwave - * In addition to the hud shake, there is one brief screen shake, the same used for mini nukes (although it ends up being more subtle because your screen is most likely covered in shockwave dust) - * The HUD shake is now 3x more intense, but also only 1.5s long (instead of 5) making it snappier - ## Fixed -* Changed the translation keys for bolts, pipes and shells to avoid naming conflicts -* Fixed glpyhid scout rampant mode spawning not working correctly -* Fixed nuclear explosions petrifying fallout layers, turning them into full sellafite blocks \ No newline at end of file +* Fixed battery connection priority being broken, all battery blocks present during the previous updates will now have their priority default to LOW +* Fixed batteries sometimes ending up transferring themselves, wasting their entire receiving and sending speed on doing effectively nothing + * Energy tracking is still a bit flakey so there could be issues that remain with buffer mode batteries, however the transfer caps should mitigate most potential issues \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index f9a8ca1d9..b4ec7f1af 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ mod_version=1.0.27 # Empty build number makes a release type -mod_build_number=4935 +mod_build_number=4936 credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion algorithms),\ \ Hoboy (textures, models), Doctor17 (russian localization), Drillgon200 (effects, models,\ diff --git a/src/main/java/api/hbm/energymk2/PowerNetMK2.java b/src/main/java/api/hbm/energymk2/PowerNetMK2.java index 467d3bbb5..c41ff9e9b 100644 --- a/src/main/java/api/hbm/energymk2/PowerNetMK2.java +++ b/src/main/java/api/hbm/energymk2/PowerNetMK2.java @@ -165,6 +165,30 @@ public class PowerNetMK2 { IEnergyProviderMK2 src = providers.get(0); IEnergyReceiverMK2 dest = receivers.get(0); + + if(src.getPower() <= 0) { providers.remove(0); prevSrc = 0; continue; } + + if(src == dest) { // STALEMATE DETECTED + //if this happens, a buffer will waste both its share of transfer and receiving potential and do effectively nothing, essentially breaking + + //try if placing the conflicting provider at the end of the list does anything + //we do this first because providers have no priority, so we may shuffle those around as much as we want + if(providers.size() > 1) { + providers.add(providers.get(0)); + providers.remove(0); + prevSrc = 0; //this might cause slight issues due to the tracking being effectively lost while there still might be pending operations + continue; + } + //if that didn't work, try shifting the receiver by one place (to minimize priority breakage) + if(receivers.size() > 1) { + receivers.add(2, receivers.get(0)); + receivers.remove(0); + prevDest = 0; //ditto + continue; + } + + //if neither option could be performed, the only conclusion is that this buffer mode battery is alone in the power net, in which case: not my provlem + } long pd = priorityDemand[dest.getPriority().ordinal()]; @@ -175,8 +199,6 @@ public class PowerNetMK2 { long toFill = Math.min(dest.getMaxPower() - dest.getPower(), receiverShare); long finalTransfer = Math.min(toDrain, toFill); - - if(src.getPower() <= 0) { providers.remove(0); prevSrc = 0; continue; } if(toFill <= 0) { receivers.remove(0); prevDest = 0; continue; } finalTransfer -= dest.transferPower(finalTransfer); diff --git a/src/main/java/com/hbm/lib/RefStrings.java b/src/main/java/com/hbm/lib/RefStrings.java index 3b02435f2..0d5894efa 100644 --- a/src/main/java/com/hbm/lib/RefStrings.java +++ b/src/main/java/com/hbm/lib/RefStrings.java @@ -3,7 +3,7 @@ package com.hbm.lib; public class RefStrings { public static final String MODID = "hbm"; public static final String NAME = "Hbm's Nuclear Tech Mod"; - public static final String VERSION = "1.0.27 BETA (4935)"; + public static final String VERSION = "1.0.27 BETA (4936)"; //HBM's Beta Naming Convention: //V T (X) //V -> next release version diff --git a/src/main/java/com/hbm/tileentity/machine/storage/TileEntityMachineBattery.java b/src/main/java/com/hbm/tileentity/machine/storage/TileEntityMachineBattery.java index d1fb7d597..b021eca59 100644 --- a/src/main/java/com/hbm/tileentity/machine/storage/TileEntityMachineBattery.java +++ b/src/main/java/com/hbm/tileentity/machine/storage/TileEntityMachineBattery.java @@ -163,6 +163,10 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I if(!worldObj.isRemote && worldObj.getBlock(xCoord, yCoord, zCoord) instanceof MachineBattery) { + if(priority == null || priority.ordinal() == 0 || priority.ordinal() == 4) { + priority = ConnectionPriority.LOW; + } + int mode = this.getRelevantMode(); if(this.node == null || this.node.expired) {