This repository was archived by the owner on Jan 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added config options for bomb, fire, and lightning arrows. Made ice a…
…rrows create frosted ice instead of regular ice when hittting water.
- Loading branch information
Showing
7 changed files
with
197 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package bullseye.client.gui; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import bullseye.config.ConfigurationHandler; | ||
import bullseye.core.Bullseye; | ||
import net.minecraft.client.gui.GuiScreen; | ||
import net.minecraft.util.text.translation.I18n; | ||
import net.minecraftforge.common.config.ConfigElement; | ||
import net.minecraftforge.fml.client.config.DummyConfigElement; | ||
import net.minecraftforge.fml.client.config.GuiConfig; | ||
import net.minecraftforge.fml.client.config.IConfigElement; | ||
|
||
public class GuiBEConfig extends GuiConfig | ||
{ | ||
public GuiBEConfig(GuiScreen parentScreen) | ||
{ | ||
super(parentScreen, GuiBEConfig.getConfigElements(), Bullseye.MOD_ID, false, false, "/bullseye"); | ||
} | ||
|
||
private static List<IConfigElement> getConfigElements() | ||
{ | ||
List<IConfigElement> list = new ArrayList<IConfigElement>(); | ||
|
||
List<IConfigElement> arrowSettings = new ConfigElement(ConfigurationHandler.config.getCategory(ConfigurationHandler.arrowSettings.toLowerCase())).getChildElements(); | ||
|
||
list.add(new DummyConfigElement.DummyCategoryElement(I18n.translateToLocal("config.category.arrowSettings.title"), "config.category.arrowSettings", arrowSettings)); | ||
|
||
return list; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package bullseye.client.gui; | ||
|
||
import java.util.Set; | ||
|
||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.GuiScreen; | ||
import net.minecraftforge.fml.client.IModGuiFactory; | ||
|
||
public class GuiFactory implements IModGuiFactory { | ||
|
||
@Override | ||
public void initialize(Minecraft minecraftInstance) { } | ||
|
||
@Override | ||
public Class<? extends GuiScreen> mainConfigGuiClass() | ||
{ | ||
return GuiBEConfig.class; | ||
} | ||
|
||
@Override | ||
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() { return null; } | ||
|
||
@Override | ||
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) { return null; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/******************************************************************************* | ||
* Copyright 2015-2016, the Biomes O' Plenty Team | ||
* | ||
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. | ||
* | ||
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. | ||
******************************************************************************/ | ||
|
||
package bullseye.config; | ||
|
||
import java.io.File; | ||
|
||
import bullseye.core.Bullseye; | ||
import net.minecraftforge.common.config.Configuration; | ||
import net.minecraftforge.fml.client.event.ConfigChangedEvent; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
|
||
public class ConfigurationHandler | ||
{ | ||
public static Configuration config; | ||
|
||
public static String arrowSettings = "Arrow Settings"; | ||
|
||
public static boolean explodeBombArrows; | ||
public static boolean burnFireArrows; | ||
public static boolean fireLightningArrows; | ||
|
||
public static void init(File configFile) | ||
{ | ||
if (config == null) | ||
{ | ||
config = new Configuration(configFile); | ||
loadConfiguration(); | ||
} | ||
} | ||
|
||
private static void loadConfiguration() | ||
{ | ||
try | ||
{ | ||
explodeBombArrows = config.getBoolean("Bombs Arrows Destroy Blocks", arrowSettings, true, "Allow Bomb Arrows to destroy blocks."); | ||
burnFireArrows = config.getBoolean("Fire Arrows Burn Blocks", arrowSettings, true, "Allow Fire Arrows to catch fire to blocks."); | ||
fireLightningArrows = config.getBoolean("Lightning Arrows Burn Blocks", arrowSettings, true, "Allow Lightning Arrows to catch fire to blocks."); | ||
} | ||
catch (Exception e) | ||
{ | ||
Bullseye.logger.error("Bullseye has encountered a problem loading misc.cfg", e); | ||
} | ||
finally | ||
{ | ||
if (config.hasChanged()) config.save(); | ||
} | ||
} | ||
|
||
@SubscribeEvent | ||
public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) | ||
{ | ||
if (event.getModID().equalsIgnoreCase(Bullseye.MOD_ID)) | ||
{ | ||
loadConfiguration(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/******************************************************************************* | ||
* Copyright 2014-2016, the Biomes O' Plenty Team | ||
* | ||
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. | ||
* | ||
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. | ||
******************************************************************************/ | ||
|
||
package bullseye.init; | ||
|
||
import java.io.File; | ||
|
||
import bullseye.config.ConfigurationHandler; | ||
import net.minecraftforge.common.MinecraftForge; | ||
|
||
public class ModConfiguration | ||
{ | ||
public static void init(File configDirectory) | ||
{ | ||
ConfigurationHandler.init(new File(configDirectory, "config.cfg")); | ||
MinecraftForge.EVENT_BUS.register(new ConfigurationHandler()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters