diff --git a/src/main/java/com/hbm/blocks/machine/MachineGasCent.java b/src/main/java/com/hbm/blocks/machine/MachineGasCent.java index 8ea3ad35c..eb011a64a 100644 --- a/src/main/java/com/hbm/blocks/machine/MachineGasCent.java +++ b/src/main/java/com/hbm/blocks/machine/MachineGasCent.java @@ -68,7 +68,7 @@ public class MachineGasCent extends BlockDummyable implements IMultiblock { @Override public int[] getDimensions() { - return new int[] {2, 0, 0, 0, 0, 0,}; + return new int[] {3, 0, 0, 0, 0, 0,}; } @Override diff --git a/src/main/java/com/hbm/blocks/machine/NTMAnvil.java b/src/main/java/com/hbm/blocks/machine/NTMAnvil.java index dcf8966ac..e43a9815c 100644 --- a/src/main/java/com/hbm/blocks/machine/NTMAnvil.java +++ b/src/main/java/com/hbm/blocks/machine/NTMAnvil.java @@ -1,5 +1,7 @@ package com.hbm.blocks.machine; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import com.hbm.blocks.ITooltipProvider; @@ -28,6 +30,8 @@ import net.minecraft.world.World; public class NTMAnvil extends BlockFalling implements ITooltipProvider { public final int tier; + + public static final HashMap> tierMap = new HashMap(); @SideOnly(Side.CLIENT) private IIcon iconTop; @@ -38,6 +42,27 @@ public class NTMAnvil extends BlockFalling implements ITooltipProvider { this.setHardness(5.0F); this.setResistance(100.0F); this.tier = tier; + + List anvils = tierMap.get((Integer)tier); + if(anvils == null) + anvils = new ArrayList(); + anvils.add(this); + tierMap.put((Integer)tier, anvils); + } + + public static List getAnvilsFromTier(int tier) { + List anvils = tierMap.get((Integer)tier); + + if(anvils != null) { + List stacks = new ArrayList(); + + for(NTMAnvil anvil : anvils) + stacks.add(new ItemStack(anvil)); + + return stacks; + } + + return new ArrayList(); } @Override diff --git a/src/main/java/com/hbm/handler/WeaponAbility.java b/src/main/java/com/hbm/handler/WeaponAbility.java index e4fbd8d57..f533fc528 100644 --- a/src/main/java/com/hbm/handler/WeaponAbility.java +++ b/src/main/java/com/hbm/handler/WeaponAbility.java @@ -1,5 +1,7 @@ package com.hbm.handler; +import com.hbm.blocks.ModBlocks; +import com.hbm.blocks.generic.BlockBobble.BobbleType; import com.hbm.items.ModItems; import com.hbm.items.tool.IItemAbility; import com.hbm.packet.AuxParticlePacketNT; @@ -20,6 +22,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.monster.EntitySlime; import net.minecraft.entity.monster.EntityZombie; @@ -316,4 +319,35 @@ public abstract class WeaponAbility { return I18n.format(getName()); } } + + public static class BobbleAbility extends WeaponAbility { + + @Override + public void onHit(World world, EntityPlayer player, Entity victim, IItemAbility tool) { + + if(victim instanceof EntityMob && ((EntityMob) victim).getHealth() <= 0.0F) { + + EntityMob mob = (EntityMob) victim; + + int chance = 1000; + + if(mob.getMaxHealth() > 20) { + chance = 750; + } + + if(world.rand.nextInt(chance) == 0) + mob.entityDropItem(new ItemStack(ModBlocks.bobblehead, 1, world.rand.nextInt(BobbleType.values().length - 1) + 1), 0.0F); + } + } + + @Override + public String getName() { + return "weapon.ability.bobble"; + } + + @Override + public String getFullName() { + return I18n.format(getName()); + } + } } diff --git a/src/main/java/com/hbm/handler/nei/AnvilRecipeHandler.java b/src/main/java/com/hbm/handler/nei/AnvilRecipeHandler.java index 15565bf25..06f0759b6 100644 --- a/src/main/java/com/hbm/handler/nei/AnvilRecipeHandler.java +++ b/src/main/java/com/hbm/handler/nei/AnvilRecipeHandler.java @@ -2,25 +2,27 @@ package com.hbm.handler.nei; import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect; -import java.util.Arrays; +import java.awt.Rectangle; +import java.util.ArrayList; import java.util.LinkedList; import java.util.List; -import org.lwjgl.opengl.GL11; - +import com.hbm.blocks.machine.NTMAnvil; +import com.hbm.inventory.RecipesCommon.AStack; +import com.hbm.inventory.gui.GUIAnvil; import com.hbm.inventory.recipes.anvil.AnvilRecipes; import com.hbm.inventory.recipes.anvil.AnvilRecipes.AnvilConstructionRecipe; import com.hbm.inventory.recipes.anvil.AnvilRecipes.AnvilOutput; +import com.hbm.inventory.recipes.anvil.AnvilRecipes.OverlayType; import com.hbm.lib.RefStrings; +import com.hbm.util.ItemStackUtil; -import codechicken.lib.gui.GuiDraw; import codechicken.nei.NEIServerUtils; import codechicken.nei.PositionedStack; import codechicken.nei.recipe.TemplateRecipeHandler; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; public class AnvilRecipeHandler extends TemplateRecipeHandler { @@ -31,22 +33,87 @@ public class AnvilRecipeHandler extends TemplateRecipeHandler { public class RecipeSet extends TemplateRecipeHandler.CachedRecipe { - PositionedStack output; + List input = new ArrayList(); + List output = new ArrayList(); + PositionedStack anvil; int tier; + OverlayType shape; - public RecipeSet(ItemStack output, int tier) { - this.output = new PositionedStack(output, 111, 24); + public RecipeSet(List in, List out, int tier) { + + //not the prettiest of solutions but certainly the most pleasant to work with + int inLine = 1; + int outLine = 1; + int inOX = 0; + int inOY = 0; + int outOX = 0; + int outOY = 0; + int anvX = 0; + int anvY = 31; + + if(in.size() == 1 && out.size() == 1) { + shape = OverlayType.SMITHING; + inOX = 48; + inOY = 24; + outOX = 102; + outOY = 24; + anvX = 75; + } else if(in.size() == 1 && out.size() > 1) { + shape = OverlayType.RECYCLING; + outLine = 6; + inOX = 12; + inOY = 24; + outOX = 48; + outOY = 6; + anvX = 30; + } else if(in.size() > 1 && out.size() == 1) { + shape = OverlayType.CONSTRUCTION; + inLine = 6; + inOX = 12; + inOY = 6; + outOX = 138; + outOY = 24; + anvX = 120; + } else { + shape = OverlayType.NONE; + inLine = 4; + outLine = 4; + inOX = 3; + inOY = 6; + outOX = 93; + outOY = 6; + anvX = 75; + } + + for(int i = 0; i < in.size(); i++) { + this.input.add(new PositionedStack(in.get(i), inOX + 18 * (i % inLine), inOY + 18 * (i / inLine))); + } + + for(int i = 0; i < out.size(); i++) { + this.output.add(new PositionedStack(out.get(i), outOX + 18 * (i % outLine), outOY + 18 * (i / outLine))); + } + + this.anvil = new PositionedStack(NTMAnvil.getAnvilsFromTier(tier), anvX, anvY); + this.tier = tier; } @Override public List getIngredients() { - return getCycledIngredients(cycleticks / 48, Arrays.asList(output)); + return getCycledIngredients(cycleticks / 48, input); } @Override public PositionedStack getResult() { - return output; + return output.get(0); + } + + @Override + public List getOtherStacks() { + List other = new ArrayList(); + other.addAll(output); + other.add(anvil); + return getCycledIngredients(cycleticks / 48, other); } } @@ -62,7 +129,7 @@ public class AnvilRecipeHandler extends TemplateRecipeHandler { List recipes = AnvilRecipes.getConstruction(); for(AnvilConstructionRecipe recipe : recipes) { - this.arecipes.add(new RecipeSet(recipe.output.get(0).stack.copy(), recipe.tierLower)); + this.addRecipeToList(recipe); } } else { super.loadCraftingRecipes(outputId, results); @@ -78,7 +145,8 @@ public class AnvilRecipeHandler extends TemplateRecipeHandler { for(AnvilOutput out : recipe.output) { if(NEIServerUtils.areStacksSameTypeCrafting(out.stack, result)) { - this.arecipes.add(new RecipeSet(recipe.output.get(0).stack.copy(), recipe.tierLower)); + this.addRecipeToList(recipe); + break; } } } @@ -96,39 +164,92 @@ public class AnvilRecipeHandler extends TemplateRecipeHandler { @Override public void loadUsageRecipes(ItemStack ingredient) { + + List recipes = AnvilRecipes.getConstruction(); + + for(AnvilConstructionRecipe recipe : recipes) { + + outer: + for(AStack in : recipe.input) { + + List stacks = in.extractForNEI(); + for(ItemStack stack : stacks) { + if(NEIServerUtils.areStacksSameTypeCrafting(stack, ingredient)) { + this.addRecipeToList(recipe); + break outer; + } + } + } + } + } + + private void addRecipeToList(AnvilConstructionRecipe recipe) { + + List ins = new ArrayList(); + for(AStack input : recipe.input) { + ins.add(input.extractForNEI()); + } + + List outs = new ArrayList(); + for(AnvilOutput output : recipe.output) { + + ItemStack stack = output.stack.copy(); + if(output.chance != 1) { + ItemStackUtil.addTooltipToStack(stack, EnumChatFormatting.RED + "" + (((int)(output.chance * 1000)) / 10D) + "%"); + } + + outs.add(stack); + } + + this.arecipes.add(new RecipeSet(ins, outs, recipe.tierLower)); } @Override public void loadTransferRects() { - } - - @Override - public void drawExtras(int recipe) { - - RecipeSet rec = (RecipeSet) this.arecipes.get(recipe); - - FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; - for(int i = 0; i < 3; i++) - for(int j = 0; j < 3; j++) - fontRenderer.drawString("Tier " + rec.tier + " anvil", 51 + i, 50 + j, 0x000000); - fontRenderer.drawString("Tier " + rec.tier + " anvil", 52, 51, 0xffffff); - } + //hey asshole, stop nulling my fucking lists + transferRectsGui = new LinkedList(); + guiGui = new LinkedList>(); - @Override - public int recipiesPerPage() { - return 1; + transferRectsGui.add(new RecipeTransferRect(new Rectangle(11, 42, 36, 18), "ntmAnvil")); + transferRectsGui.add(new RecipeTransferRect(new Rectangle(65, 42, 36, 18), "ntmAnvil")); + + guiGui.add(GUIAnvil.class); + RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui); } @Override public String getGuiTexture() { return RefStrings.MODID + ":textures/gui/nei/gui_nei_anvil.png"; } - + @Override - public void drawBackground(int recipeIndex) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - drawTexturedModalRect(0, 0, 5, 11, 166, 120); + public void drawBackground(int recipe) { + super.drawBackground(recipe); + + RecipeSet set = (RecipeSet) this.arecipes.get(recipe); + + switch(set.shape) { + case NONE: + drawTexturedModalRect(2, 5, 5, 87, 72, 54); //in + drawTexturedModalRect(92, 5, 5, 87, 72, 54); //out + drawTexturedModalRect(74, 14, 131, 96, 18, 36); //operation + break; + case SMITHING: + drawTexturedModalRect(47, 23, 113, 105, 18, 18); //in + drawTexturedModalRect(101, 23, 113, 105, 18, 18); //out + drawTexturedModalRect(74, 14, 149, 96, 18, 36); //operation + break; + case CONSTRUCTION: + drawTexturedModalRect(11, 5, 5, 87, 108, 54); //in + drawTexturedModalRect(137, 23, 113, 105, 18, 18); //out + drawTexturedModalRect(119, 14, 167, 96, 18, 36); //operation + break; + case RECYCLING: + drawTexturedModalRect(11, 23, 113, 105, 18, 18); //in + drawTexturedModalRect(47, 5, 5, 87, 108, 54); //out + drawTexturedModalRect(29, 14, 185, 96, 18, 36); //operation + break; + } } } diff --git a/src/main/java/com/hbm/hazard/HazardRegistry.java b/src/main/java/com/hbm/hazard/HazardRegistry.java index 4a86fc9ad..3e611edac 100644 --- a/src/main/java/com/hbm/hazard/HazardRegistry.java +++ b/src/main/java/com/hbm/hazard/HazardRegistry.java @@ -140,6 +140,9 @@ public class HazardRegistry { HazardSystem.register(Items.gunpowder, makeData(EXPLOSIVE, 1F)); HazardSystem.register(Blocks.tnt, makeData(EXPLOSIVE, 4F)); HazardSystem.register(Items.pumpkin_pie, makeData(EXPLOSIVE, 4F)); + + HazardSystem.register(ModItems.ball_dynamite, makeData(EXPLOSIVE, 2F)); + HazardSystem.register(ModItems.stick_dynamite, makeData(EXPLOSIVE, 1F)); HazardSystem.register("dustCoal", makeData(COAL, powder)); HazardSystem.register("dustTinyCoal", makeData(COAL, powder_tiny)); diff --git a/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java b/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java index 74538c2e8..d56a8b622 100644 --- a/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java @@ -260,7 +260,7 @@ public class AssemblerRecipes { makeRecipe(new ComparableStack(ModBlocks.seal_frame, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 3), new ComparableStack(ModItems.wire_aluminium, 4), new OreDictStack(REDSTONE.dust(), 2), new ComparableStack(ModBlocks.steel_roof, 5), },50); makeRecipe(new ComparableStack(ModBlocks.seal_controller, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 3), new OreDictStack(POLYMER.ingot(), 4), new OreDictStack(MINGRADE.ingot(), 1), new OreDictStack(REDSTONE.dust(), 4), new ComparableStack(ModBlocks.steel_roof, 5), },100); makeRecipe(new ComparableStack(ModBlocks.machine_centrifuge, 1), new AStack[] {new ComparableStack(ModItems.centrifuge_tower, 1), new OreDictStack(STEEL.ingot(), 4), new OreDictStack(IRON.ingot(), 4), new OreDictStack(STEEL.plate(), 2), new OreDictStack(CU.plate(), 2), new ComparableStack(ModItems.wire_red_copper, 8), },250); - makeRecipe(new ComparableStack(ModBlocks.machine_gascent, 1), new AStack[] {new ComparableStack(ModItems.centrifuge_tower, 1), new OreDictStack(STEEL.ingot(), 4), new OreDictStack(POLYMER.ingot(), 2), new OreDictStack(DESH.ingot(), 1), new OreDictStack(STEEL.plate(), 4), new OreDictStack(ALLOY.plate(), 4), new ComparableStack(ModItems.wire_red_copper, 8), new ComparableStack(ModItems.wire_gold, 4), },300); + makeRecipe(new ComparableStack(ModBlocks.machine_gascent, 1), new AStack[] {new ComparableStack(ModItems.centrifuge_tower, 1), new OreDictStack(STEEL.ingot(), 8), new OreDictStack(DESH.ingot(), 2), new ComparableStack(ModItems.coil_tungsten, 4), new ComparableStack(ModItems.wire_red_copper, 32) },300); makeRecipe(new ComparableStack(ModBlocks.machine_rtg_furnace_off, 1), new AStack[] {new ComparableStack(Blocks.furnace, 1), new ComparableStack(ModItems.rtg_unit, 3), new OreDictStack(PB.plate(), 6), new OreDictStack(OreDictManager.getReflector(), 4), new OreDictStack(CU.plate(), 2), },150); makeRecipe(new ComparableStack(ModBlocks.machine_diesel, 1), new AStack[] {new ComparableStack(ModItems.hull_small_steel, 4), new ComparableStack(Blocks.piston, 4), new OreDictStack(STEEL.ingot(), 6), new OreDictStack(MINGRADE.ingot(), 2), new OreDictStack(CU.plate(), 4), new ComparableStack(ModItems.wire_red_copper, 6), },200); makeRecipe(new ComparableStack(ModBlocks.machine_selenium, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 4), new OreDictStack(TI.plate(), 6), new OreDictStack(CU.plate(), 8), new ComparableStack(ModItems.hull_big_steel, 1), new ComparableStack(ModItems.hull_small_steel, 9), new ComparableStack(ModItems.pedestal_steel, 1), new ComparableStack(ModItems.coil_copper, 4), },250); diff --git a/src/main/java/com/hbm/inventory/recipes/BreederRecipes.java b/src/main/java/com/hbm/inventory/recipes/BreederRecipes.java index 85d430e2c..e10014143 100644 --- a/src/main/java/com/hbm/inventory/recipes/BreederRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/BreederRecipes.java @@ -50,9 +50,9 @@ public class BreederRecipes { recipes.put(new ComparableStack(ModItems.rod_neptunium), new BreederRecipe(ModItems.rod_pu238, 3)); recipes.put(new ComparableStack(ModItems.rod_dual_neptunium), new BreederRecipe(ModItems.rod_dual_pu238, 3)); recipes.put(new ComparableStack(ModItems.rod_quad_neptunium), new BreederRecipe(ModItems.rod_quad_pu238, 3)); - recipes.put(new ComparableStack(ModItems.rod_pu238), new BreederRecipe(ModItems.rod_pu239, 2)); - recipes.put(new ComparableStack(ModItems.rod_dual_pu238), new BreederRecipe(ModItems.rod_dual_pu239, 2)); - recipes.put(new ComparableStack(ModItems.rod_quad_pu238), new BreederRecipe(ModItems.rod_quad_pu239, 2)); + recipes.put(new ComparableStack(ModItems.rod_pu238), new BreederRecipe(ModItems.rod_pu239, 4)); + recipes.put(new ComparableStack(ModItems.rod_dual_pu238), new BreederRecipe(ModItems.rod_dual_pu239, 4)); + recipes.put(new ComparableStack(ModItems.rod_quad_pu238), new BreederRecipe(ModItems.rod_quad_pu239, 4)); recipes.put(new ComparableStack(ModItems.rod_pu239), new BreederRecipe(ModItems.rod_pu240, 2)); recipes.put(new ComparableStack(ModItems.rod_dual_pu239), new BreederRecipe(ModItems.rod_dual_pu240, 2)); recipes.put(new ComparableStack(ModItems.rod_quad_pu239), new BreederRecipe(ModItems.rod_quad_pu240, 2)); diff --git a/src/main/java/com/hbm/inventory/recipes/GasCentrifugeRecipes.java b/src/main/java/com/hbm/inventory/recipes/GasCentrifugeRecipes.java index c781a8f98..05dddc267 100644 --- a/src/main/java/com/hbm/inventory/recipes/GasCentrifugeRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/GasCentrifugeRecipes.java @@ -21,7 +21,7 @@ public class GasCentrifugeRecipes { MEUF6 (200, 100, "HEUF6", "Medium Enriched UF6", false, new ItemStack(ModItems.nugget_u238, 1)), HEUF6 (300, 0, "NONE", "High Enriched UF6", true, new ItemStack(ModItems.nugget_u238, 2), new ItemStack(ModItems.nugget_u235, 1), new ItemStack(ModItems.fluorite, 1)), - PF6 (300, 0, "NONE", "Plutonium Hexafluoride", false, new ItemStack(ModItems.nugget_pu238, 1), new ItemStack(ModItems.nugget_pu_mix, 2), new ItemStack(ModItems.fluorite, 1)); + PF6 (300, 0, "NONE", "Plutonium Hexafluoride", true, new ItemStack(ModItems.nugget_pu238, 1), new ItemStack(ModItems.nugget_pu_mix, 2), new ItemStack(ModItems.fluorite, 1)); int fluidConsumed; int fluidProduced; diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 4441b27cb..b63bcb4b0 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -5197,7 +5197,8 @@ public class ModItems { cobalt_hoe = new ModHoe(MainRegistry.tMatCobalt).setUnlocalizedName("cobalt_hoe").setTextureName(RefStrings.MODID + ":cobalt_hoe"); ToolMaterial matDecCobalt = EnumHelper.addToolMaterial("HBM_COBALT2", 3, 1000, 15.0F, 2.5F, 25).setRepairItem(new ItemStack(ModItems.ingot_cobalt)); - cobalt_decorated_sword = new ItemSwordAbility(15F, 0, matDecCobalt).setUnlocalizedName("cobalt_decorated_sword").setTextureName(RefStrings.MODID + ":cobalt_decorated_sword"); + cobalt_decorated_sword = new ItemSwordAbility(15F, 0, matDecCobalt) + .addHitAbility(new WeaponAbility.BobbleAbility()).setUnlocalizedName("cobalt_decorated_sword").setTextureName(RefStrings.MODID + ":cobalt_decorated_sword"); cobalt_decorated_pickaxe = new ItemToolAbility(6F, 0, matDecCobalt, EnumToolType.PICKAXE) .addBreakAbility(new ToolAbility.RecursionAbility(4)) .addBreakAbility(new ToolAbility.HammerAbility(1)) @@ -5219,7 +5220,8 @@ public class ModItems { ToolMaterial matStarmetal = EnumHelper.addToolMaterial("HBM_STARMETAL", 3, 1000, 20.0F, 2.5F, 30).setRepairItem(new ItemStack(ModItems.ingot_starmetal)); starmetal_sword = new ItemSwordAbility(25F, 0, matStarmetal) .addHitAbility(new WeaponAbility.BeheaderAbility()) - .addHitAbility(new WeaponAbility.StunAbility(3)).setUnlocalizedName("starmetal_sword").setTextureName(RefStrings.MODID + ":starmetal_sword"); + .addHitAbility(new WeaponAbility.StunAbility(3)) + .addHitAbility(new WeaponAbility.BobbleAbility()).setUnlocalizedName("starmetal_sword").setTextureName(RefStrings.MODID + ":starmetal_sword"); starmetal_pickaxe = new ItemToolAbility(8F, 0, matStarmetal, EnumToolType.PICKAXE) .addBreakAbility(new ToolAbility.RecursionAbility(6)) .addBreakAbility(new ToolAbility.HammerAbility(2)) diff --git a/src/main/java/com/hbm/lib/HbmChestContents.java b/src/main/java/com/hbm/lib/HbmChestContents.java index c0f444084..395071e9e 100644 --- a/src/main/java/com/hbm/lib/HbmChestContents.java +++ b/src/main/java/com/hbm/lib/HbmChestContents.java @@ -186,23 +186,17 @@ public class HbmChestContents { private static WeightedRandomChestContent[] missile = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.missile_generic, 0, 1, 1, 4), new WeightedRandomChestContent(ModItems.missile_incendiary, 0, 1, 1, 4), - new WeightedRandomChestContent(ModItems.missile_cluster, 0, 1, 1, 4), - new WeightedRandomChestContent(ModItems.missile_buster, 0, 1, 1, 4), - new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.launch_pad), 0, 1, 1, 5), new WeightedRandomChestContent(ModItems.gas_mask_m65, 0, 1, 1, 5), new WeightedRandomChestContent(ModItems.battery_advanced, 0, 1, 1, 5), new WeightedRandomChestContent(ModItems.designator, 0, 1, 1, 5), new WeightedRandomChestContent(ModItems.crate_caller, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.thruster_small, 0, 1, 1, 5), new WeightedRandomChestContent(ModItems.thruster_medium, 0, 1, 1, 4), - new WeightedRandomChestContent(ModItems.thruster_large, 0, 1, 1, 2), new WeightedRandomChestContent(ModItems.fuel_tank_small, 0, 1, 1, 5), new WeightedRandomChestContent(ModItems.fuel_tank_medium, 0, 1, 1, 4), - new WeightedRandomChestContent(ModItems.fuel_tank_small, 0, 1, 1, 2), - new WeightedRandomChestContent(ModItems.warhead_mirvlet, 0, 1, 1, 1), - new WeightedRandomChestContent(ModItems.warhead_nuclear, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.bomb_caller, 0, 1, 1, 1), - new WeightedRandomChestContent(ModItems.bomb_caller, 3, 1, 1, 1) }; + new WeightedRandomChestContent(ModItems.bomb_caller, 3, 1, 1, 1), + new WeightedRandomChestContent(ModItems.bottle_nuka, 0, 1, 3, 10) }; private static WeightedRandomChestContent[] spaceship = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.battery_advanced, 0, 1, 1, 5), diff --git a/src/main/java/com/hbm/lib/HbmWorldGen.java b/src/main/java/com/hbm/lib/HbmWorldGen.java index 1c37135bb..89c4d468e 100644 --- a/src/main/java/com/hbm/lib/HbmWorldGen.java +++ b/src/main/java/com/hbm/lib/HbmWorldGen.java @@ -108,10 +108,10 @@ public class HbmWorldGen implements IWorldGenerator { DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.cinnebarSpawn, 4, 8, 16, ModBlocks.ore_cinnebar); DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.cobaltSpawn, 4, 4, 8, ModBlocks.ore_cobalt); - DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.ironClusterSpawn, 6, 5, 50, ModBlocks.cluster_iron); - DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.titaniumClusterSpawn, 6, 5, 30, ModBlocks.cluster_titanium); - DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.aluminiumClusterSpawn, 6, 5, 40, ModBlocks.cluster_aluminium); - DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.copperClusterSpawn, 6, 5, 20, ModBlocks.cluster_copper); + DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.ironClusterSpawn, 6, 15, 45, ModBlocks.cluster_iron); + DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.titaniumClusterSpawn, 6, 15, 30, ModBlocks.cluster_titanium); + DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.aluminiumClusterSpawn, 6, 15, 35, ModBlocks.cluster_aluminium); + DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.copperClusterSpawn, 6, 15, 20, ModBlocks.cluster_copper); if(GeneralConfig.enable528ColtanSpawn) { DungeonToolbox.generateOre(world, rand, i, j, GeneralConfig.coltanRate, 4, 15, 40, ModBlocks.ore_coltan); diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index e760c13b4..15baebddc 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -732,7 +732,7 @@ public class CraftingManager { addRecipeAuto(new ItemStack(ModItems.upgrade_centrifuge, 1), new Object[] { "PHP", "PUP", "DTD", 'P', ModItems.centrifuge_element, 'H', Blocks.hopper, 'U', ModItems.upgrade_shredder, 'D', POLYMER.ingot(), 'T', ModBlocks.machine_transformer }); addRecipeAuto(new ItemStack(ModItems.upgrade_crystallizer, 1), new Object[] { "PHP", "CUC", "DTD", 'P', new ItemStack(ModItems.fluid_barrel_full, 1, FluidType.ACID.ordinal()), 'H', ModItems.circuit_targeting_tier4, 'C', ModBlocks.barrel_steel, 'U', ModItems.upgrade_centrifuge, 'D', ModItems.motor, 'T', ModBlocks.machine_transformer }); addRecipeAuto(new ItemStack(ModItems.upgrade_screm, 1), new Object[] { "SUS", "SCS", "SUS", 'S', STEEL.plate(), 'U', ModItems.upgrade_template, 'C', ModItems.crystal_xen }); - addRecipeAuto(new ItemStack(ModItems.upgrade_gc_speed, 1), new Object[] {"TCT", "HUH", "TCT", 'T', TC99.nugget(), 'C', ModItems.coil_copper, 'H', ModItems.coil_tungsten, 'U', ModItems.upgrade_template}); + addRecipeAuto(new ItemStack(ModItems.upgrade_gc_speed, 1), new Object[] {"TCT", "HUH", "TCT", 'T', ModItems.nugget_bismuth, 'C', ModItems.coil_copper, 'H', ModItems.coil_tungsten, 'U', ModItems.upgrade_template}); addRecipeAuto(new ItemStack(ModItems.mech_key, 1), new Object[] { "MCM", "MKM", "MMM", 'M', ModItems.ingot_meteorite_forged, 'C', ModItems.coin_maskman, 'K', ModItems.key }); addRecipeAuto(new ItemStack(ModItems.spawn_ufo, 1), new Object[] { "MMM", "DCD", "MMM", 'M', ModItems.ingot_meteorite, 'D', DNT.ingot(), 'C', ModItems.coin_worm }); diff --git a/src/main/java/com/hbm/packet/AnvilCraftPacket.java b/src/main/java/com/hbm/packet/AnvilCraftPacket.java index 228a2bf15..fc322a148 100644 --- a/src/main/java/com/hbm/packet/AnvilCraftPacket.java +++ b/src/main/java/com/hbm/packet/AnvilCraftPacket.java @@ -57,7 +57,7 @@ public class AnvilCraftPacket implements IMessage { if(!recipe.isTierValid(anvil.tier)) //player is using the wrong type of anvil -> bad return null; - int count = m.mode == 1 ? 64 : 1; + int count = m.mode == 1 ? (recipe.output.size() > 1 ? 64 : (recipe.output.get(0).stack.getMaxStackSize() / recipe.output.get(0).stack.stackSize)) : 1; for(int i = 0; i < count; i++) { diff --git a/src/main/java/com/hbm/render/item/ItemRenderLibrary.java b/src/main/java/com/hbm/render/item/ItemRenderLibrary.java index 97e1db930..a8d512e0d 100644 --- a/src/main/java/com/hbm/render/item/ItemRenderLibrary.java +++ b/src/main/java/com/hbm/render/item/ItemRenderLibrary.java @@ -62,10 +62,12 @@ public class ItemRenderLibrary { renderers.put(Item.getItemFromBlock(ModBlocks.machine_gascent), new ItemRenderBase() { public void renderInventory() { GL11.glTranslated(0, -4, 0); - GL11.glScaled(4.5, 4.5, 4.5); + GL11.glScaled(3.5, 3.5, 3.5); } public void renderCommon() { + GL11.glShadeModel(GL11.GL_SMOOTH); bindTexture(ResourceManager.gascent_tex); ResourceManager.gascent.renderPart("Centrifuge"); + GL11.glShadeModel(GL11.GL_FLAT); }}); renderers.put(Item.getItemFromBlock(ModBlocks.iter), new ItemRenderBase() { diff --git a/src/main/java/com/hbm/render/tileentity/RenderCentrifuge.java b/src/main/java/com/hbm/render/tileentity/RenderCentrifuge.java index 28340fa76..24848110c 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderCentrifuge.java +++ b/src/main/java/com/hbm/render/tileentity/RenderCentrifuge.java @@ -30,10 +30,16 @@ public class RenderCentrifuge extends TileEntitySpecialRenderer { } if(tileEntity instanceof TileEntityMachineGasCent) { + GL11.glRotatef(180, 0F, 1F, 0F); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glShadeModel(GL11.GL_SMOOTH); bindTexture(ResourceManager.gascent_tex); ResourceManager.gascent.renderPart("Centrifuge"); ResourceManager.gascent.renderPart("Flag"); + GL11.glShadeModel(GL11.GL_FLAT); } + + GL11.glEnable(GL11.GL_CULL_FACE); GL11.glPopMatrix(); } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineGasCent.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineGasCent.java index 30e6c37e8..595f067f6 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineGasCent.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineGasCent.java @@ -52,8 +52,6 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I private static final int[] slots_bottom = new int[] {2, 3, 4}; private static final int[] slots_side = new int[] { }; - private String customName; - public TileEntityMachineGasCent() { super(6); tank = new FluidTank(FluidType.UF6, 2000, 0); @@ -65,28 +63,21 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I public String getName() { return "container.gasCentrifuge"; } + + @Override + public int[] getAccessibleSlotsFromSide(int side) { + return side == 0 ? slots_bottom : side == 1 ? slots_top : slots_side; + } @Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); - NBTTagList list = nbt.getTagList("items", 10); power = nbt.getLong("power"); progress = nbt.getShort("progress"); tank.readFromNBT(nbt, "tank"); inputTank.readFromNBT(nbt, "inputTank"); outputTank.readFromNBT(nbt, "outputTank"); - slots = new ItemStack[getSizeInventory()]; - - for(int i = 0; i < list.tagCount(); i++) - { - NBTTagCompound nbt1 = list.getCompoundTagAt(i); - byte b0 = nbt1.getByte("slot"); - if(b0 >= 0 && b0 < slots.length) - { - slots[b0] = ItemStack.loadItemStackFromNBT(nbt1); - } - } } @Override @@ -97,26 +88,7 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I tank.writeToNBT(nbt, "tank"); inputTank.writeToNBT(nbt, "inputTank"); outputTank.writeToNBT(nbt, "outputTank"); - NBTTagList list = new NBTTagList(); - - for(int i = 0; i < slots.length; i++) - { - if(slots[i] != null) - { - NBTTagCompound nbt1 = new NBTTagCompound(); - nbt1.setByte("slot", (byte)i); - slots[i].writeToNBT(nbt1); - list.appendTag(nbt1); - } - } - nbt.setTag("items", list); } - - @Override - public int[] getAccessibleSlotsFromSide(int meta) - { - return meta == 0 ? slots_bottom : (meta == 1 ? slots_top : slots_side); - } @Override public boolean canExtractItem(int i, ItemStack itemStack, int j) { @@ -398,15 +370,21 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I return list; } + AxisAlignedBB bb = null; + @Override public AxisAlignedBB getRenderBoundingBox() { - return TileEntity.INFINITE_EXTENT_AABB; + + if(bb == null) { + bb = AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 5, zCoord + 1); + } + + return bb; } @Override @SideOnly(Side.CLIENT) - public double getMaxRenderDistanceSquared() - { + public double getMaxRenderDistanceSquared() { return 65536.0D; } @@ -461,44 +439,44 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I type = PseudoFluidType.valueOf(nbt.getString(s + "_type")); } - /* ______ ______ - * _I____I_ _I____I_ - * / \\\ / \\\ - * |IF{ || || } || | - * | IF{ || || } || | - * | IF{ || || } || | - * | IF{ || || } || | - * | IF{|| || } || | - * | || || || | - * | } || ||IF{ || | - * | } || || IF{ || | - * | } || || IF{ || | - * | } || || IF{ || | - * | } || || IF{|| | - * |IF{ || || } || | - * | IF{ || || } || | - * | IF{ || || } || | - * | IF{ || || } || | - * | IF{|| || } || | - * | || || || | - * | } || ||IF{ || | - * | } || || IF{ || | - * | } || || IF{ || | - * | } || || IF{ || | - * | } || || IF{|| | - * |IF{ || || } || | - * | IF{ || || } || | - * | IF{ || || } || | - * | IF{ || || } || | - * | IF{|| || } || | - * | || || || | - * | } || ||IF{ || | - * | } || || IF{ || | - * | } || || IF{ || | - * | } || || IF{ || | - * | } || || IF{|| | - * _|_______||_||_______||_|_ - * | | + /* ______ ______ + * _I____I_ _I____I_ + * / \\\ / \\\ + * |IF{ || || } || | + * | IF{ || || } || | + * | IF{ || || } || | + * | IF{ || || } || | + * | IF{|| || } || | + * | || || || | + * | } || ||IF{ || | + * | } || || IF{ || | + * | } || || IF{ || | + * | } || || IF{ || | + * | } || || IF{|| | + * |IF{ || || } || | + * | IF{ || || } || | + * | IF{ || || } || | + * | IF{ || || } || | + * | IF{|| || } || | + * | || || || | + * | } || ||IF{ || | + * | } || || IF{ || | + * | } || || IF{ || | + * | } || || IF{ || | + * | } || || IF{|| | + * |IF{ || || } || | + * | IF{ || || } || | + * | IF{ || || } || | + * | IF{ || || } || | + * | IF{|| || } || | + * | || || || | + * | } || ||IF{ || | + * | } || || IF{ || | + * | } || || IF{ || | + * | } || || IF{ || | + * | } || || IF{|| | + * _|_______||_||_______||_|_ + * | | * | | * | |==========| | * | |NESTED | | diff --git a/src/main/java/com/hbm/util/ItemStackUtil.java b/src/main/java/com/hbm/util/ItemStackUtil.java new file mode 100644 index 000000000..f694822d2 --- /dev/null +++ b/src/main/java/com/hbm/util/ItemStackUtil.java @@ -0,0 +1,32 @@ +package com.hbm.util; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.util.EnumChatFormatting; + +public class ItemStackUtil { + + /** + * UNSAFE! Will ignore all existing tags and override them! In its current state, only fit for items we know don't have any display tags! + * Will, however, respect existing NBT tags + * @param stack + * @param lines + */ + public static void addTooltipToStack(ItemStack stack, String... lines) { + + if(!stack.hasTagCompound()) + stack.stackTagCompound = new NBTTagCompound(); + + NBTTagCompound display = new NBTTagCompound(); + NBTTagList lore = new NBTTagList(); + + for(String line : lines) { + lore.appendTag(new NBTTagString(EnumChatFormatting.RESET + "" + EnumChatFormatting.GRAY + line)); + } + + display.setTag("Lore", lore); + stack.stackTagCompound.setTag("display", display); + } +} diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index b98980c51..75a25f27f 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -3569,6 +3569,7 @@ tool.ability.silktouch=Behutsamkeit tool.ability.smelter=Auto-Ofen weapon.ability.beheader=Köpfer +weapon.ability.bobble=Glück des Sammlers # Should rhyme with the translation for "chainsaw" weapon.ability.chainsaw=Skelettensäge weapon.ability.fire=Flammend diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index dafb95fff..f1880aa62 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -3647,6 +3647,7 @@ tool.ability.silktouch=Silk Touch tool.ability.smelter=Auto-Smelter weapon.ability.beheader=Decapitator +weapon.ability.bobble=Luck of the Collector # Should rhyme with the translation for "chainsaw" weapon.ability.chainsaw=Painsaw weapon.ability.fire=Flaming diff --git a/src/main/resources/assets/hbm/models/blocks/anvil.obj b/src/main/resources/assets/hbm/models/blocks/anvil.obj index 37ba2789c..b25b72332 100644 --- a/src/main/resources/assets/hbm/models/blocks/anvil.obj +++ b/src/main/resources/assets/hbm/models/blocks/anvil.obj @@ -250,40 +250,40 @@ v -0.056348 0.632910 -0.687500 v -0.079687 0.576563 -0.687500 v -0.056348 0.520215 -0.687500 v 0.000000 0.656250 -0.937500 -vt 0.125000 0.125000 -vt 0.000000 0.187500 -vt 0.000000 0.125000 -vt 0.812500 0.187500 -vt 0.687500 0.125000 -vt 0.812500 0.125000 -vt 0.687500 0.187500 -vt 0.562500 0.125000 -vt 0.125000 0.187500 +vt 0.875000 0.125000 +vt 1.000000 0.187500 +vt 1.000000 0.125000 +vt 0.187500 0.187500 +vt 0.312500 0.125000 vt 0.187500 0.125000 -vt 0.187500 0.250000 -vt 0.562500 0.250000 -vt 0.250000 0.312500 +vt 0.312500 0.187500 +vt 0.437500 0.125000 +vt 0.875000 0.187500 +vt 0.812500 0.125000 +vt 0.812500 0.250000 +vt 0.437500 0.250000 +vt 0.750000 0.312500 vt 0.500000 0.437500 vt 0.500000 0.312500 -vt 0.250000 0.500000 -vt 0.625000 0.562500 -vt 0.187500 0.562500 -vt 0.000000 0.562500 -vt 0.000000 0.812500 +vt 0.750000 0.500000 +vt 0.375000 0.562500 +vt 0.812500 0.562500 +vt 1.000000 0.562500 vt 1.000000 0.812500 -vt 1.000000 0.687500 -vt 0.125000 0.812500 -vt -0.000000 0.625000 -vt 0.125000 0.625000 +vt 0.000000 0.812500 +vt 0.000000 0.687500 +vt 0.875000 0.812500 +vt 1.000000 0.625000 +vt 0.875000 0.625000 vt 0.312500 0.625000 -vt 0.500000 0.687500 -vt 0.312500 0.687500 +vt 0.500000 0.562500 vt 0.312500 0.562500 +vt 0.312500 0.687500 vt 0.500000 0.625000 vt 0.750000 0.625000 -vt 0.500000 0.562500 -vt 0.750000 0.562500 -vt 0.000000 0.812500 +vt 0.500000 0.687500 +vt 0.750000 0.687500 +vt 1.000000 0.812500 vn -1.0000 0.0000 0.0000 vn -0.7071 0.0000 -0.7071 vn -0.7071 0.0000 0.7071 diff --git a/src/main/resources/assets/hbm/textures/gui/nei/gui_nei_anvil.png b/src/main/resources/assets/hbm/textures/gui/nei/gui_nei_anvil.png index fc8105f4f..8e1205723 100644 Binary files a/src/main/resources/assets/hbm/textures/gui/nei/gui_nei_anvil.png and b/src/main/resources/assets/hbm/textures/gui/nei/gui_nei_anvil.png differ diff --git a/src/main/resources/assets/hbm/textures/gui/processing/gui_anvil.png b/src/main/resources/assets/hbm/textures/gui/processing/gui_anvil.png index e10e5041b..7fb48fbdb 100755 Binary files a/src/main/resources/assets/hbm/textures/gui/processing/gui_anvil.png and b/src/main/resources/assets/hbm/textures/gui/processing/gui_anvil.png differ diff --git a/src/main/resources/assets/hbm/textures/models/machines/gascent.png b/src/main/resources/assets/hbm/textures/models/machines/gascent.png index c2f16d3e5..e5832a092 100644 Binary files a/src/main/resources/assets/hbm/textures/models/machines/gascent.png and b/src/main/resources/assets/hbm/textures/models/machines/gascent.png differ