From 304720b57f0a02d380630b6851c913126355d26f Mon Sep 17 00:00:00 2001 From: mlbv <51232730+mlbv@users.noreply.github.com> Date: Tue, 10 Feb 2026 03:15:06 +1100 Subject: [PATCH] fix: rbmk overpressure types --- .../machine/rbmk/TileEntityRBMKBase.java | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java index 94e666af3..2b0a8da93 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java @@ -2,6 +2,8 @@ package com.hbm.tileentity.machine.rbmk; import api.hbm.fluidmk2.FluidNetMK2; +import api.hbm.fluidmk2.FluidNode; +import api.hbm.fluidmk2.IFluidReceiverMK2; import com.hbm.blocks.ModBlocks; import com.hbm.blocks.machine.rbmk.RBMKBase; import com.hbm.entity.effect.EntitySpear; @@ -41,12 +43,7 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; -import java.util.List; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.Set; -import java.util.HashSet; -import java.util.Iterator; +import java.util.*; /** * Base class for all RBMK components, active or passive. Handles heat and the explosion sequence @@ -502,8 +499,8 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase { /* Hanlde overpressure event */ if(RBMKDials.getOverpressure(worldObj) && !pipes.isEmpty()) { - HashSet pipeBlocks = new HashSet<>(); - HashSet pipeReceivers = new HashSet<>(); + HashSet pipeBlocks = new HashSet<>(); + HashSet> pipeReceivers = new HashSet<>(); //unify all parts into single sets to prevent redundancy pipes.forEach(x -> { @@ -513,20 +510,23 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase { int count = 0; int max = Math.min(pipeBlocks.size() / 5, 100); - Iterator itPipes = pipeBlocks.iterator(); - Iterator itReceivers = pipeReceivers.iterator(); + Iterator itPipes = pipeBlocks.iterator(); + Iterator> itReceivers = pipeReceivers.iterator(); while(itPipes.hasNext() && count < max) { - Object pipe = itPipes.next(); - if(pipe instanceof TileEntity) { - TileEntity tile = (TileEntity) pipe; - worldObj.setBlock(tile.xCoord, tile.yCoord, tile.zCoord, Blocks.air); + FluidNode node = itPipes.next(); + for (BlockPos pos : node.positions) { + int x = pos.getX(), y = pos.getY(), z = pos.getZ(); + if (worldObj.getTileEntity(x, y ,z) != null) { + worldObj.setBlock(x, y, z, Blocks.air); + } } count++; } while(itReceivers.hasNext()) { - Object con = itReceivers.next(); + Map.Entry e = itReceivers.next(); + IFluidReceiverMK2 con = e.getKey(); if(con instanceof TileEntity) { TileEntity tile = (TileEntity) con; if(con instanceof IOverpressurable) { @@ -568,6 +568,9 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase { RBMKBase.dropLids = true; RBMKBase.digamma = false; + + columns.clear(); + pipes.clear(); } private void getFF(int x, int y, int z) {