mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
patched up dead leaf particles, small fixes
This commit is contained in:
parent
4804483913
commit
79394a84c8
@ -79,8 +79,20 @@ public abstract class BlockGasBase extends Block {
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
|
||||
if(!world.isRemote)
|
||||
if(!world.isRemote) {
|
||||
|
||||
if(world.getBlockMetadata(x, y, z) == 0)
|
||||
world.scheduleBlockUpdate(x, y, z, this, 10);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
|
||||
if(world.getBlockMetadata(x, y, z) != 0) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 0, 4);
|
||||
world.scheduleBlockUpdate(x, y, z, this, 10);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -168,6 +168,7 @@ public class BlockBobble extends BlockContainer {
|
||||
FRIZZLE("Frooz", "Frooz", "Weapon models", "BLOOD IS FUEL", true),
|
||||
PU238("Pu-238", "Pu-238", "Improved Tom impact mechanics", null, false),
|
||||
VT("VT-6/24", "VT-6/24", "Balefire warhead model and general texturework", "You cannot unfuck a horse.", true),
|
||||
DOC("The Doctor", "Doctor17PH", "Russian localization, lunar miner", "Perhaps the moon rocks were too expensive", true),
|
||||
//testing garbage. why is she so dumb?
|
||||
CIRNO("Cirno", "Cirno", "being a dumb ice fairy", "No brain. Head empty.", true);
|
||||
|
||||
|
||||
@ -43,15 +43,20 @@ public class WasteLeaves extends Block {
|
||||
super.updateTick(world, x, y, z, rand);
|
||||
}
|
||||
|
||||
/*@Override
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
super.randomDisplayTick(world, x, y, z, rand);
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "deadleaf");
|
||||
MainRegistry.proxy.effectNT(data);
|
||||
}*/
|
||||
if(rand.nextInt(5) == 0 && world.getBlock(x, y - 1, z).getMaterial() == Material.air) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "deadleaf");
|
||||
data.setDouble("posX", x + rand.nextDouble());
|
||||
data.setDouble("posY", y - 0.05);
|
||||
data.setDouble("posZ", z + rand.nextDouble());
|
||||
MainRegistry.proxy.effectNT(data);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
|
||||
@ -36,14 +36,14 @@ public class GUIMachineBattery extends GuiInfoContainer {
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 62, guiTop + 69 - 52, 52, 52, battery.power, battery.maxPower);
|
||||
|
||||
long delta = battery.log[19] - battery.log[0];
|
||||
String deltaText = Library.getShortNumber(delta) + "HE/s";
|
||||
String deltaText = Library.getShortNumber(Math.abs(delta)) + "HE/s";
|
||||
|
||||
if(delta > 0)
|
||||
deltaText = EnumChatFormatting.GREEN + "+" + deltaText;
|
||||
else if(delta < 0)
|
||||
deltaText = EnumChatFormatting.RED + "+" + deltaText;
|
||||
deltaText = EnumChatFormatting.RED + "-" + deltaText;
|
||||
else
|
||||
deltaText = EnumChatFormatting.YELLOW + deltaText;
|
||||
deltaText = EnumChatFormatting.YELLOW + "+" + deltaText;
|
||||
|
||||
String[] info = {
|
||||
Library.getShortNumber(battery.power) + "/" + Library.getShortNumber(battery.maxPower) + "HE",
|
||||
|
||||
@ -70,10 +70,10 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 1, 64, 32, 32, ModBlocks.ore_coal_oil);
|
||||
|
||||
if(WorldConfig.gasbubbleSpawn > 0 && rand.nextInt(WorldConfig.gasbubbleSpawn) == 0)
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 1, 32, 30, 10, ModBlocks.gas_flammable);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 1, 32, 30, 10, ModBlocks.gas_flammable, 1);
|
||||
|
||||
if(WorldConfig.explosivebubbleSpawn > 0 && rand.nextInt(WorldConfig.explosivebubbleSpawn) == 0)
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 1, 32, 30, 10, ModBlocks.gas_explosive);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 1, 32, 30, 10, ModBlocks.gas_explosive, 1);
|
||||
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_iron, rand, 24);
|
||||
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_titanium, rand, 32);
|
||||
|
||||
@ -865,14 +865,17 @@ public class ModEventHandlerClient {
|
||||
event.green = 0.0F;
|
||||
event.blue = 0.0F;
|
||||
}*/
|
||||
|
||||
|
||||
public static IIcon particleBase;
|
||||
public static IIcon particleLeaf;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTextureStitch(TextureStitchEvent.Pre event) {
|
||||
|
||||
if(event.map.getTextureType() == 0)
|
||||
if(event.map.getTextureType() == 0) {
|
||||
particleBase = event.map.registerIcon(RefStrings.MODID + ":particle/particle_base");
|
||||
particleLeaf = event.map.registerIcon(RefStrings.MODID + ":particle/dead_leaf");
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@ -85,6 +85,8 @@ public class ParticleCoolingTower extends EntityFX {
|
||||
|
||||
public void renderParticle(Tessellator tess, float interp, float fX, float fY, float fZ, float sX, float sZ) {
|
||||
|
||||
tess.setNormal(0.0F, 1.0F, 0.0F);
|
||||
|
||||
tess.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha);
|
||||
|
||||
float scale = this.particleScale;
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
package com.hbm.particle;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.ModEventHandlerClient;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
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)
|
||||
@ -15,11 +14,10 @@ public class ParticleDeadLeaf extends EntityFX {
|
||||
|
||||
public ParticleDeadLeaf(TextureManager texman, World world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
this.particleRed = 0.7F + world.rand.nextFloat() * 0.05F;
|
||||
this.particleGreen = 0.2F + world.rand.nextFloat() * 0.05F;
|
||||
this.particleBlue = 0.2F + world.rand.nextFloat() * 0.05F;
|
||||
this.particleScale = 1F;
|
||||
this.particleMaxAge = 100 + world.rand.nextInt(20);
|
||||
particleIcon = ModEventHandlerClient.particleLeaf;
|
||||
this.particleRed = this.particleGreen = this.particleBlue = 1F - world.rand.nextFloat() * 0.2F;
|
||||
this.particleScale = 0.1F;
|
||||
this.particleMaxAge = 200 + world.rand.nextInt(50);
|
||||
this.particleGravity = 0.2F;
|
||||
}
|
||||
|
||||
@ -31,25 +29,37 @@ public class ParticleDeadLeaf extends EntityFX {
|
||||
super.onUpdate();
|
||||
|
||||
if(!this.onGround) {
|
||||
this.motionX += rand.nextGaussian() * 0.075D;
|
||||
this.motionZ += rand.nextGaussian() * 0.075D;
|
||||
this.motionX += rand.nextGaussian() * 0.002D;
|
||||
this.motionZ += rand.nextGaussian() * 0.002D;
|
||||
|
||||
if(this.motionY < -0.025D)
|
||||
this.motionY = -0.025D;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tess, float interp, float x, float y, float z, float tx, float tz) {
|
||||
public void renderParticle(Tessellator tess, float interp, float fX, float fY, float fZ, float sX, float sZ) {
|
||||
|
||||
tess.setNormal(0.0F, 1.0F, 0.0F);
|
||||
|
||||
tess.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha);
|
||||
|
||||
float f10 = this.particleScale * 0.1F;
|
||||
float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) interp - interpPosX);
|
||||
float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) interp - interpPosY);
|
||||
float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) interp - interpPosZ);
|
||||
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) (f11 - x * f10 - tx * f10), (double) (f12 - y * f10), (double) (f13 - z * f10 - tz * f10), (double) 0, (double) 0);
|
||||
tess.addVertexWithUV((double) (f11 - x * f10 + tx * f10), (double) (f12 + y * f10), (double) (f13 - z * f10 + tz * f10), (double) 0, (double) 1);
|
||||
tess.addVertexWithUV((double) (f11 + x * f10 + tx * f10), (double) (f12 + y * f10), (double) (f13 + z * f10 + tz * f10), (double) 1, (double) 1);
|
||||
tess.addVertexWithUV((double)(f11 + x * f10 - tx * f10), (double)(f12 - y * f10), (double)(f13 + z * f10 - tz * f10), (double)1, (double)0);
|
||||
boolean flipU = this.getEntityId() % 2 == 0;
|
||||
boolean flipV = this.getEntityId() % 4 < 2;
|
||||
|
||||
double minU = flipU ? particleIcon.getMaxU() : particleIcon.getMinU();
|
||||
double maxU = flipU ? particleIcon.getMinU() : particleIcon.getMaxU();
|
||||
double minV = flipV ? particleIcon.getMaxV() : particleIcon.getMinV();
|
||||
double maxV = flipV ? particleIcon.getMinV() : particleIcon.getMaxV();
|
||||
|
||||
tess.addVertexWithUV((double) (pX - fX * scale - sX * scale), (double) (pY - fY * scale), (double) (pZ - fZ * scale - sZ * scale), maxU, maxV);
|
||||
tess.addVertexWithUV((double) (pX - fX * scale + sX * scale), (double) (pY + fY * scale), (double) (pZ - fZ * scale + sZ * scale), maxU, minV);
|
||||
tess.addVertexWithUV((double) (pX + fX * scale + sX * scale), (double) (pY + fY * scale), (double) (pZ + fZ * scale + sZ * scale), minU, minV);
|
||||
tess.addVertexWithUV((double) (pX + fX * scale - sX * scale), (double) (pY - fY * scale), (double) (pZ + fZ * scale - sZ * scale), minU, maxV);
|
||||
}
|
||||
}
|
||||
@ -31,6 +31,7 @@ public class RenderBobble extends TileEntitySpecialRenderer {
|
||||
public static final ResourceLocation bobble_pu238 = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/pellet.png");
|
||||
public static final ResourceLocation bobble_frizzle = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/frizzle.png");
|
||||
public static final ResourceLocation bobble_vt = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/vt.png");
|
||||
public static final ResourceLocation bobble_doc = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/doctor17ph.png");
|
||||
public static final ResourceLocation bobble_cirno = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/cirno.png");
|
||||
|
||||
@Override
|
||||
@ -74,6 +75,7 @@ public class RenderBobble extends TileEntitySpecialRenderer {
|
||||
case PU238: texman.bindTexture(bobble_pu238); break;
|
||||
case FRIZZLE: texman.bindTexture(bobble_frizzle); break;
|
||||
case VT: texman.bindTexture(bobble_vt); break;
|
||||
case DOC: texman.bindTexture(bobble_doc); break;
|
||||
case CIRNO: texman.bindTexture(bobble_cirno); break;
|
||||
default: texman.bindTexture(ResourceManager.universal);
|
||||
}
|
||||
@ -149,15 +151,12 @@ public class RenderBobble extends TileEntitySpecialRenderer {
|
||||
rotRightArm = new double[]{-135, -45, 0};
|
||||
rotRightLeg = new double[]{-5, 0, 0};
|
||||
break;
|
||||
case BOB: break;
|
||||
case PU238: break;
|
||||
case VT:
|
||||
rotLeftArm = new double[]{0, -45, 60};
|
||||
rotRightArm = new double[]{0, 0, 45};
|
||||
rotLeftLeg = new double[]{2, 0, 0};
|
||||
rotRightLeg = new double[]{-2, 0, 0};
|
||||
break;
|
||||
case CIRNO: break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 154 B |
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 184 B |
Loading…
x
Reference in New Issue
Block a user