ionic gel, blast furnace extension

This commit is contained in:
Boblet 2023-03-20 15:40:10 +01:00
parent 109b6714a8
commit f52dbbec35
26 changed files with 488 additions and 387 deletions

View File

@ -663,6 +663,7 @@ public class ModBlocks {
public static Block machine_difurnace_off;
public static Block machine_difurnace_on;
public static Block machine_difurnace_extension;
public static Block machine_difurnace_rtg_off;
public static Block machine_difurnace_rtg_on;
//public static final int guiID_test_difurnace = 1; historical
@ -899,17 +900,8 @@ public class ModBlocks {
public static Block teleanchor;
public static Block field_disturber;
public static Block machine_reix_mainframe;
public static final int guiID_machine_reix_mainframe = 38;
public static Block machine_rtg_grey;
//public static Block machine_rtg_red;
//public static Block machine_rtg_orange;
//public static Block machine_rtg_yellow;
//public static Block machine_rtg_green;
public static Block machine_rtg_cyan;
//public static Block machine_rtg_blue;
//public static Block machine_rtg_purple;
public static Block machine_amgen;
public static Block machine_geo;
public static Block machine_minirtg;
@ -1774,6 +1766,7 @@ public class ModBlocks {
machine_difurnace_off = new MachineDiFurnace(false).setBlockName("machine_difurnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
machine_difurnace_on = new MachineDiFurnace(true).setBlockName("machine_difurnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
machine_difurnace_extension = new MachineDiFurnaceExtension().setBlockName("machine_difurnace_extension").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
machine_difurnace_rtg_off = new MachineDiFurnaceRTG(false).setBlockName("machine_difurnace_rtg_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
machine_difurnace_rtg_on = new MachineDiFurnaceRTG(true).setBlockName("machine_difurnace_rtg_on").setHardness(5.0F).setResistance(10.0F).setLightLevel(2.0F).setCreativeTab(null);
@ -2201,8 +2194,6 @@ public class ModBlocks {
machine_schrabidium_transmutator = new MachineSchrabidiumTransmutator(Material.iron).setBlockName("machine_schrabidium_transmutator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab);
machine_reix_mainframe = new MachineReiXMainframe(Material.iron).setBlockName("machine_reix_mainframe").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab);
machine_siren = new MachineSiren(Material.iron).setBlockName("machine_siren").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_siren");
machine_spp_bottom = new SPPBottom(Material.iron).setBlockName("machine_spp_bottom").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
@ -2979,8 +2970,9 @@ public class ModBlocks {
register(foundry_channel);
register(foundry_tank);
register(foundry_outlet);
GameRegistry.registerBlock(machine_difurnace_off, machine_difurnace_off.getUnlocalizedName());
GameRegistry.registerBlock(machine_difurnace_on, machine_difurnace_on.getUnlocalizedName());
register(machine_difurnace_off);
register(machine_difurnace_on);
register(machine_difurnace_extension);
GameRegistry.registerBlock(machine_difurnace_rtg_off, machine_difurnace_rtg_off.getUnlocalizedName());
GameRegistry.registerBlock(machine_difurnace_rtg_on, machine_difurnace_rtg_on.getUnlocalizedName());
GameRegistry.registerBlock(machine_centrifuge, machine_centrifuge.getUnlocalizedName());

View File

@ -23,119 +23,84 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class MachineDiFurnace extends BlockContainer {
private final Random field_149933_a = new Random();
private final Random rand = new Random();
private final boolean isActive;
private static boolean keepInventory;
@SideOnly(Side.CLIENT) private IIcon blockIconCovered;
@SideOnly(Side.CLIENT) private IIcon iconFront;
@SideOnly(Side.CLIENT) private IIcon iconFrontCovered;
@SideOnly(Side.CLIENT) private IIcon iconTop;
@SideOnly(Side.CLIENT) private IIcon iconBottom;
public MachineDiFurnace(boolean blockState) {
super(Material.iron);
super(Material.rock);
isActive = blockState;
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityDiFurnace();
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIconCovered = iconRegister.registerIcon(RefStrings.MODID + ":difurnace_side_tall");
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":difurnace_top_on_alt" : ":difurnace_top_off_alt"));
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":difurnace_front_on_alt" : ":difurnace_front_off_alt"));
this.iconFrontCovered = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":difurnace_front_on_tall" : ":difurnace_front_off_tall"));
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":difurnace_side_alt");
this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + ":brick_fire");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
int meta = world.getBlockMetadata(x, y, z);
boolean covered = world.getBlock(x, y + 1, z) == ModBlocks.machine_difurnace_extension;
if(side == 0) return iconBottom;
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : (side == 1 ? this.iconTop : this.blockIcon));
if(covered) return meta == 0 && side == 3 ? this.iconFrontCovered : (side == meta ? this.iconFrontCovered : (side == 1 ? this.iconBottom : this.blockIconCovered));
return meta == 0 && side == 3 ? this.iconFront : (side == meta ? this.iconFront : (side == 1 ? this.iconTop : this.blockIcon));
}
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return meta == 0 && side == 3 ? this.iconFront : (side == meta ? this.iconFront : (side == 1 ? this.iconTop : this.blockIcon));
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return Item.getItemFromBlock(ModBlocks.machine_difurnace_off);
}
@Override
public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(world, x, y, z);
this.setDefaultDirection(world, x, y, z);
}
private void setDefaultDirection(World world, int x, int y, int z) {
if(!world.isRemote)
{
Block block1 = world.getBlock(x, y, z - 1);
Block block2 = world.getBlock(x, y, z + 1);
Block block3 = world.getBlock(x - 1, y, z);
Block block4 = world.getBlock(x + 1, y, z);
byte b0 = 3;
if(block1.func_149730_j() && !block2.func_149730_j())
{
b0 = 3;
}
if(block2.func_149730_j() && !block1.func_149730_j())
{
b0 = 2;
}
if(block3.func_149730_j() && !block4.func_149730_j())
{
b0 = 5;
}
if(block4.func_149730_j() && !block3.func_149730_j())
{
b0 = 4;
}
world.setBlockMetadataWithNotify(x, y, z, b0, 2);
}
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
return Item.getItemFromBlock(ModBlocks.machine_difurnace_off);
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0)
{
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
}
if(i == 1)
{
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
}
if(i == 2)
{
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
}
if(i == 3)
{
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
}
if(i == 0) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
if(i == 1) world.setBlockMetadataWithNotify(x, y, z, 5, 2);
if(i == 2) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
if(i == 3) world.setBlockMetadataWithNotify(x, y, z, 4, 2);
if(itemStack.hasDisplayName())
{
((TileEntityDiFurnace)world.getTileEntity(x, y, z)).setCustomName(itemStack.getDisplayName());
}
}
@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)
{
if(world.isRemote) {
return true;
} else if(!player.isSneaking())
{
} else if(!player.isSneaking()) {
TileEntityDiFurnace entity = (TileEntityDiFurnace) world.getTileEntity(x, y, z);
if(entity != null)
{
if(entity != null) {
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
}
return true;
@ -144,22 +109,15 @@ public class MachineDiFurnace extends BlockContainer {
}
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityDiFurnace();
}
public static void updateBlockState(boolean isProcessing, World world, int x, int y, int z) {
int i = world.getBlockMetadata(x, y, z);
TileEntity entity = world.getTileEntity(x, y, z);
keepInventory = true;
if(isProcessing)
{
world.setBlock(x, y, z, ModBlocks.machine_difurnace_on);
}else{
else
world.setBlock(x, y, z, ModBlocks.machine_difurnace_off);
}
keepInventory = false;
world.setBlockMetadataWithNotify(x, y, z, i, 2);
@ -171,103 +129,81 @@ public class MachineDiFurnace extends BlockContainer {
}
@Override
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
{
if (!keepInventory)
{
TileEntityDiFurnace tileentityfurnace = (TileEntityDiFurnace)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
if(!keepInventory) {
TileEntityDiFurnace tileentityfurnace = (TileEntityDiFurnace) world.getTileEntity(x, y, z);
if (tileentityfurnace != null)
{
for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1)
{
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
if(tileentityfurnace != null) {
for(int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1) {
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
if (itemstack != null)
{
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
if(itemstack != null) {
float f = this.rand.nextFloat() * 0.8F + 0.1F;
float f1 = this.rand.nextFloat() * 0.8F + 0.1F;
float f2 = this.rand.nextFloat() * 0.8F + 0.1F;
while (itemstack.stackSize > 0)
{
int j1 = this.field_149933_a.nextInt(21) + 10;
while(itemstack.stackSize > 0) {
int j1 = this.rand.nextInt(21) + 10;
if (j1 > itemstack.stackSize)
{
j1 = itemstack.stackSize;
}
if(j1 > itemstack.stackSize) {
j1 = itemstack.stackSize;
}
itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
if (itemstack.hasTagCompound())
{
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
}
if(itemstack.hasTagCompound()) {
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
}
float f3 = 0.05F;
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
p_149749_1_.spawnEntityInWorld(entityitem);
}
}
}
float f3 = 0.05F;
entityitem.motionX = (float) this.rand.nextGaussian() * f3;
entityitem.motionY = (float) this.rand.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float) this.rand.nextGaussian() * f3;
world.spawnEntityInWorld(entityitem);
}
}
}
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
}
}
world.func_147453_f(x, y, z, block);
}
}
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
}
super.breakBlock(world, x, y, z, block, meta);
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand)
{
if (isActive)
{
int l = p_149734_1_.getBlockMetadata(x, y, z);
float f = x + 0.5F;
float f1 = y + 0.25F + rand.nextFloat() * 6.0F / 16.0F;
float f2 = z + 0.5F;
float f3 = 0.52F;
float f4 = rand.nextFloat() * 0.5F - 0.25F;
float f5 = rand.nextFloat() * 0.75F + 0.125F;
float f6 = rand.nextFloat() * 0.75F + 0.125F;
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
if(isActive) {
int meta = world.getBlockMetadata(x, y, z);
float x0 = x + 0.5F;
float y0 = y + 0.25F + rand.nextFloat() * 6.0F / 16.0F;
float z0 = z + 0.5F;
float sideOff = 0.52F;
float sideRand = rand.nextFloat() * 0.5F - 0.25F;
float xOff = rand.nextFloat() * 0.375F + 0.3125F;
float zOff = rand.nextFloat() * 0.375F + 0.3125F;
if(world.getBlock(x, y + 1, z) == ModBlocks.machine_difurnace_extension) {
y += 1;
}
if (l == 4)
{
p_149734_1_.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
//p_149734_1_.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("smoke", x + f5, (double)y + 1, z + f6, 0.0D, 0.0D, 0.0D);
}
else if (l == 5)
{
p_149734_1_.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
//p_149734_1_.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("smoke", x + f5, (double)y + 1, z + f6, 0.0D, 0.0D, 0.0D);
}
else if (l == 2)
{
p_149734_1_.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
//p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D)
p_149734_1_.spawnParticle("smoke", x + f5, (double)y + 1, z + f6, 0.0D, 0.0D, 0.0D);
}
else if (l == 3)
{
p_149734_1_.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
//p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D);
p_149734_1_.spawnParticle("smoke", x + f5, (double)y + 1, z + f6, 0.0D, 0.0D, 0.0D);
}
}
}
@Override
@SideOnly(Side.CLIENT)
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_)
{
return Item.getItemFromBlock(ModBlocks.machine_difurnace_off);
}
if(meta == 4) {
world.spawnParticle("flame", x0 - sideOff, y0, z0 + sideRand, 0.0D, 0.0D, 0.0D);
world.spawnParticle("smoke", x + xOff, y + 1, z + zOff, 0.0D, 0.0D, 0.0D);
} else if(meta == 5) {
world.spawnParticle("flame", x0 + sideOff, y0, z0 + sideRand, 0.0D, 0.0D, 0.0D);
world.spawnParticle("smoke", x + xOff, y + 1, z + zOff, 0.0D, 0.0D, 0.0D);
} else if(meta == 2) {
world.spawnParticle("flame", x0 + sideRand, y0, z0 - sideOff, 0.0D, 0.0D, 0.0D);
world.spawnParticle("smoke", x + xOff, y + 1, z + zOff, 0.0D, 0.0D, 0.0D);
} else if(meta == 3) {
world.spawnParticle("flame", x0 + sideRand, y0, z0 + sideOff, 0.0D, 0.0D, 0.0D);
world.spawnParticle("smoke", x + xOff, y + 1, z + zOff, 0.0D, 0.0D, 0.0D);
}
}
}
}

View File

@ -0,0 +1,69 @@
package com.hbm.blocks.machine;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntityDiFurnace;
import cpw.mods.fml.client.registry.RenderingRegistry;
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.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class MachineDiFurnaceExtension extends Block {
@SideOnly(Side.CLIENT) private IIcon iconTop;
@SideOnly(Side.CLIENT) private IIcon iconBottom;
public MachineDiFurnaceExtension() {
super(Material.rock);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":difurnace_top_off_alt");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":difurnace_extension");
this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + ":brick_fire");
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(!player.isSneaking()) {
TileEntity te = world.getTileEntity(x, y - 1, z);
if(te instanceof TileEntityDiFurnace) {
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y - 1, z);
return true;
}
}
return false;
}
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return side == 0 ? this.iconBottom : side == 1 ? this.iconTop : this.blockIcon;
}
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
@Override
public int getRenderType() {
return renderID;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
}

View File

@ -58,6 +58,10 @@ public class EntityChemical extends EntityThrowableNT {
* if CORROSIVE: apply extra acid damage, poison effect as well as armor degradation
*/
public double lastClientPosX = -1;
public double lastClientPosY = -1;
public double lastClientPosZ = -1;
public EntityChemical(World world) {
super(world);
this.ignoreFrustumCheck = true;
@ -164,6 +168,15 @@ public class EntityChemical extends EntityThrowableNT {
}
}
if(style == ChemicalStyle.LIGHTNING) {
EntityDamageUtil.attackEntityFromIgnoreIFrame(e, ModDamageSource.electricity, 0.5F);
if(living != null) {
living.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 60, 9));
living.addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 9));
return;
}
}
if(type.temperature >= 100) {
EntityDamageUtil.attackEntityFromIgnoreIFrame(e, getDamage(ModDamageSource.s_boil), 5F + (type.temperature - 100) * 0.02F); //5 damage at 100°C with one extra damage every 50°C
@ -423,6 +436,7 @@ public class EntityChemical extends EntityThrowableNT {
ChemicalStyle type = getStyle();
if(type == ChemicalStyle.AMAT) return 1F;
if(type == ChemicalStyle.LIGHTNING) return 1F;
if(type == ChemicalStyle.GAS) return 0.95F;
return 0.99F;
@ -434,6 +448,7 @@ public class EntityChemical extends EntityThrowableNT {
ChemicalStyle type = getStyle();
if(type == ChemicalStyle.AMAT) return 1F;
if(type == ChemicalStyle.LIGHTNING) return 1F;
if(type == ChemicalStyle.GAS) return 1F;
return 0.8F;
@ -443,6 +458,7 @@ public class EntityChemical extends EntityThrowableNT {
switch(this.getStyle()) {
case AMAT: return 100;
case LIGHTNING: return 5;
case BURNING:return 600;
case GAS: return 60;
case GASFLAME: return 20;
@ -457,6 +473,7 @@ public class EntityChemical extends EntityThrowableNT {
ChemicalStyle type = getStyle();
if(type == ChemicalStyle.AMAT) return 0D;
if(type == ChemicalStyle.LIGHTNING) return 0D;
if(type == ChemicalStyle.GAS) return 0D;
if(type == ChemicalStyle.GASFLAME) return -0.01D;
@ -469,6 +486,10 @@ public class EntityChemical extends EntityThrowableNT {
public static ChemicalStyle getStyleFromType(FluidType type) {
if(type == Fluids.IONGEL) {
return ChemicalStyle.LIGHTNING;
}
if(type.isAntimatter()) {
return ChemicalStyle.AMAT;
}
@ -499,6 +520,7 @@ public class EntityChemical extends EntityThrowableNT {
*/
public static enum ChemicalStyle {
AMAT, //renders as beam
LIGHTNING, //renders as beam
LIQUID, //no renderer, fluid particles
GAS, //renders as particles
GASFLAME, //renders as fire particles

View File

@ -38,6 +38,12 @@ public class BossSpawnHandler {
public static void rollTheDice(World world) {
/*
* Spawns every 3 hours with a 33% chance if
* - the player is 3 blocks below the surface
* - the player has at least 50 RAD
* - the player has either crafted or placed an ore acidizer before
*/
if(MobConfig.enableMaskman) {
if(world.getTotalWorldTime() % MobConfig.maskmanDelay == 0) {
@ -45,9 +51,15 @@ public class BossSpawnHandler {
if(world.rand.nextInt(MobConfig.maskmanChance) == 0 && !world.playerEntities.isEmpty() && world.provider.isSurfaceWorld()) { //33% chance only if there is a player online
EntityPlayer player = (EntityPlayer) world.playerEntities.get(world.rand.nextInt(world.playerEntities.size())); //choose a random player
int id = Item.getIdFromItem(Item.getItemFromBlock(ModBlocks.machine_crystallizer));
StatBase statCraft = StatList.objectCraftStats[id];
StatBase statPlace = StatList.objectUseStats[id];
StatBase statBase = StatList.objectCraftStats[Item.getIdFromItem(Item.getItemFromBlock(ModBlocks.machine_crystallizer))];
boolean acidizerStat = !GeneralConfig.enableStatReRegistering || (statBase != null && player instanceof EntityPlayerMP && ((EntityPlayerMP)player).func_147099_x().writeStat(statBase) > 0);
if(!(player instanceof EntityPlayerMP)) return;
EntityPlayerMP playerMP = (EntityPlayerMP) player;
boolean acidizerStat = !GeneralConfig.enableStatReRegistering || (statCraft != null && playerMP.func_147099_x().writeStat(statCraft) > 0)|| (statPlace != null && playerMP.func_147099_x().writeStat(statPlace) > 0);
if(acidizerStat && ContaminationUtil.getRads(player) >= MobConfig.maskmanMinRad && (world.getHeightValue((int)player.posX, (int)player.posZ) > player.posY + 3 || !MobConfig.maskmanUnderground)) { //if the player has more than 50 RAD and is underground

View File

@ -38,7 +38,7 @@ public class ContainerDiFurnace extends Container {
if(index >= 0 && index < 3 && button == 1 && mode == 0) {
Slot slot = this.getSlot(index);
if(!slot.getHasStack()) {
if(!slot.getHasStack() && player.inventory.getItemStack() == null) {
if(!player.worldObj.isRemote) {
if(index == 0) diFurnace.sideUpper = (byte) ((diFurnace.sideUpper + 1) % 6);
if(index == 1) diFurnace.sideLower = (byte) ((diFurnace.sideLower + 1) % 6);

View File

@ -76,18 +76,21 @@ private TileEntityMachineAssembler assembler;
if (!this.mergeItemStack(var5, 0, 4, false))
return null;
if (var5.stackSize == 0)
{
if(var5.stackSize == 0) {
var4.putStack((ItemStack) null);
}
else
{
} else {
var4.onSlotChanged();
}
if(var5.stackSize == var3.stackSize) {
return null;
}
var4.onPickupFromSlot(p_82846_1_, var3);
}
return var3;
}
}
@Override
public boolean canInteractWith(EntityPlayer player) {

View File

@ -116,6 +116,7 @@ public class Fluids {
public static FluidType COLLOID;
public static FluidType PHOSGENE;
public static FluidType MUSTARDGAS;
public static FluidType IONGEL;
private static final HashMap<Integer, FluidType> idMapping = new HashMap();
private static final HashMap<String, FluidType> nameMapping = new HashMap();
@ -248,7 +249,8 @@ public class Fluids {
REFORMGAS = new FluidType("REFORMGAS", 0x6362AE, 1, 4, 1, EnumSymbol.NONE).addContainers(new CD_Gastank(0x9392FF, 0xFFB992)).addTraits(GASEOUS);
COLLOID = new FluidType("COLLOID", 0x787878, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
PHOSGENE = new FluidType("PHOSGENE", 0xCFC4A4, 4, 0, 1, EnumSymbol.NONE).addContainers(new CD_Gastank(0xCFC4A4, 0x361414)).addTraits(GASEOUS);
MUSTARDGAS = new FluidType(102, "MUSTARDGAS", 0xBAB572, 4, 1, 1, EnumSymbol.NONE).addContainers(new CD_Gastank(0xBAB572, 0x361414)).addTraits(GASEOUS);
MUSTARDGAS = new FluidType("MUSTARDGAS", 0xBAB572, 4, 1, 1, EnumSymbol.NONE).addContainers(new CD_Gastank(0xBAB572, 0x361414)).addTraits(GASEOUS);
IONGEL = new FluidType(103, "IONGEL", 0xB8FFFF, 1, 0, 4, EnumSymbol.NONE).addTraits(LIQUID);
// ^ ^ ^ ^ ^ ^ ^ ^
@ -339,6 +341,7 @@ public class Fluids {
metaOrder.add(SALIENT);
metaOrder.add(SEEDSLURRY);
metaOrder.add(COLLOID);
metaOrder.add(IONGEL);
metaOrder.add(ACID);
metaOrder.add(SULFURIC_ACID);
metaOrder.add(NITRIC_ACID);

View File

@ -257,7 +257,6 @@ public class AssemblerRecipes {
makeRecipe(new ComparableStack(ModItems.upgrade_overdrive_1, 1), new AStack[] {new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.upgrade_effect_3, 1), new OreDictStack(DESH.ingot(), 8), new ComparableStack(ModItems.powder_power, 16), new ComparableStack(ModItems.crystal_lithium, 4), new ComparableStack(ModItems.circuit_schrabidium, 1), }, 200);
makeRecipe(new ComparableStack(ModItems.upgrade_overdrive_2, 1), new AStack[] {new ComparableStack(ModItems.upgrade_overdrive_1, 1), new ComparableStack(ModItems.upgrade_afterburn_1, 1), new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.upgrade_effect_3, 1), new ComparableStack(ModItems.crystal_lithium, 8), new ComparableStack(ModItems.circuit_tantalium, 16), }, 300);
makeRecipe(new ComparableStack(ModItems.upgrade_overdrive_3, 1), new AStack[] {new ComparableStack(ModItems.upgrade_overdrive_2, 1), new ComparableStack(ModItems.upgrade_afterburn_1, 1), new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.upgrade_effect_3, 1), new ComparableStack(ModItems.crystal_lithium, 16), new OreDictStack(KEY_CIRCUIT_BISMUTH), }, 500);
makeRecipe(new ComparableStack(ModItems.fuse, 1), new AStack[] {new OreDictStack(STEEL.plate(), 2), new ComparableStack(Blocks.glass_pane, 1), new ComparableStack(ModItems.wire_aluminium, 1), },100);
makeRecipe(new ComparableStack(ModItems.redcoil_capacitor, 1), new AStack[] {new OreDictStack(GOLD.plate(), 3), new ComparableStack(ModItems.fuse, 1), new ComparableStack(ModItems.wire_advanced_alloy, 4), new ComparableStack(ModItems.coil_advanced_alloy, 6), new ComparableStack(Blocks.redstone_block, 2), },200);
makeRecipe(new ComparableStack(ModItems.titanium_filter, 1), new AStack[] {new OreDictStack(PB.plate(), 3), new ComparableStack(ModItems.fuse, 1), new ComparableStack(ModItems.wire_tungsten, 4), new OreDictStack(TI.plate(), 6), new OreDictStack(U238.ingot(), 2), },200);
makeRecipe(new ComparableStack(ModItems.part_lithium, 1), new AStack[] {new ComparableStack(ModItems.plate_polymer, 1), new OreDictStack(LI.dust(), 1), },50);

View File

@ -134,9 +134,10 @@ public class CrystallizerRecipes extends SerializableRecipe {
registerRecipe(CU.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.GREEN, 4), 20), woodOil);
registerRecipe(CO.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.BLUE, 4), 20), woodOil);
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE)), new CrystallizerRecipe(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX), 20), new FluidStack(Fluids.CHLORINE, 250));
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRACK)), new CrystallizerRecipe(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX), 20), new FluidStack(Fluids.CHLORINE, 100));
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE)), new CrystallizerRecipe(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX), 20), new FluidStack(Fluids.CHLORINE, 250));
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRACK)), new CrystallizerRecipe(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX), 20), new FluidStack(Fluids.CHLORINE, 100));
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX)), new CrystallizerRecipe(new ItemStack(ModItems.pellet_charged), 200), new FluidStack(Fluids.IONGEL, 500));
registerRecipe(KEY_SAND, new CrystallizerRecipe(Blocks.clay, 20), new FluidStack(Fluids.COLLOID, 1_000));
List<ItemStack> quartz = OreDictionary.getOres("crystalCertusQuartz");

View File

@ -36,6 +36,7 @@ public class MixerRecipes extends SerializableRecipe {
recipes.put(Fluids.COLLOID, new MixerRecipe(500, 20).setStack1(new FluidStack(Fluids.WATER, 500)).setSolid(new ComparableStack(ModItems.dust)));
recipes.put(Fluids.PHOSGENE, new MixerRecipe(1000, 20).setStack1(new FluidStack(Fluids.UNSATURATEDS, 500)).setStack2(new FluidStack(Fluids.CHLORINE, 500)));
recipes.put(Fluids.MUSTARDGAS, new MixerRecipe(1000, 20).setStack1(new FluidStack(Fluids.REFORMGAS, 750)).setStack2(new FluidStack(Fluids.CHLORINE, 250)).setSolid(new OreDictStack(S.dust())));
recipes.put(Fluids.IONGEL, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.WATER, 1000)).setStack2(new FluidStack(Fluids.HYDROGEN, 200)).setSolid(new ComparableStack(ModItems.pellet_charged)));
recipes.put(Fluids.SOLVENT, new MixerRecipe(1000, 50).setStack1(new FluidStack(Fluids.NAPHTHA, 500)).setStack2(new FluidStack(Fluids.AROMATICS, 500)));
recipes.put(Fluids.SULFURIC_ACID, new MixerRecipe(500, 50).setStack1(new FluidStack(Fluids.ACID, 800)).setSolid(new OreDictStack(S.dust())));

View File

@ -745,6 +745,7 @@ public class ClientProxy extends ServerProxy {
RenderingRegistry.registerBlockHandler(new RenderBlockDecoModel(ModBlocks.deco_computer.getRenderType(), ResourceManager.deco_computer));
RenderingRegistry.registerBlockHandler(new RenderReeds());
RenderingRegistry.registerBlockHandler(new RenderRTTY());
RenderingRegistry.registerBlockHandler(new RenderDiFurnaceExtension());
RenderingRegistry.registerBlockHandler(new RenderFoundryBasin());
RenderingRegistry.registerBlockHandler(new RenderFoundryMold());

View File

@ -261,6 +261,7 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModBlocks.conveyor_lift, 3), new Object[] { "IGI", "IGI", "ICI" , 'I', IRON.ingot(), 'G', ModBlocks.chain, 'C', ModBlocks.conveyor });
//addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_difurnace_off), 1), new Object[] { "T T", "PHP", "TFT", 'T', W.ingot(), 'P', ModItems.board_copper, 'H', Blocks.hopper, 'F', Blocks.furnace });
addRecipeAuto(new ItemStack(ModBlocks.machine_difurnace_extension, 1), new Object[] { " C ", "BGB", "BGB", 'C', CU.plate(), 'B', ModItems.ingot_firebrick, 'G', ModBlocks.steel_grate });
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_uf6_tank), 1), new Object[] { "WTW", "WTW", "SRS", 'S', IRON.plate(), 'W', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'W', ModItems.coil_tungsten,'R', MINGRADE.ingot() });
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_puf6_tank), 1), new Object[] { "WTW", "WTW", "SRS", 'S', STEEL.plate(), 'W', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'W', ModItems.coil_tungsten,'R', MINGRADE.ingot() });
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_nuke_furnace_off), 1), new Object[] { "SSS", "LFL", "CCC", 'S', STEEL.plate(), 'C', ModItems.board_copper, 'L', PB.plate(), 'F', Item.getItemFromBlock(Blocks.furnace) });
@ -277,10 +278,6 @@ public class CraftingManager {
addShapelessAuto(new ItemStack(ModBlocks.red_cable, 1), new Object[] { ModBlocks.red_cable_classic });
addRecipeAuto(new ItemStack(ModBlocks.red_connector, 4), new Object[] { "C", "I", "S", 'C', ModItems.coil_copper, 'I', ModItems.plate_polymer, 'S', STEEL.ingot() });
addRecipeAuto(new ItemStack(ModBlocks.red_pylon, 4), new Object[] { "CWC", "PWP", " T ", 'C', ModItems.coil_copper, 'W', KEY_PLANKS, 'P', ModItems.plate_polymer, 'T', ModBlocks.red_wire_coated });
/*addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.oil_duct_solid), 16), new Object[] { "SPS", "P P", "SPS", 'S', STEEL.ingot(), 'P', IRON.plate() });
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.oil_duct), 16), new Object[] { "SIS", " ", "SIS", 'S', STEEL.plate(), 'I', IRON.plate() });
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.gas_duct_solid), 16), new Object[] { "SPS", "P P", "SPS", 'S', STEEL.ingot(), 'P', CU.plate() });
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.gas_duct), 16), new Object[] { "SIS", " ", "SIS", 'S', STEEL.plate(), 'I', CU.plate() });*/
addRecipeAuto(new ItemStack(ModBlocks.machine_battery_potato, 1), new Object[] { "PCP", "WRW", "PCP", 'P', ItemBattery.getEmptyBattery(ModItems.battery_potato), 'C', CU.ingot(), 'R', REDSTONE.block(), 'W', KEY_PLANKS });
addRecipeAuto(new ItemStack(ModBlocks.machine_coal_off, 1), new Object[] { "STS", "SCS", "SFS", 'S', STEEL.ingot(), 'T', ModItems.tank_steel, 'C', MINGRADE.ingot(), 'F', Blocks.furnace });
addRecipeAuto(new ItemStack(ModBlocks.machine_boiler_off, 1), new Object[] { "SPS", "TFT", "SPS", 'S', STEEL.ingot(), 'P', ModItems.board_copper, 'T', ModItems.tank_steel, 'F', Blocks.furnace });
@ -331,6 +328,7 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModItems.black_hole, 1), new Object[] { "SSS", "SCS", "SSS", 'C', ModItems.singularity, 'S', ModItems.crystal_xen });
addRecipeAuto(new ItemStack(ModItems.crystal_xen, 1), new Object[] { "EEE", "EIE", "EEE", 'E', ModItems.powder_power, 'I', EUPH.ingot() });
addShapelessAuto(new ItemStack(ModItems.fuse, 1), new Object[] { STEEL.plate(), ModItems.plate_polymer, ModItems.wire_tungsten });
addShapelessAuto(new ItemStack(ModItems.overfuse, 1), new Object[] { ModItems.bolt_tungsten, NP237.dust(), I.dust(), TH232.dust(), AT.dust(), ND.dust(), ModItems.board_copper, ModItems.black_hole, CS.dust() });
addShapelessAuto(new ItemStack(ModItems.overfuse, 1), new Object[] { ModItems.bolt_tungsten, ST.dust(), BR.dust(), CO.dust(), TS.dust(), NB.dust(), ModItems.board_copper, ModItems.black_hole, CE.dust() });

View File

@ -1292,6 +1292,7 @@ public class ResourceManager {
public static final IModelCustom crystal_trixite = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/crystals_trixite.obj"));
public static final IModelCustom cable_neo = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/cable_neo.obj"));
public static final IModelCustom pipe_neo = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/pipe_neo.obj"));
public static final IModelCustom difurnace_extension = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/difurnace_extension.obj"));
public static final IModelCustom charge_dynamite = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/charge_dynamite.obj"));
public static final IModelCustom charge_c4 = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/charge_c4.obj"));

View File

@ -0,0 +1,64 @@
package com.hbm.render.block;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.MachineDiFurnaceExtension;
import com.hbm.main.ResourceManager;
import com.hbm.render.util.ObjUtil;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.model.obj.WavefrontObject;
public class RenderDiFurnaceExtension implements ISimpleBlockRenderingHandler {
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
GL11.glPushMatrix();
Tessellator tessellator = Tessellator.instance;
tessellator.setColorOpaque_F(1, 1, 1);
GL11.glTranslatef(0F, -0.5F, 0F);
tessellator.startDrawingQuads();
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.difurnace_extension, "Top", ModBlocks.machine_difurnace_extension.getIcon(1, 0), tessellator, 0, false);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.difurnace_extension, "Bottom", ModBlocks.machine_difurnace_extension.getIcon(0, 0), tessellator, 0, false);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.difurnace_extension, "Side", ModBlocks.machine_difurnace_extension.getIcon(3, 0), tessellator, 0, false);
tessellator.draw();
GL11.glPopMatrix();
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
Tessellator tessellator = Tessellator.instance;
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addTranslation(x + 0.5F, y, z + 0.5F);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.difurnace_extension, "Top", ModBlocks.machine_difurnace_extension.getIcon(1, 0), tessellator, 0, true);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.difurnace_extension, "Bottom", ModBlocks.machine_difurnace_extension.getIcon(0, 0), tessellator, 0, true);
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.difurnace_extension, "Side", ModBlocks.machine_difurnace_extension.getIcon(3, 0), tessellator, 0, true);
tessellator.addTranslation(-x - 0.5F, -y, -z - 0.5F);
return true;
}
@Override
public boolean shouldRender3DInInventory(int modelId) {
return true;
}
@Override
public int getRenderId() {
return MachineDiFurnaceExtension.renderID;
}
}

View File

@ -29,7 +29,13 @@ public class RenderChemical extends Render {
EntityChemical chem = (EntityChemical) entity;
ChemicalStyle style = chem.getStyle();
if(style == ChemicalStyle.AMAT)
if(chem.lastClientPosX == -1 && chem.lastClientPosY == -1 && chem.lastClientPosZ == -1) {
chem.lastClientPosX = chem.posX - chem.motionX;
chem.lastClientPosY = chem.posY - chem.motionY;
chem.lastClientPosZ = chem.posZ - chem.motionZ;
}
if(style == ChemicalStyle.AMAT || style == ChemicalStyle.LIGHTNING)
renderAmatBeam(chem, f1);
if(style == ChemicalStyle.GAS) {
@ -41,6 +47,10 @@ public class RenderChemical extends Render {
this.bindEntityTexture(chem);
renderGasFire(chem, f1);
}
chem.lastClientPosX = chem.prevPosX + (chem.posX - chem.prevPosX) * f1;
chem.lastClientPosY = chem.prevPosX + (chem.posY - chem.prevPosY) * f1;
chem.lastClientPosZ = chem.prevPosX + (chem.posZ - chem.prevPosZ) * f1;
GL11.glPopMatrix();
}
@ -125,6 +135,10 @@ public class RenderChemical extends Render {
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glDepthMask(false);
/*double x0 = chem.prevPosX + (chem.posX - chem.prevPosX) * interp;
double y0 = chem.prevPosX + (chem.posY - chem.prevPosY) * interp;
double z0 = chem.prevPosX + (chem.posZ - chem.prevPosZ) * interp;*/
double length = Vec3.createVectorHelper(chem.motionX, chem.motionY, chem.motionZ).lengthVector() * (chem.ticksExisted + interp) * 0.75;
double size = 0.0625;
float o = 0.2F;

View File

@ -1,14 +1,14 @@
package com.hbm.tileentity.machine;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.MachineDiFurnace;
import com.hbm.inventory.container.ContainerDiFurnace;
import com.hbm.inventory.gui.GUIDiFurnace;
import com.hbm.inventory.recipes.BlastFurnaceRecipes;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemRTGPellet;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.INBTPacketReceiver;
import com.hbm.util.RTGUtil;
import com.hbm.tileentity.TileEntityMachineBase;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -17,21 +17,16 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class TileEntityDiFurnace extends TileEntity implements ISidedInventory, INBTPacketReceiver, IGUIProvider {
public class TileEntityDiFurnace extends TileEntityMachineBase implements IGUIProvider {
private ItemStack slots[];
public int dualCookTime;
public int dualPower;
public static final int maxPower = 12800;
public int progress;
public int fuel;
public static final int maxFuel = 12800;
public static final int processingSpeed = 400;
private static final int[] slots_io = new int[] { 0, 1, 2, 3 };
@ -39,100 +34,34 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory,
public byte sideUpper = 1;
public byte sideLower = 1;
private String customName;
public TileEntityDiFurnace() {
slots = new ItemStack[4];
super(4);
}
@Override
public int getSizeInventory() {
return slots.length;
public String getName() {
return "container.diFurnace";
}
@Override
public ItemStack getStackInSlot(int i) {
return slots[i];
public boolean isItemValidForSlot(int i, ItemStack stack) {
return i != 3;
}
@Override
public ItemStack getStackInSlotOnClosing(int i) {
if(slots[i] != null) {
ItemStack itemStack = slots[i];
slots[i] = null;
return itemStack;
} else {
return null;
}
}
@Override
public void setInventorySlotContents(int i, ItemStack itemStack) {
slots[i] = itemStack;
if(itemStack != null && itemStack.stackSize > getInventoryStackLimit()) {
itemStack.stackSize = getInventoryStackLimit();
}
}
@Override
public String getInventoryName() {
return this.hasCustomInventoryName() ? this.customName : "container.diFurnace";
}
@Override
public boolean hasCustomInventoryName() {
return this.customName != null && this.customName.length() > 0;
}
public void setCustomName(String name) {
this.customName = name;
}
@Override
public int getInventoryStackLimit() {
return 64;
}
@Override
public boolean isUseableByPlayer(EntityPlayer player) {
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) {
return false;
} else {
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64;
}
}
// You scrubs aren't needed for anything (right now)
@Override
public void openInventory() {
}
@Override
public void closeInventory() {
}
@Override
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
if(i == 3) {
return false;
}
return true;
}
public boolean hasItemPower(ItemStack itemStack) {
return getItemPower(itemStack) > 0;
public boolean hasItemPower(ItemStack stack) {
return getItemPower(stack) > 0;
}
//TODO: replace this terribleness
private static int getItemPower(ItemStack itemStack) {
if(itemStack == null) {
private static int getItemPower(ItemStack stack) {
if(stack == null) {
return 0;
} else {
Item item = itemStack.getItem();
Item item = stack.getItem();
if(item == Items.coal) return 200;
if(item == Item.getItemFromBlock(Blocks.coal_block)) return 2000;
if(item == Item.getItemFromBlock(ModBlocks.block_coke)) return 4000;
if(item == Items.lava_bucket) return 12800;
if(item == Items.blaze_rod) return 1000;
if(item == Items.blaze_powder) return 300;
@ -147,41 +76,12 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory,
}
}
@Override
public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null) {
if(slots[i].stackSize <= j) {
ItemStack itemStack = slots[i];
slots[i] = null;
return itemStack;
}
ItemStack itemStack1 = slots[i].splitStack(j);
if(slots[i].stackSize == 0) {
slots[i] = null;
}
return itemStack1;
} else {
return null;
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10);
this.dualPower = nbt.getInteger("powerTime");
this.dualCookTime = nbt.getShort("cookTime");
slots = new ItemStack[getSizeInventory()];
for(int i = 0; i < list.tagCount(); i++) {
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length) {
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
this.fuel = nbt.getInteger("powerTime");
this.progress = nbt.getShort("cookTime");
byte[] modes = nbt.getByteArray("modes");
this.sideFuel = modes[0];
@ -192,20 +92,8 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory,
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setInteger("powerTime", dualPower);
nbt.setShort("cookTime", (short) dualCookTime);
NBTTagList list = new NBTTagList();
for(int i = 0; i < slots.length; i++) {
if(slots[i] != null) {
NBTTagCompound nbt1 = new NBTTagCompound();
nbt1.setByte("slot", (byte) i);
slots[i].writeToNBT(nbt1);
list.appendTag(nbt1);
}
}
nbt.setTag("items", list);
nbt.setInteger("powerTime", fuel);
nbt.setShort("cookTime", (short) progress);
nbt.setByteArray("modes", new byte[] {(byte) sideFuel, (byte) sideUpper, (byte) sideLower});
}
@ -231,17 +119,22 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory,
}
public int getDiFurnaceProgressScaled(int i) {
return (dualCookTime * i) / processingSpeed;
return (progress * i) / processingSpeed;
}
public int getPowerRemainingScaled(int i) {
return (dualPower * i) / maxPower;
return (fuel * i) / maxFuel;
}
public boolean canProcess() {
if(slots[0] == null || slots[1] == null) {
return false;
}
if(!this.hasPower()) {
return false;
}
ItemStack itemStack = BlastFurnaceRecipes.getOutput(slots[0], slots[1]);
if(itemStack == null) {
return false;
@ -263,34 +156,25 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory,
}
private void processItem() {
if(canProcess()) {
ItemStack itemStack = BlastFurnaceRecipes.getOutput(slots[0], slots[1]);
ItemStack itemStack = BlastFurnaceRecipes.getOutput(slots[0], slots[1]);
if(slots[3] == null) {
slots[3] = itemStack.copy();
} else if(slots[3].isItemEqual(itemStack)) {
slots[3].stackSize += itemStack.stackSize;
}
if(slots[3] == null) {
slots[3] = itemStack.copy();
} else if(slots[3].isItemEqual(itemStack)) {
slots[3].stackSize += itemStack.stackSize;
}
for(int i = 0; i < 2; i++) {
if(slots[i].stackSize <= 0) {
slots[i] = new ItemStack(slots[i].getItem().setFull3D());
} else {
slots[i].stackSize--;
}
if(slots[i].stackSize <= 0) {
slots[i] = null;
}
}
for(int i = 0; i < 2; i++) {
this.decrStackSize(i, 1);
}
}
public boolean hasPower() {
return dualPower > 0;
return fuel > 0;
}
public boolean isProcessing() {
return this.dualCookTime > 0;
return this.progress > 0;
}
@Override
@ -298,19 +182,12 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory,
if(!worldObj.isRemote) {
boolean flag1 = false;
if(hasPower() && isProcessing()) {
this.dualPower = this.dualPower - 1;
if(this.dualPower < 0) {
this.dualPower = 0;
}
}
if(this.hasItemPower(this.slots[2]) && this.dualPower <= (TileEntityDiFurnace.maxPower - TileEntityDiFurnace.getItemPower(this.slots[2]))) {
this.dualPower += getItemPower(this.slots[2]);
boolean markDirty = false;
if(this.hasItemPower(this.slots[2]) && this.fuel <= (TileEntityDiFurnace.maxFuel - TileEntityDiFurnace.getItemPower(this.slots[2]))) {
this.fuel += getItemPower(this.slots[2]);
if(this.slots[2] != null) {
flag1 = true;
markDirty = true;
this.slots[2].stackSize--;
if(this.slots[2].stackSize == 0) {
this.slots[2] = this.slots[2].getItem().getContainerItem(this.slots[2]);
@ -318,41 +195,45 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory,
}
}
if(hasPower() && canProcess()) {
dualCookTime++;
if(canProcess()) {
boolean extension = worldObj.getBlock(xCoord, yCoord + 1, zCoord) == ModBlocks.machine_difurnace_extension;
if(this.dualCookTime == TileEntityDiFurnace.processingSpeed) {
this.dualCookTime = 0;
//fuel -= extension ? 2 : 1;
fuel -= 1; //switch it up on me, fuel efficiency, on fumes i'm running - running - running - running
progress += extension ? 3 : 1;
if(this.progress >= TileEntityDiFurnace.processingSpeed) {
this.progress = 0;
this.processItem();
flag1 = true;
markDirty = true;
}
if(fuel < 0) {
fuel = 0;
}
} else {
dualCookTime = 0;
progress = 0;
}
boolean trigger = true;
if(hasPower() && canProcess() && this.dualCookTime == 0) {
if(canProcess() && this.progress == 0) {
trigger = false;
}
if(this.slots[2] != null && (this.slots[2].getItem() instanceof ItemRTGPellet)) {
this.dualPower += RTGUtil.updateRTGs(slots, new int[] { 2 });
if(this.dualPower > maxPower)
this.dualPower = maxPower;
}
if(trigger) {
flag1 = true;
MachineDiFurnace.updateBlockState(this.dualCookTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
markDirty = true;
MachineDiFurnace.updateBlockState(this.progress > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
}
NBTTagCompound data = new NBTTagCompound();
data.setShort("time", (short) this.dualCookTime);
data.setShort("fuel", (short) this.dualPower);
data.setShort("time", (short) this.progress);
data.setShort("fuel", (short) this.fuel);
data.setByteArray("modes", new byte[] { (byte) sideFuel, (byte) sideUpper, (byte) sideLower });
INBTPacketReceiver.networkPack(this, data, 15);
if(flag1) {
if(markDirty) {
this.markDirty();
}
}
@ -360,8 +241,8 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory,
@Override
public void networkUnpack(NBTTagCompound nbt) {
this.dualCookTime = nbt.getShort("time");
this.dualPower = nbt.getShort("fuel");
this.progress = nbt.getShort("time");
this.fuel = nbt.getShort("fuel");
byte[] modes = nbt.getByteArray("modes");
this.sideFuel = modes[0];
this.sideUpper = modes[1];

View File

@ -16,6 +16,9 @@ import net.minecraft.util.ChatComponentTranslation;
public class StatHelper {
/*
* God is dead and we are pissing on his grave
*/
public static Map publicReferenceToOneshotStatListPleaseAllPointAndLaugh;
/**
@ -25,15 +28,15 @@ public class StatHelper {
* The problem in that? Item remapping. Modded items probably don't even exist at that point and even if they did,
* the system would break because modded items have dynamic IDs and the stats register fixed IDs instead of item instances.
* What did forge do to solve this issue? Well nothing, of course! The injected bits comment on that in vanilla's stat
* registering code, but instead of fixing anything it jsut slaps a fat "TODO" onto it. Wow! Really helpful!
* registering code, but instead of fixing anything it just slaps a fat "TODO" onto it. Wow! Really helpful!
*
* So what do we do? Every time the world starts and we know the IDs are now correct, we smack that fucker up nice and good.
* All ID-bound stats get deep-cleaned out of this mess and registered 1:1 again. Is this terrible and prine to breaking with
* All ID-bound stats get deep-cleaned out of this mess and registered 1:1 again. Is this terrible and prone to breaking with
* mods that do their own stat handling? Hard to say, but the possibility is there.
*/
public static void resetStatShitFuck() {
publicReferenceToOneshotStatListPleaseAllPointAndLaugh = ReflectionHelper.getPrivateValue(StatList.class, null, "oneShotStats");
publicReferenceToOneshotStatListPleaseAllPointAndLaugh = ReflectionHelper.getPrivateValue(StatList.class, null, "oneShotStats"); //TODO: not fuck up the mapping here
for(int i = 0; i < StatList.objectCraftStats.length; i++) StatList.objectCraftStats[i] = null;
for(int i = 0; i < StatList.mineBlockStatArray.length; i++) StatList.mineBlockStatArray[i] = null;
@ -48,6 +51,13 @@ public class StatHelper {
initItemBreakStats();
}
/**
* For reasons beyond human comprehension, this bit originally only registered items that are the result
* of an IRecipe instead of just all items outright like the item usage stats. The logical consequence of this is:
* 1) The code has to iterate over thousands of recipes to get recipe results which is no more performant than just going over
* 32k potential items, most of which are going to be null anyway
* 2) The system just will never work with items that don't have crafting table recipes
*/
private static void initCraftItemStats() {
/*HashSet hashset = new HashSet();
Iterator iterator = CraftingManager.getInstance().getRecipeList().iterator();

View File

@ -627,6 +627,7 @@ hbmfluid.hotcrackoil=Heißes Crack-Öl
hbmfluid.hotoil=Heißes Rohöl
hbmfluid.hotsteam=Dichter Dampf
hbmfluid.hydrogen=Flüssiger Wasserstoff
hbmfluid.iongel=Ionengel
hbmfluid.kerosene=Kerosin
hbmfluid.kerosene_reform=Düsentreibstoff
hbmfluid.lava=Lava
@ -3840,6 +3841,7 @@ tile.machine_detector.name=Energiedetektor
tile.machine_deuterium_extractor.name=Deuteriumextraktor
tile.machine_deuterium_tower.name=Deuteriumextraktionsturm
tile.machine_diesel.name=Dieselgenerator
tile.machine_difurnace_extension.name=Hochofenerweiterung
tile.machine_difurnace_off.name=Hochofen
tile.machine_difurnace_on.name=Hochofen
tile.machine_difurnace_rtg_off.name=Atomarer Hochofen

View File

@ -1196,6 +1196,7 @@ hbmfluid.hotcrackoil=Hot Cracked Oil
hbmfluid.hotoil=Hot Crude Oil
hbmfluid.hotsteam=Dense Steam
hbmfluid.hydrogen=Liquid Hydrogen
hbmfluid.iongel=Ionic Gel
hbmfluid.kerosene=Kerosene
hbmfluid.kerosene_reform=Jet Fuel
hbmfluid.lava=Lava
@ -4652,6 +4653,7 @@ tile.machine_detector.name=Power Detector
tile.machine_deuterium_extractor.name=Deuterium Extractor
tile.machine_deuterium_tower.name=Deuterium Extraction Tower
tile.machine_diesel.name=Diesel Generator
tile.machine_difurnace_extension.name=Blast Furnace Extension
tile.machine_difurnace_off.name=Blast Furnace
tile.machine_difurnace_on.name=Blast Furnace
tile.machine_difurnace_rtg_off.name=Nuclear Blast Furnace

View File

@ -0,0 +1,90 @@
# Blender v2.79 (sub 0) OBJ File: 'difurnace_extension.blend'
# www.blender.org
o Top
v -0.250000 1.000000 0.250000
v -0.250000 1.000000 -0.250000
v 0.250000 1.000000 -0.250000
v 0.250000 1.000000 0.250000
vt 0.749950 0.749950
vt 0.250050 0.250050
vt 0.749950 0.250050
vt 0.250050 0.749950
vn 0.0000 1.0000 0.0000
s off
f 2/1/1 4/2/1 3/3/1
f 2/1/1 1/4/1 4/2/1
o Bottom
v -0.500000 0.000000 0.500000
v -0.500000 0.000000 -0.500000
v 0.500000 0.000000 0.500000
v 0.500000 0.000000 -0.500000
vt 0.999900 0.999900
vt 0.000100 0.000100
vt 0.999900 0.000100
vt 0.000100 0.999900
vn 0.0000 -1.0000 0.0000
s off
f 8/5/2 5/6/2 6/7/2
f 8/5/2 7/8/2 5/6/2
o Side
v -0.500000 0.000000 0.500000
v -0.250000 0.750000 0.250000
v -0.500000 0.000000 -0.500000
v -0.250000 0.750000 -0.250000
v 0.500000 0.000000 0.500000
v 0.250000 0.750000 0.250000
v 0.500000 0.000000 -0.500000
v 0.250000 0.750000 -0.250000
v -0.250000 1.000000 0.250000
v -0.250000 1.000000 -0.250000
v 0.250000 1.000000 -0.250000
v 0.250000 1.000000 0.250000
vt 0.750000 0.750000
vt 0.000000 0.000000
vt 1.000000 -0.000000
vt 0.750000 0.750000
vt 0.000000 0.000000
vt 1.000000 -0.000000
vt 0.750000 0.750000
vt 0.000000 0.000000
vt 1.000000 -0.000000
vt 0.750000 0.750000
vt 0.000000 0.000000
vt 1.000000 -0.000000
vt 0.250000 1.000000
vt 0.250000 0.750000
vt 0.250000 1.000000
vt 0.250000 0.750000
vt 0.250000 1.000000
vt 0.250000 0.750000
vt 0.250000 1.000000
vt 0.250000 0.750000
vt 0.750000 1.000000
vt 0.750000 1.000000
vt 0.750000 1.000000
vt 0.750000 1.000000
vn -0.9487 0.3162 0.0000
vn 0.0000 0.3162 -0.9487
vn 0.9487 0.3162 0.0000
vn 0.0000 0.3162 0.9487
vn 1.0000 0.0000 0.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 0.0000 -1.0000
s off
f 10/9/3 11/10/3 9/11/3
f 12/12/4 15/13/4 11/14/4
f 16/15/5 13/16/5 15/17/5
f 14/18/6 9/19/6 13/20/6
f 16/15/7 20/21/7 14/22/7
f 10/9/8 18/23/8 12/24/8
f 14/18/9 17/25/9 10/26/9
f 12/12/10 19/27/10 16/28/10
f 10/9/3 12/24/3 11/10/3
f 12/12/4 16/28/4 15/13/4
f 16/15/5 14/22/5 13/16/5
f 14/18/6 10/26/6 9/19/6
f 16/15/7 19/29/7 20/21/7
f 10/9/8 17/30/8 18/23/8
f 14/18/9 20/31/9 17/25/9
f 12/12/10 18/32/10 19/27/10

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B