Skip to content

Commit

Permalink
æugh
Browse files Browse the repository at this point in the history
  • Loading branch information
HbmMods committed May 26, 2020
1 parent 6647ca4 commit 7beff0d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
13 changes: 13 additions & 0 deletions com/hbm/handler/ToolAbility.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.util.Vec3;
Expand Down Expand Up @@ -152,6 +153,10 @@ public static class SmelterAbility extends ToolAbility {
@Override
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, ItemToolAbility tool) {

//a band-aid on a gaping wound
if(block == Blocks.lit_redstone_ore)
block = Blocks.redstone_ore;

ItemStack stack = new ItemStack(block, 1, meta);
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(stack);

Expand All @@ -177,6 +182,10 @@ public static class ShredderAbility extends ToolAbility {
@Override
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, ItemToolAbility tool) {

//a band-aid on a gaping wound
if(block == Blocks.lit_redstone_ore)
block = Blocks.redstone_ore;

ItemStack stack = new ItemStack(block, 1, meta);
ItemStack result = MachineRecipes.getShredderResult(stack);

Expand All @@ -202,6 +211,10 @@ public static class CentrifugeAbility extends ToolAbility {
@Override
public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, ItemToolAbility tool) {

//a band-aid on a gaping wound
if(block == Blocks.lit_redstone_ore)
block = Blocks.redstone_ore;

ItemStack stack = new ItemStack(block, 1, meta);
ItemStack[] result = MachineRecipes.getCentrifugeProcessingResult(stack);

Expand Down
8 changes: 7 additions & 1 deletion com/hbm/inventory/MachineRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ public static ItemStack[] getCentrifugeProcessingResult(ItemStack item) {
}

public static ItemStack[] getCentrifugeOutput(ItemStack item) {

if(item == null || item.getItem() == null)
return null;

ItemStack[] test = new ItemStack[] { new ItemStack(Items.apple, 3), new ItemStack(Items.leather, 1),
new ItemStack(Items.sugar, 3), new ItemStack(Items.blaze_powder, 2) };
Expand Down Expand Up @@ -327,7 +330,7 @@ public static ItemStack[] getCentrifugeOutput(ItemStack item) {
return copper;
}

if (mODE(item, "oreRedstone")) {
if (mODE(item, "oreRedstone") || item.getItem() == Item.getItemFromBlock(Blocks.lit_redstone_ore)) {
return redstone;
}

Expand Down Expand Up @@ -2071,6 +2074,9 @@ public Map<Object, Object> getShredderRecipes() {

public static ItemStack getShredderResult(ItemStack stack) {

if(stack == null || stack.getItem() == null)
return new ItemStack(ModItems.scrap);

ItemStack sta = shredderRecipes.get(new StackWrapper(stack));

/*if(sta != null)
Expand Down
6 changes: 5 additions & 1 deletion com/hbm/items/tool/ItemToolAbility.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import net.minecraft.network.play.client.C07PacketPlayerDigging;
import net.minecraft.network.play.server.S23PacketBlockChange;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
Expand Down Expand Up @@ -300,7 +301,10 @@ public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer pla
setAbility(stack, i % this.breakAbility.size());

if(getCurrentAbility(stack) != null) {
player.addChatComponentMessage(new ChatComponentText("[Enabled " + getCurrentAbility(stack).getFullName() + "]"));
player.addChatComponentMessage(
new ChatComponentText("[Enabled ")
.appendSibling(new ChatComponentTranslation(getCurrentAbility(stack).getName(), new Object[0]))
.appendSibling(new ChatComponentText("]")));
} else {
player.addChatComponentMessage(new ChatComponentText("[Tool ability deactivated]"));
}
Expand Down
11 changes: 11 additions & 0 deletions com/hbm/main/MainRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,12 @@ public static void PostLoad(FMLPostInitializationEvent PostEvent)
MachineRecipes.overridePreSetRecipe(new ItemStack(ModBlocks.ore_nether_fire), new ItemStack(ModItems.powder_fire, 6));
MachineRecipes.overridePreSetRecipe(new ItemStack(Blocks.packed_ice), new ItemStack(ModItems.powder_ice, 1));
MachineRecipes.overridePreSetRecipe(new ItemStack(ModBlocks.brick_light), new ItemStack(Items.clay_ball, 4));
MachineRecipes.overridePreSetRecipe(new ItemStack(ModBlocks.concrete), new ItemStack(Blocks.gravel, 1));
MachineRecipes.overridePreSetRecipe(new ItemStack(ModBlocks.concrete_smooth), new ItemStack(Blocks.gravel, 1));
MachineRecipes.overridePreSetRecipe(new ItemStack(ModBlocks.brick_concrete), new ItemStack(Blocks.gravel, 1));
MachineRecipes.overridePreSetRecipe(new ItemStack(ModBlocks.brick_concrete_mossy), new ItemStack(Blocks.gravel, 1));
MachineRecipes.overridePreSetRecipe(new ItemStack(ModBlocks.brick_concrete_cracked), new ItemStack(Blocks.gravel, 1));
MachineRecipes.overridePreSetRecipe(new ItemStack(ModBlocks.brick_concrete_broken), new ItemStack(Blocks.gravel, 1));
MachineRecipes.overridePreSetRecipe(new ItemStack(ModBlocks.brick_obsidian), new ItemStack(ModBlocks.gravel_obsidian, 1));
MachineRecipes.overridePreSetRecipe(new ItemStack(Blocks.obsidian), new ItemStack(ModBlocks.gravel_obsidian, 1));
MachineRecipes.overridePreSetRecipe(new ItemStack(Blocks.stone), new ItemStack(Blocks.gravel, 1));
Expand Down Expand Up @@ -1360,6 +1365,12 @@ public static void PostLoad(FMLPostInitializationEvent PostEvent)
MachineRecipes.overridePreSetRecipe(new ItemStack(Items.enchanted_book), new ItemStack(ModItems.powder_magic, 1));
MachineRecipes.overridePreSetRecipe(new ItemStack(ModItems.arc_electrode_burnt), new ItemStack(ModItems.powder_coal, 1));
MachineRecipes.overridePreSetRecipe(new ItemStack(ModItems.arc_electrode_desh), new ItemStack(ModItems.powder_desh, 2));
MachineRecipes.overridePreSetRecipe(new ItemStack(ModBlocks.meteor_polished), new ItemStack(ModItems.powder_meteorite, 1));
MachineRecipes.overridePreSetRecipe(new ItemStack(ModBlocks.meteor_brick), new ItemStack(ModItems.powder_meteorite, 1));
MachineRecipes.overridePreSetRecipe(new ItemStack(ModBlocks.meteor_brick_mossy), new ItemStack(ModItems.powder_meteorite, 1));
MachineRecipes.overridePreSetRecipe(new ItemStack(ModBlocks.meteor_brick_cracked), new ItemStack(ModItems.powder_meteorite, 1));
MachineRecipes.overridePreSetRecipe(new ItemStack(ModBlocks.meteor_brick_chiseled), new ItemStack(ModItems.powder_meteorite, 1));
MachineRecipes.overridePreSetRecipe(new ItemStack(ModBlocks.meteor_pillar), new ItemStack(ModItems.powder_meteorite, 1));

for(int i = 0; i < 16; i++) {
MachineRecipes.overridePreSetRecipe(new ItemStack(Blocks.stained_hardened_clay, 1, i), new ItemStack(Items.clay_ball, 4));
Expand Down

0 comments on commit 7beff0d

Please sign in to comment.