mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge pull request #1542 from MellowArpeggiation/master
Fix powernet disconnections
This commit is contained in:
commit
a2870e17b1
@ -19,8 +19,8 @@ import net.minecraft.world.World;
|
|||||||
public class Nodespace {
|
public class Nodespace {
|
||||||
|
|
||||||
/** Contains all "NodeWorld" instances, i.e. lists of nodes existing per world */
|
/** Contains all "NodeWorld" instances, i.e. lists of nodes existing per world */
|
||||||
public static HashMap<World, NodeWorld> worlds = new HashMap();
|
public static HashMap<World, NodeWorld> worlds = new HashMap<>();
|
||||||
public static Set<PowerNetMK2> activePowerNets = new HashSet();
|
public static Set<PowerNetMK2> activePowerNets = new HashSet<>();
|
||||||
|
|
||||||
public static PowerNode getNode(World world, int x, int y, int z) {
|
public static PowerNode getNode(World world, int x, int y, int z) {
|
||||||
NodeWorld nodeWorld = worlds.get(world);
|
NodeWorld nodeWorld = worlds.get(world);
|
||||||
@ -50,6 +50,9 @@ public class Nodespace {
|
|||||||
for(World world : MinecraftServer.getServer().worldServers) {
|
for(World world : MinecraftServer.getServer().worldServers) {
|
||||||
NodeWorld nodes = worlds.get(world);
|
NodeWorld nodes = worlds.get(world);
|
||||||
|
|
||||||
|
if(nodes == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
for(Entry<BlockPos, PowerNode> entry : nodes.nodes.entrySet()) {
|
for(Entry<BlockPos, PowerNode> entry : nodes.nodes.entrySet()) {
|
||||||
PowerNode node = entry.getValue();
|
PowerNode node = entry.getValue();
|
||||||
if(!node.hasValidNet() || node.recentlyChanged) {
|
if(!node.hasValidNet() || node.recentlyChanged) {
|
||||||
@ -120,7 +123,7 @@ public class Nodespace {
|
|||||||
|
|
||||||
/** Contains a map showing where each node is, a node is every spot that a cable exists at.
|
/** Contains a map showing where each node is, a node is every spot that a cable exists at.
|
||||||
* Instead of the old proxy system, things like substation now create multiple nodes at their connection points */
|
* Instead of the old proxy system, things like substation now create multiple nodes at their connection points */
|
||||||
public static HashMap<BlockPos, PowerNode> nodes = new HashMap();
|
public HashMap<BlockPos, PowerNode> nodes = new HashMap<>();
|
||||||
|
|
||||||
/** Adds a node at all its positions to the nodespace */
|
/** Adds a node at all its positions to the nodespace */
|
||||||
public void pushNode(PowerNode node) {
|
public void pushNode(PowerNode node) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user