diff --git a/changelog b/changelog index aea9ce396..f75344b58 100644 --- a/changelog +++ b/changelog @@ -1,38 +1,10 @@ -## Added -* Key pad - * Fits visually with the RBMK display block - * Allows up to four buttons to be configured with a screwdriver (shift click!) - * Buttons will send RoR signals when pressed, with a configured value on the configured frequencies - * Can be set to polling, which will re-send the command until the button is pressed again - * Single push buttons and buttons set to polling which are enabled will glow in the dark - * Each button can be assigned a label with glow in the dark paint - * Allows RBMK control rods to be fully remote controllable with no console -* Gauge - * Allows up to four gauges to be configured with a screwdriver - * Gauges can read RoR signals and display numeric values on a specified range - * Minimum and maximum values can be defined, the gauge also has a red area for when the value exceeds the maximum - * If the minimum value is larger than the maximum, the needle will start at the top and run backwards - * Also has glow in the dark paint labels - ## Changed -* Updated chinese and ukrainian localization -* Updated textures for some nuclear bomb GUIs -* Updated textures for steel tools -* RBMK fuel rods too hot to be taken out manually can now be removed by players in creative mode -* Updated the SILEX recycling recipe for MOX fuel to reflect the recent recipe change - * High-xenon MOX pellets now yield xenon-135 again -* Improved logging for incorrectly configured machine recipes -* Removed the legacy toolbox item -* Due to complaints, the MOX recipe was now made more expensive -* Manual control rods now have the `extendrods` command, which allows the target setting to be adjusted without using an absolute value -* Removed the legacy relay structure -* Placing RBMK fuel rods in the fuel channels by right click no longer consumes the item in creative mode +* Doubled bismuth and tantalum yields from high-performance solvent bedrock ore processing +* Hoppers and buckets can now be made out of steel +* RoR gauges now show the lowest and highest configured value on the actual gauge +* The steel sword now looks like a medival broad sword with the appropriate scale +* All remaining items have been removed from the template folder, siren tracks and plate stamps are now made in th ## Fixed -* Fixed some damage categories not applying correctly, causing things like general energy resistance to not work against lasers -* Fixed RoR components not being able to be attached to the top of reasim fuel rods -* Fixed a crash in multiplayer regarding RBMK control rods -* Fixed outdated QMAW description of some RBMK parts -* Fixed log spam when placing down a RoR controller -* Fixed the RBMK fuel crane being all jittery and awful -* Fixed RoR reader sending the xenon value on RBMK fuel rods that's 100x the intended value +* Fixed size 15 dual kerosene thruster not rendering at all +* Fixed HUD/jetpack toggle popup not working at all on multiplayer servers \ No newline at end of file diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 38cac7b77..2c9a506ab 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -8,14 +8,7 @@ import com.hbm.blocks.generic.*; import com.hbm.blocks.generic.BlockHazard.ExtDisplayEffect; import com.hbm.blocks.machine.*; import com.hbm.blocks.machine.albion.*; -import com.hbm.blocks.machine.fusion.MachineFusionBoiler; -import com.hbm.blocks.machine.fusion.MachineFusionBreeder; -import com.hbm.blocks.machine.fusion.MachineFusionCollector; -import com.hbm.blocks.machine.fusion.MachineFusionCoupler; -import com.hbm.blocks.machine.fusion.MachineFusionKlystron; -import com.hbm.blocks.machine.fusion.MachineFusionKlystronCreative; -import com.hbm.blocks.machine.fusion.MachineFusionMHDT; -import com.hbm.blocks.machine.fusion.MachineFusionTorus; +import com.hbm.blocks.machine.fusion.*; import com.hbm.blocks.machine.pile.*; import com.hbm.blocks.machine.rbmk.*; import com.hbm.blocks.network.*; @@ -887,6 +880,7 @@ public class ModBlocks { public static Block fusion_boiler; public static Block fusion_mhdt; public static Block fusion_coupler; + public static Block fusion_plasma_forge; public static Block machine_icf_press; public static Block icf_component; @@ -2003,6 +1997,7 @@ public class ModBlocks { fusion_boiler = new MachineFusionBoiler().setBlockName("fusion_boiler").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); fusion_mhdt = new MachineFusionMHDT().setBlockName("fusion_mhdt").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); fusion_coupler = new MachineFusionCoupler().setBlockName("fusion_coupler").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); + fusion_plasma_forge = new MachineFusionPlasmaForge().setBlockName("fusion_plasma_forge").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); machine_icf_press = new MachineICFPress().setBlockName("machine_icf_press").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); icf = new MachineICF().setBlockName("icf").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); @@ -3364,6 +3359,7 @@ public class ModBlocks { register(fusion_boiler); register(fusion_mhdt); register(fusion_coupler); + register(fusion_plasma_forge); register(watz_element); register(watz_cooler); diff --git a/src/main/java/com/hbm/blocks/machine/fusion/MachineFusionPlasmaForge.java b/src/main/java/com/hbm/blocks/machine/fusion/MachineFusionPlasmaForge.java new file mode 100644 index 000000000..3e6235a0c --- /dev/null +++ b/src/main/java/com/hbm/blocks/machine/fusion/MachineFusionPlasmaForge.java @@ -0,0 +1,38 @@ +package com.hbm.blocks.machine.fusion; + +import com.hbm.blocks.BlockDummyable; +import com.hbm.tileentity.TileEntityProxyCombo; +import com.hbm.tileentity.machine.fusion.TileEntityFusionPlasmaForge; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class MachineFusionPlasmaForge extends BlockDummyable { + + public MachineFusionPlasmaForge() { + super(Material.iron); + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) { + if(meta >= 12) return new TileEntityFusionPlasmaForge(); + if(meta >= 6) return new TileEntityProxyCombo().inventory().power().fluid(); + return null; + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { + return this.standardOpenBehavior(world, x, y, z, player, 0); + } + + @Override public int[] getDimensions() { return new int[] { 4, 0, 5, 5, 5, 5 }; } + @Override public int getOffset() { return 5; } + + @Override + public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) { + super.fillSpace(world, x, y, z, dir, o); + } +} diff --git a/src/main/java/com/hbm/extprop/HbmPlayerProps.java b/src/main/java/com/hbm/extprop/HbmPlayerProps.java index e1b64d8e9..207bb6d44 100644 --- a/src/main/java/com/hbm/extprop/HbmPlayerProps.java +++ b/src/main/java/com/hbm/extprop/HbmPlayerProps.java @@ -5,12 +5,15 @@ import com.hbm.handler.ArmorModHandler; import com.hbm.handler.HbmKeybinds.EnumKeybind; import com.hbm.items.armor.ItemModShield; import com.hbm.main.MainRegistry; +import com.hbm.packet.PacketDispatcher; +import com.hbm.packet.toclient.PlayerInformPacket; import com.hbm.tileentity.IGUIProvider; import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import io.netty.buffer.ByteBuf; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -86,9 +89,9 @@ public class HbmPlayerProps implements IExtendedEntityProperties { this.enableBackpack = !this.enableBackpack; if(this.enableBackpack) - MainRegistry.proxy.displayTooltip(EnumChatFormatting.GREEN + "Jetpack ON", MainRegistry.proxy.ID_JETPACK); + PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(EnumChatFormatting.GREEN + "Jetpack ON", MainRegistry.proxy.ID_JETPACK, 1000), (EntityPlayerMP) player); else - MainRegistry.proxy.displayTooltip(EnumChatFormatting.RED + "Jetpack OFF", MainRegistry.proxy.ID_JETPACK); + PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(EnumChatFormatting.RED + "Jetpack OFF", MainRegistry.proxy.ID_JETPACK, 1000), (EntityPlayerMP) player); } } if (key == EnumKeybind.TOGGLE_MAGNET){ @@ -96,9 +99,9 @@ public class HbmPlayerProps implements IExtendedEntityProperties { this.enableMagnet = !this.enableMagnet; if(this.enableMagnet) - MainRegistry.proxy.displayTooltip(EnumChatFormatting.GREEN + "Magnet ON", MainRegistry.proxy.ID_MAGNET); + PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(EnumChatFormatting.GREEN + "Magnet ON", MainRegistry.proxy.ID_MAGNET, 1000), (EntityPlayerMP) player); else - MainRegistry.proxy.displayTooltip(EnumChatFormatting.RED + "Magnet OFF", MainRegistry.proxy.ID_MAGNET); + PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(EnumChatFormatting.GREEN + "Magnet ON", MainRegistry.proxy.ID_MAGNET, 1000), (EntityPlayerMP) player); } } if(key == EnumKeybind.TOGGLE_HEAD) { @@ -107,9 +110,9 @@ public class HbmPlayerProps implements IExtendedEntityProperties { this.enableHUD = !this.enableHUD; if(this.enableHUD) - MainRegistry.proxy.displayTooltip(EnumChatFormatting.GREEN + "HUD ON", MainRegistry.proxy.ID_HUD); + PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(EnumChatFormatting.GREEN + "HUD ON", MainRegistry.proxy.ID_HUD, 1000), (EntityPlayerMP) player); else - MainRegistry.proxy.displayTooltip(EnumChatFormatting.RED + "HUD OFF", MainRegistry.proxy.ID_HUD); + PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(EnumChatFormatting.GREEN + "HUD ON", MainRegistry.proxy.ID_HUD, 1000), (EntityPlayerMP) player); } } diff --git a/src/main/java/com/hbm/inventory/gui/GUIScreenTemplateFolder.java b/src/main/java/com/hbm/inventory/gui/GUIScreenTemplateFolder.java index 135250162..bd0ff47be 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIScreenTemplateFolder.java +++ b/src/main/java/com/hbm/inventory/gui/GUIScreenTemplateFolder.java @@ -56,17 +56,7 @@ public class GUIScreenTemplateFolder extends GuiScreen { this.isJournal = item != ModItems.template_folder; - if(!this.isJournal) { - // Stamps - for(ItemStack i : ItemStamp.stamps.get(StampType.PLATE)) allStacks.add(i.copy()); - for(ItemStack i : ItemStamp.stamps.get(StampType.WIRE)) allStacks.add(i.copy()); - for(ItemStack i : ItemStamp.stamps.get(StampType.CIRCUIT)) allStacks.add(i.copy()); - - // Tracks - for(int i = 1; i < ItemCassette.TrackType.values().length; i++) { - allStacks.add(new ItemStack(ModItems.siren_track, 1, i)); - } - } + if(!this.isJournal) { diff --git a/src/main/java/com/hbm/inventory/recipes/AssemblyMachineRecipes.java b/src/main/java/com/hbm/inventory/recipes/AssemblyMachineRecipes.java index b91609144..75550e704 100644 --- a/src/main/java/com/hbm/inventory/recipes/AssemblyMachineRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/AssemblyMachineRecipes.java @@ -1154,7 +1154,6 @@ public class AssemblyMachineRecipes extends GenericRecipes { new ComparableStack(ModItems.motor_bismuth, 3))); } } - } public static HashMap getRecipes() { diff --git a/src/main/java/com/hbm/inventory/recipes/PlasmaForgeRecipes.java b/src/main/java/com/hbm/inventory/recipes/PlasmaForgeRecipes.java new file mode 100644 index 000000000..c6634c69a --- /dev/null +++ b/src/main/java/com/hbm/inventory/recipes/PlasmaForgeRecipes.java @@ -0,0 +1,80 @@ +package com.hbm.inventory.recipes; + +import static com.hbm.inventory.OreDictManager.BSCCO; +import static com.hbm.inventory.OreDictManager.SBD; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import com.hbm.blocks.ModBlocks; +import com.hbm.inventory.FluidStack; +import com.hbm.inventory.RecipesCommon.AStack; +import com.hbm.inventory.RecipesCommon.ComparableStack; +import com.hbm.inventory.RecipesCommon.OreDictStack; +import com.hbm.inventory.recipes.loader.GenericRecipe; +import com.hbm.inventory.recipes.loader.GenericRecipes; +import com.hbm.items.ModItems; +import com.hbm.items.ItemEnums.EnumExpensiveType; +import com.hbm.items.ItemGenericPart.EnumPartType; +import com.hbm.items.machine.ItemFluidIcon; +import com.hbm.items.machine.ItemCircuit.EnumCircuitType; + +import net.minecraft.item.ItemStack; + +public class PlasmaForgeRecipes extends GenericRecipes { + + public static final PlasmaForgeRecipes INSTANCE = new PlasmaForgeRecipes(); + + @Override public int inputItemLimit() { return 12; } + @Override public int inputFluidLimit() { return 1; } + @Override public int outputItemLimit() { return 1; } + @Override public int outputFluidLimit() { return 0; } + + @Override public String getFileName() { return "hbmPlasmaForge.json"; } + @Override public GenericRecipe instantiateRecipe(String name) { return new GenericRecipe(name); } + + @Override + public void registerDefaults() { + + this.register(new GenericRecipe("plsm.gerald").setup(6_000, 100).outputItems(new ItemStack(ModItems.sat_gerald, 1)) + .inputItems(new OreDictStack(SBD.plateCast(), 64), + new OreDictStack(SBD.plateCast(), 64), + new OreDictStack(BSCCO.wireDense(), 64), + new OreDictStack(BSCCO.wireDense(), 64), + new ComparableStack(ModBlocks.det_nuke, 64), + new ComparableStack(ModItems.part_generic, 64, EnumPartType.HDE), + new ComparableStack(ModItems.part_generic, 64, EnumPartType.HDE), + new ComparableStack(ModItems.part_generic, 64, EnumPartType.HDE), + new ComparableStack(ModItems.part_generic, 64, EnumPartType.HDE), + new ComparableStack(ModItems.circuit, 64, EnumCircuitType.CONTROLLER_QUANTUM), + new ComparableStack(ModItems.coin_ufo, 1)) + .inputItemsEx(new OreDictStack(SBD.plateCast(), 64), + new OreDictStack(BSCCO.wireDense(), 64), + new ComparableStack(ModBlocks.det_nuke, 64), + new ComparableStack(ModItems.item_expensive, 64, EnumExpensiveType.BRONZE_TUBES), + new ComparableStack(ModItems.item_expensive, 64, EnumExpensiveType.BRONZE_TUBES), + new ComparableStack(ModItems.item_expensive, 64, EnumExpensiveType.BRONZE_TUBES), + new ComparableStack(ModItems.part_generic, 64, EnumPartType.HDE), + new ComparableStack(ModItems.part_generic, 64, EnumPartType.HDE), + new ComparableStack(ModItems.part_generic, 64, EnumPartType.HDE), + new ComparableStack(ModItems.circuit, 64, EnumCircuitType.CONTROLLER_QUANTUM), + new ComparableStack(ModItems.item_expensive, 64, EnumExpensiveType.COMPUTER), + new ComparableStack(ModItems.coin_ufo, 1)).setPools(GenericRecipes.POOL_PREFIX_DISCOVER + "gerald")); + } + + public static HashMap getRecipes() { + HashMap recipes = new HashMap(); + + for(GenericRecipe recipe : INSTANCE.recipeOrderedList) { + List input = new ArrayList(); + if(recipe.inputItem != null) for(AStack stack : recipe.inputItem) input.add(stack); + if(recipe.inputFluid != null) for(FluidStack stack : recipe.inputFluid) input.add(ItemFluidIcon.make(stack)); + List output = new ArrayList(); + if(recipe.outputItem != null) for(IOutput stack : recipe.outputItem) output.add(stack.getAllPossibilities()); + recipes.put(input.toArray(), output.toArray()); + } + + return recipes; + } +} diff --git a/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java b/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java index 8a68e0ccf..67587ad44 100644 --- a/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java @@ -166,7 +166,9 @@ public class AnvilRecipes extends SerializableRecipe { constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(EMERALD.dust()), new AnvilOutput(new ItemStack(Items.emerald))).setTier(3)); registerConstructionRecipes(); + registerConstructionStamps(); registerConstructionAmmo(); + registerConstructionSirens(); registerConstructionUpgrades(); registerConstructionRecycling(); } @@ -578,6 +580,34 @@ public class AnvilRecipes extends SerializableRecipe { } } + public static void registerConstructionStamps() { + + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_stone_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_stone_plate))).setTier(1)); + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_stone_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_stone_wire))).setTier(1)); + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_stone_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_stone_circuit))).setTier(1)); + + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_iron_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_iron_plate))).setTier(1)); + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_iron_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_iron_wire))).setTier(1)); + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_iron_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_iron_circuit))).setTier(1)); + + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_steel_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_steel_plate))).setTier(2)); + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_steel_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_steel_wire))).setTier(2)); + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_steel_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_steel_circuit))).setTier(2)); + + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_titanium_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_titanium_plate))).setTier(2)); + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_titanium_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_titanium_wire))).setTier(2)); + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_titanium_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_titanium_circuit))).setTier(2)); + + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_obsidian_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_obsidian_plate))).setTier(2)); + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_obsidian_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_obsidian_wire))).setTier(2)); + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_obsidian_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_obsidian_circuit))).setTier(2)); + + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_desh_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_desh_plate))).setTier(3)); + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_desh_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_desh_wire))).setTier(3)); + constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModItems.stamp_desh_flat, 1),new AnvilOutput(new ItemStack(ModItems.stamp_desh_circuit))).setTier(3)); + + } + public static void registerConstructionAmmo() { constructionRecipes.add(new AnvilConstructionRecipe(new AStack[]{new ComparableStack(ModItems.stamp_iron_flat), new OreDictStack(GUNMETAL.ingot(), 2)}, new AnvilOutput(new ItemStack(ModItems.stamp_9))).setTier(2)); @@ -597,6 +627,14 @@ public class AnvilRecipes extends SerializableRecipe { constructionRecipes.add(new AnvilConstructionRecipe(new AStack[]{new ComparableStack(ModItems.mold_base), new OreDictStack(STEEL.ingot(), 4)}, new AnvilOutput(new ItemStack(ModItems.mold, 1, 28))).setTier(2)); } + public static void registerConstructionSirens() { + for(int i = 1; i < 21; i++) { + constructionRecipes.add(new AnvilConstructionRecipe(new AStack[] {new OreDictStack(STEEL.plate()), new ComparableStack(ModItems.plate_polymer)}, new AnvilOutput(new ItemStack(ModItems.siren_track, 1, i))).setTier(2).setOverlay(OverlayType.CONSTRUCTION)); + } + + + } + public static void registerConstructionUpgrades() { } public static void registerConstructionRecycling() { diff --git a/src/main/java/com/hbm/inventory/recipes/loader/GenericRecipe.java b/src/main/java/com/hbm/inventory/recipes/loader/GenericRecipe.java index 27f92cb14..145ed89ab 100644 --- a/src/main/java/com/hbm/inventory/recipes/loader/GenericRecipe.java +++ b/src/main/java/com/hbm/inventory/recipes/loader/GenericRecipe.java @@ -82,7 +82,6 @@ public class GenericRecipe { public GenericRecipe outputFluids(FluidStack... output) { this.outputFluid = output; return this; } private void checkStackLimit(AStack stack) { - boolean exceeds = false; int max = 64; if(stack instanceof ComparableStack) { ComparableStack comp = (ComparableStack) stack; diff --git a/src/main/java/com/hbm/items/machine/ItemCassette.java b/src/main/java/com/hbm/items/machine/ItemCassette.java index 9a0dc6a55..12667e1cb 100644 --- a/src/main/java/com/hbm/items/machine/ItemCassette.java +++ b/src/main/java/com/hbm/items/machine/ItemCassette.java @@ -120,8 +120,6 @@ public class ItemCassette extends Item { if(!(stack.getItem() instanceof ItemCassette)) return; - list.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("info.templatefolder", I18nUtil.resolveKey(ModItems.template_folder.getUnlocalizedName() + ".name"))); - list.add(""); list.add("Siren sound cassette:"); list.add(" Name: " + TrackType.getEnum(stack.getItemDamage()).getTrackTitle()); diff --git a/src/main/java/com/hbm/items/machine/ItemStamp.java b/src/main/java/com/hbm/items/machine/ItemStamp.java index 629f634e0..ee6372fc2 100644 --- a/src/main/java/com/hbm/items/machine/ItemStamp.java +++ b/src/main/java/com/hbm/items/machine/ItemStamp.java @@ -34,11 +34,7 @@ public class ItemStamp extends Item { stamps.put(type, list); } - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { - if(this.type == StampType.PLATE || this.type == StampType.WIRE || this.type == StampType.CIRCUIT) - list.add("[CREATED USING TEMPLATE FOLDER]"); - } + /** Params can't take an ItemStack, for some reason it crashes during init */ public StampType getStampType(Item item, int meta) { diff --git a/src/main/java/com/hbm/items/special/ItemBedrockOreNew.java b/src/main/java/com/hbm/items/special/ItemBedrockOreNew.java index ef67a0bff..ac45fb167 100644 --- a/src/main/java/com/hbm/items/special/ItemBedrockOreNew.java +++ b/src/main/java/com/hbm/items/special/ItemBedrockOreNew.java @@ -130,7 +130,7 @@ public class ItemBedrockOreNew extends Item { public static enum BedrockOreType { // primary sulfuric solvent radsolvent LIGHT_METAL( 0xFFFFFF, 0x353535, "light", o(MAT_IRON, 9), o(MAT_COPPER, 9), o(MAT_TITANIUM, 6), o(MAT_BAUXITE, 9), o(MAT_CRYOLITE, 3), o(MAT_CHLOROCALCITE, 5), o(MAT_LITHIUM, 5), o(MAT_SODIUM, 3), o(MAT_CHLOROCALCITE, 6), o(MAT_LITHIUM, 6), o(MAT_SODIUM, 6)), - HEAVY_METAL( 0x868686, 0x000000, "heavy", o(MAT_TUNGSTEN, 9), o(MAT_LEAD, 9), o(MAT_GOLD, 2), o(MAT_GOLD, 2), o(MAT_BERYLLIUM, 3), o(MAT_TUNGSTEN, 9), o(MAT_LEAD, 9), o(MAT_GOLD, 5), o(MAT_BISMUTH, 1), o(MAT_TANTALIUM, 1), o(MAT_GOLD, 6)), + HEAVY_METAL( 0x868686, 0x000000, "heavy", o(MAT_TUNGSTEN, 9), o(MAT_LEAD, 9), o(MAT_GOLD, 2), o(MAT_GOLD, 2), o(MAT_BERYLLIUM, 3), o(MAT_TUNGSTEN, 9), o(MAT_LEAD, 9), o(MAT_GOLD, 5), o(MAT_BISMUTH, 2), o(MAT_TANTALIUM, 2), o(MAT_GOLD, 6)), RARE_EARTH( 0xE6E6B6, 0x1C1C00, "rare", o(MAT_COBALT, 5), o(MAT_RAREEARTH, 5),o(MAT_BORON, 5), o(MAT_LANTHANIUM, 3), o(MAT_NIOBIUM, 4), o(MAT_NEODYMIUM, 3), o(MAT_STRONTIUM, 3), o(MAT_ZIRCONIUM, 3), o(MAT_NIOBIUM, 5), o(MAT_NEODYMIUM, 5), o(MAT_STRONTIUM, 3)), ACTINIDE( 0xC1C7BD, 0x2B3227, "actinide", o(MAT_URANIUM, 4), o(MAT_THORIUM, 4), o(MAT_RADIUM, 2), o(MAT_RADIUM, 2), o(MAT_POLONIUM, 2), o(MAT_RADIUM, 2), o(MAT_RADIUM, 2), o(MAT_POLONIUM, 2), o(MAT_TECHNETIUM, 1), o(MAT_TECHNETIUM, 1), o(MAT_U238, 1)), NON_METAL( 0xAFAFAF, 0x0F0F0F, "nonmetal", o(MAT_COAL, 9), o(MAT_SULFUR, 9), o(MAT_LIGNITE, 9), o(MAT_KNO, 6), o(MAT_FLUORITE, 6), o(MAT_PHOSPHORUS, 5), o(MAT_FLUORITE, 6), o(MAT_SULFUR, 6), o(MAT_CHLOROCALCITE, 6), o(MAT_SILICON, 2), o(MAT_SILICON, 2)), diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index c07020291..610786c2a 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -431,6 +431,7 @@ public class ClientProxy extends ServerProxy { ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFusionBoiler.class, new RenderFusionBoiler()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFusionMHDT.class, new RenderFusionMHDT()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFusionCoupler.class, new RenderFusionCoupler()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFusionPlasmaForge.class, new RenderFusionPlasmaForge()); //Watz ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWatz.class, new RenderWatz()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWatzPump.class, new RenderWatzPump()); @@ -487,6 +488,7 @@ public class ClientProxy extends ServerProxy { double[] tir = new double[] {0, 0, 0}; double[] sir = new double[] {1, 1, 1}; + MinecraftForgeClient.registerItemRenderer(ModItems.steel_sword, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir)); MinecraftForgeClient.registerItemRenderer(ModItems.titanium_sword, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir)); MinecraftForgeClient.registerItemRenderer(ModItems.alloy_sword, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir)); MinecraftForgeClient.registerItemRenderer(ModItems.desh_sword, new ItemRenderTransformer(rtp, ttp_low, stp, rfp, tfp, sfp, rir, tir, sir)); diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index 90ab0e3a9..ec8a8a774 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -293,6 +293,8 @@ public class CraftingManager { addRecipeAuto(new ItemStack(ModBlocks.machine_autocrafter, 1), new Object[] { "SCS", "MWM", "SCS", 'S', STEEL.plate(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.VACUUM_TUBE), 'M', ModItems.motor, 'W', Blocks.crafting_table }); addRecipeAuto(new ItemStack(ModBlocks.machine_funnel, 1), new Object[] { "S S", "SRS", " S ", 'S', STEEL.ingot(), 'R', REDSTONE.dust() }); + addRecipeAuto(new ItemStack(Blocks.hopper, 1), new Object[] { "S S", "S S", " S ", 'S', STEEL.ingot() }); + addRecipeAuto(new ItemStack(Items.bucket, 1), new Object[] { "S S", " S ", 'S', STEEL.ingot() }); addRecipeAuto(new ItemStack(ModBlocks.machine_waste_drum, 1), new Object[] { "LRL", "BRB", "LRL", 'L', PB.ingot(), 'B', Blocks.iron_bars, 'R', ModItems.rod_quad_empty }); addRecipeAuto(new ItemStack(ModBlocks.machine_press, 1), new Object[] { "IRI", "IPI", "IBI", 'I', IRON.ingot(), 'R', Blocks.furnace, 'B', IRON.block(), 'P', Blocks.piston }); addRecipeAuto(new ItemStack(ModBlocks.machine_ammo_press, 1), new Object[] { "IPI", "C C", "SSS", 'I', IRON.ingot(), 'P', Blocks.piston, 'C', CU.ingot(), 'S', Blocks.stone }); diff --git a/src/main/java/com/hbm/main/ResourceManager.java b/src/main/java/com/hbm/main/ResourceManager.java index 89c233042..2391413a4 100644 --- a/src/main/java/com/hbm/main/ResourceManager.java +++ b/src/main/java/com/hbm/main/ResourceManager.java @@ -249,6 +249,7 @@ public class ResourceManager { public static final IModelCustom fusion_boiler = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/fusion/boiler.obj")).asVBO(); public static final IModelCustom fusion_mhdt = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/fusion/mhdt.obj")).asVBO(); public static final IModelCustom fusion_coupler = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/fusion/coupler.obj")).asVBO(); + public static final IModelCustom fusion_plasma_forge = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/fusion/plasma_forge.obj")).asVBO(); //ICF public static final IModelCustom icf = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/reactors/icf.obj")).asVBO(); @@ -723,6 +724,7 @@ public class ResourceManager { public static final ResourceLocation fusion_boiler_tex = new ResourceLocation(RefStrings.MODID, "textures/models/fusion/boiler.png"); public static final ResourceLocation fusion_mhdt_tex = new ResourceLocation(RefStrings.MODID, "textures/models/fusion/mhdt.png"); public static final ResourceLocation fusion_coupler_tex = new ResourceLocation(RefStrings.MODID, "textures/models/fusion/coupler.png"); + public static final ResourceLocation fusion_plasma_forge_tex = new ResourceLocation(RefStrings.MODID, "textures/models/fusion/plasma_forge.png"); //ICF public static final ResourceLocation icf_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/icf.png"); diff --git a/src/main/java/com/hbm/module/machine/ModuleMachinePlasma.java b/src/main/java/com/hbm/module/machine/ModuleMachinePlasma.java new file mode 100644 index 000000000..0e4de9b3a --- /dev/null +++ b/src/main/java/com/hbm/module/machine/ModuleMachinePlasma.java @@ -0,0 +1,37 @@ +package com.hbm.module.machine; + +import com.hbm.inventory.fluid.tank.FluidTank; +import com.hbm.inventory.recipes.PlasmaForgeRecipes; +import com.hbm.inventory.recipes.loader.GenericRecipe; +import com.hbm.inventory.recipes.loader.GenericRecipes; +import com.hbm.util.BobMathUtil; + +import api.hbm.energymk2.IEnergyHandlerMK2; +import net.minecraft.item.ItemStack; + +public class ModuleMachinePlasma extends ModuleMachineBase { + + public ModuleMachinePlasma(int index, IEnergyHandlerMK2 battery, ItemStack[] slots) { + super(index, battery, slots); + this.inputSlots = new int[12]; + this.outputSlots = new int[1]; + this.inputTanks = new FluidTank[1]; + this.outputTanks = new FluidTank[0]; + } + + @Override + public GenericRecipes getRecipeSet() { + return PlasmaForgeRecipes.INSTANCE; + } + + @Override + public void setupTanks(GenericRecipe recipe) { + super.setupTanks(recipe); + if(recipe == null) return; + for(int i = 0; i < inputTanks.length; i++) if(recipe.inputFluid != null && recipe.inputFluid.length > i) inputTanks[i].changeTankSize(BobMathUtil.max(inputTanks[i].getFill(), recipe.inputFluid[i].fill * 2, 16_000)); + } + + public ModuleMachinePlasma itemInput(int from) { for(int i = 0; i < inputSlots.length; i++) inputSlots[i] = from + i; return this; } + public ModuleMachinePlasma itemOutput(int a) { outputSlots[0] = a; return this; } + public ModuleMachinePlasma fluidInput(FluidTank a) { inputTanks[0] = a; return this; } +} diff --git a/src/main/java/com/hbm/render/tileentity/RenderFusionPlasmaForge.java b/src/main/java/com/hbm/render/tileentity/RenderFusionPlasmaForge.java new file mode 100644 index 000000000..070c2df85 --- /dev/null +++ b/src/main/java/com/hbm/render/tileentity/RenderFusionPlasmaForge.java @@ -0,0 +1,128 @@ +package com.hbm.render.tileentity; + +import org.lwjgl.opengl.GL11; + +import com.hbm.blocks.BlockDummyable; +import com.hbm.blocks.ModBlocks; +import com.hbm.main.ResourceManager; +import com.hbm.render.item.ItemRenderBase; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.client.IItemRenderer; + +public class RenderFusionPlasmaForge extends TileEntitySpecialRenderer implements IItemRendererProvider { + + @Override + public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) { + GL11.glPushMatrix(); + GL11.glTranslated(x + 0.5, y, z + 0.5); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_CULL_FACE); + + GL11.glRotatef(90, 0F, 1F, 0F); + + switch(tile.getBlockMetadata() - BlockDummyable.offset) { + case 2: GL11.glRotatef(90, 0F, 1F, 0F); break; + case 4: GL11.glRotatef(180, 0F, 1F, 0F); break; + case 3: GL11.glRotatef(270, 0F, 1F, 0F); break; + case 5: GL11.glRotatef(0, 0F, 1F, 0F); break; + } + + GL11.glShadeModel(GL11.GL_SMOOTH); + bindTexture(ResourceManager.fusion_plasma_forge_tex); + ResourceManager.fusion_plasma_forge.renderPart("Body"); + + GL11.glPushMatrix(); + GL11.glRotated(20, 0, 1, 0); + GL11.glPushMatrix(); + ResourceManager.fusion_plasma_forge.renderPart("SliderStriker"); + GL11.glTranslated(-2.75, 2.5, 0); + GL11.glRotated(-20, 0, 0, 1); + GL11.glTranslated(2.75, -2.5, 0); + ResourceManager.fusion_plasma_forge.renderPart("ArmLowerStriker"); + GL11.glTranslated(-2.75, 3.75, 0); + GL11.glRotated(30, 0, 0, 1); + GL11.glTranslated(2.75, -3.75, 0); + ResourceManager.fusion_plasma_forge.renderPart("ArmUpperStriker"); + GL11.glTranslated(-1.5, 3.75, 0); + GL11.glRotated(20, 0, 0, 1); + GL11.glTranslated(1.5, -3.75, 0); + ResourceManager.fusion_plasma_forge.renderPart("StrikerMount"); + GL11.glPushMatrix(); + GL11.glTranslated(0, 3.375, 0.5); + GL11.glRotated(30, 1, 0, 0); + GL11.glTranslated(0, -3.375, -0.5); + ResourceManager.fusion_plasma_forge.renderPart("StrikerRight"); + GL11.glTranslated(0, -0.5, 0); + ResourceManager.fusion_plasma_forge.renderPart("PistonRight"); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glTranslated(0, 3.375, -0.5); + GL11.glRotated(-30, 1, 0, 0); + GL11.glTranslated(0, -3.375, 0.5); + ResourceManager.fusion_plasma_forge.renderPart("StrikerLeft"); + GL11.glTranslated(0, -0.5, 0); + ResourceManager.fusion_plasma_forge.renderPart("PistonLeft"); + GL11.glPopMatrix(); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + ResourceManager.fusion_plasma_forge.renderPart("SliderJet"); + GL11.glTranslated(2.75, 2.5, 0); + GL11.glRotated(20, 0, 0, 1); + GL11.glTranslated(-2.75, -2.5, 0); + ResourceManager.fusion_plasma_forge.renderPart("ArmLowerJet"); + GL11.glTranslated(2.75, 3.75, 0); + GL11.glRotated(-20, 0, 0, 1); + GL11.glTranslated(-2.75, -3.75, 0); + ResourceManager.fusion_plasma_forge.renderPart("ArmUpperJet"); + GL11.glTranslated(1.5, 3.75, 0); + GL11.glRotated(-30, 0, 0, 1); + GL11.glTranslated(-1.5, -3.75, 0); + ResourceManager.fusion_plasma_forge.renderPart("Jet"); + GL11.glPopMatrix(); + GL11.glPopMatrix(); + + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glColor3f(0F, 0F, 0F); + ResourceManager.fusion_plasma_forge.renderPart("Plasma"); + GL11.glColor3f(1F, 1F, 1F); + GL11.glEnable(GL11.GL_TEXTURE_2D); + + GL11.glShadeModel(GL11.GL_FLAT); + + GL11.glPopMatrix(); + } + + @Override + public Item getItemForRenderer() { + return Item.getItemFromBlock(ModBlocks.fusion_plasma_forge); + } + + @Override + public IItemRenderer getRenderer() { + return new ItemRenderBase() { + public void renderInventory() { + GL11.glTranslated(0, -1, 0); + GL11.glScaled(2.75, 2.75, 2.75); + GL11.glRotated(90, 0, 1, 0); + } + public void renderCommon() { + GL11.glScaled(0.5, 0.5, 0.5); + GL11.glRotatef(90, 0F, 1F, 0F); + GL11.glShadeModel(GL11.GL_SMOOTH); + bindTexture(ResourceManager.fusion_plasma_forge_tex); + ResourceManager.fusion_plasma_forge.renderAllExcept("Plasma"); + + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glColor3f(0F, 0F, 0F); + ResourceManager.fusion_plasma_forge.renderPart("Plasma"); + GL11.glColor3f(1F, 1F, 1F); + GL11.glEnable(GL11.GL_TEXTURE_2D); + + GL11.glShadeModel(GL11.GL_FLAT); + }}; + } +} diff --git a/src/main/java/com/hbm/render/tileentity/RenderRBMKGauge.java b/src/main/java/com/hbm/render/tileentity/RenderRBMKGauge.java index 398502319..3cd143d31 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderRBMKGauge.java +++ b/src/main/java/com/hbm/render/tileentity/RenderRBMKGauge.java @@ -5,6 +5,7 @@ import org.lwjgl.opengl.GL11; import com.hbm.main.ResourceManager; import com.hbm.tileentity.machine.rbmk.TileEntityRBMKGauge; import com.hbm.tileentity.machine.rbmk.TileEntityRBMKGauge.GaugeUnit; +import com.hbm.util.BobMathUtil; import com.hbm.util.ColorUtil; import net.minecraft.client.Minecraft; @@ -71,6 +72,25 @@ public class RenderRBMKGauge extends TileEntitySpecialRenderer { FontRenderer font = Minecraft.getMinecraft().fontRenderer; int height = font.FONT_HEIGHT; + + double lineScale = 0.0025D; + String lineLower = unit.min <= 10_000 ? unit.min + "" : BobMathUtil.getShortNumber(unit.min); + String lineUpper = unit.max <= 10_000 ? unit.max + "" : BobMathUtil.getShortNumber(unit.max); + + for(int j = 0; j < 2; j++) { + GL11.glPushMatrix(); + GL11.glTranslated(0, 0.4375, -0.125); + GL11.glRotated(10 + j * 50, -1, 0, 0); + GL11.glTranslated(0, -0.4375, 0.125); + + GL11.glTranslated(0.032, 0.4375, 0.125); + GL11.glScaled(lineScale, -lineScale, lineScale); + GL11.glNormal3f(0.0F, 0.0F, -1.0F); + GL11.glRotatef(90, 0, 1, 0); + font.drawString(j == 0 ? lineLower : lineUpper, 0, -height / 2, 0x000000); + GL11.glPopMatrix(); + } + if(unit.label != null && !unit.label.isEmpty()) { GL11.glTranslated(0.01, 0.3125, 0); diff --git a/src/main/java/com/hbm/render/util/MissilePart.java b/src/main/java/com/hbm/render/util/MissilePart.java index 1f33a4b6a..74b3ff60c 100644 --- a/src/main/java/com/hbm/render/util/MissilePart.java +++ b/src/main/java/com/hbm/render/util/MissilePart.java @@ -38,6 +38,7 @@ public class MissilePart { MissilePart.registerPart(ModItems.mp_thruster_10_xenon, PartType.THRUSTER, 0.5, 1, ResourceManager.mp_t_10_xenon, ResourceManager.mp_t_10_xenon_tex); // MissilePart.registerPart(ModItems.mp_thruster_15_kerosene, PartType.THRUSTER, 1.5, 1.5, ResourceManager.mp_t_15_kerosene, ResourceManager.mp_t_15_kerosene_tex); + MissilePart.registerPart(ModItems.mp_thruster_15_kerosene_dual, PartType.THRUSTER, 1, 1.5, ResourceManager.mp_t_15_kerosene_dual, ResourceManager.mp_t_15_kerosene_dual_tex); MissilePart.registerPart(ModItems.mp_thruster_15_kerosene_triple, PartType.THRUSTER, 1, 1.5, ResourceManager.mp_t_15_kerosene_triple, ResourceManager.mp_t_15_kerosene_dual_tex); MissilePart.registerPart(ModItems.mp_thruster_15_solid, PartType.THRUSTER, 0.5, 1, ResourceManager.mp_t_15_solid, ResourceManager.mp_t_15_solid_tex); MissilePart.registerPart(ModItems.mp_thruster_15_solid_hexdecuple, PartType.THRUSTER, 0.5, 1, ResourceManager.mp_t_15_solid_hexdecuple, ResourceManager.mp_t_15_solid_hexdecuple_tex); diff --git a/src/main/java/com/hbm/tileentity/TileMappings.java b/src/main/java/com/hbm/tileentity/TileMappings.java index 68d4604ae..a71101a50 100644 --- a/src/main/java/com/hbm/tileentity/TileMappings.java +++ b/src/main/java/com/hbm/tileentity/TileMappings.java @@ -420,6 +420,7 @@ public class TileMappings { put(TileEntityFusionBoiler.class, "tileentity_fusion_boiler"); put(TileEntityFusionMHDT.class, "tileentity_fusion_mhdt"); put(TileEntityFusionCoupler.class, "tileentity_fusion_coupler"); + put(TileEntityFusionPlasmaForge.class, "tileentity_fusion_plasma_forge"); } private static void putNetwork() { diff --git a/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionPlasmaForge.java b/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionPlasmaForge.java new file mode 100644 index 000000000..36e103dd1 --- /dev/null +++ b/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionPlasmaForge.java @@ -0,0 +1,131 @@ +package com.hbm.tileentity.machine.fusion; + +import com.hbm.interfaces.IControlReceiver; +import com.hbm.inventory.fluid.Fluids; +import com.hbm.inventory.fluid.tank.FluidTank; +import com.hbm.inventory.recipes.PlasmaForgeRecipes; +import com.hbm.inventory.recipes.loader.GenericRecipe; +import com.hbm.items.ModItems; +import com.hbm.lib.Library; +import com.hbm.module.machine.ModuleMachinePlasma; +import com.hbm.tileentity.IGUIProvider; +import com.hbm.tileentity.TileEntityMachineBase; +import com.hbm.util.BobMathUtil; +import com.hbm.util.fauxpointtwelve.DirPos; + +import api.hbm.energymk2.IEnergyReceiverMK2; +import api.hbm.fluidmk2.IFluidStandardReceiverMK2; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardReceiverMK2, IControlReceiver, IGUIProvider { + + public FluidTank inputTank; + + public long power; + public long maxPower = 10_000_000; + + public ModuleMachinePlasma plasmaModule; + + public TileEntityFusionPlasmaForge() { + super(16); + this.inputTank = new FluidTank(Fluids.NONE, 16_000); + + this.plasmaModule = new ModuleMachinePlasma(0, this, slots) + .itemInput(3).itemOutput(15).fluidInput(inputTank); + } + + @Override + public String getName() { + return "container.machinePlasmaForge"; + } + + @Override + public void updateEntity() { + + if(maxPower <= 0) this.maxPower = 1_000_000; + + if(!worldObj.isRemote) { + + GenericRecipe recipe = PlasmaForgeRecipes.INSTANCE.recipeNameMap.get(plasmaModule.recipe); + if(recipe != null) this.maxPower = recipe.power * 100; + + this.maxPower = BobMathUtil.max(this.power, this.maxPower, 100_000); + this.power = Library.chargeTEFromItems(slots, 0, power, maxPower); + + for(DirPos pos : getConPos()) { + this.trySubscribe(worldObj, pos); + if(inputTank.getTankType() != Fluids.NONE) this.trySubscribe(inputTank.getTankType(), worldObj, pos); + } + } + } + + public DirPos[] getConPos() { + return new DirPos[] { + + }; + } + + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) { + if(slot == 0) return true; // battery + if(slot == 1 && stack.getItem() == ModItems.blueprints) return true; + // TODO booster material + if(this.plasmaModule.isItemValid(slot, stack)) return true; // recipe input crap + return false; + } + + @Override + public boolean canExtractItem(int i, ItemStack itemStack, int j) { + return i == 15 || this.plasmaModule.isSlotClogged(i); + } + + @Override + public int[] getAccessibleSlotsFromSide(int side) { + return new int[] {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; + } + + @Override public long getPower() { return power; } + @Override public void setPower(long power) { this.power = power; } + @Override public long getMaxPower() { return maxPower; } + + @Override public FluidTank[] getReceivingTanks() { return new FluidTank[] {inputTank}; } + @Override public FluidTank[] getAllTanks() { return new FluidTank[] {inputTank}; } + + @Override public boolean hasPermission(EntityPlayer player) { return this.isUseableByPlayer(player); } + + @Override + public void receiveControl(NBTTagCompound data) { + + } + + AxisAlignedBB bb = null; + + @Override + public AxisAlignedBB getRenderBoundingBox() { + if(bb == null) bb = AxisAlignedBB.getBoundingBox(xCoord - 5, yCoord, zCoord - 5, xCoord + 5, yCoord + 6, zCoord + 6); + return bb; + } + + @Override + @SideOnly(Side.CLIENT) + public double getMaxRenderDistanceSquared() { + return 65536.0D; + } + + @Override + public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { + return null; + } + + @Override + public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { + return null; + } +} diff --git a/src/main/resources/assets/hbm/models/fusion/plasma_forge.obj b/src/main/resources/assets/hbm/models/fusion/plasma_forge.obj index 907a63e3b..d8a5266ab 100644 --- a/src/main/resources/assets/hbm/models/fusion/plasma_forge.obj +++ b/src/main/resources/assets/hbm/models/fusion/plasma_forge.obj @@ -1562,7 +1562,7 @@ f 340/592/78 344/596/78 343/593/78 f 337/591/79 342/598/79 341/595/79 f 339/589/80 341/595/80 344/596/80 f 338/597/81 343/599/81 342/598/81 -o PistonRight_Pistonright +o PistonRight v -1.375000 4.250000 1.125000 v -1.625000 4.250000 1.125000 v -1.375000 4.250000 0.875000 diff --git a/src/main/resources/assets/hbm/textures/gui/reactors/gui_fusion_plasmaforge.png b/src/main/resources/assets/hbm/textures/gui/reactors/gui_fusion_plasmaforge.png new file mode 100644 index 000000000..ed940ab4f Binary files /dev/null and b/src/main/resources/assets/hbm/textures/gui/reactors/gui_fusion_plasmaforge.png differ diff --git a/src/main/resources/assets/hbm/textures/items/steel_sword.png b/src/main/resources/assets/hbm/textures/items/steel_sword.png index b0852ff1b..f68b72f8a 100644 Binary files a/src/main/resources/assets/hbm/textures/items/steel_sword.png and b/src/main/resources/assets/hbm/textures/items/steel_sword.png differ diff --git a/src/main/resources/assets/hbm/textures/models/fusion/plasma_forge.png b/src/main/resources/assets/hbm/textures/models/fusion/plasma_forge.png index 7ac40ddb0..b68caac73 100644 Binary files a/src/main/resources/assets/hbm/textures/models/fusion/plasma_forge.png and b/src/main/resources/assets/hbm/textures/models/fusion/plasma_forge.png differ