Add drawer controller range config

This commit is contained in:
Justin Aquadro committed 2015-11-26 02:20:59 -05:00
1 parent a55b39ff23
commit 4580cfa838
3 files changed
+12 -1

No files matched your search

@@ -156,6 +156,8 @@ storageDrawers.config.prop.enableTape=Enable Tape
storageDrawers.config.prop.enableTape.tooltip=For moving drawers with contents.
storageDrawers.config.prop.wailaStackRemainder=WAILA amount presentation
storageDrawers.config.prop.wailaStackRemainder.tooltip=How item amounts are displayed by WAILA.
storageDrawers.config.prop.controllerRange=Controller Range
storageDrawers.config.prop.controllerRange.tooltip=Range for detecting networked blocks.
storageDrawers.config.addons=Addons
storageDrawers.config.addons.tooltip=Configure global addon pack settings.
@@ -1,5 +1,6 @@
package com.jaquadro.minecraft.storagedrawers.block.tile;
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
import com.jaquadro.minecraft.storagedrawers.api.inventory.IDrawerInventory;
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawer;
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawerGroup;
@@ -116,6 +117,7 @@ public class TileEntityController extends TileEntity implements IDrawerGroup, IS
private int direction;
private int drawerSize = 0;
private int range;
private long lastClickTime;
private UUID lastClickUUID;
@@ -125,6 +127,7 @@ public class TileEntityController extends TileEntity implements IDrawerGroup, IS
public TileEntityController () {
invSlotList.add(new SlotRecord(null, 0));
inventorySlots = new int[] { 0 };
range = StorageDrawers.config.getControllerRange();
}
public int getDirection () {
@@ -421,7 +424,7 @@ public class TileEntityController extends TileEntity implements IDrawerGroup, IS
while (!searchQueue.isEmpty()) {
BlockCoord coord = searchQueue.remove();
int depth = Math.max(Math.max(Math.abs(coord.x() - x), Math.abs(coord.y() - y)), Math.abs(coord.z() - z));
if (depth > DEPTH_LIMIT)
if (depth > range)
continue;
Block block = worldObj.getBlock(coord.x(), coord.y(), coord.z());
@@ -274,6 +274,7 @@ public class ConfigManager
config.get(sectionBlocksCompDrawers.getQualifiedName(), "recipeOutput", 1).setLanguageKey(LANG_PREFIX + "prop.recipeOutput").setRequiresMcRestart(true);
config.get(sectionBlocksController.getQualifiedName(), "enabled", true).setLanguageKey(LANG_PREFIX + "prop.enabled").setRequiresMcRestart(true);
config.get(sectionBlocksController.getQualifiedName(), "range", 12).setLanguageKey(LANG_PREFIX + "prop.controllerRange");
config.get(sectionBlocksTrim.getQualifiedName(), "enabled", true).setLanguageKey(LANG_PREFIX + "prop.enabled").setRequiresMcRestart(true);
config.get(sectionBlocksTrim.getQualifiedName(), "recipeOutput", 4).setLanguageKey(LANG_PREFIX + "prop.recipeOutput").setRequiresMcRestart(true);
@@ -326,6 +327,11 @@ public class ConfigManager
return section.getCategory().get("recipeOutput").getInt();
}
public int getControllerRange () {
ConfigSection section = blockSectionsMap.get("controller");
return section.getCategory().get("range").getInt();
}
public int getStorageUpgradeMultiplier (int level) {
switch (level) {
case 2: return cache.level2Mult;