Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ repositories {

dependencies {
deobfCompile "mezz.jei:jei_${mc_version}:${jei_version}"
deobfCompile "mcp.mobius.waila:Hwyla:${waila_version}_1.12"
deobfCompile "mcp.mobius.waila:Hwyla:${waila_version}_1.12.2"
deobfCompile "cofh:RedstoneFlux:1.12-2.+:deobf"
deobfCompile "cofh:CoFHCore:${mc_version}-+:deobf"
deobfCompile "cofh:CoFHWorld:${mc_version}-${cofh_world_version}:deobf"
Expand Down Expand Up @@ -131,4 +131,4 @@ def curseRelations = {
//
// addArtifact sourceJar
// }
//}
//}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ curse_id=
mappings_version=snapshot_20171003

jei_version=4.10.+
waila_version=1.8.23-B38
waila_version=1.8.26-B41
cofh_world_version=1.2.0.+
ccl_version=3.+
tf_version=2.+
te_version=5.+
td_version=2.+
td_version=2.+
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Mon Sep 14 12:28:28 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
public class TileAnimalFarm extends TileVirtualMachine
{
private static final int TYPE = Type.ANIMAL_FARM.getMetadata();
private static final int SLOT_COUNT = 15; // 4 + 9 + 1 + 1
public static int basePower = 80;

public static int SLOT_TOOLS_START = 0;
Expand Down Expand Up @@ -70,8 +71,8 @@ public static void init()
ALT_SIDE_CONFIGS[TYPE].defaultSides = new byte[] { 1, 1, 1, 1, 1, 1 };

SLOT_CONFIGS[TYPE] = new SlotConfig();
SLOT_CONFIGS[TYPE].allowInsertionSlot = new boolean[] { true, true, true, true, true, false, false, false, false, false, false, false, false, false };
SLOT_CONFIGS[TYPE].allowExtractionSlot = new boolean[] { false, false, false, false, false, true, true, true, true, true, true, true, true, true };
SLOT_CONFIGS[TYPE].allowInsertionSlot = Utils.buildFilterArray(SLOT_COUNT, 0, 5); // tools, morb
SLOT_CONFIGS[TYPE].allowExtractionSlot = Utils.buildFilterArray(SLOT_COUNT, 5, 14); // outputs

VALID_AUGMENTS[TYPE] = new HashSet<>();
VALID_AUGMENTS[TYPE].add(VMConstants.MACHINE_EXPERIENCE);
Expand Down Expand Up @@ -119,7 +120,7 @@ public TileAnimalFarm()
{
super();

inventory = new ItemStack[15]; // 4 + 9 + 1 + 1
inventory = new ItemStack[SLOT_COUNT];
Arrays.fill(inventory, ItemStack.EMPTY);
createAllSlots(inventory.length);
tank.setLock(TFFluids.fluidExperience);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
public class TileDarkRoom extends TileVirtualMachine
{
private static final int TYPE = Type.DARK_ROOM.getMetadata();
private static final int SLOT_COUNT = 11; // 9 + 1 + 1 = 11
public static int basePower = 80;

public static int SLOT_SWORD = 0;
Expand All @@ -66,8 +67,8 @@ public static void init()
ALT_SIDE_CONFIGS[TYPE].defaultSides = new byte[] { 1, 1, 1, 1, 1, 1 };

SLOT_CONFIGS[TYPE] = new SlotConfig();
SLOT_CONFIGS[TYPE].allowInsertionSlot = new boolean[] { true, false, false, false, false, false, false, false, false, false };
SLOT_CONFIGS[TYPE].allowExtractionSlot = new boolean[] { false, true, true, true, true, true, true, true, true, true };
SLOT_CONFIGS[TYPE].allowInsertionSlot = Utils.buildFilterArray(SLOT_COUNT, 0, 1); // sword
SLOT_CONFIGS[TYPE].allowExtractionSlot = Utils.buildFilterArray(SLOT_COUNT, 1, 10); // outputs

VALID_AUGMENTS[TYPE] = new HashSet<>();
VALID_AUGMENTS[TYPE].add(VMConstants.MACHINE_EXPERIENCE);
Expand Down Expand Up @@ -109,7 +110,7 @@ public TileDarkRoom()
{
super();

inventory = new ItemStack[11]; // 9 + 1 + 1 = 11
inventory = new ItemStack[SLOT_COUNT];
Arrays.fill(inventory, ItemStack.EMPTY);
createAllSlots(inventory.length);
tank.setLock(TFFluids.fluidExperience);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
public class TileFarm extends TileVirtualMachine
{
private static final int TYPE = Type.FARM.getMetadata();
private static final int SLOT_COUNT = 33; // 18 + 4 + 9 + 1 + 1
public static int basePower = 40;

public static final int SLOT_TOOLS_START = 18;
Expand All @@ -65,8 +66,8 @@ public static void init()
ALT_SIDE_CONFIGS[TYPE].defaultSides = new byte[] { 1, 1, 1, 1, 1, 1 };

SLOT_CONFIGS[TYPE] = new SlotConfig();
SLOT_CONFIGS[TYPE].allowInsertionSlot = new boolean[] { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true };
SLOT_CONFIGS[TYPE].allowExtractionSlot = new boolean[] { true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false, false, false };
SLOT_CONFIGS[TYPE].allowInsertionSlot = Utils.buildFilterArray(SLOT_COUNT, 18, 32); // tools, fertilizer, farm
SLOT_CONFIGS[TYPE].allowExtractionSlot = Utils.buildFilterArray(SLOT_COUNT, 0, 22); // outputs, tools

VALID_AUGMENTS[TYPE] = new HashSet<>();
VALID_AUGMENTS[TYPE].add(VMConstants.MACHINE_FARM_SOIL);
Expand Down Expand Up @@ -110,7 +111,7 @@ public TileFarm()
{
super();

inventory = new ItemStack[33]; // 18 + 4 + 9 + 1 + 1
inventory = new ItemStack[SLOT_COUNT];
Arrays.fill(inventory, ItemStack.EMPTY);
createAllSlots(inventory.length);
tank.setLock(FluidRegistry.WATER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
public class TileFishery extends TileVirtualMachine
{
private static final int TYPE = Type.FISHERY.getMetadata();
private static final int SLOT_COUNT = 12; // 1 + 1 + 9 + 1
public static int basePower = 50;
public static int baseFluid = 1000;

Expand All @@ -57,8 +58,8 @@ public static void init()
ALT_SIDE_CONFIGS[TYPE].defaultSides = new byte[] { 1, 1, 1, 1, 1, 1 };

SLOT_CONFIGS[TYPE] = new SlotConfig();
SLOT_CONFIGS[TYPE].allowInsertionSlot = new boolean[] { true, true, false, false, false, false, false, false, false, false, false };
SLOT_CONFIGS[TYPE].allowExtractionSlot = new boolean[] { false, false, true, true, true, true, true, true, true, true, true };
SLOT_CONFIGS[TYPE].allowInsertionSlot = Utils.buildFilterArray(SLOT_COUNT, 0, 2); // rod, bait
SLOT_CONFIGS[TYPE].allowExtractionSlot = Utils.buildFilterArray(SLOT_COUNT, 2, 11); // outputs

VALID_AUGMENTS[TYPE] = new HashSet<>();

Expand Down Expand Up @@ -93,7 +94,7 @@ public TileFishery()
{
super();

inventory = new ItemStack[12]; // 1 + 1 + 9 + 1
inventory = new ItemStack[SLOT_COUNT];
Arrays.fill(inventory, ItemStack.EMPTY);
createAllSlots(inventory.length);
tank.setLock(FluidRegistry.WATER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
public class TileMobFarm extends TileVirtualMachine
{
private static final int TYPE = Type.MOB_FARM.getMetadata();
private static final int SLOT_COUNT = 29; // 1 + 9 + 18 + 1 = 29
public static int basePower = 200;

public static int SLOT_SWORD = 0;
Expand All @@ -65,8 +66,8 @@ public static void init()
ALT_SIDE_CONFIGS[TYPE].defaultSides = new byte[] { 1, 1, 1, 1, 1, 1 };

SLOT_CONFIGS[TYPE] = new SlotConfig();
SLOT_CONFIGS[TYPE].allowInsertionSlot = new boolean[] { true, true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false, false };
SLOT_CONFIGS[TYPE].allowExtractionSlot = new boolean[] { false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true };
SLOT_CONFIGS[TYPE].allowInsertionSlot = Utils.buildFilterArray(SLOT_COUNT, 0, 10); // sword, morbs
SLOT_CONFIGS[TYPE].allowExtractionSlot = Utils.buildFilterArray(SLOT_COUNT, 1, 28); // morbs, outputs

VALID_AUGMENTS[TYPE] = new HashSet<>();
VALID_AUGMENTS[TYPE].add(VMConstants.MACHINE_EXPERIENCE);
Expand Down Expand Up @@ -108,7 +109,7 @@ public TileMobFarm()
{
super();

inventory = new ItemStack[29]; // 1 + 9 + 18 + 1 = 29
inventory = new ItemStack[SLOT_COUNT];
Arrays.fill(inventory, ItemStack.EMPTY);
createAllSlots(inventory.length);
tank.setLock(TFFluids.fluidExperience);
Expand Down Expand Up @@ -543,4 +544,4 @@ public IVirtualMachine getVirtualMachine()
{
return virtualMobFarm;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
public class TileMobSpawner extends TileVirtualMachine
{
private static final int TYPE = Type.MOB_SPAWNER.getMetadata();
private static final int SLOT_COUNT = 12; // 9 + 1 + 1 + 1 = 12
public static int basePower = 80;

public static int SLOT_SWORD = 0;
Expand Down Expand Up @@ -68,8 +69,8 @@ public static void init()
ALT_SIDE_CONFIGS[TYPE].defaultSides = new byte[] { 1, 1, 1, 1, 1, 1 };

SLOT_CONFIGS[TYPE] = new SlotConfig();
SLOT_CONFIGS[TYPE].allowInsertionSlot = new boolean[] { true, true, false, false, false, false, false, false, false, false, false };
SLOT_CONFIGS[TYPE].allowExtractionSlot = new boolean[] { false, true, true, true, true, true, true, true, true, true, true };
SLOT_CONFIGS[TYPE].allowInsertionSlot = Utils.buildFilterArray(SLOT_COUNT, 0, 2); // sword, morb
SLOT_CONFIGS[TYPE].allowExtractionSlot = Utils.buildFilterArray(SLOT_COUNT, 1, 11); // morb, outputs

VALID_AUGMENTS[TYPE] = new HashSet<>();
VALID_AUGMENTS[TYPE].add(VMConstants.MACHINE_EXPERIENCE);
Expand Down Expand Up @@ -113,7 +114,7 @@ public TileMobSpawner()
{
super();

inventory = new ItemStack[12]; // 9 + 1 + 1 + 1 = 12
inventory = new ItemStack[SLOT_COUNT];
Arrays.fill(inventory, ItemStack.EMPTY);
createAllSlots(inventory.length);
tank.setLock(TFFluids.fluidExperience);
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/com/arcaratus/virtualmachines/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,17 @@ public static ItemStack damageItem(ItemStack itemStack, int amount, Random rando

return result;
}

public static boolean[] buildFilterArray(int size, int... ranges)
{
if (ranges.length % 2 == 1)
throw new IllegalArgumentException("Unclosed range!");

boolean[] filterArray = new boolean[size];

for (int i = 0; i < ranges.length; i += 2)
Arrays.fill(filterArray, ranges[i], ranges[i + 1], true);

return filterArray;
}
}