mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-02-21 21:42:28 +00:00
Merge pull request #2697 from mlbv/fix-rbmk-overpressure
fix: rbmk overpressure types
This commit is contained in:
commit
1bc33bbcf9
@ -2,6 +2,8 @@ package com.hbm.tileentity.machine.rbmk;
|
|||||||
|
|
||||||
import api.hbm.fluidmk2.FluidNetMK2;
|
import api.hbm.fluidmk2.FluidNetMK2;
|
||||||
|
|
||||||
|
import api.hbm.fluidmk2.FluidNode;
|
||||||
|
import api.hbm.fluidmk2.IFluidReceiverMK2;
|
||||||
import com.hbm.blocks.ModBlocks;
|
import com.hbm.blocks.ModBlocks;
|
||||||
import com.hbm.blocks.machine.rbmk.RBMKBase;
|
import com.hbm.blocks.machine.rbmk.RBMKBase;
|
||||||
import com.hbm.entity.effect.EntitySpear;
|
import com.hbm.entity.effect.EntitySpear;
|
||||||
@ -41,12 +43,7 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
|||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for all RBMK components, active or passive. Handles heat and the explosion sequence
|
* 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 */
|
/* Hanlde overpressure event */
|
||||||
if(RBMKDials.getOverpressure(worldObj) && !pipes.isEmpty()) {
|
if(RBMKDials.getOverpressure(worldObj) && !pipes.isEmpty()) {
|
||||||
HashSet pipeBlocks = new HashSet<>();
|
HashSet<FluidNode> pipeBlocks = new HashSet<>();
|
||||||
HashSet pipeReceivers = new HashSet<>();
|
HashSet<Map.Entry<IFluidReceiverMK2, Long>> pipeReceivers = new HashSet<>();
|
||||||
|
|
||||||
//unify all parts into single sets to prevent redundancy
|
//unify all parts into single sets to prevent redundancy
|
||||||
pipes.forEach(x -> {
|
pipes.forEach(x -> {
|
||||||
@ -513,20 +510,23 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase {
|
|||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int max = Math.min(pipeBlocks.size() / 5, 100);
|
int max = Math.min(pipeBlocks.size() / 5, 100);
|
||||||
Iterator itPipes = pipeBlocks.iterator();
|
Iterator<FluidNode> itPipes = pipeBlocks.iterator();
|
||||||
Iterator itReceivers = pipeReceivers.iterator();
|
Iterator<Map.Entry<IFluidReceiverMK2, Long>> itReceivers = pipeReceivers.iterator();
|
||||||
|
|
||||||
while(itPipes.hasNext() && count < max) {
|
while(itPipes.hasNext() && count < max) {
|
||||||
Object pipe = itPipes.next();
|
FluidNode node = itPipes.next();
|
||||||
if(pipe instanceof TileEntity) {
|
for (BlockPos pos : node.positions) {
|
||||||
TileEntity tile = (TileEntity) pipe;
|
int x = pos.getX(), y = pos.getY(), z = pos.getZ();
|
||||||
worldObj.setBlock(tile.xCoord, tile.yCoord, tile.zCoord, Blocks.air);
|
if (worldObj.getTileEntity(x, y ,z) != null) {
|
||||||
|
worldObj.setBlock(x, y, z, Blocks.air);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(itReceivers.hasNext()) {
|
while(itReceivers.hasNext()) {
|
||||||
Object con = itReceivers.next();
|
Map.Entry<IFluidReceiverMK2, Long> e = itReceivers.next();
|
||||||
|
IFluidReceiverMK2 con = e.getKey();
|
||||||
if(con instanceof TileEntity) {
|
if(con instanceof TileEntity) {
|
||||||
TileEntity tile = (TileEntity) con;
|
TileEntity tile = (TileEntity) con;
|
||||||
if(con instanceof IOverpressurable) {
|
if(con instanceof IOverpressurable) {
|
||||||
@ -568,6 +568,9 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase {
|
|||||||
|
|
||||||
RBMKBase.dropLids = true;
|
RBMKBase.dropLids = true;
|
||||||
RBMKBase.digamma = false;
|
RBMKBase.digamma = false;
|
||||||
|
|
||||||
|
columns.clear();
|
||||||
|
pipes.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getFF(int x, int y, int z) {
|
private void getFF(int x, int y, int z) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user