NEI handlers, fixes, more matdefs, foundry pieces always dropping mats

This commit is contained in:
Bob 2022-10-02 20:01:36 +02:00
parent 3d1a195da5
commit b7456f1c51
46 changed files with 1059 additions and 192 deletions

View File

@ -3273,11 +3273,11 @@ public class ModBlocks {
//Industrial Factories
GameRegistry.registerBlock(factory_titanium_hull, factory_titanium_hull.getUnlocalizedName());
GameRegistry.registerBlock(factory_titanium_furnace, factory_titanium_furnace.getUnlocalizedName());
GameRegistry.registerBlock(factory_titanium_conductor, factory_titanium_conductor.getUnlocalizedName());
//GameRegistry.registerBlock(factory_titanium_furnace, factory_titanium_furnace.getUnlocalizedName());
//GameRegistry.registerBlock(factory_titanium_conductor, factory_titanium_conductor.getUnlocalizedName());
GameRegistry.registerBlock(factory_advanced_hull, factory_advanced_hull.getUnlocalizedName());
GameRegistry.registerBlock(factory_advanced_furnace, factory_advanced_furnace.getUnlocalizedName());
GameRegistry.registerBlock(factory_advanced_conductor, factory_advanced_conductor.getUnlocalizedName());
//GameRegistry.registerBlock(factory_advanced_furnace, factory_advanced_furnace.getUnlocalizedName());
//GameRegistry.registerBlock(factory_advanced_conductor, factory_advanced_conductor.getUnlocalizedName());
//The Fluid Inserter
//GameRegistry.registerBlock(machine_inserter, machine_inserter.getUnlocalizedName());

View File

@ -17,6 +17,7 @@ import api.hbm.block.ICrucibleAcceptor;
import api.hbm.block.IToolable;
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.entity.item.EntityItem;
@ -128,6 +129,25 @@ public abstract class FoundryCastingBase extends BlockContainer implements ICruc
return false;
}
@Override
public void breakBlock(World world, int x, int y, int z, Block b, int i) {
TileEntityFoundryCastingBase cast = (TileEntityFoundryCastingBase) world.getTileEntity(x, y, z);
ItemStack scrap = ItemScraps.create(new MaterialStack(cast.type, cast.amount));
EntityItem item = new EntityItem(world, x + 0.5, y + this.maxY, z + 0.5, scrap);
world.spawnEntityInWorld(item);
cast.amount = 0; //just for safety
for(ItemStack stack : cast.slots) {
if(stack != null) {
EntityItem drop = new EntityItem(world, x + 0.5, y + this.maxY, z + 0.5, stack.copy());
world.spawnEntityInWorld(drop);
}
}
super.breakBlock(world, x, y, z, b, i);
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {

View File

@ -178,4 +178,18 @@ public class FoundryChannel extends BlockContainer implements ICrucibleAcceptor
return false;
}
@Override
public void breakBlock(World world, int x, int y, int z, Block b, int i) {
TileEntityFoundryChannel channel = (TileEntityFoundryChannel) world.getTileEntity(x, y, z);
if(channel.amount > 0) {
ItemStack scrap = ItemScraps.create(new MaterialStack(channel.type, channel.amount));
EntityItem item = new EntityItem(world, x + 0.5, y + this.maxY, z + 0.5, scrap);
world.spawnEntityInWorld(item);
channel.amount = 0;
}
super.breakBlock(world, x, y, z, b, i);
}
}

View File

@ -8,7 +8,6 @@ import com.hbm.inventory.material.Mats.MaterialStack;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemScraps;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.machine.TileEntityFoundryCastingBase;
import com.hbm.tileentity.machine.TileEntityFoundryOutlet;
import com.hbm.util.I18nUtil;

View File

@ -9,6 +9,7 @@ import api.hbm.block.ICrucibleAcceptor;
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;
@ -114,6 +115,20 @@ public class FoundryTank extends BlockContainer implements ICrucibleAcceptor {
return false;
}
@Override
public void breakBlock(World world, int x, int y, int z, Block b, int i) {
TileEntityFoundryTank tank = (TileEntityFoundryTank) world.getTileEntity(x, y, z);
if(tank.amount > 0) {
ItemStack scrap = ItemScraps.create(new MaterialStack(tank.type, tank.amount));
EntityItem item = new EntityItem(world, x + 0.5, y + this.maxY, z + 0.5, scrap);
world.spawnEntityInWorld(item);
tank.amount = 0;
}
super.breakBlock(world, x, y, z, b, i);
}
@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {

View File

@ -10,6 +10,7 @@ import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntityCrucible;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
@ -87,4 +88,29 @@ public class MachineCrucible extends BlockDummyable {
public int getOffset() {
return 1;
}
@Override
public void breakBlock(World world, int x, int y, int z, Block b, int i) {
TileEntity te = world.getTileEntity(x, y, z);
if(te instanceof TileEntityCrucible) {
TileEntityCrucible crucible = (TileEntityCrucible) te;
List<MaterialStack> stacks = new ArrayList();
stacks.addAll(crucible.recipeStack);
stacks.addAll(crucible.wasteStack);
for(MaterialStack stack : stacks) {
ItemStack scrap = ItemScraps.create(new MaterialStack(stack.material, stack.amount));
EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, scrap);
world.spawnEntityInWorld(item);
}
crucible.recipeStack.clear();
crucible.wasteStack.clear();
}
super.breakBlock(world, x, y, z, b, i);
}
}

View File

@ -170,6 +170,7 @@ public class CableDiode extends BlockContainer implements ILookOverlay, IToolabl
private long subBuffer;
private long contingent = 0;
private long lastTransfer = 0;
private int pulses = 0;
@Override
public long transferPower(long power) {
@ -177,12 +178,15 @@ public class CableDiode extends BlockContainer implements ILookOverlay, IToolabl
if(recursionBrake)
return power;
pulses++;
if(lastTransfer != worldObj.getTotalWorldTime()) {
lastTransfer = worldObj.getTotalWorldTime();
contingent = getMaxPower();
pulses = 0;
}
if(contingent <= 0)
if(contingent <= 0 || pulses > 10)
return power;
//this part turns "maxPower" from a glorified transfer weight into an actual transfer cap

View File

@ -49,17 +49,17 @@ public class PowderRecipes {
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_desh_ready, 1), new Object[] { ModItems.powder_desh_mix, ModItems.ingot_mercury, ModItems.ingot_mercury, COAL.dust() });
//Metal powders
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_advanced_alloy, 4), new Object[] { REDSTONE.dust(), IRON.dust(), COAL.dust(), CU.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_advanced_alloy, 4), new Object[] { IRON.dust(), COAL.dust(), MINGRADE.dust(), MINGRADE.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_advanced_alloy, 4), new Object[] { REDSTONE.dust(), CU.dust(), STEEL.dust(), STEEL.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_advanced_alloy, 2), new Object[] { MINGRADE.dust(), STEEL.dust() });
//CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_advanced_alloy, 4), new Object[] { REDSTONE.dust(), IRON.dust(), COAL.dust(), CU.dust() });
//CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_advanced_alloy, 4), new Object[] { IRON.dust(), COAL.dust(), MINGRADE.dust(), MINGRADE.dust() });
//CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_advanced_alloy, 4), new Object[] { REDSTONE.dust(), CU.dust(), STEEL.dust(), STEEL.dust() });
//CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_advanced_alloy, 2), new Object[] { MINGRADE.dust(), STEEL.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_magnetized_tungsten, 1), new Object[] { W.dust(), SA326.nugget() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_tcalloy, 1), new Object[] { STEEL.dust(), TC99.nugget() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_red_copper, 2), new Object[] { REDSTONE.dust(), CU.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_steel, 2), new Object[] { IRON.dust(), COAL.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_dura_steel, 2), new Object[] { STEEL.dust(), W.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_dura_steel, 2), new Object[] { STEEL.dust(), CO.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_dura_steel, 4), new Object[] { IRON.dust(), COAL.dust(), W.dust(), W.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_dura_steel, 4), new Object[] { IRON.dust(), COAL.dust(), CO.dust(), CO.dust() });
//CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_red_copper, 2), new Object[] { REDSTONE.dust(), CU.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_steel, 1), new Object[] { IRON.dust(), COAL.dust() });
//CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_dura_steel, 2), new Object[] { STEEL.dust(), W.dust() });
//CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_dura_steel, 2), new Object[] { STEEL.dust(), CO.dust() });
//CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_dura_steel, 4), new Object[] { IRON.dust(), COAL.dust(), W.dust(), W.dust() });
//CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_dura_steel, 4), new Object[] { IRON.dust(), COAL.dust(), CO.dust(), CO.dust() });
}
}

View File

@ -206,6 +206,7 @@ public class EntityMappings {
addEntity(EntitySiegeTunneler.class, "entity_meme_tunneler", 1000);
addEntity(EntitySPV.class, "entity_self_propelled_vehicle_mark_1", 1000);
addEntity(EntityCog.class, "entity_stray_cog", 1000);
addEntity(EntitySawblade.class, "entity_stray_saw", 1000);
addEntity(EntityChemical.class, "entity_chemthrower_splash", 1000);
addMob(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", 0x204131, 0x75CE00);

View File

@ -0,0 +1,161 @@
package com.hbm.entity.projectile;
import com.hbm.items.ModItems;
import com.hbm.lib.ModDamageSource;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class EntitySawblade extends EntityThrowableInterp {
public EntitySawblade(World world) {
super(world);
this.setSize(1F, 1F);
}
public EntitySawblade(World world, double x, double y, double z) {
super(world, x, y, z);
this.setSize(1F, 1F);
}
@Override
protected void entityInit() {
super.entityInit();
this.dataWatcher.addObject(10, new Integer(0));
this.dataWatcher.addObject(11, new Integer(0));
}
public EntitySawblade setOrientation(int rot) {
this.dataWatcher.updateObject(10, rot);
return this;
}
public int getOrientation() {
return this.dataWatcher.getWatchableObjectInt(10);
}
public int getMeta() {
return this.dataWatcher.getWatchableObjectInt(11);
}
@Override
public boolean interactFirst(EntityPlayer player) {
if(!worldObj.isRemote) {
if(player.inventory.addItemStackToInventory(new ItemStack(ModItems.sawblade)))
this.setDead();
player.inventoryContainer.detectAndSendChanges();
}
return false;
}
@Override
public boolean canBeCollidedWith() {
return true;
}
@Override
protected void onImpact(MovingObjectPosition mop) {
if(worldObj != null && mop != null && mop.typeOfHit == MovingObjectType.ENTITY && mop.entityHit.isEntityAlive()) {
Entity e = mop.entityHit;
e.attackEntityFrom(ModDamageSource.rubble, 1000);
if(!e.isEntityAlive() && e instanceof EntityLivingBase) {
NBTTagCompound vdat = new NBTTagCompound();
vdat.setString("type", "giblets");
vdat.setInteger("ent", e.getEntityId());
vdat.setInteger("cDiv", 5);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(vdat, e.posX, e.posY + e.height * 0.5, e.posZ), new TargetPoint(e.dimension, e.posX, e.posY + e.height * 0.5, e.posZ, 150));
worldObj.playSoundEffect(e.posX, e.posY, e.posZ, "mob.zombie.woodbreak", 2.0F, 0.95F + worldObj.rand.nextFloat() * 0.2F);
}
}
if(this.ticksExisted > 1 && worldObj != null && mop != null && mop.typeOfHit == MovingObjectType.BLOCK) {
int orientation = this.dataWatcher.getWatchableObjectInt(10);
if(orientation < 6) {
if(Vec3.createVectorHelper(motionX, motionY, motionZ).lengthVector() < 0.75) {
this.dataWatcher.updateObject(10, orientation + 6);
orientation += 6;
} else {
ForgeDirection side = ForgeDirection.getOrientation(mop.sideHit);
this.motionX *= 1 - (Math.abs(side.offsetX) * 2);
this.motionY *= 1 - (Math.abs(side.offsetY) * 2);
this.motionZ *= 1 - (Math.abs(side.offsetZ) * 2);
worldObj.createExplosion(this, posX, posY, posZ, 3F, false);
if(worldObj.getBlock(mop.blockX, mop.blockY, mop.blockZ).getExplosionResistance(this) < 50) {
worldObj.func_147480_a(mop.blockX, mop.blockY, mop.blockZ, false);
}
}
}
if(orientation >= 6) {
this.motionX = 0;
this.motionY = 0;
this.motionZ = 0;
this.inGround = true;
}
}
}
@Override
public void onUpdate() {
if(!worldObj.isRemote) {
int orientation = this.dataWatcher.getWatchableObjectInt(10);
if(orientation >= 6 && !this.inGround) {
this.dataWatcher.updateObject(10, orientation - 6);
}
}
super.onUpdate();
}
@Override
@SideOnly(Side.CLIENT)
public boolean isInRangeToRenderDist(double distance) {
return true;
}
@Override
public double getGravityVelocity() {
return inGround ? 0 : 0.03D;
}
@Override
protected int groundDespawn() {
return 0;
}
@Override
public void writeEntityToNBT(NBTTagCompound nbt) {
super.writeEntityToNBT(nbt);
nbt.setInteger("rot", this.getOrientation());
}
@Override
public void readEntityFromNBT(NBTTagCompound nbt) {
super.readEntityFromNBT(nbt);
this.setOrientation(nbt.getInteger("rot"));
}
}

View File

@ -0,0 +1,152 @@
package com.hbm.handler.nei;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.material.Mats;
import com.hbm.inventory.material.Mats.MaterialStack;
import com.hbm.inventory.material.NTMMaterial;
import com.hbm.inventory.recipes.CrucibleRecipes;
import com.hbm.inventory.recipes.CrucibleRecipes.CrucibleRecipe;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemScraps;
import com.hbm.lib.RefStrings;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class CrucibleAlloyingHandler extends TemplateRecipeHandler {
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
List<PositionedStack> inputs = new ArrayList();
PositionedStack template;
PositionedStack crucible;
List<PositionedStack> outputs = new ArrayList();
public RecipeSet(CrucibleRecipe recipe) {
List<ItemStack> inputs = new ArrayList();
List<ItemStack> outputs = new ArrayList();
for(MaterialStack stack : recipe.input) inputs.add(ItemScraps.create(stack));
for(MaterialStack stack : recipe.output) outputs.add(ItemScraps.create(stack));
this.template = new PositionedStack(new ItemStack(ModItems.crucible_template, 1, recipe.getId()), 75, 6);
this.crucible = new PositionedStack(new ItemStack(ModBlocks.machine_crucible), 75, 42);
for(int i = 0; i < inputs.size(); i++) {
PositionedStack pos = new PositionedStack(inputs.get(i), 12 + (i % 3) * 18, 6 + (i / 3) * 18);
this.inputs.add(pos);
}
for(int i = 0; i < outputs.size(); i++) {
PositionedStack pos = new PositionedStack(outputs.get(i), 102 + (i % 3) * 18, 6 + (i / 3) * 18);
this.outputs.add(pos);
}
}
@Override
public List<PositionedStack> getIngredients() {
return getCycledIngredients(cycleticks / 20, inputs);
}
@Override
public PositionedStack getResult() {
return outputs.get(0);
}
@Override
public List<PositionedStack> getOtherStacks() {
List<PositionedStack> other = new ArrayList();
other.addAll(inputs);
other.add(crucible);
other.add(template);
other.addAll(outputs);
return getCycledIngredients(cycleticks / 20, other);
}
}
@Override
public String getRecipeName() {
return "Crucible Alloying";
}
@Override
public String getGuiTexture() {
return RefStrings.MODID + ":textures/gui/nei/gui_nei_crucible.png";
}
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if(outputId.equals("ntmCrucibleAlloying")) {
for(CrucibleRecipe recipe : CrucibleRecipes.recipes) {
this.arecipes.add(new RecipeSet(recipe));
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
@Override
public void loadCraftingRecipes(ItemStack result) {
if(result.getItem() != ModItems.scraps)
return;
NTMMaterial material = Mats.matById.get(result.getItemDamage());
for(CrucibleRecipe recipe : CrucibleRecipes.recipes) {
for(MaterialStack stack : recipe.output) {
if(stack.material == material) {
this.arecipes.add(new RecipeSet(recipe));
break;
}
}
}
}
@Override
public void loadUsageRecipes(String inputId, Object... ingredients) {
if(inputId.equals("ntmCrucibleAlloying")) {
loadCraftingRecipes("ntmCrucibleAlloying", new Object[0]);
} else {
super.loadUsageRecipes(inputId, ingredients);
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
if(ingredient.getItem() != ModItems.scraps)
return;
NTMMaterial material = Mats.matById.get(ingredient.getItemDamage());
for(CrucibleRecipe recipe : CrucibleRecipes.recipes) {
for(MaterialStack stack : recipe.input) {
if(stack.material == material) {
this.arecipes.add(new RecipeSet(recipe));
break;
}
}
}
}
@Override
public void loadTransferRects() {
transferRects.add(new RecipeTransferRect(new Rectangle(65, 23, 36, 18), "ntmCrucibleAlloying"));
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
}
}

View File

@ -0,0 +1,124 @@
package com.hbm.handler.nei;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import com.hbm.inventory.material.Mats;
import com.hbm.inventory.recipes.CrucibleRecipes;
import com.hbm.items.machine.ItemMold;
import com.hbm.lib.RefStrings;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class CrucibleCastingHandler extends TemplateRecipeHandler {
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
PositionedStack input;
PositionedStack mold;
PositionedStack basin;
PositionedStack output;
public RecipeSet(ItemStack[] stacks) {
this.input = new PositionedStack(stacks[0].copy(), 48, 24);
this.mold = new PositionedStack(stacks[1].copy(), 75, 6);
this.basin = new PositionedStack(stacks[2].copy(), 75, 42);
//through reasons i cannot explain, stacks[3]'s stack size does not survive until this point.
ItemStack o = ItemMold.moldById.get(stacks[1].getItemDamage()).getOutput(Mats.matById.get(stacks[0].getItemDamage()));
this.output = new PositionedStack(o.copy(), 102, 24);
}
@Override
public List<PositionedStack> getIngredients() {
return getCycledIngredients(cycleticks / 20, Arrays.asList(input, mold, basin));
}
@Override
public PositionedStack getResult() {
return output;
}
@Override
public List<PositionedStack> getOtherStacks() {
List<PositionedStack> other = new ArrayList();
other.add(input);
other.add(mold);
other.add(basin);
other.add(output);
return getCycledIngredients(cycleticks / 20, other);
}
}
@Override
public String getRecipeName() {
return "Crucible Casting";
}
@Override
public String getGuiTexture() {
return RefStrings.MODID + ":textures/gui/nei/gui_nei_foundry.png";
}
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if(outputId.equals("ntmCrucibleFoundry")) {
for(ItemStack[] recipe : CrucibleRecipes.moldRecipes) {
this.arecipes.add(new RecipeSet(recipe));
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
@Override
public void loadCraftingRecipes(ItemStack result) {
for(ItemStack[] recipe : CrucibleRecipes.moldRecipes) {
if(NEIServerUtils.areStacksSameTypeCrafting(recipe[3], result)) {
this.arecipes.add(new RecipeSet(recipe));
}
}
}
@Override
public void loadUsageRecipes(String inputId, Object... ingredients) {
if(inputId.equals("ntmCrucibleFoundry")) {
loadCraftingRecipes("ntmCrucibleFoundry", new Object[0]);
} else {
super.loadUsageRecipes(inputId, ingredients);
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
for(ItemStack[] recipe : CrucibleRecipes.moldRecipes) {
for(int i = 0; i < 3; i++) {
if(NEIServerUtils.areStacksSameTypeCrafting(recipe[i], ingredient)) {
this.arecipes.add(new RecipeSet(recipe));
break;
}
}
}
}
@Override
public void loadTransferRects() {
transferRects.add(new RecipeTransferRect(new Rectangle(65, 23, 36, 18), "ntmCrucibleFoundry"));
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
}
}

View File

@ -0,0 +1,130 @@
package com.hbm.handler.nei;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map.Entry;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.recipes.CrucibleRecipes;
import com.hbm.lib.RefStrings;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class CrucibleSmeltingHandler extends TemplateRecipeHandler {
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
PositionedStack input;
PositionedStack crucible;
List<PositionedStack> outputs = new ArrayList();
public RecipeSet(AStack input, List<ItemStack> outputs) {
this.input = new PositionedStack(input.extractForNEI(), 48, 24);
this.crucible = new PositionedStack(new ItemStack(ModBlocks.machine_crucible), 75, 42);
for(int i = 0; i < outputs.size(); i++) {
PositionedStack pos = new PositionedStack(outputs.get(i), 102 + (i % 3) * 18, 6 + (i / 3) * 18);
this.outputs.add(pos);
}
}
@Override
public List<PositionedStack> getIngredients() {
return getCycledIngredients(cycleticks / 20, Arrays.asList(input));
}
@Override
public PositionedStack getResult() {
return outputs.get(0);
}
@Override
public List<PositionedStack> getOtherStacks() {
List<PositionedStack> other = new ArrayList();
other.add(input);
other.add(crucible);
other.addAll(outputs);
return getCycledIngredients(cycleticks / 20, other);
}
}
@Override
public String getRecipeName() {
return "Crucible Smelting";
}
@Override
public String getGuiTexture() {
return RefStrings.MODID + ":textures/gui/nei/gui_nei_crucible_smelting.png";
}
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if(outputId.equals("ntmCrucibleSmelting")) {
HashMap<AStack, List<ItemStack>> smelting = CrucibleRecipes.getSmeltingRecipes();
for(Entry<AStack, List<ItemStack>> recipe : smelting.entrySet()) {
this.arecipes.add(new RecipeSet(recipe.getKey(), recipe.getValue()));
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
@Override
public void loadCraftingRecipes(ItemStack result) {
HashMap<AStack, List<ItemStack>> smelting = CrucibleRecipes.getSmeltingRecipes();
for(Entry<AStack, List<ItemStack>> recipe : smelting.entrySet()) {
for(ItemStack stack : recipe.getValue()) {
if(NEIServerUtils.areStacksSameTypeCrafting(stack, result)) {
this.arecipes.add(new RecipeSet(recipe.getKey(), recipe.getValue()));
break;
}
}
}
}
@Override
public void loadUsageRecipes(String inputId, Object... ingredients) {
if(inputId.equals("ntmCrucibleSmelting")) {
loadCraftingRecipes("ntmCrucibleSmelting", new Object[0]);
} else {
super.loadUsageRecipes(inputId, ingredients);
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
HashMap<AStack, List<ItemStack>> smelting = CrucibleRecipes.getSmeltingRecipes();
for(Entry<AStack, List<ItemStack>> recipe : smelting.entrySet()) {
if(recipe.getKey().matchesRecipe(ingredient, true)) {
this.arecipes.add(new RecipeSet(recipe.getKey(), recipe.getValue()));
}
}
}
@Override
public void loadTransferRects() {
transferRects.add(new RecipeTransferRect(new Rectangle(65, 23, 36, 18), "ntmCrucibleSmelting"));
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
}
}

View File

@ -177,13 +177,8 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
@Override
public void loadTransferRects() {
transferRectsGui = new LinkedList<RecipeTransferRect>();
//guiGui = new LinkedList<Class<? extends GuiContainer>>();
transferRects.add(new RecipeTransferRect(new Rectangle(147, 1, 18, 18), getKey()));
//transferRectsGui.add(new RecipeTransferRect(new Rectangle(18 * 2 + 2, 89 - 7 - 11, 18 * 5 - 4, 18 + 16), key));
//guiGui.add(GUIMachineAssembler.class);
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
//RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
}
public abstract String getKey();

View File

@ -170,6 +170,7 @@ public class OreDictManager {
public static final DictFrame DESH = new DictFrame("WorkersAlloy");
public static final DictFrame STAR = new DictFrame("Starmetal");
public static final DictFrame BIGMT = new DictFrame("Saturnite");
public static final DictFrame FERRO = new DictFrame("Ferrouranium");
public static final DictFrame EUPH = new DictFrame("Euphemium");
public static final DictFrame DNT = new DictFrame("Dineutronium");
public static final DictFrame FIBER = new DictFrame("Fiberglass");
@ -338,6 +339,7 @@ public class OreDictManager {
DESH .nugget(nugget_desh) .ingot(ingot_desh) .dust(powder_desh) .block(block_desh);
STAR .ingot(ingot_starmetal) .block(block_starmetal) .ore(ore_meteor_starmetal);
BIGMT .ingot(ingot_saturnite) .plate(plate_saturnite);
FERRO .ingot(ingot_ferrouranium);
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);

View File

@ -24,29 +24,29 @@ public class GUICoreEmitter extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/dfc/gui_emitter.png");
private TileEntityCoreEmitter emitter;
private GuiTextField field;
private GuiTextField field;
public GUICoreEmitter(InventoryPlayer invPlayer, TileEntityCoreEmitter tedf) {
super(new ContainerCoreEmitter(invPlayer, tedf));
emitter = tedf;
this.xSize = 176;
this.ySize = 166;
}
public void initGui() {
super.initGui();
Keyboard.enableRepeatEvents(true);
this.field = new GuiTextField(this.fontRendererObj, guiLeft + 57, guiTop + 57, 29, 12);
this.field.setTextColor(-1);
this.field.setDisabledTextColour(-1);
this.field.setEnableBackgroundDrawing(false);
this.field.setMaxStringLength(3);
this.field.setText(String.valueOf(emitter.watts));
Keyboard.enableRepeatEvents(true);
this.field = new GuiTextField(this.fontRendererObj, guiLeft + 57, guiTop + 57, 29, 12);
this.field.setTextColor(-1);
this.field.setDisabledTextColour(-1);
this.field.setEnableBackgroundDrawing(false);
this.field.setMaxStringLength(3);
this.field.setText(String.valueOf(emitter.watts));
}
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
@ -54,38 +54,38 @@ public class GUICoreEmitter extends GuiInfoContainer {
emitter.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 17, 16, 52);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 26, guiTop + 17, 16, 52, emitter.power, emitter.maxPower);
}
protected void mouseClicked(int x, int y, int i) {
super.mouseClicked(x, y, i);
this.field.mouseClicked(x, y, i);
if(guiLeft + 97 <= x && guiLeft + 97 + 18 > x && guiTop + 52 < y && guiTop + 52 + 18 >= y) {
if(NumberUtils.isNumber(field.getText())) {
int j = MathHelper.clamp_int((int)Double.parseDouble(field.getText()), 1, 100);
field.setText(j + "");
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(emitter.xCoord, emitter.yCoord, emitter.zCoord, j, 0));
}
}
if(guiLeft + 97 <= x && guiLeft + 97 + 18 > x && guiTop + 52 < y && guiTop + 52 + 18 >= y) {
if(guiLeft + 133 <= x && guiLeft + 133 + 18 > x && guiTop + 52 < y && guiTop + 52 + 18 >= y) {
if(NumberUtils.isNumber(field.getText())) {
int j = MathHelper.clamp_int((int) Double.parseDouble(field.getText()), 1, 100);
field.setText(j + "");
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(emitter.xCoord, emitter.yCoord, emitter.zCoord, j, 0));
}
}
if(guiLeft + 133 <= x && guiLeft + 133 + 18 > x && guiTop + 52 < y && guiTop + 52 + 18 >= y) {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(emitter.xCoord, emitter.yCoord, emitter.zCoord, 0, 1));
}
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(emitter.xCoord, emitter.yCoord, emitter.zCoord, 0, 1));
}
}
@Override
protected void drawGuiContainerForegroundLayer( int i, int j) {
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = I18n.format(this.emitter.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString("Output: " + BobMathUtil.getShortNumber(emitter.prev) + "Spk", 50, 30, 0xFF7F7F);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
@Override
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);
@ -99,19 +99,19 @@ public class GUICoreEmitter extends GuiInfoContainer {
drawTexturedModalRect(guiLeft + 133, guiTop + 52, 192, 0, 18, 18);
drawTexturedModalRect(guiLeft + 53, guiTop + 45, 210, 0, emitter.watts * 34 / 100, 4);
int i = (int) emitter.getPowerScaled(52);
drawTexturedModalRect(guiLeft + 26, guiTop + 69 - i, 176, 52 - i, 16, i);
this.field.drawTextBox();
emitter.tank.renderTank(guiLeft + 8, guiTop + 69, this.zLevel, 16, 52);
}
protected void keyTyped(char p_73869_1_, int p_73869_2_) {
if(this.field.textboxKeyTyped(p_73869_1_, p_73869_2_)) {
} else {
super.keyTyped(p_73869_1_, p_73869_2_);
}

View File

@ -21,8 +21,8 @@ public class GUINukeFstbmb extends GuiInfoContainer {
public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/weapon/fstbmbSchematic.png");
private TileEntityNukeBalefire bomb;
private GuiTextField timer;
private GuiTextField timer;
public GUINukeFstbmb(InventoryPlayer invPlayer, TileEntityNukeBalefire bomb) {
super(new ContainerNukeFstbmb(invPlayer, bomb));
this.bomb = bomb;
@ -30,89 +30,88 @@ public class GUINukeFstbmb extends GuiInfoContainer {
this.xSize = 176;
this.ySize = 222;
}
public void initGui() {
super.initGui();
Keyboard.enableRepeatEvents(true);
this.timer = new GuiTextField(this.fontRendererObj, guiLeft + 94, guiTop + 40, 29, 12);
this.timer.setTextColor(0xff0000);
this.timer.setDisabledTextColour(0x800000);
this.timer.setEnableBackgroundDrawing(false);
this.timer.setMaxStringLength(3);
this.timer.setText(String.valueOf(bomb.timer / 20));
Keyboard.enableRepeatEvents(true);
this.timer = new GuiTextField(this.fontRendererObj, guiLeft + 94, guiTop + 40, 29, 12);
this.timer.setTextColor(0xff0000);
this.timer.setDisabledTextColour(0x800000);
this.timer.setEnableBackgroundDrawing(false);
this.timer.setMaxStringLength(3);
this.timer.setText(String.valueOf(bomb.timer / 20));
}
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
}
protected void mouseClicked(int x, int y, int i) {
super.mouseClicked(x, y, i);
this.timer.mouseClicked(x, y, i);
super.mouseClicked(x, y, i);
this.timer.mouseClicked(x, y, i);
if(!bomb.started) {
if(guiLeft + 142 <= x && guiLeft + 142 + 18 > x && guiTop + 35 < y && guiTop + 35 + 18 >= y) {
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(bomb.xCoord, bomb.yCoord, bomb.zCoord, 0, 0));
}
if(guiLeft + 142 <= x && guiLeft + 142 + 18 > x && guiTop + 35 < y && guiTop + 35 + 18 >= y) {
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(bomb.xCoord, bomb.yCoord, bomb.zCoord, 0, 0));
}
}
}
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.bomb.hasCustomInventoryName() ? this.bomb.getInventoryName() : I18n.format(this.bomb.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
if(bomb.hasBattery()) {
String timer = bomb.getMinutes() + ":" + bomb.getSeconds();
double scale = 0.75;
GL11.glScaled(scale, scale, scale);
this.fontRendererObj.drawString(timer, (int) ((69 - this.fontRendererObj.getStringWidth(timer) / 2) * (1/scale)), (int) (95.5 * (1/scale)), 0xff0000);
this.fontRendererObj.drawString(timer, (int) ((69 - this.fontRendererObj.getStringWidth(timer) / 2) * (1 / scale)), (int) (95.5 * (1 / scale)), 0xff0000);
GL11.glScaled(1/scale, 1/scale, 1/scale);
GL11.glScaled(1 / scale, 1 / scale, 1 / scale);
}
}
@Override
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);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if(bomb.hasEgg())
drawTexturedModalRect(guiLeft + 19, guiTop + 90, 176, 0, 30, 16);
int battery = bomb.getBattery();
if(battery == 1)
drawTexturedModalRect(guiLeft + 88, guiTop + 93, 176, 16, 18, 10);
else if(battery == 2)
drawTexturedModalRect(guiLeft + 88, guiTop + 93, 194, 16, 18, 10);
if(bomb.started)
drawTexturedModalRect(guiLeft + 142, guiTop + 35, 176, 26, 18, 18);
this.timer.drawTextBox();
}
protected void keyTyped(char p_73869_1_, int p_73869_2_) {
if (this.timer.textboxKeyTyped(p_73869_1_, p_73869_2_)) {
if(NumberUtils.isNumber(timer.getText())) {
int j = MathHelper.clamp_int(Integer.parseInt(timer.getText()), 1, 999);
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(bomb.xCoord, bomb.yCoord, bomb.zCoord, j, 1));
}
} else {
super.keyTyped(p_73869_1_, p_73869_2_);
}
}
this.timer.drawTextBox();
}
protected void keyTyped(char p_73869_1_, int p_73869_2_) {
if(this.timer.textboxKeyTyped(p_73869_1_, p_73869_2_)) {
if(NumberUtils.isNumber(timer.getText())) {
int j = MathHelper.clamp_int((int) Double.parseDouble(timer.getText()), 1, 999);
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(bomb.xCoord, bomb.yCoord, bomb.zCoord, j, 1));
}
} else {
super.keyTyped(p_73869_1_, p_73869_2_);
}
}
}

View File

@ -24,8 +24,8 @@ public class MatDistribution {
registerOre("cobblestone", MAT_STONE, BLOCK.q(1));
registerEntry(Blocks.obsidian, MAT_OBSIDIAN, BLOCK.q(1));
registerEntry(Blocks.rail, MAT_IRON, INGOT.q(6, 16));
registerEntry(Blocks.golden_rail, MAT_GOLD, INGOT.q(6), MAT_REDSTONE, DUST.q(1));
registerEntry(Blocks.detector_rail, MAT_IRON, INGOT.q(6), MAT_REDSTONE, DUST.q(1));
registerEntry(Blocks.golden_rail, MAT_GOLD, INGOT.q(6, 6), MAT_REDSTONE, DUST.q(1, 6));
registerEntry(Blocks.detector_rail, MAT_IRON, INGOT.q(6, 6), MAT_REDSTONE, DUST.q(1, 6));
registerEntry(Items.minecart, MAT_IRON, INGOT.q(5));
//castables
@ -53,9 +53,18 @@ public class MatDistribution {
registerEntry(ModItems.pipes_steel, MAT_STEEL, BLOCK.q(3));
//actual ores
registerOre(OreDictManager.COAL.ore(), MAT_IRON, INGOT.q(4), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.IRON.ore(), MAT_IRON, INGOT.q(3), MAT_TITANIUM, INGOT.q(1), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.GOLD.ore(), MAT_GOLD, INGOT.q(3), MAT_LEAD, INGOT.q(1), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.COAL.ore(), MAT_COAL, GEM.q(4), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.IRON.ore(), MAT_IRON, INGOT.q(2), MAT_TITANIUM, NUGGET.q(3), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.GOLD.ore(), MAT_GOLD, INGOT.q(2), MAT_LEAD, NUGGET.q(3), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.U.ore(), MAT_URANIUM, INGOT.q(2), MAT_LEAD, NUGGET.q(3), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.TH232.ore(), MAT_THORIUM, INGOT.q(2), MAT_URANIUM, NUGGET.q(3), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.TI.ore(), MAT_TITANIUM, INGOT.q(2), MAT_IRON, NUGGET.q(3), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.CU.ore(), MAT_COPPER, INGOT.q(2), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.W.ore(), MAT_TUNGSTEN, INGOT.q(2), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.AL.ore(), MAT_ALUMINIUM, INGOT.q(2), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.PB.ore(), MAT_LEAD, INGOT.q(2), MAT_GOLD, NUGGET.q(1), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.BE.ore(), MAT_BERYLLIUM, INGOT.q(2), MAT_STONE, QUART.q(1));
registerOre(OreDictManager.CO.ore(), MAT_COBALT, INGOT.q(1), MAT_STONE, QUART.q(1));
}
public static void registerEntry(Object key, Object... matDef) {

View File

@ -8,6 +8,8 @@ public enum MaterialShapes {
WIRE(9),
BILLET(NUGGET.quantity * 6, "billet"),
INGOT(NUGGET.quantity * 9, "ingot"),
GEM(INGOT.quantity, "gem"),
CRYSTAL(INGOT.quantity, "crystal"),
DUST(INGOT.quantity, "dust"),
PLATE(INGOT.quantity, "plate"),
QUART(162),

View File

@ -49,46 +49,51 @@ public class Mats {
public static final NTMMaterial MAT_STONE = makeSmeltable(_VS + 00, df("Stone"), 0x4D2F23).omitAutoGen();
public static final NTMMaterial MAT_COAL = makeAdditive( 1400, COAL, 0x583434).omitAutoGen();
public static final NTMMaterial MAT_LIGNITE = makeAdditive( 1401, LIGNITE, 0x715444);
public static final NTMMaterial MAT_COALCOKE = makeAdditive( 1410, COALCOKE, 0);
public static final NTMMaterial MAT_PETCOKE = makeAdditive( 1411, PETCOKE, 0);
public static final NTMMaterial MAT_LIGCOKE = makeAdditive( 1412, LIGCOKE, 0);
public static final NTMMaterial MAT_GRAPHITE = makeAdditive( 1420, GRAPHITE, 0);
public static final NTMMaterial MAT_COALCOKE = makeAdditive( 1410, COALCOKE, 0x3B3B3B);
public static final NTMMaterial MAT_PETCOKE = makeAdditive( 1411, PETCOKE, 0x71645C);
public static final NTMMaterial MAT_LIGCOKE = makeAdditive( 1412, LIGCOKE, 0x725644);
public static final NTMMaterial MAT_GRAPHITE = makeAdditive( 1420, GRAPHITE, 0x666666);
public static final NTMMaterial MAT_IRON = makeSmeltable(2600, IRON, 0xFFA259).omitAutoGen();
public static final NTMMaterial MAT_GOLD = makeSmeltable(7900, GOLD, 0xE8D754).omitAutoGen();
public static final NTMMaterial MAT_REDSTONE = makeSmeltable(_VS + 01, REDSTONE, 0xFF1000).omitAutoGen();
public static final NTMMaterial MAT_OBSIDIAN = makeSmeltable(_VS + 02, df("Obsidian"), 0x3D234D).omitAutoGen();
//Radioactive
public static final NTMMaterial MAT_URANIUM = makeSmeltable(9200, U, 0).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_THORIUM = makeSmeltable(9232, TH232, 0).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_PLUTONIUM = makeSmeltable(9400, PU, 0).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_RADIUM = makeSmeltable(8826, RA226, 0).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_SCHRABIDIUM = makeSmeltable(12626, SA326, 0).setShapes(NUGGET, WIRE, BILLET, INGOT, DUST, PLATE, BLOCK);
public static final NTMMaterial MAT_URANIUM = makeSmeltable(9200, U, 0x9AA196).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_U233 = makeSmeltable(9233, U233, 0x9AA196).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_U235 = makeSmeltable(9235, U235, 0x9AA196).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_U238 = makeSmeltable(9238, U238, 0x9AA196).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_THORIUM = makeSmeltable(9032, TH232, 0xBF825F).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_PLUTONIUM = makeSmeltable(9400, PU, 0x78817E).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_TECHNIETIUM = makeSmeltable(4399, TC99, 0xCADFDF).setShapes(NUGGET, BILLET, INGOT, BLOCK);
public static final NTMMaterial MAT_RADIUM = makeSmeltable(8826, RA226, 0xE9FAF6).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_SCHRABIDIUM = makeSmeltable(12626, SA326, 0x32FFFF).setShapes(NUGGET, WIRE, BILLET, INGOT, DUST, PLATE, BLOCK);
//Base metals
public static final NTMMaterial MAT_TITANIUM = makeSmeltable(2200, TI, 0xA99E79).setShapes(INGOT, DUST, PLATE, BLOCK);
public static final NTMMaterial MAT_COPPER = makeSmeltable(2900, CU, 0xC18336).setShapes(WIRE, INGOT, DUST, PLATE, BLOCK);
public static final NTMMaterial MAT_TUNGSTEN = makeSmeltable(7400, W, 0).setShapes(WIRE, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_ALUMINIUM = makeSmeltable(1300, AL, 0).setShapes(WIRE, INGOT, DUST, PLATE, BLOCK);
public static final NTMMaterial MAT_LEAD = makeSmeltable(8200, PB, 0).setShapes(NUGGET, INGOT, DUST, PLATE, BLOCK);
public static final NTMMaterial MAT_BISMUTH = makeSmeltable(8300, df("Bismuth"), 0).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_ARSENIC = makeSmeltable(3300, AS, 0).setShapes(NUGGET, INGOT);
public static final NTMMaterial MAT_TANTALIUM = makeSmeltable(7300, TA, 0).setShapes(NUGGET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_NIOBIUM = makeSmeltable(4100, NB, 0).setShapes(NUGGET, DUSTTINY, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_BERYLLIUM = makeSmeltable(400, BE, 0).setShapes(NUGGET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_COBALT = makeSmeltable(2700, CO, 0).setShapes(NUGGET, DUSTTINY, BILLET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_BORON = makeSmeltable(500, B, 0).setShapes(DUSTTINY, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_TUNGSTEN = makeSmeltable(7400, W, 0x977474).setShapes(WIRE, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_ALUMINIUM = makeSmeltable(1300, AL, 0xD0B8EB).setShapes(WIRE, INGOT, DUST, PLATE, BLOCK);
public static final NTMMaterial MAT_LEAD = makeSmeltable(8200, PB, 0x646470).setShapes(NUGGET, INGOT, DUST, PLATE, BLOCK);
public static final NTMMaterial MAT_BISMUTH = makeSmeltable(8300, df("Bismuth"), 0xB200FF).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_ARSENIC = makeSmeltable(3300, AS, 0x558080).setShapes(NUGGET, INGOT);
public static final NTMMaterial MAT_TANTALIUM = makeSmeltable(7300, TA, 0xA89B74).setShapes(NUGGET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_NIOBIUM = makeSmeltable(4100, NB, 0xD576B1).setShapes(NUGGET, DUSTTINY, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_BERYLLIUM = makeSmeltable(400, BE, 0xAE9572).setShapes(NUGGET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_COBALT = makeSmeltable(2700, CO, 0x8F72AE).setShapes(NUGGET, DUSTTINY, BILLET, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_BORON = makeSmeltable(500, B, 0xAD72AE).setShapes(DUSTTINY, INGOT, DUST, BLOCK);
//Alloys
public static final NTMMaterial MAT_STEEL = makeSmeltable(_AS + 0, STEEL, 0x4A4A4A).setShapes(DUSTTINY, INGOT, DUST, PLATE, BLOCK);
public static final NTMMaterial MAT_MINGRADE = makeSmeltable(_AS + 1, MINGRADE, 0xE44C0F).setShapes(WIRE, INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_ALLOY = makeSmeltable(_AS + 2, ALLOY, 0xFF7318).setShapes(WIRE, INGOT, DUST, PLATE, BLOCK);
public static final NTMMaterial MAT_DURA = makeSmeltable(_AS + 3, DURA, 0).setShapes(INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_SATURN = makeSmeltable(_AS + 4, BIGMT, 0).setShapes(INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_STAR = makeSmeltable(_AS + 5, STAR, 0).setShapes(INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_TCALLOY = makeSmeltable(_AS + 6, TCALLOY, 0).setShapes(INGOT, DUST);
public static final NTMMaterial MAT_MAGTUNG = makeSmeltable(_AS + 7, MAGTUNG, 0).setShapes(INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_CMB = makeSmeltable(_AS + 8, CMB, 0).setShapes(INGOT, DUST, PLATE, BLOCK);
public static final NTMMaterial MAT_DURA = makeSmeltable(_AS + 3, DURA, 0x376373).setShapes(INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_SATURN = makeSmeltable(_AS + 4, BIGMT, 0x4DA3AF).setShapes(INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_STAR = makeSmeltable(_AS + 5, STAR, 0xA5A5D3).setShapes(INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_TCALLOY = makeSmeltable(_AS + 6, TCALLOY, 0x9CA6A6).setShapes(INGOT, DUST);
public static final NTMMaterial MAT_FERRO = makeSmeltable(_AS + 7, FERRO, 0x6B6B8B).setShapes(INGOT);
public static final NTMMaterial MAT_MAGTUNG = makeSmeltable(_AS + 8, MAGTUNG, 0x22A2A2).setShapes(INGOT, DUST, BLOCK);
public static final NTMMaterial MAT_CMB = makeSmeltable(_AS + 9, CMB, 0x6F6FB4).setShapes(INGOT, DUST, PLATE, BLOCK);
public static NTMMaterial make(int id, DictFrame dict) {
return new NTMMaterial(id, dict);

View File

@ -1344,17 +1344,6 @@ public class AssemblerRecipes {
value.add(((ComparableStack)o).toStack());
} else if(o instanceof OreDictStack) {
/*List<ItemStack> list = new ArrayList();
OreDictStack oreStack = (OreDictStack)o;
List<ItemStack> ores = OreDictionary.getOres(oreStack.name);
for(ItemStack ore : ores) {
ItemStack copy = ore.copy();
copy.stackSize = oreStack.stacksize;
list.add(copy);
}*/
value.add(((OreDictStack)o).extractForNEI());
}
}

View File

@ -17,6 +17,7 @@ import com.hbm.handler.imc.IMCBlastFurnace;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.RecipesCommon.OreDictStack;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ModItems;
import com.hbm.main.MainRegistry;
import com.hbm.util.Tuple.Triplet;
@ -46,10 +47,10 @@ public class BlastFurnaceRecipes {
addRecipe(STEEL, MINGRADE, new ItemStack(ModItems.ingot_advanced_alloy, 2));
addRecipe(W, COAL, new ItemStack(ModItems.neutron_reflector, 2));
addRecipe(W, ANY_COKE, new ItemStack(ModItems.neutron_reflector, 2));
addRecipe(ModItems.canister_fuel, "slimeball", new ItemStack(ModItems.canister_napalm));
addRecipe(STEEL, CO, new ItemStack(ModItems.ingot_dura_steel, 2));
addRecipe(STEEL, W, new ItemStack(ModItems.ingot_dura_steel, 2));
addRecipe(STEEL, U238, new ItemStack(ModItems.ingot_ferrouranium));
addRecipe(new ComparableStack(ModItems.canister_full, 1, Fluids.GASOLINE.getID()), "slimeball", new ItemStack(ModItems.canister_napalm));
//addRecipe(STEEL, CO, new ItemStack(ModItems.ingot_dura_steel, 2));
//addRecipe(STEEL, W, new ItemStack(ModItems.ingot_dura_steel, 2));
//addRecipe(STEEL, U238, new ItemStack(ModItems.ingot_ferrouranium));
addRecipe(W, SA326.nugget(), new ItemStack(ModItems.ingot_magnetized_tungsten));
addRecipe(STEEL, TC99.nugget(), new ItemStack(ModItems.ingot_tcalloy));
addRecipe(GOLD.plate(), ModItems.plate_mixed, new ItemStack(ModItems.plate_paa, 2));
@ -59,7 +60,7 @@ public class BlastFurnaceRecipes {
addRecipe(ModBlocks.block_meteor, CO, new ItemStack(ModItems.ingot_meteorite));
if(GeneralConfig.enableLBSMSimpleChemsitry)
addRecipe(ModItems.canister_empty, COAL, new ItemStack(ModItems.canister_oil));
addRecipe(ModItems.canister_empty, COAL, new ItemStack(ModItems.canister_full, 1, Fluids.OIL.getID()));
if(!IMCBlastFurnace.buffer.isEmpty()) {
blastFurnaceRecipes.addAll(IMCBlastFurnace.buffer);

View File

@ -4,15 +4,28 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import com.google.gson.JsonElement;
import com.google.gson.stream.JsonWriter;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.RecipesCommon.OreDictStack;
import com.hbm.inventory.material.MaterialShapes;
import com.hbm.inventory.material.Mats;
import com.hbm.inventory.material.Mats.MaterialStack;
import com.hbm.inventory.material.NTMMaterial;
import com.hbm.inventory.material.NTMMaterial.SmeltingBehavior;
import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemMold;
import com.hbm.items.machine.ItemMold.Mold;
import com.hbm.items.machine.ItemScraps;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class CrucibleRecipes extends SerializableRecipe {
@ -26,18 +39,35 @@ public class CrucibleRecipes extends SerializableRecipe {
@Override
public void registerDefaults() {
int n = MaterialShapes.NUGGET.q(1);
int i = MaterialShapes.INGOT.q(1);
recipes.add(new CrucibleRecipe(0, "crucible.steel", 1, new ItemStack(ModItems.ingot_steel))
.inputs(new MaterialStack(Mats.MAT_IRON, 8), new MaterialStack(Mats.MAT_COAL, 8))
.outputs(new MaterialStack(Mats.MAT_STEEL, 8)));
.inputs(new MaterialStack(Mats.MAT_IRON, n), new MaterialStack(Mats.MAT_COAL, n))
.outputs(new MaterialStack(Mats.MAT_STEEL, n)));
recipes.add(new CrucibleRecipe(1, "crucible.redcopper", 1, new ItemStack(ModItems.ingot_red_copper))
.inputs(new MaterialStack(Mats.MAT_COPPER, 8), new MaterialStack(Mats.MAT_REDSTONE, 8))
.outputs(new MaterialStack(Mats.MAT_MINGRADE, 16)));
recipes.add(new CrucibleRecipe(1, "crucible.redcopper", 2, new ItemStack(ModItems.ingot_red_copper))
.inputs(new MaterialStack(Mats.MAT_COPPER, n), new MaterialStack(Mats.MAT_REDSTONE, n))
.outputs(new MaterialStack(Mats.MAT_MINGRADE, n * 2)));
recipes.add(new CrucibleRecipe(2, "crucible.aa", 1, new ItemStack(ModItems.ingot_advanced_alloy))
.inputs(new MaterialStack(Mats.MAT_STEEL, 8), new MaterialStack(Mats.MAT_MINGRADE, 8))
.outputs(new MaterialStack(Mats.MAT_ALLOY, 16)));
recipes.add(new CrucibleRecipe(2, "crucible.aa", 2, new ItemStack(ModItems.ingot_advanced_alloy))
.inputs(new MaterialStack(Mats.MAT_STEEL, n), new MaterialStack(Mats.MAT_MINGRADE, n))
.outputs(new MaterialStack(Mats.MAT_ALLOY, n * 2)));
recipes.add(new CrucibleRecipe(3, "crucible.hss", 4, new ItemStack(ModItems.ingot_dura_steel))
.inputs(new MaterialStack(Mats.MAT_STEEL, n * 2), new MaterialStack(Mats.MAT_TUNGSTEN, n), new MaterialStack(Mats.MAT_COBALT, n))
.outputs(new MaterialStack(Mats.MAT_DURA, n * 4)));
recipes.add(new CrucibleRecipe(4, "crucible.ferro", 3, new ItemStack(ModItems.ingot_ferrouranium))
.inputs(new MaterialStack(Mats.MAT_STEEL, n * 2), new MaterialStack(Mats.MAT_U238, n), new MaterialStack(Mats.MAT_COAL, n))
.outputs(new MaterialStack(Mats.MAT_FERRO, n * 3)));
recipes.add(new CrucibleRecipe(5, "crucible.tcalloy", 9, new ItemStack(ModItems.ingot_tcalloy))
.inputs(new MaterialStack(Mats.MAT_STEEL, n * 8), new MaterialStack(Mats.MAT_TECHNIETIUM, n), new MaterialStack(Mats.MAT_COAL, n * 4))
.outputs(new MaterialStack(Mats.MAT_TCALLOY, i)));
registerMoldsForNEI();
}
public static class CrucibleRecipe {
@ -101,6 +131,11 @@ public class CrucibleRecipes extends SerializableRecipe {
return this.recipes;
}
@Override
public String getComment() {
return "/// under construction ///";
}
@Override
public void readRecipe(JsonElement recipe) {
@ -116,4 +151,64 @@ public class CrucibleRecipes extends SerializableRecipe {
this.indexMapping.clear();
this.recipes.clear();
}
/** Returns a map containing all recipes where an item becomes a liquid material in the crucible. */
public static HashMap<AStack, List<ItemStack>> getSmeltingRecipes() {
HashMap<AStack, List<ItemStack>> map = new HashMap();
for(NTMMaterial material : Mats.orderedList) {
for(MaterialShapes shape : MaterialShapes.values()) {
//TODO: buffer these
String name = shape.toString().toLowerCase() + material.names[0];
List<ItemStack> ores = OreDictionary.getOres(name);
if(!ores.isEmpty()) {
List<ItemStack> stacks = new ArrayList();
stacks.add(ItemScraps.create(new MaterialStack(material, shape.q(1))));
map.put(new OreDictStack(name), stacks);
}
}
}
for(Entry<String, List<MaterialStack>> entry : Mats.materialOreEntries.entrySet()) {
List<ItemStack> stacks = new ArrayList();
for(MaterialStack mat : entry.getValue()) {
stacks.add(ItemScraps.create(mat));
}
map.put(new OreDictStack(entry.getKey()), stacks);
}
for(Entry<ComparableStack, List<MaterialStack>> entry : Mats.materialEntries.entrySet()) {
List<ItemStack> stacks = new ArrayList();
for(MaterialStack mat : entry.getValue()) {
stacks.add(ItemScraps.create(mat));
}
map.put(entry.getKey().copy(), stacks);
}
return map;
}
public static List<ItemStack[]> moldRecipes = new ArrayList();
public static void registerMoldsForNEI() {
for(NTMMaterial material : Mats.orderedList) {
if(material.smeltable != SmeltingBehavior.SMELTABLE)
continue;
for(Mold mold : ItemMold.molds) {
ItemStack out = mold.getOutput(material);
if(out != null) {
ItemStack scrap = ItemScraps.create(new MaterialStack(material, mold.getCost()));
ItemStack shape = new ItemStack(ModItems.mold, 1, mold.id);
ItemStack basin = new ItemStack(mold.size == 0 ? ModBlocks.foundry_mold : mold.size == 1 ? ModBlocks.foundry_basin : Blocks.fire);
ItemStack[] entry = new ItemStack[] {scrap, shape, basin, out};
moldRecipes.add(entry);
}
}
}
}
}

View File

@ -116,6 +116,11 @@ public class AnvilRecipes {
smithingRecipes.add(new AnvilSmithingMold(11, new OreDictStack(IRON.plate(), 9), new OreDictStack("plate", 9)));
smithingRecipes.add(new AnvilSmithingMold(12, new OreDictStack(IRON.block()), new OreDictStack("block")));
smithingRecipes.add(new AnvilSmithingMold(13, new ComparableStack(ModItems.pipes_steel), new ItemStack[] {new ItemStack(ModItems.pipes_steel)}));
smithingRecipes.add(new AnvilSmithingMold(14, new ComparableStack(ModItems.casing_357), new ItemStack[] {new ItemStack(ModItems.casing_357)}));
smithingRecipes.add(new AnvilSmithingMold(15, new ComparableStack(ModItems.casing_44), new ItemStack[] {new ItemStack(ModItems.casing_44)}));
smithingRecipes.add(new AnvilSmithingMold(16, new ComparableStack(ModItems.casing_9), new ItemStack[] {new ItemStack(ModItems.casing_9)}));
smithingRecipes.add(new AnvilSmithingMold(17, new ComparableStack(ModItems.casing_50), new ItemStack[] {new ItemStack(ModItems.casing_50)}));
smithingRecipes.add(new AnvilSmithingMold(18, new ComparableStack(ModItems.casing_buckshot), new ItemStack[] {new ItemStack(ModItems.casing_buckshot)}));
smithingRecipes.add(new AnvilSmithingCyanideRecipe());
smithingRecipes.add(new AnvilSmithingRenameRecipe());

View File

@ -3356,7 +3356,7 @@ public class ModItems {
mold_base = new Item().setUnlocalizedName("mold_base").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":mold_base");
mold = new ItemMold().setUnlocalizedName("mold").setCreativeTab(MainRegistry.controlTab);
scraps = new ItemScraps().setUnlocalizedName("scraps").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":scraps");
scraps = new ItemScraps().setUnlocalizedName("scraps").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":scraps");
part_lithium = new Item().setUnlocalizedName("part_lithium").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":part_lithium");
part_beryllium = new Item().setUnlocalizedName("part_beryllium").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":part_beryllium");

View File

@ -26,8 +26,8 @@ import net.minecraftforge.oredict.OreDictionary;
public class ItemMold extends Item {
public List<Mold> molds = new ArrayList(); //molds in "pretty" order, variable between versions
public HashMap<Integer, Mold> moldById = new HashMap(); //molds by their static ID -> stack item damage
public static List<Mold> molds = new ArrayList(); //molds in "pretty" order, variable between versions
public static HashMap<Integer, Mold> moldById = new HashMap(); //molds by their static ID -> stack item damage
public HashMap<NTMMaterial, ItemStack> blockOverrides = new HashMap();
@ -47,7 +47,7 @@ public class ItemMold extends Item {
registerMold(new MoldShape( 3, S, "plate", MaterialShapes.PLATE));
registerMold(new MoldWire( 4, S, "wire"));
registerMold(new MoldMulti( 5, S, "blade", MaterialShapes.INGOT.q(2),
registerMold(new MoldMulti( 5, S, "blade", MaterialShapes.INGOT.q(3),
Mats.MAT_TITANIUM, new ItemStack(ModItems.blade_titanium),
Mats.MAT_TUNGSTEN, new ItemStack(ModItems.blade_tungsten)));
@ -82,6 +82,12 @@ public class ItemMold extends Item {
registerMold(new MoldShape( 11, L, "plates", MaterialShapes.PLATE, 9));
registerMold(new MoldBlock( 12, L, "block", MaterialShapes.BLOCK));
registerMold(new MoldSingle( 13, L, "pipes", new ItemStack(ModItems.pipes_steel), Mats.MAT_STEEL, MaterialShapes.BLOCK.q(3)));
registerMold(new MoldSingle( 14, S, "c357", new ItemStack(ModItems.casing_357), Mats.MAT_COPPER, MaterialShapes.PLATE.q(1)));
registerMold(new MoldSingle( 15, S, "c44", new ItemStack(ModItems.casing_44), Mats.MAT_COPPER, MaterialShapes.PLATE.q(1)));
registerMold(new MoldSingle( 16, S, "c9", new ItemStack(ModItems.casing_9), Mats.MAT_COPPER, MaterialShapes.PLATE.q(1)));
registerMold(new MoldSingle( 17, S, "c50", new ItemStack(ModItems.casing_50), Mats.MAT_COPPER, MaterialShapes.PLATE.q(1)));
registerMold(new MoldSingle( 18, S, "cbuckshot", new ItemStack(ModItems.casing_buckshot), Mats.MAT_COPPER, MaterialShapes.PLATE.q(1)));
}
public void registerMold(Mold mold) {

View File

@ -1,12 +1,11 @@
package com.hbm.lib;
import java.util.Random;
import java.util.HashMap;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemBreedingRod.*;
import com.hbm.util.I18nUtil;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
@ -15,7 +14,6 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraft.world.World;
public class HbmChestContents {
@ -360,8 +358,8 @@ public class HbmChestContents {
/** Nowhere else to put this and this seems like the most fitting place **/
public static ItemStack genetateBook(String key) {
String author = I18nUtil.resolveKey("book.lore." + key + ".author");
String title = I18nUtil.resolveKey("book.lore." + key + ".title");
String author = resolve("book.lore." + key + ".author");
String title = resolve("book.lore." + key + ".title");
ItemStack book = new ItemStack(Items.written_book);
book.stackTagCompound = new NBTTagCompound();
@ -371,7 +369,7 @@ public class HbmChestContents {
for(byte i = 1; i <= 50; i++) {
String unloc = "book.lore." + key + ".page" + i;
String page = I18nUtil.resolveKey(unloc);
String page = resolve(unloc);
if(page.equals(unloc))
break;
@ -383,4 +381,23 @@ public class HbmChestContents {
return book;
}
private static String resolve(String key) {
String result = books.get(key);
return result != null ? result : key;
}
private static HashMap<String, String> books = new HashMap();
static {
books.put("book.lore.office0.title", "Letter of Resignation");
books.put("book.lore.office0.author", "Kosma");
books.put("book.lore.office0.page1", "Management downsized our department again yesterday. Those idiots only have themselves to blame, I don't know what they were expecting after the Panay fiasco. Who the hell leaks that sort of information? We're losing millions and");
books.put("book.lore.office0.page2", "it's ME who's the one out of a job now. I'M the one being asked to resign. I hope you asshats finally learn from your overabundance of mistakes and take that stick out of your ass.");
books.put("book.lore.office0.page3", "I'm not coming back on Friday. Just send the paycheck.");
books.put("book.lore.office1.title", "Note");
books.put("book.lore.office1.author", "Jonas");
books.put("book.lore.office1.page1", null);
books.put("book.lore.office2.page2", null);
}
}

View File

@ -3,7 +3,7 @@ package com.hbm.lib;
public class RefStrings {
public static final String MODID = "hbm";
public static final String NAME = "Hbm's Nuclear Tech Mod";
public static final String VERSION = "1.0.27 BETA (4347)";
public static final String VERSION = "1.0.27 BETA (4375)";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version

View File

@ -562,6 +562,7 @@ public class ClientProxy extends ServerProxy {
RenderingRegistry.registerEntityRenderingHandler(EntityZirnoxDebris.class, new RenderZirnoxDebris());
RenderingRegistry.registerEntityRenderingHandler(EntityArtilleryShell.class, new RenderArtilleryShell());
RenderingRegistry.registerEntityRenderingHandler(EntityCog.class, new RenderCog());
RenderingRegistry.registerEntityRenderingHandler(EntitySawblade.class, new RenderSawblade());
RenderingRegistry.registerEntityRenderingHandler(EntityChemical.class, new RenderChemical());
//grenades
RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeGeneric.class, new RenderSnowball(ModItems.grenade_generic));

View File

@ -298,8 +298,8 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModBlocks.muffler, 1), new Object[] { "III", "IWI", "III", 'I', ModItems.plate_polymer, 'W', Blocks.wool });
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_titanium_hull), 1), new Object[] { "PIP", "I I", "PIP", 'P', TI.plate(), 'I', TI.ingot() });
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_advanced_hull), 1), new Object[] { "PIP", "I I", "PIP", 'P', ALLOY.plate(), 'I', ALLOY.ingot() });
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_titanium_hull), 8), new Object[] { "PIP", "I I", "PIP", 'P', TI.plate(), 'I', TI.ingot() });
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_advanced_hull), 8), new Object[] { "PIP", "I I", "PIP", 'P', ALLOY.plate(), 'I', ALLOY.ingot() });
addRecipeAuto(new ItemStack(ModItems.arc_electrode, 1), new Object[] { "C", "T", "C", 'C', GRAPHITE.ingot(), 'T', ModItems.bolt_tungsten });
addRecipeAuto(new ItemStack(ModItems.arc_electrode_desh, 1), new Object[] { "C", "T", "C", 'C', DESH.dust(), 'T', ModItems.arc_electrode });

View File

@ -939,6 +939,10 @@ public class MainRegistry {
ignoreMappings.add("hbm:item.factory_core_advanced");
ignoreMappings.add("hbm:tile.factory_titanium_core");
ignoreMappings.add("hbm:tile.factory_advanced_core");
ignoreMappings.add("hbm:tile.factory_titanium_conductor");
ignoreMappings.add("hbm:tile.factory_advanced_conductor");
ignoreMappings.add("hbm:tile.factory_titanium_furnace");
ignoreMappings.add("hbm:tile.factory_advanced_furnace");
/// REMAP ///
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);

View File

@ -68,6 +68,12 @@ public class NEIConfig implements IConfigureNEI {
API.registerUsageHandler(new FuelPoolHandler());
API.registerRecipeHandler(new RadiolysisRecipeHandler());
API.registerUsageHandler(new RadiolysisRecipeHandler());
API.registerRecipeHandler(new CrucibleSmeltingHandler());
API.registerUsageHandler(new CrucibleSmeltingHandler());
API.registerRecipeHandler(new CrucibleAlloyingHandler());
API.registerUsageHandler(new CrucibleAlloyingHandler());
API.registerRecipeHandler(new CrucibleCastingHandler());
API.registerUsageHandler(new CrucibleCastingHandler());
//universal boyes
API.registerRecipeHandler(new ZirnoxRecipeHandler());

View File

@ -0,0 +1,47 @@
package com.hbm.render.entity.projectile;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class RenderSawblade extends Render {
@Override
public void doRender(Entity cog, double x, double y, double z, float f0, float f1) {
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
int orientation = cog.getDataWatcher().getWatchableObjectInt(10);
switch(orientation % 6) {
case 3: GL11.glRotatef(0, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(90, 0F, 1F, 0F); break;
case 2: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 4: GL11.glRotatef(270, 0F, 1F, 0F); break;
}
GL11.glTranslated(0, 0, -1);
if(orientation < 6) {
GL11.glRotated(System.currentTimeMillis() % (360 * 5) / 3D, 0.0D, 0.0D, -1.0D);
}
GL11.glTranslated(0, -1.375, 0);
this.bindEntityTexture(cog);
ResourceManager.sawmill.renderPart("Blade");
GL11.glPopMatrix();
}
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return ResourceManager.sawmill_tex;
}
}

View File

@ -3,26 +3,18 @@ package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.recipes.AssemblerRecipes;
import com.hbm.lib.RefStrings;
import com.hbm.main.ResourceManager;
import com.hbm.render.util.RenderDecoItem;
import com.hbm.render.util.RenderItemStack;
import com.hbm.tileentity.machine.TileEntityMachineAssembler;
import com.hbm.tileentity.machine.TileEntityMachinePress;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
public class RenderAssembler extends TileEntitySpecialRenderer {
@ -93,6 +85,7 @@ public class RenderAssembler extends TileEntitySpecialRenderer {
}
GL11.glPopMatrix();
RenderHelper.enableStandardItemLighting();
renderSlider(tileEntity, x, y, z, f);
}

View File

@ -43,6 +43,7 @@ public class RenderFoundry extends TileEntitySpecialRenderer {
}
GL11.glPopMatrix();
RenderHelper.enableStandardItemLighting();
GL11.glEnable(GL11.GL_ALPHA_TEST);
}
private void drawBlock(ItemStack stack, IRenderFoundry foundry) {

View File

@ -190,6 +190,38 @@ public class TileEntityCrucible extends TileEntityMachineBase implements IGUIPro
this.heat = nbt.getInteger("heat");
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
int[] rec = nbt.getIntArray("rec");
for(int i = 0; i < rec.length / 2; i++) {
recipeStack.add(new MaterialStack(Mats.matById.get(rec[i * 2]), rec[i * 2 + 1]));
}
int[] was = nbt.getIntArray("was");
for(int i = 0; i < was.length / 2; i++) {
wasteStack.add(new MaterialStack(Mats.matById.get(was[i * 2]), was[i * 2 + 1]));
}
this.progress = nbt.getInteger("progress");
this.heat = nbt.getInteger("heat");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
int[] rec = new int[recipeStack.size() * 2];
int[] was = new int[wasteStack.size() * 2];
for(int i = 0; i < recipeStack.size(); i++) { MaterialStack sta = recipeStack.get(i); rec[i * 2] = sta.material.id; rec[i * 2 + 1] = sta.amount; }
for(int i = 0; i < wasteStack.size(); i++) { MaterialStack sta = wasteStack.get(i); was[i * 2] = sta.material.id; was[i * 2 + 1] = sta.amount; }
nbt.setIntArray("rec", rec);
nbt.setIntArray("was", was);
nbt.setInteger("progress", progress);
nbt.setInteger("heat", heat);
}
protected void tryPullHeat() {
TileEntity con = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);

View File

@ -3,6 +3,7 @@ package com.hbm.tileentity.machine;
import java.util.List;
import com.hbm.blocks.BlockDummyable;
import com.hbm.entity.projectile.EntitySawblade;
import com.hbm.items.ModItems;
import com.hbm.lib.ModDamageSource;
import com.hbm.tileentity.INBTPacketReceiver;
@ -104,6 +105,17 @@ public class TileEntitySawmill extends TileEntityMachineBase {
if(overspeed > 300) {
this.hasBlade = false;
this.worldObj.newExplosion(null, xCoord + 0.5, yCoord + 1, zCoord + 0.5, 5F, false, false);
int orientation = this.getBlockMetadata() - BlockDummyable.offset;
ForgeDirection dir = ForgeDirection.getOrientation(orientation);
EntitySawblade cog = new EntitySawblade(worldObj, xCoord + 0.5 + dir.offsetX, yCoord + 1, zCoord + 0.5 + dir.offsetZ).setOrientation(orientation);
ForgeDirection rot = dir.getRotation(ForgeDirection.DOWN);
cog.motionX = rot.offsetX;
cog.motionY = 1;
cog.motionZ = rot.offsetZ;
worldObj.spawnEntityInWorld(cog);
this.markDirty();
}

View File

@ -3,9 +3,12 @@ package com.hbm.util;
import java.util.ArrayList;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.resources.I18n;
@SideOnly(Side.CLIENT)
public class I18nUtil {
/**
@ -14,6 +17,7 @@ public class I18nUtil {
* @param args
* @return
*/
@SideOnly(Side.CLIENT)
public static String resolveKey(String s, Object... args) {
return I18n.format(s, args);
}
@ -24,6 +28,7 @@ public class I18nUtil {
* @param args
* @return
*/
@SideOnly(Side.CLIENT)
public static String[] resolveKeyArray(String s, Object... args) {
return resolveKey(s, args).split("\\$");
}
@ -35,6 +40,7 @@ public class I18nUtil {
* @param width
* @return
*/
@SideOnly(Side.CLIENT)
public static List<String> autoBreakWithParagraphs(FontRenderer fontRenderer, String text, int width) {
String[] paragraphs = text.split("\\$");
@ -54,6 +60,7 @@ public class I18nUtil {
* @param width
* @return
*/
@SideOnly(Side.CLIENT)
public static List<String> autoBreak(FontRenderer fontRenderer, String text, int width) {
List<String> lines = new ArrayList();

View File

@ -314,6 +314,7 @@ container.launchTable=Große Startrampe
container.machineBoiler=Dampfkessel
container.machineCMB=CMB-Stahl Hochofen
container.machineCoal=Verbrennungsgenerator
container.machineCrucible=Schmelztiegel
container.machineDiesel=Dieselgenerator
container.machineElectricBoiler=Elektrischer Boiler
container.machineFEL=FEL
@ -1302,6 +1303,7 @@ item.cotton_candy.name=Radioaktive Zuckerwatte
item.crate_caller.name=Nachschub-Requester
item.crowbar.name=Mk.V Kistenöffnungsapparat "Brechstange"
item.crucible.name=Schmelztiegel
item.crucible_template.name=Schmelztiegelvorlage
item.crystal_aluminium.name=Aluminiumkristalle
item.crystal_beryllium.name=Berylliumkristalle
item.crystal_charred.name=Verkohlter Kristall
@ -3332,11 +3334,11 @@ tile.emp_bomb.name=EMP-Ladung
tile.factory_advanced_conductor.name=Fortgeschrittener Fabriksstromanschluss
tile.factory_advanced_core.name=Fortgeschrittene Fabrikkernkomponente
tile.factory_advanced_furnace.name=Fortgeschrittene Fabrikzugriffsluke
tile.factory_advanced_hull.name=Fortgeschrittene Fabrikshülle
tile.factory_advanced_hull.name=Fabrikblock
tile.factory_titanium_conductor.name=Einfacher Fabriksstromanschluss
tile.factory_titanium_core.name=Einfache Fabrikkernkomponente
tile.factory_titanium_furnace.name=Einfache Fabrikzugriffsluke
tile.factory_titanium_hull.name=Einfache Fabrikshülle
tile.factory_titanium_hull.name=Fabrikblock
tile.fallout.name=Fallout
tile.fence_metal.name=Maschendrahtzaun
tile.fire_digamma.name=Verweilendes Digamma

View File

@ -314,17 +314,6 @@ book.starter.page18=vær is just a guy who has been trapped in the grey void fea
#book.rbmk.title16=Meltdown
#book.rbmk.page16=§4§lAvoid.
book.lore.office0.title=Letter of Resignation
book.lore.office0.author=Kosma
book.lore.office0.page1=Management downsized our department again yesterday. Those idiots only have themselves to blame, I don't know what they were expecting after the Panay fiasco. Who the hell leaks that sort of information? We're losing millions and
book.lore.office0.page2=it's ME who's the one out of a job now. I'M the one being asked to resign. I hope you asshats finally learn from your overabundance of mistakes and take that stick out of your ass.
book.lore.office0.page3=I'm not coming back on Friday. Just send the paycheck.
book.lore.office1.title=Note
book.lore.office1.author=Jonas
book.lore.office1.page1=
book.lore.office2.page2=
cannery.f1=[ Press F1 for help ]
cannery.centrifuge=Gas Centrifuge
@ -515,6 +504,7 @@ container.launchTable=Large Launch Pad
container.machineBoiler=Boiler
container.machineCMB=CMB Steel Furnace
container.machineCoal=Combustion Generator
container.machineCrucible=Crucible
container.machineDiesel=Diesel Generator
container.machineElectricBoiler=Electric Boiler
container.machineFEL=FEL
@ -1560,6 +1550,7 @@ item.cotton_candy.name=Radioactive Cotton Candy
item.crate_caller.name=Supply Drop Requester
item.crowbar.name=Mk.V Crate Opening Device "Crowbar"
item.crucible.name=Crucible
item.crucible_template.name=Crucible Template
item.crystal_aluminium.name=Aluminium Crystals
item.crystal_beryllium.name=Beryllium Crystals
item.crystal_charred.name=Charred Crystal
@ -3781,11 +3772,11 @@ tile.emp_bomb.name=EMP Device
tile.factory_advanced_conductor.name=Advanced Factory Electricity Port
tile.factory_advanced_core.name=Advanced Factory Core Component
tile.factory_advanced_furnace.name=Advanced Factory Access Hatch
tile.factory_advanced_hull.name=Advanced Factory Casing
tile.factory_advanced_hull.name=Factory Block
tile.factory_titanium_conductor.name=Basic Factory Electricity Port
tile.factory_titanium_core.name=Basic Factory Core Component
tile.factory_titanium_furnace.name=Basic Factory Access Hatch
tile.factory_titanium_hull.name=Basic Factory Casing
tile.factory_titanium_hull.name=Factory Block
tile.fallout.name=Fallout
tile.fence_metal.name=Chainlink Fence
tile.fire_digamma.name=Lingering Digamma

Binary file not shown.

After

Width:  |  Height:  |  Size: 965 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 947 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -3,7 +3,7 @@
"modid": "hbm",
"name": "Hbm's Nuclear Tech",
"description": "A mod that adds weapons, nuclear themed stuff and machines",
"version":"1.0.27_X4347",
"version":"1.0.27_X4375",
"mcversion": "1.7.10",
"url": "",
"updateUrl": "",