Remove unused config options, fix enableBackpackResupply option

This commit is contained in:
mezz committed 2014-12-16 22:34:43 -08:00
1 parent 89c3fb8bdf
commit 35afdc66b8
4 files changed
+25 -50

No files matched your search

@@ -10,17 +10,20 @@
******************************************************************************/
package forestry.core;
import java.util.concurrent.ConcurrentLinkedQueue;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChatComponentText;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
import forestry.core.config.Config;
import forestry.core.config.Version;
import forestry.core.proxy.Proxies;
import forestry.core.utils.Utils;
import java.util.concurrent.ConcurrentLinkedQueue;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChatComponentText;
public class TickHandlerCoreClient {
@@ -56,12 +59,6 @@ public class TickHandlerCoreClient {
}
}
/*
if (!Config.disableNags)
if (Proxies.common.isModLoaded("GregTech_Addon"))
queueChatMessage("\u00A76Forestry may have been modified by GregTech. It may behave unexpectedly and some config options may not work. Do not report issues with this install! You can disable this nag in the config.");
*/
if (!naggedVersion && !Config.disableVersionCheck && Version.needsUpdateNoticeAndMarkAsSeen()) {
queueChatMessage(String.format("\u00A7cNew version of Forestry available: %s for Minecraft %s", Version.getRecommendedVersion(),
Proxies.common.getMinecraftVersion()));
@@ -10,13 +10,16 @@
******************************************************************************/
package forestry.core;
import net.minecraft.entity.player.EntityPlayer;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent;
import forestry.core.config.Config;
import forestry.core.interfaces.IResupplyHandler;
import forestry.plugins.PluginManager;
import net.minecraft.entity.player.EntityPlayer;
public class TickHandlerCoreServer {
public TickHandlerCoreServer() {
@@ -27,11 +30,12 @@ public class TickHandlerCoreServer {
public void onWorldTick(WorldTickEvent event) {
if (event.phase != Phase.END) return;
for (Object obj : event.world.playerEntities) {
EntityPlayer player = (EntityPlayer) obj;
for (IResupplyHandler handler : PluginManager.resupplyHandlers)
handler.resupply(player);
if (Config.enableBackpackResupply) {
for (Object obj : event.world.playerEntities) {
EntityPlayer player = (EntityPlayer) obj;
for (IResupplyHandler handler : PluginManager.resupplyHandlers)
handler.resupply(player);
}
}
}
}
+2 -27
View File
@@ -10,7 +10,6 @@
******************************************************************************/
package forestry.core.config;
import forestry.core.proxy.Proxies;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
@@ -22,6 +21,8 @@ import java.util.HashSet;
import java.util.Locale;
import java.util.Properties;
import forestry.core.proxy.Proxies;
public class Config {
public static final String CATEGORY_COMMON = "common";
@@ -36,7 +37,6 @@ public class Config {
public static boolean isDebug = false;
public static boolean disablePermissions = false;
public static boolean disableNags = false;
public static boolean disableVersionCheck = false;
public static boolean invalidFingerprint = false;
@@ -55,23 +55,14 @@ public class Config {
public static boolean generateCopperOre = true;
public static boolean generateTinOre = true;
public static boolean generateBeehives = true;
public static boolean generateBogEarth = false;
public static boolean generateBeehivesDebug = false;
// Performance
public static boolean enableBackpackResupply = true;
public static int planterThrottle;
public static int harvesterThrottle;
// Customization
public static boolean tooltipLiquidAmount = true;
public static boolean planterSideSensitive = true;
/**
* True if the harvester should decide output to pipes according to side.
*/
public static boolean harvesterSideSensitive = true;
/* GO AWAY GRED */
private static boolean craftingBronzeEnabled = true;
public static boolean getCraftingBronzeEnabled() {
@@ -81,7 +72,6 @@ public class Config {
public static boolean craftingStampsEnabled = true;
public static final ArrayList<String> collectorStamps = new ArrayList<String>();
public static boolean applePickup = true;
public static boolean squareFarms = false;
// Mail
@@ -160,13 +150,6 @@ public class Config {
genTinOre.Comment = "set to false to force forestry to skip generating own tin ore blocks in the world";
generateTinOre = Boolean.parseBoolean(genTinOre.Value);
Property planterSideSense = config.get("planters.sidesensitive", CATEGORY_COMMON, true);
planterSideSense.Comment = "set to false if farms should output all harvested products regardless of side a pipe is attached to";
planterSideSensitive = Boolean.parseBoolean(planterSideSense.Value);
Property harvesterSideSense = config.get("harvesters.sidesensitive", CATEGORY_COMMON, true);
harvesterSideSense.Comment = "set to false if harvesters should output all harvested products regardless of side a pipe is attached to";
harvesterSideSensitive = Boolean.parseBoolean(harvesterSideSense.Value);
Property bronzeRecipe = config.get("crafting.bronze.enabled", CATEGORY_COMMON, true);
bronzeRecipe.Comment = "set to false to disable crafting recipe for bronze";
craftingBronzeEnabled = Boolean.parseBoolean(bronzeRecipe.Value);
@@ -189,10 +172,6 @@ public class Config {
indicatorEnable.Comment = "set to false to disable the mail alert box";
mailAlertEnabled = Boolean.parseBoolean(indicatorEnable.Value);
Property appleHarvest = config.get("tweaks.apple.pickup.enabled", CATEGORY_COMMON, true);
appleHarvest.Comment = "set to false to disable apple pickup by appropriate harvesters";
applePickup = Boolean.parseBoolean(appleHarvest.Value);
Property clearGenome = config.get("genetics.clear.invalid.chromosomes", CATEGORY_COMMON, clearInvalidChromosomes);
clearGenome.Comment = "set to true to clear chromosomes which contain invalid alleles. might rescue your save if it is crashing after the removal of a bee addon.";
clearInvalidChromosomes = Boolean.parseBoolean(clearGenome.Value);
@@ -219,10 +198,6 @@ public class Config {
property.Comment = "set to true to disable access restrictions on forestry machines.";
Config.disablePermissions = Boolean.parseBoolean(property.Value);
property = config.get("tweaks.nags.disabled", CATEGORY_COMMON, false);
property.Comment = "set to true to disable some nagging and warnings (e.g. GregTech).";
Config.disableNags = Boolean.parseBoolean(property.Value);
property = config.get("tweaks.upgradenotice.disabled", CATEGORY_COMMON, false);
property.Comment = "set to true to disable update and version check notice.";
Config.disableVersionCheck = isDebug || Boolean.parseBoolean(property.Value);
@@ -17,6 +17,7 @@ import forestry.api.core.ForestryAPI;
import forestry.api.storage.BackpackStowEvent;
import forestry.api.storage.EnumBackpackType;
import forestry.api.storage.IBackpackDefinition;
import forestry.core.config.Config;
import forestry.core.config.Defaults;
import forestry.core.inventory.InvTools;
import forestry.core.inventory.ItemInventory;
@@ -120,14 +121,12 @@ public class ItemBackpack extends ItemInventoried {
private void switchMode(ItemStack itemstack) {
BackpackMode mode = getMode(itemstack);
if (mode == BackpackMode.RESUPPLY)
itemstack.setItemDamage(0);
else if (mode == BackpackMode.RECEIVE)
itemstack.setItemDamage(3);
else if (mode == BackpackMode.LOCKED)
itemstack.setItemDamage(2);
else
itemstack.setItemDamage(1);
int nextMode = mode.ordinal() + 1;
if (!Config.enableBackpackResupply && nextMode == BackpackMode.RESUPPLY.ordinal()) {
nextMode++;
}
nextMode %= BackpackMode.values().length;
itemstack.setItemDamage(nextMode);
}
private IInventory getInventoryHit(World world, int x, int y, int z, int side) {