mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Only pop the first analysis particle
This commit is contained in:
parent
5ea0cae74c
commit
942a05fea7
@ -141,15 +141,11 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs
|
|||||||
// If we succeed, "collapse" the cheapest particle that had enough momentum
|
// If we succeed, "collapse" the cheapest particle that had enough momentum
|
||||||
// If we fail to make anything, "collapse" the most expensive particle
|
// If we fail to make anything, "collapse" the most expensive particle
|
||||||
if (particles.isEmpty() && !particlesCompleted.isEmpty()) {
|
if (particles.isEmpty() && !particlesCompleted.isEmpty()) {
|
||||||
MainRegistry.logger.info("number of COMPLETED: " + particlesCompleted.size());
|
|
||||||
|
|
||||||
ItemStack[] result = null;
|
ItemStack[] result = null;
|
||||||
Particle particle = null;
|
Particle particle = null;
|
||||||
|
|
||||||
particlesCompleted.sort((p1, p2) -> { return p1.momentum - p2.momentum; });
|
particlesCompleted.sort((p1, p2) -> { return p1.momentum - p2.momentum; });
|
||||||
for(Particle p : particlesCompleted) {
|
for(Particle p : particlesCompleted) {
|
||||||
MainRegistry.logger.info(p.momentum);
|
|
||||||
|
|
||||||
particle = p;
|
particle = p;
|
||||||
result = HadronRecipes.getOutput(p.item1, p.item2, p.momentum, analysisOnly);
|
result = HadronRecipes.getOutput(p.item1, p.item2, p.momentum, analysisOnly);
|
||||||
if(result != null) break;
|
if(result != null) break;
|
||||||
@ -648,11 +644,14 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs
|
|||||||
p.expire(EnumHadronState.ERROR_ANALYSIS_TOO_LONG);
|
p.expire(EnumHadronState.ERROR_ANALYSIS_TOO_LONG);
|
||||||
|
|
||||||
if(p.analysis == 2) {
|
if(p.analysis == 2) {
|
||||||
|
// Only pop for the first particle
|
||||||
|
if(this.state != EnumHadronState.ANALYSIS) {
|
||||||
|
this.worldObj.playSoundEffect(p.posX + 0.5, p.posY + 0.5, p.posZ + 0.5, "fireworks.blast", 2.0F, 2F);
|
||||||
|
NBTTagCompound data = new NBTTagCompound();
|
||||||
|
data.setString("type", "hadron");
|
||||||
|
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, p.posX + 0.5, p.posY + 0.5, p.posZ + 0.5), new TargetPoint(worldObj.provider.dimensionId, p.posX + 0.5, p.posY + 0.5, p.posZ + 0.5, 25));
|
||||||
|
}
|
||||||
this.state = EnumHadronState.ANALYSIS;
|
this.state = EnumHadronState.ANALYSIS;
|
||||||
this.worldObj.playSoundEffect(p.posX + 0.5, p.posY + 0.5, p.posZ + 0.5, "fireworks.blast", 2.0F, 2F);
|
|
||||||
NBTTagCompound data = new NBTTagCompound();
|
|
||||||
data.setString("type", "hadron");
|
|
||||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, p.posX + 0.5, p.posY + 0.5, p.posZ + 0.5), new TargetPoint(worldObj.provider.dimensionId, p.posX + 0.5, p.posY + 0.5, p.posZ + 0.5, 25));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//if operating in line accelerator mode, halt after 2 blocks and staart the reading
|
//if operating in line accelerator mode, halt after 2 blocks and staart the reading
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user