mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-27 23:45:48 +00:00
Reorganize folders for modules
This commit is contained in:
1 parent
2c14f315de
commit
e2f0558b6f
370 files changed
+4274
-4788
No files matched your search
@@ -0,0 +1,33 @@
|
||||
package tconstruct.plugins;
|
||||
|
||||
import static tconstruct.TConstruct.moduleLoader;
|
||||
import tconstruct.plugins.ic2.IC2;
|
||||
import tconstruct.plugins.imc.AppEng;
|
||||
import tconstruct.plugins.imc.BuildcraftTransport;
|
||||
import tconstruct.plugins.imc.Mystcraft;
|
||||
import tconstruct.plugins.imc.Thaumcraft;
|
||||
import tconstruct.plugins.nei.NotEnoughItems;
|
||||
import tconstruct.plugins.te3.ThermalExpansion;
|
||||
import tconstruct.plugins.waila.Waila;
|
||||
|
||||
public class PluginController
|
||||
{
|
||||
|
||||
private PluginController() {} // Don't need to instantiate this.
|
||||
|
||||
public static void registerModules()
|
||||
{
|
||||
// Mystcraft is pushed in through the backdoor so it can't be disabled.
|
||||
moduleLoader.registerUncheckedModule(Mystcraft.class);
|
||||
|
||||
// Register the remaining plugin classes normally
|
||||
moduleLoader.registerModule(AppEng.class);
|
||||
moduleLoader.registerModule(BuildcraftTransport.class);
|
||||
moduleLoader.registerModule(IC2.class);
|
||||
moduleLoader.registerModule(Thaumcraft.class);
|
||||
moduleLoader.registerModule(NotEnoughItems.class);
|
||||
moduleLoader.registerModule(Waila.class);
|
||||
moduleLoader.registerModule(ThermalExpansion.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package tconstruct.plugins.ic2;
|
||||
|
||||
import mantle.module.ILoadableModule;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.LiquidCasting;
|
||||
|
||||
public class IC2 implements ILoadableModule
|
||||
{
|
||||
|
||||
private static final String IC2_UUM_FLUIDNAME = "uumatter";
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static String modId = "IC2";
|
||||
|
||||
@Override
|
||||
public void preInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init ()
|
||||
{
|
||||
TConstruct.logger.info("[IC2] Preparing for shenanigans.");
|
||||
|
||||
Fluid fluidUUM = FluidRegistry.getFluid(IC2_UUM_FLUIDNAME);
|
||||
if (fluidUUM == null)
|
||||
return;
|
||||
|
||||
FluidStack fluidStackBlock = new FluidStack(fluidUUM, 4500);
|
||||
LiquidCasting basinCasting = TConstructRegistry.getBasinCasting();
|
||||
|
||||
// Block casting
|
||||
basinCasting.addCastingRecipe(new ItemStack(Blocks.diamond_block), fluidStackBlock, new ItemStack(Blocks.dirt), true, 50);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package tconstruct.plugins.imc;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import mantle.module.ILoadableModule;
|
||||
import tconstruct.TConstruct;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
public class AppEng implements ILoadableModule
|
||||
{
|
||||
|
||||
private static List<String> spatialIOLogics = Arrays.asList("AdaptiveSmelteryLogic", "AqueductLogic", "CastingBasinLogic", "CastingChannelLogic", "CastingTableLogic", "CraftingStationLogic",
|
||||
"DryingRackLogic", "EssenceExtractorLogic", "FaucetLogic", "FrypanLogic", "GolemPedestalLogic", "LavaTankLogic", "PartBuilderLogic", "PatternChestLogic", "SmelteryDrainLogic",
|
||||
"SmelteryLogic", "StencilTableLogic", "TankAirLogic", "TileEntityLandmine", "ToolForgeLogic", "ToolStationLogic", "TowerFurnaceLogic", "MultiServantLogic");
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static String modId = "AppliedEnergistics";
|
||||
|
||||
@Override
|
||||
public void preInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init ()
|
||||
{
|
||||
TConstruct.logger.info("[AppEng] Registering for Spatial IO.");
|
||||
for (String s : spatialIOLogics)
|
||||
{
|
||||
FMLInterModComms.sendMessage("AppliedEnergistics", "movabletile", "tconstruct.blocks.logic." + s);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package tconstruct.plugins.imc;
|
||||
|
||||
import mantle.module.ILoadableModule;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TRepo;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
public class BuildcraftTransport implements ILoadableModule
|
||||
{
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static String modId = "BuildCraft|Transport";
|
||||
|
||||
@Override
|
||||
public void preInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init ()
|
||||
{
|
||||
TConstruct.logger.info("[BC|Transport] Registering facades.");
|
||||
// Smeltery Blocks
|
||||
addFacade(TRepo.smeltery, 2);
|
||||
for (int sc = 4; sc < 11; sc++)
|
||||
{
|
||||
addFacade(TRepo.smeltery, sc);
|
||||
}
|
||||
|
||||
addFacade(TRepo.searedBlock, 0);
|
||||
addFacade(TRepo.searedBlockNether, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void addFacade (Block b, int meta)
|
||||
{
|
||||
FMLInterModComms.sendMessage("BuildCraft|Transport", "add-facade", new ItemStack(b, 1, meta));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package tconstruct.plugins.imc;
|
||||
|
||||
import mantle.module.ILoadableModule;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import tconstruct.TConstruct;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
public class Mystcraft implements ILoadableModule
|
||||
{
|
||||
|
||||
private static String[] fluids = new String[] { "invar.molten", "electrum.molten", "bronze.molten", "aluminumbrass.molten", "manyullyn.molten", "alumite.molten", "cobalt.molten", "moltenArdite",
|
||||
"ender", "steel.molten", "platinum.molten" };
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static String modId = "Mystcraft";
|
||||
|
||||
@Override
|
||||
public void preInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init ()
|
||||
{
|
||||
TConstruct.logger.info("[Mystcraft] Blacklisting Mystcraft fluid symbols.");
|
||||
for (String nm : fluids)
|
||||
sendFluidBlacklist(nm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void sendFluidBlacklist (String FluidName)
|
||||
{
|
||||
NBTTagCompound NBTMsg = new NBTTagCompound();
|
||||
NBTMsg.setTag("fluidsymbol", new NBTTagCompound());
|
||||
NBTMsg.getCompoundTag("fluidsymbol").setFloat("rarity", 0.0F);
|
||||
NBTMsg.getCompoundTag("fluidsymbol").setFloat("grammarweight", 0.0F);
|
||||
NBTMsg.getCompoundTag("fluidsymbol").setFloat("instabilityPerBlock", 10000F); // renders creative symbol useless
|
||||
NBTMsg.getCompoundTag("fluidsymbol").setString("fluidname", FluidName);
|
||||
FMLInterModComms.sendMessage("Mystcraft", "fluidsymbol", NBTMsg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package tconstruct.plugins.imc;
|
||||
|
||||
import mantle.module.ILoadableModule;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TRepo;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
public class Thaumcraft implements ILoadableModule
|
||||
{
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static String modId = "Thaumcraft";
|
||||
|
||||
@Override
|
||||
public void preInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init ()
|
||||
{
|
||||
TConstruct.logger.info("[Thaumcraft] Registering harvestables.");
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TRepo.oreBerry, 1, 12));
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TRepo.oreBerry, 1, 13));
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TRepo.oreBerry, 1, 14));
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TRepo.oreBerry, 1, 15));
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TRepo.oreBerrySecond, 1, 12));
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TRepo.oreBerrySecond, 1, 13));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package tconstruct.plugins.minefactoryreloaded;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import powercrystals.minefactoryreloaded.api.ILiquidDrinkHandler;
|
||||
|
||||
public class Drinkables implements ILiquidDrinkHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public void onDrink (EntityPlayer player)
|
||||
{
|
||||
//boost health when drink
|
||||
if (player != null)
|
||||
{
|
||||
PotionEffect potion = player.getActivePotionEffect(Potion.field_76434_w);
|
||||
int duration = 0;
|
||||
if (potion != null)
|
||||
duration = potion.duration;
|
||||
player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, duration + 20 * 30, 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package tconstruct.plugins.minefactoryreloaded;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.passive.EntityHorse;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import powercrystals.minefactoryreloaded.api.IFactoryGrindable;
|
||||
import powercrystals.minefactoryreloaded.api.MobDrop;
|
||||
import tconstruct.common.TRepo;
|
||||
|
||||
public class GrindableHorse implements IFactoryGrindable
|
||||
{
|
||||
@Override
|
||||
public Class<?> getGrindableEntity ()
|
||||
{
|
||||
return EntityHorse.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MobDrop> grind (World world, EntityLivingBase entity, Random random)
|
||||
{
|
||||
List<MobDrop> drops = new ArrayList<MobDrop>();
|
||||
|
||||
drops.add(new MobDrop(10, new ItemStack(TRepo.materials, random.nextInt(4) + 1, 36)));
|
||||
|
||||
return drops;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processEntity (EntityLivingBase entity)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package tconstruct.plugins.minefactoryreloaded;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import powercrystals.minefactoryreloaded.api.HarvestType;
|
||||
import powercrystals.minefactoryreloaded.api.IFactoryHarvestable;
|
||||
|
||||
public class HarvestableOreBerry implements IFactoryHarvestable
|
||||
{
|
||||
private int _sourceBlockId;
|
||||
private int _berryItemId;
|
||||
private int _metaOffset;
|
||||
|
||||
public HarvestableOreBerry(int sourceBlockId, int berryItemId, int metaOffset)
|
||||
{
|
||||
_sourceBlockId = sourceBlockId;
|
||||
_berryItemId = berryItemId;
|
||||
_metaOffset = metaOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPlantId ()
|
||||
{
|
||||
return _sourceBlockId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HarvestType getHarvestType ()
|
||||
{
|
||||
return HarvestType.Column;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean breakBlock ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeHarvested (World world, Map<String, Boolean> harvesterSettings, int x, int y, int z)
|
||||
{
|
||||
return world.getBlockMetadata(x, y, z) >= 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops (World world, Random rand, Map<String, Boolean> harvesterSettings, int x, int y, int z)
|
||||
{
|
||||
ItemStack[] returnItems = { new ItemStack(_berryItemId, 1, world.getBlockMetadata(x, y, z) % 4 + _metaOffset) };
|
||||
return Arrays.asList(returnItems);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preHarvest (World world, int x, int y, int z)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postHarvest (World world, int x, int y, int z)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) - 4, 2);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package tconstruct.plugins.minefactoryreloaded;
|
||||
|
||||
import powercrystals.minefactoryreloaded.api.FactoryRegistry;
|
||||
import tconstruct.common.TRepo;
|
||||
|
||||
public class MFRRegister
|
||||
{
|
||||
public static void registerWithMFR ()
|
||||
{
|
||||
FactoryRegistry.registerHarvestable(new HarvestableOreBerry(TRepo.oreBerry.blockID, TRepo.oreBerries.itemID, 0));
|
||||
FactoryRegistry.registerHarvestable(new HarvestableOreBerry(TRepo.oreBerrySecond.blockID, TRepo.oreBerries.itemID, 4));
|
||||
FactoryRegistry.registerGrindable(new GrindableHorse());
|
||||
FactoryRegistry.registerLiquidDrinkHandler(TRepo.bloodFluid.getName(), new Drinkables());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package tconstruct.plugins.minefactoryreloaded;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.plugins.ICompatPlugin;
|
||||
|
||||
public class MineFactoryReloaded implements ICompatPlugin
|
||||
{
|
||||
@Override
|
||||
public String getModId() {
|
||||
return "MineFactoryReloaded";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
TConstruct.logger.info("MineFactoryReloaded detected. Registering TConstruct farmables/grindables with MFR's Farming Registry.");
|
||||
MFRRegister.registerWithMFR();
|
||||
/*
|
||||
* Perhaps TC ores should be registered as drops from the MFR Laser Drill here, but I don't know which things would be suitable for that.
|
||||
* Syntax: FarmingRegistry.registerLaserOre(int weight, ItemStack droppedStack));
|
||||
* Currently used weights are from about 50 (emerald) to 175 (coal).
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package tconstruct.plugins.nei;
|
||||
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.recipe.DefaultOverlayHandler;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import mantle.module.ILoadableModule;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.client.gui.CraftingStationGui;
|
||||
|
||||
public class NotEnoughItems implements ILoadableModule
|
||||
{
|
||||
@SuppressWarnings("unused")
|
||||
public static String modId = "NotEnoughItems";
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
TConstruct.logger.info("NotEnoughItems detected. Registering TConstruct NEI plugin.");
|
||||
registerNEICompat();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
// Nothing
|
||||
}
|
||||
public static void registerNEICompat ()
|
||||
{
|
||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
|
||||
{
|
||||
API.registerGuiOverlay(CraftingStationGui.class, "crafting");
|
||||
API.registerGuiOverlayHandler(CraftingStationGui.class, new DefaultOverlayHandler(), "crafting");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package tconstruct.plugins.te3;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
public class TE3Helper {
|
||||
|
||||
public static void addInductionSmelterRecipe(int energy, ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, int chance)
|
||||
{
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
|
||||
data.setInteger("energy", energy);
|
||||
|
||||
NBTTagCompound input1Compound = new NBTTagCompound();
|
||||
input1.writeToNBT(input1Compound);
|
||||
data.setTag("primaryInput", input1Compound);
|
||||
|
||||
NBTTagCompound input2Compound = new NBTTagCompound();
|
||||
input2.writeToNBT(input2Compound);
|
||||
data.setTag("secondaryInput", input2Compound);
|
||||
|
||||
NBTTagCompound output1Compound = new NBTTagCompound();
|
||||
output1.writeToNBT(output1Compound);
|
||||
data.setTag("primaryOutput", output1Compound);
|
||||
|
||||
if (output2 != null) {
|
||||
NBTTagCompound output2Compound = new NBTTagCompound();
|
||||
output2.writeToNBT(output2Compound);
|
||||
data.setTag("secondaryOutput", output2Compound);
|
||||
|
||||
data.setInteger("secondaryChance", chance);
|
||||
}
|
||||
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "SmelterRecipe", data);
|
||||
}
|
||||
|
||||
public static void addPulveriserRecipe(int energy, ItemStack input, ItemStack output, ItemStack bonus, int chance)
|
||||
{
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
|
||||
data.setInteger("energy", energy);
|
||||
|
||||
NBTTagCompound inputCompound = new NBTTagCompound();
|
||||
input.writeToNBT(inputCompound);
|
||||
data.setTag("input", inputCompound);
|
||||
|
||||
NBTTagCompound outputCompound = new NBTTagCompound();
|
||||
output.writeToNBT(outputCompound);
|
||||
data.setTag("primaryOutput", outputCompound);
|
||||
|
||||
if (bonus != null) {
|
||||
NBTTagCompound outputCompound2 = new NBTTagCompound();
|
||||
bonus.writeToNBT(outputCompound2);
|
||||
data.setTag("secondaryOutput", outputCompound2);
|
||||
|
||||
data.setInteger("secondaryChance", chance);
|
||||
}
|
||||
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "PulverizerRecipe", data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package tconstruct.plugins.te3;
|
||||
|
||||
import tconstruct.common.TRepo;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import mantle.module.ILoadableModule;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class ThermalExpansion implements ILoadableModule
|
||||
{
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static String modId = "ThermalExpansion";
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
ItemStack crystalCinnabar = OreDictionary.getOres("crystalCinnabar").get(0);
|
||||
|
||||
TE3Helper.addPulveriserRecipe(1000, new ItemStack(TRepo.materials, 1, 11), new ItemStack(TRepo.materials, 1, 40), null, 0);
|
||||
TE3Helper.addPulveriserRecipe(1000, new ItemStack(TRepo.materials, 1, 3), new ItemStack(TRepo.materials, 1, 39), null, 0);
|
||||
TE3Helper.addPulveriserRecipe(1000, new ItemStack(TRepo.materials, 1, 4), new ItemStack(TRepo.materials, 1, 38), null, 0);
|
||||
|
||||
TE3Helper.addPulveriserRecipe(12000, new ItemStack(TRepo.oreSlag, 1, 1), new ItemStack(TRepo.materials, 2, 39), GameRegistry.findItemStack("ThermalExpansion", "dustIron", 1), 10);
|
||||
TE3Helper.addInductionSmelterRecipe(12000, new ItemStack(TRepo.oreSlag, 1, 1), crystalCinnabar.copy(), new ItemStack(TRepo.materials, 3, 3), new ItemStack(Items.iron_ingot), 100);
|
||||
TE3Helper.addPulveriserRecipe(12000, new ItemStack(TRepo.oreSlag, 1, 2), new ItemStack(TRepo.materials, 2, 38), GameRegistry.findItemStack("ThermalExpansion", "dustGold", 1), 10);
|
||||
TE3Helper.addInductionSmelterRecipe(12000, new ItemStack(TRepo.oreSlag, 1, 2), crystalCinnabar.copy(), new ItemStack(TRepo.materials, 3, 4), new ItemStack(Items.gold_ingot), 100);
|
||||
|
||||
TE3Helper.addInductionSmelterRecipe(4000, new ItemStack(TRepo.materials, 1, 4), new ItemStack(TRepo.materials, 1, 3), new ItemStack(TRepo.materials, 1, 5), null, 0);
|
||||
TE3Helper.addInductionSmelterRecipe(4000, new ItemStack(TRepo.materials, 1, 9), new ItemStack(TRepo.materials, 3, 11), new ItemStack(TRepo.materials, 4, 14), null, 0);
|
||||
} @Override
|
||||
public void postInit() {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package tconstruct.plugins.waila;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.blocks.logic.CastingBasinLogic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BasinDataProvider implements IWailaDataProvider
|
||||
{
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack (IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
if (accessor.getTileEntity() instanceof CastingBasinLogic)
|
||||
{
|
||||
return ((CastingBasinLogic) accessor.getTileEntity()).getStackInSlot(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
if (accessor.getTileEntity() instanceof CastingBasinLogic && config.getConfig("tcon.basin", true))
|
||||
{
|
||||
CastingBasinLogic te = (CastingBasinLogic) accessor.getTileEntity();
|
||||
if (te.getFluidAmount() != 0)
|
||||
{
|
||||
FluidStack fs = te.getFluid();
|
||||
currenttip.add("Liquid: " + WailaRegistrar.fluidNameHelper(fs));
|
||||
currenttip.add("Amount: " + fs.amount + "/" + te.getCapacity());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (te.getStackInSlot(0) != null)
|
||||
{
|
||||
currenttip.add("Contains: " + te.getStackInSlot(0).getDisplayName());
|
||||
}
|
||||
else
|
||||
{
|
||||
currenttip.add("§oEmpty"); // "§o" == Italics
|
||||
}
|
||||
}
|
||||
}
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package tconstruct.plugins.waila;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import tconstruct.blocks.logic.CastingChannelLogic;
|
||||
|
||||
public class CastingChannelDataProvider implements IWailaDataProvider
|
||||
{
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack (IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
if (accessor.getTileEntity() instanceof CastingChannelLogic)
|
||||
{
|
||||
CastingChannelLogic te = (CastingChannelLogic) accessor.getTileEntity();
|
||||
FluidTankInfo internalTank = te.getTankInfo(null)[0];
|
||||
FluidTankInfo northTank = te.getTankInfo(ForgeDirection.NORTH)[0];
|
||||
FluidTankInfo southTank = te.getTankInfo(ForgeDirection.SOUTH)[0];
|
||||
FluidTankInfo westTank = te.getTankInfo(ForgeDirection.WEST)[0];
|
||||
FluidTankInfo eastTank = te.getTankInfo(ForgeDirection.EAST)[0];
|
||||
|
||||
if (internalTank.fluid != null && internalTank.fluid.amount > 0)
|
||||
{
|
||||
FluidStack fs = internalTank.fluid;
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.liquidtag") + WailaRegistrar.fluidNameHelper(fs));
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.amounttag") + fs.amount + "/" + internalTank.capacity);
|
||||
}
|
||||
else
|
||||
{
|
||||
currenttip.add("§o" + StatCollector.translateToLocal("tconstruct.waila.empty")); // "§o" == Italics
|
||||
}
|
||||
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.subtanks"));
|
||||
String s1, s2, s3, s4;
|
||||
s1 = s2 = s3 = s4 = "§o" + StatCollector.translateToLocal("tconstruct.waila.empty");
|
||||
|
||||
if (northTank.fluid != null)
|
||||
s1 = northTank.fluid.amount + " / " + northTank.capacity;
|
||||
if (southTank.fluid != null)
|
||||
s2 = southTank.fluid.amount + " / " + southTank.capacity;
|
||||
if (westTank.fluid != null)
|
||||
s3 = westTank.fluid.amount + " / " + westTank.capacity;
|
||||
if (eastTank.fluid != null)
|
||||
s4 = eastTank.fluid.amount + " / " + eastTank.capacity;
|
||||
currenttip.add(s1 + "; " + s2 + "; " + s3 + "; " + s4);
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package tconstruct.plugins.waila;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.blocks.logic.LavaTankLogic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SearedTankDataProvider implements IWailaDataProvider
|
||||
{
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack (IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
if (accessor.getTileEntity() instanceof LavaTankLogic && config.getConfig("tcon.searedtank", true))
|
||||
{
|
||||
LavaTankLogic te = (LavaTankLogic) accessor.getTileEntity();
|
||||
if (te.containsFluid())
|
||||
{
|
||||
FluidStack fs = te.tank.getFluid();
|
||||
currenttip.add("Liquid: " + WailaRegistrar.fluidNameHelper(fs));
|
||||
currenttip.add("Amount: " + fs.amount + "/" + te.tank.getCapacity());
|
||||
}
|
||||
else
|
||||
{
|
||||
currenttip.add("§oEmpty"); // "§o" == Italics
|
||||
}
|
||||
}
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package tconstruct.plugins.waila;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.blocks.logic.SmelteryLogic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SmelteryDataProvider implements IWailaDataProvider
|
||||
{
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack (IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
if (accessor.getTileEntity() instanceof SmelteryLogic && config.getConfig("tcon.smeltery", true))
|
||||
{
|
||||
SmelteryLogic te = (SmelteryLogic) accessor.getTileEntity();
|
||||
if (te.validStructure)
|
||||
{
|
||||
List<FluidStack> fls = te.moltenMetal;
|
||||
if (fls.size() <= 0)
|
||||
{
|
||||
currenttip.add("§oEmpty"); // "§o" == Italics
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < fls.size(); i++)
|
||||
{
|
||||
FluidStack st = fls.get(i);
|
||||
currenttip.add(WailaRegistrar.fluidNameHelper(st) + " (" + st.amount + "mB)");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
currenttip.add("§oInvalid structure");
|
||||
}
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package tconstruct.plugins.waila;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import tconstruct.blocks.logic.CastingTableLogic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TableDataProvider implements IWailaDataProvider
|
||||
{
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack (IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
if (accessor.getTileEntity() instanceof CastingTableLogic)
|
||||
{
|
||||
CastingTableLogic te = (CastingTableLogic) accessor.getTileEntity();
|
||||
return te.getStackInSlot(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
if (accessor.getTileEntity() instanceof CastingTableLogic && config.getConfig("tcon.table", true))
|
||||
{
|
||||
CastingTableLogic te = (CastingTableLogic) accessor.getTileEntity();
|
||||
if (te.getStackInSlot(1) != null)
|
||||
{
|
||||
currenttip.add("Contains: " + te.getStackInSlot(1).getDisplayName());
|
||||
}
|
||||
if (te.getFluid() != null)
|
||||
{
|
||||
currenttip.add("Fluid: " + WailaRegistrar.fluidNameHelper(te.getFluid()));
|
||||
currenttip.add("Amount: " + te.getFluidAmount() + "/" + te.getCapacity());
|
||||
}
|
||||
}
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package tconstruct.plugins.waila;
|
||||
|
||||
import mantle.module.ILoadableModule;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import tconstruct.TConstruct;
|
||||
|
||||
public class Waila implements ILoadableModule
|
||||
{
|
||||
@SuppressWarnings("unused")
|
||||
public static String modId = "Waila";
|
||||
|
||||
@Override
|
||||
public void preInit ()
|
||||
{
|
||||
// Nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init ()
|
||||
{
|
||||
TConstruct.logger.info("Waila detected. Registering TConstruct tank blocks with Waila registry.");
|
||||
|
||||
FMLInterModComms.sendMessage("Waila", "register", "tconstruct.plugins.waila.WailaRegistrar.wailaCallback");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit ()
|
||||
{
|
||||
// Nothing
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package tconstruct.plugins.waila;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.LavaTankBlock;
|
||||
import tconstruct.blocks.SmelteryBlock;
|
||||
import tconstruct.blocks.logic.CastingBasinLogic;
|
||||
import tconstruct.blocks.logic.CastingChannelLogic;
|
||||
import tconstruct.blocks.logic.CastingTableLogic;
|
||||
|
||||
public class WailaRegistrar
|
||||
{
|
||||
public static void wailaCallback (IWailaRegistrar registrar)
|
||||
{
|
||||
TConstruct.logger.info("[Waila-Compat] Got registrar: " + registrar);
|
||||
|
||||
// Configs
|
||||
registrar.addConfig("Tinkers' Construct", "tcon.searedtank", "Seared Tank");
|
||||
registrar.addConfig("Tinkers' Construct", "tcon.castingchannel", "Casting Channel");
|
||||
registrar.addConfig("Tinkers' Construct", "tcon.basin", "Casting Basin");
|
||||
registrar.addConfig("Tinkers' Construct", "tcon.table", "Casting Table");
|
||||
registrar.addConfig("Tinkers' Construct", "tcon.smeltery", "Smeltery status");
|
||||
|
||||
// Tanks
|
||||
registrar.registerBodyProvider(new SearedTankDataProvider(), LavaTankBlock.class);
|
||||
registrar.registerBodyProvider(new CastingChannelDataProvider(), CastingChannelLogic.class);
|
||||
//registrar.registerBodyProvider(new EssenceExtractorDataProvider(), EssenceExtractor.class);
|
||||
|
||||
// Casting systems
|
||||
registrar.registerBodyProvider(new BasinDataProvider(), CastingBasinLogic.class);
|
||||
registrar.registerBodyProvider(new TableDataProvider(), CastingTableLogic.class);
|
||||
|
||||
// Smeltery
|
||||
registrar.registerBodyProvider(new SmelteryDataProvider(), SmelteryBlock.class);
|
||||
}
|
||||
|
||||
public static String fluidNameHelper (FluidStack f)
|
||||
{
|
||||
return StatCollector.translateToLocal(FluidRegistry.getFluidName(f));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user