Merge branch 'development' into 1.8
Conflicts: build.properties src/main/java/mekanism/client/MekanismKeyHandler.java src/main/java/mekanism/common/FluidNetwork.java src/main/java/mekanism/common/Mekanism.java src/main/java/mekanism/common/item/ItemBlockEnergyCube.java src/main/java/mekanism/common/item/ItemBlockGasTank.java src/main/java/mekanism/common/item/ItemBlockMachine.java src/main/java/mekanism/common/multipart/PartLogisticalTransporter.java src/main/java/mekanism/common/multipart/PartSidedPipe.java src/main/java/mekanism/common/util/MekanismUtils.java src/main/java/mekanism/generators/common/MekanismGenerators.java src/main/java/mekanism/tools/common/MekanismTools.java
This commit is contained in:
commit
1ad8f62627
11 changed files with 43 additions and 36 deletions
10
build.gradle
10
build.gradle
|
@ -74,10 +74,10 @@ task coreJar(type: Jar) {
|
|||
|
||||
from('etc/core') {
|
||||
include '*.info'
|
||||
expand 'version':config.mod_version,'mc_version':config.minecraft_version,'fmp_version':config.FMP_version
|
||||
expand 'version': config.mod_version, 'mc_version': config.minecraft_version, 'fmp_version': config.FMP_version
|
||||
}
|
||||
|
||||
from zipTree(reobf.outputs.getFiles().getSingleFile()).matching {
|
||||
from zipTree(jar.outputs.getFiles().getSingleFile()).matching {
|
||||
exclude 'mekanism/tools/**', 'mekanism/generators/**', 'mcmod.info'
|
||||
}
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ task toolsJar(type: Jar) {
|
|||
expand 'version':config.mod_version,'mc_version':config.minecraft_version,'fmp_version':config.FMP_version
|
||||
}
|
||||
|
||||
from zipTree(reobf.outputs.getFiles().getSingleFile()).matching {
|
||||
from zipTree(jar.outputs.getFiles().getSingleFile()).matching {
|
||||
include 'mekanism/tools/**'
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ task generatorsJar(type: Jar) {
|
|||
expand 'version':config.mod_version,'mc_version':config.minecraft_version,'fmp_version':config.FMP_version
|
||||
}
|
||||
|
||||
from zipTree(reobf.outputs.getFiles().getSingleFile()).matching {
|
||||
from zipTree(jar.outputs.getFiles().getSingleFile()).matching {
|
||||
include 'mekanism/generators/**'
|
||||
}
|
||||
}
|
||||
|
@ -129,6 +129,6 @@ task releaseJars(type: Copy) {
|
|||
}
|
||||
|
||||
task fullBuild(type: Delete) {
|
||||
delete reobf
|
||||
delete jar
|
||||
}
|
||||
fullBuild.dependsOn('releaseJars')
|
||||
|
|
|
@ -36,6 +36,12 @@ public abstract class MekKeyHandler
|
|||
isDummy = true;
|
||||
}
|
||||
|
||||
public static boolean getIsKeyPressed(KeyBinding keyBinding)
|
||||
{
|
||||
int keyCode = keyBinding.getKeyCode();
|
||||
return keyCode < 0 ? Mouse.isButtonDown(keyCode + 100) : Keyboard.isKeyDown(keyCode);
|
||||
}
|
||||
|
||||
public KeyBinding[] getKeyBindings ()
|
||||
{
|
||||
return keyBindings;
|
||||
|
|
|
@ -23,6 +23,7 @@ import mekanism.common.network.PacketWalkieTalkieState.WalkieTalkieStateMessage;
|
|||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -32,7 +33,6 @@ import cpw.mods.fml.client.FMLClientHandler;
|
|||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Type;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
@ -46,6 +46,8 @@ public class MekanismKeyHandler extends MekKeyHandler
|
|||
public static KeyBinding modeSwitchKey = new KeyBinding("Mekanism " + MekanismUtils.localize("key.mode"), Keyboard.KEY_M, keybindCategory);
|
||||
public static KeyBinding armorModeSwitchKey = new KeyBinding("Mekanism " + MekanismUtils.localize("key.armorMode"), Keyboard.KEY_F, keybindCategory);
|
||||
public static KeyBinding voiceKey = new KeyBinding("Mekanism " + MekanismUtils.localize("key.voice"), Keyboard.KEY_U, keybindCategory);
|
||||
public static KeyBinding sneakKey = Minecraft.getMinecraft().gameSettings.keyBindSneak;
|
||||
public static KeyBinding jumpKey = Minecraft.getMinecraft().gameSettings.keyBindJump;
|
||||
|
||||
public MekanismKeyHandler()
|
||||
{
|
||||
|
|
|
@ -187,7 +187,10 @@ public class FluidNetwork extends DynamicNetwork<IFluidHandler, FluidNetwork>
|
|||
{
|
||||
int prev = fluidSent;
|
||||
|
||||
fluidSent += acceptor.fill(side.getOpposite(), new FluidStack(fluidToSend.fluidID, currentSending), doTransfer);
|
||||
if(acceptor != null && fluidToSend != null)
|
||||
{
|
||||
fluidSent += acceptor.fill(side.getOpposite(), new FluidStack(fluidToSend.fluidID, currentSending), doTransfer);
|
||||
}
|
||||
|
||||
if(fluidSent > prev)
|
||||
{
|
||||
|
|
|
@ -33,8 +33,6 @@ import cpw.mods.fml.common.Optional.Method;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import ic2.api.item.IElectricItemManager;
|
||||
import ic2.api.item.ISpecialElectricItem;
|
||||
|
@ -61,9 +59,9 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IE
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
|
||||
{
|
||||
if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey))
|
||||
{
|
||||
list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + "shift" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDetails"));
|
||||
list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDetails"));
|
||||
}
|
||||
else {
|
||||
list.add(EnumColor.BRIGHT_GREEN + MekanismUtils.localize("tooltip.storedEnergy") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(getEnergy(itemstack)));
|
||||
|
|
|
@ -25,8 +25,6 @@ import net.minecraft.util.IIcon;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.Constants.NBT;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedInventory
|
||||
{
|
||||
public Block metaBlock;
|
||||
|
@ -95,9 +93,9 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI
|
|||
list.add(MekanismUtils.localize("tooltip.stored") + " " + gasStack.getGas().getLocalizedName() + ": " + gasStack.amount);
|
||||
}
|
||||
|
||||
if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey))
|
||||
{
|
||||
list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + "shift" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDetails"));
|
||||
list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDetails"));
|
||||
}
|
||||
else {
|
||||
list.add(EnumColor.AQUA + MekanismUtils.localize("tooltip.inventory") + ": " + EnumColor.GREY + LangUtils.transYesNo(getInventory(itemstack) != null && getInventory(itemstack).tagCount() != 0));
|
||||
|
|
|
@ -59,8 +59,6 @@ import cpw.mods.fml.common.Optional.Method;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
|
@ -143,7 +141,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
|||
{
|
||||
MachineType type = MachineType.get(itemstack);
|
||||
|
||||
if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey))
|
||||
{
|
||||
if(type == MachineType.PORTABLE_TANK)
|
||||
{
|
||||
|
@ -154,10 +152,10 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
|||
}
|
||||
}
|
||||
|
||||
list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.INDIGO + "shift" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDetails") + ".");
|
||||
list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + "shift" + EnumColor.GREY + " and " + EnumColor.AQUA + Keyboard.getKeyName(MekanismKeyHandler.modeSwitchKey.getKeyCode()) + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDesc") + ".");
|
||||
list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.INDIGO + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDetails") + ".");
|
||||
list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " and " + EnumColor.AQUA + GameSettings.getKeyDisplayString(MekanismKeyHandler.modeSwitchKey.getKeyCode()) + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDesc") + ".");
|
||||
}
|
||||
else if(!Keyboard.isKeyDown(MekanismKeyHandler.modeSwitchKey.getKeyCode()))
|
||||
else if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.modeSwitchKey))
|
||||
{
|
||||
if(type == MachineType.BASIC_FACTORY || type == MachineType.ADVANCED_FACTORY || type == MachineType.ELITE_FACTORY)
|
||||
{
|
||||
|
|
|
@ -3,9 +3,12 @@ package mekanism.common.item;
|
|||
import java.util.List;
|
||||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.client.MekKeyHandler;
|
||||
import mekanism.client.MekanismKeyHandler;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -13,8 +16,6 @@ import net.minecraft.util.IIcon;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
/**
|
||||
* Item class for handling multiple ore block IDs.
|
||||
* 0: Osmium Ore
|
||||
|
@ -38,9 +39,9 @@ public class ItemBlockOre extends ItemBlock
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
|
||||
{
|
||||
if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey))
|
||||
{
|
||||
list.add("Hold " + EnumColor.AQUA + "shift" + EnumColor.GREY + " for details.");
|
||||
list.add("Hold " + EnumColor.AQUA + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " for details.");
|
||||
}
|
||||
else {
|
||||
list.addAll(MekanismUtils.splitLines(MekanismUtils.localize("tooltip." + getUnlocalizedName(itemstack).replace("tile.OreBlock.", ""))));
|
||||
|
|
|
@ -8,11 +8,14 @@ import mekanism.api.EnumColor;
|
|||
import mekanism.api.transmitters.IGridTransmitter;
|
||||
import mekanism.api.transmitters.ITransmitterNetwork;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.client.MekKeyHandler;
|
||||
import mekanism.client.MekanismKeyHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -23,8 +26,6 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import codechicken.lib.vec.BlockCoord;
|
||||
import codechicken.lib.vec.Vector3;
|
||||
import codechicken.multipart.JItemMultiPart;
|
||||
|
@ -86,7 +87,7 @@ public class ItemPartTransmitter extends JItemMultiPart
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
|
||||
{
|
||||
if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey))
|
||||
{
|
||||
if(TransmitterType.values()[itemstack.getItemDamage()].getTransmission() == TransmissionType.ENERGY)
|
||||
{
|
||||
|
@ -99,7 +100,7 @@ public class ItemPartTransmitter extends JItemMultiPart
|
|||
list.add(EnumColor.INDIGO + MekanismUtils.localize("tooltip.pumpRate") + ": " + EnumColor.GREY + Tier.PipeTier.getTierFromMeta(itemstack.getItemDamage()).pipePullAmount + "mB/t");
|
||||
}
|
||||
|
||||
list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + "shift" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDetails"));
|
||||
list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDetails"));
|
||||
}
|
||||
else {
|
||||
switch(itemstack.getItemDamage())
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.MekanismConfig.general;
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.client.MekKeyHandler;
|
||||
import mekanism.client.MekanismKeyHandler;
|
||||
import mekanism.common.base.ISustainedData;
|
||||
import mekanism.common.base.ISustainedInventory;
|
||||
|
@ -16,6 +17,7 @@ import mekanism.common.util.MekanismUtils;
|
|||
import mekanism.generators.common.block.BlockGenerator.GeneratorType;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
@ -32,8 +34,6 @@ import cpw.mods.fml.common.Optional.Method;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import ic2.api.item.IElectricItemManager;
|
||||
import ic2.api.item.ISpecialElectricItem;
|
||||
|
@ -95,12 +95,12 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp
|
|||
{
|
||||
GeneratorType type = GeneratorType.getFromMetadata(itemstack.getItemDamage());
|
||||
|
||||
if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey))
|
||||
{
|
||||
list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.INDIGO + "shift" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDetails") + ".");
|
||||
list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + "shift" + EnumColor.GREY + " and " + EnumColor.AQUA + Keyboard.getKeyName(MekanismKeyHandler.modeSwitchKey.getKeyCode()) + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDesc") + ".");
|
||||
list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.INDIGO + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDetails") + ".");
|
||||
list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " and " + EnumColor.AQUA + GameSettings.getKeyDisplayString(MekanismKeyHandler.modeSwitchKey.getKeyCode()) + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDesc") + ".");
|
||||
}
|
||||
else if(!Keyboard.isKeyDown(MekanismKeyHandler.modeSwitchKey.getKeyCode()))
|
||||
else if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.modeSwitchKey))
|
||||
{
|
||||
list.add(EnumColor.BRIGHT_GREEN + MekanismUtils.localize("tooltip.storedEnergy") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(getEnergy(itemstack)));
|
||||
|
||||
|
|
|
@ -284,7 +284,7 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
|
|||
@Override
|
||||
public void writeSustainedData(ItemStack itemStack)
|
||||
{
|
||||
if(fuelTank.getGas() != null)
|
||||
if(fuelTank != null)
|
||||
{
|
||||
itemStack.stackTagCompound.setTag("fuelTank", fuelTank.write(new NBTTagCompound()));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue