Skip to content

Commit

Permalink
Removed sawdust and ash, using TFC wood ash in the potash recipe (Closes
Browse files Browse the repository at this point in the history
 #73)
  • Loading branch information
DisasterMoo committed Feb 18, 2021
1 parent 16bdb93 commit 8012362
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 27 deletions.
18 changes: 0 additions & 18 deletions src/main/java/tfctech/CommonEventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,4 @@ public static void attachItemCapabilities(AttachCapabilitiesEvent<ItemStack> eve
}
}
}

@SubscribeEvent
public static void onHarvestEvent(BlockEvent.HarvestDropsEvent event)
{
if (event.getHarvester() != null && !event.getWorld().isRemote)
{
final ItemStack heldItem = event.getHarvester().getHeldItemMainhand();
if (event.getState().getBlock() instanceof BlockLogTFC && heldItem.getItem().getToolClasses(heldItem).contains("saw") && Constants.RNG.nextFloat() < 0.5F)
{
if (Constants.RNG.nextFloat() < 0.5F)
{
event.getDrops().clear(); // Also, consume log
}
event.getDrops().add(new ItemStack(TechItems.WOOD_POWDER, 1));

}
}
}
}
9 changes: 9 additions & 0 deletions src/main/java/tfctech/TFCTech.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
package tfctech;

import org.apache.logging.log4j.Logger;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInterModComms;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.oredict.OreDictionary;

import net.dries007.tfc.TerraFirmaCraft;
import net.dries007.tfc.objects.items.ItemsTFC;
import tfctech.client.TechGuiHandler;
import tfctech.network.PacketFridgeUpdate;
import tfctech.network.PacketLatexUpdate;
import tfctech.network.PacketTileEntityUpdate;
import tfctech.objects.items.TechItems;
import tfctech.registry.TechFoodTraits;

@SuppressWarnings("WeakerAccess")
Expand Down Expand Up @@ -50,6 +56,9 @@ public static TFCTech getInstance()
@EventHandler
public void init(FMLInitializationEvent event)
{
// Register dust ash ore dictionary
// Unfortunately, this has to be done after TFC registered it's items, which is only safe after preInit
OreDictionary.registerOre("dustAsh", ItemsTFC.WOOD_ASH);
FMLInterModComms.sendFunctionMessage("theoneprobe", "getTheOneProbe", "tfctech.compat.waila.TOPPlugin");
TechFoodTraits.init();
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/tfctech/compat/jei/TechJEIPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public void register(IModRegistry registry)
registry.addRecipeClickArea(GuiGlassworking.class, 132, 27, 9, 14, GLASSWORKING_UID);

// Information
registry.addIngredientInfo(new ItemStack(TechItems.WOOD_POWDER), VanillaTypes.ITEM, "jei.information.tfctech.wood_powder");
registry.addIngredientInfo(new ItemStack(TechItems.IRON_GROOVE), VanillaTypes.ITEM, "jei.information.tfctech.groove");
registry.addIngredientInfo(new FluidStack(TechFluids.LATEX.get(), 1000), VanillaTypes.FLUID, "jei.information.tfctech.latex");
registry.addIngredientInfo(new ItemStack(TechBlocks.FRIDGE), VanillaTypes.ITEM, "jei.information.tfctech.fridge");
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/tfctech/objects/items/TechItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.registries.IForgeRegistry;
Expand Down Expand Up @@ -81,8 +82,6 @@ public final class TechItems
public static final ItemMiscTech POTASH = getNull();
@GameRegistry.ObjectHolder("pot_potash")
public static final ItemPottery POTASH_POT = getNull();
@GameRegistry.ObjectHolder("powder/wood")
public static final ItemMiscTech WOOD_POWDER = getNull();
@GameRegistry.ObjectHolder("powder/ash")
public static final ItemMiscTech ASH = getNull();
@GameRegistry.ObjectHolder("pot_ash")
Expand Down Expand Up @@ -166,8 +165,6 @@ public boolean hasContainerItem(@Nonnull ItemStack stack)
}, CT_MISC));
simpleItems.add(register(r, "powder/potash", new ItemMiscTech(Size.SMALL, Weight.LIGHT, "dustPotash"), CT_MISC));
simpleItems.add(register(r, "powder/lime", new ItemMiscHeatable(Size.SMALL, Weight.LIGHT, 0.22f, 2000f, "dustLime"), CT_MISC));
simpleItems.add(register(r, "powder/wood", new ItemMiscHeatable(Size.SMALL, Weight.LIGHT, 0.22f, 2000f, "dustWood"), CT_MISC));
simpleItems.add(register(r, "powder/ash", new ItemMiscHeatable(Size.SMALL, Weight.LIGHT, 0.22f, 2000f, "dustAsh"), CT_MISC));

simpleItems.add(register(r, "latex/vulcanizing_agents", new ItemMiscTech(Size.SMALL, Weight.LIGHT), CT_MISC));
simpleItems.add(register(r, "latex/rubber_mix", new ItemMiscHeatable(Size.SMALL, Weight.LIGHT, 0.8f, 800f), CT_MISC));
Expand Down Expand Up @@ -319,7 +316,6 @@ private static void registerTFCOreDict()
OreDictionary.registerOre("sandSilica", x);
}
});

}

private static boolean isSilica(BlockRockVariant block)
Expand Down
1 change: 0 additions & 1 deletion src/main/java/tfctech/registry/TechRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public static void onRegisterHeatRecipeEvent(RegistryEvent.Register<HeatRecipe>
new HeatRecipeSimple(IIngredient.of(new ItemStack(TechItems.RUBBER_MIX)), new ItemStack(TechItems.RUBBER), 600f, Metal.Tier.TIER_I).setRegistryName("rubber"),
new HeatRecipeSimple(IIngredient.of(new ItemStack(TechItems.UNFIRED_RACKWHEEL_PIECE)), new ItemStack(TechItems.MOLD_RACKWHEEL_PIECE), 1599f, Metal.Tier.TIER_I).setRegistryName("fired_mold_rackwheel"),
new HeatRecipeSimple(IIngredient.of(new ItemStack(TechItems.UNFIRED_SLEEVE)), new ItemStack(TechItems.MOLD_SLEEVE), 1599f, Metal.Tier.TIER_I).setRegistryName("fired_mold_sleeve"),
new HeatRecipeSimple(IIngredient.of("dustWood"), new ItemStack(TechItems.ASH), 850f, Metal.Tier.TIER_I).setRegistryName("ash"),
new HeatRecipeSimple(IIngredient.of(new ItemStack(TechItems.ASH_POT)), new ItemStack(TechItems.POTASH_POT), 500f, Metal.Tier.TIER_I).setRegistryName("potash_pot"),
new HeatRecipeSimple(IIngredient.of("rockFlux"), new ItemStack(TechItems.LIME, 2), 600f, Metal.Tier.TIER_I).setRegistryName("lime"),
new HeatRecipeSimple(IIngredient.of(new ItemStack(TechItems.UNFIRED_MOLD_PANE)), new ItemStack(TechItems.MOLD_PANE), 1599f, Metal.Tier.TIER_I).setRegistryName("fired_mold_pane"),
Expand Down
3 changes: 1 addition & 2 deletions src/main/resources/assets/tfctech/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ item.tfctech.powder.potash.name=Potash
item.tfctech.powder.wood.name=Sawdust
item.tfctech.powder.ash.name=Ash
item.tfctech.pot_potash.name=Pot with Potash
item.tfctech.pot_ash.name=Pot with Ash Powder
item.tfctech.pot_ash.name=Pot with Ash

## Wiredraw
item.tfctech.wiredraw.leather_belt.name=Leather Belt
Expand Down Expand Up @@ -192,7 +192,6 @@ jei.category.tfctech.smeltery=Smeltery
jei.category.tfctech.glassworking=Glassworking

# JEI Information
jei.information.tfctech.wood_powder=To obtain Sawdust, you need to harvest logs using a saw. There's a 50% chance to drop and also another 50% chance the log is consumed in the process.
jei.information.tfctech.groove=Used to get latex, right click a hevea tree log with a hammer in your toolbar to place. Complete the latex tapping by placing a bowl mount, an empty bowl and right clicking with a knife to open a vein of flowing latex.
jei.information.tfctech.latex=To get latex, you need a rubber tapper. Right click a Wrought Iron Groove (with a hammer on toolbar) on any hevea tree log, then place a bowl mount, an empty bowl and open a vein of fluid latex by right clicking with a knife.
jei.information.tfctech.fridge=Consumes energy to cool down your foods effectively slowing down decay. Efficiency rises when the door is kept closed and has sufficient energy.
Expand Down

0 comments on commit 8012362

Please sign in to comment.