Fixes, particles for cooling towers

This commit is contained in:
Bob 2021-09-19 20:30:16 +02:00
parent f9f1ed9d6b
commit fc1a2f15a4
13 changed files with 208 additions and 11 deletions

View File

@ -2461,7 +2461,7 @@ public class ModItems {
ingot_u235 = new ItemHazard(ItemHazard.u235 * ItemHazard.ingot).setUnlocalizedName("ingot_u235").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_u235");
ingot_u238 = new ItemHazard(ItemHazard.u238 * ItemHazard.ingot).setUnlocalizedName("ingot_u238").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_u238");
ingot_u238m2 = new ItemUnstable(350, 200).setUnlocalizedName("ingot_u238m2").setCreativeTab(null).setTextureName(RefStrings.MODID + ":ingot_u238m2");
ingot_plutonium = new ItemHazard(ItemHazard.pu * ItemHazard.ingot).setUnlocalizedName("ingot_plutonium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_plutonium");
ingot_plutonium = new ItemHazard().setUnlocalizedName("ingot_plutonium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_plutonium");
ingot_pu238 = new ItemHazard(ItemHazard.pu238 * ItemHazard.ingot, true).setUnlocalizedName("ingot_pu238").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_pu238");
ingot_pu239 = new ItemHazard(ItemHazard.pu239 * ItemHazard.ingot).setUnlocalizedName("ingot_pu239").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_pu239");
ingot_pu240 = new ItemHazard(ItemHazard.pu240 * ItemHazard.ingot).setUnlocalizedName("ingot_pu240").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_pu240");

View File

@ -3,7 +3,7 @@ package com.hbm.lib;
public class RefStrings {
public static final String MODID = "hbm";
public static final String NAME = "Hbm's Nuclear Tech Mod";
public static final String VERSION = "1.0.27 BETA (3991)";
public static final String VERSION = "1.0.27 BETA (3997)";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version

View File

@ -1364,6 +1364,15 @@ public class ClientProxy extends ServerProxy {
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleRBMKMush(man, world, x, y, z, scale));
}
if("tower".equals(type)) {
ParticleCoolingTower fx = new ParticleCoolingTower(man, world, x, y, z);
fx.setLift(data.getFloat("lift"));
fx.setBaseScale(data.getFloat("base"));
fx.setMaxScale(data.getFloat("max"));
fx.setLife(data.getInteger("life"));
Minecraft.getMinecraft().effectRenderer.addEffect(fx);
}
if("anim".equals(type)) {
if("crucible".equals(data.getString("mode")) && player.getHeldItem() != null) {

View File

@ -813,7 +813,6 @@ public class CraftingManager {
GameRegistry.addRecipe(new ItemStack(ModItems.rag, 4), new Object[] { "SW", "WS", 'S', Items.string, 'W', Blocks.wool });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_condenser), new Object[] { "SIS", "ICI", "SIS", 'S', "ingotSteel", 'I', "plateIron", 'C', ModItems.board_copper }));
GameRegistry.addRecipe(new ItemStack(ModBlocks.machine_tower_large), new Object[] { "C C", "C C", "DDD", 'C', ModBlocks.concrete_smooth, 'D', ModBlocks.machine_condenser });
if(GeneralConfig.enableBabyMode) {
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.cordite, 3), new Object[] { ModItems.ballistite, Items.gunpowder, new ItemStack(Blocks.wool, 1, OreDictionary.WILDCARD_VALUE) });

View File

@ -0,0 +1,119 @@
package com.hbm.particle;
import org.lwjgl.opengl.GL11;
import com.hbm.lib.RefStrings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
@SideOnly(Side.CLIENT)
public class ParticleCoolingTower extends EntityFX {
private static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/particle/particle_base.png");
private TextureManager theRenderEngine;
private float baseScale = 1.0F;
private float maxScale = 1.0F;
private float lift = 0.3F;
public ParticleCoolingTower(TextureManager texman, World world, double x, double y, double z) {
super(world, x, y, z);
this.particleRed = this.particleGreen = this.particleBlue = 0.9F + world.rand.nextFloat() * 0.05F;
this.theRenderEngine = texman;
this.noClip = true;
}
public void setBaseScale(float f) {
this.baseScale = f;
}
public void setMaxScale(float f) {
this.maxScale = f;
}
public void setLift(float f) {
this.lift = f;
}
public void setLife(int i) {
this.particleMaxAge = i;
}
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
float ageScale = (float) this.particleAge / (float) this.particleMaxAge;
this.particleAlpha = 0.25F - ageScale * 0.25F;
this.particleScale = baseScale + (float)Math.pow((maxScale * ageScale - baseScale), 2);
this.particleAge++;
if(this.motionY < this.lift) {
this.motionY += 0.01F;
}
this.motionX += rand.nextGaussian() * 0.075D * ageScale;
this.motionZ += rand.nextGaussian() * 0.075D * ageScale;
this.motionX += 0.02 * ageScale;
this.motionX -= 0.01 * ageScale;
if(this.particleAge == this.particleMaxAge) {
this.setDead();
}
this.moveEntity(this.motionX, this.motionY, this.motionZ);
motionX *= 0.925;
motionY *= 0.925;
motionZ *= 0.925;
}
public int getFXLayer() {
return 3;
}
public void renderParticle(Tessellator tess, float interp, float fX, float fY, float fZ, float sX, float sZ) {
this.theRenderEngine.bindTexture(texture);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
GL11.glDepthMask(false);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
RenderHelper.disableStandardItemLighting();
tess.startDrawingQuads();
tess.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha);
tess.setNormal(0.0F, 1.0F, 0.0F);
float scale = this.particleScale;
float pX = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) interp - interpPosX);
float pY = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) interp - interpPosY);
float pZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) interp - interpPosZ);
tess.addVertexWithUV((double) (pX - fX * scale - sX * scale), (double) (pY - fY * scale), (double) (pZ - fZ * scale - sZ * scale), 1, 1);
tess.addVertexWithUV((double) (pX - fX * scale + sX * scale), (double) (pY + fY * scale), (double) (pZ - fZ * scale + sZ * scale), 1, 0);
tess.addVertexWithUV((double) (pX + fX * scale + sX * scale), (double) (pY + fY * scale), (double) (pZ + fZ * scale + sZ * scale), 0, 0);
tess.addVertexWithUV((double) (pX + fX * scale - sX * scale), (double) (pY - fY * scale), (double) (pZ + fZ * scale - sZ * scale), 0, 1);
tess.draw();
GL11.glPolygonOffset(0.0F, 0.0F);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
}
}

View File

@ -21,6 +21,8 @@ public class TileEntityCondenser extends TileEntity implements IFluidAcceptor, I
public FluidTank[] tanks;
public List<IFluidAcceptor> list = new ArrayList();
public int waterTimer = 0;
public TileEntityCondenser() {
tanks = new FluidTank[2];
tanks[0] = new FluidTank(FluidType.SPENTSTEAM, 100, 0);
@ -37,11 +39,21 @@ public class TileEntityCondenser extends TileEntity implements IFluidAcceptor, I
age = 0;
}
this.tanks[0].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
int convert = Math.min(tanks[0].getFill(), tanks[1].getMaxFill() - tanks[1].getFill());
tanks[0].setFill(tanks[0].getFill() - convert);
tanks[1].setFill(tanks[1].getFill() + convert);
fillFluidInit(tanks[1].getTankType());
} else {
if(tanks[0].getFill() > 0) {
this.waterTimer = 20;
} else if(this.waterTimer > 0){
this.waterTimer--;
}
}
}

View File

@ -2,10 +2,11 @@ package com.hbm.tileentity.machine;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.inventory.FluidTank;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
@ -16,6 +17,29 @@ public class TileEntityTowerLarge extends TileEntityCondenser {
tanks[0] = new FluidTank(FluidType.SPENTSTEAM, 10000, 0);
tanks[1] = new FluidTank(FluidType.WATER, 10000, 1);
}
@Override
public void updateEntity() {
super.updateEntity();
if(worldObj.isRemote) {
if(this.waterTimer > 0) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "tower");
data.setFloat("lift", 0.5F);
data.setFloat("base", 1F);
data.setFloat("max", 10F);
data.setInteger("life", 750 + worldObj.rand.nextInt(250));
data.setDouble("posX", xCoord + 0.5 + worldObj.rand.nextDouble() * 3 - 1.5);
data.setDouble("posZ", zCoord + 0.5 + worldObj.rand.nextDouble() * 3 - 1.5);
data.setDouble("posY", yCoord + 1);
MainRegistry.proxy.effectNT(data);
}
}
}
@Override
public void fillFluidInit(FluidType type) {

View File

@ -2,9 +2,11 @@ package com.hbm.tileentity.machine;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.inventory.FluidTank;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
@ -15,6 +17,29 @@ public class TileEntityTowerSmall extends TileEntityCondenser {
tanks[0] = new FluidTank(FluidType.SPENTSTEAM, 1000, 0);
tanks[1] = new FluidTank(FluidType.WATER, 1000, 1);
}
@Override
public void updateEntity() {
super.updateEntity();
if(worldObj.isRemote) {
if(this.waterTimer > 0) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "tower");
data.setFloat("lift", 1F);
data.setFloat("base", 0.5F);
data.setFloat("max", 4F);
data.setInteger("life", 250 + worldObj.rand.nextInt(250));
data.setDouble("posX", xCoord + 0.5);
data.setDouble("posZ", zCoord + 0.5);
data.setDouble("posY", yCoord + 18);
MainRegistry.proxy.effectNT(data);
}
}
}
@Override
public void fillFluidInit(FluidType type) {

View File

@ -152,12 +152,7 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, (float) (flux * 0.05F));
if(base.isModerated()) {
if(this.stream != NType.SLOW) {
//flux *= 0.85D;
} else {
this.stream = NType.SLOW;
}
this.stream = NType.SLOW;
}
}

View File

@ -114,6 +114,18 @@ public class TileEntityTurretFritz extends TileEntityTurretBaseNT implements IFl
}
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
this.tank.readFromNBT(nbt, "diesel");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
this.tank.writeToNBT(nbt, "diesel");
}
@Override
public int[] getAccessibleSlotsFromSide(int side) {

View File

@ -2702,6 +2702,7 @@ tile.block_mox_fuel.name=MOX-Kernbrennstoffblock
tile.block_neptunium.name=Neptuniumblock
tile.block_niter.name=Salpeterblock
tile.block_niter_reinforced.name=Sprengsicherer Salpeterblock
tile.block_niobium.name=Niobblock
tile.block_plutonium.name=Plutoniumblock
tile.block_plutonium_fuel.name=Plutoniumkernbrennstoffblock
tile.block_polonium.name=Polonium-210-Block

View File

@ -2769,6 +2769,7 @@ tile.block_mox_fuel.name=Block of MOX Fuel
tile.block_neptunium.name=Block of Neptunium
tile.block_niter.name=Block of Niter
tile.block_niter_reinforced.name=Reinforced Block of Niter
tile.block_niobium.name=Block of Niobium
tile.block_plutonium.name=Block of Plutonium
tile.block_plutonium_fuel.name=Block of Plutonium Fuel
tile.block_polonium.name=Block of Polonium-210

View File

@ -3,7 +3,7 @@
"modid": "hbm",
"name": "Hbm's Nuclear Tech",
"description": "A mod that adds weapons, nuclear themed stuff and machines",
"version":"1.0.27_X3991",
"version":"1.0.27_X3997",
"mcversion": "1.7.10",
"url": "",
"updateUrl": "",