This commit is contained in:
Bob 2023-02-12 20:42:33 +01:00
parent 9242c79ee3
commit 84d5dcb3a6
21 changed files with 357 additions and 7 deletions

View File

@ -80,6 +80,7 @@ public class ModBlocks {
public static Block ore_random;
public static Block ore_bedrock;
public static Block ore_volcano;
public static Block ore_bedrock_coltan;
@ -552,6 +553,7 @@ public class ModBlocks {
public static Block tnt;
public static Block semtex;
public static Block c4;
public static Block fissure_bomb;
public static Block charge_dynamite;
public static Block charge_miner;
@ -1401,6 +1403,7 @@ public class ModBlocks {
ore_random = new BlockMotherOfAllOres().setBlockName("ore_random").setCreativeTab(MainRegistry.blockTab);
ore_bedrock = new BlockBedrockOreTE().setBlockName("ore_bedrock").setCreativeTab(null);
ore_volcano = new BlockFissure().setBlockName("ore_volcano").setLightLevel(1F).setCreativeTab(MainRegistry.blockTab);
depth_brick = new BlockDepth().setBlockName("depth_brick").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":depth_brick");
depth_tiles = new BlockDepth().setBlockName("depth_tiles").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":depth_tiles");
@ -1849,6 +1852,7 @@ public class ModBlocks {
tnt = new BlockTNT().setBlockName("tnt_ntm").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.nukeTab).setHardness(0.0F).setBlockTextureName(RefStrings.MODID + ":tnt");
semtex = new BlockSemtex().setBlockName("semtex").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.nukeTab).setHardness(0.0F).setBlockTextureName(RefStrings.MODID + ":semtex");
c4 = new BlockC4().setBlockName("c4").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.nukeTab).setHardness(0.0F).setBlockTextureName(RefStrings.MODID + ":c4");
fissure_bomb = new BlockFissureBomb().setBlockName("fissure_bomb").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.nukeTab).setHardness(0.0F).setBlockTextureName(RefStrings.MODID + ":fissure_bomb");
heater_firebox = new HeaterFirebox().setBlockName("heater_firebox").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
heater_oven = new HeaterOven().setBlockName("heater_oven").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
@ -2539,6 +2543,7 @@ public class ModBlocks {
//Bedrock ore
register(ore_bedrock);
register(ore_volcano);
//Crystals
GameRegistry.registerBlock(crystal_power, crystal_power.getUnlocalizedName());
@ -2928,6 +2933,7 @@ public class ModBlocks {
GameRegistry.registerBlock(tnt, tnt.getUnlocalizedName());
GameRegistry.registerBlock(semtex, semtex.getUnlocalizedName());
GameRegistry.registerBlock(c4, c4.getUnlocalizedName());
register(fissure_bomb);
//Turrets
GameRegistry.registerBlock(turret_chekhov, turret_chekhov.getUnlocalizedName());

View File

@ -0,0 +1,38 @@
package com.hbm.blocks.bomb;
import com.hbm.blocks.ModBlocks;
import com.hbm.entity.item.EntityTNTPrimedBase;
import com.hbm.explosion.ExplosionNukeSmall;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
public class BlockFissureBomb extends BlockTNTBase {
@Override
public void explodeEntity(World world, double x, double y, double z, EntityTNTPrimedBase entity) {
ExplosionNukeSmall.explode(world, x, y, z, ExplosionNukeSmall.medium);
int range = 5;
for(int i = -range; i <= range; i++) {
for(int j = -range; j <= range; j++) {
for(int k = -range; k <= range; k++) {
int a = (int) Math.floor(x + i);
int b = (int) Math.floor(y + j);
int c = (int) Math.floor(z + k);
Block block = world.getBlock(a, b, c);
if(block == ModBlocks.ore_bedrock) {
world.setBlock(a, b, c, ModBlocks.ore_volcano);
} else if(block == ModBlocks.ore_bedrock_oil) {
world.setBlock(a, b, c, Blocks.bedrock);
}
}
}
}
}
}

View File

@ -24,10 +24,8 @@ import net.minecraft.world.World;
public abstract class BlockTNTBase extends BlockFlammable implements IToolable {
@SideOnly(Side.CLIENT)
private IIcon topIcon;
@SideOnly(Side.CLIENT)
private IIcon bottomIcon;
@SideOnly(Side.CLIENT) private IIcon topIcon;
@SideOnly(Side.CLIENT) private IIcon bottomIcon;
public BlockTNTBase() {
super(Material.tnt, 15, 100);

View File

@ -98,6 +98,7 @@ public class BlockBedrockOreTE extends BlockContainer implements ILookOverlay, I
return Blocks.bedrock.getIcon(0, 0);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {

View File

@ -0,0 +1,53 @@
package com.hbm.blocks.generic;
import com.hbm.blocks.IBlockMultiPass;
import com.hbm.lib.RefStrings;
import com.hbm.render.block.RenderBlockMultipass;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.util.IIcon;
public class BlockFissure extends Block implements IBlockMultiPass {
private IIcon overlay;
public BlockFissure() {
super(Material.rock);
this.setBlockTextureName("bedrock");
this.setBlockUnbreakable();
this.setResistance(1_000_000);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister reg) {
this.blockIcon = reg.registerIcon("bedrock");
this.overlay = reg.registerIcon(RefStrings.MODID + ":molten_overlay");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
if(RenderBlockMultipass.currentPass == 0)
return Blocks.bedrock.getIcon(0, 0);
return this.overlay;
}
@Override
public int getPasses() {
return 2;
}
@Override
public int getRenderType(){
return IBlockMultiPass.getRenderType();
}
}

View File

@ -1,6 +1,7 @@
package com.hbm.blocks.machine;
import com.hbm.blocks.BlockDummyable;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.TileEntityMachineHephaestus;
import net.minecraft.block.material.Material;
@ -16,7 +17,10 @@ public class MachineHephaestus extends BlockDummyable {
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityMachineHephaestus();
if(meta >= 12) return new TileEntityMachineHephaestus();
if(meta >= 6) return new TileEntityProxyCombo().fluid();
return null;
}
@Override

View File

@ -358,6 +358,7 @@ public class WeaponRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.tnt, 1), new Object[] { "DDD", "DSD", "DDD", 'D', ModItems.stick_tnt, 'S', ModItems.safety_fuse });
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.semtex, 1), new Object[] { "DDD", "DSD", "DDD", 'D', ModItems.stick_semtex, 'S', ModItems.safety_fuse });
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.c4, 1), new Object[] { "DDD", "DSD", "DDD", 'D', ModItems.stick_c4, 'S', ModItems.safety_fuse });
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.fissure_bomb, 1), new Object[] { "SUS", "RPR", "SUS", 'S', ModBlocks.semtex, 'U', U238.block(), 'R', OreDictManager.getReflector(), 'P', PU239.billet() });
//IF Grenades

View File

@ -76,7 +76,7 @@ public class ExplosionSolinium
{
breakColumn(this.lastposX, this.lastposZ);
this.shell = (int) Math.floor((Math.sqrt(n) + 1) / 2);
int shell2 = this.shell * 2;
int shell2 = Math.max(this.shell * 2,1);
this.leg = (int) Math.floor((this.n - (shell2 - 1) * (shell2 - 1)) / shell2);
this.element = (this.n - (shell2 - 1) * (shell2 - 1)) - shell2 * this.leg - this.shell + 1;
this.lastposX = this.leg == 0 ? this.shell : this.leg == 1 ? -this.element : this.leg == 2 ? -this.shell : this.element;

View File

@ -267,6 +267,7 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCombustionEngine.class, new RenderCombustionEngine());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineExcavator.class, new RenderExcavator());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineMixer.class, new RenderMixer());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineHephaestus.class, new RenderHephaestus());
//Foundry
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFoundryBasin.class, new RenderFoundry());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFoundryMold.class, new RenderFoundry());

View File

@ -48,6 +48,7 @@ public class ResourceManager {
public static final IModelCustom crucible_heat = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/crucible.obj"));
public static final IModelCustom boiler = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/boiler.obj"));
public static final IModelCustom boiler_burst = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/boiler_burst.obj"));
public static final IModelCustom hephaestus = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/hephaestus.obj"));
//Furnaces
public static final IModelCustom furnace_iron = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/furnace_iron.obj"));
@ -367,6 +368,7 @@ public class ResourceManager {
public static final ResourceLocation sawmill_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/sawmill.png");
public static final ResourceLocation crucible_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/crucible_heat.png");
public static final ResourceLocation boiler_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/boiler.png");
public static final ResourceLocation hephaestus_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/hephaestus.png");
//Furnaces
public static final ResourceLocation furnace_iron_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/furnace_iron.png");

View File

@ -0,0 +1,71 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.machine.TileEntityMachineHephaestus;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderHephaestus extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.hephaestus_tex);
ResourceManager.hephaestus.renderPart("Main");
TileEntityMachineHephaestus geo = (TileEntityMachineHephaestus) tile;
float movement = geo.prevRot + (geo.rot - geo.prevRot) * interp;
boolean isOn = geo.bufferedHeat > 0;
GL11.glPushMatrix();
GL11.glRotatef(movement, 0, 1, 0);
for(int i = 0; i < 3; i++) {
ResourceManager.hephaestus.renderPart("Rotor");
GL11.glRotated(120, 0, 1, 0);
}
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
GL11.glPushMatrix();
if(isOn) {
bindTexture(RenderCrucible.lava);
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
GL11.glDisable(GL11.GL_LIGHTING);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
} else {
bindTexture(RenderExcavator.cobble);
GL11.glColor3f(0.5F, 0.5F, 0.5F);
}
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
GL11.glScalef(0.5F, 0.5F, 0.5F);
GL11.glTranslatef(0, movement / 10F, 0);
ResourceManager.hephaestus.renderPart("Core");
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
if(isOn) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopAttrib();
} else {
GL11.glColor3f(1F, 1F, 1F);
}
GL11.glPopMatrix();
GL11.glPopMatrix();
}
}

View File

@ -140,6 +140,7 @@ public class TileMappings {
put(TileEntityCore.class, "tileentity_v0");
put(TileEntityMachineArcFurnace.class, "tileentity_arc_furnace");
put(TileEntityMachineAmgen.class, "tileentity_amgen");
put(TileEntityMachineHephaestus.class, "tileentity_hephaestus");
put(TileEntityGeysir.class, "tileentity_geysir");
put(TileEntityMachineMissileAssembly.class, "tileentity_missile_assembly");
put(TileEntityLaunchTable.class, "tileentity_large_launch_table");

View File

@ -1,42 +1,184 @@
package com.hbm.tileentity.machine;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.inventory.fluid.trait.FT_Heatable;
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingStep;
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingType;
import com.hbm.lib.Library;
import com.hbm.tileentity.INBTPacketReceiver;
import com.hbm.tileentity.TileEntityLoadedBase;
import com.hbm.util.fauxpointtwelve.DirPos;
import api.hbm.fluid.IFluidStandardTransceiver;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityMachineHephaestus extends TileEntityLoadedBase implements INBTPacketReceiver, IFluidStandardTransceiver {
public FluidTank input;
public FluidTank output;
public int bufferedHeat;
public float rot;
public float prevRot;
public TileEntityMachineHephaestus() {
this.input = new FluidTank(Fluids.OIL, 24_000);
this.output = new FluidTank(Fluids.HOTOIL, 24_000);
}
private int[] heat = new int[10];
private long fissureScanTime;
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
this.updateConnections();
setupTanks();
if(worldObj.getTotalWorldTime() % 20 == 0) {
this.updateConnections();
}
int height = (int) (worldObj.getTotalWorldTime() % 10);
int range = 7;
int y = yCoord - 1 - height;
heat[height] = 0;
if(y >= 0) {
for(int x = -range; x <= range; x++) {
for(int z = -range; z <= range; z++) {
heat[height] += heatFromBlock(xCoord + x, y, zCoord + z);
}
}
}
NBTTagCompound data = new NBTTagCompound();
input.writeToNBT(data, "i");
heatFluid();
output.writeToNBT(data, "o");
if(output.getFill() > 0) {
for(DirPos pos : getConPos()) {
this.sendFluid(output.getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
}
}
data.setInteger("heat", this.getTotalHeat());
INBTPacketReceiver.networkPack(this, data, 150);
} else {
this.prevRot = this.rot;
if(this.bufferedHeat > 0) {
this.rot += 0.5F;
if(worldObj.rand.nextInt(7) == 0) {
double x = worldObj.rand.nextGaussian() * 2;
double y = worldObj.rand.nextGaussian() * 3;
double z = worldObj.rand.nextGaussian() * 2;
worldObj.spawnParticle("cloud", xCoord + 0.5 + x, yCoord + 6 + y, zCoord + 0.5 + z, 0, 0, 0);
}
}
if(this.rot >= 360F) {
this.prevRot -= 360F;
this.rot -= 360F;
}
}
}
protected void heatFluid() {
FluidType type = input.getTankType();
if(type.hasTrait(FT_Heatable.class)) {
FT_Heatable trait = type.getTrait(FT_Heatable.class);
int heat = this.getTotalHeat();
HeatingStep step = trait.getFirstStep();
int inputOps = input.getFill() / step.amountReq;
int outputOps = (output.getMaxFill() - output.getFill()) / step.amountProduced;
int heatOps = heat / step.heatReq;
int ops = Math.min(Math.min(inputOps, outputOps), heatOps);
input.setFill(input.getFill() - step.amountReq * ops);
output.setFill(output.getFill() + step.amountProduced * ops);
worldObj.markTileEntityChunkModified(xCoord, yCoord, zCoord, this);
}
}
protected void setupTanks() {
FluidType type = input.getTankType();
if(type.hasTrait(FT_Heatable.class)) {
FT_Heatable trait = type.getTrait(FT_Heatable.class);
if(trait.getEfficiency(HeatingType.HEATEXCHANGER) > 0) {
FluidType outType = trait.getFirstStep().typeProduced;
output.setTankType(outType);
return;
}
}
input.setTankType(Fluids.NONE);
output.setTankType(Fluids.NONE);
}
protected int heatFromBlock(int x, int y, int z) {
Block b = worldObj.getBlock(x, y, z);
if(b == Blocks.lava || b == Blocks.flowing_lava) return 200;
if(b == ModBlocks.volcanic_lava_block) return 800;
if(b == ModBlocks.ore_volcano) {
this.fissureScanTime = worldObj.getTotalWorldTime();
return 2_000;
}
return 0;
}
public int getTotalHeat() {
boolean fissure = worldObj.getTotalWorldTime() - this.fissureScanTime < 20;
int heat = 0;
for(int h : this.heat) {
heat += h;
}
if(fissure) {
heat *= 5;
}
return heat;
}
@Override
public void networkUnpack(NBTTagCompound nbt) {
input.readFromNBT(nbt, "i");
output.readFromNBT(nbt, "o");
this.bufferedHeat = nbt.getInteger("heat");
}
private void updateConnections() {
if(input.getTankType() == Fluids.NONE) return;
for(DirPos pos : getConPos()) {
this.trySubscribe(input.getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
}
@ -75,4 +217,29 @@ public class TileEntityMachineHephaestus extends TileEntityLoadedBase implements
public boolean canConnect(FluidType type, ForgeDirection dir) {
return dir != ForgeDirection.UNKNOWN && dir != ForgeDirection.UP && dir != ForgeDirection.DOWN;
}
AxisAlignedBB bb = null;
@Override
public AxisAlignedBB getRenderBoundingBox() {
if(bb == null) {
bb = AxisAlignedBB.getBoundingBox(
xCoord - 3,
yCoord,
zCoord - 3,
xCoord + 4,
yCoord + 12,
zCoord + 4
);
}
return bb;
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared() {
return 65536.0D;
}
}

View File

@ -3579,6 +3579,7 @@ tile.fireworks.name=Feuerwerksbatterie
tile.fireworks.charges=Ladungen: %s
tile.fireworks.message=Nachricht: %s
tile.fireworks.color=Farbe: %s
tile.fissure_bomb.name=Geofissur-Bombe
tile.flame_war.name=Flamewar aus der Box
tile.float_bomb.name=Schwebebombe
tile.fluid_duct.name=Universelles Flüssigkeitsrohr (Veraltet)

View File

@ -4391,6 +4391,7 @@ tile.fireworks.name=Firework Battery
tile.fireworks.charges=Charges Loaded: %s
tile.fireworks.message=Message: %s
tile.fireworks.color=Color: %s
tile.fissure_bomb.name=Fissure Bomb
tile.flame_war.name=Flame War in a Box
tile.float_bomb.name=Levitation Bomb
tile.fluid_duct.name=Universal Fluid Duct (Deprecated)

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

View File

@ -0,0 +1,5 @@
{
"animation": {
"frametime": 4
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB