Skip to content

Commit

Permalink
tweak recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pilzinsel64 committed Jan 3, 2025
1 parent fba2e37 commit 8c61787
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 114 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/zerofall/ezstorage/EZStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ public void preInit(FMLPreInitializationEvent event) {
@EventHandler
public void init(FMLInitializationEvent event) {
proxy.registerRenders();
EZBlocks.registerRecipes();
}

}
133 changes: 25 additions & 108 deletions src/main/java/com/zerofall/ezstorage/init/EZBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand All @@ -23,6 +25,8 @@

import cpw.mods.fml.common.registry.GameRegistry;

// spotless:off

public class EZBlocks {

public static Block storage_core;
Expand All @@ -46,120 +50,33 @@ public static void init() {
}

public static void register() {
GameRegistry.registerBlock(
storage_core,
storage_core.getUnlocalizedName()
.substring(5));
GameRegistry.registerBlock(storage_core, storage_core.getUnlocalizedName().substring(5));
GameRegistry.registerTileEntity(TileEntityStorageCore.class, "TileEntityStorageCore");
GameRegistry.registerBlock(
storage_box,
storage_box.getUnlocalizedName()
.substring(5));
GameRegistry.registerBlock(
condensed_storage_box,
condensed_storage_box.getUnlocalizedName()
.substring(5));
GameRegistry.registerBlock(
hyper_storage_box,
hyper_storage_box.getUnlocalizedName()
.substring(5));
GameRegistry.registerBlock(
input_port,
input_port.getUnlocalizedName()
.substring(5));
GameRegistry.registerBlock(storage_box, storage_box.getUnlocalizedName().substring(5));
GameRegistry.registerBlock(condensed_storage_box, condensed_storage_box.getUnlocalizedName().substring(5));
GameRegistry.registerBlock(hyper_storage_box, hyper_storage_box.getUnlocalizedName().substring(5));
GameRegistry.registerBlock(input_port, input_port.getUnlocalizedName().substring(5));
GameRegistry.registerTileEntity(TileEntityInputPort.class, "TileEntityInputPort");
GameRegistry.registerBlock(
output_port,
output_port.getUnlocalizedName()
.substring(5));
GameRegistry.registerBlock(output_port, output_port.getUnlocalizedName().substring(5));
GameRegistry.registerTileEntity(TileEntityOutputPort.class, "TileEntityOutputPort");
GameRegistry.registerBlock(
crafting_box,
crafting_box.getUnlocalizedName()
.substring(5));
registerRecipes();
GameRegistry.registerBlock(crafting_box, crafting_box.getUnlocalizedName().substring(5));
}

public static void registerRenders() {
registerRender(storage_core);
registerRender(storage_box);
registerRender(condensed_storage_box);
registerRender(hyper_storage_box);
registerRender(input_port);
registerRender(output_port);
registerRender(crafting_box);
}
public static void registerRecipes() {
String t1_1 = "logWood";
String t1_2 = "stickWood";

public static void registerRender(Block block) {
// Nothing todo here for 1.7.10 probably!
// Item item = Item.getItemFromBlock(block);
// Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new
// ModelResourceLocation(Reference.MOD_ID, item.getUnlocalizedName().substring(5), "inventory"));
}
String t2_1 = "blockIron";
String t2_2 = OreDictionary.getOres("blockBronze", false).size() != 0 ? "blockBronze" : t2_1;

public static void registerRecipes() {
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(storage_core),
"ABA",
"BCB",
"ABA",
'A',
"logWood",
'B',
"stickWood",
'C',
Blocks.chest));
GameRegistry.addRecipe(
new ShapedOreRecipe(new ItemStack(storage_box), "ABA", "B B", "ABA", 'A', "logWood", 'B', Blocks.chest));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(condensed_storage_box),
"ACA",
"CBC",
"ACA",
'A',
"blockIron",
'B',
storage_box,
'C',
Blocks.iron_bars));
GameRegistry.addRecipe(
new ItemStack(hyper_storage_box),
"ABA",
"ACA",
"AAA",
'A',
Blocks.obsidian,
'B',
Items.nether_star,
'C',
condensed_storage_box);
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(input_port),
"ABA",
"BCB",
"ABA",
'A',
Blocks.hopper,
'B',
Blocks.piston,
'C',
"blockQuartz"));
GameRegistry.addRecipe(
new ShapedOreRecipe(new ItemStack(output_port), "A", "B", "A", 'A', Blocks.piston, 'B', input_port));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(crafting_box),
"ABA",
"BCB",
"ABA",
'A',
Items.ender_pearl,
'B',
Blocks.crafting_table,
'C',
"gemDiamond"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(storage_core), "ABA", "BCB", "ABA", 'A', t1_1, 'B', t1_2, 'C', Blocks.chest));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(storage_box), "ABA", "B B", "ABA", 'A', "logWood", 'B', Blocks.chest));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(condensed_storage_box), "ACA", "CBC", "DCD", 'A', t2_1, 'B', storage_box, 'C', Blocks.iron_bars, 'D', t2_2));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(hyper_storage_box), "ABA", "ACA", "AAA", 'A', Blocks.obsidian, 'B', Items.nether_star, 'C', condensed_storage_box));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(input_port), Blocks.hopper, Blocks.piston, "blockQuartz"));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(output_port), Blocks.piston, input_port));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(crafting_box), Items.ender_pearl, Blocks.crafting_table, "gemDiamond"));
}
}

// spotless:on
6 changes: 1 addition & 5 deletions src/main/java/com/zerofall/ezstorage/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package com.zerofall.ezstorage.proxy;

import com.zerofall.ezstorage.init.EZBlocks;

public class ClientProxy extends CommonProxy {

@Override
public void registerRenders() {
EZBlocks.registerRenders();
}
public void registerRenders() {}
}

0 comments on commit 8c61787

Please sign in to comment.