Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
RebelKeithy committed Aug 20, 2021
1 parent 29268be commit c61190d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ public int size() {

this.processor.addStateChangeListener(state1 -> {
if(world != null) {
System.out.println("Notify: " + state1);
BlockState blockState = world.getBlockState(CrusherBlockEntity.this.getPos());
if(blockState.getBlock() instanceof CrusherBlock) {
blockState = blockState.with(AbstractFurnaceBlock.LIT, state1);
world.setBlockState(pos, blockState, Block.NOTIFY_ALL);
world.setBlockState(pos, blockState.with(AbstractFurnaceBlock.LIT, state1), Block.NOTIFY_ALL);
}
}
});
Expand All @@ -76,20 +74,19 @@ private void addRecipes() {
for(String metal : metals) {
Item dust = MetalRegistry.instance().getItem(metal, Constants.ItemDust);
addRecipe(MetalRegistry.instance().getItem(metal, Constants.ItemIngot), dust, 1, (int) (20 * multiplier));
addRecipe(MetalRegistry.instance().getItem(metal, Constants.ItemRawOre), dust, 2, (int) (20 * multiplier));
addRecipe(MetalRegistry.instance().getItem(metal, Constants.ItemRawOre), dust, 1, (int) (20 * multiplier));
addRecipe(MetalRegistry.instance().getBlock(metal, Constants.BlockOre), dust, 2, (int) (20 * multiplier));
}
//addRecipe(MetalRegistry.instance().getItem("bronze", Constants.ItemIngot), MetalRegistry.instance().getItem("bronze", Constants.ItemDust), (int) (20 * multiplier));
}

private void addRecipe(Block input, Item output, int count, int time) {
if(input == null || output == null || count == 0) return;
((ItemConsumer<ItemStack>)this.consumer).addRecipe(new AbstractRecipe<ItemStack, ItemStack>(new ItemStack(input), new ItemStack(output, count), time));
((ItemConsumer<ItemStack>)this.consumer).addRecipe(new AbstractRecipe<>(new ItemStack(input), new ItemStack(output, count), time));
}

private void addRecipe(Item input, Item output, int count, int time) {
if(input == null || output == null || count == 0) return;
((ItemConsumer<ItemStack>)this.consumer).addRecipe(new AbstractRecipe<ItemStack, ItemStack>(new ItemStack(input), new ItemStack(output, count), time));
((ItemConsumer<ItemStack>)this.consumer).addRecipe(new AbstractRecipe<>(new ItemStack(input), new ItemStack(output, count), time));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
package com.teammetallurgy.metallurgyclassic.machines.crusher;

import com.teammetallurgy.metallurgyclassic.blocks.MetallurgyBlocks;
import com.teammetallurgy.metallurgyclassic.machines.chest.MetalChestComponent;
import com.teammetallurgy.metallurgyclassic.machines.chest.MetalChestEntity;
import com.teammetallurgy.metallurgyclassic.machines.chest.MetalChestEntityRenderer;
import com.teammetallurgy.metallurgyclassic.machines.chest.MetalChestScreen;
import com.teammetallurgy.metallurgyclassic.machines.furnace.*;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.rendereregistry.v1.BlockEntityRendererRegistry;
Expand All @@ -22,7 +17,6 @@
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.TexturedRenderLayers;
import net.minecraft.client.util.SpriteIdentifier;
import net.minecraft.item.ItemGroup;
import net.minecraft.screen.ScreenHandlerType;
Expand All @@ -37,7 +31,6 @@

import static com.teammetallurgy.metallurgyclassic.MetallurgyClassic.id;
import static com.teammetallurgy.metallurgyclassic.config.ModConfig.*;
import static com.teammetallurgy.metallurgyclassic.config.ModConfig.STEEL_FURNACE_SMELT_TIME_SECONDS;
import static net.minecraft.client.render.TexturedRenderLayers.CHEST_ATLAS_TEXTURE;

public class CrusherComponent {
Expand Down

0 comments on commit c61190d

Please sign in to comment.