Skip to content

Commit

Permalink
1.7.10-0.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuxelus committed Sep 30, 2023
1 parent 9014285 commit 5641ca3
Show file tree
Hide file tree
Showing 9 changed files with 452 additions and 315 deletions.
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {

apply plugin: 'forge'

version = "1.7.10-0.3.4f"
version = "1.7.10-0.3.5"
group= "com.zuxelus.energycontrol"
archivesBaseName = "EnergyControl"

Expand All @@ -40,13 +40,14 @@ dependencies {
'libs_/BigReactors-0.4.3A.jar',
'libs_/CodeChickenLib-1.7.10-1.1.3.138-dev.jar',
'libs_/ComputerCraft1.75.jar',
'libs_/CraftTweaker-1.7.10-3.1.0-legacy.jar',
'libs_/Draconic-Evolution-1.7.10-1.0.2h.jar',
'libs_/EnderCore-1.7.10-0.2.0.39_beta.jar',
'libs_/EnderIO-1.7.10-2.3.0.429_beta.jar',
'libs_/EnderCore-1.7.10-0.2.0.40_beta.jar',
'libs_/EnderIO-1.7.10-2.3.0.430_beta.jar',
'libs_/gregtech_1.7.10-6.15.01.jar',
'libs_/GalacticraftCore-1.7-3.0.12.504.jar',
'libs_/Galacticraft-Planets-1.7-3.0.12.504.jar',
'libs_/HBM-NTM-[1.0.27_X4627].jar',
'libs_/HBM-NTM-.1.0.27_X4724.jar',
'libs_/industrialcraft-2-2.2.827-experimental-dev.jar',
'libs_/Mekanism-1.7.10-9.1.1.1031.jar',
'libs_/NotEnoughItems-1.7.10-1.0.5.120-universal.jar',
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/zuxelus/energycontrol/EnergyControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
import org.apache.logging.log4j.Logger;

import com.zuxelus.energycontrol.config.ConfigHandler;
import com.zuxelus.energycontrol.crossmod.CraftTweakerIntegration;
import com.zuxelus.energycontrol.crossmod.CrossModLoader;
import com.zuxelus.energycontrol.init.ModItems;
import com.zuxelus.energycontrol.network.ChannelHandler;
import com.zuxelus.energycontrol.proxy.IProxy;
import com.zuxelus.energycontrol.recipes.Recipes;
import com.zuxelus.energycontrol.tileentities.ScreenManager;

import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
Expand Down Expand Up @@ -78,5 +80,8 @@ public static void init(FMLInitializationEvent event) {
@EventHandler
public static void postInit(FMLPostInitializationEvent event) {
Recipes.addRecipes();
if (Loader.isModLoaded("MineTweaker3") || Loader.isModLoaded("MineTweaker3".toLowerCase())) {
CraftTweakerIntegration.init();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.zuxelus.energycontrol.crossmod;

import com.zuxelus.energycontrol.recipes.KitAssemblerRecipe;

import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack;
import minetweaker.api.minecraft.MineTweakerMC;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;

public class CraftTweakerIntegration {

public static void init() {
MineTweakerAPI.registerClass(KitAssemblerHandler.class);
}

@ZenClass("mods.energycontrol.KitAssembler")
public static class KitAssemblerHandler {

@ZenMethod
public static void addRecipe(IItemStack input1, IItemStack input2, IItemStack input3, IItemStack output, int time) {
KitAssemblerRecipe.addRecipe(new KitAssemblerRecipe(getStack(input1), getStack(input2), getStack(input3), getStack(output), time));
}

@ZenMethod
public static void removeRecipe(IItemStack input1, IItemStack input2, IItemStack input3) {
KitAssemblerRecipe.removeRecipe(getStack(input1), getStack(input2), getStack(input3), null);
}

private static ItemStack getStack(IItemStack stack) {
return MineTweakerMC.getItemStack(stack);
}
}
}
668 changes: 368 additions & 300 deletions src/main/java/com/zuxelus/energycontrol/crossmod/CrossHBM.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public List<FluidInfo> getAllTanks(TileEntity te) {
return null;
}

public TileEntity findTileEntity(World world, int x, int y, int z) {
return null;
}

public ArrayList getHookValues(TileEntity te) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,15 @@ public static NBTTagCompound getEnergyData(TileEntity te) {

public static List<FluidInfo> getAllTanks(World world, int x, int y, int z) {
TileEntity te = world.getTileEntity(x, y, z);
if (te == null)
return null;
for (CrossModBase crossMod : CROSS_MODS.values()) {
List<FluidInfo> list = crossMod.getAllTanks(te);
if (list != null)
return list;
if (te == null) {
te = crossMod.findTileEntity(world, x, y, z);
}
if (te != null) {
List<FluidInfo> list = crossMod.getAllTanks(te);
if (list != null)
return list;
}
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ public List<PanelString> getStringData(int settings, ICardReader reader, boolean
List<PanelString> result = reader.getTitleList();
if (reader.hasField(DataHelper.ENERGY))
result.add(new PanelString("msg.ec.InfoPanelEnergy", reader.getLong(DataHelper.ENERGY), "HE", showLabels));
if (reader.hasField(DataHelper.ENERGYTU))
result.add(new PanelString("msg.ec.InfoPanelEnergy", reader.getLong(DataHelper.ENERGYTU), "TU", showLabels));
if (reader.hasField("energy_"))
result.add(new PanelString("msg.ec.InfoPanelEnergy", reader.getLong("energy_"), showLabels));
if (reader.hasField(DataHelper.CAPACITY))
result.add(new PanelString("msg.ec.InfoPanelCapacity", reader.getLong(DataHelper.CAPACITY), "HE", showLabels));
if (reader.hasField(DataHelper.CAPACITYTU))
result.add(new PanelString("msg.ec.InfoPanelCapacity", reader.getLong(DataHelper.CAPACITYTU), "TU", showLabels));
if (reader.hasField("capacity_"))
result.add(new PanelString("msg.ec.InfoPanelCapacity", reader.getLong("capacity_"), showLabels));
if (reader.hasField("consumptionHE"))
Expand All @@ -62,6 +66,8 @@ public List<PanelString> getStringData(int settings, ICardReader reader, boolean
result.add(new PanelString("msg.ec.InfoPanelOutput", reader.getDouble(DataHelper.OUTPUT), "HE/t", showLabels));
if (reader.hasField(DataHelper.OUTPUTMB))
result.add(new PanelString("msg.ec.InfoPanelOutput", reader.getDouble(DataHelper.OUTPUTMB), "mB/t", showLabels));
if (reader.hasField(DataHelper.OUTPUTTU))
result.add(new PanelString("msg.ec.InfoPanelOutput", reader.getDouble(DataHelper.OUTPUTTU), "TU/t", showLabels));
if (reader.hasField(DataHelper.DIFF))
result.add(new PanelString("msg.ec.InfoPanelDifference", reader.getLong(DataHelper.DIFF), "HE/t", showLabels));
if (reader.hasField("temp"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,19 @@ public KitAssemblerRecipe(ItemStack input1, ItemStack input2, ItemStack input3,
}

public boolean isSuitable(TileEntityKitAssembler te) {
ItemStack stack1 = te.getStackInSlot(TileEntityKitAssembler.SLOT_CARD1);
return isSuitable(te.getStackInSlot(TileEntityKitAssembler.SLOT_CARD1),
te.getStackInSlot(TileEntityKitAssembler.SLOT_ITEM),
te.getStackInSlot(TileEntityKitAssembler.SLOT_CARD2),
te.getStackInSlot(TileEntityKitAssembler.SLOT_RESULT));
}

public boolean isSuitable(ItemStack stack1, ItemStack stack2, ItemStack stack3, ItemStack result) {
if (stack1 == null || stack1.stackSize < input1.stackSize || !input1.isItemEqual(stack1))
return false;
ItemStack stack2 = te.getStackInSlot(TileEntityKitAssembler.SLOT_ITEM);
if (stack2 == null || stack2.stackSize < input2.stackSize || !input2.isItemEqual(stack2))
return false;
ItemStack stack3 = te.getStackInSlot(TileEntityKitAssembler.SLOT_CARD2);
if (stack3 == null || stack3.stackSize < input3.stackSize || !input3.isItemEqual(stack3))
return false;
ItemStack result = te.getStackInSlot(TileEntityKitAssembler.SLOT_RESULT);
if (result != null) {
if (!result.isItemEqual(output))
return false;
Expand Down Expand Up @@ -99,15 +102,22 @@ else if (input3 instanceof String)
}
}

public static void removeRecipe(ItemStack stack1, ItemStack stack2, ItemStack stack3, ItemStack result) {
for(KitAssemblerRecipe recipe : recipes)
if (recipe.isSuitable(stack1, stack2, stack3, result)) {
recipes.remove(recipe);
return;
}
}

public static List<KitAssemblerRecipe> getRecipes() {
return recipes;
}

public static KitAssemblerRecipe findRecipe(TileEntityKitAssembler te) {
for(KitAssemblerRecipe recipe : recipes) {
for(KitAssemblerRecipe recipe : recipes)
if (recipe.isSuitable(te))
return recipe;
}
return null;
}
}
5 changes: 5 additions & 0 deletions src/main/java/com/zuxelus/energycontrol/utils/DataHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ public class DataHelper {
public static final String CAPACITY = "capacity";
public static final String CAPACITYHU = "capacityHU";
public static final String CAPACITYKU = "capacityKU";
public static final String CAPACITYTU = "capacityTU";
public static final String CONSUMPTION = "consumption";
public static final String CONSUMPTIONHE = "consumptionHE";
public static final String CONSUMPTIONTU = "consumptionTU";
public static final String DIFF = "diff";
public static final String ENERGY = "energy";
public static final String ENERGYHU = "energyHU";
public static final String ENERGYKU = "energyKU";
public static final String ENERGYTU = "energyTU";
public static final String EUTYPE = "euType";
public static final String FUEL = "fuel";
public static final String HEAT = "heat";
Expand All @@ -24,6 +28,7 @@ public class DataHelper {
public static final String OUTPUT = "output";
public static final String OUTPUTHU = "outputHU";
public static final String OUTPUTKU = "outputKU";
public static final String OUTPUTTU = "outputTU";
public static final String OUTPUTMB = "outputmb";
public static final String PRESSURE = "pressure";
public static final String TANK = "tank";
Expand Down

0 comments on commit 5641ca3

Please sign in to comment.