Merge pull request #9 from anonymouspineapple/patch-10

Removed duplicate Red Water entries
This commit is contained in:
Lure 2012-12-05 15:07:53 -08:00
commit 5a87f5e0bc
17 changed files with 287 additions and 120 deletions

View file

@ -1,5 +1,5 @@
## Welcome to Equivalent Exchange 3!
Setup MCP was done mostly by the people who update the wiki, I just changed it a bit. Some credit goes to BuildCraft's README.md, which I based this README off of.
Setup MCP was done mostly by the people who update How to Compile for Beginners on the wiki, I just updated/changed it a bit. Some credit goes to BuildCraft's README.md, which I based this README off of.
The Minecraft Forums page can be found [here] (http://www.minecraftforum.net/topic/1540010-equivalent-exchange-3).
@ -7,7 +7,8 @@ The Minecraft Forums page can be found [here] (http://www.minecraftforum.net/top
IMPORTANT: This is not guaranteed to work as it has not been tested extensively (Linux and Windows tested).
____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
#### Prerequisites (Tested for Windows 7 ONLY!)
1. Download and install the Java JDK [here](http://www.oracle.com/technetwork/java/javase/downloads/index.html). Click the one that says `Java Platform (JDK) #u#`, and follow instructions.
0. WARNING: Make sure you know EXACTLY what you're doing! It's not any of our faults if your OS crashes, becomes corrupted, etc.
1. Download and install the Java JDK [here](http://www.oracle.com/technetwork/java/javase/downloads/jdk7u9-downloads-1859576.html). Scroll down, accept the Oracle Binary Code License Agreement for Java SE, and download the one pertaining to your OS.
* Go to `Control Panel\System and Security\System`, and click on `Advanced System Settings` on the left-hand side.
* Click on `Environment Variables`.
* Under `System Variables`, click `New`.
@ -23,10 +24,10 @@ ________________________________________________________________________________
* For `Variable Value`, input `C:\Ant\apache-ant-1.8.4` (or your Ant directory \apache-ant-1.8.4).
* Scroll down to `Path`, and double-click on it.
* Append `;C:\Ant\apache-ant-1.8.4\bin` exactly as shown to the end (or your Ant directory \apache-ant-1.8.4\bin).
3. Download and install Github [here] (http://windows.github.com/).
3. Download and install Github [here] (http://windows.github.com/) (Windows) or [here] (http://mac.github.com/) (Mac OS X 10.7+). For Linux, I *guess* you could download it as a .zip/tarball and unzip it?
* Create an account.
* Scroll to the top of this page, login at the top-right, and then click `Clone to Windows` near the top-left of the page..
* You should see Github flash and `pahimar/Equivalent-Exchange-3` appear. (The local repository defaults to `C:\Users\(username)\Documents\GitHub\Equivalent-Exchange-3`, you can change it if you want but then you have to find it again on Github).
* Scroll to the top of this page, login at the top-right, and then click `Clone to Windows/Mac` near the top-left of the page.
* You should see Github flash and `pahimar/Equivalent-Exchange-3` appear. (The local repository on Windows defaults to `C:\Users\(username)\Documents\GitHub\Equivalent-Exchange-3`, you can change it if you want but then you have to find it again on Github).
4. Create an empty directory for EE3 development. This directory is refernced as `mcdev` from now on. It can be where you cloned EE3, but it'll be a little messy.
5. You are now ready to setup MCP!
@ -36,16 +37,10 @@ ________________________________________________________________________________
1. Download the latest version of MCP from [here] (http://mcp.ocean-labs.de/index.php/MCP_Releases), e.g. mcp723.zip. Install MCP dependencies as listed on the website if neccessary.
2. Inside `mcdev`, create a directory named `mcp` and unzip the MCP .zip file into it.
* To verify, check if a file name `CHANGELOG` exists inside `mcp`.
3. Get an unmodded copy of minecraft's `bin` folder. Currently EE3 runs on 1.4.5 but that might have changed.
4. From your `.minecraft` directory (on Windows, defaults to `%appdata%\.minecraft`), copy the `bin` and the `resources` (not sure if necessary) directory to the `jars` directory inside `mcp`. (Forge might do this for you, not confirmed.)
5. Get an unmodded copy of `minecraft_server.jar` and also place it into `jars`. (Forge might do this for you)
6. Download the latest forge **source** for Minecraft 1.4.5 and unzip it into `mcp` so that `mcp\forge\install.sh` exists. You need at least Forge 6.4.0, best way is to get it from [here] (http://files.minecraftforge.net/).
7. Execute `install.sh` (Linux and Mac) or `install.cmd` (Windows), both found in `mcdev\mcp\forge`. On Linux you might have to `chmod +x` `install.sh` before you can execute it. On some system configurations you need to execute `install.sh` from within the `forge` directory whereas on others it doesn't matter. Just check the output for error messages to find out what you need to do.
* To verify, check if a file named `CHANGELOG` exists inside `mcp`.
3. Download the latest forge **source** for Minecraft 1.4.5 and unzip it into `mcp`. You need at least Forge 6.4.0, best way is to get it from [here] (http://files.minecraftforge.net/).
* To verify, check if a application named `install.sh` exists.
4. Execute `install.sh` (Linux and Mac) or `install.cmd` (Windows), both found in `mcdev\mcp\forge`. On Linux you might have to `chmod +x` `install.sh` before you can execute it. On some system configurations you need to execute `install.sh` from within the `forge` directory whereas on others it doesn't matter. Just check the output for error messages to find out what you need to do.
#### Setup EE3 (Some tested for Linux, tested fully for Windows)
1. Inside `mcdev`, create a directory named `source`.
@ -63,33 +58,33 @@ ________________________________________________________________________________
\-jars
\-source
\-Equivalent-Exchange-3
\-EE3's files, (should have build.xml).
\-EE3's files (should have build.xml).
***
4. Inside `Equivalent-Exchange-3`, create a new file called `build.properties`.
* Open it up, and type into it the following:
* `dir.development=../../`
* `dir.share=Shared` (or what you want it to be-optional)
* `dir.release=Releases` (what you want it to be)
* `release.minecraft.version=1.4.5` (as of 11/30)
* `release.mod.version=pre2` (or whatever version # want it to be)
* `release.minecraft.version=1.4.5` (as of 12/02)
* `release.mod.version=pre1d` (or whatever version # want it to be)
5. [FOR WINDOWS] Open up `cmd` by typing `cmd` in Run.
6. [FOR WINDOWS] Navigate to `mcdev\source\Equivalent-Exchange-3` by executing `cd mcdev's location\source\Equivalent-Exchange-3`.
7. Execute `ant release`. This will generally take around 5-15 minutes, depending on your computer. If you've done everything right, `BUILD SUCCESSFUL` is displayed after it finishes.
* If you see `BUILD FAILED`, check the error output (it should be right around `BUILD FAILED`), fix everything, and try again.
8. Go to `mcdev\source\Equivalent-Exchange-3\Releases\1.4.5\pre2` (This might be different according to what you put in build.properties).
* You should see a .jar named `ee3-universal-pre2.jar` (Again, might be different).
8. Go to `mcdev\source\Equivalent-Exchange-3\Releases\1.4.5\pre1d` (This might be different according to what you put in build.properties).
* You should see a .jar named `ee3-universal-pre1d.jar` (Again, might be different).
9. Copy the jar into your Minecraft mods folder, and play Minecraft!
### To Update EE3 (For Windows/Mac?)
#### Update EE3 (For Windows/Mac)
1. Check to see if pahimar updated EE3 since you last compiled. If he/she did, follow these instructions.
2. Open Github.
3. Double-click on pahimar/Equivalent-Exchange-3.
4. At the top, there is a button named `Sync` (or `Refreshing...` if its still checking).
4. At the top, there is a button named `Sync`/`Sync Branch` (Mac) (or `Refreshing...` if it's still checking).
5. Click `Sync`, and wait for it to finish.

View file

@ -0,0 +1,39 @@
package ee3.common.core.addons;
import java.util.logging.Level;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import ee3.common.core.helper.LogHelper;
import ee3.common.core.helper.RecipeHelper;
import ee3.common.recipe.RecipesTransmutationStone;
import net.minecraft.src.Block;
import net.minecraft.src.ItemStack;
import net.minecraft.src.ModLoader;
public class AddonRedPower2 {
public static Block rp2Stone = null;
public static void initWorld() {
if (Loader.isModLoaded("RedPowerWorld")) {
try {
rp2Stone = (Block) Class.forName("RedPowerWorld").getField("blockStone").get(null);
for (ItemStack stone: RecipesTransmutationStone.transmutationStones) {
// Extremely temporary recipe
RecipeHelper.addRecipe(new ItemStack(rp2Stone.blockID, 1, 3), stone, Block.cobblestone, Block.cobblestone, Block.cobblestone, Block.cobblestone, Block.cobblestone, Block.cobblestone);
}
LogHelper.log(Level.INFO, "Loaded RP2 World addon");
}
catch (Exception e) {
LogHelper.log(Level.SEVERE, "Could not load RP2 World addon");
e.printStackTrace(System.err);
}
}
}
}

View file

@ -1,5 +1,7 @@
package ee3.common.core.handlers;
import ee3.common.core.addons.AddonRedPower2;
/**
* AddonHandler
*
@ -12,6 +14,8 @@ package ee3.common.core.handlers;
*/
public class AddonHandler {
public static void init() {}
public static void init() {
AddonRedPower2.initWorld();
}
}

View file

@ -25,8 +25,12 @@ import static net.minecraftforge.common.Configuration.*;
*/
public class ConfigurationHandler {
private static final String CATEGORY_KEYBIND = "keybinds";
private static final String CATEGORY_KEYBIND = "keybindings";
private static final String CATEGORY_GRAPHICS = "graphics";
private static final String CATEGORY_TRANSMUTATION = "transmutation";
private static final String CATEGORY_BLOCK_PROPERTIES = Configuration.CATEGORY_BLOCK + Configuration.CATEGORY_SPLITTER + "properties";
private static final String CATEGORY_RED_WATER_PROPERTIES = CATEGORY_BLOCK_PROPERTIES + Configuration.CATEGORY_SPLITTER + "red_water";
private static final String CATEGORY_DURABILITY = Configuration.CATEGORY_ITEM + Configuration.CATEGORY_SPLITTER + "durability";
public static void init(File configFile) {
Configuration configuration = new Configuration(configFile);
@ -34,21 +38,15 @@ public class ConfigurationHandler {
try {
configuration.load();
/* General Configs */
/* General configs */
ConfigurationSettings.ENABLE_VERSION_CHECK = configuration
.get(CATEGORY_GENERAL, ConfigurationSettings.ENABLE_VERSION_CHECK_CONFIGNAME, ConfigurationSettings.ENABLE_VERSION_CHECK_DEFAULT)
.getBoolean(ConfigurationSettings.ENABLE_VERSION_CHECK_DEFAULT);
ConfigurationSettings.ENABLE_SOUNDS = configuration
.get(CATEGORY_GENERAL, ConfigurationSettings.ENABLE_SOUNDS_CONFIGNAME, ConfigurationSettings.ENABLE_SOUNDS_DEFAULT)
.getBoolean(ConfigurationSettings.ENABLE_SOUNDS_DEFAULT);
ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST = configuration
.get(CATEGORY_GENERAL, ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST_CONFIGNAME, ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST_DEFAULT)
.getInt(ConfigurationSettings.MINIUM_STONE_TRANSMUTE_COST_DEFAULT);
ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY = configuration
.get(CATEGORY_GENERAL, ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_CONFIGNAME, ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_DEFAULT)
.getInt(ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_DEFAULT);
/* Graphics/Rendering Configs */
/* Graphic configs */
ConfigurationSettings.ENABLE_PARTICLE_FX = configuration
.get(CATEGORY_GRAPHICS, ConfigurationSettings.ENABLE_PARTICLE_FX_CONFIGNAME, ConfigurationSettings.ENABLE_PARTICLE_FX_DEFAULT)
.getBoolean(ConfigurationSettings.ENABLE_PARTICLE_FX_DEFAULT);
@ -56,18 +54,34 @@ public class ConfigurationHandler {
.get(CATEGORY_GRAPHICS, ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION_CONFIGNAME, ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION_DEFAULT)
.getBoolean(ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION_DEFAULT);
/* Block Configs */
ConfigurationSettings.AUTO_RESOLVE_BLOCK_IDS = configuration
.get(CATEGORY_BLOCK, ConfigurationSettings.AUTO_RESOLVE_BLOCK_IDS_CONFIGNAME, ConfigurationSettings.AUTO_RESOLVE_BLOCK_IDS_DEFAULT)
.getBoolean(ConfigurationSettings.AUTO_RESOLVE_BLOCK_IDS_DEFAULT);
/* Block configs */
BlockIds.CALCINATOR = configuration
.getBlock(Strings.CALCINATOR_NAME, BlockIds.CALCINATOR_DEFAULT)
.getInt(BlockIds.CALCINATOR_DEFAULT);
BlockIds.RED_WATER_STILL = configuration
.getBlock(Strings.RED_WATER_STILL_NAME, BlockIds.RED_WATER_STILL_DEFAULT)
.getInt(BlockIds.RED_WATER_STILL_DEFAULT);
/* Block property configs */
configuration.addCustomCategoryComment(CATEGORY_BLOCK_PROPERTIES, "Custom block properties");
/* Red Water configs */
configuration.addCustomCategoryComment(CATEGORY_RED_WATER_PROPERTIES, "Configuration settings for various properties of Red Water");
ConfigurationSettings.RED_WATER_DURATION_BASE = configuration
.get(CATEGORY_RED_WATER_PROPERTIES, ConfigurationSettings.RED_WATER_DURATION_BASE_CONFIGNAME, ConfigurationSettings.RED_WATER_DURATION_BASE_DEFAULT)
.getInt(ConfigurationSettings.RED_WATER_DURATION_BASE_DEFAULT);
ConfigurationSettings.RED_WATER_DURATION_MODIFIER = configuration
.get(CATEGORY_RED_WATER_PROPERTIES, ConfigurationSettings.RED_WATER_DURATION_MODIFIER_CONFIGNAME, ConfigurationSettings.RED_WATER_DURATION_MODIFIER_DEFAULT)
.getInt(ConfigurationSettings.RED_WATER_DURATION_MODIFIER_DEFAULT);
ConfigurationSettings.RED_WATER_RANGE_BASE = configuration
.get(CATEGORY_RED_WATER_PROPERTIES, ConfigurationSettings.RED_WATER_RANGE_BASE_CONFIGNAME, ConfigurationSettings.RED_WATER_RANGE_BASE_DEFAULT)
.getInt(ConfigurationSettings.RED_WATER_RANGE_BASE_DEFAULT);
ConfigurationSettings.RED_WATER_RANGE_MODIFIER = configuration
.get(CATEGORY_RED_WATER_PROPERTIES, ConfigurationSettings.RED_WATER_RANGE_MODIFIER_CONFIGNAME, ConfigurationSettings.RED_WATER_RANGE_MODIFIER_DEFAULT)
.getInt(ConfigurationSettings.RED_WATER_RANGE_MODIFIER_DEFAULT);
/* Item Configs */
/* Item configs */
ItemIds.MINIUM_SHARD = configuration
.getItem(Strings.MINIUM_SHARD_NAME, ItemIds.MINIUM_SHARD_DEFAULT)
.getInt(ItemIds.MINIUM_SHARD_DEFAULT);
@ -86,21 +100,40 @@ public class ConfigurationHandler {
ItemIds.ALCHEMY_BAG = configuration
.getItem(Strings.ALCHEMY_BAG_NAME, ItemIds.ALCHEMY_BAG_DEFAULT)
.getInt(ItemIds.ALCHEMY_BAG_DEFAULT);
/* Item durability configs */
ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY = configuration
.get(CATEGORY_DURABILITY, ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_CONFIGNAME, ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_DEFAULT)
.getInt(ConfigurationSettings.MINIUM_STONE_MAX_DURABILITY_DEFAULT);
ConfigurationSettings.PHILOSOPHERS_STONE_MAX_DURABILITY = configuration
.get(CATEGORY_DURABILITY, ConfigurationSettings.PHILOSOPHERS_STONE_MAX_DURABILITY_CONFIGNAME, ConfigurationSettings.PHILOSOPHERS_STONE_MAX_DURABILITY_DEFAULT)
.getInt(ConfigurationSettings.PHILOSOPHERS_STONE_MAX_DURABILITY_DEFAULT);
/* KeyBinding Configs */
configuration.addCustomCategoryComment(CATEGORY_KEYBIND, "");
EquivalentExchange3.proxy.setKeyBinding(Reference.KEYBINDING_EXTRA, configuration
.get(CATEGORY_KEYBIND, Reference.KEYBINDING_EXTRA, Reference.KEYBINDING_EXTRA_DEFAULT)
.getInt(Reference.KEYBINDING_EXTRA_DEFAULT));
EquivalentExchange3.proxy.setKeyBinding(Reference.KEYBINDING_CHARGE, configuration
.get(CATEGORY_KEYBIND, Reference.KEYBINDING_CHARGE, Reference.KEYBINDING_CHARGE_DEFAULT)
.getInt(Reference.KEYBINDING_CHARGE_DEFAULT));
EquivalentExchange3.proxy.setKeyBinding(Reference.KEYBINDING_TOGGLE, configuration
.get(CATEGORY_KEYBIND, Reference.KEYBINDING_TOGGLE, Reference.KEYBINDING_TOGGLE_DEFAULT)
.getInt(Reference.KEYBINDING_TOGGLE_DEFAULT));
EquivalentExchange3.proxy.setKeyBinding(Reference.KEYBINDING_RELEASE, configuration
.get(CATEGORY_KEYBIND, Reference.KEYBINDING_RELEASE, Reference.KEYBINDING_RELEASE_DEFAULT)
.getInt(Reference.KEYBINDING_RELEASE_DEFAULT));
/* KeyBinding configs */
configuration.addCustomCategoryComment(CATEGORY_KEYBIND, "Keybindings for Equivalent Exchange 3. See http://www.minecraftwiki.net/wiki/Key_codes for mapping of key codes to keyboard keys");
EquivalentExchange3.proxy.setKeyBinding(ConfigurationSettings.KEYBINDING_EXTRA, configuration
.get(CATEGORY_KEYBIND, ConfigurationSettings.KEYBINDING_EXTRA, ConfigurationSettings.KEYBINDING_EXTRA_DEFAULT)
.getInt(ConfigurationSettings.KEYBINDING_EXTRA_DEFAULT));
EquivalentExchange3.proxy.setKeyBinding(ConfigurationSettings.KEYBINDING_CHARGE, configuration
.get(CATEGORY_KEYBIND, ConfigurationSettings.KEYBINDING_CHARGE, ConfigurationSettings.KEYBINDING_CHARGE_DEFAULT)
.getInt(ConfigurationSettings.KEYBINDING_CHARGE_DEFAULT));
EquivalentExchange3.proxy.setKeyBinding(ConfigurationSettings.KEYBINDING_TOGGLE, configuration
.get(CATEGORY_KEYBIND, ConfigurationSettings.KEYBINDING_TOGGLE, ConfigurationSettings.KEYBINDING_TOGGLE_DEFAULT)
.getInt(ConfigurationSettings.KEYBINDING_TOGGLE_DEFAULT));
EquivalentExchange3.proxy.setKeyBinding(ConfigurationSettings.KEYBINDING_RELEASE, configuration
.get(CATEGORY_KEYBIND, ConfigurationSettings.KEYBINDING_RELEASE, ConfigurationSettings.KEYBINDING_RELEASE_DEFAULT)
.getInt(ConfigurationSettings.KEYBINDING_RELEASE_DEFAULT));
/* Transmutation configs */
ConfigurationSettings.TRANSMUTE_COST_ITEM = configuration
.get(CATEGORY_TRANSMUTATION, ConfigurationSettings.TRANSMUTE_COST_ITEM_CONFIGNAME, ConfigurationSettings.TRANSMUTE_COST_ITEM_DEFAULT)
.getInt(ConfigurationSettings.TRANSMUTE_COST_ITEM_DEFAULT);
ConfigurationSettings.TRANSMUTE_COST_BLOCK = configuration
.get(CATEGORY_TRANSMUTATION, ConfigurationSettings.TRANSMUTE_COST_BLOCK_CONFIGNAME, ConfigurationSettings.TRANSMUTE_COST_BLOCK_DEFAULT)
.getInt(ConfigurationSettings.TRANSMUTE_COST_BLOCK_DEFAULT);
ConfigurationSettings.TRANSMUTE_COST_MOB = configuration
.get(CATEGORY_TRANSMUTATION, ConfigurationSettings.TRANSMUTE_COST_MOB_CONFIGNAME, ConfigurationSettings.TRANSMUTE_COST_MOB_DEFAULT)
.getInt(ConfigurationSettings.TRANSMUTE_COST_MOB_DEFAULT);
}
catch (Exception e) {
FMLLog.log(Level.SEVERE, e, Reference.MOD_NAME + " has had a problem loading its configuration");

View file

@ -1,7 +1,7 @@
package ee3.common.core.helper;
import ee3.common.block.ModBlocks;
import ee3.common.lib.Reference;
import ee3.common.lib.ConfigurationSettings;
import net.minecraft.src.AxisAlignedBB;
import net.minecraft.src.Block;
import net.minecraft.src.EntityLiving;
@ -24,12 +24,12 @@ public class RedWaterHelper {
}
public static boolean isBlockInBB(World world, AxisAlignedBB par1AxisAlignedBB, Block block) {
int minX = MathHelper.floor_double(par1AxisAlignedBB.minX - Reference.BLOCK_RED_WATER_RANGE_BASE * Reference.BLOCK_RED_WATER_RANGE_MODIFIER * 1.0D);
int maxX = MathHelper.floor_double(par1AxisAlignedBB.maxX + Reference.BLOCK_RED_WATER_RANGE_BASE * Reference.BLOCK_RED_WATER_RANGE_MODIFIER * 1.0D);
int minY = MathHelper.floor_double(par1AxisAlignedBB.minY - Reference.BLOCK_RED_WATER_RANGE_BASE * Reference.BLOCK_RED_WATER_RANGE_MODIFIER * 1.0D);
int maxY = MathHelper.floor_double(par1AxisAlignedBB.maxY + Reference.BLOCK_RED_WATER_RANGE_BASE * Reference.BLOCK_RED_WATER_RANGE_MODIFIER * 1.0D);
int minZ = MathHelper.floor_double(par1AxisAlignedBB.minZ - Reference.BLOCK_RED_WATER_RANGE_BASE * Reference.BLOCK_RED_WATER_RANGE_MODIFIER * 1.0D);
int maxZ = MathHelper.floor_double(par1AxisAlignedBB.maxZ + Reference.BLOCK_RED_WATER_RANGE_BASE * Reference.BLOCK_RED_WATER_RANGE_MODIFIER * 1.0D);
int minX = MathHelper.floor_double(par1AxisAlignedBB.minX - ConfigurationSettings.RED_WATER_RANGE_BASE * ConfigurationSettings.RED_WATER_RANGE_MODIFIER * 1.0D);
int maxX = MathHelper.floor_double(par1AxisAlignedBB.maxX + ConfigurationSettings.RED_WATER_RANGE_BASE * ConfigurationSettings.RED_WATER_RANGE_MODIFIER * 1.0D);
int minY = MathHelper.floor_double(par1AxisAlignedBB.minY - ConfigurationSettings.RED_WATER_RANGE_BASE * ConfigurationSettings.RED_WATER_RANGE_MODIFIER * 1.0D);
int maxY = MathHelper.floor_double(par1AxisAlignedBB.maxY + ConfigurationSettings.RED_WATER_RANGE_BASE * ConfigurationSettings.RED_WATER_RANGE_MODIFIER * 1.0D);
int minZ = MathHelper.floor_double(par1AxisAlignedBB.minZ - ConfigurationSettings.RED_WATER_RANGE_BASE * ConfigurationSettings.RED_WATER_RANGE_MODIFIER * 1.0D);
int maxZ = MathHelper.floor_double(par1AxisAlignedBB.maxZ + ConfigurationSettings.RED_WATER_RANGE_BASE * ConfigurationSettings.RED_WATER_RANGE_MODIFIER * 1.0D);
for (int i = minX; i < maxX; ++i) {
for (int j = minY; j < maxY; ++j) {

View file

@ -93,7 +93,7 @@ public class ItemMiniumStone extends ItemEE
@Override
public void doKeyBindingAction(EntityPlayer thePlayer, ItemStack itemStack, String keyBinding) {
if (keyBinding.equals(Reference.KEYBINDING_EXTRA)) {
if (keyBinding.equals(ConfigurationSettings.KEYBINDING_EXTRA)) {
openPortableCrafting(thePlayer);
}

View file

@ -7,6 +7,7 @@ import cpw.mods.fml.common.network.PacketDispatcher;
import ee3.common.EquivalentExchange3;
import ee3.common.core.helper.NBTHelper;
import ee3.common.core.helper.TransmutationHelper;
import ee3.common.lib.ConfigurationSettings;
import ee3.common.lib.CustomItemRarity;
import ee3.common.lib.GuiIds;
import ee3.common.lib.Reference;
@ -39,6 +40,7 @@ public class ItemPhilosopherStone extends ItemEE
this.setIconCoord(2, 0);
this.setItemName(Strings.PHILOSOPHER_STONE_NAME);
this.setCreativeTab(EquivalentExchange3.tabsEE3);
this.setMaxDamage(ConfigurationSettings.PHILOSOPHERS_STONE_MAX_DURABILITY - 1);
this.maxChargeLevel = 3;
}
@ -66,10 +68,24 @@ public class ItemPhilosopherStone extends ItemEE
return true;
}
@Override
public ItemStack getContainerItemStack(ItemStack itemStack) {
itemStack.setItemDamage(itemStack.getItemDamage() + 1);
return itemStack;
}
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World world, int x, int y, int z, int l, float f1, float f2, float f3) {
return TransmutationHelper.transmuteInWorld(world, entityPlayer, itemStack, x, y, z);
boolean result = TransmutationHelper.transmuteInWorld(world, entityPlayer, itemStack, x, y, z);
if (result) {
itemStack.damageItem(1, entityPlayer);
}
return result;
}
@Override
@ -81,40 +97,40 @@ public class ItemPhilosopherStone extends ItemEE
@Override
public short getCharge(ItemStack stack) {
return NBTHelper.getShort(stack, Strings.NBT_CHARGE_LEVEL_KEY);
return NBTHelper.getShort(stack, Strings.NBT_ITEM_CHARGE_LEVEL_KEY);
}
@Override
public void setCharge(ItemStack stack, short charge) {
if (charge <= maxChargeLevel) {
NBTHelper.setShort(stack, Strings.NBT_CHARGE_LEVEL_KEY, charge);
NBTHelper.setShort(stack, Strings.NBT_ITEM_CHARGE_LEVEL_KEY, charge);
}
}
@Override
public void increaseCharge(ItemStack stack) {
if (NBTHelper.getShort(stack, Strings.NBT_CHARGE_LEVEL_KEY) < maxChargeLevel) {
NBTHelper.setShort(stack, Strings.NBT_CHARGE_LEVEL_KEY, (short) (NBTHelper.getShort(stack, Strings.NBT_CHARGE_LEVEL_KEY) + 1));
if (NBTHelper.getShort(stack, Strings.NBT_ITEM_CHARGE_LEVEL_KEY) < maxChargeLevel) {
NBTHelper.setShort(stack, Strings.NBT_ITEM_CHARGE_LEVEL_KEY, (short) (NBTHelper.getShort(stack, Strings.NBT_ITEM_CHARGE_LEVEL_KEY) + 1));
}
}
@Override
public void decreaseCharge(ItemStack stack) {
if (NBTHelper.getShort(stack, Strings.NBT_CHARGE_LEVEL_KEY) > 0) {
NBTHelper.setShort(stack, Strings.NBT_CHARGE_LEVEL_KEY, (short) (NBTHelper.getShort(stack, Strings.NBT_CHARGE_LEVEL_KEY) - 1));
if (NBTHelper.getShort(stack, Strings.NBT_ITEM_CHARGE_LEVEL_KEY) > 0) {
NBTHelper.setShort(stack, Strings.NBT_ITEM_CHARGE_LEVEL_KEY, (short) (NBTHelper.getShort(stack, Strings.NBT_ITEM_CHARGE_LEVEL_KEY) - 1));
}
}
@Override
public void doKeyBindingAction(EntityPlayer thePlayer, ItemStack itemStack, String keyBinding) {
if (keyBinding.equals(Reference.KEYBINDING_EXTRA)) {
if (keyBinding.equals(ConfigurationSettings.KEYBINDING_EXTRA)) {
openPortableCrafting(thePlayer);
}
else if (keyBinding.equals(Reference.KEYBINDING_CHARGE)) {
else if (keyBinding.equals(ConfigurationSettings.KEYBINDING_CHARGE)) {
if (!thePlayer.isSneaking()) {
increaseCharge(itemStack);
thePlayer.worldObj.playSoundAtEntity(thePlayer, Sounds.CHARGE_UP, 0.5F, 0.5F + (0.5F * (getCharge(itemStack) * 1.0F / maxChargeLevel)));

View file

@ -1,5 +1,6 @@
package ee3.common.lib;
import net.minecraftforge.common.Configuration;
import ee3.common.item.ModItems;
/**
@ -16,45 +17,96 @@ public class ConfigurationSettings {
/*
* General configuration settings
*/
// Whether or not automatic block id resolution for EE3 is turned on or off
public static boolean AUTO_RESOLVE_BLOCK_IDS;
public static final String ENABLE_VERSION_CHECK_CONFIGNAME = "enable_version_check";
public static final boolean AUTO_RESOLVE_BLOCK_IDS_DEFAULT = false;
// Whether or not EE3 sounds are enabled
public static boolean ENABLE_SOUNDS;
public static final String ENABLE_SOUNDS_CONFIGNAME = "enable_sounds";
public static final String ENABLE_SOUNDS_CONFIGNAME = "sounds.enabled";
public static final boolean ENABLE_SOUNDS_DEFAULT = true;
// Whether or not EE3 will do a version check when loaded
public static boolean ENABLE_VERSION_CHECK;
public static final String AUTO_RESOLVE_BLOCK_IDS_CONFIGNAME = "auto_resolve_block_ids";
public static final String ENABLE_VERSION_CHECK_CONFIGNAME = "version_check.enabled";
public static final boolean ENABLE_VERSION_CHECK_DEFAULT = true;
/*
* Render config settings
* Graphic config settings
*/
// Whether or not EE3 particle fx are enabled
public static boolean ENABLE_PARTICLE_FX;
public static final String ENABLE_PARTICLE_FX_CONFIGNAME = "enable_particle_fx";
public static final String ENABLE_PARTICLE_FX_CONFIGNAME = "particle_fx.enabled";
public static final boolean ENABLE_PARTICLE_FX_DEFAULT = true;
// Whether or not the in world transmutation overlay is enabled
public static boolean ENABLE_OVERLAY_WORLD_TRANSMUTATION;
public static final String ENABLE_OVERLAY_WORLD_TRANSMUTATION_CONFIGNAME = "enable_world_transmutation_overlay";
public static final String ENABLE_OVERLAY_WORLD_TRANSMUTATION_CONFIGNAME = "world_transmutation_overlay.enabled";
public static final boolean ENABLE_OVERLAY_WORLD_TRANSMUTATION_DEFAULT = true;
/*
* Minium stone config settings
* Block related config settings
*/
// The durability cost for each transmute with the Minium Stone
public static int MINIUM_STONE_TRANSMUTE_COST;
public static final String MINIUM_STONE_TRANSMUTE_COST_CONFIGNAME = Strings.MINIUM_STONE_NAME + ".transmuteCost";
public static final int MINIUM_STONE_TRANSMUTE_COST_DEFAULT = 1;
public static int RED_WATER_DURATION_BASE;
public static String RED_WATER_DURATION_BASE_CONFIGNAME = "duration.base";
public static final int RED_WATER_DURATION_BASE_DEFAULT = 5;
public static int RED_WATER_DURATION_MODIFIER;
public static String RED_WATER_DURATION_MODIFIER_CONFIGNAME = "duration.modifier";
public static final int RED_WATER_DURATION_MODIFIER_DEFAULT = 2;
public static int RED_WATER_RANGE_BASE;
public static String RED_WATER_RANGE_BASE_CONFIGNAME = "range.base";
public static final int RED_WATER_RANGE_BASE_DEFAULT = 1;
public static int RED_WATER_RANGE_MODIFIER;
public static String RED_WATER_RANGE_MODIFIER_CONFIGNAME = "range.modifier";
public static final int RED_WATER_RANGE_MODIFIER_DEFAULT = 3;
/*
* Item related config settings
*/
// The maximum durability for the Minium Stone
public static int MINIUM_STONE_MAX_DURABILITY;
public static final String MINIUM_STONE_MAX_DURABILITY_CONFIGNAME = Strings.MINIUM_STONE_NAME + ".maxDurability";
public static final String MINIUM_STONE_MAX_DURABILITY_CONFIGNAME = Strings.MINIUM_STONE_NAME;
public static final int MINIUM_STONE_MAX_DURABILITY_DEFAULT = 1521;
// The maximum durability for the Philosophers Stone
public static int PHILOSOPHERS_STONE_MAX_DURABILITY;
public static final String PHILOSOPHERS_STONE_MAX_DURABILITY_CONFIGNAME = Strings.PHILOSOPHER_STONE_NAME;
public static final int PHILOSOPHERS_STONE_MAX_DURABILITY_DEFAULT = 10001;
/*
* Keybinding related config settings
*/
// Extra key
public static final String KEYBINDING_EXTRA = "key.extra";
public static final int KEYBINDING_EXTRA_DEFAULT = 46;
// Release key
public static final String KEYBINDING_RELEASE = "key.release";
public static final int KEYBINDING_RELEASE_DEFAULT = 19;
// Toggle key
public static final String KEYBINDING_TOGGLE = "key.toggle";
public static final int KEYBINDING_TOGGLE_DEFAULT = 34;
// Charge key
public static final String KEYBINDING_CHARGE = "key.charge";
public static final int KEYBINDING_CHARGE_DEFAULT = 47;
/*
* Transmutation related config settings
*/
// The durability cost for each item transmutation
public static int TRANSMUTE_COST_ITEM;
public static final String TRANSMUTE_COST_ITEM_CONFIGNAME = Strings.TRANSMUTATION_COST_ITEM;
public static final int TRANSMUTE_COST_ITEM_DEFAULT = 1;
// The durability cost for each block transmutation
public static int TRANSMUTE_COST_BLOCK;
public static final String TRANSMUTE_COST_BLOCK_CONFIGNAME = Strings.TRANSMUTATION_COST_BLOCK;
public static final int TRANSMUTE_COST_BLOCK_DEFAULT = 1;
// The durability cost for each block transmutation
public static int TRANSMUTE_COST_MOB;
public static final String TRANSMUTE_COST_MOB_CONFIGNAME = Strings.TRANSMUTATION_COST_MOB;
public static final int TRANSMUTE_COST_MOB_DEFAULT = 1;
}

View file

@ -13,5 +13,6 @@ public class PacketIds {
public static final int KEYBINDING_PRESSED = 0;
public static final int TILEENTITY_UPDATE = 1;
public static final int WORLD_TRANSMUTATION_EVENT = 2;
}

View file

@ -24,25 +24,4 @@ public class Reference {
public static final String SERVER_PROXY_CLASS = "ee3.common.core.CommonProxy";
public static final String CLIENT_PROXY_CLASS = "ee3.client.core.ClientProxy";
/* KeyBinding related constants */
public static final String KEYBINDING_EXTRA = "key.extra";
public static final int KEYBINDING_EXTRA_DEFAULT = 46;
public static final String KEYBINDING_RELEASE = "key.release";
public static final int KEYBINDING_RELEASE_DEFAULT = 19;
public static final String KEYBINDING_TOGGLE = "key.toggle";
public static final int KEYBINDING_TOGGLE_DEFAULT = 34;
public static final String KEYBINDING_CHARGE = "key.charge";
public static final int KEYBINDING_CHARGE_DEFAULT = 47;
/* General Tile Entity related constants */
public static final String TE_GEN_OWNER_NBT_TAG_LABEL = "owner";
public static final String TE_GEN_STATE_NBT_TAG_LABEL = "state";
public static final String TE_GEN_DIRECTION_NBT_TAG_LABEL = "direction";
// TODO: Find a better spot for these
public static final int BLOCK_RED_WATER_EFFECT_DURATION_BASE = 5;
public static final int BLOCK_RED_WATER_EFFECT_DURATION_MODIFIER = 2;
public static final int BLOCK_RED_WATER_RANGE_BASE = 1;
public static final int BLOCK_RED_WATER_RANGE_MODIFIER = 3;
}

View file

@ -2,7 +2,7 @@ package ee3.common.lib;
public class Strings {
/* General text keys */
/* General keys */
/* Version check related constants */
public static final String VERSION_CHECK_DISABLED = "version.check_disabled";
@ -16,7 +16,11 @@ public class Strings {
public static final String GUI_CALCINATOR_NAME = "gui.calcinator.name";
/* NBT related constants */
public static final String NBT_CHARGE_LEVEL_KEY = "chargeLevel";
public static final String NBT_ITEM_CHARGE_LEVEL_KEY = "itemChargeLevel";
public static final String NBT_ITEM_MODE_KEY = "itemMode";
public static final String NBT_TE_OWNER_KEY = "teOwner";
public static final String NBT_TE_STATE_KEY = "teState";
public static final String NBT_TE_DIRECTION_KEY = "teDirection";
/* Block name constants */
public static final String CALCINATOR_NAME = "calcinator";
@ -33,5 +37,11 @@ public class Strings {
/* TileEntity name constants */
public static final String TE_CALCINATOR_NAME = "tileCalcinator";
/* Transmutation cost related constants */
public static final String TRANSMUTATION_COST = "_cost";
public static final String TRANSMUTATION_COST_ITEM = "item" + TRANSMUTATION_COST;
public static final String TRANSMUTATION_COST_BLOCK = "block" + TRANSMUTATION_COST;
public static final String TRANSMUTATION_COST_MOB = "mob" + TRANSMUTATION_COST;
}

View file

@ -19,7 +19,8 @@ import net.minecraft.src.Packet250CustomPayload;
*/
public enum PacketTypeHandler {
KEY(PacketKeyPressed.class),
TILE(PacketTileUpdate.class);
TILE(PacketTileUpdate.class),
WORLD_TRANSMUTATION(PacketWorldTransmutation.class);
private Class<? extends PacketEE> clazz;

View file

@ -0,0 +1,14 @@
package ee3.common.network;
public class PacketWorldTransmutation extends PacketEE {
public int originX, originY, originZ;
public int rangeX, rangeY, rangeZ;
public int targetID, targetMeta;
public PacketWorldTransmutation() {
super(PacketTypeHandler.TILE, true);
}
}

View file

@ -31,7 +31,8 @@ public class RecipesTransmutationStone {
private static ItemStack philStone = new ItemStack(ModItems.philStone, 1, -1);
private static ItemStack miniumStone = new ItemStack(ModItems.miniumStone, 1, -1);
private static List<ItemStack> transmutationStones = Arrays.asList(miniumStone, philStone);
public static List<ItemStack> transmutationStones = Arrays.asList(miniumStone, philStone);
private static ItemStack anyCoal = new ItemStack(Item.coal, 1, -1);
private static ItemStack anyWood = new ItemStack(Block.wood, 1, -1);

View file

@ -1,6 +1,7 @@
package ee3.common.tile;
import ee3.common.lib.Reference;
import ee3.common.lib.Strings;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.TileEntity;
@ -51,18 +52,18 @@ public class TileEE extends TileEntity {
public void readFromNBT(NBTTagCompound nbtTagCompound) {
super.readFromNBT(nbtTagCompound);
direction = nbtTagCompound.getByte(Reference.TE_GEN_DIRECTION_NBT_TAG_LABEL);
state = nbtTagCompound.getShort(Reference.TE_GEN_STATE_NBT_TAG_LABEL);
owner = nbtTagCompound.getString(Reference.TE_GEN_OWNER_NBT_TAG_LABEL);
direction = nbtTagCompound.getByte(Strings.NBT_TE_DIRECTION_KEY);
state = nbtTagCompound.getShort(Strings.NBT_TE_STATE_KEY);
owner = nbtTagCompound.getString(Strings.NBT_TE_OWNER_KEY);
}
public void writeToNBT(NBTTagCompound nbtTagCompound) {
super.writeToNBT(nbtTagCompound);
nbtTagCompound.setByte(Reference.TE_GEN_DIRECTION_NBT_TAG_LABEL, direction);
nbtTagCompound.setShort(Reference.TE_GEN_STATE_NBT_TAG_LABEL, state);
nbtTagCompound.setByte(Strings.NBT_TE_DIRECTION_KEY, direction);
nbtTagCompound.setShort(Strings.NBT_TE_STATE_KEY, state);
if(owner != null && owner != "") {
nbtTagCompound.setString(Reference.TE_GEN_OWNER_NBT_TAG_LABEL, owner);
nbtTagCompound.setString(Strings.NBT_TE_OWNER_KEY, owner);
}
}

View file

@ -10,14 +10,37 @@
<entry key="item.inertStone.name">Carreg Anadweithiol</entry>
<entry key="item.miniumStone.name">Carreg Miniwm</entry>
<entry key="item.philStone.name">Maen Athronwyr</entry>
<entry key="item.alchemyDust.ash.name">Lludw</entry>
<entry key="item.alchemyDust.minium.name">Llwch Miniwm</entry>
<entry key="item.alchemyDust.verdant.name">Llwch Werdd</entry>
<entry key="item.alchemyDust.azure.name">Llwch Asur</entry>
<entry key="item.alchemyDust.amaranthine.name">Llwch Amorol</entry>
<entry key="item.alchemyDust.iridescent.name">Llwch Symudliw</entry>
<entry key="item.alchemyBag.white.name">Bag Alcemaidd Gwyn</entry>
<entry key="item.alchemyBag.orange.name">Bag Alcemaidd Oren</entry>
<entry key="item.alchemyBag.magenta.name">Bag Alcemaidd Magenta</entry>
<entry key="item.alchemyBag.light_blue.name">Bag Alcemaidd Glas Golau</entry>
<entry key="item.alchemyBag.yellow.name">Bag Alcemaidd Melyn</entry>
<entry key="item.alchemyBag.lime.name">Bag Alcemaidd Leim</entry>
<entry key="item.alchemyBag.pink.name">Bag Alcemaidd Pinc</entry>
<entry key="item.alchemyBag.gray.name">Bag Alcemaidd Llwyd</entry>
<entry key="item.alchemyBag.light_gray.name">Bag Alcemaidd Llwyd Golau</entry>
<entry key="item.alchemyBag.cyan.name">Bag Alcemaidd Gwyrddlas</entry>
<entry key="item.alchemyBag.purple.name">Bag Alcemaidd Porffor</entry>
<entry key="item.alchemyBag.blue.name">Bag Alcemaidd Glas</entry>
<entry key="item.alchemyBag.brown.name">Bag Alcemaidd Brown</entry>
<entry key="item.alchemyBag.green.name">Bag Alcemaidd Gwyrdd</entry>
<entry key="item.alchemyBag.red.name">Bag Alcemaidd Coch</entry>
<entry key="item.alchemyBag.black.name">Bag Alcemaidd Du</entry>
<entry key="tile.redWaterStill.name">Dŵr Coch (Llonydd)</entry>
<entry key="tile.redWaterFlowing.name">Dŵr Coch (Llifeiriol)</entry>
<entry key="tile.calcinator.name">Calchyniadwr</entry>
<entry key="gui.calcinator.name">Calchyniadwr</entry>
<entry key="itemGroup.EE3">Equivalent Exchange 3</entry>
<entry key="version.init_log_message">Ymgychwynnu gwiriad fersiwn yn erbyn y ffeil awdurdod fersiwn o bell, a leolir ar</entry>
<entry key="version.uninitialized">Ni gyflawnwyd y gwiriad fersiwn yn llwyddiannus (ni ymgychwynodd y gwiriad fersiwn yn briodol)</entry>
<entry key="version.current">Rydych yn defnyddio y fersiwn diweddaraf ar gyfer eich fersiwn o Minecraft</entry>
<entry key="version.outdated">Rydych yn defnyddio fersiwn wedi dyddio; cysidrwch diweddaru yma - @MOD_UPDATE_LOCATION@</entry>
<entry key="version.uninitialized">Ni ymgychwynodd y gwiriad fersiwn yn briodol</entry>
<entry key="version.current">Rydych yn defnyddio y fersiwn diweddaraf (@REMOTE_MOD_VERSION@) o Equivalent Exchange 3 ar gyfer @MINECRAFT_VERSION@</entry>
<entry key="version.outdated">Mae yna fersiwn mwy diweddar o @MOD_NAME@ ar gael (@REMOTE_MOD_VERSION@) ar gyfer @MINECRAFT_VERSION@. Ffeindiwch o yma: @MOD_UPDATE_LOCATION@</entry>
<entry key="version.connection_error">Gwall wrth drio cysylltu gyda'r ffeil awdurdod fersiwn o bell (Gwiriwch eich cysylltiad rhwydwaith)</entry>
<entry key="version.check_disabled">Gwiriad fersiwn o bell wedi'i ddiffodd, esgusodid</entry>
</properties>

View file

@ -34,8 +34,6 @@
<entry key="item.alchemyBag.black.name">Bolsa Alquímica Negra</entry>
<entry key="tile.redWaterStill.name">Água Vermelha (Parada)</entry>
<entry key="tile.redWaterFlowing.name">Água Vermelha (Corrente)</entry>
<entry key="tile.redWaterStill.name">Água Vermelha (Parada)</entry>
<entry key="tile.redWaterFlowing.name">Água Vermelha (Corrente)</entry>
<entry key="tile.calcinator.name">Calcinador</entry>
<entry key="gui.calcinator.name">Calcinador</entry>
<entry key="itemGroup.EE3">Equivalent Exchange 3</entry>