mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Fix JABBA-related issues with crafting station slots (#54)
* Fix shift-merging tools voiding items fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/11392> * Change 0-sized ItemStacks into null stacks in crafting station attached slots Fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10425> * Update buildscript * spotlessApply
This commit is contained in:
1 parent
18bfeaff32
commit
39be06c23b
571 files changed
+25959
-28223
No files matched your search
@@ -3,46 +3,43 @@ package tconstruct.plugins;
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import mantle.pulsar.pulse.*;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.armor.ArmorPart;
|
||||
import tconstruct.library.crafting.ModifyBuilder;
|
||||
import tconstruct.modifiers.armor.AModBoolean;
|
||||
import tconstruct.modifiers.armor.AModThaumicVision;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import thaumcraft.api.ItemApi;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
@ObjectHolder(TConstruct.modID)
|
||||
@Pulse(id = "Tinkers Thaumcraft Compatibility", description = "Tinkers Construct compatibility for Thaumcraft", modsRequired = "Thaumcraft", pulsesRequired = "Tinkers' World", forced = true)
|
||||
public class TinkerThaumcraft
|
||||
{
|
||||
@Pulse(
|
||||
id = "Tinkers Thaumcraft Compatibility",
|
||||
description = "Tinkers Construct compatibility for Thaumcraft",
|
||||
modsRequired = "Thaumcraft",
|
||||
pulsesRequired = "Tinkers' World",
|
||||
forced = true)
|
||||
public class TinkerThaumcraft {
|
||||
|
||||
@Handler
|
||||
public void init (FMLInitializationEvent event)
|
||||
{
|
||||
public void init(FMLInitializationEvent event) {
|
||||
TConstruct.logger.info("Thaumcraft detected. Registering harvestables.");
|
||||
sendIMC();
|
||||
registerModifiers();
|
||||
}
|
||||
|
||||
private void sendIMC()
|
||||
{
|
||||
private void sendIMC() {
|
||||
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));
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TinkerWorld.oreBerry, 1, 15));
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TinkerWorld.oreBerrySecond, 1, 12));
|
||||
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TinkerWorld.oreBerrySecond, 1, 13));
|
||||
FMLInterModComms.sendMessage(
|
||||
"Thaumcraft", "harvestClickableCrop", new ItemStack(TinkerWorld.oreBerrySecond, 1, 12));
|
||||
FMLInterModComms.sendMessage(
|
||||
"Thaumcraft", "harvestClickableCrop", new ItemStack(TinkerWorld.oreBerrySecond, 1, 13));
|
||||
}
|
||||
|
||||
private void registerModifiers()
|
||||
{
|
||||
private void registerModifiers() {
|
||||
ItemStack thaumometer = ItemApi.getItem("itemThaumometer", 0);
|
||||
if(thaumometer != null) {
|
||||
if (thaumometer != null) {
|
||||
// Thaumometer Vision!
|
||||
ModifyBuilder.registerModifier(new AModThaumicVision(thaumometer));
|
||||
}
|
||||
|
||||
@@ -9,48 +9,47 @@ import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
|
||||
@Pulse(id = "Tinkers FMP Compatibility", description = "Makes Tinkers Blocks Multipart compatible", modsRequired = "ForgeMultipart", forced = true)
|
||||
@Pulse(
|
||||
id = "Tinkers FMP Compatibility",
|
||||
description = "Makes Tinkers Blocks Multipart compatible",
|
||||
modsRequired = "ForgeMultipart",
|
||||
forced = true)
|
||||
public class TinkerFMP {
|
||||
@Handler
|
||||
public void init(FMLInitializationEvent event)
|
||||
{
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
TConstruct.logger.info("ForgeMultipart detected. Registering TConstruct decorative blocks with FMP.");
|
||||
|
||||
//make Tconstruct blocks multipartable!
|
||||
if(TinkerWorld.metalBlock != null) {
|
||||
// make Tconstruct blocks multipartable!
|
||||
if (TinkerWorld.metalBlock != null) {
|
||||
// metal blocks
|
||||
for (int i = 0; i < 11; i++)
|
||||
BlockMicroMaterial.createAndRegister(TinkerWorld.metalBlock, i);
|
||||
for (int i = 0; i < 11; i++) BlockMicroMaterial.createAndRegister(TinkerWorld.metalBlock, i);
|
||||
}
|
||||
|
||||
if(TinkerSmeltery.smeltery != null) {
|
||||
if (TinkerSmeltery.smeltery != null) {
|
||||
// smeltery bricks
|
||||
for (int i = 2; i < 12; i++) {
|
||||
if (i == 3)
|
||||
continue;
|
||||
if (i == 3) continue;
|
||||
BlockMicroMaterial.createAndRegister(TinkerSmeltery.smeltery, i);
|
||||
BlockMicroMaterial.createAndRegister(TinkerSmeltery.smelteryNether, i, TinkerSmeltery.smelteryNether.getUnlocalizedName() + "Nether");
|
||||
BlockMicroMaterial.createAndRegister(
|
||||
TinkerSmeltery.smelteryNether,
|
||||
i,
|
||||
TinkerSmeltery.smelteryNether.getUnlocalizedName() + "Nether");
|
||||
}
|
||||
|
||||
// brownstone
|
||||
for (int i = 0; i < 7; i++)
|
||||
BlockMicroMaterial.createAndRegister(TinkerSmeltery.speedBlock, i);
|
||||
for (int i = 0; i < 7; i++) BlockMicroMaterial.createAndRegister(TinkerSmeltery.speedBlock, i);
|
||||
|
||||
// clear glass
|
||||
BlockMicroMaterial.createAndRegister(TinkerSmeltery.clearGlass, 0);
|
||||
for (int i = 0; i < 16; i++)
|
||||
BlockMicroMaterial.createAndRegister(TinkerSmeltery.stainedGlassClear, i);
|
||||
for (int i = 0; i < 16; i++) BlockMicroMaterial.createAndRegister(TinkerSmeltery.stainedGlassClear, i);
|
||||
}
|
||||
|
||||
if(TinkerTools.multiBrick != null) {
|
||||
if (TinkerTools.multiBrick != null) {
|
||||
// chisel bricks
|
||||
for (int i = 0; i < 14; i++)
|
||||
BlockMicroMaterial.createAndRegister(TinkerTools.multiBrick, i);
|
||||
for (int i = 0; i < 14; i++) BlockMicroMaterial.createAndRegister(TinkerTools.multiBrick, i);
|
||||
|
||||
for (int i = 0; i < 16; i++)
|
||||
BlockMicroMaterial.createAndRegister(TinkerTools.multiBrickFancy, i);
|
||||
for (int i = 0; i < 16; i++) BlockMicroMaterial.createAndRegister(TinkerTools.multiBrickFancy, i);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package tconstruct.plugins.gears;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import java.util.List;
|
||||
import mantle.pulsar.pulse.Handler;
|
||||
import mantle.pulsar.pulse.Pulse;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -16,14 +17,12 @@ import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.FluidType;
|
||||
import tconstruct.library.crafting.Smeltery;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.tools.items.Pattern;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Pulse(id = "Tinkers Gears", description = "Adds a gear cast if other mods provide gears", pulsesRequired = "Tinkers' Smeltery")
|
||||
@Pulse(
|
||||
id = "Tinkers Gears",
|
||||
description = "Adds a gear cast if other mods provide gears",
|
||||
pulsesRequired = "Tinkers' Smeltery")
|
||||
public class TinkerGears {
|
||||
public static Item gearCast;
|
||||
|
||||
@@ -40,22 +39,21 @@ public class TinkerGears {
|
||||
ItemStack cast = new ItemStack(gearCast);
|
||||
FluidStack aluCastLiquid = new FluidStack(TinkerSmeltery.moltenAlubrassFluid, TConstruct.ingotLiquidValue);
|
||||
FluidStack goldCastLiquid = null;
|
||||
if(!PHConstruct.removeGoldCastRecipes) {
|
||||
goldCastLiquid = new FluidStack(TinkerSmeltery.moltenGoldFluid, TConstruct.ingotLiquidValue*2);
|
||||
if (!PHConstruct.removeGoldCastRecipes) {
|
||||
goldCastLiquid = new FluidStack(TinkerSmeltery.moltenGoldFluid, TConstruct.ingotLiquidValue * 2);
|
||||
}
|
||||
|
||||
// find all gears in the registry
|
||||
for(String oreName : OreDictionary.getOreNames()) {
|
||||
if(!oreName.startsWith("gear"))
|
||||
continue;
|
||||
for (String oreName : OreDictionary.getOreNames()) {
|
||||
if (!oreName.startsWith("gear")) continue;
|
||||
|
||||
List<ItemStack> gears = OreDictionary.getOres(oreName);
|
||||
|
||||
// register every gear besides wooden gear for creating a gear cast
|
||||
if(!oreName.equals("gearWood")) {
|
||||
for(ItemStack g : gears) {
|
||||
if (!oreName.equals("gearWood")) {
|
||||
for (ItemStack g : gears) {
|
||||
TConstructRegistry.getTableCasting().addCastingRecipe(cast, aluCastLiquid, g, false, 50);
|
||||
if(!PHConstruct.removeGoldCastRecipes)
|
||||
if (!PHConstruct.removeGoldCastRecipes)
|
||||
TConstructRegistry.getTableCasting().addCastingRecipe(cast, goldCastLiquid, g, false, 50);
|
||||
}
|
||||
}
|
||||
@@ -65,24 +63,20 @@ public class TinkerGears {
|
||||
// try the oredict name directly
|
||||
Fluid fluid = FluidRegistry.getFluid(material);
|
||||
// or lowercased
|
||||
if(fluid == null)
|
||||
fluid = FluidRegistry.getFluid(material.toLowerCase());
|
||||
if (fluid == null) fluid = FluidRegistry.getFluid(material.toLowerCase());
|
||||
// or in the tinkers liquid format
|
||||
if(fluid == null)
|
||||
fluid = FluidRegistry.getFluid(material.toLowerCase() + ".molten");
|
||||
if (fluid == null) fluid = FluidRegistry.getFluid(material.toLowerCase() + ".molten");
|
||||
|
||||
// found one?
|
||||
if(fluid != null) {
|
||||
if (fluid != null) {
|
||||
ItemStack gear = gears.get(0);
|
||||
FluidStack liquid = new FluidStack(fluid.getID(), TConstruct.ingotLiquidValue*4);
|
||||
FluidStack liquid = new FluidStack(fluid.getID(), TConstruct.ingotLiquidValue * 4);
|
||||
// gear casting
|
||||
TConstructRegistry.getTableCasting().addCastingRecipe(gear, liquid, cast, 55);
|
||||
// and melting it back
|
||||
FluidType ft = FluidType.getFluidType(fluid);
|
||||
if(ft != null)
|
||||
Smeltery.addMelting(ft, gear, 100, TConstruct.ingotLiquidValue*4);
|
||||
else
|
||||
Smeltery.addMelting(gear, TinkerSmeltery.glueBlock, 0, 100, liquid);
|
||||
if (ft != null) Smeltery.addMelting(ft, gear, 100, TConstruct.ingotLiquidValue * 4);
|
||||
else Smeltery.addMelting(gear, TinkerSmeltery.glueBlock, 0, 100, liquid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,24 +11,26 @@ 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", forced = true)
|
||||
public class TinkerIC2
|
||||
{
|
||||
@Pulse(
|
||||
id = "Tinkers IC2 Compatibility",
|
||||
description = "Tinkers Construct compatibility for IndustrialCraft 2",
|
||||
modsRequired = "IC2",
|
||||
forced = true)
|
||||
public class TinkerIC2 {
|
||||
private static final String IC2_UUM_FLUIDNAME = "ic2fluiduumatter";
|
||||
|
||||
@Handler
|
||||
public void init (FMLInitializationEvent event)
|
||||
{
|
||||
public void init(FMLInitializationEvent event) {
|
||||
TConstruct.logger.info("IC2 detected. Preparing for shenanigans.");
|
||||
|
||||
Fluid fluidUUM = FluidRegistry.getFluid(IC2_UUM_FLUIDNAME);
|
||||
if (fluidUUM == null)
|
||||
return;
|
||||
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);
|
||||
basinCasting.addCastingRecipe(
|
||||
new ItemStack(Blocks.diamond_block), fluidStackBlock, new ItemStack(Blocks.dirt), true, 50);
|
||||
}
|
||||
}
|
||||
@@ -7,37 +7,56 @@ import mantle.pulsar.pulse.*;
|
||||
import tconstruct.TConstruct;
|
||||
|
||||
@ObjectHolder(TConstruct.modID)
|
||||
@Pulse(id = "Tinkers AE2 Compatibility", description = "Tinkers Construct compatibility for Applied Energistics 2", modsRequired = "appliedenergistics2", forced = true)
|
||||
public class TinkerAE2
|
||||
{
|
||||
private static List<String> spatialIOLogics = Arrays.asList("EssenceExtractorLogic", "GolemPedestalLogic", //TODO What happened to these?
|
||||
"MultiServantLogic"); //TODO Should Mantle handle this?
|
||||
@Pulse(
|
||||
id = "Tinkers AE2 Compatibility",
|
||||
description = "Tinkers Construct compatibility for Applied Energistics 2",
|
||||
modsRequired = "appliedenergistics2",
|
||||
forced = true)
|
||||
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> 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");
|
||||
private static List<String> spatialIOToolLogics = Arrays.asList(
|
||||
"CraftingStationLogic",
|
||||
"FrypanLogic",
|
||||
"PartBuilderLogic",
|
||||
"PatternChestLogic",
|
||||
"StencilTableLogic",
|
||||
"ToolForgeLogic",
|
||||
"ToolStationLogic");
|
||||
|
||||
@Handler
|
||||
public void init (FMLInitializationEvent event)
|
||||
{
|
||||
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)
|
||||
{
|
||||
for (String s : spatialIOSmelteryLogics) {
|
||||
addtoSpatialWhitelist("tconstruct.smeltery.logic." + s);
|
||||
}
|
||||
|
||||
for (String s : spatialIOToolLogics)
|
||||
{
|
||||
for (String s : spatialIOToolLogics) {
|
||||
addtoSpatialWhitelist("tconstruct.tools.logic." + s);
|
||||
}
|
||||
}
|
||||
|
||||
public void addtoSpatialWhitelist (String teClass)
|
||||
{
|
||||
public void addtoSpatialWhitelist(String teClass) {
|
||||
FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial", teClass);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,25 @@
|
||||
package tconstruct.plugins.imc;
|
||||
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import mantle.pulsar.pulse.*;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
|
||||
@Pulse(id = "Tinkers BuildCraft Compatibility", description = "Tinkers Construct compatibility for BC Transport", modsRequired = "BuildCraft|Transport", forced = true)
|
||||
public class TinkerBuildCraft
|
||||
{
|
||||
@Pulse(
|
||||
id = "Tinkers BuildCraft Compatibility",
|
||||
description = "Tinkers Construct compatibility for BC Transport",
|
||||
modsRequired = "BuildCraft|Transport",
|
||||
forced = true)
|
||||
public class TinkerBuildCraft {
|
||||
@Handler
|
||||
public void init (FMLInitializationEvent event)
|
||||
{
|
||||
public void init(FMLInitializationEvent event) {
|
||||
TConstruct.logger.info("BuildCraft detected. Registering facades.");
|
||||
// Smeltery Blocks
|
||||
addFacade(TinkerSmeltery.smeltery, 2);
|
||||
addFacade(TinkerSmeltery.smelteryNether, 2);
|
||||
for (int sc = 4; sc < 11; sc++)
|
||||
{
|
||||
for (int sc = 4; sc < 11; sc++) {
|
||||
addFacade(TinkerSmeltery.smeltery, sc);
|
||||
addFacade(TinkerSmeltery.smelteryNether, sc);
|
||||
}
|
||||
@@ -28,8 +28,7 @@ public class TinkerBuildCraft
|
||||
addFacade(TinkerSmeltery.searedBlockNether, 0);
|
||||
}
|
||||
|
||||
private void addFacade (Block b, int meta)
|
||||
{
|
||||
private void addFacade(Block b, int meta) {
|
||||
FMLInterModComms.sendMessage("BuildCraft|Transport", "add-facade", new ItemStack(b, 1, meta));
|
||||
}
|
||||
}
|
||||
@@ -1,49 +1,49 @@
|
||||
package tconstruct.plugins.imc;
|
||||
|
||||
import static tconstruct.smeltery.TinkerSmeltery.*;
|
||||
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import mantle.pulsar.pulse.*;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import tconstruct.TConstruct;
|
||||
|
||||
import static tconstruct.smeltery.TinkerSmeltery.*;
|
||||
|
||||
@Pulse(id = "Tinkers Mystcraft Compatibility", forced = true, modsRequired = "Mystcraft", pulsesRequired = "Tinkers' Smeltery")
|
||||
public class TinkerMystcraft
|
||||
{
|
||||
@Pulse(
|
||||
id = "Tinkers Mystcraft Compatibility",
|
||||
forced = true,
|
||||
modsRequired = "Mystcraft",
|
||||
pulsesRequired = "Tinkers' Smeltery")
|
||||
public class TinkerMystcraft {
|
||||
@Handler
|
||||
public void init (FMLInitializationEvent event)
|
||||
{
|
||||
public void init(FMLInitializationEvent event) {
|
||||
final Fluid[] fluids = new Fluid[] {
|
||||
// precious tinker fluids
|
||||
moltenGoldFluid,
|
||||
moltenSteelFluid,
|
||||
moltenEmeraldFluid,
|
||||
moltenQuartzFluid,
|
||||
moltenArditeFluid,
|
||||
moltenCobaltFluid,
|
||||
// all alloys
|
||||
pigIronFluid,
|
||||
moltenBronzeFluid,
|
||||
moltenAlumiteFluid,
|
||||
moltenAlubrassFluid,
|
||||
moltenManyullynFluid,
|
||||
// precious TE fluids
|
||||
moltenEnderFluid,
|
||||
moltenSilverFluid,
|
||||
moltenInvarFluid,
|
||||
moltenElectrumFluid,
|
||||
moltenShinyFluid,
|
||||
moltenSignalumFluid,
|
||||
moltenLumiumFluid,
|
||||
moltenMithrilFluid,
|
||||
moltenEnderiumFluid
|
||||
// precious tinker fluids
|
||||
moltenGoldFluid,
|
||||
moltenSteelFluid,
|
||||
moltenEmeraldFluid,
|
||||
moltenQuartzFluid,
|
||||
moltenArditeFluid,
|
||||
moltenCobaltFluid,
|
||||
// all alloys
|
||||
pigIronFluid,
|
||||
moltenBronzeFluid,
|
||||
moltenAlumiteFluid,
|
||||
moltenAlubrassFluid,
|
||||
moltenManyullynFluid,
|
||||
// precious TE fluids
|
||||
moltenEnderFluid,
|
||||
moltenSilverFluid,
|
||||
moltenInvarFluid,
|
||||
moltenElectrumFluid,
|
||||
moltenShinyFluid,
|
||||
moltenSignalumFluid,
|
||||
moltenLumiumFluid,
|
||||
moltenMithrilFluid,
|
||||
moltenEnderiumFluid
|
||||
};
|
||||
|
||||
TConstruct.logger.info("Mystcraft detected. Blacklisting Mystcraft fluid symbols.");
|
||||
for(Fluid fluid : fluids)
|
||||
{
|
||||
if(fluid == null)
|
||||
continue;
|
||||
for (Fluid fluid : fluids) {
|
||||
if (fluid == null) continue;
|
||||
FMLInterModComms.sendMessage("Mystcraft", "blacklistfluid", fluid.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package tconstruct.plugins.imc;
|
||||
|
||||
import static tconstruct.smeltery.TinkerSmeltery.*;
|
||||
import static tconstruct.smeltery.TinkerSmeltery.moltenEnderiumFluid;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import mantle.pulsar.pulse.Handler;
|
||||
@@ -7,12 +10,9 @@ import mantle.pulsar.pulse.Pulse;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
|
||||
import static tconstruct.smeltery.TinkerSmeltery.*;
|
||||
import static tconstruct.smeltery.TinkerSmeltery.moltenEnderiumFluid;
|
||||
|
||||
@Pulse(id = "Tinkers RF-Tools Compatibility", forced = true, modsRequired = TinkerRfTools.modid)
|
||||
public class TinkerRfTools {
|
||||
final static String modid = "rftools";
|
||||
static final String modid = "rftools";
|
||||
|
||||
@Handler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
@@ -40,41 +40,73 @@ public class TinkerRfTools {
|
||||
configure(moltenSilverFluid, 45678, 14321, 1234, 6);
|
||||
|
||||
// configure availability
|
||||
preventLoot(moltenSteelFluid, moltenGoldFluid, moltenEnderFluid, moltenArditeFluid, moltenCobaltFluid, moltenSilverFluid, moltenEmeraldFluid, moltenQuartzFluid);
|
||||
preventGen(moltenCobaltFluid, moltenArditeFluid, moltenSteelFluid, moltenGoldFluid, moltenEmeraldFluid, moltenIronFluid, moltenQuartzFluid);
|
||||
preventLoot(
|
||||
moltenSteelFluid,
|
||||
moltenGoldFluid,
|
||||
moltenEnderFluid,
|
||||
moltenArditeFluid,
|
||||
moltenCobaltFluid,
|
||||
moltenSilverFluid,
|
||||
moltenEmeraldFluid,
|
||||
moltenQuartzFluid);
|
||||
preventGen(
|
||||
moltenCobaltFluid,
|
||||
moltenArditeFluid,
|
||||
moltenSteelFluid,
|
||||
moltenGoldFluid,
|
||||
moltenEmeraldFluid,
|
||||
moltenIronFluid,
|
||||
moltenQuartzFluid);
|
||||
|
||||
// configure ores
|
||||
if(TinkerWorld.oreSlag != null) {
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_configure", String.format("Material.%s=%d,%d,%d,%d", "tile.tconstruct.stoneore1", 500000, 25000, 15000, 5));
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_preventloot", String.format("Material.%s", "tile.tconstruct.stoneore1"));
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_configure", String.format("Material.%s=%d,%d,%d,%d", "tile.tconstruct.stoneore2", 400000, 20000, 10000, 5));
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_preventloot", String.format("Material.%s", "tile.tconstruct.stoneore2"));
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_configure", String.format("Material.%s=%d,%d,%d,%d", "tile.tconstruct.stoneore3", 10000, 3000, 1000, 3));
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_configure", String.format("Material.%s=%d,%d,%d,%d", "tile.tconstruct.stoneore4", 12000, 3333, 5000, 3));
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_configure", String.format("Material.%s=%d,%d,%d,%d", "tile.tconstruct.stoneore5", 10000, 2800, 500, 3));
|
||||
if (TinkerWorld.oreSlag != null) {
|
||||
FMLInterModComms.sendMessage(
|
||||
modid,
|
||||
"dimlet_configure",
|
||||
String.format("Material.%s=%d,%d,%d,%d", "tile.tconstruct.stoneore1", 500000, 25000, 15000, 5));
|
||||
FMLInterModComms.sendMessage(
|
||||
modid, "dimlet_preventloot", String.format("Material.%s", "tile.tconstruct.stoneore1"));
|
||||
FMLInterModComms.sendMessage(
|
||||
modid,
|
||||
"dimlet_configure",
|
||||
String.format("Material.%s=%d,%d,%d,%d", "tile.tconstruct.stoneore2", 400000, 20000, 10000, 5));
|
||||
FMLInterModComms.sendMessage(
|
||||
modid, "dimlet_preventloot", String.format("Material.%s", "tile.tconstruct.stoneore2"));
|
||||
FMLInterModComms.sendMessage(
|
||||
modid,
|
||||
"dimlet_configure",
|
||||
String.format("Material.%s=%d,%d,%d,%d", "tile.tconstruct.stoneore3", 10000, 3000, 1000, 3));
|
||||
FMLInterModComms.sendMessage(
|
||||
modid,
|
||||
"dimlet_configure",
|
||||
String.format("Material.%s=%d,%d,%d,%d", "tile.tconstruct.stoneore4", 12000, 3333, 5000, 3));
|
||||
FMLInterModComms.sendMessage(
|
||||
modid,
|
||||
"dimlet_configure",
|
||||
String.format("Material.%s=%d,%d,%d,%d", "tile.tconstruct.stoneore5", 10000, 2800, 500, 3));
|
||||
}
|
||||
}
|
||||
|
||||
private void configure(Fluid fluid, int create, int maintain, int ticks, int rarity) {
|
||||
if(fluid == null)
|
||||
return;
|
||||
if (fluid == null) return;
|
||||
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_configure", String.format("Liquid.%s=%d,%d,%d,%d", fluid.getName(), create, maintain, ticks, rarity));
|
||||
FMLInterModComms.sendMessage(
|
||||
modid,
|
||||
"dimlet_configure",
|
||||
String.format("Liquid.%s=%d,%d,%d,%d", fluid.getName(), create, maintain, ticks, rarity));
|
||||
}
|
||||
|
||||
private void preventLoot(Fluid... fluids) {
|
||||
for(Fluid fluid : fluids) {
|
||||
if (fluid == null)
|
||||
continue;
|
||||
for (Fluid fluid : fluids) {
|
||||
if (fluid == null) continue;
|
||||
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_preventloot", String.format("Liquid.%s", fluid.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
private void preventGen(Fluid... fluids) {
|
||||
for(Fluid fluid : fluids) {
|
||||
if (fluid == null)
|
||||
continue;
|
||||
for (Fluid fluid : fluids) {
|
||||
if (fluid == null) continue;
|
||||
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_preventworldgen", String.format("Liquid.%s", fluid.getName()));
|
||||
}
|
||||
@@ -83,37 +115,41 @@ public class TinkerRfTools {
|
||||
private void blacklist() {
|
||||
// blacklist alloys
|
||||
final Fluid[] fluidBlacklist = {
|
||||
// all alloys
|
||||
pigIronFluid,
|
||||
moltenBronzeFluid,
|
||||
moltenAlumiteFluid,
|
||||
moltenAlubrassFluid,
|
||||
moltenManyullynFluid,
|
||||
moltenInvarFluid,
|
||||
moltenElectrumFluid,
|
||||
moltenSignalumFluid,
|
||||
moltenLumiumFluid,
|
||||
moltenMithrilFluid,
|
||||
moltenEnderiumFluid,
|
||||
// and shiny
|
||||
moltenShinyFluid
|
||||
// all alloys
|
||||
pigIronFluid,
|
||||
moltenBronzeFluid,
|
||||
moltenAlumiteFluid,
|
||||
moltenAlubrassFluid,
|
||||
moltenManyullynFluid,
|
||||
moltenInvarFluid,
|
||||
moltenElectrumFluid,
|
||||
moltenSignalumFluid,
|
||||
moltenLumiumFluid,
|
||||
moltenMithrilFluid,
|
||||
moltenEnderiumFluid,
|
||||
// and shiny
|
||||
moltenShinyFluid
|
||||
};
|
||||
|
||||
for(Fluid fluid : fluidBlacklist) {
|
||||
if(fluid == null)
|
||||
continue;
|
||||
for (Fluid fluid : fluidBlacklist) {
|
||||
if (fluid == null) continue;
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_blacklist", "Liquid." + fluid.getName());
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_configure", "Liquid." + fluid.getName() + "=999999,999999,999999,6");
|
||||
FMLInterModComms.sendMessage(
|
||||
modid, "dimlet_configure", "Liquid." + fluid.getName() + "=999999,999999,999999,6");
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_preventworldgen", "Liquid." + fluid.getName());
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_preventloot", "Liquid." + fluid.getName());
|
||||
}
|
||||
|
||||
// blacklist oreberry bushes
|
||||
if(TinkerWorld.oreBerry != null) {
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_configure", "Material." + "tile.ore.berries.one=123456,123456,123456,6");
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_configure", "Material." + "tile.ore.berries.one1=123456,123456,123456,6");
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_configure", "Material." + "tile.ore.berries.one2=123456,123456,123456,6");
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_configure", "Material." + "tile.ore.berries.one3=123456,123456,123456,6");
|
||||
if (TinkerWorld.oreBerry != null) {
|
||||
FMLInterModComms.sendMessage(
|
||||
modid, "dimlet_configure", "Material." + "tile.ore.berries.one=123456,123456,123456,6");
|
||||
FMLInterModComms.sendMessage(
|
||||
modid, "dimlet_configure", "Material." + "tile.ore.berries.one1=123456,123456,123456,6");
|
||||
FMLInterModComms.sendMessage(
|
||||
modid, "dimlet_configure", "Material." + "tile.ore.berries.one2=123456,123456,123456,6");
|
||||
FMLInterModComms.sendMessage(
|
||||
modid, "dimlet_configure", "Material." + "tile.ore.berries.one3=123456,123456,123456,6");
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_blacklist", "Material." + "tile.ore.berries.one");
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_blacklist", "Material." + "tile.ore.berries.one1");
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_blacklist", "Material." + "tile.ore.berries.one2");
|
||||
@@ -127,9 +163,11 @@ public class TinkerRfTools {
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_preventloot", "Material." + "tile.ore.berries.one2");
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_preventloot", "Material." + "tile.ore.berries.one3");
|
||||
}
|
||||
if(TinkerWorld.oreBerrySecond != null) {
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_configure", "Material." + "tile.ore.berries.two=123456,123456,123456,6");
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_configure", "Material." + "tile.ore.berries.two1=123456,123456,123456,6");
|
||||
if (TinkerWorld.oreBerrySecond != null) {
|
||||
FMLInterModComms.sendMessage(
|
||||
modid, "dimlet_configure", "Material." + "tile.ore.berries.two=123456,123456,123456,6");
|
||||
FMLInterModComms.sendMessage(
|
||||
modid, "dimlet_configure", "Material." + "tile.ore.berries.two1=123456,123456,123456,6");
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_blacklist", "Material." + "tile.ore.berries.two");
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_blacklist", "Material." + "tile.ore.berries.two1");
|
||||
FMLInterModComms.sendMessage(modid, "dimlet_preventworldgen", "Material." + "tile.ore.berries.two");
|
||||
|
||||
@@ -4,22 +4,16 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.potion.*;
|
||||
import powercrystals.minefactoryreloaded.api.ILiquidDrinkHandler;
|
||||
|
||||
public class Drinkables implements ILiquidDrinkHandler
|
||||
{
|
||||
public class Drinkables implements ILiquidDrinkHandler {
|
||||
|
||||
@Override
|
||||
public void onDrink (EntityLivingBase entity)
|
||||
{
|
||||
//boost health when drink
|
||||
if (entity != null)
|
||||
{
|
||||
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();
|
||||
if (potion != null) duration = potion.getDuration();
|
||||
entity.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, duration + 20 * 30, 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,17 +8,14 @@ import net.minecraft.world.World;
|
||||
import powercrystals.minefactoryreloaded.api.*;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
|
||||
public class GrindableHorse implements IFactoryGrindable
|
||||
{
|
||||
public class GrindableHorse implements IFactoryGrindable {
|
||||
@Override
|
||||
public Class<? extends EntityLivingBase> getGrindableEntity ()
|
||||
{
|
||||
public Class<? extends EntityLivingBase> getGrindableEntity() {
|
||||
return EntityHorse.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MobDrop> grind (World world, EntityLivingBase entity, Random random)
|
||||
{
|
||||
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)));
|
||||
@@ -27,8 +24,7 @@ public class GrindableHorse implements IFactoryGrindable
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processEntity (EntityLivingBase entity)
|
||||
{
|
||||
public boolean processEntity(EntityLivingBase entity) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -6,58 +6,49 @@ import net.minecraft.item.*;
|
||||
import net.minecraft.world.World;
|
||||
import powercrystals.minefactoryreloaded.api.*;
|
||||
|
||||
public class HarvestableOreBerry implements IFactoryHarvestable
|
||||
{
|
||||
public class HarvestableOreBerry implements IFactoryHarvestable {
|
||||
private Block _sourceBlock;
|
||||
private Item _berryItem;
|
||||
private int _metaOffset;
|
||||
|
||||
public HarvestableOreBerry(Block sourceBlock, Item berryItem, int metaOffset)
|
||||
{
|
||||
public HarvestableOreBerry(Block sourceBlock, Item berryItem, int metaOffset) {
|
||||
_sourceBlock = sourceBlock;
|
||||
_berryItem = berryItem;
|
||||
_metaOffset = metaOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getPlant ()
|
||||
{
|
||||
public Block getPlant() {
|
||||
return _sourceBlock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HarvestType getHarvestType ()
|
||||
{
|
||||
public HarvestType getHarvestType() {
|
||||
return HarvestType.Column;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean breakBlock ()
|
||||
{
|
||||
public boolean breakBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeHarvested (World world, Map<String, Boolean> harvesterSettings, int x, int y, int z)
|
||||
{
|
||||
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) };
|
||||
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)
|
||||
{
|
||||
}
|
||||
public void preHarvest(World world, int x, int y, int z) {}
|
||||
|
||||
@Override
|
||||
public void postHarvest (World world, int x, int y, int z)
|
||||
{
|
||||
public void postHarvest(World world, int x, int y, int z) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) - 4, 2);
|
||||
}
|
||||
}
|
||||
@@ -4,13 +4,14 @@ import powercrystals.minefactoryreloaded.api.*;
|
||||
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));
|
||||
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()));
|
||||
FactoryRegistry.sendMessage(
|
||||
"registerLiquidDrinkHandler", new ValuedItem(TinkerSmeltery.bloodFluid.getName(), new Drinkables()));
|
||||
}
|
||||
}
|
||||
@@ -6,13 +6,16 @@ import mantle.pulsar.pulse.*;
|
||||
import tconstruct.TConstruct;
|
||||
|
||||
@ObjectHolder(TConstruct.modID)
|
||||
@Pulse(id = "Tinkers MFR Compatibility", description = "Tinkers Construct compatibility for MineFactory Reloaded", modsRequired = "MineFactoryReloaded", forced = true)
|
||||
public class TinkerMFR
|
||||
{
|
||||
@Pulse(
|
||||
id = "Tinkers MFR Compatibility",
|
||||
description = "Tinkers Construct compatibility for MineFactory Reloaded",
|
||||
modsRequired = "MineFactoryReloaded",
|
||||
forced = true)
|
||||
public class TinkerMFR {
|
||||
@Handler
|
||||
public void init (FMLInitializationEvent event)
|
||||
{
|
||||
TConstruct.logger.info("MineFactoryReloaded detected. Registering TConstruct farmables/grindables with MFR's Farming Registry.");
|
||||
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.
|
||||
@@ -20,4 +23,4 @@ public class TinkerMFR
|
||||
* Currently used weights are from about 50 (emerald) to 175 (coal).
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,69 +1,60 @@
|
||||
package tconstruct.plugins.nei;
|
||||
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
import codechicken.nei.guihook.IContainerInputHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import tconstruct.client.ArmorControls;
|
||||
|
||||
public class BeltToggleFromGuiInputHandler implements IContainerInputHandler {
|
||||
|
||||
static final String KEY_IDENTIFIER = "gui.tinkers_belt";
|
||||
public static void init() {
|
||||
API.addKeyBind(KEY_IDENTIFIER, 0);
|
||||
GuiContainerManager.addInputHandler(new BeltToggleFromGuiInputHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean keyTyped(GuiContainer guiContainer, char c, int i) {
|
||||
if (i == 0) {
|
||||
return false;
|
||||
}
|
||||
final int keyBinding = NEIClientConfig.getKeyBinding(KEY_IDENTIFIER);
|
||||
if (keyBinding == 0 || i != keyBinding) {
|
||||
return false;
|
||||
}
|
||||
return ArmorControls.doBeltSwapIfPossible();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKeyTyped(GuiContainer guiContainer, char c, int i) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean lastKeyTyped(GuiContainer guiContainer, char c, int i) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(GuiContainer guiContainer, int i, int i1, int i2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMouseClicked(GuiContainer guiContainer, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMouseUp(GuiContainer guiContainer, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseScrolled(GuiContainer guiContainer, int i, int i1, int i2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMouseScrolled(GuiContainer guiContainer, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMouseDragged(GuiContainer guiContainer, int i, int i1, int i2, long l) {
|
||||
|
||||
}
|
||||
}
|
||||
package tconstruct.plugins.nei;
|
||||
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
import codechicken.nei.guihook.IContainerInputHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import tconstruct.client.ArmorControls;
|
||||
|
||||
public class BeltToggleFromGuiInputHandler implements IContainerInputHandler {
|
||||
|
||||
static final String KEY_IDENTIFIER = "gui.tinkers_belt";
|
||||
|
||||
public static void init() {
|
||||
API.addKeyBind(KEY_IDENTIFIER, 0);
|
||||
GuiContainerManager.addInputHandler(new BeltToggleFromGuiInputHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean keyTyped(GuiContainer guiContainer, char c, int i) {
|
||||
if (i == 0) {
|
||||
return false;
|
||||
}
|
||||
final int keyBinding = NEIClientConfig.getKeyBinding(KEY_IDENTIFIER);
|
||||
if (keyBinding == 0 || i != keyBinding) {
|
||||
return false;
|
||||
}
|
||||
return ArmorControls.doBeltSwapIfPossible();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKeyTyped(GuiContainer guiContainer, char c, int i) {}
|
||||
|
||||
@Override
|
||||
public boolean lastKeyTyped(GuiContainer guiContainer, char c, int i) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(GuiContainer guiContainer, int i, int i1, int i2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMouseClicked(GuiContainer guiContainer, int i, int i1, int i2) {}
|
||||
|
||||
@Override
|
||||
public void onMouseUp(GuiContainer guiContainer, int i, int i1, int i2) {}
|
||||
|
||||
@Override
|
||||
public boolean mouseScrolled(GuiContainer guiContainer, int i, int i1, int i2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMouseScrolled(GuiContainer guiContainer, int i, int i1, int i2) {}
|
||||
|
||||
@Override
|
||||
public void onMouseDragged(GuiContainer guiContainer, int i, int i1, int i2, long l) {}
|
||||
}
|
||||
@@ -11,16 +11,14 @@ import tconstruct.tools.logic.CraftingStationLogic;
|
||||
/**
|
||||
* Modified copy of DefaultOverlayHandler from NotEnoughItems
|
||||
*/
|
||||
public class CraftingStationOverlayHandler extends DefaultOverlayHandler
|
||||
{
|
||||
public class CraftingStationOverlayHandler extends DefaultOverlayHandler {
|
||||
@Override
|
||||
public void overlayRecipe(GuiContainer gui, IRecipeHandler recipe, int recipeIndex, boolean shift) {
|
||||
if(gui.inventorySlots instanceof CraftingStationContainer) {
|
||||
final CraftingStationContainer station = (CraftingStationContainer)gui.inventorySlots;
|
||||
if(station.logic.chest != null && gui instanceof CraftingStationGui) {
|
||||
offsetx = 5 + ((CraftingStationGui)gui).getChestWidth();
|
||||
}
|
||||
else {
|
||||
if (gui.inventorySlots instanceof CraftingStationContainer) {
|
||||
final CraftingStationContainer station = (CraftingStationContainer) gui.inventorySlots;
|
||||
if (station.logic.chest != null && gui instanceof CraftingStationGui) {
|
||||
offsetx = 5 + ((CraftingStationGui) gui).getChestWidth();
|
||||
} else {
|
||||
offsetx = 5;
|
||||
}
|
||||
}
|
||||
@@ -30,12 +28,10 @@ public class CraftingStationOverlayHandler extends DefaultOverlayHandler
|
||||
|
||||
@Override
|
||||
public boolean canMoveFrom(Slot slot, GuiContainer gui) {
|
||||
if(gui.inventorySlots instanceof CraftingStationContainer) {
|
||||
if (gui.inventorySlots instanceof CraftingStationContainer) {
|
||||
CraftingStationLogic logic = ((CraftingStationContainer) gui.inventorySlots).logic;
|
||||
if(logic.chest != null && slot.inventory == logic.chest.get())
|
||||
return true;
|
||||
if(logic.doubleChest != null && slot.inventory == logic.doubleChest.get())
|
||||
return true;
|
||||
if (logic.chest != null && slot.inventory == logic.chest.get()) return true;
|
||||
if (logic.doubleChest != null && slot.inventory == logic.doubleChest.get()) return true;
|
||||
}
|
||||
|
||||
return super.canMoveFrom(slot, gui);
|
||||
|
||||
@@ -3,16 +3,15 @@ package tconstruct.plugins.nei;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.api.IStackPositioner;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import java.util.ArrayList;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.tools.gui.CraftingStationGui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class CraftingStationStackPositioner implements IStackPositioner {
|
||||
|
||||
@Override
|
||||
public ArrayList<PositionedStack> positionStacks (ArrayList<PositionedStack> stacks) {
|
||||
public ArrayList<PositionedStack> positionStacks(ArrayList<PositionedStack> stacks) {
|
||||
|
||||
if (Minecraft.getMinecraft().currentScreen instanceof GuiRecipe) {
|
||||
GuiRecipe recipeGui = (GuiRecipe) Minecraft.getMinecraft().currentScreen;
|
||||
@@ -35,5 +34,4 @@ public class CraftingStationStackPositioner implements IStackPositioner {
|
||||
|
||||
return stacks;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +1,13 @@
|
||||
package tconstruct.plugins.nei;
|
||||
|
||||
import tconstruct.tools.gui.CraftingStationGui;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
import tconstruct.tools.gui.CraftingStationGui;
|
||||
|
||||
public class NEITConstructConfig implements IConfigureNEI
|
||||
{
|
||||
public class NEITConstructConfig implements IConfigureNEI {
|
||||
|
||||
@Override
|
||||
public void loadConfig ()
|
||||
{
|
||||
public void loadConfig() {
|
||||
API.registerGuiOverlay(CraftingStationGui.class, "crafting", new CraftingStationStackPositioner());
|
||||
API.registerGuiOverlayHandler(CraftingStationGui.class, new CraftingStationOverlayHandler(), "crafting");
|
||||
|
||||
@@ -24,21 +22,17 @@ public class NEITConstructConfig implements IConfigureNEI
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName ()
|
||||
{
|
||||
public String getName() {
|
||||
return "TConstruct";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion ()
|
||||
{
|
||||
public String getVersion() {
|
||||
return "${version}";
|
||||
}
|
||||
|
||||
private static void registerHandler (RecipeHandlerBase handler)
|
||||
{
|
||||
private static void registerHandler(RecipeHandlerBase handler) {
|
||||
API.registerRecipeHandler(handler);
|
||||
API.registerUsageHandler(handler);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,46 +1,36 @@
|
||||
package tconstruct.plugins.nei;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import tconstruct.library.crafting.AlloyMix;
|
||||
import tconstruct.library.crafting.Smeltery;
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
|
||||
public class RecipeHandlerAlloying extends RecipeHandlerBase
|
||||
{
|
||||
public class RecipeHandlerAlloying extends RecipeHandlerBase {
|
||||
|
||||
public static final Rectangle OUTPUT_TANK = new Rectangle(118, 9, 18, 32);
|
||||
|
||||
public class CachedAlloyingRecipe extends CachedBaseRecipe
|
||||
{
|
||||
public class CachedAlloyingRecipe extends CachedBaseRecipe {
|
||||
private List<FluidTankElement> fluidTanks;
|
||||
private int minAmount;
|
||||
|
||||
public CachedAlloyingRecipe(AlloyMix recipe)
|
||||
{
|
||||
public CachedAlloyingRecipe(AlloyMix recipe) {
|
||||
this.fluidTanks = new ArrayList<FluidTankElement>();
|
||||
|
||||
int maxAmount = recipe.mixers.get(0).amount;
|
||||
int mult = 1;
|
||||
this.minAmount = maxAmount;
|
||||
for (FluidStack stack : recipe.mixers)
|
||||
{
|
||||
if (stack.amount > maxAmount)
|
||||
{
|
||||
for (FluidStack stack : recipe.mixers) {
|
||||
if (stack.amount > maxAmount) {
|
||||
maxAmount = stack.amount;
|
||||
}
|
||||
if (stack.amount < this.minAmount)
|
||||
{
|
||||
if (stack.amount < this.minAmount) {
|
||||
this.minAmount = stack.amount;
|
||||
}
|
||||
}
|
||||
@@ -50,15 +40,13 @@ public class RecipeHandlerAlloying extends RecipeHandlerBase
|
||||
|
||||
int width = 36 / recipe.mixers.size();
|
||||
int counter = 0;
|
||||
for (FluidStack stack : recipe.mixers)
|
||||
{
|
||||
if (counter == recipe.mixers.size() - 1)
|
||||
{
|
||||
tank = new FluidTankElement(new Rectangle(21 + width * counter, 9, 36 - width * counter, 32), maxAmount * mult, stack);
|
||||
}
|
||||
else
|
||||
{
|
||||
tank = new FluidTankElement(new Rectangle(21 + width * counter, 9, width, 32), maxAmount * mult, stack);
|
||||
for (FluidStack stack : recipe.mixers) {
|
||||
if (counter == recipe.mixers.size() - 1) {
|
||||
tank = new FluidTankElement(
|
||||
new Rectangle(21 + width * counter, 9, 36 - width * counter, 32), maxAmount * mult, stack);
|
||||
} else {
|
||||
tank = new FluidTankElement(
|
||||
new Rectangle(21 + width * counter, 9, width, 32), maxAmount * mult, stack);
|
||||
}
|
||||
tank.fluid.amount *= mult;
|
||||
this.fluidTanks.add(tank);
|
||||
@@ -67,102 +55,81 @@ public class RecipeHandlerAlloying extends RecipeHandlerBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getIngredient ()
|
||||
{
|
||||
public PositionedStack getIngredient() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult ()
|
||||
{
|
||||
public PositionedStack getResult() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTankElement> getFluidTanks ()
|
||||
{
|
||||
public List<FluidTankElement> getFluidTanks() {
|
||||
return this.fluidTanks;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName ()
|
||||
{
|
||||
public String getRecipeName() {
|
||||
return StatCollector.translateToLocal("tconstruct.nei.alloying");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeID ()
|
||||
{
|
||||
public String getRecipeID() {
|
||||
return "tconstruct.smeltery.alloying";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture ()
|
||||
{
|
||||
public String getGuiTexture() {
|
||||
return "tinker:textures/gui/nei/smeltery.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects ()
|
||||
{
|
||||
this.transferRects.add(new RecipeTransferRect(new Rectangle(76, 21, 22, 15), this.getRecipeID(), new Object[0]));
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(
|
||||
new RecipeTransferRect(new Rectangle(76, 21, 22, 15), this.getRecipeID(), new Object[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground (int recipe)
|
||||
{
|
||||
public void drawBackground(int recipe) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(this.getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(0, 0, 0, 62, 160, 65);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes (String outputId, Object... results)
|
||||
{
|
||||
if (outputId.equals(this.getRecipeID()))
|
||||
{
|
||||
for (AlloyMix recipe : Smeltery.getAlloyList())
|
||||
{
|
||||
if (!recipe.mixers.isEmpty())
|
||||
{
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals(this.getRecipeID())) {
|
||||
for (AlloyMix recipe : Smeltery.getAlloyList()) {
|
||||
if (!recipe.mixers.isEmpty()) {
|
||||
this.arecipes.add(new CachedAlloyingRecipe(recipe));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes (FluidStack result)
|
||||
{
|
||||
for (AlloyMix recipe : Smeltery.getAlloyList())
|
||||
{
|
||||
if (areFluidsEqual(recipe.result, result) && !recipe.mixers.isEmpty())
|
||||
{
|
||||
public void loadCraftingRecipes(FluidStack result) {
|
||||
for (AlloyMix recipe : Smeltery.getAlloyList()) {
|
||||
if (areFluidsEqual(recipe.result, result) && !recipe.mixers.isEmpty()) {
|
||||
this.arecipes.add(new CachedAlloyingRecipe(recipe));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes (FluidStack ingredient)
|
||||
{
|
||||
for (Iterator<AlloyMix> i = Smeltery.getAlloyList().iterator(); i.hasNext();)
|
||||
{
|
||||
public void loadUsageRecipes(FluidStack ingredient) {
|
||||
for (Iterator<AlloyMix> i = Smeltery.getAlloyList().iterator(); i.hasNext(); ) {
|
||||
AlloyMix recipe = i.next();
|
||||
for (FluidStack liquid : recipe.mixers)
|
||||
{
|
||||
if (areFluidsEqual(liquid, ingredient) && !recipe.mixers.isEmpty())
|
||||
{
|
||||
for (FluidStack liquid : recipe.mixers) {
|
||||
if (areFluidsEqual(liquid, ingredient) && !recipe.mixers.isEmpty()) {
|
||||
this.arecipes.add(new CachedAlloyingRecipe(recipe));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,16 @@
|
||||
package tconstruct.plugins.nei;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
import codechicken.nei.recipe.GuiCraftingRecipe;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.GuiUsageRecipe;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
@@ -17,122 +23,82 @@ import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidBlock;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
import codechicken.nei.recipe.GuiCraftingRecipe;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.GuiUsageRecipe;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
public abstract class RecipeHandlerBase extends TemplateRecipeHandler {
|
||||
|
||||
public abstract class RecipeHandlerBase extends TemplateRecipeHandler
|
||||
{
|
||||
|
||||
public abstract class CachedBaseRecipe extends CachedRecipe
|
||||
{
|
||||
public List<FluidTankElement> getFluidTanks ()
|
||||
{
|
||||
public abstract class CachedBaseRecipe extends CachedRecipe {
|
||||
public List<FluidTankElement> getFluidTanks() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract String getRecipeID ();
|
||||
public abstract String getRecipeID();
|
||||
|
||||
public void loadCraftingRecipes (FluidStack result)
|
||||
{
|
||||
}
|
||||
public void loadCraftingRecipes(FluidStack result) {}
|
||||
|
||||
public void loadUsageRecipes (FluidStack ingredient)
|
||||
{
|
||||
}
|
||||
public void loadUsageRecipes(FluidStack ingredient) {}
|
||||
|
||||
@Override
|
||||
public void drawForeground (int recipe)
|
||||
{
|
||||
public void drawForeground(int recipe) {
|
||||
super.drawForeground(recipe);
|
||||
this.drawFluidTanks(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes (String outputId, Object... results)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (outputId.equals("liquid") && results.length == 1 && results[0] instanceof FluidStack)
|
||||
{
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
try {
|
||||
if (outputId.equals("liquid") && results.length == 1 && results[0] instanceof FluidStack) {
|
||||
this.loadCraftingRecipes((FluidStack) results[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
catch (Throwable ex)
|
||||
{
|
||||
} catch (Throwable ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes (ItemStack result)
|
||||
{
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
FluidStack fluid = getFluidStack(result);
|
||||
if (fluid != null)
|
||||
{
|
||||
if (fluid != null) {
|
||||
this.loadCraftingRecipes(fluid);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes (String inputId, Object... ingredients)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (inputId.equals("liquid") && ingredients.length == 1 && ingredients[0] instanceof FluidStack)
|
||||
{
|
||||
public void loadUsageRecipes(String inputId, Object... ingredients) {
|
||||
try {
|
||||
if (inputId.equals("liquid") && ingredients.length == 1 && ingredients[0] instanceof FluidStack) {
|
||||
this.loadUsageRecipes((FluidStack) ingredients[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
super.loadUsageRecipes(inputId, ingredients);
|
||||
}
|
||||
}
|
||||
catch (Throwable ex)
|
||||
{
|
||||
} catch (Throwable ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes (ItemStack ingred)
|
||||
{
|
||||
public void loadUsageRecipes(ItemStack ingred) {
|
||||
FluidStack fluid = getFluidStack(ingred);
|
||||
if (fluid != null)
|
||||
{
|
||||
if (fluid != null) {
|
||||
this.loadUsageRecipes(fluid);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleTooltip (GuiRecipe guiRecipe, List<String> currenttip, int recipe)
|
||||
{
|
||||
public List<String> handleTooltip(GuiRecipe guiRecipe, List<String> currenttip, int recipe) {
|
||||
super.handleTooltip(guiRecipe, currenttip, recipe);
|
||||
CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe);
|
||||
if (GuiContainerManager.shouldShowTooltip(guiRecipe))
|
||||
{
|
||||
if (GuiContainerManager.shouldShowTooltip(guiRecipe)) {
|
||||
Point mouse = GuiDraw.getMousePosition();
|
||||
Point offset = guiRecipe.getRecipePosition(recipe);
|
||||
Point relMouse = new Point(mouse.x - guiRecipe.guiLeft - offset.x, mouse.y - guiRecipe.guiTop - offset.y);
|
||||
|
||||
if (crecipe.getFluidTanks() != null)
|
||||
{
|
||||
for (FluidTankElement tank : crecipe.getFluidTanks())
|
||||
{
|
||||
if (tank.position.contains(relMouse))
|
||||
{
|
||||
if (crecipe.getFluidTanks() != null) {
|
||||
for (FluidTankElement tank : crecipe.getFluidTanks()) {
|
||||
if (tank.position.contains(relMouse)) {
|
||||
tank.handleTooltip(currenttip);
|
||||
}
|
||||
}
|
||||
@@ -142,19 +108,13 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean keyTyped (GuiRecipe gui, char keyChar, int keyCode, int recipe)
|
||||
{
|
||||
if (keyCode == NEIClientConfig.getKeyBinding("gui.recipe"))
|
||||
{
|
||||
if (this.transferFluidTank(gui, recipe, false))
|
||||
{
|
||||
public boolean keyTyped(GuiRecipe gui, char keyChar, int keyCode, int recipe) {
|
||||
if (keyCode == NEIClientConfig.getKeyBinding("gui.recipe")) {
|
||||
if (this.transferFluidTank(gui, recipe, false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (keyCode == NEIClientConfig.getKeyBinding("gui.usage"))
|
||||
{
|
||||
if (this.transferFluidTank(gui, recipe, true))
|
||||
{
|
||||
} else if (keyCode == NEIClientConfig.getKeyBinding("gui.usage")) {
|
||||
if (this.transferFluidTank(gui, recipe, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -162,51 +122,35 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked (GuiRecipe gui, int button, int recipe)
|
||||
{
|
||||
if (button == 0)
|
||||
{
|
||||
if (this.transferFluidTank(gui, recipe, false))
|
||||
{
|
||||
public boolean mouseClicked(GuiRecipe gui, int button, int recipe) {
|
||||
if (button == 0) {
|
||||
if (this.transferFluidTank(gui, recipe, false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (button == 1)
|
||||
{
|
||||
if (this.transferFluidTank(gui, recipe, true))
|
||||
{
|
||||
} else if (button == 1) {
|
||||
if (this.transferFluidTank(gui, recipe, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return super.mouseClicked(gui, button, recipe);
|
||||
}
|
||||
|
||||
protected boolean transferFluidTank (GuiRecipe guiRecipe, int recipe, boolean usage)
|
||||
{
|
||||
protected boolean transferFluidTank(GuiRecipe guiRecipe, int recipe, boolean usage) {
|
||||
CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe);
|
||||
Point mouse = GuiDraw.getMousePosition();
|
||||
Point offset = guiRecipe.getRecipePosition(recipe);
|
||||
Point relMouse = new Point(mouse.x - guiRecipe.guiLeft - offset.x, mouse.y - guiRecipe.guiTop - offset.y);
|
||||
|
||||
if (crecipe.getFluidTanks() != null)
|
||||
{
|
||||
for (FluidTankElement tank : crecipe.getFluidTanks())
|
||||
{
|
||||
if (tank.position.contains(relMouse))
|
||||
{
|
||||
if ((tank.fluid != null) && tank.fluid.amount > 0)
|
||||
{
|
||||
if (usage)
|
||||
{
|
||||
if (!GuiUsageRecipe.openRecipeGui("liquid", new Object[] { tank.fluid }))
|
||||
{
|
||||
if (crecipe.getFluidTanks() != null) {
|
||||
for (FluidTankElement tank : crecipe.getFluidTanks()) {
|
||||
if (tank.position.contains(relMouse)) {
|
||||
if ((tank.fluid != null) && tank.fluid.amount > 0) {
|
||||
if (usage) {
|
||||
if (!GuiUsageRecipe.openRecipeGui("liquid", new Object[] {tank.fluid})) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!GuiCraftingRecipe.openRecipeGui("liquid", new Object[] { tank.fluid }))
|
||||
{
|
||||
} else {
|
||||
if (!GuiCraftingRecipe.openRecipeGui("liquid", new Object[] {tank.fluid})) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -219,79 +163,63 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
public void drawFluidTanks (int recipe)
|
||||
{
|
||||
public void drawFluidTanks(int recipe) {
|
||||
CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe);
|
||||
if (crecipe.getFluidTanks() != null)
|
||||
{
|
||||
for (FluidTankElement fluidTank : crecipe.getFluidTanks())
|
||||
{
|
||||
if (crecipe.getFluidTanks() != null) {
|
||||
for (FluidTankElement fluidTank : crecipe.getFluidTanks()) {
|
||||
fluidTank.draw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static List getSingleList (Object o)
|
||||
{
|
||||
public static List getSingleList(Object o) {
|
||||
List list = new ArrayList();
|
||||
list.add(o);
|
||||
return list;
|
||||
}
|
||||
|
||||
public static FluidStack getFluidStack (ItemStack stack)
|
||||
{
|
||||
if (stack == null)
|
||||
{
|
||||
public static FluidStack getFluidStack(ItemStack stack) {
|
||||
if (stack == null) {
|
||||
return null;
|
||||
}
|
||||
Item item = stack.getItem();
|
||||
FluidStack fluidStack = null;
|
||||
if ((item instanceof IFluidContainerItem))
|
||||
{
|
||||
if ((item instanceof IFluidContainerItem)) {
|
||||
fluidStack = ((IFluidContainerItem) item).getFluid(stack);
|
||||
}
|
||||
if (fluidStack == null)
|
||||
{
|
||||
if (fluidStack == null) {
|
||||
fluidStack = FluidContainerRegistry.getFluidForFilledItem(stack);
|
||||
}
|
||||
if ((fluidStack == null) && (Block.getBlockFromItem(stack.getItem()) instanceof IFluidBlock))
|
||||
{
|
||||
if ((fluidStack == null) && (Block.getBlockFromItem(stack.getItem()) instanceof IFluidBlock)) {
|
||||
Fluid fluid = ((IFluidBlock) Block.getBlockFromItem(stack.getItem())).getFluid();
|
||||
if (fluid != null)
|
||||
{
|
||||
if (fluid != null) {
|
||||
return new FluidStack(fluid, 1000);
|
||||
}
|
||||
}
|
||||
return fluidStack;
|
||||
}
|
||||
|
||||
public static boolean areFluidsEqual (FluidStack fluidStack1, FluidStack fluidStack2)
|
||||
{
|
||||
if (fluidStack1 == null || fluidStack2 == null)
|
||||
{
|
||||
public static boolean areFluidsEqual(FluidStack fluidStack1, FluidStack fluidStack2) {
|
||||
if (fluidStack1 == null || fluidStack2 == null) {
|
||||
return false;
|
||||
}
|
||||
return fluidStack1.isFluidEqual(fluidStack2);
|
||||
}
|
||||
|
||||
public static class FluidTankElement
|
||||
{
|
||||
public static class FluidTankElement {
|
||||
public Rectangle position;
|
||||
public FluidStack fluid;
|
||||
public int capacity;
|
||||
public boolean flowingTexture = false;
|
||||
|
||||
public FluidTankElement(Rectangle position, int capacity, FluidStack fluid)
|
||||
{
|
||||
public FluidTankElement(Rectangle position, int capacity, FluidStack fluid) {
|
||||
this.position = position;
|
||||
this.capacity = capacity;
|
||||
this.fluid = fluid;
|
||||
}
|
||||
|
||||
public List<String> handleTooltip (List<String> currenttip)
|
||||
{
|
||||
if (this.fluid == null || this.fluid.getFluid() == null || this.fluid.amount <= 0)
|
||||
{
|
||||
public List<String> handleTooltip(List<String> currenttip) {
|
||||
if (this.fluid == null || this.fluid.getFluid() == null || this.fluid.amount <= 0) {
|
||||
return currenttip;
|
||||
}
|
||||
currenttip.add(this.fluid.getLocalizedName());
|
||||
@@ -299,23 +227,16 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
public void draw ()
|
||||
{
|
||||
if (this.fluid == null || this.fluid.getFluid() == null || this.fluid.amount <= 0)
|
||||
{
|
||||
public void draw() {
|
||||
if (this.fluid == null || this.fluid.getFluid() == null || this.fluid.amount <= 0) {
|
||||
return;
|
||||
}
|
||||
IIcon fluidIcon = null;
|
||||
if (this.flowingTexture && this.fluid.getFluid().getFlowingIcon() != null)
|
||||
{
|
||||
if (this.flowingTexture && this.fluid.getFluid().getFlowingIcon() != null) {
|
||||
fluidIcon = this.fluid.getFluid().getFlowingIcon();
|
||||
}
|
||||
else if (this.fluid.getFluid().getStillIcon() != null)
|
||||
{
|
||||
} else if (this.fluid.getFluid().getStillIcon() != null) {
|
||||
fluidIcon = this.fluid.getFluid().getStillIcon();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -324,13 +245,12 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler
|
||||
GL11.glColor3ub((byte) (color >> 16 & 0xFF), (byte) (color >> 8 & 0xFF), (byte) (color & 0xFF));
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
int amount = Math.max(Math.min(this.position.height, this.fluid.amount * this.position.height / this.capacity), 1);
|
||||
int amount = Math.max(
|
||||
Math.min(this.position.height, this.fluid.amount * this.position.height / this.capacity), 1);
|
||||
int posY = this.position.y + this.position.height - amount;
|
||||
|
||||
for (int i = 0; i < this.position.width; i += 16)
|
||||
{
|
||||
for (int j = 0; j < amount; j += 16)
|
||||
{
|
||||
for (int i = 0; i < this.position.width; i += 16) {
|
||||
for (int j = 0; j < amount; j += 16) {
|
||||
int drawWidth = Math.min(this.position.width - i, 16);
|
||||
int drawHeight = Math.min(amount - j, 16);
|
||||
|
||||
@@ -344,9 +264,16 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(drawX, drawY + drawHeight, 0, minU, minV + (maxV - minV) * drawHeight / 16F);
|
||||
tessellator.addVertexWithUV(drawX + drawWidth, drawY + drawHeight, 0, minU + (maxU - minU) * drawWidth / 16F, minV + (maxV - minV) * drawHeight / 16F);
|
||||
tessellator.addVertexWithUV(drawX + drawWidth, drawY, 0, minU + (maxU - minU) * drawWidth / 16F, minV);
|
||||
tessellator.addVertexWithUV(
|
||||
drawX, drawY + drawHeight, 0, minU, minV + (maxV - minV) * drawHeight / 16F);
|
||||
tessellator.addVertexWithUV(
|
||||
drawX + drawWidth,
|
||||
drawY + drawHeight,
|
||||
0,
|
||||
minU + (maxU - minU) * drawWidth / 16F,
|
||||
minV + (maxV - minV) * drawHeight / 16F);
|
||||
tessellator.addVertexWithUV(
|
||||
drawX + drawWidth, drawY, 0, minU + (maxU - minU) * drawWidth / 16F, minV);
|
||||
tessellator.addVertexWithUV(drawX, drawY, 0, minU, minV);
|
||||
tessellator.draw();
|
||||
}
|
||||
@@ -354,7 +281,5 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,57 +1,47 @@
|
||||
package tconstruct.plugins.nei;
|
||||
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.library.crafting.CastingRecipe;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
|
||||
public abstract class RecipeHandlerCastingBase extends RecipeHandlerBase
|
||||
{
|
||||
public abstract class RecipeHandlerCastingBase extends RecipeHandlerBase {
|
||||
public static final Rectangle MOLTEN_FLOW = new Rectangle(60, 8, 6, 11);
|
||||
public static final Rectangle MOLTEN_FLOW_NO_ITEM = new Rectangle(60, 8, 6, 27);
|
||||
|
||||
public class CachedCastingRecipe extends CachedBaseRecipe
|
||||
{
|
||||
public class CachedCastingRecipe extends CachedBaseRecipe {
|
||||
private List<PositionedStack> resources;
|
||||
private FluidTankElement metal;
|
||||
private PositionedStack output = null;
|
||||
|
||||
public CachedCastingRecipe(CastingRecipe recipe)
|
||||
{
|
||||
public CachedCastingRecipe(CastingRecipe recipe) {
|
||||
this.metal = new FluidTankElement(MOLTEN_FLOW, recipe.castingMetal.amount, recipe.castingMetal);
|
||||
this.metal.flowingTexture = true;
|
||||
this.resources = new ArrayList<PositionedStack>();
|
||||
if (recipe.cast != null)
|
||||
{
|
||||
if (recipe.cast != null) {
|
||||
this.resources.add(new PositionedStack(recipe.cast, 55, 19));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.metal.position = MOLTEN_FLOW_NO_ITEM;
|
||||
}
|
||||
this.output = new PositionedStack(recipe.output, 110, 18);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients ()
|
||||
{
|
||||
public List<PositionedStack> getIngredients() {
|
||||
return getCycledIngredients(cycleticks / 20, this.resources);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult ()
|
||||
{
|
||||
public PositionedStack getResult() {
|
||||
return this.output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTankElement> getFluidTanks ()
|
||||
{
|
||||
public List<FluidTankElement> getFluidTanks() {
|
||||
List<FluidTankElement> res = new ArrayList<FluidTankElement>();
|
||||
res.add(this.metal);
|
||||
return res;
|
||||
@@ -59,60 +49,47 @@ public abstract class RecipeHandlerCastingBase extends RecipeHandlerBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeID ()
|
||||
{
|
||||
public String getRecipeID() {
|
||||
return "tconstruct.smeltery.casting";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture ()
|
||||
{
|
||||
public String getGuiTexture() {
|
||||
return "tinker:textures/gui/nei/casting.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects ()
|
||||
{
|
||||
this.transferRects.add(new RecipeTransferRect(new Rectangle(76, 18, 22, 15), this.getRecipeID(), new Object[0]));
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(
|
||||
new RecipeTransferRect(new Rectangle(76, 18, 22, 15), this.getRecipeID(), new Object[0]));
|
||||
}
|
||||
|
||||
public abstract List<CastingRecipe> getCastingRecipes ();
|
||||
public abstract List<CastingRecipe> getCastingRecipes();
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes (String outputId, Object... results)
|
||||
{
|
||||
if (outputId.equals(this.getRecipeID()))
|
||||
{
|
||||
for (CastingRecipe recipe : this.getCastingRecipes())
|
||||
{
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals(this.getRecipeID())) {
|
||||
for (CastingRecipe recipe : this.getCastingRecipes()) {
|
||||
this.arecipes.add(new CachedCastingRecipe(recipe));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes (ItemStack result)
|
||||
{
|
||||
for (CastingRecipe recipe : getCastingRecipes())
|
||||
{
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(result, recipe.getResult()))
|
||||
{
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
for (CastingRecipe recipe : getCastingRecipes()) {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(result, recipe.getResult())) {
|
||||
this.arecipes.add(new CachedCastingRecipe(recipe));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes (ItemStack ingred)
|
||||
{
|
||||
for (CastingRecipe recipe : getCastingRecipes())
|
||||
{
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(recipe.cast, ingred))
|
||||
{
|
||||
public void loadUsageRecipes(ItemStack ingred) {
|
||||
for (CastingRecipe recipe : getCastingRecipes()) {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(recipe.cast, ingred)) {
|
||||
CachedCastingRecipe irecipe = new CachedCastingRecipe(recipe);
|
||||
irecipe.setIngredientPermutation(irecipe.resources, ingred);
|
||||
this.arecipes.add(irecipe);
|
||||
@@ -121,15 +98,11 @@ public abstract class RecipeHandlerCastingBase extends RecipeHandlerBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes (FluidStack ingredient)
|
||||
{
|
||||
for (CastingRecipe recipe : getCastingRecipes())
|
||||
{
|
||||
if (areFluidsEqual(recipe.castingMetal, ingredient))
|
||||
{
|
||||
public void loadUsageRecipes(FluidStack ingredient) {
|
||||
for (CastingRecipe recipe : getCastingRecipes()) {
|
||||
if (areFluidsEqual(recipe.castingMetal, ingredient)) {
|
||||
this.arecipes.add(new CachedCastingRecipe(recipe));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,43 +1,34 @@
|
||||
package tconstruct.plugins.nei;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.CastingRecipe;
|
||||
import tconstruct.library.crafting.LiquidCasting;
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
|
||||
public class RecipeHandlerCastingBasin extends RecipeHandlerCastingBase
|
||||
{
|
||||
public class RecipeHandlerCastingBasin extends RecipeHandlerCastingBase {
|
||||
|
||||
@Override
|
||||
public String getRecipeName ()
|
||||
{
|
||||
public String getRecipeName() {
|
||||
return StatCollector.translateToLocal("tconstruct.nei.castingbasin");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground (int recipe)
|
||||
{
|
||||
public void drawBackground(int recipe) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(this.getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(30, 0, 0, 62, 112, 55);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CastingRecipe> getCastingRecipes ()
|
||||
{
|
||||
public List<CastingRecipe> getCastingRecipes() {
|
||||
LiquidCasting casting = TConstructRegistry.getBasinCasting();
|
||||
if (casting == null)
|
||||
{
|
||||
if (casting == null) {
|
||||
return new ArrayList<CastingRecipe>();
|
||||
}
|
||||
return casting.getCastingRecipes();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,43 +1,34 @@
|
||||
package tconstruct.plugins.nei;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.CastingRecipe;
|
||||
import tconstruct.library.crafting.LiquidCasting;
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
|
||||
public class RecipeHandlerCastingTable extends RecipeHandlerCastingBase
|
||||
{
|
||||
public class RecipeHandlerCastingTable extends RecipeHandlerCastingBase {
|
||||
|
||||
@Override
|
||||
public String getRecipeName ()
|
||||
{
|
||||
public String getRecipeName() {
|
||||
return StatCollector.translateToLocal("tconstruct.nei.castingtable");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground (int recipe)
|
||||
{
|
||||
public void drawBackground(int recipe) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(this.getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(30, 0, 0, 0, 112, 55);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CastingRecipe> getCastingRecipes ()
|
||||
{
|
||||
public List<CastingRecipe> getCastingRecipes() {
|
||||
LiquidCasting casting = TConstructRegistry.getTableCasting();
|
||||
if (casting == null)
|
||||
{
|
||||
if (casting == null) {
|
||||
return new ArrayList<CastingRecipe>();
|
||||
}
|
||||
return casting.getCastingRecipes();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,128 +1,101 @@
|
||||
package tconstruct.plugins.nei;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import tconstruct.library.crafting.DryingRackRecipes;
|
||||
import tconstruct.library.crafting.DryingRackRecipes.DryingRecipe;
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import java.awt.Rectangle;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import tconstruct.library.crafting.DryingRackRecipes;
|
||||
import tconstruct.library.crafting.DryingRackRecipes.DryingRecipe;
|
||||
|
||||
public class RecipeHandlerDryingRack extends RecipeHandlerBase
|
||||
{
|
||||
public class RecipeHandlerDryingRack extends RecipeHandlerBase {
|
||||
|
||||
public class CachedDryingRackRecipe extends CachedBaseRecipe
|
||||
{
|
||||
public class CachedDryingRackRecipe extends CachedBaseRecipe {
|
||||
|
||||
public PositionedStack input;
|
||||
public PositionedStack output;
|
||||
public int time;
|
||||
|
||||
public CachedDryingRackRecipe(DryingRecipe drying)
|
||||
{
|
||||
public CachedDryingRackRecipe(DryingRecipe drying) {
|
||||
this.input = new PositionedStack(drying.input, 44, 18);
|
||||
this.output = new PositionedStack(drying.result, 98, 18);
|
||||
this.time = drying.time;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getIngredient ()
|
||||
{
|
||||
public PositionedStack getIngredient() {
|
||||
return this.input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult ()
|
||||
{
|
||||
public PositionedStack getResult() {
|
||||
return this.output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName ()
|
||||
{
|
||||
public String getRecipeName() {
|
||||
return StatCollector.translateToLocal("tconstruct.nei.dryingrack");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeID ()
|
||||
{
|
||||
public String getRecipeID() {
|
||||
return "tconstruct.dryingrack";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects ()
|
||||
{
|
||||
this.transferRects.add(new RecipeTransferRect(new Rectangle(68, 20, 22, 15), this.getRecipeID(), new Object[0]));
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(
|
||||
new RecipeTransferRect(new Rectangle(68, 20, 22, 15), this.getRecipeID(), new Object[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture ()
|
||||
{
|
||||
public String getGuiTexture() {
|
||||
return "tinker:textures/gui/nei/dryingrack.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground (int recipe)
|
||||
{
|
||||
public void drawBackground(int recipe) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(this.getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(0, 0, 0, 0, 160, 65);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras (int recipe)
|
||||
{
|
||||
public void drawExtras(int recipe) {
|
||||
int time = ((CachedDryingRackRecipe) this.arecipes.get(recipe)).time;
|
||||
int seconds = time / 20;
|
||||
GuiDraw.drawStringC(time + " ticks (" + seconds + " secs)", 81, 40, 0x808080, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes (String outputId, Object... results)
|
||||
{
|
||||
if (outputId.equals(this.getRecipeID()))
|
||||
{
|
||||
for (DryingRecipe drying : DryingRackRecipes.recipes)
|
||||
{
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals(this.getRecipeID())) {
|
||||
for (DryingRecipe drying : DryingRackRecipes.recipes) {
|
||||
this.arecipes.add(new CachedDryingRackRecipe(drying));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes (ItemStack result)
|
||||
{
|
||||
for (DryingRecipe drying : DryingRackRecipes.recipes)
|
||||
{
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(drying.result, result))
|
||||
{
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
for (DryingRecipe drying : DryingRackRecipes.recipes) {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(drying.result, result)) {
|
||||
this.arecipes.add(new CachedDryingRackRecipe(drying));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes (ItemStack ingred)
|
||||
{
|
||||
for (DryingRecipe drying : DryingRackRecipes.recipes)
|
||||
{
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(drying.input, ingred))
|
||||
{
|
||||
public void loadUsageRecipes(ItemStack ingred) {
|
||||
for (DryingRecipe drying : DryingRackRecipes.recipes) {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(drying.input, ingred)) {
|
||||
this.arecipes.add(new CachedDryingRackRecipe(drying));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,36 +1,29 @@
|
||||
package tconstruct.plugins.nei;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import mantle.utils.ItemMetaWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import tconstruct.library.crafting.Smeltery;
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
|
||||
public class RecipeHandlerMelting extends RecipeHandlerBase
|
||||
{
|
||||
public class RecipeHandlerMelting extends RecipeHandlerBase {
|
||||
|
||||
public static final Rectangle MOLTEN_TANK = new Rectangle(115, 20, 18, 18);
|
||||
|
||||
public class CachedMeltingRecipe extends CachedBaseRecipe
|
||||
{
|
||||
public class CachedMeltingRecipe extends CachedBaseRecipe {
|
||||
private PositionedStack input;
|
||||
private int temperature;
|
||||
private FluidTankElement output;
|
||||
|
||||
public CachedMeltingRecipe(ItemStack input)
|
||||
{
|
||||
public CachedMeltingRecipe(ItemStack input) {
|
||||
this.input = new PositionedStack(input, 28, 21);
|
||||
this.temperature = Smeltery.getLiquifyTemperature(input);
|
||||
this.output = new FluidTankElement(MOLTEN_TANK, 1, Smeltery.getSmelteryResult(input));
|
||||
@@ -38,20 +31,17 @@ public class RecipeHandlerMelting extends RecipeHandlerBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getIngredient ()
|
||||
{
|
||||
public PositionedStack getIngredient() {
|
||||
return this.input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult ()
|
||||
{
|
||||
public PositionedStack getResult() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTankElement> getFluidTanks ()
|
||||
{
|
||||
public List<FluidTankElement> getFluidTanks() {
|
||||
List<FluidTankElement> tanks = new ArrayList<FluidTankElement>();
|
||||
tanks.add(this.output);
|
||||
return tanks;
|
||||
@@ -59,82 +49,66 @@ public class RecipeHandlerMelting extends RecipeHandlerBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName ()
|
||||
{
|
||||
public String getRecipeName() {
|
||||
return StatCollector.translateToLocal("tconstruct.nei.melting");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeID ()
|
||||
{
|
||||
public String getRecipeID() {
|
||||
return "tconstruct.smeltery.melting";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture ()
|
||||
{
|
||||
public String getGuiTexture() {
|
||||
return "tinker:textures/gui/nei/smeltery.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects ()
|
||||
{
|
||||
this.transferRects.add(new RecipeTransferRect(new Rectangle(72, 20, 16, 34), this.getRecipeID(), new Object[0]));
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(
|
||||
new RecipeTransferRect(new Rectangle(72, 20, 16, 34), this.getRecipeID(), new Object[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground (int recipe)
|
||||
{
|
||||
public void drawBackground(int recipe) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(this.getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(0, 0, 0, 0, 160, 55);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras (int recipe)
|
||||
{
|
||||
public void drawExtras(int recipe) {
|
||||
int temperature = ((CachedMeltingRecipe) this.arecipes.get(recipe)).temperature;
|
||||
GuiDraw.drawStringC(temperature + " C", 81, 9, 0x808080, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes (String outputId, Object... results)
|
||||
{
|
||||
if (outputId.equals(getRecipeID()))
|
||||
{
|
||||
for (ItemMetaWrapper key : Smeltery.getSmeltingList().keySet())
|
||||
{
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals(getRecipeID())) {
|
||||
for (ItemMetaWrapper key : Smeltery.getSmeltingList().keySet()) {
|
||||
this.arecipes.add(new CachedMeltingRecipe(new ItemStack(key.item, 1, key.meta)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes (FluidStack result)
|
||||
{
|
||||
for (Entry<ItemMetaWrapper, FluidStack> pair : Smeltery.getSmeltingList().entrySet())
|
||||
{
|
||||
if (areFluidsEqual(pair.getValue(), result))
|
||||
{
|
||||
public void loadCraftingRecipes(FluidStack result) {
|
||||
for (Entry<ItemMetaWrapper, FluidStack> pair :
|
||||
Smeltery.getSmeltingList().entrySet()) {
|
||||
if (areFluidsEqual(pair.getValue(), result)) {
|
||||
this.arecipes.add(new CachedMeltingRecipe(new ItemStack(pair.getKey().item, 1, pair.getKey().meta)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes (ItemStack ingred)
|
||||
{
|
||||
for (ItemMetaWrapper key : Smeltery.getSmeltingList().keySet())
|
||||
{
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(key.item, 1, key.meta), ingred))
|
||||
{
|
||||
public void loadUsageRecipes(ItemStack ingred) {
|
||||
for (ItemMetaWrapper key : Smeltery.getSmeltingList().keySet()) {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(key.item, 1, key.meta), ingred)) {
|
||||
this.arecipes.add(new CachedMeltingRecipe(new ItemStack(key.item, 1, key.meta)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +1,14 @@
|
||||
package tconstruct.plugins.nei;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.CastingRecipe;
|
||||
import tconstruct.library.crafting.PatternBuilder;
|
||||
@@ -23,35 +22,27 @@ import tconstruct.library.util.HarvestLevels;
|
||||
import tconstruct.library.util.IToolPart;
|
||||
import tconstruct.tools.items.ToolPart;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
|
||||
public class RecipeHandlerToolMaterials extends RecipeHandlerBase
|
||||
{
|
||||
public class RecipeHandlerToolMaterials extends RecipeHandlerBase {
|
||||
|
||||
public class CachedToolMaterialsRecipe extends CachedBaseRecipe
|
||||
{
|
||||
public class CachedToolMaterialsRecipe extends CachedBaseRecipe {
|
||||
|
||||
public List<PositionedStack> toolParts;
|
||||
public ToolMaterial material;
|
||||
public BowMaterial bowMaterial;
|
||||
public ArrowMaterial arrowMaterial;
|
||||
|
||||
public CachedToolMaterialsRecipe(List<ItemStack> toolParts, int materialID)
|
||||
{
|
||||
public CachedToolMaterialsRecipe(List<ItemStack> toolParts, int materialID) {
|
||||
this.toolParts = new ArrayList<PositionedStack>();
|
||||
for (ItemStack stack : toolParts)
|
||||
{
|
||||
for (ItemStack stack : toolParts) {
|
||||
this.toolParts.add(new PositionedStack(stack, 10, 10));
|
||||
}
|
||||
this.material = TConstructRegistry.getMaterial(materialID);
|
||||
}
|
||||
|
||||
public CachedToolMaterialsRecipe(List<ItemStack> toolParts, int materialID, boolean arrowBow)
|
||||
{
|
||||
public CachedToolMaterialsRecipe(List<ItemStack> toolParts, int materialID, boolean arrowBow) {
|
||||
this.toolParts = new ArrayList<PositionedStack>();
|
||||
for (ItemStack stack : toolParts)
|
||||
{
|
||||
for (ItemStack stack : toolParts) {
|
||||
this.toolParts.add(new PositionedStack(stack, 10, 10));
|
||||
}
|
||||
this.arrowMaterial = TConstructRegistry.getArrowMaterial(materialID);
|
||||
@@ -59,239 +50,265 @@ public class RecipeHandlerToolMaterials extends RecipeHandlerBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getIngredient ()
|
||||
{
|
||||
public PositionedStack getIngredient() {
|
||||
return this.toolParts.get((cycleticks / 20) % this.toolParts.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult ()
|
||||
{
|
||||
public PositionedStack getResult() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName ()
|
||||
{
|
||||
public String getRecipeName() {
|
||||
return StatCollector.translateToLocal("tconstruct.nei.toolmaterials");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeID ()
|
||||
{
|
||||
public String getRecipeID() {
|
||||
return "tconstruct.tools.materials";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture ()
|
||||
{
|
||||
public String getGuiTexture() {
|
||||
return "tinker:textures/gui/nei/toolmaterials.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int recipiesPerPage ()
|
||||
{
|
||||
public int recipiesPerPage() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground (int recipe)
|
||||
{
|
||||
public void drawBackground(int recipe) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(this.getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(0, 0, 0, 0, 160, 130);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects ()
|
||||
{
|
||||
this.transferRects.add(new RecipeTransferRect(new Rectangle(10, 30, 16, 16), this.getRecipeID(), new Object[0]));
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(
|
||||
new RecipeTransferRect(new Rectangle(10, 30, 16, 16), this.getRecipeID(), new Object[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras (int recipe)
|
||||
{
|
||||
public void drawExtras(int recipe) {
|
||||
CachedToolMaterialsRecipe crecipe = (CachedToolMaterialsRecipe) this.arecipes.get(recipe);
|
||||
if (crecipe.material != null)
|
||||
{
|
||||
if (crecipe.material != null) {
|
||||
GuiDraw.drawString(EnumChatFormatting.BOLD + crecipe.material.localizedName(), 35, 10, 0x404040, false);
|
||||
GuiDraw.drawString(StatCollector.translateToLocal("gui.partcrafter4") + crecipe.material.durability, 35, 20, 0x404040, false);
|
||||
GuiDraw.drawString(StatCollector.translateToLocal("gui.partcrafter5") + crecipe.material.handleModifier + "x", 35, 30, 0x404040, false);
|
||||
GuiDraw.drawString(StatCollector.translateToLocal("gui.partcrafter11") + Math.round(crecipe.material.durability * crecipe.material.handleModifier), 35, 40, 0x404040, false);
|
||||
GuiDraw.drawString(StatCollector.translateToLocal("gui.partcrafter6") + crecipe.material.miningspeed / 100F, 35, 50, 0x404040, false);
|
||||
GuiDraw.drawString(StatCollector.translateToLocal("gui.partcrafter7") + HarvestLevels.getHarvestLevelName(crecipe.material.harvestLevel), 35, 60, 0x404040, false);
|
||||
String heart = crecipe.material.attack == 2 ? StatCollector.translateToLocal("gui.partcrafter8") : StatCollector.translateToLocal("gui.partcrafter9");
|
||||
if (crecipe.material.attack() % 2 == 0)
|
||||
{
|
||||
GuiDraw.drawString(StatCollector.translateToLocal("gui.partcrafter10") + crecipe.material.attack / 2 + heart, 35, 70, 0x404040, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
GuiDraw.drawString(StatCollector.translateToLocal("gui.partcrafter10") + crecipe.material.attack / 2F + heart, 35, 70, 0x404040, false);
|
||||
GuiDraw.drawString(
|
||||
StatCollector.translateToLocal("gui.partcrafter4") + crecipe.material.durability,
|
||||
35,
|
||||
20,
|
||||
0x404040,
|
||||
false);
|
||||
GuiDraw.drawString(
|
||||
StatCollector.translateToLocal("gui.partcrafter5") + crecipe.material.handleModifier + "x",
|
||||
35,
|
||||
30,
|
||||
0x404040,
|
||||
false);
|
||||
GuiDraw.drawString(
|
||||
StatCollector.translateToLocal("gui.partcrafter11")
|
||||
+ Math.round(crecipe.material.durability * crecipe.material.handleModifier),
|
||||
35,
|
||||
40,
|
||||
0x404040,
|
||||
false);
|
||||
GuiDraw.drawString(
|
||||
StatCollector.translateToLocal("gui.partcrafter6") + crecipe.material.miningspeed / 100F,
|
||||
35,
|
||||
50,
|
||||
0x404040,
|
||||
false);
|
||||
GuiDraw.drawString(
|
||||
StatCollector.translateToLocal("gui.partcrafter7")
|
||||
+ HarvestLevels.getHarvestLevelName(crecipe.material.harvestLevel),
|
||||
35,
|
||||
60,
|
||||
0x404040,
|
||||
false);
|
||||
String heart = crecipe.material.attack == 2
|
||||
? StatCollector.translateToLocal("gui.partcrafter8")
|
||||
: StatCollector.translateToLocal("gui.partcrafter9");
|
||||
if (crecipe.material.attack() % 2 == 0) {
|
||||
GuiDraw.drawString(
|
||||
StatCollector.translateToLocal("gui.partcrafter10") + crecipe.material.attack / 2 + heart,
|
||||
35,
|
||||
70,
|
||||
0x404040,
|
||||
false);
|
||||
} else {
|
||||
GuiDraw.drawString(
|
||||
StatCollector.translateToLocal("gui.partcrafter10") + crecipe.material.attack / 2F + heart,
|
||||
35,
|
||||
70,
|
||||
0x404040,
|
||||
false);
|
||||
}
|
||||
int abilityY = 85;
|
||||
if (crecipe.material.reinforced > 0)
|
||||
{
|
||||
if (crecipe.material.reinforced > 0) {
|
||||
GuiDraw.drawString(getReinforcedString(crecipe.material.reinforced), 35, 85, 0x404040, false);
|
||||
abilityY += 10;
|
||||
}
|
||||
String ability = crecipe.material.ability();
|
||||
if (ability != null)
|
||||
{
|
||||
if (crecipe.material.stonebound != 0)
|
||||
{
|
||||
GuiDraw.drawString(ability + " (" + Math.abs(crecipe.material.stonebound) + ")", 35, abilityY, 0x404040, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ability != null) {
|
||||
if (crecipe.material.stonebound != 0) {
|
||||
GuiDraw.drawString(
|
||||
ability + " (" + Math.abs(crecipe.material.stonebound) + ")",
|
||||
35,
|
||||
abilityY,
|
||||
0x404040,
|
||||
false);
|
||||
} else {
|
||||
GuiDraw.drawString(ability, 35, abilityY, 0x404040, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (crecipe.bowMaterial != null)
|
||||
{
|
||||
if (crecipe.bowMaterial != null) {
|
||||
int y = 20;
|
||||
int x = 35;
|
||||
GuiDraw.drawString(EnumChatFormatting.BOLD + StatCollector.translateToLocal("tconstruct.nei.projectilematerials"), 35, 10, 0x404040, false);
|
||||
GuiDraw.drawString(StatCollector.translateToLocal("gui.toolstation6") + crecipe.bowMaterial.drawspeed, x, y, 0x404040, false);
|
||||
GuiDraw.drawString(
|
||||
EnumChatFormatting.BOLD + StatCollector.translateToLocal("tconstruct.nei.projectilematerials"),
|
||||
35,
|
||||
10,
|
||||
0x404040,
|
||||
false);
|
||||
GuiDraw.drawString(
|
||||
StatCollector.translateToLocal("gui.toolstation6") + crecipe.bowMaterial.drawspeed,
|
||||
x,
|
||||
y,
|
||||
0x404040,
|
||||
false);
|
||||
y += 10;
|
||||
GuiDraw.drawString(StatCollector.translateToLocal("gui.toolstation7") + crecipe.bowMaterial.flightSpeedMax, x, y, 0x404040, false);
|
||||
GuiDraw.drawString(
|
||||
StatCollector.translateToLocal("gui.toolstation7") + crecipe.bowMaterial.flightSpeedMax,
|
||||
x,
|
||||
y,
|
||||
0x404040,
|
||||
false);
|
||||
}
|
||||
if (crecipe.arrowMaterial != null)
|
||||
{
|
||||
if (crecipe.arrowMaterial != null) {
|
||||
int y = 50;
|
||||
int x = 35;
|
||||
GuiDraw.drawString(StatCollector.translateToLocal("gui.toolstation8") + crecipe.arrowMaterial.mass, x, y, 0x404040, false);
|
||||
GuiDraw.drawString(
|
||||
StatCollector.translateToLocal("gui.toolstation8") + crecipe.arrowMaterial.mass,
|
||||
x,
|
||||
y,
|
||||
0x404040,
|
||||
false);
|
||||
y += 10;
|
||||
GuiDraw.drawString(StatCollector.translateToLocal("gui.toolstation22") + crecipe.arrowMaterial.breakChance, x, y, 0x404040, false);
|
||||
GuiDraw.drawString(
|
||||
StatCollector.translateToLocal("gui.toolstation22") + crecipe.arrowMaterial.breakChance,
|
||||
x,
|
||||
y,
|
||||
0x404040,
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes (String outputId, Object... results)
|
||||
{
|
||||
if (outputId.equals(this.getRecipeID()))
|
||||
{
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals(this.getRecipeID())) {
|
||||
ToolMaterial mat;
|
||||
for (int matID : TConstructRegistry.toolMaterials.keySet())
|
||||
{
|
||||
for (int matID : TConstructRegistry.toolMaterials.keySet()) {
|
||||
List<ItemStack> toolParts = new ArrayList<ItemStack>();
|
||||
|
||||
mat = TConstructRegistry.toolMaterials.get(matID);
|
||||
for (ItemKey key : PatternBuilder.instance.materials)
|
||||
{
|
||||
for (ItemKey key : PatternBuilder.instance.materials) {
|
||||
MaterialSet set = PatternBuilder.instance.materialSets.get(key.key);
|
||||
if (set.materialID == matID)
|
||||
{
|
||||
if (set.materialID == matID) {
|
||||
ItemStack stack = new ItemStack(key.item, 1, key.damage);
|
||||
toolParts.add(stack);
|
||||
}
|
||||
}
|
||||
for (List list : TConstructRegistry.patternPartMapping.keySet())
|
||||
{
|
||||
if ((Integer) list.get(2) == matID)
|
||||
{
|
||||
for (List list : TConstructRegistry.patternPartMapping.keySet()) {
|
||||
if ((Integer) list.get(2) == matID) {
|
||||
toolParts.add(TConstructRegistry.patternPartMapping.get(list));
|
||||
}
|
||||
}
|
||||
if (!PHConstruct.craftMetalTools)
|
||||
{
|
||||
for (CastingRecipe recipe : TConstructRegistry.getTableCasting().getCastingRecipes())
|
||||
{
|
||||
if (!PHConstruct.craftMetalTools) {
|
||||
for (CastingRecipe recipe :
|
||||
TConstructRegistry.getTableCasting().getCastingRecipes()) {
|
||||
ItemStack castResult = recipe.getResult();
|
||||
if (castResult.getItem() instanceof IToolPart)
|
||||
{
|
||||
if (((IToolPart) castResult.getItem()).getMaterialID(castResult) == matID)
|
||||
{
|
||||
if (castResult.getItem() instanceof IToolPart) {
|
||||
if (((IToolPart) castResult.getItem()).getMaterialID(castResult) == matID) {
|
||||
toolParts.add(castResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(toolParts.size() > 0) {
|
||||
if (toolParts.size() > 0) {
|
||||
this.arecipes.add(new CachedToolMaterialsRecipe(toolParts, matID));
|
||||
this.arecipes.add(new CachedToolMaterialsRecipe(toolParts, matID, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes (ItemStack ingred)
|
||||
{
|
||||
if (ingred.getItem() instanceof ToolPart || ingred.getItem() instanceof DynamicToolPart)
|
||||
{
|
||||
public void loadUsageRecipes(ItemStack ingred) {
|
||||
if (ingred.getItem() instanceof ToolPart || ingred.getItem() instanceof DynamicToolPart) {
|
||||
int materialID = ((IToolPart) ingred.getItem()).getMaterialID(ingred);
|
||||
if (materialID >= 0)
|
||||
{
|
||||
if (materialID >= 0) {
|
||||
List toolParts = getSingleList(ingred);
|
||||
if(toolParts.size() > 0) {
|
||||
if (toolParts.size() > 0) {
|
||||
this.arecipes.add(new CachedToolMaterialsRecipe(toolParts, materialID));
|
||||
this.arecipes.add(new CachedToolMaterialsRecipe(toolParts, materialID, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (PatternBuilder.instance.getPartID(ingred) < Short.MAX_VALUE)
|
||||
{
|
||||
} else if (PatternBuilder.instance.getPartID(ingred) < Short.MAX_VALUE) {
|
||||
int materialID = PatternBuilder.instance.getPartID(ingred);
|
||||
List toolParts = getSingleList(ingred);
|
||||
if(toolParts.size() > 0) {
|
||||
if (toolParts.size() > 0) {
|
||||
this.arecipes.add(new CachedToolMaterialsRecipe(toolParts, materialID));
|
||||
this.arecipes.add(new CachedToolMaterialsRecipe(toolParts, materialID, true));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
super.loadUsageRecipes(ingred);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getReinforcedString (int reinforced)
|
||||
{
|
||||
if (reinforced > 9)
|
||||
return "Unbreakable";
|
||||
public static String getReinforcedString(int reinforced) {
|
||||
if (reinforced > 9) return "Unbreakable";
|
||||
String ret = "Reinforced ";
|
||||
switch (reinforced)
|
||||
{
|
||||
case 1:
|
||||
ret += "I";
|
||||
break;
|
||||
case 2:
|
||||
ret += "II";
|
||||
break;
|
||||
case 3:
|
||||
ret += "III";
|
||||
break;
|
||||
case 4:
|
||||
ret += "IV";
|
||||
break;
|
||||
case 5:
|
||||
ret += "V";
|
||||
break;
|
||||
case 6:
|
||||
ret += "VI";
|
||||
break;
|
||||
case 7:
|
||||
ret += "VII";
|
||||
break;
|
||||
case 8:
|
||||
ret += "VIII";
|
||||
break;
|
||||
case 9:
|
||||
ret += "IX";
|
||||
break;
|
||||
default:
|
||||
ret += "X";
|
||||
break;
|
||||
switch (reinforced) {
|
||||
case 1:
|
||||
ret += "I";
|
||||
break;
|
||||
case 2:
|
||||
ret += "II";
|
||||
break;
|
||||
case 3:
|
||||
ret += "III";
|
||||
break;
|
||||
case 4:
|
||||
ret += "IV";
|
||||
break;
|
||||
case 5:
|
||||
ret += "V";
|
||||
break;
|
||||
case 6:
|
||||
ret += "VI";
|
||||
break;
|
||||
case 7:
|
||||
ret += "VII";
|
||||
break;
|
||||
case 8:
|
||||
ret += "VIII";
|
||||
break;
|
||||
case 9:
|
||||
ret += "IX";
|
||||
break;
|
||||
default:
|
||||
ret += "X";
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,14 +8,11 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
/**
|
||||
* Taken from CoFHLib
|
||||
*/
|
||||
public class TE4Helper
|
||||
{
|
||||
public class TE4Helper {
|
||||
|
||||
public static void addFurnaceRecipe (int energy, ItemStack input, ItemStack output)
|
||||
{
|
||||
public static void addFurnaceRecipe(int energy, ItemStack input, ItemStack output) {
|
||||
|
||||
if (input == null || output == null)
|
||||
{
|
||||
if (input == null || output == null) {
|
||||
return;
|
||||
}
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
@@ -29,23 +26,21 @@ public class TE4Helper
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "FurnaceRecipe", toSend);
|
||||
}
|
||||
|
||||
public static void addPulverizerRecipe (int energy, ItemStack input, ItemStack primaryOutput)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
public static void addPulverizerRecipe(
|
||||
int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {
|
||||
|
||||
if (input == null || primaryOutput == null || secondaryOutput == null)
|
||||
{
|
||||
if (input == null || primaryOutput == null || secondaryOutput == null) {
|
||||
return;
|
||||
}
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
@@ -63,23 +58,21 @@ public class TE4Helper
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "PulverizerRecipe", toSend);
|
||||
}
|
||||
|
||||
public static void addSawmillRecipe (int energy, ItemStack input, ItemStack primaryOutput)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
public static void addSawmillRecipe(
|
||||
int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {
|
||||
|
||||
if (input == null || primaryOutput == null || secondaryOutput == null)
|
||||
{
|
||||
if (input == null || primaryOutput == null || secondaryOutput == null) {
|
||||
return;
|
||||
}
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
@@ -97,23 +90,31 @@ public class TE4Helper
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "SawmillRecipe", toSend);
|
||||
}
|
||||
|
||||
public static void addSmelterRecipe (int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (primaryInput == null || secondaryInput == null || primaryOutput == null || secondaryOutput == null) {
|
||||
return;
|
||||
}
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
@@ -141,8 +142,7 @@ public class TE4Helper
|
||||
*
|
||||
* @param oreType
|
||||
*/
|
||||
public static void addSmelterBlastOre (String oreType)
|
||||
{
|
||||
public static void addSmelterBlastOre(String oreType) {
|
||||
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
@@ -151,11 +151,9 @@ public class TE4Helper
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "SmelterBlastOreType", toSend);
|
||||
}
|
||||
|
||||
public static void addCrucibleRecipe (int energy, ItemStack input, FluidStack output)
|
||||
{
|
||||
public static void addCrucibleRecipe(int energy, ItemStack input, FluidStack output) {
|
||||
|
||||
if (input == null || output == null)
|
||||
{
|
||||
if (input == null || output == null) {
|
||||
return;
|
||||
}
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
@@ -170,11 +168,10 @@ public class TE4Helper
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend);
|
||||
}
|
||||
|
||||
public static void addTransposerFill (int energy, ItemStack input, ItemStack output, FluidStack fluid, boolean reversible)
|
||||
{
|
||||
public static void addTransposerFill(
|
||||
int energy, ItemStack input, ItemStack output, FluidStack fluid, boolean reversible) {
|
||||
|
||||
if (input == null || output == null || fluid == null)
|
||||
{
|
||||
if (input == null || output == null || fluid == null) {
|
||||
return;
|
||||
}
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
@@ -192,11 +189,10 @@ public class TE4Helper
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "TransposerFillRecipe", toSend);
|
||||
}
|
||||
|
||||
public static void addTransposerExtract (int energy, ItemStack input, ItemStack output, FluidStack fluid, int chance, boolean reversible)
|
||||
{
|
||||
public static void addTransposerExtract(
|
||||
int energy, ItemStack input, ItemStack output, FluidStack fluid, int chance, boolean reversible) {
|
||||
|
||||
if (input == null || output == null || fluid == null)
|
||||
{
|
||||
if (input == null || output == null || fluid == null) {
|
||||
return;
|
||||
}
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
@@ -215,8 +211,7 @@ public class TE4Helper
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "TransposerExtractRecipe", toSend);
|
||||
}
|
||||
|
||||
public static void addMagmaticFuel (String fluidName, int energy)
|
||||
{
|
||||
public static void addMagmaticFuel(String fluidName, int energy) {
|
||||
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
@@ -226,8 +221,7 @@ public class TE4Helper
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "MagmaticFuel", toSend);
|
||||
}
|
||||
|
||||
public static void addCompressionFuel (String fluidName, int energy)
|
||||
{
|
||||
public static void addCompressionFuel(String fluidName, int energy) {
|
||||
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
@@ -237,8 +231,7 @@ public class TE4Helper
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "CompressionFuel", toSend);
|
||||
}
|
||||
|
||||
public static void addReactantFuel (String fluidName, int energy)
|
||||
{
|
||||
public static void addReactantFuel(String fluidName, int energy) {
|
||||
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
@@ -248,8 +241,7 @@ public class TE4Helper
|
||||
FMLInterModComms.sendMessage("ThermalExpansion", "ReactantFuel", toSend);
|
||||
}
|
||||
|
||||
public static void addCoolant (String fluidName, int energy)
|
||||
{
|
||||
public static void addCoolant(String fluidName, int energy) {
|
||||
|
||||
NBTTagCompound toSend = new NBTTagCompound();
|
||||
|
||||
|
||||
@@ -18,30 +18,79 @@ 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", forced = true)
|
||||
public class TinkerTE4
|
||||
{
|
||||
@Pulse(
|
||||
id = "Tinkers TE4 Compatibility",
|
||||
description = "Tinkers Construct compatibility for Thermal Expansion",
|
||||
modsRequired = "ThermalExpansion",
|
||||
forced = true)
|
||||
public class TinkerTE4 {
|
||||
@Handler
|
||||
public void init ()
|
||||
{
|
||||
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(
|
||||
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.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);
|
||||
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);
|
||||
|
||||
// Dust Recipes
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(TinkerTools.materials, 1, 41), "dustArdite", "dustCobalt"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(TinkerTools.materials, 4, 42), "dustAluminum", "dustAluminum", "dustAluminum", "dustCopper"));
|
||||
GameRegistry.addRecipe(
|
||||
new ShapelessOreRecipe(new ItemStack(TinkerTools.materials, 1, 41), "dustArdite", "dustCobalt"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
new ItemStack(TinkerTools.materials, 4, 42),
|
||||
"dustAluminum",
|
||||
"dustAluminum",
|
||||
"dustAluminum",
|
||||
"dustCopper"));
|
||||
}
|
||||
|
||||
@Handler
|
||||
@@ -52,40 +101,47 @@ public class TinkerTE4
|
||||
|
||||
// selected fluid transposer recipies
|
||||
// tesseract
|
||||
ItemStack tesseractEmpty = GameRegistry.findItemStack("ThermalExpansion", "frameTesseractEmpty" ,1);
|
||||
ItemStack tesseractFull = GameRegistry.findItemStack("ThermalExpansion", "frameTesseractFull" ,1);
|
||||
TConstructRegistry.getBasinCasting().addCastingRecipe(tesseractFull, new FluidStack(enderFluid, 1000), tesseractEmpty, true, 300);
|
||||
ItemStack tesseractEmpty = GameRegistry.findItemStack("ThermalExpansion", "frameTesseractEmpty", 1);
|
||||
ItemStack tesseractFull = GameRegistry.findItemStack("ThermalExpansion", "frameTesseractFull", 1);
|
||||
TConstructRegistry.getBasinCasting()
|
||||
.addCastingRecipe(tesseractFull, new FluidStack(enderFluid, 1000), tesseractEmpty, true, 300);
|
||||
|
||||
// redstone energy cell
|
||||
ItemStack cellFrameEmpty = GameRegistry.findItemStack("ThermalExpansion", "frameCellReinforcedEmpty", 1);
|
||||
ItemStack cellFrameFull = GameRegistry.findItemStack("ThermalExpansion", "frameCellReinforcedFull", 1);
|
||||
TConstructRegistry.getBasinCasting().addCastingRecipe(cellFrameFull, new FluidStack(redstoneFluid, 4000), cellFrameEmpty, true, 100);
|
||||
TConstructRegistry.getBasinCasting()
|
||||
.addCastingRecipe(cellFrameFull, new FluidStack(redstoneFluid, 4000), cellFrameEmpty, true, 100);
|
||||
|
||||
cellFrameEmpty = GameRegistry.findItemStack("ThermalExpansion", "frameCellResonantEmpty", 1);
|
||||
if(cellFrameEmpty != null) {
|
||||
if (cellFrameEmpty != null) {
|
||||
cellFrameFull = GameRegistry.findItemStack("ThermalExpansion", "frameCellResonantFull", 1);
|
||||
TConstructRegistry.getBasinCasting().addCastingRecipe(cellFrameFull, new FluidStack(redstoneFluid, 4000), cellFrameEmpty, true, 100);
|
||||
TConstructRegistry.getBasinCasting()
|
||||
.addCastingRecipe(cellFrameFull, new FluidStack(redstoneFluid, 4000), cellFrameEmpty, true, 100);
|
||||
}
|
||||
|
||||
// glowstone illuminator
|
||||
ItemStack illuminatorEmpty = GameRegistry.findItemStack("ThermalExpansion", "frameIlluminator" ,1);
|
||||
ItemStack illuminator = GameRegistry.findItemStack("ThermalExpansion", "illuminator" ,1);
|
||||
TConstructRegistry.getBasinCasting().addCastingRecipe(illuminator, new FluidStack(glowstoneFluid, 1000), illuminatorEmpty, true, 300);
|
||||
ItemStack illuminatorEmpty = GameRegistry.findItemStack("ThermalExpansion", "frameIlluminator", 1);
|
||||
ItemStack illuminator = GameRegistry.findItemStack("ThermalExpansion", "illuminator", 1);
|
||||
TConstructRegistry.getBasinCasting()
|
||||
.addCastingRecipe(illuminator, new FluidStack(glowstoneFluid, 1000), illuminatorEmpty, true, 300);
|
||||
|
||||
// plates
|
||||
ItemStack plate = GameRegistry.findItemStack("ThermalExpansion", "plateFrame" ,1);
|
||||
ItemStack plateRedstone = GameRegistry.findItemStack("ThermalExpansion", "plateSignal" ,1);
|
||||
ItemStack plateGlowstone = GameRegistry.findItemStack("ThermalExpansion", "plateImpulse" ,1);
|
||||
ItemStack plateEnder = GameRegistry.findItemStack("ThermalExpansion", "plateTranslocate" ,1);
|
||||
ItemStack plate = GameRegistry.findItemStack("ThermalExpansion", "plateFrame", 1);
|
||||
ItemStack plateRedstone = GameRegistry.findItemStack("ThermalExpansion", "plateSignal", 1);
|
||||
ItemStack plateGlowstone = GameRegistry.findItemStack("ThermalExpansion", "plateImpulse", 1);
|
||||
ItemStack plateEnder = GameRegistry.findItemStack("ThermalExpansion", "plateTranslocate", 1);
|
||||
|
||||
TConstructRegistry.getTableCasting().addCastingRecipe(plateRedstone, new FluidStack(redstoneFluid, 1000), plate, true, 100);
|
||||
TConstructRegistry.getTableCasting().addCastingRecipe(plateGlowstone, new FluidStack(glowstoneFluid, 1000), plate, true, 100);
|
||||
TConstructRegistry.getTableCasting().addCastingRecipe(plateEnder, new FluidStack(enderFluid, 1000), plate, true, 100);
|
||||
TConstructRegistry.getTableCasting()
|
||||
.addCastingRecipe(plateRedstone, new FluidStack(redstoneFluid, 1000), plate, true, 100);
|
||||
TConstructRegistry.getTableCasting()
|
||||
.addCastingRecipe(plateGlowstone, new FluidStack(glowstoneFluid, 1000), plate, true, 100);
|
||||
TConstructRegistry.getTableCasting()
|
||||
.addCastingRecipe(plateEnder, new FluidStack(enderFluid, 1000), plate, true, 100);
|
||||
|
||||
// last but not least.. a really weird hardened glass recipe
|
||||
ItemStack hardenedGlass = GameRegistry.findItemStack("ThermalExpansion", "blockGlassHardened" ,1);
|
||||
ItemStack hardenedGlass = GameRegistry.findItemStack("ThermalExpansion", "blockGlassHardened", 1);
|
||||
ItemStack obsidian = new ItemStack(Blocks.obsidian);
|
||||
FluidStack lead = new FluidStack(TinkerSmeltery.moltenLeadFluid, TConstruct.ingotLiquidValue/2);
|
||||
FluidStack lead = new FluidStack(TinkerSmeltery.moltenLeadFluid, TConstruct.ingotLiquidValue / 2);
|
||||
TConstructRegistry.getBasinCasting().addCastingRecipe(hardenedGlass, lead, obsidian, true, 150);
|
||||
}
|
||||
}
|
||||
@@ -1,31 +1,29 @@
|
||||
package tconstruct.plugins.te4;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import mantle.pulsar.pulse.Handler;
|
||||
import mantle.pulsar.pulse.Pulse;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.FluidType;
|
||||
import tconstruct.library.crafting.LiquidCasting;
|
||||
import tconstruct.library.crafting.Smeltery;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@GameRegistry.ObjectHolder(TinkersThermalFoundation.TF_MOD_ID)
|
||||
@Pulse(id = "Tinkers Thermal Foundation Compatibility", description = "Tinkers Construct compatibility for Thermal Foundation", modsRequired = TinkersThermalFoundation.TF_MOD_ID, forced = true)
|
||||
@Pulse(
|
||||
id = "Tinkers Thermal Foundation Compatibility",
|
||||
description = "Tinkers Construct compatibility for Thermal Foundation",
|
||||
modsRequired = TinkersThermalFoundation.TF_MOD_ID,
|
||||
forced = true)
|
||||
public class TinkersThermalFoundation {
|
||||
static final String TF_MOD_ID = "ThermalFoundation";
|
||||
|
||||
@@ -52,32 +50,45 @@ public class TinkersThermalFoundation {
|
||||
Fluid glowstoneFluid = FluidRegistry.getFluid("glowstone");
|
||||
Fluid coalFluid = FluidRegistry.getFluid("coal");
|
||||
|
||||
//pyrotheum fuel
|
||||
// pyrotheum fuel
|
||||
// register pyrotheum if it's present
|
||||
Smeltery.addSmelteryFuel(pyrotheumFluid, 5000, 70); // pyrotheum lasts 3.5 seconds per 15 mb
|
||||
|
||||
// liquid redstone
|
||||
for(ItemStack stack : OreDictionary.getOres("blockRedstone"))
|
||||
Smeltery.addMelting(stack, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 3000, new FluidStack(redstoneFluid, 900));
|
||||
for(ItemStack stack : OreDictionary.getOres("dustRedstone"))
|
||||
Smeltery.addMelting(stack, Blocks.redstone_block, stack.getItemDamage(), 2500, new FluidStack(redstoneFluid, 100));
|
||||
for (ItemStack stack : OreDictionary.getOres("blockRedstone"))
|
||||
Smeltery.addMelting(
|
||||
stack,
|
||||
Block.getBlockFromItem(stack.getItem()),
|
||||
stack.getItemDamage(),
|
||||
3000,
|
||||
new FluidStack(redstoneFluid, 900));
|
||||
for (ItemStack stack : OreDictionary.getOres("dustRedstone"))
|
||||
Smeltery.addMelting(
|
||||
stack, Blocks.redstone_block, stack.getItemDamage(), 2500, new FluidStack(redstoneFluid, 100));
|
||||
|
||||
// liquid glowstone
|
||||
for(ItemStack stack : OreDictionary.getOres("glowstone"))
|
||||
Smeltery.addMelting(stack, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 3000, new FluidStack(glowstoneFluid, 1000));
|
||||
for(ItemStack stack : OreDictionary.getOres("dustGlowstone"))
|
||||
Smeltery.addMelting(stack, Blocks.glowstone, stack.getItemDamage(), 2500, new FluidStack(glowstoneFluid, 250));
|
||||
for (ItemStack stack : OreDictionary.getOres("glowstone"))
|
||||
Smeltery.addMelting(
|
||||
stack,
|
||||
Block.getBlockFromItem(stack.getItem()),
|
||||
stack.getItemDamage(),
|
||||
3000,
|
||||
new FluidStack(glowstoneFluid, 1000));
|
||||
for (ItemStack stack : OreDictionary.getOres("dustGlowstone"))
|
||||
Smeltery.addMelting(
|
||||
stack, Blocks.glowstone, stack.getItemDamage(), 2500, new FluidStack(glowstoneFluid, 250));
|
||||
|
||||
// liquid pyrotheum
|
||||
for(ItemStack stack : OreDictionary.getOres("dustPyrotheum"))
|
||||
Smeltery.addMelting(stack, Blocks.glowstone, stack.getItemDamage(), 1299, new FluidStack(pyrotheumFluid, 100));
|
||||
for (ItemStack stack : OreDictionary.getOres("dustPyrotheum"))
|
||||
Smeltery.addMelting(
|
||||
stack, Blocks.glowstone, stack.getItemDamage(), 1299, new FluidStack(pyrotheumFluid, 100));
|
||||
|
||||
// liquid cryotheum
|
||||
for(ItemStack stack : OreDictionary.getOres("dustCryotheum"))
|
||||
for (ItemStack stack : OreDictionary.getOres("dustCryotheum"))
|
||||
Smeltery.addMelting(stack, Blocks.snow, stack.getItemDamage(), 4000, new FluidStack(cryotheumFluid, 100));
|
||||
|
||||
// liquid coal
|
||||
for(ItemStack stack : OreDictionary.getOres("dustCoal"))
|
||||
for (ItemStack stack : OreDictionary.getOres("dustCoal"))
|
||||
Smeltery.addMelting(stack, Blocks.coal_block, stack.getItemDamage(), 4000, new FluidStack(coalFluid, 100));
|
||||
|
||||
// Alloying
|
||||
@@ -118,12 +129,11 @@ public class TinkersThermalFoundation {
|
||||
Smeltery.addAlloyMixing(result, part1, part2, part3, new FluidStack(TinkerSmeltery.moltenEnderFluid, 1000));
|
||||
}
|
||||
|
||||
|
||||
private void registerFluidType(String name, int temp, Fluid fluid) {
|
||||
ItemStack stack = GameRegistry.findItemStack(TF_MOD_ID, "block" + name, 1);
|
||||
if(stack == null || stack.getItem() == null)
|
||||
stack = new ItemStack(TinkerWorld.metalBlock);
|
||||
if (stack == null || stack.getItem() == null) stack = new ItemStack(TinkerWorld.metalBlock);
|
||||
|
||||
FluidType.registerFluidType(name, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), temp, fluid, false);
|
||||
FluidType.registerFluidType(
|
||||
name, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), temp, fluid, false);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package tconstruct.plugins.ubc;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import exterminatorJeff.undergroundBiomes.api.UBAPIHook;
|
||||
import exterminatorJeff.undergroundBiomes.api.UBOreTexturizer.BlocksAreAlreadySet;
|
||||
import mantle.pulsar.pulse.Handler;
|
||||
@@ -9,34 +8,33 @@ import mantle.pulsar.pulse.Pulse;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
|
||||
@Pulse(id = "Tinkers' Underground Biomes Compatiblity", description = "Tinkers' Construct compatibilty for Underground Biomes Construct", modsRequired = "UndergroundBiomes", pulsesRequired = "Tinkers' World", forced = true)
|
||||
public class TinkerUBC
|
||||
{
|
||||
@Pulse(
|
||||
id = "Tinkers' Underground Biomes Compatiblity",
|
||||
description = "Tinkers' Construct compatibilty for Underground Biomes Construct",
|
||||
modsRequired = "UndergroundBiomes",
|
||||
pulsesRequired = "Tinkers' World",
|
||||
forced = true)
|
||||
public class TinkerUBC {
|
||||
@Handler
|
||||
public void preInit (FMLPreInitializationEvent event)
|
||||
{
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
registerBlock(3, "Copper");
|
||||
registerBlock(4, "Tin");
|
||||
registerBlock(5, "Aluminum");
|
||||
}
|
||||
|
||||
private void registerBlock (int meta, String blockName)
|
||||
{
|
||||
private void registerBlock(int meta, String blockName) {
|
||||
String overlayTexture = blockName.toLowerCase();
|
||||
try
|
||||
{
|
||||
UBAPIHook.ubAPIHook.ubOreTexturizer.requestUBOreSetup(TinkerWorld.oreSlag, meta, "tinker:ore_" + overlayTexture + "_overlay", "MetalOre." + blockName);
|
||||
}
|
||||
catch (RuntimeException exception)
|
||||
{
|
||||
try {
|
||||
UBAPIHook.ubAPIHook.ubOreTexturizer.requestUBOreSetup(
|
||||
TinkerWorld.oreSlag, meta, "tinker:ore_" + overlayTexture + "_overlay", "MetalOre." + blockName);
|
||||
} catch (RuntimeException exception) {
|
||||
// we have to work around this because otherwise FML would access this for some reason
|
||||
// and crash because BlocksAreAlreadySet Exception is not present without UBC
|
||||
if(exception instanceof BlocksAreAlreadySet)
|
||||
if (exception instanceof BlocksAreAlreadySet)
|
||||
TConstruct.logger.error(blockName + " is already registered in UBC");
|
||||
else
|
||||
// rethrow if it's another exception
|
||||
throw exception;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
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;
|
||||
@@ -13,49 +14,40 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.smeltery.logic.CastingBasinLogic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BasinDataProvider implements IWailaDataProvider
|
||||
{
|
||||
public class BasinDataProvider implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack (IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
if (accessor.getTileEntity() instanceof CastingBasinLogic)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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))
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (te.getFluidAmount() != 0) {
|
||||
FluidStack fs = te.getFluid();
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.liquidtag") + WailaRegistrar.fluidNameHelper(fs));
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.amounttag") + fs.amount + "/" + te.getCapacity());
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.liquidtag")
|
||||
+ WailaRegistrar.fluidNameHelper(fs));
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.amounttag") + fs.amount + "/"
|
||||
+ te.getCapacity());
|
||||
final int progress = te.getProgress();
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.progress") + progress + "%");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (te.getStackInSlot(0) != null)
|
||||
{
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.contains") + te.getStackInSlot(0).getDisplayName());
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
if (te.getStackInSlot(0) != null) {
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.contains")
|
||||
+ te.getStackInSlot(0).getDisplayName());
|
||||
} else {
|
||||
currenttip.add(SpecialChars.ITALIC + StatCollector.translateToLocal("tconstruct.waila.empty"));
|
||||
}
|
||||
}
|
||||
@@ -64,13 +56,14 @@ public class BasinDataProvider implements IWailaDataProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
public List<String> getWailaTail(
|
||||
ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
||||
public NBTTagCompound getNBTData(
|
||||
EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
@@ -12,26 +12,23 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import tconstruct.smeltery.logic.CastingChannelLogic;
|
||||
|
||||
public class CastingChannelDataProvider implements IWailaDataProvider
|
||||
{
|
||||
public class CastingChannelDataProvider implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack (IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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];
|
||||
@@ -39,14 +36,13 @@ public class CastingChannelDataProvider implements IWailaDataProvider
|
||||
FluidTankInfo westTank = te.getTankInfo(ForgeDirection.WEST)[0];
|
||||
FluidTankInfo eastTank = te.getTankInfo(ForgeDirection.EAST)[0];
|
||||
|
||||
if (internalTank.fluid != null && internalTank.fluid.amount > 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(StatCollector.translateToLocal("tconstruct.waila.liquidtag")
|
||||
+ WailaRegistrar.fluidNameHelper(fs));
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.amounttag") + fs.amount + "/"
|
||||
+ internalTank.capacity);
|
||||
} else {
|
||||
currenttip.add(SpecialChars.ITALIC + StatCollector.translateToLocal("tconstruct.waila.empty"));
|
||||
}
|
||||
|
||||
@@ -54,14 +50,10 @@ public class CastingChannelDataProvider implements IWailaDataProvider
|
||||
String s1, s2, s3, s4;
|
||||
s1 = s2 = s3 = s4 = 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;
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -69,13 +61,14 @@ public class CastingChannelDataProvider implements IWailaDataProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
public List<String> getWailaTail(
|
||||
ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
||||
public NBTTagCompound getNBTData(
|
||||
EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
@@ -11,35 +11,31 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.smeltery.logic.LavaTankLogic;
|
||||
|
||||
public class SearedTankDataProvider implements IWailaDataProvider
|
||||
{
|
||||
public class SearedTankDataProvider implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack (IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
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))
|
||||
{
|
||||
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())
|
||||
{
|
||||
if (te.containsFluid()) {
|
||||
FluidStack fs = te.tank.getFluid();
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.liquidtag") + WailaRegistrar.fluidNameHelper(fs));
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.amounttag") + fs.amount + "/" + te.tank.getCapacity());
|
||||
}
|
||||
else
|
||||
{
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.liquidtag")
|
||||
+ WailaRegistrar.fluidNameHelper(fs));
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.amounttag") + fs.amount + "/"
|
||||
+ te.tank.getCapacity());
|
||||
} else {
|
||||
currenttip.add(SpecialChars.ITALIC + StatCollector.translateToLocal("tconstruct.waila.empty"));
|
||||
}
|
||||
}
|
||||
@@ -47,13 +43,14 @@ public class SearedTankDataProvider implements IWailaDataProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
public List<String> getWailaTail(
|
||||
ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
||||
public NBTTagCompound getNBTData(
|
||||
EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
@@ -11,46 +11,37 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.smeltery.logic.SmelteryLogic;
|
||||
|
||||
public class SmelteryDataProvider implements IWailaDataProvider
|
||||
{
|
||||
public class SmelteryDataProvider implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack (IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
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))
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (te.validStructure) {
|
||||
List<FluidStack> fls = te.moltenMetal;
|
||||
if (fls.size() <= 0)
|
||||
{
|
||||
if (fls.size() <= 0) {
|
||||
currenttip.add(SpecialChars.ITALIC + StatCollector.translateToLocal("tconstruct.waila.empty"));
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < fls.size(); i++)
|
||||
{
|
||||
} 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(SpecialChars.ITALIC + StatCollector.translateToLocal("tconstruct.waila.invalidstructure"));
|
||||
} else {
|
||||
currenttip.add(
|
||||
SpecialChars.ITALIC + StatCollector.translateToLocal("tconstruct.waila.invalidstructure"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,13 +49,14 @@ public class SmelteryDataProvider implements IWailaDataProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
public List<String> getWailaTail(
|
||||
ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
||||
public NBTTagCompound getNBTData(
|
||||
EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
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;
|
||||
@@ -11,16 +12,11 @@ import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.smeltery.logic.CastingTableLogic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TableDataProvider implements IWailaDataProvider
|
||||
{
|
||||
public class TableDataProvider implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack (IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
if (accessor.getTileEntity() instanceof CastingTableLogic)
|
||||
{
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
if (accessor.getTileEntity() instanceof CastingTableLogic) {
|
||||
CastingTableLogic te = (CastingTableLogic) accessor.getTileEntity();
|
||||
return te.getStackInSlot(0);
|
||||
}
|
||||
@@ -28,25 +24,25 @@ public class TableDataProvider implements IWailaDataProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
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))
|
||||
{
|
||||
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(StatCollector.translateToLocal("tconstruct.waila.contains") + te.getStackInSlot(1).getDisplayName());
|
||||
if (te.getStackInSlot(1) != null) {
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.contains")
|
||||
+ te.getStackInSlot(1).getDisplayName());
|
||||
}
|
||||
if (te.getFluid() != null)
|
||||
{
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.liquidtag") + WailaRegistrar.fluidNameHelper(te.getFluid()));
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.amounttag") + te.getFluidAmount() + "/" + te.getCapacity());
|
||||
if (te.getFluid() != null) {
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.liquidtag")
|
||||
+ WailaRegistrar.fluidNameHelper(te.getFluid()));
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.amounttag") + te.getFluidAmount() + "/"
|
||||
+ te.getCapacity());
|
||||
final int progress = te.getProgress();
|
||||
currenttip.add(StatCollector.translateToLocal("tconstruct.waila.progress") + progress + "%");
|
||||
}
|
||||
@@ -55,13 +51,14 @@ public class TableDataProvider implements IWailaDataProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
public List<String> getWailaTail(
|
||||
ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
||||
public NBTTagCompound getNBTData(
|
||||
EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
@@ -6,12 +6,14 @@ import mantle.pulsar.pulse.*;
|
||||
import tconstruct.TConstruct;
|
||||
|
||||
@ObjectHolder(TConstruct.modID)
|
||||
@Pulse(id = "Tinkers Waila Compatibility", description = "Tinkers Construct compatibility for Waila", modsRequired = "Waila", forced = true)
|
||||
public class TinkerWaila
|
||||
{
|
||||
@Pulse(
|
||||
id = "Tinkers Waila Compatibility",
|
||||
description = "Tinkers Construct compatibility for Waila",
|
||||
modsRequired = "Waila",
|
||||
forced = true)
|
||||
public class TinkerWaila {
|
||||
@Handler
|
||||
public void init (FMLInitializationEvent event)
|
||||
{
|
||||
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");
|
||||
}
|
||||
|
||||
@@ -6,10 +6,8 @@ import tconstruct.TConstruct;
|
||||
import tconstruct.smeltery.blocks.*;
|
||||
import tconstruct.smeltery.logic.*;
|
||||
|
||||
public class WailaRegistrar
|
||||
{
|
||||
public static void wailaCallback (IWailaRegistrar registrar)
|
||||
{
|
||||
public class WailaRegistrar {
|
||||
public static void wailaCallback(IWailaRegistrar registrar) {
|
||||
TConstruct.logger.info("[Waila-Compat] Got registrar: " + registrar);
|
||||
|
||||
// Configs
|
||||
@@ -22,7 +20,7 @@ public class WailaRegistrar
|
||||
// Tanks
|
||||
registrar.registerBodyProvider(new SearedTankDataProvider(), LavaTankBlock.class);
|
||||
registrar.registerBodyProvider(new CastingChannelDataProvider(), CastingChannelLogic.class);
|
||||
//registrar.registerBodyProvider(new EssenceExtractorDataProvider(), EssenceExtractor.class);
|
||||
// registrar.registerBodyProvider(new EssenceExtractorDataProvider(), EssenceExtractor.class);
|
||||
|
||||
// Casting systems
|
||||
registrar.registerBodyProvider(new BasinDataProvider(), CastingBasinLogic.class);
|
||||
@@ -32,9 +30,7 @@ public class WailaRegistrar
|
||||
registrar.registerBodyProvider(new SmelteryDataProvider(), SmelteryBlock.class);
|
||||
}
|
||||
|
||||
public static String fluidNameHelper (FluidStack f)
|
||||
{
|
||||
public static String fluidNameHelper(FluidStack f) {
|
||||
return f.getFluid().getLocalizedName();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user