Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
Laser Diode recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
htmlcsjs committed Jan 3, 2022
1 parent 5846cc8 commit a797a28
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.Arrays;
import java.util.List;

import static net.htmlcsjs.htmlTech.common.item.HTMetaItems.EMPTY_LASER;
import static net.htmlcsjs.htmlTech.common.item.HTMetaItems.LASER_INSPECTOR;

public class HTMetaItem extends StandardMetaItem {
Expand All @@ -32,6 +33,7 @@ public HTMetaItem(short offset) {
@Override
public void registerSubItems() {
LASER_INSPECTOR = addItem(1, "tool.laser.inspector").addComponents(new LaserInspectorToolBehaviour()).setMaxStackSize(1);
EMPTY_LASER = addItem(2, "empty_laser").setMaxStackSize(1);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

public class HTMetaItems {
public static MetaItem<?>.MetaValueItem LASER_INSPECTOR;
public static MetaItem<?>.MetaValueItem EMPTY_LASER;

public static void init() {
HTMetaItem item = new HTMetaItem((short) 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

import net.htmlcsjs.htmlTech.loaders.recipe.LaserEquipmentLoader;
import net.htmlcsjs.htmlTech.loaders.recipe.MaterialLoader;
import net.htmlcsjs.htmlTech.loaders.recipe.handlers.HTRecipeHandlers;

public class HTRecipeManiger {

public static void init() {
LaserEquipmentLoader.init();
MaterialLoader.init();

HTRecipeHandlers.register();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static net.htmlcsjs.htmlTech.api.HTValues.mteLength;
import static net.htmlcsjs.htmlTech.common.blocks.HTMetaBlocks.HT_CASING;
import static net.htmlcsjs.htmlTech.common.blocks.HTMetaBlocks.LASER_PIPES;
import static net.htmlcsjs.htmlTech.common.item.HTMetaItems.EMPTY_LASER;
import static net.htmlcsjs.htmlTech.common.metatileentity.HTMetaTileEntities.*;

public class LaserEquipmentLoader {
Expand Down Expand Up @@ -114,5 +115,15 @@ public static void init() {
.duration(800)
.buildAndRegister();

// Empty Laser Recipe
ASSEMBLER_RECIPES.recipeBuilder()
.input(GLASS_TUBE)
.input(lens, Glass)
.fluidInputs(Silver.getFluid(4*L))
.output(EMPTY_LASER)
.EUt(VA[EV])
.duration(20)
.buildAndRegister();

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package net.htmlcsjs.htmlTech.loaders.recipe.handlers;

public class HTRecipeHandlers {

public static void register() {
LaserHandler.register();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package net.htmlcsjs.htmlTech.loaders.recipe.handlers;

import gregtech.api.unification.material.Material;
import gregtech.api.unification.ore.OrePrefix;
import gregtech.api.util.GTUtility;
import net.htmlcsjs.htmlTech.api.unification.materials.HTMaterials;
import net.htmlcsjs.htmlTech.api.unification.materials.LaserProperties;
import net.htmlcsjs.htmlTech.common.item.HTMetaItems;

import static gregtech.api.GTValues.VA;
import static gregtech.api.recipes.RecipeMaps.CANNER_RECIPES;
import static net.htmlcsjs.htmlTech.api.unification.materials.HTOrePrefix.laser;

public class LaserHandler {

public static void register() {
laser.addProcessingHandler(HTMaterials.LASER, LaserHandler::generateLaserCanningRecipe);
}

private static void generateLaserCanningRecipe (OrePrefix orePrefix, Material material, LaserProperties properties) {
CANNER_RECIPES.recipeBuilder()
.input(HTMetaItems.EMPTY_LASER)
.fluidInputs(material.getFluid(1000))
.output(orePrefix, material)
.duration(20000)
.EUt(VA[GTUtility.getTierByVoltage(properties.voltage)])
.buildAndRegister();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "gregtech:items/metaitems/empty_laser"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/main/resources/assets/htmltech/lang/en_us.lang
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
metaitem.tool.laser.inspector.name=Laser Inspector
metaitem.tool.laser.inspector.gui.title=§n§lLaser Inspector
metaitem.tool.laser.inspector.gui.not_laser=§lThis isnt a laser, please put in a htmlTech Laser
metaitem.empty_laser.name=Empty Laser


htmltech.laser.voltage=Max Voltage: §a%,d (§r%s§a)
Expand Down

0 comments on commit a797a28

Please sign in to comment.