mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
old man yaoi
This commit is contained in:
parent
71b40de7a7
commit
e5b93da9e4
@ -11,6 +11,7 @@ import com.hbm.blocks.machine.albion.*;
|
||||
import com.hbm.blocks.machine.fusion.MachineFusionBoiler;
|
||||
import com.hbm.blocks.machine.fusion.MachineFusionBreeder;
|
||||
import com.hbm.blocks.machine.fusion.MachineFusionCollector;
|
||||
import com.hbm.blocks.machine.fusion.MachineFusionCoupler;
|
||||
import com.hbm.blocks.machine.fusion.MachineFusionKlystron;
|
||||
import com.hbm.blocks.machine.fusion.MachineFusionMHDT;
|
||||
import com.hbm.blocks.machine.fusion.MachineFusionTorus;
|
||||
@ -2068,6 +2069,7 @@ public class ModBlocks {
|
||||
fusion_collector = new MachineFusionCollector().setBlockName("fusion_collector").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
fusion_boiler = new MachineFusionBoiler().setBlockName("fusion_boiler").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
fusion_mhdt = new MachineFusionMHDT().setBlockName("fusion_mhdt").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
fusion_coupler = new MachineFusionCoupler().setBlockName("fusion_coupler").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
|
||||
machine_icf_press = new MachineICFPress().setBlockName("machine_icf_press").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
icf = new MachineICF().setBlockName("icf").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -3460,6 +3462,7 @@ public class ModBlocks {
|
||||
register(fusion_collector);
|
||||
register(fusion_boiler);
|
||||
register(fusion_mhdt);
|
||||
register(fusion_coupler);
|
||||
|
||||
register(watz_element);
|
||||
register(watz_cooler);
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
package com.hbm.blocks.machine.fusion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.tileentity.machine.fusion.TileEntityFusionCoupler;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MachineFusionCoupler extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public MachineFusionCoupler() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityFusionCoupler();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] { 3, 0, 1, 1, 1, 1 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
@ -116,7 +116,7 @@ public class MachineFusionTorus extends BlockDummyable implements ITooltipProvid
|
||||
int ex = ix - layer.length / 2;
|
||||
int ez = iz - layer.length / 2;
|
||||
|
||||
if(!world.getBlock(x + ex, y + iy, z + ez).canPlaceBlockAt(world, x + ex, y + iy, z + ez)) {
|
||||
if(layout[l][ix][iz] > 0 && !world.getBlock(x + ex, y + iy, z + ez).canPlaceBlockAt(world, x + ex, y + iy, z + ez)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -432,6 +432,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFusionCollector.class, new RenderFusionCollector());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFusionBoiler.class, new RenderFusionBoiler());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFusionMHDT.class, new RenderFusionMHDT());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFusionCoupler.class, new RenderFusionCoupler());
|
||||
//Watz
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWatz.class, new RenderWatz());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWatzPump.class, new RenderWatzPump());
|
||||
|
||||
@ -254,6 +254,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom fusion_collector = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/fusion/collector.obj")).asVBO();
|
||||
public static final IModelCustom fusion_boiler = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/fusion/boiler.obj")).asVBO();
|
||||
public static final IModelCustom fusion_mhdt = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/fusion/mhdt.obj")).asVBO();
|
||||
public static final IModelCustom fusion_coupler = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/fusion/coupler.obj")).asVBO();
|
||||
|
||||
//ICF
|
||||
public static final IModelCustom icf = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/reactors/icf.obj")).asVBO();
|
||||
@ -711,6 +712,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation fusion_collector_tex = new ResourceLocation(RefStrings.MODID, "textures/models/fusion/collector.png");
|
||||
public static final ResourceLocation fusion_boiler_tex = new ResourceLocation(RefStrings.MODID, "textures/models/fusion/boiler.png");
|
||||
public static final ResourceLocation fusion_mhdt_tex = new ResourceLocation(RefStrings.MODID, "textures/models/fusion/mhdt.png");
|
||||
public static final ResourceLocation fusion_coupler_tex = new ResourceLocation(RefStrings.MODID, "textures/models/fusion/coupler.png");
|
||||
|
||||
//ICF
|
||||
public static final ResourceLocation icf_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/icf.png");
|
||||
|
||||
@ -0,0 +1,63 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderFusionCoupler extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y, z + 0.5);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
||||
GL11.glRotatef(90, 0F, 1F, 0F);
|
||||
|
||||
switch(tile.getBlockMetadata() - BlockDummyable.offset) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.fusion_coupler_tex);
|
||||
ResourceManager.fusion_coupler.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.fusion_coupler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -3, 0);
|
||||
GL11.glScaled(6, 6, 6);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glScaled(0.5, 0.5, 0.5);
|
||||
GL11.glRotatef(90, 0F, 1F, 0F);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.fusion_coupler_tex);
|
||||
ResourceManager.fusion_coupler.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}};
|
||||
}
|
||||
}
|
||||
@ -421,6 +421,7 @@ public class TileMappings {
|
||||
put(TileEntityFusionCollector.class, "tileentity_fusion_collector");
|
||||
put(TileEntityFusionBoiler.class, "tileentity_fusion_boiler");
|
||||
put(TileEntityFusionMHDT.class, "tileentity_fusion_mhdt");
|
||||
put(TileEntityFusionCoupler.class, "tileentity_fusion_coupler");
|
||||
}
|
||||
|
||||
private static void putNetwork() {
|
||||
|
||||
@ -163,13 +163,15 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
||||
this.fanAcceleration = Math.max(0F, Math.min(15F, this.fanAcceleration += 0.075F + audioDesync));
|
||||
|
||||
if(audio == null) {
|
||||
audio = MainRegistry.proxy.getLoopedSound("hbm:block.largeTurbineRunning", xCoord, yCoord, zCoord, 1.0F, 10F, 1.0F);
|
||||
audio = MainRegistry.proxy.getLoopedSound("hbm:block.largeTurbineRunning", xCoord, yCoord, zCoord, 1.0F, 10F, 1.0F, 20);
|
||||
audio.startSound();
|
||||
}
|
||||
|
||||
float turbineSpeed = this.fanAcceleration / 15F;
|
||||
audio.updateVolume(getVolume(0.4f * turbineSpeed));
|
||||
audio.updatePitch(0.25F + 0.75F * turbineSpeed);
|
||||
audio.keepAlive();
|
||||
|
||||
} else {
|
||||
this.fanAcceleration = Math.max(0F, Math.min(15F, this.fanAcceleration -= 0.1F));
|
||||
|
||||
|
||||
@ -0,0 +1,119 @@
|
||||
package com.hbm.tileentity.machine.fusion;
|
||||
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.uninos.GenNode;
|
||||
import com.hbm.uninos.UniNodespace;
|
||||
import com.hbm.uninos.networkproviders.KlystronNetwork;
|
||||
import com.hbm.uninos.networkproviders.KlystronNetworkProvider;
|
||||
import com.hbm.uninos.networkproviders.PlasmaNetworkProvider;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityFusionCoupler extends TileEntityLoadedBase implements IFusionPowerReceiver {
|
||||
|
||||
protected GenNode klystronNode;
|
||||
protected GenNode plasmaNode;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10).getOpposite();
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
// christ on the cross why didn't i just make a baseclass to shove this crap into
|
||||
if(klystronNode == null || klystronNode.expired) {
|
||||
klystronNode = UniNodespace.getNode(worldObj, xCoord + rot.offsetX, yCoord + 2, zCoord + rot.offsetZ, KlystronNetworkProvider.THE_PROVIDER);
|
||||
|
||||
if(klystronNode == null) {
|
||||
klystronNode = new GenNode(KlystronNetworkProvider.THE_PROVIDER,
|
||||
new BlockPos(xCoord + rot.offsetX, yCoord + 2, zCoord + rot.offsetZ))
|
||||
.setConnections(new DirPos(xCoord + rot.offsetX * 2, yCoord + 2, zCoord + rot.offsetZ * 2, rot));
|
||||
|
||||
UniNodespace.createNode(worldObj, klystronNode);
|
||||
}
|
||||
}
|
||||
|
||||
if(plasmaNode == null || plasmaNode.expired) {
|
||||
plasmaNode = UniNodespace.getNode(worldObj, xCoord - rot.offsetX, yCoord + 2, zCoord - rot.offsetZ, PlasmaNetworkProvider.THE_PROVIDER);
|
||||
|
||||
if(plasmaNode == null) {
|
||||
plasmaNode = new GenNode(PlasmaNetworkProvider.THE_PROVIDER,
|
||||
new BlockPos(xCoord - rot.offsetX, yCoord + 2, zCoord - rot.offsetZ))
|
||||
.setConnections(new DirPos(xCoord - rot.offsetX * 2, yCoord + 2, zCoord - rot.offsetZ * 2, rot.getOpposite()));
|
||||
|
||||
UniNodespace.createNode(worldObj, plasmaNode);
|
||||
}
|
||||
}
|
||||
|
||||
if(klystronNode.net != null) klystronNode.net.addProvider(this);
|
||||
if(plasmaNode.net != null) plasmaNode.net.addReceiver(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public boolean receivesFusionPower() { return true; }
|
||||
|
||||
@Override
|
||||
public void receiveFusionPower(long fusionPower, double neutronPower) {
|
||||
|
||||
// more copy pasted crap code ! ! !
|
||||
if(klystronNode != null && klystronNode.net != null) {
|
||||
KlystronNetwork net = (KlystronNetwork) klystronNode.net;
|
||||
|
||||
for(Object o : net.receiverEntries.entrySet()) {
|
||||
Entry e = (Entry) o;
|
||||
if(e.getKey() instanceof TileEntityFusionTorus) {
|
||||
TileEntityFusionTorus torus = (TileEntityFusionTorus) e.getKey();
|
||||
|
||||
if(torus.isLoaded() && !torus.isInvalid()) {
|
||||
torus.klystronEnergy += fusionPower;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
if(this.klystronNode != null) UniNodespace.destroyNode(worldObj, klystronNode);
|
||||
if(this.plasmaNode != null) UniNodespace.destroyNode(worldObj, plasmaNode);
|
||||
}
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 1,
|
||||
yCoord,
|
||||
zCoord - 1,
|
||||
xCoord + 2,
|
||||
yCoord + 4,
|
||||
zCoord + 2
|
||||
);
|
||||
}
|
||||
|
||||
return bb;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
}
|
||||
@ -8,6 +8,8 @@ import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUIFusionKlystron;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.uninos.GenNode;
|
||||
@ -48,6 +50,8 @@ public class TileEntityFusionKlystron extends TileEntityMachineBase implements I
|
||||
|
||||
public FluidTank compair;
|
||||
|
||||
private AudioWrapper audio;
|
||||
|
||||
public TileEntityFusionKlystron() {
|
||||
super(1);
|
||||
|
||||
@ -139,6 +143,27 @@ public class TileEntityFusionKlystron extends TileEntityMachineBase implements I
|
||||
this.fan -= 360F;
|
||||
this.prevFan -= 360F;
|
||||
}
|
||||
|
||||
if(this.fanSpeed > 0 && MainRegistry.proxy.me().getDistanceSq(xCoord + 0.5, yCoord + 2.5, zCoord + 0.5) < 30 * 30) {
|
||||
|
||||
float speed = this.fanSpeed / 5F;
|
||||
|
||||
if(audio == null) {
|
||||
audio = MainRegistry.proxy.getLoopedSound("hbm:block.fel", xCoord + 0.5F, yCoord + 2.5F, zCoord + 0.5F, getVolume(speed), 15F, speed, 20);
|
||||
audio.startSound();
|
||||
} else {
|
||||
audio.updateVolume(getVolume(speed));
|
||||
audio.updatePitch(speed);
|
||||
audio.keepAlive();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if(audio != null) {
|
||||
if(audio.isPlaying()) audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -153,10 +178,25 @@ public class TileEntityFusionKlystron extends TileEntityMachineBase implements I
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
super.onChunkUnload();
|
||||
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
if(this.klystronNode != null) UniNodespace.destroyNode(worldObj, klystronNode);
|
||||
}
|
||||
|
||||
@ -2,6 +2,8 @@ package com.hbm.tileentity.machine.fusion;
|
||||
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.uninos.GenNode;
|
||||
import com.hbm.uninos.UniNodespace;
|
||||
@ -36,6 +38,8 @@ public class TileEntityFusionMHDT extends TileEntityLoadedBase implements IEnerg
|
||||
public static final int COOLANT_USE = 50;
|
||||
|
||||
public FluidTank[] tanks;
|
||||
|
||||
private AudioWrapper audio;
|
||||
|
||||
public TileEntityFusionMHDT() {
|
||||
this.tanks = new FluidTank[2];
|
||||
@ -94,6 +98,27 @@ public class TileEntityFusionMHDT extends TileEntityLoadedBase implements IEnerg
|
||||
this.rotor -= 360F;
|
||||
this.prevRotor -= 360F;
|
||||
}
|
||||
|
||||
if(this.rotorSpeed > 0 && MainRegistry.proxy.me().getDistanceSq(xCoord + 0.5, yCoord + 2.5, zCoord + 0.5) < 30 * 30) {
|
||||
|
||||
float speed = this.rotorSpeed / 15F;
|
||||
|
||||
if(audio == null) {
|
||||
audio = MainRegistry.proxy.getLoopedSound("hbm:block.largeTurbineRunning", xCoord + 0.5F, yCoord + 1.5F, zCoord + 0.5F, getVolume(speed), 20F, speed, 20);
|
||||
audio.startSound();
|
||||
} else {
|
||||
audio.updateVolume(getVolume(speed));
|
||||
audio.updatePitch(speed);
|
||||
audio.keepAlive();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if(audio != null) {
|
||||
if(audio.isPlaying()) audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,10 +174,25 @@ public class TileEntityFusionMHDT extends TileEntityLoadedBase implements IEnerg
|
||||
this.tanks[1].writeToNBT(nbt, "t1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
super.onChunkUnload();
|
||||
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
if(this.plasmaNode != null) UniNodespace.destroyNode(worldObj, plasmaNode);
|
||||
}
|
||||
|
||||
@ -10,7 +10,9 @@ import com.hbm.inventory.gui.GUIFusionTorus;
|
||||
import com.hbm.inventory.recipes.FusionRecipe;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.module.machine.ModuleMachineFusion;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityCooledBase;
|
||||
@ -54,6 +56,8 @@ public class TileEntityFusionTorus extends TileEntityCooledBase implements IGUIP
|
||||
public float prevMagnet;
|
||||
public float magnetSpeed;
|
||||
public static final float MAGNET_ACCELERATION = 0.25F;
|
||||
|
||||
private AudioWrapper audio;
|
||||
|
||||
public TileEntityFusionTorus() {
|
||||
super(3);
|
||||
@ -205,6 +209,27 @@ public class TileEntityFusionTorus extends TileEntityCooledBase implements IGUIP
|
||||
this.magnet -= 360F;
|
||||
this.prevMagnet -= 360F;
|
||||
}
|
||||
|
||||
if(this.magnetSpeed > 0 && MainRegistry.proxy.me().getDistanceSq(xCoord + 0.5, yCoord + 2.5, zCoord + 0.5) < 50 * 50) {
|
||||
|
||||
float speed = this.magnetSpeed / 30F;
|
||||
|
||||
if(audio == null) {
|
||||
audio = MainRegistry.proxy.getLoopedSound("hbm:block.fusionReactorRunning", xCoord + 0.5F, yCoord + 2.5F, zCoord + 0.5F, getVolume(speed), 30F, speed, 20);
|
||||
audio.startSound();
|
||||
} else {
|
||||
audio.updateVolume(getVolume(speed));
|
||||
audio.updatePitch(speed);
|
||||
audio.keepAlive();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if(audio != null) {
|
||||
if(audio.isPlaying()) audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -228,10 +253,25 @@ public class TileEntityFusionTorus extends TileEntityCooledBase implements IGUIP
|
||||
return node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
super.onChunkUnload();
|
||||
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
for(GenNode node : klystronNodes) if(node != null) UniNodespace.destroyNode(worldObj, node);
|
||||
for(GenNode node : plasmaNodes) if(node != null) UniNodespace.destroyNode(worldObj, node);
|
||||
|
||||
1119
src/main/resources/assets/hbm/models/fusion/coupler.obj
Normal file
1119
src/main/resources/assets/hbm/models/fusion/coupler.obj
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/main/resources/assets/hbm/textures/models/fusion/coupler.png
Normal file
BIN
src/main/resources/assets/hbm/textures/models/fusion/coupler.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
Loading…
x
Reference in New Issue
Block a user