mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-08-10 17:55:44 +00:00
finished plasma forge
This commit is contained in:
parent
2f1bf11bef
commit
7dda5c1c0a
@ -1,6 +1,7 @@
|
||||
package com.hbm.blocks.machine.fusion;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.fusion.TileEntityFusionPlasmaForge;
|
||||
|
||||
@ -28,11 +29,41 @@ public class MachineFusionPlasmaForge extends BlockDummyable {
|
||||
return this.standardOpenBehavior(world, x, y, z, player, 0);
|
||||
}
|
||||
|
||||
@Override public int[] getDimensions() { return new int[] { 0, 0, 5, 5, 5, 5 }; }
|
||||
@Override public int[] getDimensions() { return new int[] { 2, 0, 2, 2, 5, 5 }; }
|
||||
@Override public int getOffset() { return 5; }
|
||||
|
||||
@Override
|
||||
public boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
return super.checkRequirement(world, x, y, z, dir, o) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, 3, -2, 4, 4}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, -2, 3, 4, 4}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, 4, -3, 3, 3}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, -3, 4, 3, 3}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, 5, -4, 2, 2}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, -4, 5, 2, 2}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, -2, 1, 1, 5, 5}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {4, -3, 0, 0, 4, 4}, x, y, z, dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, 3, -2, 4, 4}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, -2, 3, 4, 4}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, 4, -3, 3, 3}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, -3, 4, 3, 3}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, 5, -4, 2, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, -4, 5, 2, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, -2, 1, 1, 5, 5}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {4, -3, 0, 0, 4, 4}, this, dir);
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
for(int i = -2; i <= 2; i++) {
|
||||
this.makeExtra(world, x + dir.offsetX * 5 + rot.offsetX * i, y, z + dir.offsetZ * 5 + rot.offsetZ * i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,6 +78,8 @@ public class GUIMachinePlasmaForge extends GuiInfoContainer {
|
||||
list.set(cycle, selected);
|
||||
}
|
||||
|
||||
lines.add(new Object[] {"Booster Isotope:"});
|
||||
|
||||
if(list.size() < 10) {
|
||||
lines.add(list.toArray());
|
||||
} else if(list.size() < 24) {
|
||||
@ -117,7 +119,7 @@ public class GUIMachinePlasmaForge extends GuiInfoContainer {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int p = (int) (forge.power * 61 / forge.maxPower);
|
||||
int p = (int) (forge.power * 62 / forge.maxPower);
|
||||
drawTexturedModalRect(guiLeft + 152, guiTop + 80 - p, 176, 62 - p, 16, p);
|
||||
|
||||
if(forge.plasmaModule.progress > 0) {
|
||||
|
||||
@ -25,7 +25,7 @@ public class PlasmaForgeRecipe extends GenericRecipe {
|
||||
autoSwitch(list);
|
||||
duration(list);
|
||||
power(list);
|
||||
list.add(EnumChatFormatting.LIGHT_PURPLE + I18nUtil.resolveKey("gui.recipe.fusionIn") + ": " + BobMathUtil.getShortNumber(ignitionTemp) + "TU/t");
|
||||
list.add(EnumChatFormatting.LIGHT_PURPLE + I18nUtil.resolveKey("gui.recipe.plasmaIn") + ": " + BobMathUtil.getShortNumber(ignitionTemp) + "TU/t");
|
||||
input(list);
|
||||
output(list);
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ public class PlasmaForgeRecipes extends GenericRecipes<PlasmaForgeRecipe> {
|
||||
this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.hde").setInputEnergy(10_000_000).setup(600, 25_000_000L)
|
||||
.outputItems(DictFrame.fromOne(ModItems.part_generic, EnumPartType.HDE))
|
||||
.inputItems(new OreDictStack(ANY_BISMOIDBRONZE.plateCast(), 2), new OreDictStack(CMB.plateWelded(), 1), new ComparableStack(ModItems.ingot_cft))
|
||||
.inputFluids(new FluidStack(Fluids.STELLAR_FLUX, 4_000)).setGroup(autoPlate, this));
|
||||
.inputFluids(new FluidStack(Fluids.STELLAR_FLUX, 4_000)));
|
||||
|
||||
// Welded Plates
|
||||
this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.weldiron").setInputEnergy(500_000).setup(50, 100L)
|
||||
@ -112,7 +112,7 @@ public class PlasmaForgeRecipes extends GenericRecipes<PlasmaForgeRecipe> {
|
||||
new ComparableStack(ModBlocks.fusion_component, 64, 3),
|
||||
new ComparableStack(ModBlocks.fusion_component, 64, 2),
|
||||
new ComparableStack(ModBlocks.fusion_component, 64, 2),
|
||||
new ComparableStack(ModItems.circuit, 4, EnumCircuitType.CHIP_QUANTUM))
|
||||
new ComparableStack(ModItems.circuit, 4, EnumCircuitType.QUANTUM))
|
||||
.setPools528(PlasmaForgeRecipes.POOL_PREFIX_528 + "chlorophyte"));
|
||||
|
||||
// ICF
|
||||
|
||||
@ -15,6 +15,8 @@ public class NEIRegistry {
|
||||
|
||||
if(!handlers.isEmpty()) return handlers;
|
||||
|
||||
handlers.add(new ToolingHandler());
|
||||
handlers.add(new ConstructionHandler());
|
||||
handlers.add(new AnnihilatorHandler());
|
||||
handlers.add(new AnvilRecipeHandler());
|
||||
handlers.add(new SmithingRecipeHandler());
|
||||
@ -47,8 +49,6 @@ public class NEIRegistry {
|
||||
handlers.add(new FuelPoolHandler());
|
||||
handlers.add(new RBMKRodDisassemblyHandler());
|
||||
handlers.add(new RBMKWasteDecayHandler());
|
||||
handlers.add(new ToolingHandler());
|
||||
handlers.add(new ConstructionHandler());
|
||||
handlers.add(new SatelliteHandler());
|
||||
|
||||
//universal boyes
|
||||
|
||||
@ -50,6 +50,15 @@ public class RenderFusionPlasmaForge extends TileEntitySpecialRenderer implement
|
||||
TileEntityFusionPlasmaForge forge = (TileEntityFusionPlasmaForge) tile;
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
if(forge.connected) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(-2, 0, 0);
|
||||
bindTexture(ResourceManager.fusion_torus_tex);
|
||||
ResourceManager.fusion_torus.renderPart("Bolts1");
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
bindTexture(ResourceManager.fusion_plasma_forge_tex);
|
||||
ResourceManager.fusion_plasma_forge.renderPart("Body");
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@ import com.hbm.inventory.recipes.PlasmaForgeRecipe;
|
||||
import com.hbm.inventory.recipes.PlasmaForgeRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.module.machine.ModuleMachinePlasma;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
@ -60,6 +61,7 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
|
||||
public double neutronEnergy;
|
||||
protected GenNode receiverNode;
|
||||
protected GenNode providerNode;
|
||||
public boolean connected;
|
||||
|
||||
public int booster;
|
||||
public int maxBooster;
|
||||
@ -175,13 +177,17 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
|
||||
if(this.plasmaModule.markDirty) this.markDirty();
|
||||
|
||||
long powerReceived = (long) Math.ceil(this.plasmaEnergySync * 0.75);
|
||||
if(powerReceived > 0 && providerNode != null && providerNode.hasValidNet()) {
|
||||
|
||||
this.connected = false;
|
||||
if(providerNode != null && providerNode.hasValidNet() && !providerNode.net.receiverEntries.isEmpty()) connected = true;
|
||||
|
||||
if(providerNode != null && providerNode.hasValidNet()) {
|
||||
|
||||
for(Object o : providerNode.net.receiverEntries.entrySet()) {
|
||||
Entry<Object, Long> entry = (Entry<Object, Long>) o;
|
||||
|
||||
if(entry.getKey() instanceof IFusionPowerReceiver) {
|
||||
((IFusionPowerReceiver) entry.getKey()).receiveFusionPower(powerReceived, this.neutronEnergy, plasmaRed, plasmaGreen, plasmaBlue);
|
||||
if(powerReceived > 0) ((IFusionPowerReceiver) entry.getKey()).receiveFusionPower(powerReceived, this.neutronEnergy, plasmaRed, plasmaGreen, plasmaBlue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -217,7 +223,6 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
|
||||
if(this.ringDelay <= 0) {
|
||||
this.ringTarget += (worldObj.rand.nextDouble() + 1) * 60 * (worldObj.rand.nextBoolean() ? - 1 : 1);
|
||||
this.ringSpeed = 2.5D;
|
||||
//if(!this.muffled) MainRegistry.proxy.playSoundClient(xCoord, yCoord, zCoord, NTMSounds.ASSEMBLER_START, this.getVolume(0.25F), 1.25F + worldObj.rand.nextFloat() * 0.25F);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -236,6 +241,16 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
if(receiverNode != null) UniNodespace.destroyNode(worldObj, receiverNode);
|
||||
if(providerNode != null) UniNodespace.destroyNode(worldObj, providerNode);
|
||||
}
|
||||
}
|
||||
|
||||
public DirPos[] getConPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
|
||||
@ -266,6 +281,7 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
|
||||
buf.writeLong(power);
|
||||
buf.writeLong(maxPower);
|
||||
buf.writeBoolean(didProcess);
|
||||
buf.writeBoolean(connected);
|
||||
buf.writeInt(booster);
|
||||
buf.writeInt(maxBooster);
|
||||
this.plasmaModule.serialize(buf);
|
||||
@ -282,6 +298,7 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
|
||||
this.power = buf.readLong();
|
||||
this.maxPower = buf.readLong();
|
||||
this.didProcess = buf.readBoolean();
|
||||
this.connected = buf.readBoolean();
|
||||
this.booster = buf.readInt();
|
||||
this.maxBooster = buf.readInt();
|
||||
this.plasmaModule.deserialize(buf);
|
||||
@ -433,6 +450,10 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
|
||||
return !didMove;
|
||||
}
|
||||
|
||||
public void playStrikerSound() {
|
||||
MainRegistry.proxy.playSoundClient(xCoord, yCoord, zCoord, "hbm:item.boltgun", getVolume(0.25F), 1.25F);
|
||||
}
|
||||
|
||||
public double[] getPositions(float interp) {
|
||||
double[] pos = new double[this.angles.length];
|
||||
for(int i = 0; i < pos.length; i++) {
|
||||
@ -497,6 +518,7 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
|
||||
arm.actionDelay = 0;
|
||||
arm.state = ForgeArmState.RETRACT1;
|
||||
arm.targetAngles[4] = 0D;
|
||||
arm.playStrikerSound();
|
||||
}
|
||||
} break;
|
||||
case RETRACT1: {
|
||||
@ -511,6 +533,7 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
|
||||
arm.actionDelay = 0;
|
||||
arm.state = ForgeArmState.RETRACT2;
|
||||
arm.targetAngles[5] = 0D;
|
||||
arm.playStrikerSound();
|
||||
}
|
||||
} break;
|
||||
case RETRACT2: {
|
||||
|
||||
@ -411,6 +411,7 @@ container.machineLargeTurbine=Industrielle Dampfturbine
|
||||
container.machineLiquefactor=Verflüssiger
|
||||
container.machineMixer=Industrieller Mixer
|
||||
container.machineOreSlopper=B.E.M.
|
||||
container.machinePlasmaForge=Plasmaschmiede
|
||||
container.machinePrecAss=Präzisions-Montagemaschine
|
||||
container.machinePUREX=PUREX
|
||||
container.machinePyroOven=Pyrolyseofen
|
||||
@ -700,6 +701,19 @@ geiger.playerRes=Strahlungsresistenz:
|
||||
geiger.title=GEIGERZÄHLER
|
||||
geiger.title.dosimeter=DOSIMETER
|
||||
|
||||
general.na=N/A
|
||||
|
||||
gui.recipe.duration=Dauer
|
||||
gui.recipe.consumption=Verbrauch
|
||||
gui.recipe.fusionFlux=Produzierter Neutronenflux
|
||||
gui.recipe.fusionIn=Benötigte Klystronenergie
|
||||
gui.recipe.fusionOut=Erzeugte Plasmaenergie
|
||||
gui.recipe.input=Input
|
||||
gui.recipe.output=Output
|
||||
gui.recipe.plasmaIn=Benötigte Plasmaenergie
|
||||
gui.recipe.atPressure=bei
|
||||
gui.recipe.setRecipe=Klicken um Rezept zu ändern
|
||||
|
||||
hadron.analysis=Analysiere...
|
||||
hadron.buttonOn=Analysekammer (falls vorhanden) ist AN
|
||||
hadron.buttonOff=Analysekammer ist AUS
|
||||
@ -4366,6 +4380,7 @@ tile.fusion_klystron_creative.desc=Erzeugt unendlich viel Klystron-Energie.
|
||||
tile.fusion_mhdt.name=MHD-Turbine
|
||||
tile.fusion_mhdt.desc=Wandelt Plasmaenergie in verwendbare$elektrische Energie um. Effizienter als ein$konventioneller Boiler.$Benötigt Kühlung!
|
||||
tile.fusion_motor.name=Magnetmotorstück
|
||||
tile.fusion_plasma_forge.name=Plasmaschmiede
|
||||
tile.fusion_torus.name=Fusionsreaktor-Plasmagefäß
|
||||
tile.fusion_torus.desc=Hauptkomponente des Reaktors.$Benötigt Energie von einem Klystron zur Zündung,$erzeugt Plasmaenergie und Neutronenflux.$Benötigt Kühlung!
|
||||
tile.fwatz_computer.name=Watzwerkrechenmatrix
|
||||
|
||||
@ -817,6 +817,7 @@ container.machineLargeTurbine=Industrial Steam Turbine
|
||||
container.machineLiquefactor=Liquefactor
|
||||
container.machineMixer=Industrial Mixer
|
||||
container.machineOreSlopper=B.O.P.
|
||||
container.machinePlasmaForge=Plasma Forge
|
||||
container.machinePrecAss=Precision Assembly Machine
|
||||
container.machinePUREX=PUREX
|
||||
container.machinePyroOven=Pyrolysis Oven
|
||||
@ -1294,6 +1295,7 @@ gui.recipe.fusionIn=Klystron Input Energy
|
||||
gui.recipe.fusionOut=Plasma Output Energy
|
||||
gui.recipe.input=Input
|
||||
gui.recipe.output=Output
|
||||
gui.recipe.plasmaIn=Plasma Input Energy
|
||||
gui.recipe.atPressure=at
|
||||
gui.recipe.setRecipe=Click to set recipe
|
||||
|
||||
@ -5622,6 +5624,7 @@ tile.fusion_klystron_creative.desc=Provides infinite klystron energy.
|
||||
tile.fusion_mhdt.name=MHD Turbine
|
||||
tile.fusion_mhdt.desc=Turns plasma energy into usable$electricity directly. More efficient$than a conventional boiler.$Requires cooling!
|
||||
tile.fusion_motor.name=Magnet Motor Piece
|
||||
tile.fusion_plasma_forge.name=Plasma Forge
|
||||
tile.fusion_torus.name=Fusion Reactor Vessel
|
||||
tile.fusion_torus.desc=Fusion reactor main component.$Requires klystron input energy to ignite plasma,$produces plasma energy and neutron flux.$Requires cooling!
|
||||
tile.fwatz_computer.name=Fusionary Watz Reactor Calculation Matrix
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user