diff --git a/changelog b/changelog index 80966d835..09de51953 100644 --- a/changelog +++ b/changelog @@ -1,60 +1,12 @@ ## Added -* Limestone dust - * Limestone now shreds into limestone dust instead of calcium (yields 4) - * Can be combination cooked into calcium - * Used for making cement -* Cement - * Used in all concretes (only requires 1 per 16 concrete) - * Either made from combining 1 limestone dust with 3 clay (yields 4) or from shredding slag (also yields 4) -* Bedrock ore processor - * Used for separating the new bedrock ore - * Creates ore slop as a byproduct - * Slop can be coked into some rare byproducts or solidified into tar sand - * Vitriol can be coked into iron and sulfuric acid or electrolyzed into sulfuric acid and chlorine -* New bedrock ore processing - * Most bedrock ores now create a single common item that contains different quantities of the 6 main ore types - * Ores can be processed in many different ways with three tiers of byproducts and many optional steps, also making use of machines that the old bedrock ores didn't - * New bedrock ores are now rarer, only spawning in every 10th chunk vs in evbery 3rd - * The old system can be restored via config +* Acidizer Input Partitioner + * Buffers inputs for the ore acidizer and releases the exact amount needed to complete an operation + * This allows easy automation of acidizers accepting multiple types which have higher input requirements + * By simply shoving items into the acidizer all at once, there is a high likelyhood of the acidizer to clog, as the remaining input is no longer sufficient + * The partitioner only has 9 slots for ingredients, for more types it's necessary to sort the items and use multiple partitioners + * The partitioner has 9 additional slots for invalid items that cannot be processed via acidizer, those can be ejected via hopper IO + * An inline conveyor machine similar to the splitter, receives items from conveyors (but not from ejectors directly) and outputs them on its built-in conveyor belt ## Changed -* Updated italian localization -* Updated boxducts - * All boxducts are now way cleaner, only having bolts on intersections, with straight parts only having very light seams - * Intersections now have unique textures for each size - * Copper boxducts now have a much nicer color gradient - * Exhaust pipes now have a more rusted appearance -* Added an alternate recipe for blank upgrades using integrated circuits and polymer instead of analog circuits -* Update the soyuz and orbital module recipes - * Simplified the recipes, fewer microcrafting parts - * Both now use low-density elements which are made from aluminium/titanium, fiberglass and hard plastic - * Both now make use of more advanced electronics, although in smaller numbers -* Removed the recipes for the satellite deco blocks, those will be phased out soon. Existing deco blocks can still be crafted back into functional satellites -* Moved the satellite recipes to the welder, the attachment is now welded onto the common satellite body -* Simplified the satellite recipes, adjusted cost based on utility (depth scanner, death ray and resonator are more expensive than the mapper/radar) -* CTRL + ALT view now shows the item's internal name and domain -* Adjusted Mekanism compat - * Decreased crafting complexity and time for the digiminer assembler recipe - * Replaced recipes for the wind turbine and atomic disassembler - * Added a config option for toggling Mekanism compat -* Added recipe caching to the combinator funnel, meaning it no longer has to iterate over the entire recipe list all the time for compression/automation, this should improve performance by a fair bit -* Diodes now use silicon nuggets instead of nether quartz -* Aluminium wire's coloring is now consistent with the ingot -* Nuclear explosions below a radius of 75 no longer have a gamma flash, therefore a high yield mini nuke should no longer be able to instakill someone wearing full euph armor -* Updated OpenComputers compat -* The solar boiler now has a tooltip showing its contents -* Updated drones - * Drones will now drop when destroyed - * Drones are now generally faster (standard drones are now as fast as express drones used to be) - * Holding a transport drone item now shows transport drone paths, just like how logistics drones work - * Drones should no longer randomly get stuck on waypoints - * Drones will now move upwards to avoid small ledges, this usually happens when drones approach docks from a lower angle - * Logistics drone crates can now be disabled with a redstone signal - * Logistics drone docks are now 5x faster, spawning a new rone every second instead of every 5 seconds - * Drones are now a fair bit cheaper -* Tar sand can now be liquefacted into bitumen directly with a higher yield than the chemplant recipe - * This however is slower, more energy intensive and yields no sand byproduct - -## Fixed -* Fixed crash caused by PRISM updating unloaded worlds -* Hopefully fixed another crash caused by PRISM (reproduction was unreliable and sporadic, not confirmed) +* The mandatory washing step for bedrock ore byproducts now needs 4 items for sulfuric, 12 for dissolved and 24 for cleaned byproducts (isntead of just one) + * This should offset the exponentially increasing amount of byproduct created from processing bedrock ore which ends up being far greater than the primary product \ No newline at end of file diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 1806a7f4e..ffea93dc9 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -791,6 +791,7 @@ public class ModBlocks { public static Block crane_boxer; public static Block crane_unboxer; public static Block crane_splitter; + public static Block crane_partitioner; public static Block drone_waypoint; public static Block drone_crate; @@ -1912,6 +1913,7 @@ public class ModBlocks { crane_boxer = new CraneBoxer().setBlockName("crane_boxer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab); crane_unboxer = new CraneUnboxer().setBlockName("crane_unboxer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab); crane_splitter = new CraneSplitter().setBlockName("crane_splitter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":crane_side"); + crane_partitioner = new CranePartitioner().setBlockName("crane_partitioner").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":crane_side"); fan = new MachineFan().setBlockName("fan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); piston_inserter = new PistonInserter().setBlockName("piston_inserter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); @@ -3163,6 +3165,7 @@ public class ModBlocks { register(conveyor_chute); register(conveyor_lift); register(crane_splitter); + register(crane_partitioner); register(drone_waypoint); register(drone_crate); register(drone_waypoint_request); diff --git a/src/main/java/com/hbm/blocks/network/CranePartitioner.java b/src/main/java/com/hbm/blocks/network/CranePartitioner.java new file mode 100644 index 000000000..415ed34aa --- /dev/null +++ b/src/main/java/com/hbm/blocks/network/CranePartitioner.java @@ -0,0 +1,237 @@ +package com.hbm.blocks.network; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Random; + +import com.hbm.blocks.ITooltipProvider; +import com.hbm.entity.item.EntityMovingItem; +import com.hbm.inventory.recipes.CrystallizerRecipes; +import com.hbm.lib.RefStrings; +import com.hbm.tileentity.TileEntityMachineBase; +import com.hbm.util.InventoryUtil; + +import api.hbm.conveyor.IConveyorBelt; +import api.hbm.conveyor.IConveyorItem; +import api.hbm.conveyor.IConveyorPackage; +import api.hbm.conveyor.IEnterableBlock; +import cpw.mods.fml.client.registry.RenderingRegistry; +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.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class CranePartitioner extends BlockContainer implements IConveyorBelt, IEnterableBlock, ITooltipProvider { + + @SideOnly(Side.CLIENT) public IIcon iconTop; + @SideOnly(Side.CLIENT) public IIcon iconBack; + @SideOnly(Side.CLIENT) public IIcon iconBelt; + @SideOnly(Side.CLIENT) public IIcon iconInner; + @SideOnly(Side.CLIENT) public IIcon iconInnerSide; + + public CranePartitioner() { + super(Material.iron); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + super.registerBlockIcons(iconRegister); + this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":crane_top"); + this.iconBack = iconRegister.registerIcon(RefStrings.MODID + ":crane_partitioner_back"); + this.iconBelt = iconRegister.registerIcon(RefStrings.MODID + ":crane_splitter_belt"); + this.iconInner = iconRegister.registerIcon(RefStrings.MODID + ":crane_splitter_inner"); + this.iconInnerSide = iconRegister.registerIcon(RefStrings.MODID + ":crane_splitter_inner_side"); + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) { + return new TileEntityCranePartitioner(); + } + + @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); + } + + @Override + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F); + } + + public static int renderID = RenderingRegistry.getNextAvailableRenderId(); + + @Override public int getRenderType() { return renderID; } + @Override public boolean isOpaqueCube() { return false; } + @Override public boolean renderAsNormalBlock() { return false; } + + @Override public boolean canItemEnter(World world, int x, int y, int z, ForgeDirection dir, IConveyorItem entity) { return getTravelDirection(world, x, y, z, null) == dir; } + @Override public boolean canPackageEnter(World world, int x, int y, int z, ForgeDirection dir, IConveyorPackage entity) { return false; } + @Override public void onPackageEnter(World world, int x, int y, int z, ForgeDirection dir, IConveyorPackage entity) { } + + @Override + public boolean canItemStay(World world, int x, int y, int z, Vec3 itemPos) { + return true; + } + + @Override + public Vec3 getTravelLocation(World world, int x, int y, int z, Vec3 itemPos, double speed) { + ForgeDirection dir = this.getTravelDirection(world, x, y, z, itemPos); + Vec3 snap = this.getClosestSnappingPosition(world, x, y, z, itemPos); + Vec3 dest = Vec3.createVectorHelper(snap.xCoord - dir.offsetX * speed, snap.yCoord - dir.offsetY * speed, snap.zCoord - dir.offsetZ * speed); + Vec3 motion = Vec3.createVectorHelper((dest.xCoord - itemPos.xCoord), (dest.yCoord - itemPos.yCoord), (dest.zCoord - itemPos.zCoord)); + double len = motion.lengthVector(); + Vec3 ret = Vec3.createVectorHelper(itemPos.xCoord + motion.xCoord / len * speed, itemPos.yCoord + motion.yCoord / len * speed, itemPos.zCoord + motion.zCoord / len * speed); + return ret; + } + + @Override + public Vec3 getClosestSnappingPosition(World world, int x, int y, int z, Vec3 itemPos) { + ForgeDirection dir = this.getTravelDirection(world, x, y, z, itemPos); + itemPos.xCoord = MathHelper.clamp_double(itemPos.xCoord, x, x + 1); + itemPos.zCoord = MathHelper.clamp_double(itemPos.zCoord, z, z + 1); + double posX = x + 0.5; + double posZ = z + 0.5; + if(dir.offsetX != 0) posX = itemPos.xCoord; + if(dir.offsetZ != 0) posZ = itemPos.zCoord; + return Vec3.createVectorHelper(posX, y + 0.25, posZ); + } + + public ForgeDirection getTravelDirection(World world, int x, int y, int z, Vec3 itemPos) { + int meta = world.getBlockMetadata(x, y, z); + return ForgeDirection.getOrientation(meta); + } + + @Override + public void onItemEnter(World world, int x, int y, int z, ForgeDirection dir, IConveyorItem entity) { + TileEntityCranePartitioner partitioner = (TileEntityCranePartitioner) world.getTileEntity(x, y, z); + ItemStack stack = entity.getItemStack(); + ItemStack remainder = null; + if(CrystallizerRecipes.getAmount(stack) > 0) { + remainder = InventoryUtil.tryAddItemToInventory(partitioner, 0, 8, stack); + } else { + remainder = InventoryUtil.tryAddItemToInventory(partitioner, 9, 17, stack); + } + if(remainder != null) { + EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, remainder.copy()); + world.spawnEntityInWorld(item); + } + } + + public static class TileEntityCranePartitioner extends TileEntityMachineBase { + + public TileEntityCranePartitioner() { + super(18); + } + + @Override public String getName() { return "container.partitioner"; } + + @Override + public void updateEntity() { + + if(!worldObj.isRemote) { + + List stacks = new ArrayList(); + for(int i = 0; i < 9; i++) if(slots[i] != null) stacks.add(slots[i]); + stacks.sort(stackSizeComparator); + boolean markDirty = false; + + for(ItemStack stack : stacks) { + int amount = CrystallizerRecipes.getAmount(stack); + while(stack.stackSize >= amount) { + ItemStack entityStack = stack.copy(); + entityStack.stackSize = amount; + stack.stackSize -= amount; + EntityMovingItem item = new EntityMovingItem(worldObj); + item.setItemStack(entityStack); + item.setPosition(xCoord + 0.5, yCoord + 0.25, zCoord + 0.5); + worldObj.spawnEntityInWorld(item); + } + } + + for(int i = 0; i < 9; i++) if(slots[i] != null && slots[i].stackSize <= 0) slots[i] = null; + if(markDirty) this.markDirty(); + } + } + + public static Comparator stackSizeComparator = new Comparator() { + + @Override + public int compare(ItemStack o1, ItemStack o2) { + return (int) Math.signum(o1.stackSize - o2.stackSize); + } + }; + + @Override + public boolean canExtractItem(int slot, ItemStack stack, int side) { + return slot >= 9; + } + + @Override + public boolean isItemValidForSlot(int i, ItemStack stack) { + return i <= 8 && CrystallizerRecipes.getAmount(stack) >= 1; + } + + @Override + public int[] getAccessibleSlotsFromSide(int side) { + return new int[] { 0, 1, 2, 3, 4, 5, 6 ,7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 }; + } + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) { + this.addStandardInfo(stack, player, list, ext); + } + + private final Random dropRandom = new Random(); + + @Override + public void breakBlock(World world, int x, int y, int z, Block block, int meta) { + TileEntity tile = world.getTileEntity(x, y, z); + if(tile instanceof IInventory) { + IInventory battery = (IInventory) tile; + for(int i = 0; i < battery.getSizeInventory(); ++i) { + ItemStack itemstack = battery.getStackInSlot(i); + if(itemstack != null) { + float f = this.dropRandom.nextFloat() * 0.8F + 0.1F; + float f1 = this.dropRandom.nextFloat() * 0.8F + 0.1F; + float f2 = this.dropRandom.nextFloat() * 0.8F + 0.1F; + while(itemstack.stackSize > 0) { + int j1 = this.dropRandom.nextInt(21) + 10; + if(j1 > itemstack.stackSize) j1 = itemstack.stackSize; + 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()); + float f3 = 0.05F; + entityitem.motionX = (float) this.dropRandom.nextGaussian() * f3; + entityitem.motionY = (float) this.dropRandom.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float) this.dropRandom.nextGaussian() * f3; + world.spawnEntityInWorld(entityitem); + } + } + } + world.func_147453_f(x, y, z, block); + } + super.breakBlock(world, x, y, z, block, meta); + } +} diff --git a/src/main/java/com/hbm/inventory/recipes/CrystallizerRecipes.java b/src/main/java/com/hbm/inventory/recipes/CrystallizerRecipes.java index 2c5867d72..fc949cec1 100644 --- a/src/main/java/com/hbm/inventory/recipes/CrystallizerRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/CrystallizerRecipes.java @@ -46,6 +46,7 @@ public class CrystallizerRecipes extends SerializableRecipe { //'Object' is either a ComparableStack or the key for the ore dict private static HashMap, CrystallizerRecipe> recipes = new HashMap(); + private static HashMap amounts = new HashMap(); // for use in the partitioner @Override public void registerDefaults() { @@ -155,17 +156,20 @@ public class CrystallizerRecipes extends SerializableRecipe { registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_NOSULFURIC, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_RAD, type), bedrock), new FluidStack(Fluids.RADIOSOLVENT, 250)); registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_NOSOLVENT, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_RAD, type), bedrock), new FluidStack(Fluids.RADIOSOLVENT, 250)); - registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_BYPRODUCT, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_WASHED, type), washing), new FluidStack(Fluids.WATER, 250)); - registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_ROASTED, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_WASHED, type), washing), new FluidStack(Fluids.WATER, 250)); - registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_ARC, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_WASHED, type), washing), new FluidStack(Fluids.WATER, 250)); + int sulf = 4; + registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_BYPRODUCT, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_WASHED, type), washing).setReq(sulf), new FluidStack(Fluids.WATER, 250)); + registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_ROASTED, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_WASHED, type), washing).setReq(sulf), new FluidStack(Fluids.WATER, 250)); + registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_ARC, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_WASHED, type), washing).setReq(sulf), new FluidStack(Fluids.WATER, 250)); - registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_BYPRODUCT, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_WASHED, type), washing), new FluidStack(Fluids.WATER, 250)); - registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_ROASTED, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_WASHED, type), washing), new FluidStack(Fluids.WATER, 250)); - registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_ARC, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_WASHED, type), washing), new FluidStack(Fluids.WATER, 250)); + int solv = 12; + registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_BYPRODUCT, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_WASHED, type), washing).setReq(solv), new FluidStack(Fluids.WATER, 250)); + registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_ROASTED, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_WASHED, type), washing).setReq(solv), new FluidStack(Fluids.WATER, 250)); + registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_ARC, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_WASHED, type), washing).setReq(solv), new FluidStack(Fluids.WATER, 250)); - registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.RAD_BYPRODUCT, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.RAD_WASHED, type), washing), new FluidStack(Fluids.WATER, 250)); - registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.RAD_ROASTED, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.RAD_WASHED, type), washing), new FluidStack(Fluids.WATER, 250)); - registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.RAD_ARC, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.RAD_WASHED, type), washing), new FluidStack(Fluids.WATER, 250)); + int rad = 24; + registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.RAD_BYPRODUCT, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.RAD_WASHED, type), washing).setReq(rad), new FluidStack(Fluids.WATER, 250)); + registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.RAD_ROASTED, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.RAD_WASHED, type), washing).setReq(rad), new FluidStack(Fluids.WATER, 250)); + registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.RAD_ARC, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.RAD_WASHED, type), washing).setReq(rad), new FluidStack(Fluids.WATER, 250)); FluidStack primary = new FluidStack(Fluids.HYDROGEN, 250); registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_FIRST, type), bedrock), primary); @@ -238,22 +242,41 @@ public class CrystallizerRecipes extends SerializableRecipe { ComparableStack comp = new ComparableStack(stack.getItem(), 1, stack.getItemDamage()); Pair compKey = new Pair(comp, type); - - if(recipes.containsKey(compKey)) - return recipes.get(compKey); + + if(recipes.containsKey(compKey)) return recipes.get(compKey); String[] dictKeys = comp.getDictKeys(); for(String key : dictKeys) { - Pair dictKey = new Pair(key, type); - - if(recipes.containsKey(dictKey)) - return recipes.get(dictKey); + if(recipes.containsKey(dictKey)) return recipes.get(dictKey); } + comp.meta = OreDictionary.WILDCARD_VALUE; + if(recipes.containsKey(compKey)) return recipes.get(compKey); + return null; } + + public static int getAmount(ItemStack stack) { + + if(stack == null || stack.getItem() == null) + return 0; + + ComparableStack comp = new ComparableStack(stack.getItem(), 1, stack.getItemDamage()); + if(amounts.containsKey(comp)) return amounts.get(comp); + + String[] dictKeys = comp.getDictKeys(); + + for(String key : dictKeys) { + if(amounts.containsKey(key)) return amounts.get(key); + } + + comp.meta = OreDictionary.WILDCARD_VALUE; + if(amounts.containsKey(comp)) return amounts.get(comp); + + return 0; + } public static HashMap getRecipes() { @@ -289,6 +312,7 @@ public class CrystallizerRecipes extends SerializableRecipe { public static void registerRecipe(Object input, CrystallizerRecipe recipe, FluidStack stack) { recipe.acidAmount = stack.fill; recipes.put(new Pair(input, stack.type), recipe); + amounts.put(input, recipe.itemAmount); } public static class CrystallizerRecipe { @@ -362,6 +386,7 @@ public class CrystallizerRecipes extends SerializableRecipe { @Override public void deleteRecipes() { recipes.clear(); + amounts.clear(); } @Override diff --git a/src/main/java/com/hbm/lib/HbmWorldGen.java b/src/main/java/com/hbm/lib/HbmWorldGen.java index 2096fb388..e17c1b0fd 100644 --- a/src/main/java/com/hbm/lib/HbmWorldGen.java +++ b/src/main/java/com/hbm/lib/HbmWorldGen.java @@ -400,8 +400,8 @@ public class HbmWorldGen implements IWorldGenerator { } if(WorldConfig.minefreq > 0 && GeneralConfig.enableMines && rand.nextInt(WorldConfig.minefreq) == 0) { - int x = i + rand.nextInt(16); - int z = j + rand.nextInt(16); + int x = i + rand.nextInt(16) + 8; + int z = j + rand.nextInt(16) + 8; int y = world.getHeightValue(x, z); if(world.getBlock(x, y - 1, z).canPlaceTorchOnTop(world, x, y - 1, z)) { diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index bb65cbe6e..ebb4661b2 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -873,6 +873,7 @@ public class ClientProxy extends ServerProxy { RenderingRegistry.registerBlockHandler(new RenderLight()); RenderingRegistry.registerBlockHandler(new RenderCRT()); RenderingRegistry.registerBlockHandler(new RenderToaster()); + RenderingRegistry.registerBlockHandler(new RenderPartitioner()); RenderingRegistry.registerBlockHandler(new RenderFoundryBasin()); RenderingRegistry.registerBlockHandler(new RenderFoundryMold()); diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index 2c3546964..10894584b 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -980,6 +980,7 @@ public class CraftingManager { addRecipeAuto(new ItemStack(ModBlocks.crane_unboxer), new Object[] { "WWW", "WPW", "CCC", 'W', KEY_STICK, 'P', Items.shears, 'C', ModBlocks.conveyor }); addRecipeAuto(new ItemStack(ModBlocks.crane_router), new Object[] { "PIP", "ICI", "PIP", 'P', DictFrame.fromOne(ModItems.part_generic, EnumPartType.PISTON_PNEUMATIC), 'I', ModItems.plate_polymer, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC) }); addRecipeAuto(new ItemStack(ModBlocks.crane_splitter), new Object[] { "III", "PCP", "III", 'P', DictFrame.fromOne(ModItems.part_generic, EnumPartType.PISTON_PNEUMATIC), 'I', STEEL.ingot(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.VACUUM_TUBE) }); + addRecipeAuto(new ItemStack(ModBlocks.crane_partitioner), new Object[] { " M ", "BCB", 'M', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CHIP), 'B', ModBlocks.conveyor, 'C', ModBlocks.crate_steel }); addRecipeAuto(new ItemStack(ModBlocks.machine_conveyor_press), new Object[] { "CPC", "CBC", "CCC", 'C', CU.plate(), 'P', ModBlocks.machine_epress, 'B', ModBlocks.conveyor }); addRecipeAuto(new ItemStack(ModBlocks.radar_screen), new Object[] { "PCP", "SRS", "PCP", 'P', ANY_PLASTIC.ingot(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), 'S', STEEL.plate(), 'R', ModItems.crt_display }); diff --git a/src/main/java/com/hbm/main/ResourceManager.java b/src/main/java/com/hbm/main/ResourceManager.java index 4df4c2649..56a731df4 100644 --- a/src/main/java/com/hbm/main/ResourceManager.java +++ b/src/main/java/com/hbm/main/ResourceManager.java @@ -1491,6 +1491,7 @@ public class ResourceManager { 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 splitter = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/splitter.obj")); + public static final IModelCustom crane_buffer = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/crane_buffer.obj")); public static final IModelCustom rail_narrow_straight = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/rail_narrow.obj")); public static final IModelCustom rail_narrow_curve = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/rail_narrow_bend.obj")); public static final IModelCustom rail_standard_straight = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/rail_standard.obj")); diff --git a/src/main/java/com/hbm/render/block/RenderPartitioner.java b/src/main/java/com/hbm/render/block/RenderPartitioner.java new file mode 100644 index 000000000..f70b68577 --- /dev/null +++ b/src/main/java/com/hbm/render/block/RenderPartitioner.java @@ -0,0 +1,75 @@ +package com.hbm.render.block; + +import org.lwjgl.opengl.GL11; + +import com.hbm.blocks.network.CranePartitioner; +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 RenderPartitioner 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.glRotated(90, 0, 1, 0); + GL11.glTranslatef(0F, -0.5F, 0F); + + tessellator.startDrawingQuads(); + drawPartitioner(tessellator, block, 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); + + int meta = world.getBlockMetadata(x, y, z); + float rotation = 0; + if(meta == 2) rotation = 90F / 180F * (float) Math.PI; + if(meta == 4) rotation = 180F / 180F * (float) Math.PI; + if(meta == 5) rotation = 0F / 180F * (float) Math.PI; + if(meta == 3) rotation = 270F / 180F * (float)Math.PI; + drawPartitioner(tessellator, block, rotation, true); + tessellator.addTranslation(-x - 0.5F, -y, -z - 0.5F); + + return true; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + private static void drawPartitioner(Tessellator tessellator, Block block, float rotation, boolean shadeNormals) { + CranePartitioner partitioner = (CranePartitioner) block; + ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.crane_buffer, "Side", partitioner.getIcon(0, 0), tessellator, rotation, shadeNormals); + ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.crane_buffer, "Back", partitioner.iconBack, tessellator, rotation, shadeNormals); + ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.crane_buffer, "Top_Top.001", partitioner.iconTop, tessellator, rotation, shadeNormals); + ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.crane_buffer, "Inner", partitioner.iconInner, tessellator, rotation, shadeNormals); + ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.crane_buffer, "InnerSide", partitioner.iconInnerSide, tessellator, rotation, shadeNormals); + ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.crane_buffer, "Belt", partitioner.iconBelt, tessellator, rotation, shadeNormals); + } + + @Override + public int getRenderId() { + return CranePartitioner.renderID; + } +} diff --git a/src/main/java/com/hbm/tileentity/TileMappings.java b/src/main/java/com/hbm/tileentity/TileMappings.java index 51ec0f7ae..3947dde60 100644 --- a/src/main/java/com/hbm/tileentity/TileMappings.java +++ b/src/main/java/com/hbm/tileentity/TileMappings.java @@ -25,6 +25,7 @@ import com.hbm.blocks.machine.WatzPump.TileEntityWatzPump; import com.hbm.blocks.network.BlockCableGauge.TileEntityCableGauge; import com.hbm.blocks.network.BlockCablePaintable.TileEntityCablePaintable; import com.hbm.blocks.network.CableDiode.TileEntityDiode; +import com.hbm.blocks.network.CranePartitioner.TileEntityCranePartitioner; import com.hbm.blocks.network.FluidDuctGauge.TileEntityPipeGauge; import com.hbm.blocks.network.FluidDuctPaintable.TileEntityPipePaintable; import com.hbm.blocks.rail.RailStandardSwitch.TileEntityRailSwitch; @@ -398,6 +399,7 @@ public class TileMappings { put(TileEntityCraneUnboxer.class, "tileentity_unboxer"); put(TileEntityCraneRouter.class, "tileentity_router"); put(TileEntityCraneSplitter.class, "tileentity_splitter"); + put(TileEntityCranePartitioner.class, "tileentity_partitioner"); put(TileEntityFan.class, "tileentity_fan"); put(TileEntityPistonInserter.class, "tileentity_piston_inserter"); diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index 16c228226..775c3984b 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -3947,6 +3947,8 @@ tile.crane_grabber.name=Förderband-Greifer tile.crane_grabber.desc=Nimmt Items von vorbeilaufenden Förderbändern und legt sie in Behälter$Nimmt nur Items von der nähesten Spur$Hat bis zu 9 Filterslots mit Black- und Whitelist$Rechstclick mit Schraubenzieher um Eingang zu definieren$Shiftclick mit Schraubenzieher um Ausgang zu definieren$Zweimal clicken, um gegenüberliegende Seite zu definieren tile.crane_inserter.name=Förderband-Einsetzer tile.crane_inserter.desc=Akzeptiert Items von Förderbändern und legt sie in Behälter$Rechstclick mit Schraubenzieher um Eingang zu definieren$Shiftclick mit Schraubenzieher um Ausgang zu definieren$Zweimal clicken, um gegenüberliegende Seite zu definieren +tile.crane_partitioner.name=Erzauflöser-Partitionierer +tile.crane_partitioner.desc=Speichert Input für den Erzazflöser$und gibt sie in der benötigten Itemanzahl aus.$Ungültige Items werden auch gespeichert, und müssen seitlich entfernt werden. tile.crane_router.name=Förderband-Sortierer tile.crane_router.desc=Sortiert Items basierend auf eingestellte Kriterien$Seiten können als Blacklist, Whitelist oder Wildcard eingestellt werden$Widlcard-Seiten werden nur verwendet, wenn kein anderer Filter zutrifft tile.crate_splitter.name=Förderband-Teiler diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 97dcf2552..85264fe13 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -5012,6 +5012,8 @@ tile.crane_grabber.name=Conveyor Grabber tile.crane_grabber.desc=Takes items from passing conveyors and places them into containers$Will only take items from the closest lane$Has up to 9 filter slots with black and whitelist$Right-click with screwdriver to set input side$Shift-click with screwdriver to set the output side$Click twice to set the opposite side tile.crane_inserter.name=Conveyor Inserter tile.crane_inserter.desc=Accepts items from conveyors and places them into containers$Right-click with screwdriver to set input side$Shift-click with screwdriver to set the output side$Click twice to set the opposite side +tile.crane_partitioner.name=Acidizer Input Paritioner +tile.crane_partitioner.desc=Receives and stores up to nine Ore Acidizer inputs$and releases them if they match the required input size.$Invalid items are also saved, and need to be extracted from the side. tile.crane_router.name=Conveyor Sorter tile.crane_router.desc=Sorts item based on defined criteria$Sides can be defined as blacklist, whitelist or wildcard$Wildcard sides are only chosen if no other filter matches tile.crane_splitter.name=Conveyor Splitter diff --git a/src/main/resources/assets/hbm/models/blocks/crane_buffer.obj b/src/main/resources/assets/hbm/models/blocks/crane_buffer.obj new file mode 100644 index 000000000..22810c603 --- /dev/null +++ b/src/main/resources/assets/hbm/models/blocks/crane_buffer.obj @@ -0,0 +1,141 @@ +# Blender v2.79 (sub 0) OBJ File: 'crane_buffer.blend' +# www.blender.org +o Back +v 0.500000 0.000000 0.500000 +v 0.500000 0.000000 -0.500000 +v 0.500000 0.750000 0.500000 +v 0.500000 0.750000 -0.500000 +vt 1.000000 0.750000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt -0.000000 0.750000 +vn 1.0000 0.0000 0.0000 +s off +f 4/1/1 1/2/1 2/3/1 +f 4/1/1 3/4/1 1/2/1 +o Side +v -0.500000 0.250000 0.375000 +v 0.500000 0.000000 0.500000 +v -0.500000 0.250000 -0.375000 +v 0.500000 0.000000 -0.500000 +v -0.500000 0.625000 0.375000 +v 0.500000 0.750000 0.500000 +v -0.500000 0.625000 -0.375000 +v 0.500000 0.750000 -0.500000 +v -0.500000 0.000000 -0.500000 +v -0.500000 0.000000 0.500000 +v -0.500000 0.750000 -0.500000 +v -0.500000 0.750000 0.500000 +vt 1.000000 0.750000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 0.750000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 0.125000 0.250000 +vt 1.000000 0.000000 +vt 0.875000 0.250000 +vt -0.000000 0.750000 +vt 0.000000 0.000000 +vt 1.000000 0.750000 +vt 0.875000 0.625000 +vt 0.125000 0.625000 +vt -0.000000 0.750000 +vt -0.000000 0.750000 +vn 0.0000 0.0000 -1.0000 +vn 0.0000 0.0000 1.0000 +vn -1.0000 0.0000 0.0000 +s off +f 15/5/2 8/6/2 13/7/2 +f 10/8/3 14/9/3 6/10/3 +f 7/11/4 14/12/4 5/13/4 +f 7/11/4 15/14/4 13/15/4 +f 5/13/4 16/16/4 9/17/4 +f 9/17/4 15/14/4 11/18/4 +f 15/5/2 12/19/2 8/6/2 +f 10/8/3 16/20/3 14/9/3 +f 7/11/4 13/15/4 14/12/4 +f 7/11/4 11/18/4 15/14/4 +f 5/13/4 14/12/4 16/16/4 +f 9/17/4 16/16/4 15/14/4 +o Inner +v 0.000000 0.250000 -0.375000 +v 0.000000 0.250000 0.375000 +v 0.000000 0.625000 -0.375000 +v 0.000000 0.625000 0.375000 +vt 0.875000 0.250000 +vt 0.125000 0.625000 +vt 0.125000 0.250000 +vt 0.875000 0.625000 +vn -1.0000 0.0000 0.0000 +s off +f 18/21/5 19/22/5 17/23/5 +f 18/21/5 20/24/5 19/22/5 +o InnerSide +v -0.500000 0.250000 0.375000 +v -0.500000 0.250000 -0.375000 +v -0.500000 0.625000 0.375000 +v -0.500000 0.625000 -0.375000 +v 0.000000 0.250000 -0.375000 +v 0.000000 0.250000 0.375000 +v 0.000000 0.625000 -0.375000 +v 0.000000 0.625000 0.375000 +vt 0.125000 1.000000 +vt 0.875000 0.500000 +vt 0.875000 1.000000 +vt 0.312500 1.000000 +vt 0.687500 0.500000 +vt 0.687500 1.000000 +vt 0.312500 1.000000 +vt 0.687500 0.500000 +vt 0.687500 1.000000 +vt 0.125000 0.500000 +vt 0.312500 0.500000 +vt 0.312500 0.500000 +vn 0.0000 -1.0000 0.0000 +vn 0.0000 0.0000 1.0000 +vn 0.0000 0.0000 -1.0000 +s off +f 24/25/6 28/26/6 23/27/6 +f 22/28/7 27/29/7 24/30/7 +f 23/31/8 26/32/8 21/33/8 +f 24/25/6 27/34/6 28/26/6 +f 22/28/7 25/35/7 27/29/7 +f 23/31/8 28/36/8 26/32/8 +o Belt +v -0.500000 0.250000 0.375000 +v -0.500000 0.250000 -0.375000 +v 0.000000 0.250000 -0.375000 +v 0.000000 0.250000 0.375000 +vt 0.875000 0.000000 +vt 0.125000 0.500000 +vt 0.125000 0.000000 +vt 0.875000 0.500000 +vn 0.0000 1.0000 0.0000 +s off +f 29/37/9 31/38/9 30/39/9 +f 29/37/9 32/40/9 31/38/9 +o Top_Top.001 +v 0.500000 0.000000 0.500000 +v 0.500000 0.000000 -0.500000 +v 0.500000 0.750000 0.500000 +v 0.500000 0.750000 -0.500000 +v -0.500000 0.000000 -0.500000 +v -0.500000 0.000000 0.500000 +v -0.500000 0.750000 -0.500000 +v -0.500000 0.750000 0.500000 +vt 0.999900 0.000100 +vt 0.000100 0.999900 +vt 0.000100 0.000100 +vt 0.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.999900 0.999900 +vt 1.000000 0.000000 +vn 0.0000 -1.0000 0.0000 +vn 0.0000 1.0000 0.0000 +s off +f 37/41/10 33/42/10 38/43/10 +f 35/44/11 39/45/11 40/46/11 +f 37/41/10 34/47/10 33/42/10 +f 35/44/11 36/48/11 39/45/11 diff --git a/src/main/resources/assets/hbm/textures/blocks/crane_partitioner_back.png b/src/main/resources/assets/hbm/textures/blocks/crane_partitioner_back.png new file mode 100644 index 000000000..96a123b22 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/blocks/crane_partitioner_back.png differ diff --git a/src/main/resources/assets/hbm/textures/blocks/crane_partitioner_side.png b/src/main/resources/assets/hbm/textures/blocks/crane_partitioner_side.png new file mode 100644 index 000000000..875d3d239 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/blocks/crane_partitioner_side.png differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_funnel_ore.png b/src/main/resources/assets/hbm/textures/blocks/machine_funnel_ore.png new file mode 100644 index 000000000..d429fc43e Binary files /dev/null and b/src/main/resources/assets/hbm/textures/blocks/machine_funnel_ore.png differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_funnel_ore_bottom.png b/src/main/resources/assets/hbm/textures/blocks/machine_funnel_ore_bottom.png new file mode 100644 index 000000000..e1062efc4 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/blocks/machine_funnel_ore_bottom.png differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_funnel_ore_side.png b/src/main/resources/assets/hbm/textures/blocks/machine_funnel_ore_side.png new file mode 100644 index 000000000..e83237b61 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/blocks/machine_funnel_ore_side.png differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_funnel_ore_top.png b/src/main/resources/assets/hbm/textures/blocks/machine_funnel_ore_top.png new file mode 100644 index 000000000..6b0e57915 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/blocks/machine_funnel_ore_top.png differ