mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
igen configs, HSS crucible recipe tweak
This commit is contained in:
parent
52cfe40da8
commit
f1a6e4526b
@ -6,7 +6,8 @@ public class BlockEnums {
|
||||
SULFUR,
|
||||
ASBESTOS,
|
||||
HEMATITE,
|
||||
MALACHITE
|
||||
MALACHITE,
|
||||
LIMESTONE
|
||||
}
|
||||
|
||||
public static enum EnumStalagmiteType {
|
||||
|
||||
@ -293,6 +293,7 @@ public class ModBlocks {
|
||||
public static Block deco_emitter;
|
||||
public static Block deco_loot;
|
||||
public static Block bobblehead;
|
||||
public static Block snowglobe;
|
||||
|
||||
public static Block hazmat;
|
||||
|
||||
@ -1562,6 +1563,7 @@ public class ModBlocks {
|
||||
deco_emitter = new BlockEmitter().setBlockName("deco_emitter").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(20.0F).setBlockTextureName(RefStrings.MODID + ":emitter");
|
||||
deco_loot = new BlockLoot().setBlockName("deco_loot").setCreativeTab(null).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
bobblehead = new BlockBobble().setBlockName("bobblehead").setCreativeTab(MainRegistry.blockTab).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
snowglobe = new BlockSnowglobe().setBlockName("snowglobe").setCreativeTab(MainRegistry.blockTab).setHardness(0.0F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":glass_boron");
|
||||
hazmat = new BlockGeneric(Material.cloth).setBlockName("hazmat").setStepSound(Block.soundTypeCloth).setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(100.0F).setBlockTextureName(RefStrings.MODID + ":hazmat");
|
||||
|
||||
gravel_obsidian = new BlockFalling(Material.iron).setBlockName("gravel_obsidian").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGravel).setHardness(5.0F).setResistance(600.0F).setBlockTextureName(RefStrings.MODID + ":gravel_obsidian");
|
||||
@ -2665,6 +2667,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(deco_emitter, ItemBlockBase.class, deco_emitter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(deco_loot, deco_loot.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(bobblehead, ItemBlockMeta.class, bobblehead.getUnlocalizedName());
|
||||
register(snowglobe);
|
||||
GameRegistry.registerBlock(hazmat, hazmat.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(deco_rbmk, deco_rbmk.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(deco_rbmk_smooth, deco_rbmk_smooth.getUnlocalizedName());
|
||||
|
||||
@ -1,13 +1,8 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockStone;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
166
src/main/java/com/hbm/blocks/generic/BlockSnowglobe.java
Normal file
166
src/main/java/com/hbm/blocks/generic/BlockSnowglobe.java
Normal file
@ -0,0 +1,166 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.wiaj.WorldInAJar;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockSnowglobe extends BlockContainer {
|
||||
|
||||
public BlockSnowglobe() {
|
||||
super(Material.glass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random rand, int j) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
|
||||
TileEntitySnowglobe entity = (TileEntitySnowglobe) world.getTileEntity(x, y, z);
|
||||
|
||||
if(entity != null) {
|
||||
return new ItemStack(this, 1, entity.type.ordinal());
|
||||
}
|
||||
|
||||
return super.getPickBlock(target, world, x, y, z, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
TileEntitySnowglobe entity = (TileEntitySnowglobe) world.getTileEntity(x, y, z);
|
||||
if(entity != null) {
|
||||
EntityItem item = new EntityItem(world, x + 0.5, y, z + 0.5, new ItemStack(this, 1, entity.type.ordinal()));
|
||||
item.motionX = 0;
|
||||
item.motionY = 0;
|
||||
item.motionZ = 0;
|
||||
world.spawnEntityInWorld(item);
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
if(world.isRemote) {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModItems.guiID_item_snowglobe, world, x, y, z);
|
||||
return true;
|
||||
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
|
||||
for(int i = 1; i < SnowglobeType.values().length; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
|
||||
int meta = MathHelper.floor_double((double)((player.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15;
|
||||
world.setBlockMetadataWithNotify(x, y, z, meta, 2);
|
||||
|
||||
TileEntitySnowglobe bobble = (TileEntitySnowglobe) world.getTileEntity(x, y, z);
|
||||
bobble.type = SnowglobeType.values()[Math.abs(stack.getItemDamage()) % SnowglobeType.values().length];
|
||||
bobble.markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntitySnowglobe();
|
||||
}
|
||||
|
||||
public static class TileEntitySnowglobe extends TileEntity {
|
||||
|
||||
public SnowglobeType type = SnowglobeType.NONE;
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
this.writeToNBT(nbt);
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
this.readFromNBT(pkt.func_148857_g());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.type = SnowglobeType.values()[Math.abs(nbt.getByte("type")) % SnowglobeType.values().length];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setByte("type", (byte) type.ordinal());
|
||||
}
|
||||
}
|
||||
|
||||
public static enum SnowglobeType {
|
||||
NONE("NONE", new WorldInAJar(1, 1, 1));
|
||||
|
||||
public String label;
|
||||
public WorldInAJar scene;
|
||||
|
||||
private SnowglobeType(String label, WorldInAJar scene) {
|
||||
this.label = label;
|
||||
this.scene = scene;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -51,10 +51,6 @@ public class CrucibleRecipes extends SerializableRecipe {
|
||||
.inputs(new MaterialStack(Mats.MAT_IRON, n * 2), new MaterialStack(Mats.MAT_CARBON, n))
|
||||
.outputs(new MaterialStack(Mats.MAT_STEEL, n * 2)));
|
||||
|
||||
/*recipes.add(new CrucibleRecipe(6, "crucible.steel_flux", 9, new ItemStack(ModItems.ingot_steel))
|
||||
.inputs(new MaterialStack(Mats.MAT_IRON, i), new MaterialStack(Mats.MAT_COAL, n * 4), new MaterialStack(Mats.MAT_FLUX, n))
|
||||
.outputs(new MaterialStack(Mats.MAT_STEEL, i)));*/ //TODO: unify coal types into carbon with varying yield
|
||||
|
||||
recipes.add(new CrucibleRecipe(7, "crucible.hematite", 6, DictFrame.fromOne(ModBlocks.stone_resource, EnumStoneType.HEMATITE))
|
||||
.inputs(new MaterialStack(Mats.MAT_HEMATITE, i * 2), new MaterialStack(Mats.MAT_FLUX, n * 2))
|
||||
.outputs(new MaterialStack(Mats.MAT_IRON, i), new MaterialStack(Mats.MAT_SLAG, n * 3)));
|
||||
@ -71,9 +67,9 @@ public class CrucibleRecipes extends SerializableRecipe {
|
||||
.inputs(new MaterialStack(Mats.MAT_STEEL, n), new MaterialStack(Mats.MAT_MINGRADE, n))
|
||||
.outputs(new MaterialStack(Mats.MAT_ALLOY, n * 2)));
|
||||
|
||||
recipes.add(new CrucibleRecipe(3, "crucible.hss", 4, new ItemStack(ModItems.ingot_dura_steel))
|
||||
.inputs(new MaterialStack(Mats.MAT_STEEL, n * 2), new MaterialStack(Mats.MAT_TUNGSTEN, n), new MaterialStack(Mats.MAT_COBALT, n))
|
||||
.outputs(new MaterialStack(Mats.MAT_DURA, n * 4)));
|
||||
recipes.add(new CrucibleRecipe(3, "crucible.hss", 9, new ItemStack(ModItems.ingot_dura_steel))
|
||||
.inputs(new MaterialStack(Mats.MAT_STEEL, n * 5), new MaterialStack(Mats.MAT_TUNGSTEN, n * 3), new MaterialStack(Mats.MAT_COBALT, n * 1))
|
||||
.outputs(new MaterialStack(Mats.MAT_DURA, n * 9)));
|
||||
|
||||
recipes.add(new CrucibleRecipe(4, "crucible.ferro", 3, new ItemStack(ModItems.ingot_ferrouranium))
|
||||
.inputs(new MaterialStack(Mats.MAT_STEEL, n * 2), new MaterialStack(Mats.MAT_U238, n))
|
||||
|
||||
@ -2591,6 +2591,7 @@ public class ModItems {
|
||||
public static final int guiID_item_guide = 10106;
|
||||
public static final int guiID_item_bobble = 10107;
|
||||
public static final int guiID_item_holo_image = 10108;
|
||||
public static final int guiID_item_snowglobe = 10109;
|
||||
|
||||
public static final int guiID_cart_crate = 2000;
|
||||
public static final int guiID_cart_destroyer = 2001;
|
||||
|
||||
@ -9,6 +9,7 @@ import com.hbm.blocks.generic.BlockBobble.TileEntityBobble;
|
||||
import com.hbm.blocks.generic.BlockEmitter.TileEntityEmitter;
|
||||
import com.hbm.blocks.generic.BlockLoot.TileEntityLoot;
|
||||
import com.hbm.blocks.generic.BlockMotherOfAllOres.TileEntityRandomOre;
|
||||
import com.hbm.blocks.generic.BlockSnowglobe.TileEntitySnowglobe;
|
||||
import com.hbm.blocks.network.CableDiode.TileEntityDiode;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
@ -178,6 +179,7 @@ public class TileMappings {
|
||||
|
||||
put(TileEntityLoot.class, "tileentity_ntm_loot");
|
||||
put(TileEntityBobble.class, "tileentity_ntm_bobblehead");
|
||||
put(TileEntitySnowglobe.class, "tileentity_ntm_snowglobe");
|
||||
put(TileEntityEmitter.class, "tileentity_ntm_emitter");
|
||||
|
||||
put(TileEntityDoorGeneric.class, "tileentity_ntm_door");
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
@ -9,6 +13,7 @@ import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.fluid.trait.FT_Flammable;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.RTGUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
@ -25,10 +30,9 @@ import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineIGenerator extends TileEntityMachineBase implements IFluidAcceptor, IEnergyGenerator, IFluidStandardReceiver {
|
||||
public class TileEntityMachineIGenerator extends TileEntityMachineBase implements IFluidAcceptor, IEnergyGenerator, IFluidStandardReceiver, IConfigurableMachine {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 1000000;
|
||||
public int spin;
|
||||
public int[] burn = new int[4];
|
||||
public boolean hasRTG = false;
|
||||
@ -42,13 +46,66 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
|
||||
public FluidTank[] tanks;
|
||||
|
||||
public int age = 0;
|
||||
|
||||
public static final int coalConRate = 75;
|
||||
|
||||
/* CONFIGURABLE */
|
||||
public static long maxPower = 1_000_000;
|
||||
public static int waterCap = 16000;
|
||||
public static int oilCap = 16000;
|
||||
public static int lubeCap = 4000;
|
||||
public static int coalGenRate = 20;
|
||||
public static double rtgHeatMult = 0.15D;
|
||||
public static double waterPowerMult = 1.0D;
|
||||
public static double lubePowerMult = 1.0D;
|
||||
public static double heatExponent = 1.1D;
|
||||
public static int waterRate = 10;
|
||||
public static int lubeRate = 1;
|
||||
public static long fluidHeatDiv = 5_000L;
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "igen";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
maxPower = IConfigurableMachine.grab(obj, "L:powerCap", maxPower);
|
||||
waterCap = IConfigurableMachine.grab(obj, "I:waterCap", waterCap);
|
||||
oilCap = IConfigurableMachine.grab(obj, "I:oilCap", oilCap);
|
||||
lubeCap = IConfigurableMachine.grab(obj, "I:lubeCap", lubeCap);
|
||||
coalGenRate = IConfigurableMachine.grab(obj, "I:solidFuelRate", coalGenRate);
|
||||
rtgHeatMult = IConfigurableMachine.grab(obj, "D:rtgHeatMult", rtgHeatMult);
|
||||
waterPowerMult = IConfigurableMachine.grab(obj, "D:waterPowerMult", waterPowerMult);
|
||||
lubePowerMult = IConfigurableMachine.grab(obj, "D:lubePowerMult", lubePowerMult);
|
||||
heatExponent = IConfigurableMachine.grab(obj, "D:heatExponent", heatExponent);
|
||||
waterRate = IConfigurableMachine.grab(obj, "I:waterRate", waterRate);
|
||||
lubeRate = IConfigurableMachine.grab(obj, "I:lubeRate", lubeRate);
|
||||
fluidHeatDiv = IConfigurableMachine.grab(obj, "D:fluidHeatDiv", fluidHeatDiv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("L:powerCap").value(maxPower);
|
||||
writer.name("I:waterCap").value(waterCap);
|
||||
writer.name("I:oilCap").value(oilCap);
|
||||
writer.name("I:lubeCap").value(lubeCap);
|
||||
writer.name("I:solidFuelRate").value(coalGenRate);
|
||||
writer.name("D:rtgHeatMult").value(rtgHeatMult);
|
||||
writer.name("D:waterPowerMult").value(waterPowerMult);
|
||||
writer.name("D:lubePowerMult").value(lubePowerMult);
|
||||
writer.name("D:heatExponent").value(heatExponent);
|
||||
writer.name("I:waterRate").value(waterRate);
|
||||
writer.name("I:lubeRate").value(lubeRate);
|
||||
writer.name("D:fluidHeatDiv").value(fluidHeatDiv);
|
||||
}
|
||||
|
||||
public TileEntityMachineIGenerator() {
|
||||
super(21);
|
||||
tanks = new FluidTank[3];
|
||||
tanks[0] = new FluidTank(Fluids.WATER, 16000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.HEATINGOIL, 16000, 1);
|
||||
tanks[2] = new FluidTank(Fluids.LUBRICANT, 4000, 2);
|
||||
tanks[0] = new FluidTank(Fluids.WATER, waterCap, 0);
|
||||
tanks[1] = new FluidTank(Fluids.HEATINGOIL, oilCap, 1);
|
||||
tanks[2] = new FluidTank(Fluids.LUBRICANT, lubeCap, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -144,23 +201,23 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
|
||||
|
||||
// RTG ///
|
||||
this.hasRTG = RTGUtil.hasHeat(slots, RTGSlots);
|
||||
this.spin += RTGUtil.updateRTGs(slots, RTGSlots) * (con ? 0.2 : 0.15);
|
||||
this.spin += RTGUtil.updateRTGs(slots, RTGSlots) * (con ? 0.2 : rtgHeatMult);
|
||||
|
||||
if(this.spin > 0) {
|
||||
|
||||
int powerGen = this.spin;
|
||||
|
||||
if(this.tanks[0].getFill() >= 10) {
|
||||
powerGen += this.spin;
|
||||
this.tanks[0].setFill(this.tanks[0].getFill() - 10);
|
||||
powerGen += this.spin * waterPowerMult;
|
||||
this.tanks[0].setFill(this.tanks[0].getFill() - waterRate);
|
||||
}
|
||||
|
||||
if(this.tanks[2].getFill() >= 1) {
|
||||
powerGen += this.spin * 3;
|
||||
this.tanks[2].setFill(this.tanks[2].getFill() - 1);
|
||||
powerGen += this.spin * lubePowerMult;
|
||||
this.tanks[2].setFill(this.tanks[2].getFill() - lubeRate);
|
||||
}
|
||||
|
||||
this.power += Math.pow(powerGen, 1.1D);
|
||||
this.power += Math.pow(powerGen, heatExponent);
|
||||
|
||||
if(this.power > this.maxPower)
|
||||
this.power = this.maxPower;
|
||||
@ -208,13 +265,10 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
|
||||
this.burn = nbt.getIntArray("burn");
|
||||
this.hasRTG = nbt.getBoolean("hasRTG");
|
||||
}
|
||||
|
||||
public static final int coalConRate = 75;
|
||||
public static final int coalGenRate = 20;
|
||||
|
||||
public int getPowerFromFuel(boolean con) {
|
||||
FluidType type = tanks[1].getTankType();
|
||||
return type.hasTrait(FT_Flammable.class) ? (int)(type.getTrait(FT_Flammable.class).getHeatEnergy() / (con ? 1000L : 5000L)) : 0;
|
||||
return type.hasTrait(FT_Flammable.class) ? (int)(type.getTrait(FT_Flammable.class).getHeatEnergy() / (con ? 1000L : fluidHeatDiv)) : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
Before Width: | Height: | Size: 235 B After Width: | Height: | Size: 235 B |
Loading…
x
Reference in New Issue
Block a user