mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Merge pull request #819 from Parker8283/patch-pluginporting
Re-implemented all plugins
This commit is contained in:
commit
f5179c1af6
42 files changed
+939
-619
No files matched your search
@@ -3,40 +3,12 @@ package tconstruct;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import mantle.pulsar.config.ForgeCFG;
|
||||
import mantle.pulsar.control.PulseManager;
|
||||
import net.minecraft.world.gen.structure.MapGenStructureIO;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import tconstruct.armor.TinkerArmor;
|
||||
import tconstruct.armor.player.TPlayerHandler;
|
||||
import tconstruct.client.TControls;
|
||||
import tconstruct.common.TConstructCreativeTab;
|
||||
import tconstruct.common.TProxyCommon;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.Detailing;
|
||||
import tconstruct.library.crafting.LiquidCasting;
|
||||
import tconstruct.mechworks.TinkerMechworks;
|
||||
import tconstruct.mechworks.landmine.behavior.Behavior;
|
||||
import tconstruct.mechworks.landmine.behavior.stackCombo.SpecialStackHandler;
|
||||
import tconstruct.plugins.imc.TinkerThaumcraft;
|
||||
import tconstruct.plugins.nei.TinkerNEI;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.util.EnvironmentChecks;
|
||||
import tconstruct.util.config.DimensionBlacklist;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import tconstruct.util.network.PacketPipeline;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import tconstruct.world.gen.SlimeIslandGen;
|
||||
import tconstruct.world.village.ComponentSmeltery;
|
||||
import tconstruct.world.village.ComponentToolWorkshop;
|
||||
import tconstruct.world.village.TVillageTrades;
|
||||
import tconstruct.world.village.VillageSmelteryHandler;
|
||||
import tconstruct.world.village.VillageToolStationHandler;
|
||||
import net.minecraft.world.gen.structure.MapGenStructureIO;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
@@ -51,6 +23,37 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.VillagerRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import mantle.pulsar.config.ForgeCFG;
|
||||
import mantle.pulsar.control.PulseManager;
|
||||
import tconstruct.armor.TinkerArmor;
|
||||
import tconstruct.armor.player.TPlayerHandler;
|
||||
import tconstruct.client.TControls;
|
||||
import tconstruct.common.TConstructCreativeTab;
|
||||
import tconstruct.common.TProxyCommon;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.Detailing;
|
||||
import tconstruct.library.crafting.LiquidCasting;
|
||||
import tconstruct.mechworks.TinkerMechworks;
|
||||
import tconstruct.mechworks.landmine.behavior.Behavior;
|
||||
import tconstruct.mechworks.landmine.behavior.stackCombo.SpecialStackHandler;
|
||||
import tconstruct.plugins.ic2.TinkerIC2;
|
||||
import tconstruct.plugins.imc.TinkerAE2;
|
||||
import tconstruct.plugins.imc.TinkerBuildCraft;
|
||||
import tconstruct.plugins.imc.TinkerMystcraft;
|
||||
import tconstruct.plugins.imc.TinkerThaumcraft;
|
||||
import tconstruct.plugins.mfr.TinkerMFR;
|
||||
import tconstruct.plugins.nei.TinkerNEI;
|
||||
import tconstruct.plugins.te4.TinkerTE4;
|
||||
import tconstruct.plugins.waila.TinkerWaila;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.util.EnvironmentChecks;
|
||||
import tconstruct.util.config.DimensionBlacklist;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import tconstruct.util.network.PacketPipeline;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import tconstruct.world.gen.SlimeIslandGen;
|
||||
import tconstruct.world.village.*;
|
||||
|
||||
/**
|
||||
* TConstruct, the tool mod. Craft your tools with style, then modify until the
|
||||
@@ -121,6 +124,13 @@ public class TConstruct
|
||||
pulsar.registerPulse(new TinkerArmor());
|
||||
pulsar.registerPulse(new TinkerNEI());
|
||||
pulsar.registerPulse(new TinkerThaumcraft());
|
||||
pulsar.registerPulse(new TinkerWaila());
|
||||
pulsar.registerPulse(new TinkerBuildCraft());
|
||||
pulsar.registerPulse(new TinkerAE2());
|
||||
pulsar.registerPulse(new TinkerIC2());
|
||||
pulsar.registerPulse(new TinkerMystcraft());
|
||||
pulsar.registerPulse(new TinkerMFR());
|
||||
pulsar.registerPulse(new TinkerTE4());
|
||||
/*pulsar.registerPulse(new TinkerPrayers());
|
||||
pulsar.registerPulse(new TinkerCropify());*/
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package tconstruct.plugins.ic2;
|
||||
|
||||
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 cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import mantle.pulsar.pulse.Handler;
|
||||
import mantle.pulsar.pulse.Pulse;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.LiquidCasting;
|
||||
|
||||
@ObjectHolder(TConstruct.modID)
|
||||
@Pulse(id = "Tinkers IC2 Compatibility", description = "Tinkers Construct compatibility for IndustrialCraft 2", modsRequired = "IC2")
|
||||
public class TinkerIC2
|
||||
{
|
||||
private static final String IC2_UUM_FLUIDNAME = "ic2fluiduumatter";
|
||||
|
||||
@Handler
|
||||
public void init (FMLInitializationEvent event)
|
||||
{
|
||||
TConstruct.logger.info("IC2 detected. 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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package tconstruct.plugins.imc;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import mantle.pulsar.pulse.Handler;
|
||||
import mantle.pulsar.pulse.Pulse;
|
||||
import tconstruct.TConstruct;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
@ObjectHolder(TConstruct.modID)
|
||||
@Pulse(id = "Tinkers AE2 Compatibility", description = "Tinkers Construct compatibility for Applied Energistics 2", modsRequired = "appliedenergistics2")
|
||||
public class TinkerAE2
|
||||
{
|
||||
private static List<String> spatialIOLogics = Arrays.asList(
|
||||
"EssenceExtractorLogic", "GolemPedestalLogic", //TODO What happened to these?
|
||||
"MultiServantLogic"); //TODO Should Mantle handle this?
|
||||
|
||||
private static List<String> spatialIOSmelteryLogics = Arrays.asList("AdaptiveSmelteryLogic", "AqueductLogic", "CastingBasinLogic", "CastingChannelLogic",
|
||||
"CastingTableLogic", "FaucetLogic", "LavaTankLogic", "SmelteryDrainLogic", "SmelteryLogic", "TankAirLogic", "TowerFurnaceLogic");
|
||||
|
||||
private static List<String> spatialIOToolLogics = Arrays.asList("CraftingStationLogic", "FrypanLogic", "PartBuilderLogic", "PatternChestLogic",
|
||||
"StencilTableLogic", "ToolForgeLogic", "ToolStationLogic");
|
||||
|
||||
@Handler
|
||||
public void init (FMLInitializationEvent event)
|
||||
{
|
||||
TConstruct.logger.info("AE2 detected. Registering for Spatial IO.");
|
||||
|
||||
addtoSpatialWhitelist("tconstruct.blocks.logic.DryingRackLogic");
|
||||
addtoSpatialWhitelist("tconstruct.mechworks.logic.TileEntityLandmine");
|
||||
|
||||
for(String s : spatialIOSmelteryLogics)
|
||||
{
|
||||
addtoSpatialWhitelist("tconstruct.smeltery.logic." + s);
|
||||
}
|
||||
|
||||
for(String s : spatialIOToolLogics)
|
||||
{
|
||||
addtoSpatialWhitelist("tconstruct.tools.logic." + s);
|
||||
}
|
||||
}
|
||||
|
||||
public void addtoSpatialWhitelist(String teClass)
|
||||
{
|
||||
FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial", teClass);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package tconstruct.plugins.imc;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import mantle.pulsar.pulse.Handler;
|
||||
import mantle.pulsar.pulse.Pulse;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
|
||||
@ObjectHolder(TConstruct.modID)
|
||||
@Pulse(id = "Tinkers BuildCraft Compatibility", description = "Tinkers Construct compatibility for BC Transport", modsRequired = "BuildCraft|Transport")
|
||||
public class TinkerBuildCraft
|
||||
{
|
||||
@Handler
|
||||
public void init(FMLInitializationEvent event)
|
||||
{
|
||||
TConstruct.logger.info("BuildCraft detected. Registering facades.");
|
||||
// Smeltery Blocks
|
||||
addFacade(TinkerSmeltery.smeltery, 2);
|
||||
for (int sc = 4; sc < 11; sc++)
|
||||
{
|
||||
addFacade(TinkerSmeltery.smeltery, sc);
|
||||
}
|
||||
|
||||
addFacade(TinkerSmeltery.searedBlock, 0);
|
||||
addFacade(TinkerSmeltery.searedBlockNether, 0);
|
||||
}
|
||||
|
||||
private void addFacade (Block b, int meta)
|
||||
{
|
||||
FMLInterModComms.sendMessage("BuildCraft|Transport", "add-facade", new ItemStack(b, 1, meta));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package tconstruct.plugins.imc;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import mantle.pulsar.pulse.Handler;
|
||||
import mantle.pulsar.pulse.Pulse;
|
||||
import tconstruct.TConstruct;
|
||||
|
||||
@ObjectHolder(TConstruct.modID)
|
||||
@Pulse(id = "Tinkers Mystcraft Compatibility", forced = true, modsRequired = "Mystcraft")
|
||||
public class TinkerMystcraft
|
||||
{
|
||||
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" };
|
||||
|
||||
@Handler
|
||||
public void init (FMLInitializationEvent event)
|
||||
{
|
||||
TConstruct.logger.info("Mystcraft detected. Blacklisting Mystcraft fluid symbols.");
|
||||
for (String nm : fluids)
|
||||
sendFluidBlacklist(nm);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,7 +17,7 @@ public class TinkerThaumcraft
|
||||
@Handler
|
||||
public void init (FMLInitializationEvent event)
|
||||
{
|
||||
TConstruct.logger.info("[Thaumcraft] Registering harvestables.");
|
||||
TConstruct.logger.info("Thaumcraft detected. Registering harvestables.");
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TinkerWorld.oreBerry, 1, 12));
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TinkerWorld.oreBerry, 1, 13));
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TinkerWorld.oreBerry, 1, 14));
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package tconstruct.plugins.mfr;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
import powercrystals.minefactoryreloaded.api.ILiquidDrinkHandler;
|
||||
|
||||
public class Drinkables implements ILiquidDrinkHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public void onDrink (EntityLivingBase entity)
|
||||
{
|
||||
//boost health when drink
|
||||
if (entity != null)
|
||||
{
|
||||
PotionEffect potion = entity.getActivePotionEffect(Potion.field_76434_w);
|
||||
int duration = 0;
|
||||
if (potion != null)
|
||||
duration = potion.getDuration();
|
||||
entity.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, duration + 20 * 30, 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package tconstruct.plugins.mfr;
|
||||
|
||||
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.tools.TinkerTools;
|
||||
|
||||
public class GrindableHorse implements IFactoryGrindable
|
||||
{
|
||||
@Override
|
||||
public Class<? extends EntityLivingBase> 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(TinkerTools.materials, random.nextInt(4) + 1, 36)));
|
||||
|
||||
return drops;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processEntity (EntityLivingBase entity)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package tconstruct.plugins.mfr;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
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 Block _sourceBlock;
|
||||
private Item _berryItem;
|
||||
private int _metaOffset;
|
||||
|
||||
public HarvestableOreBerry(Block sourceBlock, Item berryItem, int metaOffset)
|
||||
{
|
||||
_sourceBlock = sourceBlock;
|
||||
_berryItem = berryItem;
|
||||
_metaOffset = metaOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getPlant ()
|
||||
{
|
||||
return _sourceBlock;
|
||||
}
|
||||
|
||||
@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(_berryItem, 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,17 @@
|
||||
package tconstruct.plugins.mfr;
|
||||
|
||||
import powercrystals.minefactoryreloaded.api.FactoryRegistry;
|
||||
import powercrystals.minefactoryreloaded.api.ValuedItem;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
|
||||
public class MFRRegister
|
||||
{
|
||||
public static void registerWithMFR ()
|
||||
{
|
||||
FactoryRegistry.sendMessage("registerHarvestable", new HarvestableOreBerry(TinkerWorld.oreBerry, TinkerWorld.oreBerries, 0));
|
||||
FactoryRegistry.sendMessage("registerHarvestable", new HarvestableOreBerry(TinkerWorld.oreBerrySecond, TinkerWorld.oreBerries, 4));
|
||||
FactoryRegistry.sendMessage("registerGrindable", new GrindableHorse());
|
||||
FactoryRegistry.sendMessage("registerLiquidDrinkHandler", new ValuedItem(TinkerSmeltery.bloodFluid.getName(), new Drinkables()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package tconstruct.plugins.mfr;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import mantle.pulsar.pulse.Handler;
|
||||
import mantle.pulsar.pulse.Pulse;
|
||||
import tconstruct.TConstruct;
|
||||
|
||||
@ObjectHolder(TConstruct.modID)
|
||||
@Pulse(id = "Tinkers MFR Compatibility", description = "Tinkers Construct compatibility for MineFactory Reloaded", modsRequired = "MineFactoryReloaded")
|
||||
public class TinkerMFR
|
||||
{
|
||||
@Handler
|
||||
public void init (FMLInitializationEvent event)
|
||||
{
|
||||
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).
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,240 @@
|
||||
package tconstruct.plugins.te4;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
/**
|
||||
* Taken from CoFHLib
|
||||
*
|
||||
* @author KingLemming
|
||||
*/
|
||||
public class TE4Helper
|
||||
{
|
||||
|
||||
public static void addFurnaceRecipe(int energy, ItemStack input, ItemStack output) {
|
||||
|
||||
if (input == null || output == null) {
|
||||
return;
|
||||
}
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
toSend.setInteger("energy", energy);
|
||||
toSend.setTag("input", new NBTTagCompound());
|
||||
toSend.setTag("output", new NBTTagCompound());
|
||||
|
||||
input.writeToNBT(toSend.getCompoundTag("input"));
|
||||
output.writeToNBT(toSend.getCompoundTag("output"));
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "FurnaceRecipe", toSend);
|
||||
}
|
||||
|
||||
public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput) {
|
||||
|
||||
addPulverizerRecipe(energy, input, primaryOutput, null, 0);
|
||||
}
|
||||
|
||||
public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput) {
|
||||
|
||||
addPulverizerRecipe(energy, input, primaryOutput, secondaryOutput, 100);
|
||||
}
|
||||
|
||||
public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {
|
||||
|
||||
if (input == null || primaryOutput == null || secondaryOutput == null) {
|
||||
return;
|
||||
}
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
toSend.setInteger("energy", energy);
|
||||
toSend.setTag("input", new NBTTagCompound());
|
||||
toSend.setTag("primaryOutput", new NBTTagCompound());
|
||||
toSend.setTag("secondaryOutput", new NBTTagCompound());
|
||||
|
||||
input.writeToNBT(toSend.getCompoundTag("input"));
|
||||
primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));
|
||||
secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
|
||||
toSend.setInteger("secondaryChance", secondaryChance);
|
||||
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "PulverizerRecipe", toSend);
|
||||
}
|
||||
|
||||
public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput) {
|
||||
|
||||
addSawmillRecipe(energy, input, primaryOutput, null, 0);
|
||||
}
|
||||
|
||||
public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput) {
|
||||
|
||||
addSawmillRecipe(energy, input, primaryOutput, secondaryOutput, 100);
|
||||
}
|
||||
|
||||
public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {
|
||||
|
||||
if (input == null || primaryOutput == null || secondaryOutput == null) {
|
||||
return;
|
||||
}
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
toSend.setInteger("energy", energy);
|
||||
toSend.setTag("input", new NBTTagCompound());
|
||||
toSend.setTag("primaryOutput", new NBTTagCompound());
|
||||
toSend.setTag("secondaryOutput", new NBTTagCompound());
|
||||
|
||||
input.writeToNBT(toSend.getCompoundTag("input"));
|
||||
primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));
|
||||
secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
|
||||
toSend.setInteger("secondaryChance", secondaryChance);
|
||||
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "SawmillRecipe", toSend);
|
||||
}
|
||||
|
||||
public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput) {
|
||||
|
||||
addSmelterRecipe(energy, primaryInput, secondaryInput, primaryOutput, null, 0);
|
||||
}
|
||||
|
||||
public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput, ItemStack secondaryOutput) {
|
||||
|
||||
addSmelterRecipe(energy, primaryInput, secondaryInput, primaryOutput, secondaryOutput, 100);
|
||||
}
|
||||
|
||||
public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput, ItemStack secondaryOutput,
|
||||
int secondaryChance) {
|
||||
|
||||
if (primaryInput == null || secondaryInput == null || primaryOutput == null || secondaryOutput == null) {
|
||||
return;
|
||||
}
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
toSend.setInteger("energy", energy);
|
||||
toSend.setTag("primaryInput", new NBTTagCompound());
|
||||
toSend.setTag("secondaryInput", new NBTTagCompound());
|
||||
toSend.setTag("primaryOutput", new NBTTagCompound());
|
||||
toSend.setTag("secondaryOutput", new NBTTagCompound());
|
||||
|
||||
primaryInput.writeToNBT(toSend.getCompoundTag("primaryInput"));
|
||||
secondaryInput.writeToNBT(toSend.getCompoundTag("secondaryInput"));
|
||||
primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));
|
||||
secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
|
||||
toSend.setInteger("secondaryChance", secondaryChance);
|
||||
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "SmelterRecipe", toSend);
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this to register an Ore TYPE as a "Blast" recipe - it will require Pyrotheum Dust to smelt. Do not add the prefix. This is an opt-in for ores which
|
||||
* do NOT have vanilla furnace recipes.
|
||||
*
|
||||
* Ex: "Steel" or "ElectrumFlux", not "dustSteel" or "dustElectrumFlux"
|
||||
*
|
||||
* @param oreType
|
||||
*/
|
||||
public static void addSmelterBlastOre(String oreType) {
|
||||
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
toSend.setString("oreType", oreType);
|
||||
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "SmelterBlastOreType", toSend);
|
||||
}
|
||||
|
||||
public static void addCrucibleRecipe(int energy, ItemStack input, FluidStack output) {
|
||||
|
||||
if (input == null || output == null) {
|
||||
return;
|
||||
}
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
toSend.setInteger("energy", energy);
|
||||
toSend.setTag("input", new NBTTagCompound());
|
||||
toSend.setTag("output", new NBTTagCompound());
|
||||
|
||||
input.writeToNBT(toSend.getCompoundTag("input"));
|
||||
output.writeToNBT(toSend.getCompoundTag("output"));
|
||||
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend);
|
||||
}
|
||||
|
||||
public static void addTransposerFill(int energy, ItemStack input, ItemStack output, FluidStack fluid, boolean reversible) {
|
||||
|
||||
if (input == null || output == null || fluid == null) {
|
||||
return;
|
||||
}
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
toSend.setInteger("energy", energy);
|
||||
toSend.setTag("input", new NBTTagCompound());
|
||||
toSend.setTag("output", new NBTTagCompound());
|
||||
toSend.setTag("fluid", new NBTTagCompound());
|
||||
|
||||
input.writeToNBT(toSend.getCompoundTag("input"));
|
||||
output.writeToNBT(toSend.getCompoundTag("output"));
|
||||
toSend.setBoolean("reversible", reversible);
|
||||
fluid.writeToNBT(toSend.getCompoundTag("fluid"));
|
||||
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "TransposerFillRecipe", toSend);
|
||||
}
|
||||
|
||||
public static void addTransposerExtract(int energy, ItemStack input, ItemStack output, FluidStack fluid, int chance, boolean reversible) {
|
||||
|
||||
if (input == null || output == null || fluid == null) {
|
||||
return;
|
||||
}
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
toSend.setInteger("energy", energy);
|
||||
toSend.setTag("input", new NBTTagCompound());
|
||||
toSend.setTag("output", new NBTTagCompound());
|
||||
toSend.setTag("fluid", new NBTTagCompound());
|
||||
|
||||
input.writeToNBT(toSend.getCompoundTag("input"));
|
||||
output.writeToNBT(toSend.getCompoundTag("output"));
|
||||
toSend.setBoolean("reversible", reversible);
|
||||
toSend.setInteger("chance", chance);
|
||||
fluid.writeToNBT(toSend.getCompoundTag("fluid"));
|
||||
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "TransposerExtractRecipe", toSend);
|
||||
}
|
||||
|
||||
public static void addMagmaticFuel(String fluidName, int energy) {
|
||||
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
toSend.setString("fluidName", fluidName);
|
||||
toSend.setInteger("energy", energy);
|
||||
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "MagmaticFuel", toSend);
|
||||
}
|
||||
|
||||
public static void addCompressionFuel(String fluidName, int energy) {
|
||||
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
toSend.setString("fluidName", fluidName);
|
||||
toSend.setInteger("energy", energy);
|
||||
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "CompressionFuel", toSend);
|
||||
}
|
||||
|
||||
public static void addReactantFuel(String fluidName, int energy) {
|
||||
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
toSend.setString("fluidName", fluidName);
|
||||
toSend.setInteger("energy", energy);
|
||||
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "ReactantFuel", toSend);
|
||||
}
|
||||
|
||||
public static void addCoolant(String fluidName, int energy) {
|
||||
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
toSend.setString("fluidName", fluidName);
|
||||
toSend.setInteger("energy", energy);
|
||||
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "Coolant", toSend);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package tconstruct.plugins.te4;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import mantle.pulsar.pulse.Handler;
|
||||
import mantle.pulsar.pulse.Pulse;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
|
||||
@ObjectHolder(TConstruct.modID)
|
||||
@Pulse(id = "Tinkers TE4 Compatibility", description = "Tinkers Construct compatibility for Thermal Expansion", modsRequired = "ThermalExpansion")
|
||||
public class TinkerTE4
|
||||
{
|
||||
@Handler
|
||||
public void init ()
|
||||
{
|
||||
TConstruct.logger.info("Thermal Expansion detected. Adding Pulverizer & Induction Smelter recipes");
|
||||
ItemStack crystalCinnabar = OreDictionary.getOres("crystalCinnabar").get(0);
|
||||
|
||||
TE4Helper.addPulverizerRecipe(1000, new ItemStack(TinkerTools.materials, 1, 11), new ItemStack(TinkerTools.materials, 1, 40), null, 0);
|
||||
TE4Helper.addPulverizerRecipe(1000, new ItemStack(TinkerTools.materials, 1, 3), new ItemStack(TinkerTools.materials, 1, 39), null, 0);
|
||||
TE4Helper.addPulverizerRecipe(1000, new ItemStack(TinkerTools.materials, 1, 4), new ItemStack(TinkerTools.materials, 1, 38), null, 0);
|
||||
|
||||
TE4Helper.addPulverizerRecipe(12000, new ItemStack(TinkerWorld.oreSlag, 1, 1), new ItemStack(TinkerTools.materials, 2, 39), GameRegistry.findItemStack("ThermalExpansion", "dustIron", 1), 10);
|
||||
TE4Helper.addSmelterRecipe(12000, new ItemStack(TinkerWorld.oreSlag, 1, 1), crystalCinnabar.copy(), new ItemStack(TinkerTools.materials, 3, 3), new ItemStack(Items.iron_ingot), 100);
|
||||
TE4Helper.addPulverizerRecipe(12000, new ItemStack(TinkerWorld.oreSlag, 1, 2), new ItemStack(TinkerTools.materials, 2, 38), GameRegistry.findItemStack("ThermalExpansion", "dustGold", 1), 10);
|
||||
TE4Helper.addSmelterRecipe(12000, new ItemStack(TinkerWorld.oreSlag, 1, 2), crystalCinnabar.copy(), new ItemStack(TinkerTools.materials, 3, 4), new ItemStack(Items.gold_ingot), 100);
|
||||
|
||||
TE4Helper.addSmelterRecipe(4000, new ItemStack(TinkerTools.materials, 1, 4), new ItemStack(TinkerTools.materials, 1, 3), new ItemStack(TinkerTools.materials, 1, 5), null, 0);
|
||||
TE4Helper.addSmelterRecipe(4000, new ItemStack(TinkerTools.materials, 1, 9), new ItemStack(TinkerTools.materials, 3, 11), new ItemStack(TinkerTools.materials, 4, 14), null, 0);
|
||||
}
|
||||
}
|
||||
@@ -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.smeltery.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.smeltery.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.smeltery.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.smeltery.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.smeltery.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,20 @@
|
||||
package tconstruct.plugins.waila;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import mantle.pulsar.pulse.Handler;
|
||||
import mantle.pulsar.pulse.Pulse;
|
||||
import tconstruct.TConstruct;
|
||||
|
||||
@ObjectHolder(TConstruct.modID)
|
||||
@Pulse(id = "Tinkers Waila Compatibility", description = "Tinkers Construct compatibility for Waila", modsRequired = "Waila")
|
||||
public class TinkerWaila
|
||||
{
|
||||
@Handler
|
||||
public void init (FMLInitializationEvent event)
|
||||
{
|
||||
TConstruct.logger.info("Waila detected. Registering TConstruct tank blocks with Waila registry.");
|
||||
FMLInterModComms.sendMessage("Waila", "register", "tconstruct.plugins.waila.WailaRegistrar.wailaCallback");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package tconstruct.plugins.waila;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.smeltery.blocks.LavaTankBlock;
|
||||
import tconstruct.smeltery.blocks.SmelteryBlock;
|
||||
import tconstruct.smeltery.logic.CastingBasinLogic;
|
||||
import tconstruct.smeltery.logic.CastingChannelLogic;
|
||||
import tconstruct.smeltery.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 f.getFluid().getLocalizedName(f);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user