From 614f5db7dc5d192007f71d94586bf57a8d5bb7b3 Mon Sep 17 00:00:00 2001 From: Boblet Date: Mon, 10 Feb 2025 16:53:37 +0100 Subject: [PATCH] fuck! --- changelog | 9 ++++ .../hbm/handler/nei/NEIUniversalHandler.java | 4 +- .../tileentity/machine/rbmk/RBMKDials.java | 4 +- src/main/java/com/hbm/uninos/GenNode.java | 12 +++++ .../java/com/hbm/uninos/GenNodeWorld.java | 29 ---------- .../java/com/hbm/uninos/GenNodespace.java | 34 ------------ .../java/com/hbm/uninos/UniNodespace.java | 53 ++++++++++++++++++- 7 files changed, 77 insertions(+), 68 deletions(-) delete mode 100644 src/main/java/com/hbm/uninos/GenNodeWorld.java delete mode 100644 src/main/java/com/hbm/uninos/GenNodespace.java diff --git a/changelog b/changelog index 45700092f..9a1af5f24 100644 --- a/changelog +++ b/changelog @@ -1,9 +1,17 @@ +## Added +* Refueling station + * Like a charging station, but for fluids + ## Changed * Particle detectors now print an error for when the recipe could not be completed * Night Vision Goggles toggles with armor HUD * Removed "no ore dict data" line from tooltips with extended view enabled * Added a client config called `GUN_ANIMATION_SPEED` which allows the speed of gun animations to be changed * Mostly for debugging, since it only applies to the bus animation system, things like smoke trails and muzzle flashes are unaffected +* Item filters can now filter by bedrock ore grade +* Meteorite dungeons now use a new structure system + * The rooms have been completely changed, and the dungeons are no longer single-level with fixed room sizes + * Dungeons no longer lag the game to hell when generating ## Fixed * Fixed items being annihilated when shift clicking them into the particle source @@ -11,3 +19,4 @@ * Fixed particle detectors not always using power when they should * Fixed rotary furnace voiding low pressure steam when dealing with input numbers not divisible by 100 * Fixed state leak causing smoke from the right akimbo weapon to glow when the first one is fired +* Fixed incorrect default values for new RBMK dials \ No newline at end of file diff --git a/src/main/java/com/hbm/handler/nei/NEIUniversalHandler.java b/src/main/java/com/hbm/handler/nei/NEIUniversalHandler.java index 2b8eeed8b..d82303b6c 100644 --- a/src/main/java/com/hbm/handler/nei/NEIUniversalHandler.java +++ b/src/main/java/com/hbm/handler/nei/NEIUniversalHandler.java @@ -106,8 +106,8 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler implemen @Override public List getOtherStacks() { List other = new ArrayList(); - for(PositionedStack pos : output) { - other.add(pos); + for(int i = 1; i < output.length; i++) { + other.add(output[i]); } other.add(machinePositioned); return getCycledIngredients(cycleticks / 20, other); diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/RBMKDials.java b/src/main/java/com/hbm/tileentity/machine/rbmk/RBMKDials.java index b8e24f1c8..85b3834e8 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/RBMKDials.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/RBMKDials.java @@ -38,8 +38,8 @@ public class RBMKDials { KEY_MODERATOR_EFFICIENCY("dialModeratorEfficiency", 1.0), KEY_ABSORBER_EFFICIENCY("dialAbsorberEfficiency", 1.0), KEY_REFLECTOR_EFFICIENCY("dialReflectorEfficiency", 1.0), - KEY_DISABLE_DEPLETION("dialDisableDepletion", true), - KEY_DISABLE_XENON("dialDisableXenon", true); + KEY_DISABLE_DEPLETION("dialDisableDepletion", false), + KEY_DISABLE_XENON("dialDisableXenon", false); public final String keyString; public final Object defValue; diff --git a/src/main/java/com/hbm/uninos/GenNode.java b/src/main/java/com/hbm/uninos/GenNode.java index 8be4641b3..d9c3d8001 100644 --- a/src/main/java/com/hbm/uninos/GenNode.java +++ b/src/main/java/com/hbm/uninos/GenNode.java @@ -1,10 +1,12 @@ package com.hbm.uninos; +import com.hbm.uninos.UniNodespace.UniNodeWorld; import com.hbm.util.fauxpointtwelve.BlockPos; import com.hbm.util.fauxpointtwelve.DirPos; public class GenNode { + public long id; public BlockPos[] positions; public DirPos[] connections; public INodeNet net; @@ -12,6 +14,7 @@ public class GenNode { public boolean recentlyChanged = true; public GenNode(BlockPos... positions) { + this.id = UniNodeWorld.nextId++; this.positions = positions; } @@ -37,3 +40,12 @@ public class GenNode { this.recentlyChanged = true; } } + +/* + * + * ok so here's the deal: attempt #1 SUCKED. + * making a central nodespaces hashmap that holds one instance of each possible nodespace sounds like a great and simple solution + * until you realize that every single fucking fluid under the sun needs to be its own nodespace. which means the update function + * has to iterate over every world instance, and for every world instance there's 150 or so nodespaces for fluids alone. not good. + * + */ diff --git a/src/main/java/com/hbm/uninos/GenNodeWorld.java b/src/main/java/com/hbm/uninos/GenNodeWorld.java deleted file mode 100644 index 82c2fcb81..000000000 --- a/src/main/java/com/hbm/uninos/GenNodeWorld.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.hbm.uninos; - -import java.util.HashMap; - -import com.hbm.util.fauxpointtwelve.BlockPos; - -public class GenNodeWorld { - - public HashMap> nodes = new HashMap(); - - public void pushNode(GenNode node) { - for(BlockPos pos : node.positions) { - nodes.put(pos, node); - } - } - - public void popNode(GenNode node) { - if(node.net != null) node.net.destroy(); - for(BlockPos pos : node.positions) { - nodes.remove(pos); - node.expired = true; - } - } - - public void popNode(BlockPos pos) { - GenNode node = nodes.get(pos); - if(node != null) popNode(node); - } -} diff --git a/src/main/java/com/hbm/uninos/GenNodespace.java b/src/main/java/com/hbm/uninos/GenNodespace.java deleted file mode 100644 index 8785df0b1..000000000 --- a/src/main/java/com/hbm/uninos/GenNodespace.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.hbm.uninos; - -import java.util.HashMap; - -import com.hbm.util.fauxpointtwelve.BlockPos; - -import net.minecraft.world.World; - -public class GenNodespace { - - public HashMap> worlds = new HashMap<>(); - - public GenNode getNode(World world, int x, int y, int z) { - GenNodeWorld nodeWorld = worlds.get(world); - if(nodeWorld != null) return (GenNode) nodeWorld.nodes.get(new BlockPos(x, y, z)); - return null; - } - - public void createNode(World world, GenNode node) { - GenNodeWorld nodeWorld = worlds.get(world); - if(nodeWorld == null) { - nodeWorld = new GenNodeWorld(); - worlds.put(world, nodeWorld); - } - nodeWorld.pushNode(node); - } - - public void destroyNode(World world, int x, int y, int z) { - GenNode node = getNode(world, x, y, z); - if(node != null) { - worlds.get(world).popNode(node); - } - } -} diff --git a/src/main/java/com/hbm/uninos/UniNodespace.java b/src/main/java/com/hbm/uninos/UniNodespace.java index e56468b3c..84a3d0ddc 100644 --- a/src/main/java/com/hbm/uninos/UniNodespace.java +++ b/src/main/java/com/hbm/uninos/UniNodespace.java @@ -1,8 +1,59 @@ package com.hbm.uninos; import java.util.HashMap; +import java.util.HashSet; + +import com.hbm.util.fauxpointtwelve.BlockPos; + +import net.minecraft.world.World; public class UniNodespace { + + public static HashMap worlds = new HashMap(); + + /* + * attempt #1 went south because there would be an entirely separate nodespace for every single possible type + * which for fluids means at least 150 alone, and that's not great. + * this is attempt #2 which is not good for reasons explained below + */ + public static class UniNodeWorld { + + public static int nextId = 0; - public static HashMap nodespaces = new HashMap(); + //shot in the dark: how well is the dual hashmap system gonna perform? + //how are we gonna handle type segregation for network forming? + public HashMap> posToId = new HashMap<>(); + public HashMap idToNode = new HashMap<>(); + + /** Adds a node at all its positions to the nodespace */ + public void pushNode(GenNode node) { + for(BlockPos pos : node.positions) { + HashSet set = posToId.get(pos); + if(set == null) { + set = new HashSet(); + posToId.put(pos, set); + } + set.add(node.id); + } + } + + /** Removes the specified node from all positions from nodespace */ + public void popNode(GenNode node) { + if(node.net != null) node.net.destroy(); + for(BlockPos pos : node.positions) { + HashSet set = posToId.get(pos); + if(set != null) { + set.remove(node.id); + if(set.isEmpty()) posToId.remove(pos); + } + } + node.expired = true; + } + } + /* + * yeah this shit isn't gonna work because this allows multiple nodes of the same type in the same pos + * (we don't want that) which also makes it near impossible to do per-type position node lookups + * (sure it's possible but we are gonna have to iterate over every possible node in that spot, which is + * usually 1, but who knows how we end up using this system so i'd rather not) + */ }