shit i really want in my survival world
13
changelog
@ -11,6 +11,17 @@
|
||||
* I don't know how this would ever be useful but I was stuck in a phonecall at work for two consecutive hours and didn't have anything else to do
|
||||
* They should invent handsets that don't hurt when you hold them onto your head for too long
|
||||
* Has no NEI handler because the call ended before I got to that
|
||||
* Bricked furnace
|
||||
* An earlygame machine made from smooth stone and bricks
|
||||
* Largely identical to vanilla furnaces
|
||||
* Like the wood burner, it will collect ashes from burnt fuel
|
||||
* Certain recipes are sped up, sand and cobblestone are smelted at twice the speed while (fire) clay is smelted at quadruple speed
|
||||
* This means that making a clay brick block now takes as much time using a bricked furnace as one single furnace operation in a vanilla furnace
|
||||
* I *really* like bricks and I don't feel like waiting until I can get an arc furnace to mass produce them at a sensible pace
|
||||
* Dwarven pickaxe
|
||||
* Earlygame tool made from iron and copper
|
||||
* Has the harvest level of iron, a durability of just 250 but the AoE ability
|
||||
* Great for getting cobblestone quickly or making tunnels when you don't have desh or electric tools yet
|
||||
|
||||
## Changed
|
||||
* Large turbines, levis and geothermal heat exchangers now have their own sounds when operating
|
||||
@ -28,9 +39,11 @@
|
||||
* Rebalanced all the food items so their saturation values aren't ridiculously high (turns out - the number represents a *multiplier* for the hunger value and not a flat number)
|
||||
* Dirt MREs are now just regular low-quality MREs made from latex packaging and some easily obtainable earlygame ingredients - wheat, rotten flesh and saplings (makes 4)
|
||||
* The recipe for the chemical plant has been slightly simplified (again)
|
||||
* Iron furnaces now have a 20% faster base smelting speed, making them complete operations in 8 seconds instead of 10 without upgrades
|
||||
|
||||
## Fixed
|
||||
* Fixed basalt ores dropping their items with invalid metadata
|
||||
* Fixed creative infinite fluid tanks not being able to fill fluid gauges at >0PU
|
||||
* Fixed an issue where repeatedly opening and closing certain doors would cause their sound loop to get stuck running forever
|
||||
* Fixed radar screens behaving weirdly when out of then intended range. The max interaction range for radars is now infinite, and radars will send a second information packet to players near connected radars
|
||||
* Fixed very rare bug where waiting for wood ash to build up in the wood burner and then clearing the slot will remove twice as much ash on the internal counter for the initial ash item created
|
||||
|
||||
@ -152,10 +152,6 @@ public class ModBlocks {
|
||||
|
||||
public static Block basalt;
|
||||
public static Block ore_basalt;
|
||||
@Deprecated public static Block basalt_sulfur;
|
||||
@Deprecated public static Block basalt_fluorite;
|
||||
@Deprecated public static Block basalt_asbestos;
|
||||
@Deprecated public static Block basalt_gem;
|
||||
public static Block basalt_smooth;
|
||||
public static Block basalt_brick;
|
||||
public static Block basalt_polished;
|
||||
@ -713,10 +709,11 @@ public class ModBlocks {
|
||||
public static Block machine_puf6_tank;
|
||||
|
||||
public static Block machine_reactor_breeding;
|
||||
|
||||
|
||||
public static Block machine_furnace_brick_off;
|
||||
public static Block machine_furnace_brick_on;
|
||||
public static Block machine_nuke_furnace_off;
|
||||
public static Block machine_nuke_furnace_on;
|
||||
|
||||
public static Block machine_rtg_furnace_off;
|
||||
public static Block machine_rtg_furnace_on;
|
||||
|
||||
@ -1378,10 +1375,6 @@ public class ModBlocks {
|
||||
|
||||
basalt = new BlockGeneric(Material.rock).setBlockName("basalt").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt");
|
||||
ore_basalt = new BlockOreBasalt().setBlockName("ore_basalt").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_basalt");
|
||||
basalt_sulfur = new BlockRemap(ore_basalt, 0).setBlockName("basalt_sulfur");
|
||||
basalt_fluorite = new BlockRemap(ore_basalt, 1).setBlockName("basalt_fluorite");
|
||||
basalt_asbestos = new BlockRemap(ore_basalt, 2).setBlockName("basalt_asbestos");
|
||||
basalt_gem = new BlockRemap(ore_basalt, 3).setBlockName("basalt_gem");
|
||||
basalt_smooth = new BlockGeneric(Material.rock).setBlockName("basalt_smooth").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_smooth");
|
||||
basalt_brick = new BlockGeneric(Material.rock).setBlockName("basalt_brick").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_brick");
|
||||
basalt_polished = new BlockGeneric(Material.rock).setBlockName("basalt_polished").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_polished");
|
||||
@ -1864,10 +1857,11 @@ public class ModBlocks {
|
||||
machine_puf6_tank = new MachinePuF6Tank(Material.iron).setBlockName("machine_puf6_tank").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
|
||||
machine_reactor_breeding = new MachineReactorBreeding(Material.iron).setBlockName("machine_reactor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_reactor");
|
||||
|
||||
|
||||
machine_furnace_brick_off = new MachineBrickFurnace(false).setBlockName("machine_furnace_brick_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_furnace_brick_on = new MachineBrickFurnace(true).setBlockName("machine_furnace_brick_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
machine_nuke_furnace_off = new MachineNukeFurnace(false).setBlockName("machine_nuke_furnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_nuke_furnace_on = new MachineNukeFurnace(true).setBlockName("machine_nuke_furnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
|
||||
machine_rtg_furnace_off = new MachineRtgFurnace(false).setBlockName("machine_rtg_furnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_rtg_furnace_on = new MachineRtgFurnace(true).setBlockName("machine_rtg_furnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
|
||||
@ -2549,10 +2543,6 @@ public class ModBlocks {
|
||||
|
||||
//Basalt ores
|
||||
register(ore_basalt);
|
||||
GameRegistry.registerBlock(basalt_sulfur, basalt_sulfur.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(basalt_fluorite, basalt_fluorite.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(basalt_asbestos, basalt_asbestos.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(basalt_gem, ItemBlockBase.class, basalt_gem.getUnlocalizedName());
|
||||
|
||||
//End Ores
|
||||
GameRegistry.registerBlock(ore_tikite, ore_tikite.getUnlocalizedName());
|
||||
@ -3136,6 +3126,8 @@ public class ModBlocks {
|
||||
register(foundry_outlet);
|
||||
register(foundry_slagtap);
|
||||
register(slag);
|
||||
register(machine_furnace_brick_off);
|
||||
register(machine_furnace_brick_on);
|
||||
register(machine_difurnace_off);
|
||||
register(machine_difurnace_on);
|
||||
register(machine_difurnace_extension);
|
||||
|
||||
@ -62,7 +62,6 @@ public class BlockCluster extends Block implements IDrillInteraction, ITooltipPr
|
||||
if(this == ModBlocks.cluster_titanium) return ModItems.crystal_titanium;
|
||||
if(this == ModBlocks.cluster_aluminium) return ModItems.crystal_aluminium;
|
||||
if(this == ModBlocks.cluster_copper) return ModItems.crystal_copper;
|
||||
if(this == ModBlocks.basalt_gem) return ModItems.gem_volcanic;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -5,7 +5,6 @@ import java.util.List;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.items.special.ItemDoorSkin;
|
||||
import com.hbm.items.tool.ItemLock;
|
||||
import com.hbm.tileentity.DoorDecl;
|
||||
import com.hbm.tileentity.TileEntityDoorGeneric;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
@ -44,13 +44,13 @@ public class BlockOre extends Block {
|
||||
@Spaghetti("*throws up*")
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random rand, int j) {
|
||||
if(this == ModBlocks.ore_fluorite || this == ModBlocks.basalt_fluorite) {
|
||||
if(this == ModBlocks.ore_fluorite) {
|
||||
return ModItems.fluorite;
|
||||
}
|
||||
if(this == ModBlocks.ore_niter) {
|
||||
return ModItems.niter;
|
||||
}
|
||||
if(this == ModBlocks.ore_sulfur || this == ModBlocks.ore_nether_sulfur || this == ModBlocks.ore_meteor_sulfur || this == ModBlocks.basalt_sulfur) {
|
||||
if(this == ModBlocks.ore_sulfur || this == ModBlocks.ore_nether_sulfur || this == ModBlocks.ore_meteor_sulfur) {
|
||||
return ModItems.sulfur;
|
||||
}
|
||||
if(this == ModBlocks.waste_trinitite || this == ModBlocks.waste_trinitite_red) {
|
||||
@ -178,7 +178,7 @@ public class BlockOre extends Block {
|
||||
if(this == ModBlocks.deco_asbestos) {
|
||||
return ModItems.ingot_asbestos;
|
||||
}
|
||||
if(this == ModBlocks.ore_asbestos || this == ModBlocks.ore_gneiss_asbestos || this == ModBlocks.basalt_asbestos) {
|
||||
if(this == ModBlocks.ore_asbestos || this == ModBlocks.ore_gneiss_asbestos) {
|
||||
return ModItems.ingot_asbestos;
|
||||
}
|
||||
if(this == ModBlocks.ore_lignite) {
|
||||
@ -202,13 +202,13 @@ public class BlockOre extends Block {
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random rand) {
|
||||
if(this == ModBlocks.ore_fluorite || this == ModBlocks.basalt_fluorite) {
|
||||
if(this == ModBlocks.ore_fluorite) {
|
||||
return 2 + rand.nextInt(3);
|
||||
}
|
||||
if(this == ModBlocks.ore_niter) {
|
||||
return 2 + rand.nextInt(3);
|
||||
}
|
||||
if(this == ModBlocks.ore_sulfur || this == ModBlocks.ore_nether_sulfur || this == ModBlocks.ore_meteor_sulfur || this == ModBlocks.basalt_sulfur) {
|
||||
if(this == ModBlocks.ore_sulfur || this == ModBlocks.ore_nether_sulfur || this == ModBlocks.ore_meteor_sulfur) {
|
||||
return 2 + rand.nextInt(3);
|
||||
}
|
||||
if(this == ModBlocks.block_meteor_broken) {
|
||||
|
||||
@ -57,8 +57,7 @@ public class BlockOutgas extends BlockOre {
|
||||
if(this == ModBlocks.ore_asbestos || this == ModBlocks.ore_gneiss_asbestos ||
|
||||
this == ModBlocks.block_asbestos || this == ModBlocks.deco_asbestos ||
|
||||
this == ModBlocks.brick_asbestos || this == ModBlocks.tile_lab ||
|
||||
this == ModBlocks.tile_lab_cracked || this == ModBlocks.tile_lab_broken ||
|
||||
this == ModBlocks.basalt_asbestos) {
|
||||
this == ModBlocks.tile_lab_cracked || this == ModBlocks.tile_lab_broken) {
|
||||
return ModBlocks.gas_asbestos;
|
||||
}
|
||||
|
||||
|
||||
172
src/main/java/com/hbm/blocks/machine/MachineBrickFurnace.java
Normal file
@ -0,0 +1,172 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityFurnaceBrick;
|
||||
import com.hbm.util.ItemStackUtil;
|
||||
|
||||
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.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MachineBrickFurnace extends BlockContainer {
|
||||
|
||||
private final Random rand = new Random();
|
||||
private final boolean isActive;
|
||||
private static boolean keepInventory;
|
||||
|
||||
@SideOnly(Side.CLIENT) private IIcon iconTop;
|
||||
@SideOnly(Side.CLIENT) private IIcon iconBottom;
|
||||
@SideOnly(Side.CLIENT) private IIcon iconFront;
|
||||
|
||||
public MachineBrickFurnace(boolean blockState) {
|
||||
super(Material.iron);
|
||||
isActive = blockState;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":machine_furnace_brick_top");
|
||||
this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + ":machine_furnace_brick_bottom");
|
||||
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":machine_furnace_brick_front_on" : ":machine_furnace_brick_front_off"));
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_furnace_brick_side");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : (side == 1 ? this.iconTop : (side == 0 ? this.iconBottom : this.blockIcon)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityFurnaceBrick();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, int x, int y, int z) {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_furnace_brick_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 nZ = world.getBlock(x, y, z - 1);
|
||||
Block pZ = world.getBlock(x, y, z + 1);
|
||||
Block nX = world.getBlock(x - 1, y, z);
|
||||
Block pX = world.getBlock(x + 1, y, z);
|
||||
|
||||
byte meta = 3;
|
||||
|
||||
if(nZ.func_149730_j() && !pZ.func_149730_j()) meta = 3;
|
||||
if(pZ.func_149730_j() && !nZ.func_149730_j()) meta = 2;
|
||||
if(nX.func_149730_j() && !pX.func_149730_j()) meta = 5;
|
||||
if(pX.func_149730_j() && !nX.func_149730_j()) meta = 4;
|
||||
|
||||
world.setBlockMetadataWithNotify(x, y, z, meta, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@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(itemStack.hasDisplayName()) ((TileEntityFurnaceBrick)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) {
|
||||
return true;
|
||||
} else if(!player.isSneaking()) {
|
||||
TileEntityFurnaceBrick entity = (TileEntityFurnaceBrick) world.getTileEntity(x, y, z);
|
||||
if(entity != null) {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
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_furnace_brick_on);
|
||||
} else {
|
||||
world.setBlock(x, y, z, ModBlocks.machine_furnace_brick_off);
|
||||
}
|
||||
|
||||
keepInventory = false;
|
||||
world.setBlockMetadataWithNotify(x, y, z, i, 2);
|
||||
|
||||
if(entity != null) {
|
||||
entity.validate();
|
||||
world.setTileEntity(x, y, z, entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
if(!keepInventory) ItemStackUtil.spillItems(world, x, y, z, block, rand);
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
if(isActive) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
float cX = x + 0.5F;
|
||||
float cY = y + rand.nextFloat() * 0.375F;
|
||||
float cZ = z + 0.5F;
|
||||
float off = 0.52F;
|
||||
float var = rand.nextFloat() * 0.6F - 0.3F;
|
||||
rand.nextFloat();
|
||||
rand.nextFloat();
|
||||
|
||||
if(meta == 4) {
|
||||
world.spawnParticle("smoke", cX - off, cY, cZ + var, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", cX - off, cY, cZ + var, 0.0D, 0.0D, 0.0D);
|
||||
} else if(meta == 5) {
|
||||
world.spawnParticle("smoke", cX + off, cY, cZ + var, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", cX + off, cY, cZ + var, 0.0D, 0.0D, 0.0D);
|
||||
} else if(meta == 2) {
|
||||
world.spawnParticle("smoke", cX + var, cY, cZ - off, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", cX + var, cY, cZ - off, 0.0D, 0.0D, 0.0D);
|
||||
} else if(meta == 3) {
|
||||
world.spawnParticle("smoke", cX + var, cY, cZ + off, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", cX + var, cY, cZ + off, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6,6 +6,8 @@ import api.hbm.conveyor.IEnterableBlock;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.network.TileEntityCraneBase;
|
||||
import com.hbm.tileentity.network.TileEntityCraneInserter;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
@ -17,7 +19,6 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@ -72,7 +73,7 @@ public class CraneInserter extends BlockCraneBase implements IEnterableBlock {
|
||||
|
||||
if(te instanceof ISidedInventory) {
|
||||
ISidedInventory sided = (ISidedInventory) te;
|
||||
access = masquerade(sided, outputDirection.getOpposite().ordinal());
|
||||
access = InventoryUtil.masquerade(sided, outputDirection.getOpposite().ordinal());
|
||||
}
|
||||
|
||||
if(te instanceof IInventory) {
|
||||
@ -90,15 +91,6 @@ public class CraneInserter extends BlockCraneBase implements IEnterableBlock {
|
||||
}
|
||||
}
|
||||
|
||||
public static int[] masquerade(ISidedInventory sided, int side) {
|
||||
|
||||
if(sided instanceof TileEntityFurnace) {
|
||||
return new int[] {1, 0};
|
||||
}
|
||||
|
||||
return sided.getAccessibleSlotsFromSide(side);
|
||||
}
|
||||
|
||||
public static ItemStack addToInventory(IInventory inv, int[] access, ItemStack toAdd, int side) {
|
||||
|
||||
ISidedInventory sided = inv instanceof ISidedInventory ? (ISidedInventory) inv : null;
|
||||
|
||||
@ -5,18 +5,13 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.entity.train.EntityRailCarBase;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.PlayerInformPacket;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.ChatBuilder;
|
||||
import com.hbm.util.ParticleUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -69,6 +69,7 @@ public class ToolRecipes {
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.centri_stick, 1), new Object[] { ModItems.centrifuge_element, ModItems.energy_core, KEY_STICK });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.smashing_hammer, 1), new Object[] { "STS", "SPS", " P ", 'S', STEEL.block(), 'T', W.block(), 'P', ANY_PLASTIC.ingot() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.meteorite_sword, 1), new Object[] { " B", "GB ", "SG ", 'B', ModItems.blade_meteorite, 'G', GOLD.plate(), 'S', KEY_STICK });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.dwarven_pickaxe, 1), new Object[] { "CIC", " S ", " S ", 'C', CU.ingot(), 'I', IRON.ingot(), 'S', KEY_STICK });
|
||||
|
||||
//Drax
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.drax, 1), new Object[] { "BDS", "CDC", "FMF", 'B', ModItems.starmetal_pickaxe, 'S', ModItems.starmetal_shovel, 'C', CO.ingot(), 'F', ModItems.fusion_core, 'D', DESH.ingot(), 'M', ModItems.motor_desh });
|
||||
|
||||
@ -6,8 +6,6 @@ import com.hbm.packet.ParticleBurstPacket;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -392,15 +392,15 @@ public class OreDictManager {
|
||||
EUPH .nugget(nugget_euphemium) .ingot(ingot_euphemium) .dust(powder_euphemium) .block(block_euphemium);
|
||||
DNT .nugget(nugget_dineutronium) .ingot(ingot_dineutronium) .dust(powder_dineutronium) .block(block_dineutronium);
|
||||
FIBER .ingot(ingot_fiberglass) .block(block_fiberglass);
|
||||
ASBESTOS .asbestos(1F) .ingot(ingot_asbestos) .dust(powder_asbestos) .block(block_asbestos) .ore(ore_asbestos, ore_gneiss_asbestos, basalt_asbestos, DictFrame.fromOne(ore_basalt, EnumBasaltOreType.ASBESTOS), DictFrame.fromOne(stone_resource, EnumStoneType.ASBESTOS));
|
||||
ASBESTOS .asbestos(1F) .ingot(ingot_asbestos) .dust(powder_asbestos) .block(block_asbestos) .ore(ore_asbestos, ore_gneiss_asbestos, DictFrame.fromOne(ore_basalt, EnumBasaltOreType.ASBESTOS), DictFrame.fromOne(stone_resource, EnumStoneType.ASBESTOS));
|
||||
OSMIRIDIUM .nugget(nugget_osmiridium) .ingot(ingot_osmiridium);
|
||||
|
||||
/*
|
||||
* DUST AND GEM ORES
|
||||
*/
|
||||
S .dust(sulfur) .block(block_sulfur) .ore(ore_sulfur, ore_nether_sulfur, basalt_sulfur, DictFrame.fromOne(ore_basalt, EnumBasaltOreType.SULFUR), ore_meteor_sulfur, DictFrame.fromOne(stone_resource, EnumStoneType.SULFUR)) .oreNether(ore_nether_sulfur);
|
||||
S .dust(sulfur) .block(block_sulfur) .ore(ore_sulfur, ore_nether_sulfur, DictFrame.fromOne(ore_basalt, EnumBasaltOreType.SULFUR), ore_meteor_sulfur, DictFrame.fromOne(stone_resource, EnumStoneType.SULFUR)) .oreNether(ore_nether_sulfur);
|
||||
KNO .dust(niter) .block(block_niter) .ore(ore_niter);
|
||||
F .dust(fluorite) .block(block_fluorite) .ore(ore_fluorite, basalt_fluorite, DictFrame.fromOne(ore_basalt, EnumBasaltOreType.FLUORITE));
|
||||
F .dust(fluorite) .block(block_fluorite) .ore(ore_fluorite, DictFrame.fromOne(ore_basalt, EnumBasaltOreType.FLUORITE));
|
||||
LIGNITE .gem(lignite) .dust(powder_lignite) .ore(ore_lignite);
|
||||
COALCOKE .gem(fromOne(coke, EnumCokeType.COAL)) .block(fromOne(block_coke, EnumCokeType.COAL));
|
||||
PETCOKE .gem(fromOne(coke, EnumCokeType.PETROLEUM)) .block(fromOne(block_coke, EnumCokeType.PETROLEUM));
|
||||
@ -410,7 +410,7 @@ public class OreDictManager {
|
||||
CHLOROCALCITE .dust(powder_chlorocalcite);
|
||||
MOLYSITE .dust(powder_molysite) .ore(DictFrame.fromOne(ore_basalt, EnumBasaltOreType.MOLYSITE));
|
||||
SODALITE .gem(gem_sodalite);
|
||||
VOLCANIC .gem(gem_volcanic) .ore(basalt_gem, DictFrame.fromOne(ore_basalt, EnumBasaltOreType.GEM));
|
||||
VOLCANIC .gem(gem_volcanic) .ore(DictFrame.fromOne(ore_basalt, EnumBasaltOreType.GEM));
|
||||
HEMATITE .ore(fromOne(stone_resource, EnumStoneType.HEMATITE));
|
||||
MALACHITE .ore(fromOne(stone_resource, EnumStoneType.MALACHITE));
|
||||
SLAG .block(block_slag);
|
||||
|
||||
@ -0,0 +1,78 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotCraftingOutput;
|
||||
import com.hbm.tileentity.machine.TileEntityFurnaceBrick;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
|
||||
public class ContainerFurnaceBrick extends Container {
|
||||
|
||||
private TileEntityFurnaceBrick furnace;
|
||||
|
||||
public ContainerFurnaceBrick(InventoryPlayer invPlayer, TileEntityFurnaceBrick tedf) {
|
||||
furnace = tedf;
|
||||
|
||||
//input
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 62, 35));
|
||||
//fuel
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 35, 17));
|
||||
//output
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 2, 116, 35));
|
||||
//ash
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 3, 35, 53));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if(var4 != null && var4.getHasStack()) {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if(par2 <= 3) {
|
||||
if(!this.mergeItemStack(var5, 3, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
||||
if(!TileEntityFurnace.isItemFuel(var5)) {
|
||||
if(!InventoryUtil.mergeItemStack(this.inventorySlots, var5, 0, 1, false))
|
||||
return null;
|
||||
} else {
|
||||
if(!this.mergeItemStack(var5, 1, 2, false) && !this.mergeItemStack(var5, 0, 1, false)) return null;
|
||||
}
|
||||
}
|
||||
|
||||
if(var5.stackSize == 0) {
|
||||
var4.putStack((ItemStack) null);
|
||||
} else {
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return furnace.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
44
src/main/java/com/hbm/inventory/gui/GUIFurnaceBrick.java
Normal file
@ -0,0 +1,44 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerFurnaceBrick;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityFurnaceBrick;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIFurnaceBrick extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_furnace_brick.png");
|
||||
private TileEntityFurnaceBrick furnace;
|
||||
|
||||
public GUIFurnaceBrick(InventoryPlayer invPlayer, TileEntityFurnaceBrick tile) {
|
||||
super(new ContainerFurnaceBrick(invPlayer, tile));
|
||||
this.furnace = tile;
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = this.furnace.hasCustomInventoryName() ? this.furnace.getInventoryName() : I18n.format(this.furnace.getInventoryName());
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 0xffffff);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 0xffffff);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
if(furnace.isInvalid() && furnace.getWorldObj().getTileEntity(furnace.xCoord, furnace.yCoord, furnace.zCoord) instanceof TileEntityFurnaceBrick)
|
||||
furnace = (TileEntityFurnaceBrick) furnace.getWorldObj().getTileEntity(furnace.xCoord, furnace.yCoord, furnace.zCoord);
|
||||
|
||||
if(this.furnace.burnTime > 0) {
|
||||
int b = furnace.burnTime * 13 / furnace.maxBurnTime;
|
||||
this.drawTexturedModalRect(guiLeft + 62, guiTop + 54 + 12 - b, 176, 12 - b, 14, b + 1);
|
||||
int p = this.furnace.progress * 24 / 200;
|
||||
this.drawTexturedModalRect(guiLeft + 85, guiTop + 34, 176, 14, p + 1, 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2091,6 +2091,7 @@ public class ModItems {
|
||||
public static Item chlorophyte_pickaxe;
|
||||
public static Item mese_pickaxe;
|
||||
public static Item dnt_sword;
|
||||
public static Item dwarven_pickaxe;
|
||||
|
||||
public static Item meteorite_sword;
|
||||
public static Item meteorite_sword_seared;
|
||||
@ -5321,6 +5322,10 @@ public class ModItems {
|
||||
|
||||
dnt_sword = new ItemSwordAbility(12F, 0, matMese).setUnlocalizedName("dnt_sword").setTextureName(RefStrings.MODID + ":dnt_sword");
|
||||
|
||||
ToolMaterial matDwarf = EnumHelper.addToolMaterial("HBM_DWARVEN", 2, 0, 4F, 0.0F, 10).setRepairItem(new ItemStack(ModItems.ingot_copper));
|
||||
dwarven_pickaxe = new ItemToolAbility(5F, -0.1, matDwarf, EnumToolType.MINER)
|
||||
.addBreakAbility(new ToolAbility.HammerAbility(1)).setUnlocalizedName("dwarven_pickaxe").setMaxDamage(250).setTextureName(RefStrings.MODID + ":dwarven_pickaxe");
|
||||
|
||||
ToolMaterial matMeteorite = EnumHelper.addToolMaterial("HBM_METEORITE", 4, 0, 50F, 0.0F, 200).setRepairItem(new ItemStack(ModItems.plate_paa));
|
||||
meteorite_sword = new ItemSwordMeteorite(10F, 0, matMeteorite).setUnlocalizedName("meteorite_sword").setTextureName(RefStrings.MODID + ":meteorite_sword");
|
||||
meteorite_sword_seared = new ItemSwordMeteorite(15F, 0, matMeteorite).setUnlocalizedName("meteorite_sword_seared").setTextureName(RefStrings.MODID + ":meteorite_sword");
|
||||
@ -7466,6 +7471,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(cape_hidden, cape_hidden.getUnlocalizedName());
|
||||
|
||||
//Tools
|
||||
GameRegistry.registerItem(dwarven_pickaxe, dwarven_pickaxe.getUnlocalizedName());
|
||||
GameRegistry.registerItem(schrabidium_sword, schrabidium_sword.getUnlocalizedName());
|
||||
GameRegistry.registerItem(schrabidium_hammer, schrabidium_hammer.getUnlocalizedName());
|
||||
GameRegistry.registerItem(shimmer_sledge, shimmer_sledge.getUnlocalizedName());
|
||||
|
||||
@ -1,16 +1,6 @@
|
||||
package com.hbm.items.tool;
|
||||
|
||||
import com.hbm.items.machine.ItemSatChip;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.saveddata.SatelliteSavedData;
|
||||
import com.hbm.saveddata.satellites.Satellite;
|
||||
import com.hbm.saveddata.satellites.Satellite.Interfaces;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ItemSatRelay extends ItemSatChip {
|
||||
//Schrabby doesn't fucking know how this works so I HOPE it will create a new item that works without fucking everything up
|
||||
|
||||
@ -325,6 +325,7 @@ public class CraftingManager {
|
||||
addRecipeAuto(new ItemStack(ModBlocks.anvil_murky, 1), new Object[] { "UUU", "UAU", "UUU", 'U', ModItems.undefined, 'A', ModBlocks.anvil_steel });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_fraction_tower), new Object[] { "H", "G", "H", 'H', STEEL.plateWelded(), 'G', ModBlocks.steel_grate });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.fraction_spacer), new Object[] { "BHB", 'H', ModItems.hull_big_steel, 'B', Blocks.iron_bars });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_furnace_brick_off), new Object[] { "III", "I I", "BBB", 'I', Items.brick, 'B', Blocks.stone });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.furnace_iron), new Object[] { "III", "IFI", "BBB", 'I', IRON.ingot(), 'F', Blocks.furnace, 'B', Blocks.stonebrick });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_mixer), new Object[] { "PIP", "GCG", "PMP", 'P', STEEL.plate(), 'I', DURA.ingot(), 'G', KEY_ANYPANE, 'C', ModItems.circuit_copper, 'M', ModItems.motor });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.fan), new Object[] { "BPB", "PRP", "BPB", 'B', STEEL.bolt(), 'P', IRON.plate(), 'R', REDSTONE.dust() });
|
||||
|
||||
@ -1212,6 +1212,10 @@ public class MainRegistry {
|
||||
ignoreMappings.add("hbm:tile.reactor_computer");
|
||||
ignoreMappings.add("hbm:tile.ff");
|
||||
ignoreMappings.add("hbm:tile.muffler");
|
||||
ignoreMappings.add("hbm:tile.basalt_sulfur");
|
||||
ignoreMappings.add("hbm:tile.basalt_fluorite");
|
||||
ignoreMappings.add("hbm:tile.basalt_asbestos");
|
||||
ignoreMappings.add("hbm:tile.basalt_gem");
|
||||
|
||||
/// REMAP ///
|
||||
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);
|
||||
|
||||
@ -2,8 +2,6 @@ package com.hbm.packet;
|
||||
|
||||
import com.hbm.config.MobConfig;
|
||||
import com.hbm.entity.mob.EntityDuck;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.items.weapon.ItemMissile.PartSize;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.tileentity.TileEntityTickingBase;
|
||||
|
||||
@ -274,6 +274,7 @@ public class TileMappings {
|
||||
put(TileEntityHeaterElectric.class, "tileentity_electric_heater");
|
||||
put(TileEntityHeaterHeatex.class, "tileentity_heater_heatex");
|
||||
put(TileEntityFurnaceIron.class, "tileentity_furnace_iron");
|
||||
put(TileEntityFurnaceBrick.class, "tileentity_furnace_brick");
|
||||
put(TileEntityFurnaceSteel.class, "tileentity_furnace_steel");
|
||||
put(TileEntityFurnaceCombination.class, "tileentity_combination_oven");
|
||||
put(TileEntityStirling.class, "tileentity_stirling");
|
||||
|
||||
@ -0,0 +1,232 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.hbm.blocks.machine.MachineBrickFurnace;
|
||||
import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
import com.hbm.inventory.container.ContainerFurnaceBrick;
|
||||
import com.hbm.inventory.gui.GUIFurnaceBrick;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.ItemEnums.EnumAshType;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityFurnaceBrick extends TileEntityMachineBase implements IGUIProvider {
|
||||
|
||||
private static final int[] slotsTop = new int[] { 0 };
|
||||
private static final int[] slotsBottom = new int[] { 2, 1, 3 };
|
||||
private static final int[] slotsSides = new int[] {1};
|
||||
|
||||
public static HashMap<Item, Integer> burnSpeed = new HashMap();
|
||||
|
||||
static {
|
||||
burnSpeed.put(Items.clay_ball, 4);
|
||||
burnSpeed.put(ModItems.ball_fireclay, 4);
|
||||
burnSpeed.put(Item.getItemFromBlock(Blocks.netherrack), 4);
|
||||
burnSpeed.put(Item.getItemFromBlock(Blocks.cobblestone), 2);
|
||||
burnSpeed.put(Item.getItemFromBlock(Blocks.sand), 2);
|
||||
}
|
||||
|
||||
public int burnTime;
|
||||
public int maxBurnTime;
|
||||
public int progress;
|
||||
|
||||
public int ashLevelWood;
|
||||
public int ashLevelCoal;
|
||||
public int ashLevelMisc;
|
||||
|
||||
public TileEntityFurnaceBrick() {
|
||||
super(4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.furnaceBrick";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
boolean wasBurning = this.burnTime > 0;
|
||||
boolean markDirty = false;
|
||||
|
||||
if(this.burnTime > 0) {
|
||||
this.burnTime--;
|
||||
}
|
||||
|
||||
if(this.burnTime != 0 || this.slots[1] != null && this.slots[0] != null) {
|
||||
if(this.burnTime == 0 && this.canSmelt()) {
|
||||
this.maxBurnTime = this.burnTime = TileEntityFurnace.getItemBurnTime(this.slots[1]);
|
||||
|
||||
if(this.burnTime > 0) {
|
||||
markDirty = true;
|
||||
|
||||
if(this.slots[1] != null) {
|
||||
this.slots[1].stackSize--;
|
||||
|
||||
EnumAshType type = TileEntityFireboxBase.getAshFromFuel(slots[1]);
|
||||
if(type == EnumAshType.WOOD) ashLevelWood += burnTime;
|
||||
if(type == EnumAshType.COAL) ashLevelCoal += burnTime;
|
||||
if(type == EnumAshType.MISC) ashLevelMisc += burnTime;
|
||||
int threshold = 2000;
|
||||
if(processAsh(ashLevelWood, EnumAshType.WOOD, threshold)) ashLevelWood -= threshold;
|
||||
if(processAsh(ashLevelCoal, EnumAshType.COAL, threshold)) ashLevelCoal -= threshold;
|
||||
if(processAsh(ashLevelMisc, EnumAshType.MISC, threshold)) ashLevelMisc -= threshold;
|
||||
|
||||
if(this.slots[1].stackSize == 0) {
|
||||
this.slots[1] = slots[1].getItem().getContainerItem(slots[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.burnTime > 0 && this.canSmelt()) {
|
||||
this.progress += this.getBurnSpeed();
|
||||
|
||||
if(this.progress >= 200) {
|
||||
this.progress = 0;
|
||||
this.smeltItem();
|
||||
markDirty = true;
|
||||
}
|
||||
} else {
|
||||
this.progress = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(wasBurning != this.burnTime > 0) {
|
||||
markDirty = true;
|
||||
MachineBrickFurnace.updateBlockState(this.burnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
if(markDirty) {
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
this.networkPackNT(15);
|
||||
}
|
||||
}
|
||||
|
||||
public int getBurnSpeed() {
|
||||
Integer speed = burnSpeed.get(slots[0].getItem());
|
||||
if(speed != null) return speed;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
||||
return slot >= 2 ? false : (slot == 1 ? TileEntityFurnace.getItemBurnTime(stack) > 0 : true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return side == 0 ? slotsBottom : (side == 1 ? slotsTop : slotsSides);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
buf.writeInt(burnTime);
|
||||
buf.writeInt(maxBurnTime);
|
||||
buf.writeInt(progress);
|
||||
}
|
||||
|
||||
@Override public void deserialize(ByteBuf buf) {
|
||||
super.deserialize(buf);
|
||||
this.burnTime = buf.readInt();
|
||||
this.maxBurnTime = buf.readInt();
|
||||
this.progress = buf.readInt();
|
||||
}
|
||||
|
||||
protected boolean processAsh(int level, EnumAshType type, int threshold) {
|
||||
|
||||
if(level >= threshold) {
|
||||
if(slots[3] == null) {
|
||||
slots[3] = DictFrame.fromOne(ModItems.powder_ash, type);
|
||||
return true;
|
||||
} else if(slots[3].stackSize < slots[3].getMaxStackSize() && slots[3].getItem() == ModItems.powder_ash && slots[3].getItemDamage() == type.ordinal()) {
|
||||
slots[3].stackSize++;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean canSmelt() {
|
||||
if(this.slots[0] == null) {
|
||||
return false;
|
||||
} else {
|
||||
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]);
|
||||
if(itemstack == null)
|
||||
return false;
|
||||
if(this.slots[2] == null)
|
||||
return true;
|
||||
if(!this.slots[2].isItemEqual(itemstack))
|
||||
return false;
|
||||
int result = slots[2].stackSize + itemstack.stackSize;
|
||||
return result <= getInventoryStackLimit() && result <= this.slots[2].getMaxStackSize();
|
||||
}
|
||||
}
|
||||
|
||||
public void smeltItem() {
|
||||
if(this.canSmelt()) {
|
||||
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]);
|
||||
|
||||
if(this.slots[2] == null) {
|
||||
this.slots[2] = itemstack.copy();
|
||||
} else if(this.slots[2].getItem() == itemstack.getItem()) {
|
||||
this.slots[2].stackSize += itemstack.stackSize;
|
||||
}
|
||||
|
||||
--this.slots[0].stackSize;
|
||||
|
||||
if(this.slots[0].stackSize <= 0) {
|
||||
this.slots[0] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.burnTime = nbt.getInteger("burnTime");
|
||||
this.maxBurnTime = nbt.getInteger("maxBurn");
|
||||
this.progress = nbt.getInteger("progress");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("burnTime", this.burnTime);
|
||||
nbt.setInteger("maxBurn", this.maxBurnTime);
|
||||
nbt.setInteger("progress", this.progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerFurnaceBrick(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIFurnaceBrick(player.inventory, this);
|
||||
}
|
||||
}
|
||||
@ -36,7 +36,7 @@ public class TileEntityFurnaceIron extends TileEntityMachineBase implements IGUI
|
||||
|
||||
public int progress;
|
||||
public int processingTime;
|
||||
public static final int baseTime = 200;
|
||||
public static final int baseTime = 160;
|
||||
|
||||
public ModuleBurnTime burnModule;
|
||||
|
||||
@ -63,7 +63,7 @@ public class TileEntityFurnaceIron extends TileEntityMachineBase implements IGUI
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
UpgradeManager.eval(slots, 4, 4);
|
||||
this.processingTime = baseTime - (100 * Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3) / 3);
|
||||
this.processingTime = baseTime - ((baseTime / 2) * Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3) / 3);
|
||||
|
||||
wasOn = false;
|
||||
|
||||
|
||||
@ -29,6 +29,7 @@ import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.Compat;
|
||||
import com.hbm.util.EnumUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
import com.hbm.util.ItemStackUtil;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
@ -673,7 +674,7 @@ public class TileEntityMachineExcavator extends TileEntityMachineBase implements
|
||||
|
||||
if(inv instanceof ISidedInventory) {
|
||||
ISidedInventory sided = (ISidedInventory) inv;
|
||||
access = CraneInserter.masquerade(sided, dir.ordinal());
|
||||
access = InventoryUtil.masquerade(sided, dir.ordinal());
|
||||
}
|
||||
|
||||
for(ItemStack item : items) {
|
||||
|
||||
@ -187,7 +187,6 @@ public class TileEntityMachineWoodBurner extends TileEntityMachineBase implement
|
||||
if(level >= threshold) {
|
||||
if(slots[1] == null) {
|
||||
slots[1] = DictFrame.fromOne(ModItems.powder_ash, type);
|
||||
ashLevelWood -= threshold;
|
||||
return true;
|
||||
} else if(slots[1].stackSize < slots[1].getMaxStackSize() && slots[1].getItem() == ModItems.powder_ash && slots[1].getItemDamage() == type.ordinal()) {
|
||||
slots[1].stackSize++;
|
||||
|
||||
@ -9,6 +9,8 @@ import com.hbm.inventory.gui.GUICraneGrabber;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.module.ModulePatternMatcher;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
@ -81,7 +83,7 @@ public class TileEntityCraneGrabber extends TileEntityCraneBase implements IGUIP
|
||||
|
||||
if(te instanceof ISidedInventory) {
|
||||
sided = (ISidedInventory) te;
|
||||
access = CraneInserter.masquerade(sided, outputSide.getOpposite().ordinal());
|
||||
access = InventoryUtil.masquerade(sided, outputSide.getOpposite().ordinal());
|
||||
}
|
||||
|
||||
if(te instanceof IInventory) {
|
||||
|
||||
@ -4,6 +4,8 @@ import com.hbm.blocks.network.CraneInserter;
|
||||
import com.hbm.inventory.container.ContainerCraneInserter;
|
||||
import com.hbm.inventory.gui.GUICraneInserter;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
@ -42,7 +44,7 @@ public class TileEntityCraneInserter extends TileEntityCraneBase implements IGUI
|
||||
if(te instanceof ISidedInventory) {
|
||||
ISidedInventory sided = (ISidedInventory) te;
|
||||
//access = sided.getAccessibleSlotsFromSide(dir.ordinal());
|
||||
access = CraneInserter.masquerade(sided, outputSide.getOpposite().ordinal());
|
||||
access = InventoryUtil.masquerade(sided, outputSide.getOpposite().ordinal());
|
||||
}
|
||||
|
||||
if(te instanceof IInventory) {
|
||||
|
||||
@ -4,16 +4,27 @@ import java.util.List;
|
||||
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.recipes.anvil.AnvilRecipes.AnvilOutput;
|
||||
import com.hbm.tileentity.machine.TileEntityFurnaceBrick;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
//'t was about time
|
||||
public class InventoryUtil {
|
||||
|
||||
public static int[] masquerade(ISidedInventory sided, int side) {
|
||||
|
||||
if(sided instanceof TileEntityFurnace) return new int[] {1, 0};
|
||||
if(sided instanceof TileEntityFurnaceBrick) return new int[] {1, 0, 3};
|
||||
|
||||
return sided.getAccessibleSlotsFromSide(side);
|
||||
}
|
||||
|
||||
/**
|
||||
* Will attempt to cram a much of the given itemstack into the stack array as possible
|
||||
* The rest will be returned
|
||||
|
||||
@ -2,12 +2,17 @@ package com.hbm.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class ItemStackUtil {
|
||||
@ -161,4 +166,36 @@ public class ItemStackUtil {
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static void spillItems(World world, int x, int y, int z, Block block, Random rand) {
|
||||
IInventory tileentityfurnace = (IInventory) world.getTileEntity(x, y, z);
|
||||
|
||||
if(tileentityfurnace != null) {
|
||||
for(int slot = 0; slot < tileentityfurnace.getSizeInventory(); ++slot) {
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(slot);
|
||||
|
||||
if(itemstack != null) {
|
||||
float oX = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float oY = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float oZ = rand.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while(itemstack.stackSize > 0) {
|
||||
int j1 = rand.nextInt(21) + 10;
|
||||
if(j1 > itemstack.stackSize) j1 = itemstack.stackSize;
|
||||
itemstack.stackSize -= j1;
|
||||
|
||||
EntityItem entityitem = new EntityItem(world, x + oX, y + oY, z + oZ, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||
if(itemstack.hasTagCompound()) entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
|
||||
float motion = 0.05F;
|
||||
entityitem.motionX = (float) rand.nextGaussian() * motion;
|
||||
entityitem.motionY = (float) rand.nextGaussian() * motion + 0.2F;
|
||||
entityitem.motionZ = (float) rand.nextGaussian() * motion;
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
world.func_147453_f(x, y, z, block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -323,6 +323,7 @@ container.factoryTitanium=Einfache Fabrik
|
||||
container.fluidtank=Tank
|
||||
container.forceField=Kraftfeldgenerator
|
||||
container.frackingTower=Hydraulischer Frackingturm
|
||||
container.furnaceBrick=Ziegelofen
|
||||
container.furnaceCombination=Kombinationsofen
|
||||
container.furnaceIron=Eiserner Ofen
|
||||
container.furnaceSteel=Stahlofen
|
||||
@ -1737,6 +1738,7 @@ item.drone.request.name=Logistikdrone
|
||||
item.drone_linker.name=Transportdronen-Linker
|
||||
item.ducttape.name=Klebeband
|
||||
item.dust.name=Staub
|
||||
item.dwarven_pickaxe.name=Zwergenspitzhacke
|
||||
item.dynosphere_base.name=Blanke Dynosphere
|
||||
item.dynosphere_desh.name=Desh-Dynosphere
|
||||
item.dynosphere_desh_charged.name=Desh-Dynosphere (Geladen)
|
||||
@ -3947,6 +3949,8 @@ tile.frozen_dirt.name=Gefrorene Erde
|
||||
tile.frozen_grass.name=Gefrorenes Gras
|
||||
tile.frozen_log.name=Gefrorener Baumstamm
|
||||
tile.frozen_planks.name=Gefrorene Holzbretter
|
||||
tile.machine_furnace_brick_off.name=Ziegelofen
|
||||
tile.machine_furnace_brick_on.name=Ziegelofen
|
||||
tile.furnace_combination.name=Kombinationsofen
|
||||
tile.furnace_combination.desc=Großer Ofen welcher Holzhokle und Kohlekoks herstellen kann.$Erzeugt flüssige Nebenprodukte.$Wärmetransferrate: ΔT*0.25 TU/t
|
||||
tile.furnace_iron.name=Eiserner Ofen
|
||||
|
||||
@ -682,6 +682,7 @@ container.fluidtank=Tank
|
||||
container.fileCabinet=Filing Cabinet
|
||||
container.forceField=Forcefield Emitter
|
||||
container.frackingTower=Hydraulic Fracking Tower
|
||||
container.furnaceBrick=Bricked Furnace
|
||||
container.furnaceCombination=Combination Oven
|
||||
container.furnaceIron=Iron Furnace
|
||||
container.furnaceSteel=Steel Furnace
|
||||
@ -2446,6 +2447,7 @@ item.dust.name=Dust
|
||||
item.dust.desc=I hate dust!
|
||||
item.dust.desc.P11=Another one bites the dust!
|
||||
item.dust_tiny.name=Tiny Pile of Dust
|
||||
item.dwarven_pickaxe.name=Dwarven Pickaxe
|
||||
item.dynosphere_base.name=Blank Dynosphere
|
||||
item.dynosphere_desh.name=Desh Dynosphere
|
||||
item.dynosphere_desh_charged.name=Desh Dynosphere (Charged)
|
||||
@ -4941,6 +4943,8 @@ tile.frozen_dirt.name=Frozen Dirt
|
||||
tile.frozen_grass.name=Frozen Grass
|
||||
tile.frozen_log.name=Frozen Log
|
||||
tile.frozen_planks.name=Frozen Planks
|
||||
tile.machine_furnace_brick_off.name=Bricked Furnace
|
||||
tile.machine_furnace_brick_on.name=Bricked Furnace
|
||||
tile.furnace_combination.name=Combination Oven
|
||||
tile.furnace_combination.desc=A large furnace that can produce charcoal and coal coke.$Produces fluid byproducts.$Heat transfer rate: ΔT*0.25 TU/t
|
||||
tile.furnace_iron.name=Iron Furnace
|
||||
|
||||
|
After Width: | Height: | Size: 405 B |
|
After Width: | Height: | Size: 614 B |
|
After Width: | Height: | Size: 649 B |
|
After Width: | Height: | Size: 678 B |
|
After Width: | Height: | Size: 695 B |
|
After Width: | Height: | Size: 12 KiB |
BIN
src/main/resources/assets/hbm/textures/items/dwarven_pickaxe.png
Normal file
|
After Width: | Height: | Size: 313 B |