Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix recipes bug #319

Merged
merged 2 commits into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/main/java/mods/eln/Eln.java
Original file line number Diff line number Diff line change
Expand Up @@ -329,15 +329,15 @@ public void preInit(FMLPreInitializationEvent event) {
elnNetwork = NetworkRegistry.INSTANCE.newSimpleChannel("electrical-age");
elnNetwork.registerMessage(AchievePacketHandler.class, AchievePacket.class, 0, Side.SERVER);
elnNetwork.registerMessage(TransparentNodeRequestPacketHandler.class, TransparentNodeRequestPacket.class, 1,
Side.SERVER);
elnNetwork.registerMessage(TransparentNodeResponsePacketHandler.class, TransparentNodeResponsePacket.class, 2
, Side.CLIENT);
Side.SERVER);
elnNetwork.registerMessage(TransparentNodeResponsePacketHandler.class, TransparentNodeResponsePacket.class, 2,
Side.CLIENT);
elnNetwork.registerMessage(GhostNodeWailaRequestPacketHandler.class, GhostNodeWailaRequestPacket.class, 3,
Side.SERVER);
elnNetwork.registerMessage(GhostNodeWailaResponsePacketHandler.class, GhostNodeWailaResponsePacket.class, 4,
Side.CLIENT);
elnNetwork.registerMessage(SixNodeWailaRequestPacketHandler.class, SixNodeWailaRequestPacket.class, 5,
Side.SERVER);
Side.SERVER);
elnNetwork.registerMessage(SixNodeWailaResponsePacketHandler.class, SixNodeWailaResponsePacket.class, 6,
Side.CLIENT);

Expand Down Expand Up @@ -390,16 +390,16 @@ public void preInit(FMLPreInitializationEvent event) {
arcMetalBlock = new ArcMetalBlock();

sharedItem =
(SharedItem) new SharedItem().setCreativeTab(creativeTab).setMaxStackSize(64).setUnlocalizedName("sharedItem");
(SharedItem) new SharedItem().setCreativeTab(creativeTab).setMaxStackSize(64).setUnlocalizedName("sharedItem");

sharedItemStackOne =
(SharedItem) new SharedItem().setCreativeTab(creativeTab).setMaxStackSize(1).setUnlocalizedName(
"sharedItemStackOne");
(SharedItem) new SharedItem().setCreativeTab(creativeTab).setMaxStackSize(1).setUnlocalizedName(
"sharedItemStackOne");

transparentNodeBlock = (TransparentNodeBlock) new TransparentNodeBlock(Material.iron,
TransparentNodeEntity.class).setCreativeTab(creativeTab).setBlockTextureName("iron_block");
TransparentNodeEntity.class).setCreativeTab(creativeTab).setBlockTextureName("iron_block");
sixNodeBlock =
(SixNodeBlock) new SixNodeBlock(Material.plants, SixNodeEntity.class).setCreativeTab(creativeTab).setBlockTextureName("iron_block");
(SixNodeBlock) new SixNodeBlock(Material.plants, SixNodeEntity.class).setCreativeTab(creativeTab).setBlockTextureName("iron_block");

ghostBlock = (GhostBlock) new GhostBlock().setBlockTextureName("iron_block");
lightBlock = new LightBlock();
Expand Down Expand Up @@ -448,7 +448,7 @@ public void modsLoaded(FMLPostInitializationEvent event) {
if (Other.ccLoaded) {
PeripheralHandler.register();
}
CraftingRecipes.INSTANCE.recipeMaceratorModOres();
CraftingRecipes.INSTANCE.itemCrafting();
}

@EventHandler
Expand All @@ -465,7 +465,7 @@ public void load(FMLInitializationEvent event) {
FMLCommonHandler.instance().bus().register(new ElnFMLEventsHandler());
MinecraftForge.EVENT_BUS.register(this);
FMLInterModComms.sendMessage("Waila", "register", "mods.eln.integration.waila.WailaIntegration" +
".callbackRegister");
".callbackRegister");
Utils.println("Electrical age init done");
}

Expand Down
87 changes: 68 additions & 19 deletions src/main/kotlin/mods/eln/craft/CraftingRecipes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import net.minecraft.launchwrapper.LogWrapper
import net.minecraftforge.oredict.OreDictionary
import net.minecraftforge.oredict.ShapedOreRecipe
import net.minecraftforge.oredict.ShapelessOreRecipe
import java.util.*
import kotlin.collections.HashSet

object CraftingRecipes {

Expand Down Expand Up @@ -116,6 +118,13 @@ object CraftingRecipes {
recipeECoal()

recipeGridDevices(Eln.oreNames)
recipeMaceratorModOres()
craftBrush()
val cal: Calendar = Calendar.getInstance()
val month: Int = cal.get(Calendar.MONTH) + 1
if(month == 12 ) {
recipeChristmas()
}

checkRecipe()
}
Expand Down Expand Up @@ -370,6 +379,10 @@ object CraftingRecipes {
findItemStack("Power Resistor"), " ", "cCc", " ", 'c', findItemStack("Copper Cable"), 'C',
findItemStack("Coal Dust")
)
addRecipe(
findItemStack("Thermistor"), " ", "cCc", " ", 'c', findItemStack("Copper Cable"), 'C',
findItemStack("Copper Ingot")
)
addRecipe(
findItemStack("Rheostat"), " R ", " MS", "cmc", 'R', findItemStack("Power Resistor"), 'c',
findItemStack("Copper Cable"), 'm', findItemStack("Machine Block"), 'M', findItemStack("Electrical Motor"),
Expand Down Expand Up @@ -434,6 +447,24 @@ object CraftingRecipes {
findItemStack("Iron Cable"), 'G', ItemStack(Blocks.glass_pane), 'I', findItemStack("Copper Cable"), 'C',
findItemStack("Signal Cable")
)
addRecipe(
findItemStack("Low Current Relay"), "GGG", "OIO", "CRC", 'R', ItemStack(Items.redstone), 'O',
findItemStack("Iron Cable"), 'G', ItemStack(Blocks.glass_pane), 'A', "itemRubber", 'I', findItemStack(
"Copper Cable"
), 'C', findItemStack("Low Current Cable")
)
addRecipe(
findItemStack("Medium Current Relay"), "GGG", "OIO", "CRC", 'R', ItemStack(Items.redstone), 'O',
findItemStack("Iron Cable"), 'G', ItemStack(Blocks.glass_pane), 'A', "itemRubber", 'I', findItemStack(
"Copper Cable"
), 'C', findItemStack("Medium Current Cable")
)
addRecipe(
findItemStack("High Current Relay"), "GGG", "OIO", "CRC", 'R', ItemStack(Items.redstone), 'O',
findItemStack("Iron Cable"), 'G', ItemStack(Blocks.glass_pane), 'A', "itemRubber", 'I', findItemStack(
"Copper Cable"
), 'C', findItemStack("High Current Cable")
)
}

private fun recipeWirelessSignal() {
Expand Down Expand Up @@ -511,6 +542,10 @@ object CraftingRecipes {
findItemStack("Amplifier"), " r", "cCc", " ", 'r', ItemStack(Items.redstone), 'c',
findItemStack("Copper Cable"), 'C', Eln.dictAdvancedChip
)
addRecipe(
findItemStack("Voltage controlled amplifier"), " sr", "cCc", " ", 'r', ItemStack(Items.redstone), 'c',
findItemStack("Copper Cable"), 'C', Eln.dictAdvancedChip, 's', findItemStack("Signal Cable")
)
addRecipe(
findItemStack("OpAmp"), " r", "cCc", " c ", 'r', ItemStack(Items.redstone), 'c',
findItemStack("Copper Cable"), 'C', Eln.dictAdvancedChip
Expand Down Expand Up @@ -610,6 +645,7 @@ object CraftingRecipes {
), 'M', findItemStack("Advanced Machine Block")
)
addRecipe(findItemStack("Joint"), " ", "iii", " m ", 'i', "ingotIron", 'm', findItemStack("Machine Block"))
addRecipe(findItemStack("Crank Shaft"), " i", "iii", " m ", 'i', "ingotIron", 'm', findItemStack("Machine Block"))
addRecipe(
findItemStack("Joint hub"), " i ", "iii", " m ", 'i', "ingotIron", 'm', findItemStack(
"Machine " +
Expand Down Expand Up @@ -638,6 +674,10 @@ object CraftingRecipes {
"Machine Block"
)
)
addRecipe(
findItemStack("Rolling Shaft Machine"), "IiI", "IcI", "IiI", 'i', "ingotIron", 'I', "plateIron", 'c', findItemStack(
"Machine Block")
)
}

private fun recipeBattery() {
Expand Down Expand Up @@ -1365,6 +1405,10 @@ object CraftingRecipes {
findItemStack("Monster Filter"), " g", "gc", " g", 'g', ItemStack(Blocks.glass_pane), 'c',
ItemStack(Items.dye, 1, 1)
)
addRecipe(
findItemStack("Animal Filter"), " g", "gc", " g", 'g', ItemStack(Blocks.glass_pane), 'c',
ItemStack(Items.dye, 1, 4)
)
addRecipe(Eln.findItemStack("Casing", 1), "ppp", "p p", "ppp", 'p', findItemStack("Iron Cable"))
addRecipe(findItemStack("Iron Clutch Plate"), " t ", "tIt", " t ", 'I', "plateIron", 't', Eln.dictTungstenDust)
addRecipe(findItemStack("Gold Clutch Plate"), " t ", "tGt", " t ", 'G', "plateGold", 't', Eln.dictTungstenDust)
Expand Down Expand Up @@ -1780,7 +1824,7 @@ object CraftingRecipes {
) //hardcoded 7MJ to prevent overunity
}

public fun recipeMaceratorModOres() {
private fun recipeMaceratorModOres() {
val f = 4000f
recipeMaceratorModOre(f * 3f, "oreCertusQuartz", "dustCertusQuartz", 3)
recipeMaceratorModOre(f * 1.5f, "crystalCertusQuartz", "dustCertusQuartz", 1)
Expand Down Expand Up @@ -2106,23 +2150,21 @@ object CraftingRecipes {
}

private fun recipeElectricalVuMeter() {
for (idx in 0..3) {
addRecipe(
Eln.findItemStack("Analog vuMeter", 1), "WWW", "RIr", "WSW", 'W', ItemStack(
Blocks.planks, 1,
idx
), 'R', ItemStack(Items.redstone), 'I', findItemStack("Iron Cable"), 'r', ItemStack(
Items.dye,
1, 1
), 'S', findItemStack("Signal Cable")
)
}
for (idx in 0..3) {
addRecipe(
Eln.findItemStack("LED vuMeter", 1), " W ", "WTW", " S ", 'W', ItemStack(Blocks.planks, 1, idx),
'T', ItemStack(Blocks.redstone_torch), 'S', findItemStack("Signal Cable")
)
}
addRecipe(
Eln.findItemStack("Analog vuMeter", 1), "WWW", "RIr", "WSW", 'W', "plankWood",
'R', ItemStack(Items.redstone), 'I', findItemStack("Iron Cable"), 'r', ItemStack(
Items.dye,
1, 1
), 'S', findItemStack("Signal Cable")
)
addRecipe(
Eln.findItemStack("LED vuMeter", 1), " W ", "WTW", " S ", 'W', "plankWood",
'T', ItemStack(Blocks.redstone_torch), 'S', findItemStack("Signal Cable")
)
addRecipe(
Eln.findItemStack("Multicolor LED vuMeter", 1), " W ", "WRW", " S ", 'W', "plankWood",
'R', ItemStack(Items.redstone), 'S', findItemStack("Signal Cable")
)
}

private fun recipeElectricalBreaker() {
Expand Down Expand Up @@ -2368,6 +2410,13 @@ object CraftingRecipes {
ReplicatorEntity.dropList.add(ItemStack(Items.glowstone_dust))
// EntityRegistry.addSpawn(ReplicatorEntity.class, 1, 1, 2, EnumCreatureType.monster, BiomeGenBase.plains);
}

private fun recipeChristmas(){
addShapelessRecipe(Eln.findItemStack("Christmas Tree", 1), findItemStack("String Lights"), ItemStack(Blocks.sapling, 1, 1), findItemStack("String Lights"))
addRecipe(
Eln.findItemStack("Holiday Candle", 1), " g ", "gbg", " i ", 'g', ItemStack(Blocks.glass_pane), 'b',
findItemStack("200V LED Bulb"), 'i', "ingotIron"
)
addShapelessRecipe(Eln.findItemStack("String Lights", 2), findItemStack("200V LED Bulb"), "materialString")
}

}