Merge pull request #1 from mekanism/1.7.10

1.7.10
This commit is contained in:
Bogdan 2020-01-05 12:35:53 +03:00 committed by GitHub
commit 2ca34400cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
253 changed files with 3929 additions and 864 deletions

View file

@ -11,22 +11,16 @@ Mekanism is a Minecraft add-on featuring high-tech machinery that can be used to
# Modpacks, websites, reviews, or anything else # # Modpacks, websites, reviews, or anything else #
Some people really don't like others to review or distribute their mods, something which I honestly don't understand. You are the ones who help get this mod into the Minecraft community's hands, which seems like a good thing from my perspective. Some people really don't like others to review or distribute their mods, something which I honestly don't understand. You are the ones who help get this mod into the Minecraft community's hands, which seems like a good thing from my perspective.
So go ahead, do whatever you like. I honestly just don't want you messaging me on IRC or on the forums, asking my permission. If you need proof, provide a link to this page, or give them information on the MIT license. As long as you follow the terms laid out in the license below, go right ahead. I honestly just don't want you messaging me on IRC or on the forums, asking my permission. If you need proof, provide a link to this page.
# License # # License #
Licenses are not really my friend -- strict closed source software really drives me nuts. Even more, with a derivative work coded in a language such as Java, nothing can really prevent people from looking through my source with JD-GUI. Licenses are not really my friend -- strict closed source software really drives me nuts. Even more, with a derivative work coded in a language such as Java, nothing can really prevent people from looking through my source with JD-GUI. I learned to program through a combination of textbooks, trial-and-error and browsing open source projects. As such, I have decided to license Mekanism under the MIT license, allowing for anyone with an interest in the project to fork/pull/distribute.
However, I welcome people wanting to learn how to mod, and because of this, I have licensed Mekanism under the MIT License, which doesn't include many guidelines. This basically means you have the right to use my mod's source code, learn
from it, and even use it in your own mod. You even have the right to distribute this mod to the public and make money off of it, although this is something I wouldn't necessarily encourage! :)
Copyright © 2016 Aidan Brady
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**Copyright © 2016 Aidan Brady**
# Developers & Credits # # Developers & Credits #
**Lead Developer:** aidancbrady **Lead Developer:** aidancbrady

View file

@ -4,4 +4,4 @@ FMP_version=1.1.2.331
CCLIB_version=1.1.3.136 CCLIB_version=1.1.3.136
NEI_version=1.0.4.101 NEI_version=1.0.4.101
CCC_version=1.0.6.39 CCC_version=1.0.6.39
mod_version=9.0.2 mod_version=9.1.1

Binary file not shown.

View file

@ -1,5 +1,8 @@
package ic2.api; package ic2.api;
import java.util.EnumSet;
import java.util.Set;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -36,6 +39,15 @@ public enum Direction {
*/ */
ZP; ZP;
private Direction() {
int side = ordinal() / 2;
int sign = getSign();
xOffset = side == 0 ? sign : 0;
yOffset = side == 1 ? sign : 0;
zOffset = side == 2 ? sign : 0;
}
public static Direction fromSideValue(int side) { public static Direction fromSideValue(int side) {
return directions[(side + 2) % 6]; return directions[(side + 2) % 6];
} }
@ -112,6 +124,12 @@ public enum Direction {
return ForgeDirection.getOrientation(toSideValue()); return ForgeDirection.getOrientation(toSideValue());
} }
public final int xOffset;
public final int yOffset;
public final int zOffset;
public static final Direction[] directions = Direction.values(); public static final Direction[] directions = Direction.values();
public static final Set<Direction> noDirections = EnumSet.noneOf(Direction.class);
public static final Set<Direction> allDirections = EnumSet.allOf(Direction.class);
} }

View file

@ -37,13 +37,16 @@ public abstract class CropCard {
/** /**
* Determine the mod id owning this crop. * Determine the mod id owning this crop.
* *
* It's recommended to hard code this to your mod id. * The owner serves as a name space. With every mod using a different owner, a mod only has to
* make sure it doesn't have conflicts with name() in itself.
* It's recommended to hard code this to your mod id as specified in the @Mod annotation.
* Do not use IC2's mod id here.
* *
* @note changing name or owner will cause existing crops in users' worlds to disappear. * @note changing name or owner will cause existing crops in users' worlds to disappear.
* *
* @return Mod id. * @return Mod id.
*/ */
public String owner() { public String owner() { // TODO: make abstract
return modId; return modId;
} }
@ -100,7 +103,7 @@ public abstract class CropCard {
* @param crop reference to ICropTile * @param crop reference to ICropTile
* @return roots lengt use in isBlockBelow * @return roots lengt use in isBlockBelow
*/ */
public int getrootslength(ICropTile crop) { public int getrootslength(ICropTile crop) { // TODO: camel case
return 1; return 1;
} }
@ -126,7 +129,7 @@ public abstract class CropCard {
* @param n index of the requested stat * @param n index of the requested stat
* @return The requested value of the stats * @return The requested value of the stats
*/ */
public abstract int stat(int n); public abstract int stat(int n); // TODO: change to fixed property object or builder with other attributes like tier
/** /**
* Additional attributes of the plant, also influencing breeding. * Additional attributes of the plant, also influencing breeding.
@ -134,7 +137,7 @@ public abstract class CropCard {
* *
* @return Attributes as an array of strings * @return Attributes as an array of strings
*/ */
public abstract String[] attributes(); public abstract String[] attributes(); // TODO: default to none
/** /**
* Determine the max crop size. * Determine the max crop size.
@ -212,7 +215,7 @@ public abstract class CropCard {
* @return 0-30 * @return 0-30
*/ */
public int weightInfluences(ICropTile crop, float humidity, float nutrients, float air) { public int weightInfluences(ICropTile crop, float humidity, float nutrients, float air) {
return (int) (humidity+nutrients+air); return (int) (humidity + nutrients + air);
} }
/** /**
@ -247,7 +250,7 @@ public abstract class CropCard {
* @return need crop size for best output. * @return need crop size for best output.
*/ */
public abstract int getOptimalHavestSize(ICropTile crop); public abstract int getOptimalHavestSize(ICropTile crop); // TODO: default to maxSize
/** /**
* Check whether the crop can be harvested. * Check whether the crop can be harvested.
@ -255,7 +258,7 @@ public abstract class CropCard {
* @param crop reference to ICropTile * @param crop reference to ICropTile
* @return Whether the crop can be harvested in its current state. * @return Whether the crop can be harvested in its current state.
*/ */
public abstract boolean canBeHarvested(ICropTile crop); public abstract boolean canBeHarvested(ICropTile crop); // TODO: default to maxSize check
/** /**
* Base chance for dropping the plant's gains, specify values greater than 1 for multiple drops. * Base chance for dropping the plant's gains, specify values greater than 1 for multiple drops.
@ -263,10 +266,8 @@ public abstract class CropCard {
* *
* @return Chance to drop the gains * @return Chance to drop the gains
*/ */
public float dropGainChance() { public float dropGainChance() { // TODO: change to double
float base = 1F; return (float) Math.pow(0.95, tier());
for (int i = 0; i < tier(); i++) {base*=0.95;}
return base;
} }
/** /**
@ -284,20 +285,20 @@ public abstract class CropCard {
* @param crop reference to ICropTile * @param crop reference to ICropTile
* @return Plant size after harvesting * @return Plant size after harvesting
*/ */
public byte getSizeAfterHarvest(ICropTile crop) {return 1;} public byte getSizeAfterHarvest(ICropTile crop) {return 1;} // TODO: change to int
/** /**
* Called when the plant is leftclicked by a player. * Called when the plant is left clicked by a player.
* Default action is picking the plant. * Default action is picking the plant.
* *
* Only called Serverside. * Only called server side.
* *
* @param crop reference to ICropTile * @param crop reference to ICropTile
* @param player player leftclicked the crop * @param player player left clicked the crop
* @return Whether the plant has changed * @return Whether the plant has changed
*/ */
public boolean leftclick(ICropTile crop, EntityPlayer player) { public boolean leftclick(ICropTile crop, EntityPlayer player) { // TODO: camel case
return crop.pick(true); return crop.pick(true);
} }
@ -398,7 +399,7 @@ public abstract class CropCard {
*/ */
public boolean isWeed(ICropTile crop) { public boolean isWeed(ICropTile crop) {
return crop.getSize() >= 2 && return crop.getSize() >= 2 &&
(crop == Crops.weed || crop.getGrowth() >= 24); (crop.getCrop() == Crops.weed || crop.getGrowth() >= 24);
} }
@ -430,4 +431,5 @@ public abstract class CropCard {
protected IIcon textures[]; protected IIcon textures[];
private final String modId; // TODO: make owner abstract, remove modId auto detection private final String modId; // TODO: make owner abstract, remove modId auto detection
// TODO: add a clean way to obtain world reference and position
} }

View file

@ -260,6 +260,15 @@ public interface ICropTile {
*/ */
public boolean isBlockBelow(Block block); public boolean isBlockBelow(Block block);
/**
* Check if a block is under the farmland containing the crop.
* Searches up to 2 blocks below the farmland or an air space, whichever appears first.
*
* @param oreDictionaryName blocks to search
* @return Whether the blocks were found
*/
public boolean isBlockBelow(String oreDictionaryName);
/** /**
* Generate plant seeds with the given parameters. * Generate plant seeds with the given parameters.
* *

Binary file not shown.

View file

@ -1,5 +1,6 @@
package ic2.api.info; package ic2.api.info;
import net.minecraft.potion.Potion;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Loader;
@ -16,6 +17,12 @@ public class Info {
*/ */
public static DamageSource DMG_ELECTRIC, DMG_NUKE_EXPLOSION, DMG_RADIATION; public static DamageSource DMG_ELECTRIC, DMG_NUKE_EXPLOSION, DMG_RADIATION;
/**
* Potions used by IC2.
* Getting assigned in preload.
*/
public static Potion POTION_RADIATION;
public static boolean isIc2Available() { public static boolean isIc2Available() {
if (ic2Available != null) return ic2Available; if (ic2Available != null) return ic2Available;

View file

@ -39,7 +39,9 @@ public interface IElectricItem {
/** /**
* Get the item's tier, lower tiers can't send energy to higher ones. * Get the item's tier, lower tiers can't send energy to higher ones.
* Batteries are Tier 1, Energy Crystals are Tier 2, Lapotron Crystals are Tier 3. *
* Batteries are Tier 1, Advanced Batteries are Tier 2, Energy Crystals are Tier 3, Lapotron
* Crystals are Tier 4.
* *
* @return Item's tier * @return Item's tier
*/ */

Binary file not shown.

View file

@ -3,7 +3,7 @@ package ic2.api.item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
public interface IKineticWindRotor { public interface IKineticRotor {
int getDiameter(ItemStack stack); int getDiameter(ItemStack stack);
ResourceLocation getRotorRenderTexture(ItemStack stack); ResourceLocation getRotorRenderTexture(ItemStack stack);
@ -13,4 +13,11 @@ public interface IKineticWindRotor {
int getMinWindStrength(ItemStack stack); int getMinWindStrength(ItemStack stack);
int getMaxWindStrength(ItemStack stack); int getMaxWindStrength(ItemStack stack);
boolean isAcceptedType(ItemStack stack, GearboxType type);
public static enum GearboxType {
WATER,
WIND,
}
} }

Binary file not shown.

View file

@ -6,6 +6,9 @@ import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
/**
* Interface used for Items that can be processed in the Turning Table
*/
public interface ILatheItem { public interface ILatheItem {
/** /**
@ -44,4 +47,24 @@ public interface ILatheItem {
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
ResourceLocation getTexture(ItemStack stack); ResourceLocation getTexture(ItemStack stack);
/**
* This is similar to the Block HarvestLevel. Requires a different tool for a different hardness
* for ex. the Iron Turning Blank has a Hardness of 2 (Like Iron Ore (Harvest Level)).
* In this case however it requires a Tool hardness of one above (3)
*/
int getHardness(ItemStack stack);
/**
* Interface used for Tools that can be used to modify {@link ILatheItem}
*/
public static interface ILatheTool extends ICustomDamageItem {
/**
* This is similar to the Tool HarvestLevel. Requires a different tool for a different hardness
* for ex. the Iron Turning Blank has a Hardness of 2 (Like Iron Ore (Harvest Level)).
* The tool requires a hardness of one level above (in this case 3)
*/
int getHardness(ItemStack stack);
}
} }

View file

@ -178,7 +178,7 @@ public final class NetworkHelper {
*/ */
private static Object getInstance() { private static Object getInstance() {
try { try {
return Class.forName(getPackage() + ".core.IC2").getDeclaredField("network").get(null); return Class.forName(getPackage() + ".core.util.SideGateway").getMethod("get").invoke(Class.forName(getPackage() + ".core.IC2").getDeclaredField("network").get(null));
} catch (Throwable e) { } catch (Throwable e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }

View file

@ -0,0 +1,39 @@
package ic2.api.recipe;
import java.util.Map;
import net.minecraftforge.fluids.Fluid;
public interface ILiquidHeatExchangerManager extends ILiquidAcceptManager {
/**
* Add a new fluid heatup/cooldown recipe.
*
* @param fluidName the fluid to heat up/cool down
* @param fluidOutput the fluid the above fluid turns into
* @param huPerMB the Thermal Energy difference in hU for the conversion of one mB fluid
*/
void addFluid(String fluidName, String fluidOutput, int huPerMB);
HeatExchangeProperty getHeatExchangeProperty(Fluid fluid);
Map<String, HeatExchangeProperty> getHeatExchangeProperties();
/**
* This returns an ILiquidAcceptManager that only accepts fluids, that can be heated up / cooled down, but not both.
* You can basically use this to check if the liquid resulting from this conversion can be reprocessed into the first one.
* @return Returns the SingleDirectionManager.
*/
ILiquidAcceptManager getSingleDirectionLiquidManager();
public static class HeatExchangeProperty {
public HeatExchangeProperty(Fluid outputFluid, int huPerMB) {
this.outputFluid = outputFluid;
this.huPerMB = huPerMB;
}
public final Fluid outputFluid;
public final int huPerMB;
}
}

View file

@ -25,8 +25,7 @@ public final class RecipeOutput {
RecipeOutput ro = (RecipeOutput) obj; RecipeOutput ro = (RecipeOutput) obj;
if (items.size() == ro.items.size() && if (items.size() == ro.items.size() &&
(metadata == null && ro.metadata == null || metadata != null && ro.metadata != null) && (metadata == null && ro.metadata == null || metadata != null && ro.metadata != null && metadata.equals(ro.metadata))) {
metadata.equals(ro.metadata)) {
Iterator<ItemStack> itA = items.iterator(); Iterator<ItemStack> itA = items.iterator();
Iterator<ItemStack> itB = ro.items.iterator(); Iterator<ItemStack> itB = ro.items.iterator();

View file

@ -57,4 +57,12 @@ public class Recipes {
public static ISemiFluidFuelManager semiFluidGenerator; public static ISemiFluidFuelManager semiFluidGenerator;
public static IFluidHeatManager FluidHeatGenerator; public static IFluidHeatManager FluidHeatGenerator;
/**
* Used by the Liquid Heat Exchanger to cool down liquids and determine the amount of hu generated for every mb.
*/
public static ILiquidHeatExchangerManager liquidCooldownManager;
/**
* Opposite of {@link #liquidCooldownManager}. This is for Liquids that can be heated up again.
*/
public static ILiquidHeatExchangerManager liquidHeatupManager;
} }

View file

@ -65,13 +65,14 @@ public class MekanismConfig
public static double maxEnergyPerSteam = 100; public static double maxEnergyPerSteam = 100;
public static double superheatingHeatTransfer = 10000; public static double superheatingHeatTransfer = 10000;
public static double heatPerFuelTick = 4; public static double heatPerFuelTick = 4;
public static boolean allowTransmitterAlloyUpgrade;
public static boolean allowProtection = true;
} }
public static class client public static class client
{ {
public static boolean enablePlayerSounds = true; public static boolean enablePlayerSounds = true;
public static boolean enableMachineSounds = true; public static boolean enableMachineSounds = true;
public static boolean fancyUniversalCableRender = true;
public static boolean holidays = true; public static boolean holidays = true;
public static float baseSoundVolume = 1F; public static float baseSoundVolume = 1F;
public static boolean machineEffects = true; public static boolean machineEffects = true;
@ -80,6 +81,7 @@ public class MekanismConfig
public static boolean renderCTM = true; public static boolean renderCTM = true;
public static boolean enableAmbientLighting; public static boolean enableAmbientLighting;
public static int ambientLightingLevel; public static int ambientLightingLevel;
public static boolean opaqueTransmitters = false;
} }
public static class machines public static class machines
@ -144,6 +146,7 @@ public class MekanismConfig
public static int turbineBladesPerCoil; public static int turbineBladesPerCoil;
public static double turbineVentGasFlow; public static double turbineVentGasFlow;
public static double turbineDisperserGasFlow; public static double turbineDisperserGasFlow;
public static int condenserRate;
} }
public static class tools public static class tools

View file

@ -216,18 +216,18 @@ public class ClientProxy extends CommonProxy
{ {
super.loadConfiguration(); super.loadConfiguration();
client.enablePlayerSounds = Mekanism.configuration.get("client", "EnablePlayerSounds", true).getBoolean(true); client.enablePlayerSounds = Mekanism.configuration.get("client", "EnablePlayerSounds", true).getBoolean();
client.enableMachineSounds = Mekanism.configuration.get("client", "EnableMachineSounds", true).getBoolean(true); client.enableMachineSounds = Mekanism.configuration.get("client", "EnableMachineSounds", true).getBoolean();
client.fancyUniversalCableRender = Mekanism.configuration.get("client", "FancyUniversalCableRender", true).getBoolean(true); client.holidays = Mekanism.configuration.get("client", "Holidays", true).getBoolean();
client.holidays = Mekanism.configuration.get("client", "Holidays", true).getBoolean(true); client.baseSoundVolume = (float)Mekanism.configuration.get("client", "SoundVolume", 1D).getDouble();
client.baseSoundVolume = (float)Mekanism.configuration.get("client", "SoundVolume", 1D).getDouble(1D); client.machineEffects = Mekanism.configuration.get("client", "MachineEffects", true).getBoolean();
client.machineEffects = Mekanism.configuration.get("client", "MachineEffects", true).getBoolean(true);
client.oldTransmitterRender = Mekanism.configuration.get("client", "OldTransmitterRender", false).getBoolean(); client.oldTransmitterRender = Mekanism.configuration.get("client", "OldTransmitterRender", false).getBoolean();
client.replaceSoundsWhenResuming = Mekanism.configuration.get("client", "ReplaceSoundsWhenResuming", true, client.replaceSoundsWhenResuming = Mekanism.configuration.get("client", "ReplaceSoundsWhenResuming", true,
"If true, will reduce lagging between player sounds. Setting to false will reduce GC load").getBoolean(); "If true, will reduce lagging between player sounds. Setting to false will reduce GC load").getBoolean();
client.renderCTM = Mekanism.configuration.get("client", "CTMRenderer", true).getBoolean(); client.renderCTM = Mekanism.configuration.get("client", "CTMRenderer", true).getBoolean();
client.enableAmbientLighting = Mekanism.configuration.get("general", "EnableAmbientLighting", true).getBoolean(); client.enableAmbientLighting = Mekanism.configuration.get("client", "EnableAmbientLighting", true).getBoolean();
client.ambientLightingLevel = Mekanism.configuration.get("general", "AmbientLightingLevel", 15).getInt(); client.ambientLightingLevel = Mekanism.configuration.get("client", "AmbientLightingLevel", 15).getInt();
client.opaqueTransmitters = Mekanism.configuration.get("client", "OpaqueTransmitterRender", false).getBoolean();
if(Mekanism.configuration.hasChanged()) if(Mekanism.configuration.hasChanged())
{ {
@ -430,23 +430,33 @@ public class ClientProxy extends CommonProxy
return new GuiRobitMain(player.inventory, robit); return new GuiRobitMain(player.inventory, robit);
} }
case 22: case 22:
return new GuiRobitCrafting(player.inventory, world, x); robit = (EntityRobit)world.getEntityByID(x);
case 23:
EntityRobit robit1 = (EntityRobit)world.getEntityByID(x);
if(robit1 != null) if(robit != null)
{ {
return new GuiRobitInventory(player.inventory, robit1); return new GuiRobitCrafting(player.inventory, robit);
}
case 23:
robit = (EntityRobit)world.getEntityByID(x);
if(robit != null)
{
return new GuiRobitInventory(player.inventory, robit);
} }
case 24: case 24:
EntityRobit robit2 = (EntityRobit)world.getEntityByID(x); robit = (EntityRobit)world.getEntityByID(x);
if(robit2 != null) if(robit != null)
{ {
return new GuiRobitSmelting(player.inventory, robit2); return new GuiRobitSmelting(player.inventory, robit);
} }
case 25: case 25:
return new GuiRobitRepair(player.inventory, world, x); robit = (EntityRobit)world.getEntityByID(x);
if(robit != null)
{
return new GuiRobitRepair(player.inventory, robit);
}
case 29: case 29:
return new GuiChemicalOxidizer(player.inventory, (TileEntityChemicalOxidizer)tileEntity); return new GuiChemicalOxidizer(player.inventory, (TileEntityChemicalOxidizer)tileEntity);
case 30: case 30:

View file

@ -66,11 +66,9 @@ public class ClientTickHandler
public static Minecraft mc = FMLClientHandler.instance().getClient(); public static Minecraft mc = FMLClientHandler.instance().getClient();
public static final String MIKE_CAPE = "https://dl.dropboxusercontent.com/s/ji06yflixnszcby/cape.png"; public static final String DONATE_CAPE = "http://aidancbrady.com/data/capes/donate.png";
public static final String DONATE_CAPE = "https://dl.dropboxusercontent.com/u/90411166/donate.png"; public static final String AIDAN_CAPE = "http://aidancbrady.com/data/capes/aidan.png";
public static final String AIDAN_CAPE = "https://dl.dropboxusercontent.com/u/90411166/aidan.png";
private Map<String, CapeBufferDownload> mikeDownload = new HashMap<String, CapeBufferDownload>();
private Map<String, CapeBufferDownload> donateDownload = new HashMap<String, CapeBufferDownload>(); private Map<String, CapeBufferDownload> donateDownload = new HashMap<String, CapeBufferDownload>();
private Map<String, CapeBufferDownload> aidanDownload = new HashMap<String, CapeBufferDownload>(); private Map<String, CapeBufferDownload> aidanDownload = new HashMap<String, CapeBufferDownload>();
@ -137,27 +135,7 @@ public class ClientTickHandler
if(player != null) if(player != null)
{ {
if(StringUtils.stripControlCodes(player.getCommandSenderName()).equals("mikeacttck")) if(StringUtils.stripControlCodes(player.getCommandSenderName()).equals("aidancbrady"))
{
CapeBufferDownload download = mikeDownload.get(player.getCommandSenderName());
if(download == null)
{
download = new CapeBufferDownload(player.getCommandSenderName(), MIKE_CAPE);
mikeDownload.put(player.getCommandSenderName(), download);
download.start();
}
else {
if(!download.downloaded)
{
continue;
}
player.func_152121_a(MinecraftProfileTexture.Type.CAPE, download.getResourceLocation());
}
}
else if(StringUtils.stripControlCodes(player.getCommandSenderName()).equals("aidancbrady"))
{ {
CapeBufferDownload download = aidanDownload.get(player.getCommandSenderName()); CapeBufferDownload download = aidanDownload.get(player.getCommandSenderName());

View file

@ -43,7 +43,7 @@ public class GuiBoilerStats extends GuiMekanism
public List<String> getInfo() public List<String> getInfo()
{ {
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()]; TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
String environment = UnitDisplayUtils.getDisplayShort(tileEntity.structure.lastEnvironmentLoss*unit.intervalSize, unit); String environment = UnitDisplayUtils.getDisplayShort(tileEntity.structure.lastEnvironmentLoss*unit.intervalSize, false, unit);
return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t"); return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
} }
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBoilerStats.png"))); }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBoilerStats.png")));

View file

@ -671,7 +671,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism
} }
} }
if(Character.isDigit(c) || i == Keyboard.KEY_BACK || i == Keyboard.KEY_DELETE || i == Keyboard.KEY_LEFT || i == Keyboard.KEY_RIGHT) if(Character.isDigit(c) || isTextboxKey(c, i))
{ {
radiusField.textboxKeyTyped(c, i); radiusField.textboxKeyTyped(c, i);
minField.textboxKeyTyped(c, i); minField.textboxKeyTyped(c, i);

View file

@ -40,7 +40,7 @@ public class GuiFuelwoodHeater extends GuiMekanism
public List<String> getInfo() public List<String> getInfo()
{ {
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()]; TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
String environment = UnitDisplayUtils.getDisplayShort(tileEntity.lastEnvironmentLoss*unit.intervalSize, unit); String environment = UnitDisplayUtils.getDisplayShort(tileEntity.lastEnvironmentLoss*unit.intervalSize, false, unit);
return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t"); return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
} }
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiFuelwoodHeater.png"))); }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiFuelwoodHeater.png")));

View file

@ -3,7 +3,7 @@ package mekanism.client.gui;
import java.util.ArrayList; import java.util.ArrayList;
import mekanism.api.Coord4D; import mekanism.api.Coord4D;
import mekanism.client.gui.element.GuiDetectionTab; import mekanism.client.gui.element.GuiAmplifierTab;
import mekanism.client.gui.element.GuiGauge.Type; import mekanism.client.gui.element.GuiGauge.Type;
import mekanism.client.gui.element.GuiNumberGauge; import mekanism.client.gui.element.GuiNumberGauge;
import mekanism.client.gui.element.GuiNumberGauge.INumberInfoHandler; import mekanism.client.gui.element.GuiNumberGauge.INumberInfoHandler;
@ -69,7 +69,7 @@ public class GuiLaserAmplifier extends GuiMekanism
}, Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 6, 10)); }, Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 6, 10));
guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"))); guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"))); guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
guiElements.add(new GuiDetectionTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"))); guiElements.add(new GuiAmplifierTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
} }
@Override @Override
@ -148,7 +148,7 @@ public class GuiLaserAmplifier extends GuiMekanism
} }
} }
if(Character.isDigit(c) || c == '.' || c == 'E' || i == Keyboard.KEY_BACK || i == Keyboard.KEY_DELETE || i == Keyboard.KEY_LEFT || i == Keyboard.KEY_RIGHT) if(Character.isDigit(c) || c == '.' || c == 'E' || isTextboxKey(c, i))
{ {
minField.textboxKeyTyped(c, i); minField.textboxKeyTyped(c, i);
maxField.textboxKeyTyped(c, i); maxField.textboxKeyTyped(c, i);

View file

@ -112,7 +112,7 @@ public class GuiMModIDFilter extends GuiMekanism
return; return;
} }
if(Character.isLetter(c) || Character.isDigit(c) || TransporterFilter.SPECIAL_CHARS.contains(c) || i == Keyboard.KEY_BACK || i == Keyboard.KEY_DELETE || i == Keyboard.KEY_LEFT || i == Keyboard.KEY_RIGHT) if(Character.isLetter(c) || Character.isDigit(c) || TransporterFilter.SPECIAL_CHARS.contains(c) || isTextboxKey(c, i))
{ {
modIDText.textboxKeyTyped(c, i); modIDText.textboxKeyTyped(c, i);
} }

View file

@ -112,7 +112,7 @@ public class GuiMOreDictFilter extends GuiMekanism
return; return;
} }
if(Character.isLetter(c) || Character.isDigit(c) || TransporterFilter.SPECIAL_CHARS.contains(c) || i == Keyboard.KEY_BACK || i == Keyboard.KEY_DELETE || i == Keyboard.KEY_LEFT || i == Keyboard.KEY_RIGHT) if(Character.isLetter(c) || Character.isDigit(c) || TransporterFilter.SPECIAL_CHARS.contains(c) || isTextboxKey(c, i))
{ {
oreDictText.textboxKeyTyped(c, i); oreDictText.textboxKeyTyped(c, i);
} }

View file

@ -18,6 +18,7 @@ import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper
@ -74,6 +75,18 @@ public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper
} }
} }
public static boolean isTextboxKey(char c, int i)
{
if(i == Keyboard.KEY_BACK || i == Keyboard.KEY_DELETE || i == Keyboard.KEY_LEFT || i == Keyboard.KEY_RIGHT ||
i == Keyboard.KEY_END || i == Keyboard.KEY_HOME || i == Keyboard.KEY_BACK || c == 1 || c == 3 || c == 22
|| c == 24)
{
return true;
}
return false;
}
@Override @Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
{ {

View file

@ -248,7 +248,7 @@ public class GuiOredictionificatorFilter extends GuiMekanism
return; return;
} }
if(Character.isLetter(c) || Character.isDigit(c) || i == Keyboard.KEY_BACK || i == Keyboard.KEY_DELETE || i == Keyboard.KEY_LEFT || i == Keyboard.KEY_RIGHT) if(Character.isLetter(c) || Character.isDigit(c) || isTextboxKey(c, i))
{ {
filterText.textboxKeyTyped(c, i); filterText.textboxKeyTyped(c, i);
} }

View file

@ -11,6 +11,7 @@ import mekanism.client.gui.element.GuiTransporterConfigTab;
import mekanism.client.sound.SoundHandler; import mekanism.client.sound.SoundHandler;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.frequency.Frequency; import mekanism.common.frequency.Frequency;
import mekanism.common.frequency.FrequencyManager;
import mekanism.common.inventory.container.ContainerQuantumEntangloporter; import mekanism.common.inventory.container.ContainerQuantumEntangloporter;
import mekanism.common.network.PacketPortableTeleporter.PortableTeleporterMessage; import mekanism.common.network.PacketPortableTeleporter.PortableTeleporterMessage;
import mekanism.common.network.PacketPortableTeleporter.PortableTeleporterPacketType; import mekanism.common.network.PacketPortableTeleporter.PortableTeleporterPacketType;
@ -34,8 +35,6 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiQuantumEntangloporter extends GuiMekanism public class GuiQuantumEntangloporter extends GuiMekanism
{ {
public static int MAX_LENGTH = 16;
public ResourceLocation resource; public ResourceLocation resource;
public TileEntityQuantumEntangloporter tileEntity; public TileEntityQuantumEntangloporter tileEntity;
@ -89,7 +88,7 @@ public class GuiQuantumEntangloporter extends GuiMekanism
deleteButton = new GuiButton(3, guiWidth + 89, guiHeight + 116, 60, 20, LangUtils.localize("gui.delete")); deleteButton = new GuiButton(3, guiWidth + 89, guiHeight + 116, 60, 20, LangUtils.localize("gui.delete"));
frequencyField = new GuiTextField(fontRendererObj, guiWidth + 50, guiHeight + 104, 86, 11); frequencyField = new GuiTextField(fontRendererObj, guiWidth + 50, guiHeight + 104, 86, 11);
frequencyField.setMaxStringLength(MAX_LENGTH); frequencyField.setMaxStringLength(FrequencyManager.MAX_FREQ_LENGTH);
frequencyField.setEnableBackgroundDrawing(false); frequencyField.setEnableBackgroundDrawing(false);
updateButtons(); updateButtons();
@ -231,7 +230,7 @@ public class GuiQuantumEntangloporter extends GuiMekanism
} }
} }
if(Character.isDigit(c) || Character.isLetter(c) || i == Keyboard.KEY_BACK || i == Keyboard.KEY_DELETE || i == Keyboard.KEY_LEFT || i == Keyboard.KEY_RIGHT) if(Character.isDigit(c) || Character.isLetter(c) || isTextboxKey(c, i) || FrequencyManager.SPECIAL_CHARS.contains(c))
{ {
frequencyField.textboxKeyTyped(c, i); frequencyField.textboxKeyTyped(c, i);
} }

View file

@ -62,7 +62,6 @@ public class GuiResistiveHeater extends GuiMekanism
@Override @Override
public List<String> getInfo() public List<String> getInfo()
{ {
System.out.println(tileEntity.lastEnvironmentLoss);
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()]; TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
String environment = UnitDisplayUtils.getDisplayShort(tileEntity.lastEnvironmentLoss*unit.intervalSize, false, unit); String environment = UnitDisplayUtils.getDisplayShort(tileEntity.lastEnvironmentLoss*unit.intervalSize, false, unit);
return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t"); return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
@ -180,7 +179,7 @@ public class GuiResistiveHeater extends GuiMekanism
return; return;
} }
if(Character.isDigit(c) || i == Keyboard.KEY_BACK || i == Keyboard.KEY_DELETE || i == Keyboard.KEY_LEFT || i == Keyboard.KEY_RIGHT) if(Character.isDigit(c) || isTextboxKey(c, i))
{ {
energyUsageField.textboxKeyTyped(c, i); energyUsageField.textboxKeyTyped(c, i);
} }

View file

@ -2,6 +2,7 @@ package mekanism.client.gui;
import mekanism.client.sound.SoundHandler; import mekanism.client.sound.SoundHandler;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.entity.EntityRobit;
import mekanism.common.inventory.container.ContainerRobitCrafting; import mekanism.common.inventory.container.ContainerRobitCrafting;
import mekanism.common.network.PacketRobit.RobitMessage; import mekanism.common.network.PacketRobit.RobitMessage;
import mekanism.common.network.PacketRobit.RobitPacketType; import mekanism.common.network.PacketRobit.RobitPacketType;
@ -9,7 +10,6 @@ import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType; import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@ -19,12 +19,12 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiRobitCrafting extends GuiMekanism public class GuiRobitCrafting extends GuiMekanism
{ {
public int entityId; public EntityRobit robit;
public GuiRobitCrafting(InventoryPlayer inventory, World world, int id) public GuiRobitCrafting(InventoryPlayer inventory, EntityRobit entity)
{ {
super(new ContainerRobitCrafting(inventory, world)); super(new ContainerRobitCrafting(inventory, entity));
entityId = id; robit = entity;
xSize += 25; xSize += 25;
} }
@ -105,8 +105,8 @@ public class GuiRobitCrafting extends GuiMekanism
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28) if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
{ {
SoundHandler.playSound("gui.button.press"); SoundHandler.playSound("gui.button.press");
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 0, entityId, null)); Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 0, robit.getEntityId(), null));
mc.thePlayer.openGui(Mekanism.instance, 21, mc.theWorld, entityId, 0, 0); mc.thePlayer.openGui(Mekanism.instance, 21, mc.theWorld, robit.getEntityId(), 0, 0);
} }
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48) else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48)
{ {
@ -115,20 +115,20 @@ public class GuiRobitCrafting extends GuiMekanism
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68) else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68)
{ {
SoundHandler.playSound("gui.button.press"); SoundHandler.playSound("gui.button.press");
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 2, entityId, null)); Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 2, robit.getEntityId(), null));
mc.thePlayer.openGui(Mekanism.instance, 23, mc.theWorld, entityId, 0, 0); mc.thePlayer.openGui(Mekanism.instance, 23, mc.theWorld, robit.getEntityId(), 0, 0);
} }
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88) else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88)
{ {
SoundHandler.playSound("gui.button.press"); SoundHandler.playSound("gui.button.press");
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 3, entityId, null)); Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 3, robit.getEntityId(), null));
mc.thePlayer.openGui(Mekanism.instance, 24, mc.theWorld, entityId, 0, 0); mc.thePlayer.openGui(Mekanism.instance, 24, mc.theWorld, robit.getEntityId(), 0, 0);
} }
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108) else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108)
{ {
SoundHandler.playSound("gui.button.press"); SoundHandler.playSound("gui.button.press");
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 4, entityId, null)); Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 4, robit.getEntityId(), null));
mc.thePlayer.openGui(Mekanism.instance, 25, mc.theWorld, entityId, 0, 0); mc.thePlayer.openGui(Mekanism.instance, 25, mc.theWorld, robit.getEntityId(), 0, 0);
} }
} }
} }

View file

@ -4,6 +4,7 @@ import java.util.List;
import mekanism.client.sound.SoundHandler; import mekanism.client.sound.SoundHandler;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.entity.EntityRobit;
import mekanism.common.inventory.container.ContainerRobitRepair; import mekanism.common.inventory.container.ContainerRobitRepair;
import mekanism.common.network.PacketRobit.RobitMessage; import mekanism.common.network.PacketRobit.RobitMessage;
import mekanism.common.network.PacketRobit.RobitPacketType; import mekanism.common.network.PacketRobit.RobitPacketType;
@ -18,7 +19,6 @@ import net.minecraft.inventory.ICrafting;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.network.play.client.C17PacketCustomPayload; import net.minecraft.network.play.client.C17PacketCustomPayload;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import org.apache.commons.io.Charsets; import org.apache.commons.io.Charsets;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
@ -30,16 +30,16 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiRobitRepair extends GuiMekanism implements ICrafting public class GuiRobitRepair extends GuiMekanism implements ICrafting
{ {
public int entityId; private EntityRobit robit;
private ContainerRepair repairContainer; private ContainerRepair repairContainer;
private GuiTextField itemNameField; private GuiTextField itemNameField;
private InventoryPlayer playerInventory; private InventoryPlayer playerInventory;
public GuiRobitRepair(InventoryPlayer inventory, World world, int id) public GuiRobitRepair(InventoryPlayer inventory, EntityRobit entity)
{ {
super(new ContainerRobitRepair(inventory, world)); super(new ContainerRobitRepair(inventory, entity));
robit = entity;
xSize += 25; xSize += 25;
entityId = id;
playerInventory = inventory; playerInventory = inventory;
repairContainer = (ContainerRobitRepair)inventorySlots; repairContainer = (ContainerRobitRepair)inventorySlots;
} }
@ -150,26 +150,26 @@ public class GuiRobitRepair extends GuiMekanism implements ICrafting
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28) if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
{ {
SoundHandler.playSound("gui.button.press"); SoundHandler.playSound("gui.button.press");
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 0, entityId, null)); Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 0, robit.getEntityId(), null));
mc.thePlayer.openGui(Mekanism.instance, 21, mc.theWorld, entityId, 0, 0); mc.thePlayer.openGui(Mekanism.instance, 21, mc.theWorld, robit.getEntityId(), 0, 0);
} }
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48) else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48)
{ {
SoundHandler.playSound("gui.button.press"); SoundHandler.playSound("gui.button.press");
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 1, entityId, null)); Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 1, robit.getEntityId(), null));
mc.thePlayer.openGui(Mekanism.instance, 22, mc.theWorld, entityId, 0, 0); mc.thePlayer.openGui(Mekanism.instance, 22, mc.theWorld, robit.getEntityId(), 0, 0);
} }
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68) else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68)
{ {
SoundHandler.playSound("gui.button.press"); SoundHandler.playSound("gui.button.press");
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 2, entityId, null)); Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 2, robit.getEntityId(), null));
mc.thePlayer.openGui(Mekanism.instance, 23, mc.theWorld, entityId, 0, 0); mc.thePlayer.openGui(Mekanism.instance, 23, mc.theWorld, robit.getEntityId(), 0, 0);
} }
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88) else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88)
{ {
SoundHandler.playSound("gui.button.press"); SoundHandler.playSound("gui.button.press");
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 3, entityId, null)); Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 3, robit.getEntityId(), null));
mc.thePlayer.openGui(Mekanism.instance, 24, mc.theWorld, entityId, 0, 0); mc.thePlayer.openGui(Mekanism.instance, 24, mc.theWorld, robit.getEntityId(), 0, 0);
} }
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108) else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108)
{ {

View file

@ -20,8 +20,8 @@ public class GuiRobitSmelting extends GuiMekanism
public GuiRobitSmelting(InventoryPlayer inventory, EntityRobit entity) public GuiRobitSmelting(InventoryPlayer inventory, EntityRobit entity)
{ {
super(new ContainerRobitSmelting(inventory, entity)); super(new ContainerRobitSmelting(inventory, entity));
xSize += 25;
robit = entity; robit = entity;
xSize += 25;
} }
@Override @Override

View file

@ -213,7 +213,7 @@ public class GuiSecurityDesk extends GuiMekanism
} }
} }
if(SPECIAL_CHARS.contains(c) || Character.isDigit(c) || Character.isLetter(c) || i == Keyboard.KEY_BACK || i == Keyboard.KEY_DELETE || i == Keyboard.KEY_LEFT || i == Keyboard.KEY_RIGHT) if(SPECIAL_CHARS.contains(c) || Character.isDigit(c) || Character.isLetter(c) || isTextboxKey(c, i))
{ {
trustedField.textboxKeyTyped(c, i); trustedField.textboxKeyTyped(c, i);
} }

View file

@ -12,6 +12,7 @@ import mekanism.client.gui.element.GuiSecurityTab;
import mekanism.client.gui.element.GuiSlot; import mekanism.client.gui.element.GuiSlot;
import mekanism.client.gui.element.GuiSlot.SlotOverlay; import mekanism.client.gui.element.GuiSlot.SlotOverlay;
import mekanism.client.gui.element.GuiSlot.SlotType; import mekanism.client.gui.element.GuiSlot.SlotType;
import mekanism.client.gui.element.GuiUpgradeTab;
import mekanism.common.inventory.container.ContainerSolarNeutronActivator; import mekanism.common.inventory.container.ContainerSolarNeutronActivator;
import mekanism.common.tile.TileEntitySolarNeutronActivator; import mekanism.common.tile.TileEntitySolarNeutronActivator;
import mekanism.common.util.LangUtils; import mekanism.common.util.LangUtils;
@ -36,6 +37,7 @@ public class GuiSolarNeutronActivator extends GuiMekanism
guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"))); guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"))); guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
guiElements.add(new GuiUpgradeTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 4, 55).with(SlotOverlay.MINUS)); guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 4, 55).with(SlotOverlay.MINUS));
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 154, 55).with(SlotOverlay.PLUS)); guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 154, 55).with(SlotOverlay.PLUS));

View file

@ -153,7 +153,7 @@ public class GuiTItemStackFilter extends GuiMekanism
super.keyTyped(c, i); super.keyTyped(c, i);
} }
if(Character.isDigit(c) || i == Keyboard.KEY_BACK || i == Keyboard.KEY_DELETE || i == Keyboard.KEY_LEFT || i == Keyboard.KEY_RIGHT) if(Character.isDigit(c) || isTextboxKey(c, i))
{ {
minField.textboxKeyTyped(c, i); minField.textboxKeyTyped(c, i);
maxField.textboxKeyTyped(c, i); maxField.textboxKeyTyped(c, i);

View file

@ -112,7 +112,7 @@ public class GuiTModIDFilter extends GuiMekanism
return; return;
} }
if(Character.isLetter(c) || Character.isDigit(c) || TransporterFilter.SPECIAL_CHARS.contains(c) || i == Keyboard.KEY_BACK || i == Keyboard.KEY_DELETE || i == Keyboard.KEY_LEFT || i == Keyboard.KEY_RIGHT) if(Character.isLetter(c) || Character.isDigit(c) || TransporterFilter.SPECIAL_CHARS.contains(c) || isTextboxKey(c, i))
{ {
modIDText.textboxKeyTyped(c, i); modIDText.textboxKeyTyped(c, i);
} }

View file

@ -112,7 +112,7 @@ public class GuiTOreDictFilter extends GuiMekanism
return; return;
} }
if(Character.isLetter(c) || Character.isDigit(c) || TransporterFilter.SPECIAL_CHARS.contains(c) || i == Keyboard.KEY_BACK || i == Keyboard.KEY_DELETE || i == Keyboard.KEY_LEFT || i == Keyboard.KEY_RIGHT) if(Character.isLetter(c) || Character.isDigit(c) || TransporterFilter.SPECIAL_CHARS.contains(c) || isTextboxKey(c, i))
{ {
oreDictText.textboxKeyTyped(c, i); oreDictText.textboxKeyTyped(c, i);
} }

View file

@ -15,6 +15,7 @@ import mekanism.client.gui.element.GuiSlot.SlotType;
import mekanism.client.sound.SoundHandler; import mekanism.client.sound.SoundHandler;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.frequency.Frequency; import mekanism.common.frequency.Frequency;
import mekanism.common.frequency.FrequencyManager;
import mekanism.common.inventory.container.ContainerNull; import mekanism.common.inventory.container.ContainerNull;
import mekanism.common.inventory.container.ContainerTeleporter; import mekanism.common.inventory.container.ContainerTeleporter;
import mekanism.common.item.ItemPortableTeleporter; import mekanism.common.item.ItemPortableTeleporter;
@ -42,8 +43,6 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiTeleporter extends GuiMekanism public class GuiTeleporter extends GuiMekanism
{ {
public static int MAX_LENGTH = 16;
public ResourceLocation resource; public ResourceLocation resource;
public TileEntityTeleporter tileEntity; public TileEntityTeleporter tileEntity;
@ -162,7 +161,7 @@ public class GuiTeleporter extends GuiMekanism
} }
frequencyField = new GuiTextField(fontRendererObj, guiWidth + 50, guiHeight + 104, 86, 11); frequencyField = new GuiTextField(fontRendererObj, guiWidth + 50, guiHeight + 104, 86, 11);
frequencyField.setMaxStringLength(MAX_LENGTH); frequencyField.setMaxStringLength(FrequencyManager.MAX_FREQ_LENGTH);
frequencyField.setEnableBackgroundDrawing(false); frequencyField.setEnableBackgroundDrawing(false);
updateButtons(); updateButtons();
@ -336,7 +335,7 @@ public class GuiTeleporter extends GuiMekanism
} }
} }
if(Character.isDigit(c) || Character.isLetter(c) || i == Keyboard.KEY_BACK || i == Keyboard.KEY_DELETE || i == Keyboard.KEY_LEFT || i == Keyboard.KEY_RIGHT) if(Character.isDigit(c) || Character.isLetter(c) || isTextboxKey(c, i) || FrequencyManager.SPECIAL_CHARS.contains(c))
{ {
frequencyField.textboxKeyTyped(c, i); frequencyField.textboxKeyTyped(c, i);
} }

View file

@ -53,7 +53,7 @@ public class GuiThermalEvaporationController extends GuiMekanism
public List<String> getInfo() public List<String> getInfo()
{ {
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()]; TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
String environment = UnitDisplayUtils.getDisplayShort(tileEntity.totalLoss*unit.intervalSize, unit); String environment = UnitDisplayUtils.getDisplayShort(tileEntity.totalLoss*unit.intervalSize, false, unit);
return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t"); return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
} }
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiThermalEvaporationController.png"))); }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiThermalEvaporationController.png")));

View file

@ -71,7 +71,7 @@ public class GuiThermoelectricBoiler extends GuiMekanism
public List<String> getInfo() public List<String> getInfo()
{ {
TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()]; TemperatureUnit unit = TemperatureUnit.values()[general.tempUnit.ordinal()];
String environment = UnitDisplayUtils.getDisplayShort(tileEntity.structure.lastEnvironmentLoss*unit.intervalSize, unit); String environment = UnitDisplayUtils.getDisplayShort(tileEntity.structure.lastEnvironmentLoss*unit.intervalSize, false, unit);
return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t"); return ListUtils.asList(LangUtils.localize("gui.dissipated") + ": " + environment + "/t");
} }
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiThermoelectricBoiler.png"))); }, this, MekanismUtils.getResource(ResourceType.GUI, "GuiThermoelectricBoiler.png")));

View file

@ -18,13 +18,13 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiDetectionTab extends GuiElement public class GuiAmplifierTab extends GuiElement
{ {
public TileEntity tileEntity; public TileEntity tileEntity;
public GuiDetectionTab(IGuiWrapper gui, TileEntity tile, ResourceLocation def) public GuiAmplifierTab(IGuiWrapper gui, TileEntity tile, ResourceLocation def)
{ {
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiDetectionTab.png"), gui, def); super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiAmplifierTab.png"), gui, def);
tileEntity = tile; tileEntity = tile;
} }
@ -41,13 +41,14 @@ public class GuiDetectionTab extends GuiElement
mc.renderEngine.bindTexture(RESOURCE); mc.renderEngine.bindTexture(RESOURCE);
guiObj.drawTexturedRect(guiWidth - 26, guiHeight + 138, 0, 0, 26, 26); guiObj.drawTexturedRect(guiWidth - 26, guiHeight + 138, 0, 0, 26, 26);
int outputOrdinal = ((TileEntityLaserAmplifier)tileEntity).outputMode.ordinal();
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 142 && yAxis <= 160) if(xAxis >= -21 && xAxis <= -3 && yAxis >= 142 && yAxis <= 160)
{ {
guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 142, 26, 0, 18, 18); guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 142, 26 + 18*outputOrdinal, 0, 18, 18);
} }
else { else {
guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 142, 26, 18, 18, 18); guiObj.drawTexturedRect(guiWidth - 21, guiHeight + 142, 26 + 18*outputOrdinal, 18, 18, 18);
} }
mc.renderEngine.bindTexture(defaultLocation); mc.renderEngine.bindTexture(defaultLocation);
@ -60,8 +61,8 @@ public class GuiDetectionTab extends GuiElement
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 142 && yAxis <= 160) if(xAxis >= -21 && xAxis <= -3 && yAxis >= 142 && yAxis <= 160)
{ {
String text = LangUtils.transOnOff(((TileEntityLaserAmplifier)tileEntity).entityDetection); String text = LangUtils.localize("gui.redstoneOutput") + ": ";
displayTooltip(LangUtils.localize("gui.entityDetection") + ": " + text, xAxis, yAxis); displayTooltip(text + ((TileEntityLaserAmplifier)tileEntity).outputMode.getName(), xAxis, yAxis);
} }
mc.renderEngine.bindTexture(defaultLocation); mc.renderEngine.bindTexture(defaultLocation);

View file

@ -2,6 +2,7 @@ package mekanism.client.gui.element;
import mekanism.api.Coord4D; import mekanism.api.Coord4D;
import mekanism.api.EnumColor; import mekanism.api.EnumColor;
import mekanism.api.MekanismConfig.general;
import mekanism.api.util.ListUtils; import mekanism.api.util.ListUtils;
import mekanism.client.MekanismClient; import mekanism.client.MekanismClient;
import mekanism.client.gui.IGuiWrapper; import mekanism.client.gui.IGuiWrapper;
@ -129,6 +130,9 @@ public class GuiSecurityTab extends GuiElement
private SecurityMode getSecurity() private SecurityMode getSecurity()
{ {
if(!general.allowProtection) {
return SecurityMode.PUBLIC;
}
if(isItem) if(isItem)
{ {
if(getItem() == null || !(getItem().getItem() instanceof ISecurityItem)) if(getItem() == null || !(getItem().getItem() instanceof ISecurityItem))
@ -172,7 +176,7 @@ public class GuiSecurityTab extends GuiElement
@Override @Override
public void mouseClicked(int xAxis, int yAxis, int button) public void mouseClicked(int xAxis, int yAxis, int button)
{ {
if(button == 0) if(button == 0 && general.allowProtection)
{ {
if(getOwner() != null && mc.thePlayer.getCommandSenderName().equals(getOwner())) if(getOwner() != null && mc.thePlayer.getCommandSenderName().equals(getOwner()))
{ {

View file

@ -630,6 +630,11 @@ public class RenderPartTransmitter implements IIconSelfRegister
public void renderTransparency(IIcon icon, CCModel cc, Colour color) public void renderTransparency(IIcon icon, CCModel cc, Colour color)
{ {
if(icon == null)
{
return;
}
if(color != null) if(color != null)
{ {
cc.render(new IconTransformation(icon), new ColourMultiplier(color.rgba())); cc.render(new IconTransformation(icon), new ColourMultiplier(color.rgba()));

View file

@ -90,7 +90,7 @@ public class RenderBin extends TileEntitySpecialRenderer
if(amount != "") if(amount != "")
{ {
renderText(amount, ForgeDirection.getOrientation(tileEntity.facing), 0.02F, x, y - 0.31F, z); renderText(amount, ForgeDirection.getOrientation(tileEntity.facing), 0.02F, x, y - 0.3725F, z);
} }
MekanismRenderer.glowOff(); MekanismRenderer.glowOff();

View file

@ -29,7 +29,7 @@ public class RenderDigitalMiner extends TileEntitySpecialRenderer
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "DigitalMiner" + (tileEntity.isActive ? "On" : "") + ".png")); bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "DigitalMiner.png"));
switch(tileEntity.facing) switch(tileEntity.facing)
{ {

View file

@ -281,7 +281,7 @@ public class CommonProxy implements IGuiProvider
general.armoredJetpackDamageRatio = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ArmoredJetpackDamageRatio", 0.8).getDouble(); general.armoredJetpackDamageRatio = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ArmoredJetpackDamageRatio", 0.8).getDouble();
general.armoredJetpackDamageMax = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ArmoredJepackDamageMax", 115).getInt(); general.armoredJetpackDamageMax = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ArmoredJepackDamageMax", 115).getInt();
general.aestheticWorldDamage = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "AestheticWorldDamage", true).getBoolean(); general.aestheticWorldDamage = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "AestheticWorldDamage", true).getBoolean();
general.opsBypassRestrictions = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "OpsBypassRestrictions", true).getBoolean(); general.opsBypassRestrictions = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "OpsBypassRestrictions", false).getBoolean();
general.thermalEvaporationSpeed = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ThermalEvaporationSpeed", 1.0D).getDouble(); general.thermalEvaporationSpeed = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ThermalEvaporationSpeed", 1.0D).getDouble();
general.maxJetpackGas = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MaxJetpackGas", 24000).getInt(); general.maxJetpackGas = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MaxJetpackGas", 24000).getInt();
general.maxScubaGas = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MaxScubaGas", 24000).getInt(); general.maxScubaGas = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MaxScubaGas", 24000).getInt();
@ -297,6 +297,8 @@ public class CommonProxy implements IGuiProvider
general.maxEnergyPerSteam = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MaxEnergyPerSteam", 100D).getDouble(); general.maxEnergyPerSteam = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MaxEnergyPerSteam", 100D).getDouble();
general.superheatingHeatTransfer = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "SuperheatingHeatTransfer", 10000D).getDouble(); general.superheatingHeatTransfer = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "SuperheatingHeatTransfer", 10000D).getDouble();
general.heatPerFuelTick = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "HeatPerFuelTick", 4D).getDouble(); general.heatPerFuelTick = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "HeatPerFuelTick", 4D).getDouble();
general.allowTransmitterAlloyUpgrade = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "AllowTransmitterAlloyUpgrade", true).getBoolean();
general.allowProtection = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "AllowProtection", true).getBoolean();
general.blacklistIC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistIC2Power", false).getBoolean(); general.blacklistIC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistIC2Power", false).getBoolean();
general.blacklistRF = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistRFPower", false).getBoolean(); general.blacklistRF = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistRFPower", false).getBoolean();
@ -486,23 +488,33 @@ public class CommonProxy implements IGuiProvider
return new ContainerRobitMain(player.inventory, robit); return new ContainerRobitMain(player.inventory, robit);
} }
case 22: case 22:
return new ContainerRobitCrafting(player.inventory, world); robit = (EntityRobit)world.getEntityByID(x);
case 23:
EntityRobit robit1 = (EntityRobit)world.getEntityByID(x);
if(robit1 != null) if(robit != null)
{ {
return new ContainerRobitInventory(player.inventory, robit1); return new ContainerRobitCrafting(player.inventory, robit);
}
case 23:
robit = (EntityRobit)world.getEntityByID(x);
if(robit != null)
{
return new ContainerRobitInventory(player.inventory, robit);
} }
case 24: case 24:
EntityRobit robit2 = (EntityRobit)world.getEntityByID(x); robit = (EntityRobit)world.getEntityByID(x);
if(robit2 != null) if(robit != null)
{ {
return new ContainerRobitSmelting(player.inventory, robit2); return new ContainerRobitSmelting(player.inventory, robit);
} }
case 25: case 25:
return new ContainerRobitRepair(player.inventory, world); robit = (EntityRobit)world.getEntityByID(x);
if(robit != null)
{
return new ContainerRobitRepair(player.inventory, robit);
}
case 26: case 26:
return new ContainerNull(player, (TileEntityContainerBlock)tileEntity); return new ContainerNull(player, (TileEntityContainerBlock)tileEntity);
case 27: case 27:

View file

@ -12,6 +12,7 @@ import mekanism.api.Coord4D;
import mekanism.api.transmitters.DynamicNetwork; import mekanism.api.transmitters.DynamicNetwork;
import mekanism.api.transmitters.IGridTransmitter; import mekanism.api.transmitters.IGridTransmitter;
import mekanism.common.util.LangUtils; import mekanism.common.util.LangUtils;
import mekanism.common.util.PipeUtils;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
@ -164,7 +165,7 @@ public class FluidNetwork extends DynamicNetwork<IFluidHandler, FluidNetwork>
if(acceptor != null && fluidToSend != null) if(acceptor != null && fluidToSend != null)
{ {
fluidSent += acceptor.fill(side, new FluidStack(fluidToSend.getFluidID(), currentSending), doTransfer); fluidSent += acceptor.fill(side, PipeUtils.copy(fluidToSend, currentSending), doTransfer);
} }
if(fluidSent > prev) if(fluidSent > prev)

View file

@ -142,7 +142,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
* @author AidanBrady * @author AidanBrady
* *
*/ */
@Mod(modid = "Mekanism", name = "Mekanism", version = "9.0.2", guiFactory = "mekanism.client.gui.ConfigGuiFactory", @Mod(modid = "Mekanism", name = "Mekanism", version = "9.1.1", guiFactory = "mekanism.client.gui.ConfigGuiFactory",
dependencies = "after:ForgeMultipart;after:BuildCraft;after:BuildCraftAPI;after:IC2;after:CoFHCore;" + dependencies = "after:ForgeMultipart;after:BuildCraft;after:BuildCraftAPI;after:IC2;after:CoFHCore;" +
"after:ComputerCraft;after:Galacticraft API;after:MetallurgyCore") "after:ComputerCraft;after:Galacticraft API;after:MetallurgyCore")
public class Mekanism public class Mekanism
@ -168,7 +168,7 @@ public class Mekanism
public static Configuration configuration; public static Configuration configuration;
/** Mekanism version number */ /** Mekanism version number */
public static Version versionNumber = new Version(9, 0, 2); public static Version versionNumber = new Version(9, 1, 1);
/** MultiblockManagers for various structrures */ /** MultiblockManagers for various structrures */
public static MultiblockManager<SynchronizedTankData> tankManager = new MultiblockManager<SynchronizedTankData>("dynamicTank"); public static MultiblockManager<SynchronizedTankData> tankManager = new MultiblockManager<SynchronizedTankData>("dynamicTank");
@ -357,7 +357,7 @@ public class Mekanism
" I ", "IBI", " I ", Character.valueOf('I'), "ingotSteel", Character.valueOf('B'), Items.bucket " I ", "IBI", " I ", Character.valueOf('I'), "ingotSteel", Character.valueOf('B'), Items.bucket
})); }));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 4, 10), new Object[] { CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 4, 10), new Object[] {
" I ", "IGI", " I ", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 9), Character.valueOf('G'), "blockGlass" " I ", "IGI", " I ", Character.valueOf('I'), "ingotSteel", Character.valueOf('G'), "blockGlass"
})); }));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 2, 11), new Object[] { CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 2, 11), new Object[] {
" I ", "ICI", " I ", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 9), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC) " I ", "ICI", " I ", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 9), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
@ -479,15 +479,18 @@ public class Mekanism
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock2, 2, 2), new Object[] { CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock2, 2, 2), new Object[] {
" I ", "ICI", " I ", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock2, 1, 1), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE) " I ", "ICI", " I ", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock2, 1, 1), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE)
})); }));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.FactoryInstaller, 1, 0), new Object[] { CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.TierInstaller, 1, 0), new Object[] {
"RCR", "iWi", "RCR", Character.valueOf('R'), "alloyBasic", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('i'), "ingotIron", Character.valueOf('W'), "plankWood" "RCR", "iWi", "RCR", Character.valueOf('R'), "alloyBasic", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('i'), "ingotIron", Character.valueOf('W'), "plankWood"
})); }));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.FactoryInstaller, 1, 1), new Object[] { CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.TierInstaller, 1, 1), new Object[] {
"ECE", "oWo", "ECE", Character.valueOf('E'), "alloyAdvanced", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED), Character.valueOf('o'), "ingotOsmium", Character.valueOf('W'), "plankWood" "ECE", "oWo", "ECE", Character.valueOf('E'), "alloyAdvanced", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED), Character.valueOf('o'), "ingotOsmium", Character.valueOf('W'), "plankWood"
})); }));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.FactoryInstaller, 1, 2), new Object[] { CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.TierInstaller, 1, 2), new Object[] {
"RCR", "gWg", "RCR", Character.valueOf('R'), "alloyElite", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE), Character.valueOf('g'), "ingotGold", Character.valueOf('W'), "plankWood" "RCR", "gWg", "RCR", Character.valueOf('R'), "alloyElite", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE), Character.valueOf('g'), "ingotGold", Character.valueOf('W'), "plankWood"
})); }));
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.TierInstaller, 1, 3), new Object[] {
"RCR", "dWd", "RCR", Character.valueOf('R'), "alloyUltimate", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ULTIMATE), Character.valueOf('d'), "gemDiamond", Character.valueOf('W'), "plankWood"
}));
MachineType.OREDICTIONIFICATOR.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock3, 1, 3), new Object[] { MachineType.OREDICTIONIFICATOR.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock3, 1, 3), new Object[] {
"SGS", "CBC", "SWS", Character.valueOf('S'), "ingotSteel", Character.valueOf('G'), "paneGlass", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('B'), MekanismItems.Dictionary, Character.valueOf('W'), Blocks.chest "SGS", "CBC", "SWS", Character.valueOf('S'), "ingotSteel", Character.valueOf('G'), "paneGlass", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('B'), MekanismItems.Dictionary, Character.valueOf('W'), Blocks.chest
})); }));
@ -1206,14 +1209,14 @@ public class Mekanism
@EventHandler @EventHandler
public void preInit(FMLPreInitializationEvent event) public void preInit(FMLPreInitializationEvent event)
{ {
//Register tier information
Tier.init();
File config = event.getSuggestedConfigurationFile(); File config = event.getSuggestedConfigurationFile();
//Set the mod's configuration //Set the mod's configuration
configuration = new Configuration(config); configuration = new Configuration(config);
//Register tier information
Tier.init();
if(config.getAbsolutePath().contains("voltz")) if(config.getAbsolutePath().contains("voltz"))
{ {
logger.info("Detected Voltz in root directory - hello, fellow user!"); logger.info("Detected Voltz in root directory - hello, fellow user!");

View file

@ -14,7 +14,7 @@ import mekanism.common.item.ItemDirtyDust;
import mekanism.common.item.ItemDust; import mekanism.common.item.ItemDust;
import mekanism.common.item.ItemElectricBow; import mekanism.common.item.ItemElectricBow;
import mekanism.common.item.ItemEnergized; import mekanism.common.item.ItemEnergized;
import mekanism.common.item.ItemFactoryInstaller; import mekanism.common.item.ItemTierInstaller;
import mekanism.common.item.ItemFlamethrower; import mekanism.common.item.ItemFlamethrower;
import mekanism.common.item.ItemFreeRunners; import mekanism.common.item.ItemFreeRunners;
import mekanism.common.item.ItemGasMask; import mekanism.common.item.ItemGasMask;
@ -69,7 +69,7 @@ public class MekanismItems
public static final Item FilterUpgrade = new ItemUpgrade(Upgrade.FILTER).setUnlocalizedName("FilterUpgrade"); public static final Item FilterUpgrade = new ItemUpgrade(Upgrade.FILTER).setUnlocalizedName("FilterUpgrade");
public static final Item MufflingUpgrade = new ItemUpgrade(Upgrade.MUFFLING).setUnlocalizedName("MufflingUpgrade"); public static final Item MufflingUpgrade = new ItemUpgrade(Upgrade.MUFFLING).setUnlocalizedName("MufflingUpgrade");
public static final Item GasUpgrade = new ItemUpgrade(Upgrade.GAS).setUnlocalizedName("GasUpgrade"); public static final Item GasUpgrade = new ItemUpgrade(Upgrade.GAS).setUnlocalizedName("GasUpgrade");
public static final Item FactoryInstaller = new ItemFactoryInstaller().setUnlocalizedName("FactoryInstaller"); public static final Item TierInstaller = new ItemTierInstaller().setUnlocalizedName("FactoryInstaller");
public static final ItemEnergized EnergyTablet = (ItemEnergized)new ItemEnergized(1000000).setUnlocalizedName("EnergyTablet"); public static final ItemEnergized EnergyTablet = (ItemEnergized)new ItemEnergized(1000000).setUnlocalizedName("EnergyTablet");
public static final ItemRobit Robit = (ItemRobit)new ItemRobit().setUnlocalizedName("Robit"); public static final ItemRobit Robit = (ItemRobit)new ItemRobit().setUnlocalizedName("Robit");
public static final ItemAtomicDisassembler AtomicDisassembler = (ItemAtomicDisassembler)new ItemAtomicDisassembler().setUnlocalizedName("AtomicDisassembler"); public static final ItemAtomicDisassembler AtomicDisassembler = (ItemAtomicDisassembler)new ItemAtomicDisassembler().setUnlocalizedName("AtomicDisassembler");
@ -163,7 +163,7 @@ public class MekanismItems
GameRegistry.registerItem(GlowPanel, "GlowPanel"); GameRegistry.registerItem(GlowPanel, "GlowPanel");
GameRegistry.registerItem(Flamethrower, "Flamethrower"); GameRegistry.registerItem(Flamethrower, "Flamethrower");
GameRegistry.registerItem(GaugeDropper, "GaugeDropper"); GameRegistry.registerItem(GaugeDropper, "GaugeDropper");
GameRegistry.registerItem(FactoryInstaller, "FactoryInstaller"); GameRegistry.registerItem(TierInstaller, "FactoryInstaller");
GameRegistry.registerItem(OtherDust, "OtherDust"); GameRegistry.registerItem(OtherDust, "OtherDust");
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluid("brine"), new ItemStack(BrineBucket), FluidContainerRegistry.EMPTY_BUCKET); FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluid("brine"), new ItemStack(BrineBucket), FluidContainerRegistry.EMPTY_BUCKET);

View file

@ -44,7 +44,6 @@ public class RobitAIFollow extends EntityAIBase
thePathfinder = entityRobit.getNavigator(); thePathfinder = entityRobit.getNavigator();
minDist = min; minDist = min;
maxDist = max; maxDist = max;
setMutexBits(3);
} }
@Override @Override

View file

@ -42,7 +42,6 @@ public class RobitAIPickup extends EntityAIBase
theWorld = entityRobit.worldObj; theWorld = entityRobit.worldObj;
moveSpeed = speed; moveSpeed = speed;
thePathfinder = entityRobit.getNavigator(); thePathfinder = entityRobit.getNavigator();
setMutexBits(3);
} }
@Override @Override
@ -52,6 +51,7 @@ public class RobitAIPickup extends EntityAIBase
{ {
return false; return false;
} }
if(closest != null && closest.getDistanceSqToEntity(closest) > 100 && thePathfinder.getPathToXYZ(closest.posX, closest.posY, closest.posZ) != null) if(closest != null && closest.getDistanceSqToEntity(closest) > 100 && thePathfinder.getPathToXYZ(closest.posX, closest.posY, closest.posZ) != null)
{ {
return true; return true;
@ -81,7 +81,7 @@ public class RobitAIPickup extends EntityAIBase
} }
} }
if(closest == null) if(closest == null || closest.isDead)
{ {
//No valid items //No valid items
return false; return false;
@ -94,7 +94,7 @@ public class RobitAIPickup extends EntityAIBase
@Override @Override
public boolean continueExecuting() public boolean continueExecuting()
{ {
return !closest.isDead && !thePathfinder.noPath() && theRobit.getDistanceSqToEntity(closest) > 100 && theRobit.getFollowing() && theRobit.getEnergy() > 0 && closest.worldObj.provider.dimensionId == theRobit.worldObj.provider.dimensionId; return !closest.isDead && !thePathfinder.noPath() && theRobit.getDistanceSqToEntity(closest) > 100 && theRobit.getDropPickup() && theRobit.getEnergy() > 0 && closest.worldObj.provider.dimensionId == theRobit.worldObj.provider.dimensionId;
} }
@Override @Override
@ -115,13 +115,13 @@ public class RobitAIPickup extends EntityAIBase
@Override @Override
public void updateTask() public void updateTask()
{ {
theRobit.getLookHelper().setLookPositionWithEntity(closest, 6.0F, theRobit.getVerticalFaceSpeed()/10);
if(!theRobit.getDropPickup()) if(!theRobit.getDropPickup())
{ {
return; return;
} }
theRobit.getLookHelper().setLookPositionWithEntity(closest, 6.0F, theRobit.getVerticalFaceSpeed()/10);
if(--ticker <= 0) if(--ticker <= 0)
{ {
ticker = 10; ticker = 10;
@ -147,7 +147,6 @@ public class RobitAIPickup extends EntityAIBase
} }
} }
} }
} }
} }
} }

View file

@ -1,6 +1,9 @@
package mekanism.common; package mekanism.common;
import java.util.List;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
import cpw.mods.fml.relauncher.FMLInjectionData;
/** /**
* Thread used to retrieve data from the Mekanism server. * Thread used to retrieve data from the Mekanism server.
@ -18,8 +21,26 @@ public class ThreadGetData extends Thread
@Override @Override
public void run() public void run()
{ {
Mekanism.latestVersionNumber = MekanismUtils.getLatestVersion(); List<String> ret = MekanismUtils.getHTML("http://aidancbrady.com/data/versions/Mekanism.txt");
Mekanism.recentNews = MekanismUtils.getRecentNews();
Mekanism.latestVersionNumber = "null";
Mekanism.recentNews = "null";
for(String s : ret)
{
String[] text = s.split(":");
if(text.length == 3 && !text[0].contains("UTF-8") && !text[0].contains("HTML") && !text[0].contains("http"))
{
if(Version.get(text[0]) != null && Version.get(text[0]).equals(Version.get((String)FMLInjectionData.data()[4])))
{
Mekanism.latestVersionNumber = text[1];
Mekanism.recentNews = text[2];
break;
}
}
}
MekanismUtils.updateDonators(); MekanismUtils.updateDonators();
} }

View file

@ -1,7 +1,7 @@
package mekanism.common; package mekanism.common;
/** /**
* Version v1.0.4. Simple version handling for Mekanism. * Version v2.0.0. Simple version handling for Mekanism.
* @author AidanBrady * @author AidanBrady
* *
*/ */
@ -127,4 +127,29 @@ public class Version
return major + "." + minor + "." + build; return major + "." + minor + "." + build;
} }
} }
@Override
public int hashCode()
{
int result = 1;
result = 31 * result + build;
result = 31 * result + major;
result = 31 * result + minor;
return result;
}
@Override
public boolean equals(Object obj)
{
if(obj == null || getClass() != obj.getClass())
{
return false;
}
Version other = (Version)obj;
return build == other.build && major == other.major && minor == other.minor;
}
} }

View file

@ -103,8 +103,7 @@ public abstract class EnergyAcceptorWrapper implements IStrictEnergyAcceptor
@Override @Override
public double transferEnergyToAcceptor(ForgeDirection side, double amount) public double transferEnergyToAcceptor(ForgeDirection side, double amount)
{ {
int needed = Math.min(acceptor.getMaxEnergyStored(side)-acceptor.getEnergyStored(side), Integer.MAX_VALUE); int transferred = acceptor.receiveEnergy(side, Math.min(Integer.MAX_VALUE, toRF(amount)), false);
int transferred = acceptor.receiveEnergy(side, Math.min(needed, toRF(amount)), false);
return fromRF(transferred); return fromRF(transferred);
} }
@ -170,7 +169,9 @@ public abstract class EnergyAcceptorWrapper implements IStrictEnergyAcceptor
public double transferEnergyToAcceptor(ForgeDirection side, double amount) public double transferEnergyToAcceptor(ForgeDirection side, double amount)
{ {
double toTransfer = Math.min(Math.min(acceptor.getDemandedEnergy(), toEU(amount)), Integer.MAX_VALUE); double toTransfer = Math.min(Math.min(acceptor.getDemandedEnergy(), toEU(amount)), Integer.MAX_VALUE);
return amount - fromEU(acceptor.injectEnergy(side, toTransfer, 0)); double rejects = acceptor.injectEnergy(side, toTransfer, 0);
return fromEU(toTransfer - rejects);
} }
@Override @Override

View file

@ -243,6 +243,24 @@ public interface IFactory
return fuelSpeed; return fuelSpeed;
} }
public static RecipeType getFromMachine(Block block, int meta)
{
RecipeType type = null;
for(RecipeType iterType : RecipeType.values())
{
ItemStack machineStack = iterType.getStack();
if(Block.getBlockFromItem(machineStack.getItem()) == block && machineStack.getItemDamage() == meta)
{
type = iterType;
break;
}
}
return type;
}
private RecipeType(String s, String s1, ItemStack is, boolean b, boolean b1, Recipe r) private RecipeType(String s, String s1, ItemStack is, boolean b, boolean b1, Recipe r)
{ {
name = s; name = s;

View file

@ -0,0 +1,8 @@
package mekanism.common.base;
import mekanism.common.Tier.BaseTier;
public interface ITierUpgradeable
{
public boolean upgrade(BaseTier upgradeTier);
}

View file

@ -37,7 +37,7 @@ public class BlockBounding extends Block
{ {
try { try {
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z); TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z);
return world.getBlock(tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ).onBlockActivated(world, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ, entityplayer, facing, playerX, playerY, playerZ); return getMainBlock(tileEntity, world).onBlockActivated(world, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ, entityplayer, facing, playerX, playerY, playerZ);
} catch(Exception e) { } catch(Exception e) {
return false; return false;
} }
@ -56,7 +56,7 @@ public class BlockBounding extends Block
{ {
try { try {
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z); TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z);
return world.getBlock(tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ).getPickBlock(target, world, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ, player); return getMainBlock(tileEntity, world).getPickBlock(target, world, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ, player);
} catch(Exception e) { } catch(Exception e) {
return null; return null;
} }
@ -67,7 +67,7 @@ public class BlockBounding extends Block
{ {
try { try {
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z); TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z);
return world.getBlock(tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ).removedByPlayer(world, player, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ, willHarvest); return getMainBlock(tileEntity, world).removedByPlayer(world, player, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ, willHarvest);
} catch(Exception e) { } catch(Exception e) {
return false; return false;
} }
@ -79,7 +79,7 @@ public class BlockBounding extends Block
try { try {
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z); TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z);
tileEntity.onNeighborChange(block); tileEntity.onNeighborChange(block);
world.getBlock(tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ).onNeighborBlockChange(world, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ, this); getMainBlock(tileEntity, world).onNeighborBlockChange(world, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ, this);
} catch(Exception e) {} } catch(Exception e) {}
} }
@ -88,12 +88,24 @@ public class BlockBounding extends Block
{ {
try { try {
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z); TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(x, y, z);
return world.getBlock(tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ).getPlayerRelativeBlockHardness(player, world, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ); return getMainBlock(tileEntity, world).getPlayerRelativeBlockHardness(player, world, tileEntity.mainX, tileEntity.mainY, tileEntity.mainZ);
} catch(Exception e) { } catch(Exception e) {
return super.getPlayerRelativeBlockHardness(player, world, x, y, z); return super.getPlayerRelativeBlockHardness(player, world, x, y, z);
} }
} }
private Block getMainBlock(TileEntityBoundingBlock mainTile, World world)
{
Block block = world.getBlock(mainTile.mainX, mainTile.mainY, mainTile.mainZ);
if(block instanceof BlockBounding)
{
return null;
}
return block;
}
@Override @Override
public int quantityDropped(Random random) public int quantityDropped(Random random)
{ {

View file

@ -84,6 +84,7 @@ import mekanism.common.tile.TileEntitySolarNeutronActivator;
import mekanism.common.tile.TileEntityTeleporter; import mekanism.common.tile.TileEntityTeleporter;
import mekanism.common.util.LangUtils; import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
import mekanism.common.util.PipeUtils;
import mekanism.common.util.SecurityUtils; import mekanism.common.util.SecurityUtils;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
@ -687,7 +688,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IBlo
{ {
String owner = ((ISecurityTile)tileEntity).getSecurity().getOwner(); String owner = ((ISecurityTile)tileEntity).getSecurity().getOwner();
if(owner == null || entityplayer.getCommandSenderName().equals(owner)) if(MekanismUtils.isOp((EntityPlayerMP)entityplayer) || owner == null || entityplayer.getCommandSenderName().equals(owner))
{ {
entityplayer.openGui(Mekanism.instance, type.guiId, world, x, y, z); entityplayer.openGui(Mekanism.instance, type.guiId, world, x, y, z);
} }
@ -801,6 +802,38 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IBlo
return world.setBlockToAir(x, y, z); return world.setBlockToAir(x, y, z);
} }
@Override
public boolean hasComparatorInputOverride()
{
return true;
}
@Override
public int getComparatorInputOverride(World world, int x, int y, int z, int par5)
{
TileEntity tileEntity = world.getTileEntity(x, y, z);
if(tileEntity instanceof TileEntityFluidTank)
{
return ((TileEntityFluidTank)tileEntity).getRedstoneLevel();
}
if(tileEntity instanceof TileEntityLaserAmplifier)
{
TileEntityLaserAmplifier amplifier = (TileEntityLaserAmplifier)tileEntity;
if(amplifier.outputMode == TileEntityLaserAmplifier.RedstoneOutput.ENERGY_CONTENTS)
{
return amplifier.getRedstoneLevel();
}
else {
return isProvidingWeakPower(world, x, y, z, par5);
}
}
return 0;
}
private boolean manageInventory(EntityPlayer player, TileEntityFluidTank tileEntity) private boolean manageInventory(EntityPlayer player, TileEntityFluidTank tileEntity)
{ {
ItemStack itemStack = player.getCurrentEquippedItem(); ItemStack itemStack = player.getCurrentEquippedItem();
@ -899,7 +932,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IBlo
if(itemFluid.amount-toFill > 0) if(itemFluid.amount-toFill > 0)
{ {
tileEntity.pushUp(new FluidStack(itemFluid.getFluid(), itemFluid.amount-toFill), true); tileEntity.pushUp(PipeUtils.copy(itemFluid, itemFluid.amount-toFill), true);
} }
return true; return true;

View file

@ -90,7 +90,7 @@ public class InventoryFrequency extends Frequency
if(nbtTags.hasKey("storedItem")) if(nbtTags.hasKey("storedItem"))
{ {
storedItem.readFromNBT(nbtTags.getCompoundTag("storedItem")); storedItem = ItemStack.loadItemStackFromNBT(nbtTags.getCompoundTag("storedItem"));
} }
temperature = nbtTags.getDouble("temperature"); temperature = nbtTags.getDouble("temperature");

View file

@ -16,7 +16,7 @@ import net.minecraft.item.ItemStack;
public class TankUpdateProtocol extends UpdateProtocol<SynchronizedTankData> public class TankUpdateProtocol extends UpdateProtocol<SynchronizedTankData>
{ {
public static final int FLUID_PER_TANK = 16000; public static final int FLUID_PER_TANK = 64000;
public TankUpdateProtocol(TileEntityDynamicTank tileEntity) public TankUpdateProtocol(TileEntityDynamicTank tileEntity)
{ {

View file

@ -4,8 +4,10 @@ import io.netty.buffer.ByteBuf;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List;
import java.util.Set; import java.util.Set;
import mekanism.api.Coord4D; import mekanism.api.Coord4D;
@ -18,6 +20,10 @@ import net.minecraftforge.common.util.Constants.NBT;
public class FrequencyManager public class FrequencyManager
{ {
public static final int MAX_FREQ_LENGTH = 16;
public static final List<Character> SPECIAL_CHARS = Arrays.asList('-', ' ', '|', '\'', '\"', '_', '+', ':', '(', ')',
'?', '!', '/', '@', '$', '`', '~', ',', '.', '#');
public static boolean loaded; public static boolean loaded;
private static Set<FrequencyManager> managers = new HashSet<FrequencyManager>(); private static Set<FrequencyManager> managers = new HashSet<FrequencyManager>();
@ -147,6 +153,7 @@ public class FrequencyManager
if(user.equals(freq.owner)) if(user.equals(freq.owner))
{ {
freq.activeCoords.add(coord); freq.activeCoords.add(coord);
freq.valid = true;
frequencies.add(freq); frequencies.add(freq);
dataHandler.markDirty(); dataHandler.markDirty();

View file

@ -267,6 +267,13 @@ public final class OreDictManager
RecipeHandler.addCrusherRecipe(new ItemStack(Items.gunpowder), StackUtils.size(OreDictionary.getOres("dustSaltpeter").get(0), 1)); RecipeHandler.addCrusherRecipe(new ItemStack(Items.gunpowder), StackUtils.size(OreDictionary.getOres("dustSaltpeter").get(0), 1));
} catch(Exception e) {} } catch(Exception e) {}
for(ItemStack ore : OreDictionary.getOres("sand"))
{
try {
RecipeHandler.addCrusherRecipe(StackUtils.size(ore, 1), StackUtils.size(OreDictionary.getOres("itemSilicon").get(0), 1));
} catch(Exception e) {}
}
for(ItemStack ore : OreDictionary.getOres("dustSaltpeter")) for(ItemStack ore : OreDictionary.getOres("dustSaltpeter"))
{ {
RecipeHandler.addEnrichmentChamberRecipe(StackUtils.size(ore, 1), new ItemStack(Items.gunpowder)); RecipeHandler.addEnrichmentChamberRecipe(StackUtils.size(ore, 1), new ItemStack(Items.gunpowder));

View file

@ -178,7 +178,7 @@ public class ContainerFactory extends Container
} }
else if(tileEntity.recipeType.getItemGas(slotStack) != null) else if(tileEntity.recipeType.getItemGas(slotStack) != null)
{ {
if(slotID > tileEntity.inventory.length-1) if(slotID >= tileEntity.inventory.length-1)
{ {
if(!mergeItemStack(slotStack, 3, 4, false)) if(!mergeItemStack(slotStack, 3, 4, false))
{ {
@ -194,7 +194,7 @@ public class ContainerFactory extends Container
} }
else if(tileEntity.recipeType == RecipeType.INFUSING && InfuseRegistry.getObject(slotStack) != null && (tileEntity.infuseStored.type == null || tileEntity.infuseStored.type == InfuseRegistry.getObject(slotStack).type)) else if(tileEntity.recipeType == RecipeType.INFUSING && InfuseRegistry.getObject(slotStack) != null && (tileEntity.infuseStored.type == null || tileEntity.infuseStored.type == InfuseRegistry.getObject(slotStack).type))
{ {
if(slotID > tileEntity.inventory.length-1) if(slotID >= tileEntity.inventory.length-1)
{ {
if(!mergeItemStack(slotStack, 3, 4, false)) if(!mergeItemStack(slotStack, 3, 4, false))
{ {
@ -267,25 +267,11 @@ public class ContainerFactory extends Container
public boolean isInputSlot(int slot) public boolean isInputSlot(int slot)
{ {
if(tileEntity.tier == Tier.FactoryTier.BASIC) return slot >= 4 && slot < 4+tileEntity.tier.processes;
return slot >= 4 && slot <= 6;
if(tileEntity.tier == Tier.FactoryTier.ADVANCED)
return slot >= 4 && slot <= 8;
if(tileEntity.tier == Tier.FactoryTier.ELITE)
return slot >= 4 && slot <= 10;
return false;
} }
public boolean isOutputSlot(int slot) public boolean isOutputSlot(int slot)
{ {
if(tileEntity.tier == Tier.FactoryTier.BASIC) return slot >= 4+tileEntity.tier.processes && slot < 4+tileEntity.tier.processes*2;
return slot >= 7 && slot <= 9;
if(tileEntity.tier == Tier.FactoryTier.ADVANCED)
return slot >= 9 && slot <= 13;
if(tileEntity.tier == Tier.FactoryTier.ELITE)
return slot >= 11 && slot <= 17;
return false;
} }
} }

View file

@ -1,20 +1,24 @@
package mekanism.common.inventory.container; package mekanism.common.inventory.container;
import mekanism.common.entity.EntityRobit;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ContainerWorkbench; import net.minecraft.inventory.ContainerWorkbench;
import net.minecraft.world.World;
public class ContainerRobitCrafting extends ContainerWorkbench public class ContainerRobitCrafting extends ContainerWorkbench
{ {
public ContainerRobitCrafting(InventoryPlayer inventory, World world) public EntityRobit robit;
public ContainerRobitCrafting(InventoryPlayer inventory, EntityRobit entity)
{ {
super(inventory, world, 0, 0, 0); super(inventory, entity.worldObj, 0, 0, 0);
robit = entity;
} }
@Override @Override
public boolean canInteractWith(EntityPlayer entityplayer) public boolean canInteractWith(EntityPlayer entityplayer)
{ {
return true; return !robit.isDead;
} }
} }

View file

@ -43,7 +43,7 @@ public class ContainerRobitInventory extends Container
@Override @Override
public boolean canInteractWith(EntityPlayer entityplayer) public boolean canInteractWith(EntityPlayer entityplayer)
{ {
return true; return !robit.isDead;
} }
@Override @Override

View file

@ -45,7 +45,7 @@ public class ContainerRobitMain extends Container
@Override @Override
public boolean canInteractWith(EntityPlayer entityplayer) public boolean canInteractWith(EntityPlayer entityplayer)
{ {
return true; return !robit.isDead;
} }
@Override @Override

View file

@ -1,20 +1,24 @@
package mekanism.common.inventory.container; package mekanism.common.inventory.container;
import mekanism.common.entity.EntityRobit;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ContainerRepair; import net.minecraft.inventory.ContainerRepair;
import net.minecraft.world.World;
public class ContainerRobitRepair extends ContainerRepair public class ContainerRobitRepair extends ContainerRepair
{ {
public ContainerRobitRepair(InventoryPlayer inventory, World world) public EntityRobit robit;
public ContainerRobitRepair(InventoryPlayer inventory, EntityRobit entity)
{ {
super(inventory, world, 0, 0, 0, inventory.player); super(inventory, entity.worldObj, 0, 0, 0, inventory.player);
robit = entity;
} }
@Override @Override
public boolean canInteractWith(EntityPlayer entityplayer) public boolean canInteractWith(EntityPlayer entityplayer)
{ {
return true; return !robit.isDead;
} }
} }

View file

@ -47,7 +47,7 @@ public class ContainerRobitSmelting extends Container
@Override @Override
public boolean canInteractWith(EntityPlayer entityplayer) public boolean canInteractWith(EntityPlayer entityplayer)
{ {
return true; return !robit.isDead;
} }
@Override @Override

View file

@ -1,6 +1,7 @@
package mekanism.common.item; package mekanism.common.item;
import mekanism.api.IAlloyInteraction; import mekanism.api.IAlloyInteraction;
import mekanism.api.MekanismConfig.general;
import mekanism.common.MekanismItems; import mekanism.common.MekanismItems;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -19,7 +20,7 @@ public class ItemAlloy extends ItemMekanism
{ {
TileEntity tile = world.getTileEntity(x, y, z); TileEntity tile = world.getTileEntity(x, y, z);
if(tile instanceof IAlloyInteraction) if(general.allowTransmitterAlloyUpgrade && tile instanceof IAlloyInteraction)
{ {
if(!world.isRemote) if(!world.isRemote)
{ {

View file

@ -158,11 +158,13 @@ public class ItemBlockBasic extends ItemBlock implements IEnergizedItem, ITierIt
if(inv.getItemCount() > 0) if(inv.getItemCount() > 0)
{ {
list.add(EnumColor.BRIGHT_GREEN + inv.getItemType().getDisplayName()); list.add(EnumColor.BRIGHT_GREEN + inv.getItemType().getDisplayName());
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.itemAmount") + ": " + EnumColor.GREY + inv.getItemCount()); list.add(EnumColor.PURPLE + LangUtils.localize("tooltip.itemAmount") + ": " + EnumColor.GREY + inv.getItemCount());
} }
else { else {
list.add(EnumColor.DARK_RED + LangUtils.localize("gui.empty")); list.add(EnumColor.DARK_RED + LangUtils.localize("gui.empty"));
} }
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + BinTier.values()[getBaseTier(itemstack).ordinal()].storage + " " + LangUtils.localize("transmission.Items"));
} }
else if(type == BasicType.INDUCTION_CELL) else if(type == BasicType.INDUCTION_CELL)
{ {

View file

@ -64,6 +64,7 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
{ {
list.add(EnumColor.BRIGHT_GREEN + LangUtils.localize("tooltip.storedEnergy") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(getEnergy(itemstack))); list.add(EnumColor.BRIGHT_GREEN + LangUtils.localize("tooltip.storedEnergy") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(getEnergy(itemstack)));
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(getEnergyCubeTier(itemstack).maxEnergy));
if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey)) if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey))
{ {
@ -392,7 +393,7 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE
@Override @Override
public SecurityMode getSecurity(ItemStack stack) public SecurityMode getSecurity(ItemStack stack)
{ {
if(stack.stackTagCompound == null) if(stack.stackTagCompound == null || !general.allowProtection)
{ {
return SecurityMode.PUBLIC; return SecurityMode.PUBLIC;
} }

View file

@ -122,12 +122,14 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI
if(gasStack == null) if(gasStack == null)
{ {
list.add(LangUtils.localize("tooltip.noGas") + "."); list.add(EnumColor.DARK_RED + LangUtils.localize("gui.empty") + ".");
} }
else { else {
list.add(LangUtils.localize("tooltip.stored") + " " + gasStack.getGas().getLocalizedName() + ": " + gasStack.amount); list.add(EnumColor.ORANGE + gasStack.getGas().getLocalizedName() + ": " + EnumColor.GREY + gasStack.amount);
} }
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + GasTankTier.values()[getBaseTier(itemstack).ordinal()].storage);
if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey)) if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey))
{ {
list.add(LangUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " " + LangUtils.localize("tooltip.forDetails") + "."); list.add(LangUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " " + LangUtils.localize("tooltip.forDetails") + ".");
@ -371,7 +373,7 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI
@Override @Override
public SecurityMode getSecurity(ItemStack stack) public SecurityMode getSecurity(ItemStack stack)
{ {
if(stack.stackTagCompound == null) if(stack.stackTagCompound == null || !general.allowProtection)
{ {
return SecurityMode.PUBLIC; return SecurityMode.PUBLIC;
} }

View file

@ -36,6 +36,7 @@ import mekanism.common.tile.TileEntityFactory;
import mekanism.common.tile.TileEntityFluidTank; import mekanism.common.tile.TileEntityFluidTank;
import mekanism.common.util.LangUtils; import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
import mekanism.common.util.PipeUtils;
import mekanism.common.util.SecurityUtils; import mekanism.common.util.SecurityUtils;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
@ -178,8 +179,13 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
if(fluidStack != null) if(fluidStack != null)
{ {
list.add(EnumColor.PINK + LangUtils.localizeFluidStack(fluidStack) + ": " + EnumColor.GREY + getFluidStack(itemstack).amount + "mB"); list.add(EnumColor.AQUA + LangUtils.localizeFluidStack(fluidStack) + ": " + EnumColor.GREY + getFluidStack(itemstack).amount + "mB");
} }
else {
list.add(EnumColor.DARK_RED + LangUtils.localize("gui.empty") + ".");
}
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.capacity") + ": " + EnumColor.GREY + FluidTankTier.values()[getBaseTier(itemstack).ordinal()].storage + " mB");
} }
list.add(LangUtils.localize("tooltip.hold") + " " + EnumColor.INDIGO + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " " + LangUtils.localize("tooltip.forDetails") + "."); list.add(LangUtils.localize("tooltip.hold") + " " + EnumColor.INDIGO + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " " + LangUtils.localize("tooltip.forDetails") + ".");
@ -852,7 +858,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
if(doFill) if(doFill)
{ {
int fillAmount = toFill + (stored == null ? 0 : stored.amount); int fillAmount = toFill + (stored == null ? 0 : stored.amount);
setFluidStack(new FluidStack(resource.getFluid(), (stored != null ? stored.amount : 0)+toFill), container); setFluidStack(PipeUtils.copy(resource, (stored != null ? stored.amount : 0)+toFill), container);
} }
return toFill; return toFill;
@ -870,7 +876,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
if(stored != null) if(stored != null)
{ {
FluidStack toDrain = new FluidStack(stored.getFluid(), Math.min(stored.amount, maxDrain)); FluidStack toDrain = PipeUtils.copy(stored, Math.min(stored.amount, maxDrain));
if(doDrain) if(doDrain)
{ {
@ -938,7 +944,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
@Override @Override
public SecurityMode getSecurity(ItemStack stack) public SecurityMode getSecurity(ItemStack stack)
{ {
if(stack.stackTagCompound == null) if(stack.stackTagCompound == null || !general.allowProtection)
{ {
return SecurityMode.PUBLIC; return SecurityMode.PUBLIC;
} }

View file

@ -1,159 +0,0 @@
package mekanism.common.item;
import java.util.List;
import mekanism.common.Tier.BaseTier;
import mekanism.common.Tier.FactoryTier;
import mekanism.common.base.IFactory.RecipeType;
import mekanism.common.tile.TileEntityAdvancedElectricMachine;
import mekanism.common.tile.TileEntityBasicBlock;
import mekanism.common.tile.TileEntityElectricMachine;
import mekanism.common.tile.TileEntityFactory;
import mekanism.common.tile.TileEntityMetallurgicInfuser;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class ItemFactoryInstaller extends ItemMekanism
{
public IIcon[] icons = new IIcon[256];
public ItemFactoryInstaller()
{
super();
setMaxStackSize(1);
setHasSubtypes(true);
}
@Override
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
{
if(world.isRemote)
{
return false;
}
TileEntity tile = world.getTileEntity(x, y, z);
FactoryTier tier = FactoryTier.values()[stack.getItemDamage()];
if(tile instanceof TileEntityBasicBlock && ((TileEntityBasicBlock)tile).playersUsing.size() > 0)
{
return true;
}
if(tile instanceof TileEntityFactory && tier != FactoryTier.BASIC)
{
TileEntityFactory factory = (TileEntityFactory)tile;
if(factory.tier.ordinal()+1 == tier.ordinal())
{
if(!world.isRemote)
{
factory.upgrade();
}
if(!player.capabilities.isCreativeMode)
{
stack.stackSize = 0;
}
return true;
}
}
else if(tile != null && tier == FactoryTier.BASIC)
{
RecipeType type = null;
for(RecipeType iterType : RecipeType.values())
{
ItemStack machineStack = iterType.getStack();
if(Block.getBlockFromItem(machineStack.getItem()) == world.getBlock(x, y, z) && machineStack.getItemDamage() == world.getBlockMetadata(x, y, z))
{
type = iterType;
break;
}
}
if(type != null)
{
if(tile instanceof TileEntityElectricMachine)
{
((TileEntityElectricMachine)tile).upgrade(type);
if(!player.capabilities.isCreativeMode)
{
stack.stackSize = 0;
}
return true;
}
else if(tile instanceof TileEntityAdvancedElectricMachine)
{
((TileEntityAdvancedElectricMachine)tile).upgrade(type);
if(!player.capabilities.isCreativeMode)
{
stack.stackSize = 0;
}
return true;
}
else if(tile instanceof TileEntityMetallurgicInfuser)
{
((TileEntityMetallurgicInfuser)tile).upgrade(type);
if(!player.capabilities.isCreativeMode)
{
stack.stackSize = 0;
}
return true;
}
}
}
return false;
}
private int getOutputSlot(FactoryTier tier, int operation)
{
return 5+tier.processes+operation;
}
@Override
public void registerIcons(IIconRegister register)
{
for(FactoryTier tier : FactoryTier.values())
{
icons[tier.ordinal()] = register.registerIcon("mekanism:" + tier.getBaseTier().getName() + "FactoryInstaller");
}
}
@Override
public IIcon getIconFromDamage(int meta)
{
return icons[meta];
}
@Override
public void getSubItems(Item item, CreativeTabs tabs, List itemList)
{
for(FactoryTier tier : FactoryTier.values())
{
itemList.add(new ItemStack(item, 1, tier.ordinal()));
}
}
@Override
public String getUnlocalizedName(ItemStack item)
{
return "item." + BaseTier.values()[item.getItemDamage()].getName().toLowerCase() + "FactoryInstaller";
}
}

View file

@ -7,6 +7,7 @@ import mekanism.api.gas.GasStack;
import mekanism.api.gas.IGasItem; import mekanism.api.gas.IGasItem;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.util.LangUtils; import mekanism.common.util.LangUtils;
import mekanism.common.util.PipeUtils;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
@ -164,7 +165,7 @@ public class ItemGaugeDropper extends ItemMekanism implements IGasItem, IFluidCo
if(doFill) if(doFill)
{ {
int fillAmount = toFill + (stored == null ? 0 : stored.amount); int fillAmount = toFill + (stored == null ? 0 : stored.amount);
setFluid(container, new FluidStack(resource.getFluid(), (stored != null ? stored.amount : 0)+toFill)); setFluid(container, PipeUtils.copy(resource, (stored != null ? stored.amount : 0)+toFill));
} }
return toFill; return toFill;
@ -177,7 +178,7 @@ public class ItemGaugeDropper extends ItemMekanism implements IGasItem, IFluidCo
if(stored != null) if(stored != null)
{ {
FluidStack toDrain = new FluidStack(stored.getFluid(), Math.min(stored.amount, maxDrain)); FluidStack toDrain = PipeUtils.copy(stored, Math.min(stored.amount, maxDrain));
if(doDrain) if(doDrain)
{ {

View file

@ -4,13 +4,10 @@ import java.util.List;
import mekanism.api.Coord4D; import mekanism.api.Coord4D;
import mekanism.api.EnumColor; import mekanism.api.EnumColor;
import mekanism.client.MekKeyHandler;
import mekanism.client.MekanismKeyHandler;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.security.IOwnerItem; import mekanism.common.security.IOwnerItem;
import mekanism.common.util.LangUtils; import mekanism.common.util.LangUtils;
import mekanism.common.util.SecurityUtils; import mekanism.common.util.SecurityUtils;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -36,13 +33,7 @@ public class ItemPortableTeleporter extends ItemEnergized implements IOwnerItem
list.add(EnumColor.INDIGO + LangUtils.localize("gui.mode") + ": " + EnumColor.GREY + LangUtils.localize("gui." + (isPrivateMode(itemstack) ? "private" : "public"))); list.add(EnumColor.INDIGO + LangUtils.localize("gui.mode") + ": " + EnumColor.GREY + LangUtils.localize("gui." + (isPrivateMode(itemstack) ? "private" : "public")));
} }
if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey)) super.addInformation(itemstack, entityplayer, list, flag);
{
list.add(LangUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " " + LangUtils.localize("tooltip.forDetails") + ".");
}
else {
super.addInformation(itemstack, entityplayer, list, flag);
}
} }
@Override @Override

View file

@ -0,0 +1,96 @@
package mekanism.common.item;
import java.util.List;
import mekanism.common.Tier.BaseTier;
import mekanism.common.base.ITierUpgradeable;
import mekanism.common.tile.TileEntityBasicBlock;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class ItemTierInstaller extends ItemMekanism
{
public IIcon[] icons = new IIcon[256];
public ItemTierInstaller()
{
super();
setHasSubtypes(true);
}
@Override
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
{
if(world.isRemote)
{
return false;
}
TileEntity tile = world.getTileEntity(x, y, z);
BaseTier tier = BaseTier.values()[stack.getItemDamage()];
if(tile instanceof ITierUpgradeable)
{
if(tile instanceof TileEntityBasicBlock && ((TileEntityBasicBlock)tile).playersUsing.size() > 0)
{
return true;
}
if(((ITierUpgradeable)tile).upgrade(tier))
{
if(!player.capabilities.isCreativeMode)
{
stack.stackSize--;
}
return true;
}
return false;
}
return false;
}
@Override
public void registerIcons(IIconRegister register)
{
for(BaseTier tier : BaseTier.values())
{
if(tier.isObtainable())
{
icons[tier.ordinal()] = register.registerIcon("mekanism:" + tier.getName() + "TierInstaller");
}
}
}
@Override
public IIcon getIconFromDamage(int meta)
{
return icons[meta];
}
@Override
public void getSubItems(Item item, CreativeTabs tabs, List itemList)
{
for(BaseTier tier : BaseTier.values())
{
if(tier.isObtainable())
{
itemList.add(new ItemStack(item, 1, tier.ordinal()));
}
}
}
@Override
public String getUnlocalizedName(ItemStack item)
{
return "item." + BaseTier.values()[item.getItemDamage()].getName().toLowerCase() + "TierInstaller";
}
}

View file

@ -5,10 +5,14 @@ import java.util.List;
import mekanism.api.EnumColor; import mekanism.api.EnumColor;
import mekanism.common.Upgrade; import mekanism.common.Upgrade;
import mekanism.common.base.IUpgradeItem; import mekanism.common.base.IUpgradeItem;
import mekanism.common.base.IUpgradeTile;
import mekanism.common.tile.component.TileComponentUpgrade;
import mekanism.common.util.LangUtils; import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
@ -44,4 +48,37 @@ public class ItemUpgrade extends ItemMekanism implements IUpgradeItem
{ {
return upgrade; return upgrade;
} }
@Override
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
{
if(world.isRemote)
{
return false;
}
if(player.isSneaking())
{
TileEntity tile = world.getTileEntity(x, y, z);
Upgrade type = getUpgradeType(stack);
if(tile instanceof IUpgradeTile)
{
TileComponentUpgrade component = ((IUpgradeTile)tile).getComponent();
if(component.supports(type))
{
if(component.getUpgrades(type) < type.getMax())
{
component.addUpgrade(type);
stack.stackSize--;
}
}
return true;
}
}
return false;
}
} }

View file

@ -55,7 +55,7 @@ public class MultipartTransmitter<A, N extends DynamicNetwork<A,N>> extends Tran
{ {
IGridTransmitter transmitter = ((ITransmitterTile)potentialTransmitterTile).getTransmitter(); IGridTransmitter transmitter = ((ITransmitterTile)potentialTransmitterTile).getTransmitter();
if(TransmissionType.checkTransmissionType(transmitter, getTransmissionType())) if(TransmissionType.checkTransmissionType(transmitter, getTransmissionType()) && containingPart.isValidTransmitter(potentialTransmitterTile))
{ {
return sideCoord; return sideCoord;
} }

View file

@ -7,6 +7,7 @@ import java.util.Collection;
import mekanism.api.Coord4D; import mekanism.api.Coord4D;
import mekanism.api.EnumColor; import mekanism.api.EnumColor;
import mekanism.api.MekanismConfig.client;
import mekanism.api.Range4D; import mekanism.api.Range4D;
import mekanism.api.transmitters.TransmissionType; import mekanism.api.transmitters.TransmissionType;
import mekanism.client.render.RenderPartTransmitter; import mekanism.client.render.RenderPartTransmitter;
@ -94,7 +95,7 @@ public class PartLogisticalTransporter extends PartTransmitter<IInventory, Inven
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void renderDynamic(Vector3 pos, float f, int pass) public void renderDynamic(Vector3 pos, float f, int pass)
{ {
if(pass == 0) if(pass == 0 && !client.opaqueTransmitters)
{ {
RenderPartTransmitter.getInstance().renderContents(this, f, pos); RenderPartTransmitter.getInstance().renderContents(this, f, pos);
} }
@ -383,8 +384,7 @@ public class PartLogisticalTransporter extends PartTransmitter<IInventory, Inven
protected boolean onConfigure(EntityPlayer player, int part, int side) protected boolean onConfigure(EntityPlayer player, int part, int side)
{ {
TransporterUtils.incrementColor(getTransmitter()); TransporterUtils.incrementColor(getTransmitter());
refreshConnections(); onPartChanged(this);
notifyTileChange();
PathfinderCache.onChanged(Coord4D.get(tile())); PathfinderCache.onChanged(Coord4D.get(tile()));
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(tile()), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(tile()))); Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(tile()), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(tile())));
player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + LangUtils.localize("tooltip.configurator.toggleColor") + ": " + (getTransmitter().getColor() != null ? getTransmitter().getColor().getName() : EnumColor.BLACK + LangUtils.localize("gui.none")))); player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + LangUtils.localize("tooltip.configurator.toggleColor") + ": " + (getTransmitter().getColor() != null ? getTransmitter().getColor().getName() : EnumColor.BLACK + LangUtils.localize("gui.none"))));

Some files were not shown because too many files have changed in this diff Show more