More Scala to Java porting. Getting close now

This commit is contained in:
Leon 2016-11-05 09:36:06 -04:00
parent acbf07b09d
commit 72355a8882
141 changed files with 2161 additions and 1599 deletions

View file

@ -0,0 +1,36 @@
package net.machinemuse.api;
import cpw.mods.fml.common.Optional;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
/**
* Author: MachineMuse (Claire Semple)
* Created: 6:54 AM, 4/28/13
*
* Ported to Java by lehjr on 11/4/16.
*/
@Optional.Interface(iface = "forestry.api.apiculture.IArmorApiarist", modid = "Forestry", striprefs = true)
public class ApiaristArmor implements IApiaristArmor {
private static ApiaristArmor INSTANCE;
public static ApiaristArmor getInstance() {
if (INSTANCE == null)
INSTANCE = new ApiaristArmor();
return INSTANCE;
}
@Optional.Method(modid = "Forestry")
@Override
public boolean protectPlayer(EntityPlayer player, ItemStack armor, String cause, boolean doProtect) {
return false;
}
@Optional.Method(modid = "Forestry")
@Override
public boolean protectEntity(EntityLivingBase player, ItemStack armor, String cause, boolean doProtect) {
return false;
}
}

View file

@ -0,0 +1,24 @@
package net.machinemuse.api;
import cpw.mods.fml.common.Optional;
import forestry.api.apiculture.IArmorApiarist;
import net.machinemuse.utils.ElectricItemUtils;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
/**
* Author: MachineMuse (Claire Semple)
* Created: 6:54 AM, 4/28/13
*
* Ported to Java by lehjr on 11/4/16.
*/
@Optional.Interface(iface = "forestry.api.apiculture.IArmorApiarist", modid = "Forestry", striprefs = true)
public interface IApiaristArmor extends IArmorApiarist {
@Optional.Method(modid = "Forestry")
public boolean protectPlayer(final EntityPlayer player, final ItemStack armor, final String cause, final boolean doProtect);
@Optional.Method(modid = "Forestry")
public boolean protectEntity(final EntityLivingBase player, final ItemStack armor, final String cause, final boolean doProtect);
}

View file

@ -0,0 +1,10 @@
package net.machinemuse.api;
import net.machinemuse.api.electricity.IModularItem;
/**
* Ported to Java by lehjr on 11/4/16.
*/
public interface IArmorTraits extends IModularItem, IApiaristArmor
{
}

View file

@ -1,5 +1,6 @@
package net.machinemuse.api;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IBlockBreakingModule;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IRightClickModule;

View file

@ -0,0 +1,50 @@
package net.machinemuse.api.electricity;
import appeng.api.config.AccessRestriction;
import appeng.api.implementations.items.IAEItemPowerStorage;
import net.minecraft.item.ItemStack;
/**
* Ported to Java by lehjr on 11/4/16.
*/
public class AE2ElectricAdapter extends ElectricAdapter {
private final ItemStack stack;
private final IAEItemPowerStorage item;
public AE2ElectricAdapter(final ItemStack stack) {
this.stack = stack;
this.item = (IAEItemPowerStorage)stack.getItem();
}
public ItemStack stack() {
return this.stack;
}
public IAEItemPowerStorage item() {
return this.item;
}
@Override
public double getCurrentEnergy() {
return ElectricConversions.museEnergyFromAE(this.item().getAECurrentPower(this.stack()));
}
@Override
public double getMaxEnergy() {
return ElectricConversions.museEnergyFromAE(this.item().getAEMaxPower(this.stack()));
}
@Override
public double drainEnergy(final double requested) {
return ElectricConversions.museEnergyFromAE(this.item().extractAEPower(this.stack(), ElectricConversions.museEnergyToAE(requested)));
}
@Override
public double giveEnergy(final double provided) {
return ElectricConversions.museEnergyFromAE(this.item().injectAEPower(this.stack(), ElectricConversions.museEnergyToAE(provided)));
}
public AccessRestriction getPowerFlow(final ItemStack stack) {
return AccessRestriction.READ_WRITE;
}
}

View file

@ -0,0 +1,29 @@
package net.machinemuse.api.electricity;
import appeng.api.implementations.items.IAEItemPowerStorage;
import cofh.api.energy.IEnergyContainerItem;
import ic2.api.item.IElectricItem;
import net.machinemuse.powersuits.common.ModCompatibility;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
/**
* Ported to Java by lehjr on 11/4/16.
*/
public abstract class ElectricAdapter {
public static ElectricAdapter wrap(final ItemStack stack) {
if (stack == null) {
return null;
}
final Item i = stack.getItem();
return (i instanceof MuseElectricItem) ? new MuseElectricAdapter(stack) : ((ModCompatibility.isRFAPILoaded() && i instanceof IEnergyContainerItem) ? new TEElectricAdapter(stack) : ((ModCompatibility.isIndustrialCraftLoaded() && i instanceof IElectricItem) ? new IC2ElectricAdapter(stack) : ((ModCompatibility.isAppengLoaded() && i instanceof IAEItemPowerStorage) ? new AE2ElectricAdapter(stack) : null)));
}
public abstract double getCurrentEnergy();
public abstract double getMaxEnergy();
public abstract double drainEnergy(double requested);
public abstract double giveEnergy(double provided);
}

View file

@ -0,0 +1,49 @@
package net.machinemuse.api.electricity;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.powersuits.common.ModCompatibility;
import net.minecraft.item.ItemStack;
/**
* Author: MachineMuse (Claire Semple)
* Created: 4:51 AM, 4/28/13
*
* Ported to Java by lehjr on 11/4/16.
*/
public final class ElectricConversions {
/* Industrialcraft 2 -------------------------------------------------------------------------- */
public static final String IC2_TIER = "IC2 Tier";
public static int getTier(final ItemStack stack) {
return (int) ModuleManager.computeModularProperty(stack, IC2_TIER);
}
public static double museEnergyToEU(final double museEnergy) {
return museEnergy / ModCompatibility.getIC2Ratio();
}
public static double museEnergyFromEU(final double eu) {
return eu * ModCompatibility.getIC2Ratio();
}
/* Thermal Expansion -------------------------------------------------------------------------- */
public static int museEnergyToRF(final double museEnergy) {
return (int)Math.ceil(museEnergy / ModCompatibility.getRFRatio());
}
public static double museEnergyFromRF(final int rf) {
return rf * ModCompatibility.getRFRatio();
}
/* Applied Energistics 2 ---------------------------------------------------------------------- */
public static double museEnergyFromAE(final double ae) {
return ae * ModCompatibility.getAE2Ratio();
}
public static double museEnergyToAE(final double museEnergy) {
return museEnergy / ModCompatibility.getAE2Ratio();
}
}

View file

@ -0,0 +1,50 @@
package net.machinemuse.api.electricity;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import net.minecraft.item.ItemStack;
/**
* Ported to Java by lehjr on 11/4/16.
*/
public class IC2ElectricAdapter extends ElectricAdapter {
private final ItemStack stack;
private final IElectricItem item;
public IC2ElectricAdapter(final ItemStack stack) {
this.stack = stack;
this.item = (IElectricItem)stack.getItem();
}
public ItemStack stack() {
return this.stack;
}
public IElectricItem item() {
return this.item;
}
@Override
public double getCurrentEnergy() {
return ElectricConversions.museEnergyFromEU(ElectricItem.manager.getCharge(this.stack()));
}
@Override
public double getMaxEnergy() {
return ElectricConversions.museEnergyFromEU(this.item().getMaxCharge(this.stack()));
}
@Override
public double drainEnergy(final double requested) {
return ElectricConversions.museEnergyFromEU(ElectricItem.manager.discharge(this.stack(), ElectricConversions.museEnergyToEU(requested), this.getTier(), true, false, false));
}
@Override
public double giveEnergy(final double provided) {
return ElectricConversions.museEnergyFromEU(ElectricItem.manager.charge(this.stack(), ElectricConversions.museEnergyToEU(provided), this.getTier(), true, false));
}
public int getTier() {
return this.item().getTier(this.stack());
}
}

View file

@ -0,0 +1,51 @@
package net.machinemuse.api.electricity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import java.util.List;
/**
* Interface for ItemPowerArmor and ItemPowerTool to share.
*
* @author MachineMuse
*
* Ported to Java by lehjr on 11/3/16.
*/
public interface IModularItem {
/**
* Gets the item's extended summary for displaying in the gui.
*
* @param stack
* @return
*/
List<String> getLongInfo(EntityPlayer player, ItemStack stack);
/**
* Returns the amount of energy contained in the player's inventory.
*
* @param player
* @return
*/
double getPlayerEnergy(EntityPlayer player);
/**
* Drains the amount of energy from the player's inventory.
*
* @param player
* @param drainAmount
* @return
*/
void drainPlayerEnergy(EntityPlayer player, double drainAmount);
/**
* Adds the amount of energy to the player's inventory.
*
* @param player
* @param joulesToGive
* @return
*/
void givePlayerEnergy(EntityPlayer player, double joulesToGive);
}

View file

@ -0,0 +1,128 @@
package net.machinemuse.api.electricity;
import appeng.api.config.AccessRestriction;
import appeng.api.implementations.items.IAEItemPowerStorage;
import cofh.api.energy.IEnergyContainerItem;
import cpw.mods.fml.common.Optional;
import ic2.api.item.IElectricItemManager;
import ic2.api.item.ISpecialElectricItem;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
/**
* Author: MachineMuse (Claire Semple)
* Created: 10:12 PM, 4/20/13
*
* Ported to Java by lehjr on 11/3/16.
*/
@Optional.InterfaceList({
@Optional.Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "CoFHAPI|energy", striprefs = true),
@Optional.Interface(iface = "ic2.api.item.IElectricItemManager", modid = "IC2", striprefs = true),
@Optional.Interface(iface = "ic2.api.item.ISpecialElectricItem", modid = "IC2", striprefs = true),
@Optional.Interface(iface = "appeng.api.implementations.items.IAEItemPowerStorage", modid = "AE2", striprefs = true)})
public interface IMuseElectricItem
extends IEnergyContainerItem,
ISpecialElectricItem,
IElectricItemManager,
IAEItemPowerStorage {
/**
* Call to get the energy of an item
*
* @param stack ItemStack to set
* @return Current energy level
*/
double getCurrentEnergy(ItemStack stack);
/**
* Call to set the energy of an item
*
* @param stack ItemStack to set
* @return Maximum energy level
*/
double getMaxEnergy(ItemStack stack);
/**
* Call to set the energy of an item
*
* @param stack ItemStack to set
* @param energy Level to set it to
*/
void setCurrentEnergy(ItemStack stack, double energy);
/**
* Call to drain energy from an item
*
* @param stack ItemStack being requested for energy
* @param requested Amount of energy to drain
* @return Amount of energy successfully drained
*/
double drainEnergyFrom(ItemStack stack, double requested);
/**
* Call to give energy to an item
*
* @param stack ItemStack being provided with energy
* @param provided Amount of energy to add
* @return Amount of energy added
*/
double giveEnergyTo(ItemStack stack, double provided);
/* Industrialcraft 2 -------------------------------------------------------------------------- */
IMuseElectricItem getManager(ItemStack stack);
@Override
void chargeFromArmor(ItemStack itemStack, EntityLivingBase entity);
@Override
boolean use(ItemStack itemStack, double amount, EntityLivingBase entity);
boolean canProvideEnergy(ItemStack itemStack);
@Override
double getCharge(ItemStack itemStack);
double getMaxCharge(ItemStack itemStack);
int getTier(ItemStack itemStack);
double getTransferLimit(ItemStack itemStack);
@Override
double charge(ItemStack itemStack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate);
@Override
double discharge(ItemStack itemStack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate);
@Override
boolean canUse(ItemStack itemStack, double amount);
@Override
String getToolTip(ItemStack itemStack);
Item getChargedItem(ItemStack itemStack);
Item getEmptyItem(ItemStack itemStack);
/* Thermal Expansion -------------------------------------------------------------------------- */
int receiveEnergy(ItemStack stack, int energy, boolean simulate);
int extractEnergy(ItemStack stack, int energy, boolean simulate);
int getEnergyStored(ItemStack theItem);
int getMaxEnergyStored(ItemStack theItem);
int getMaxDamage(ItemStack itemStack);
/* Applied Energistics 2 ---------------------------------------------------------------------- */
double injectAEPower(ItemStack stack, double ae);
double extractAEPower(ItemStack stack, double ae);
double getAEMaxPower(ItemStack stack);
double getAECurrentPower(ItemStack stack);
AccessRestriction getPowerFlow(ItemStack stack);
}

View file

@ -0,0 +1,44 @@
package net.machinemuse.api.electricity;
import net.minecraft.item.ItemStack;
/**
* Ported to Java by lehjr on 11/4/16.
*/
public class MuseElectricAdapter extends ElectricAdapter {
private final ItemStack stack;
private final MuseElectricItem item;
public MuseElectricAdapter(final ItemStack stack) {
this.stack = stack;
this.item = (MuseElectricItem)stack.getItem();
}
public ItemStack stack() {
return this.stack;
}
public MuseElectricItem item() {
return this.item;
}
@Override
public double getCurrentEnergy() {
return this.item().getCurrentEnergy(this.stack());
}
@Override
public double getMaxEnergy() {
return this.item().getMaxEnergy(this.stack());
}
@Override
public double drainEnergy(final double requested) {
return this.item().drainEnergyFrom(this.stack(), requested);
}
@Override
public double giveEnergy(final double provided) {
return this.item().giveEnergyTo(this.stack(), provided);
}
}

View file

@ -0,0 +1,233 @@
package net.machinemuse.api.electricity;
import appeng.api.config.AccessRestriction;
import ic2.api.item.ElectricItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.numina.item.ModeChangingItem;
import net.machinemuse.utils.ElectricItemUtils;
import net.machinemuse.utils.MuseItemUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.machinemuse.api.electricity.ElectricConversions;
/**
* Author: MachineMuse (Claire Semple)
* Created: 10:12 PM, 4/20/13
*
* Ported to Java by lehjr on 11/3/16.
*/
public class MuseElectricItem extends Item implements IMuseElectricItem {
private static MuseElectricItem INSTANCE;
public static MuseElectricItem getInstance() {
if (INSTANCE == null)
INSTANCE = new MuseElectricItem();
return INSTANCE;
}
/**
* Call to get the energy of an item
*
* @param stack ItemStack to set
* @return Current energy level
*/
public double getCurrentEnergy(ItemStack stack) {
return MuseItemUtils.getDoubleOrZero(stack, ElectricItemUtils.CURRENT_ENERGY);
}
/**
* Call to set the energy of an item
*
* @param stack ItemStack to set
* @return Maximum energy level
*/
public double getMaxEnergy(ItemStack stack) {
return ModuleManager.computeModularProperty(stack, ElectricItemUtils.MAXIMUM_ENERGY);
}
/**
* Call to set the energy of an item
*
* @param stack ItemStack to set
* @param energy Level to set it to
*/
public void setCurrentEnergy(ItemStack stack, double energy) {
MuseItemUtils.setDoubleOrRemove(stack, ElectricItemUtils.CURRENT_ENERGY, Math.min(energy, getMaxEnergy(stack)));
}
/**
* Call to drain energy from an item
*
* @param stack ItemStack being requested for energy
* @param requested Amount of energy to drain
* @return Amount of energy successfully drained
*/
public double drainEnergyFrom(ItemStack stack, double requested) {
double available = getCurrentEnergy(stack);
if (available > requested) {
setCurrentEnergy(stack, available - requested);
return requested;
} else {
setCurrentEnergy(stack, 0);
return available;
}
}
/**
* Call to give energy to an item
*
* @param stack ItemStack being provided with energy
* @param provided Amount of energy to add
* @return Amount of energy added
*/
public double giveEnergyTo(ItemStack stack, double provided) {
double available = getCurrentEnergy(stack);
double max = getMaxEnergy(stack);
if (available + provided < max) {
setCurrentEnergy(stack, available + provided);
return provided;
} else {
setCurrentEnergy(stack, max);
return max - available;
}
}
/* Industrialcraft 2 -------------------------------------------------------------------------- */
public IMuseElectricItem getManager(ItemStack stack) {
return this;
}
@Override
public void chargeFromArmor(ItemStack itemStack, EntityLivingBase entity) {
ElectricItem.rawManager.chargeFromArmor(itemStack, entity);
}
@Override
public boolean use(ItemStack itemStack, double amount, EntityLivingBase entity) {
return ElectricItem.rawManager.use(itemStack, ElectricConversions.museEnergyToEU(amount), entity);
}
public boolean canProvideEnergy(ItemStack itemStack) {
return true;
}
@Override
public double getCharge(ItemStack itemStack) {
return ElectricConversions.museEnergyToEU(getCurrentEnergy(itemStack));
}
public double getMaxCharge(ItemStack itemStack) {
return ElectricConversions.museEnergyToEU(getMaxEnergy(itemStack));
}
public int getTier(ItemStack itemStack) {
return ElectricConversions.getTier(itemStack);
}
public double getTransferLimit(ItemStack itemStack) {
return ElectricConversions.museEnergyToEU(Math.sqrt(getMaxEnergy(itemStack)));
}
@Override
public double charge(ItemStack itemStack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate){
double current = getCurrentEnergy(itemStack);
double transfer = (ignoreTransferLimit || amount < getTransferLimit(itemStack)) ? ElectricConversions.museEnergyFromEU(amount) : getTransferLimit(itemStack);
double given = giveEnergyTo(itemStack, transfer);
if (simulate) {
setCurrentEnergy(itemStack, current);
}
return ElectricConversions.museEnergyToEU(given);
}
@Override
public double discharge(ItemStack itemStack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate) {
double current = getCurrentEnergy(itemStack);
double transfer = (ignoreTransferLimit || amount < getTransferLimit(itemStack)) ? ElectricConversions.museEnergyFromEU(amount) : getTransferLimit(itemStack);
double taken = drainEnergyFrom(itemStack, transfer);
if (simulate) {
setCurrentEnergy(itemStack, current);
}
return ElectricConversions.museEnergyToEU(taken);
}
@Override
public boolean canUse(ItemStack itemStack, double amount) {
return ElectricConversions.museEnergyFromEU(amount) < getCurrentEnergy(itemStack);
}
@Override
public String getToolTip(ItemStack itemStack) {
return itemStack.getTooltip(Minecraft.getMinecraft().thePlayer, false).toString();
}
public Item getChargedItem(ItemStack itemStack) {
return this;
}
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
/* Thermal Expansion -------------------------------------------------------------------------- */
public int receiveEnergy(ItemStack stack, int energy, boolean simulate) {
double current = getCurrentEnergy(stack);
double receivedME = ElectricConversions.museEnergyFromRF(energy);
double eatenME = giveEnergyTo(stack, receivedME);
if (simulate) {
setCurrentEnergy(stack, current);
}
return ElectricConversions.museEnergyToRF(eatenME);
}
public int extractEnergy(ItemStack stack, int energy, boolean simulate) {
double current = getCurrentEnergy(stack);
double requesteddME = ElectricConversions.museEnergyFromRF(energy);
double takenME = drainEnergyFrom(stack, requesteddME);
if (simulate) {
setCurrentEnergy(stack, current);
}
return ElectricConversions.museEnergyToRF(takenME);
}
public int getEnergyStored(ItemStack theItem) {
return ElectricConversions.museEnergyToRF(getCurrentEnergy(theItem));
}
public int getMaxEnergyStored(ItemStack theItem) {
return ElectricConversions.museEnergyToRF(getMaxEnergy(theItem));
}
public int getMaxDamage(ItemStack itemStack) {
return 0;
}
/* Applied Energistics 2 ---------------------------------------------------------------------- */
public double injectAEPower(ItemStack stack, double ae) {
double current = getCurrentEnergy(stack);
double recieved = ElectricConversions.museEnergyFromAE(ae);
setCurrentEnergy(stack, current);
return ElectricConversions.museEnergyToAE(recieved);
}
public double extractAEPower(ItemStack stack, double ae) {
double current = getCurrentEnergy(stack);
double taken = ElectricConversions.museEnergyFromAE(ae);
setCurrentEnergy(stack, current);
return ElectricConversions.museEnergyToAE(taken);
}
public double getAEMaxPower(ItemStack stack) {
return ElectricConversions.museEnergyToAE(getCurrentEnergy(stack));
}
public double getAECurrentPower(ItemStack stack) {
return ElectricConversions.museEnergyToAE(getCurrentEnergy(stack));
}
public AccessRestriction getPowerFlow(ItemStack stack) {
return AccessRestriction.READ_WRITE;
}
}

View file

@ -0,0 +1,45 @@
package net.machinemuse.api.electricity;
import cofh.api.energy.IEnergyContainerItem;
import net.minecraft.item.ItemStack;
/**
* Ported to Java by lehjr on 11/4/16.
*/
public class TEElectricAdapter extends ElectricAdapter {
private final ItemStack stack;
private final IEnergyContainerItem item;
public TEElectricAdapter(final ItemStack stack) {
this.stack = stack;
this.item = (IEnergyContainerItem)stack.getItem();
}
public ItemStack stack() {
return this.stack;
}
public IEnergyContainerItem item() {
return this.item;
}
@Override
public double getCurrentEnergy() {
return ElectricConversions.museEnergyFromRF(this.item().getEnergyStored(this.stack()));
}
@Override
public double getMaxEnergy() {
return ElectricConversions.museEnergyFromRF(this.item().getMaxEnergyStored(this.stack()));
}
@Override
public double drainEnergy(final double requested) {
return ElectricConversions.museEnergyFromRF(this.item().extractEnergy(this.stack(), ElectricConversions.museEnergyToRF(requested), false));
}
@Override
public double giveEnergy(final double provided) {
return ElectricConversions.museEnergyFromRF(this.item().receiveEnergy(this.stack(), ElectricConversions.museEnergyToRF(provided), false));
}
}

View file

@ -1,6 +1,6 @@
package net.machinemuse.general.gui.frame;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.general.gui.clickable.ClickableItem;
import net.machinemuse.numina.geometry.Colour;
import net.machinemuse.numina.geometry.MusePoint2D;

View file

@ -4,6 +4,7 @@ import net.machinemuse.numina.geometry.Colour;
import net.machinemuse.numina.render.MuseIconUtils;
import net.machinemuse.powersuits.client.render.entity.MuseRender;
import net.machinemuse.powersuits.common.MPSItems;
import net.machinemuse.powersuits.item.IModularItemBase;
import net.machinemuse.powersuits.item.ItemPowerFist;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
@ -59,8 +60,11 @@ public class ToolRenderer extends MuseRender implements IItemRenderer {
boolean drawIcon = false;
ItemPowerFist item = (ItemPowerFist) itemStack.getItem();
Colour colour = item.getColorFromItemStack(itemStack);
Colour glow = item.getColorFromItemStack(itemStack);
Colour colour = ((IModularItemBase) item).getColorFromItemStack(itemStack);
Colour glow = ((IModularItemBase) item).getColorFromItemStack(itemStack);
switch (type) {
case ENTITY:
RenderBlocks renderEntity = (RenderBlocks) data[0];

View file

@ -0,0 +1,18 @@
package net.machinemuse.powersuits.common;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
/**
* Ported to Java by lehjr on 11/3/16.
*/
public class MPSCreativeTab extends CreativeTabs {
public MPSCreativeTab() {
super(CreativeTabs.getNextID(), "powersuits");
}
@Override
public Item getTabIconItem() {
return MPSItems.INSTANCE.powerArmorHead;
}
}

View file

@ -0,0 +1,56 @@
package net.machinemuse.powersuits.common;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.machinemuse.general.gui.*;
import net.machinemuse.general.gui.frame.PortableCraftingContainer;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.stats.AchievementList;
import net.minecraft.world.World;
/**
* Gui handler for this mod. Mainly just takes an ID according to what was
* passed to player.OpenGUI, and opens the corresponding GUI.
*
* @author MachineMuse
*
* Ported to Java by lehjr on 11/3/16.
*/
public final class MPSGuiHandler implements IGuiHandler {
private static MPSGuiHandler INSTANCE;
public static MPSGuiHandler getInstance() {
if (INSTANCE == null)
INSTANCE = new MPSGuiHandler();
return INSTANCE;
}
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if (ID == 4)
return new PortableCraftingContainer(player.inventory, world, x, y, z);
return null;
}
@SideOnly(Side.CLIENT)
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
Minecraft.getMinecraft().thePlayer.addStat(AchievementList.openInventory, 1);
switch (ID) {
case 0:
return new GuiTinkerTable(player, x, y, z);
case 1:
return new KeyConfigGui(player, x, y, z);
case 2:
return new GuiFieldTinker(player);
case 3:
return new CosmeticGui(player, x, y, z);
case 4:
return new PortableCraftingGui(player, world, x, y, z);
default:
return null;
}
}
}

View file

@ -2,7 +2,7 @@ package net.machinemuse.powersuits.common;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModAPIManager;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.numina.general.MuseLogger;
import net.machinemuse.powersuits.powermodule.armor.ApiaristArmorModule;

View file

@ -1,7 +1,7 @@
package net.machinemuse.powersuits.event;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IBlockBreakingModule;
import net.machinemuse.powersuits.item.ItemPowerFist;

View file

@ -8,6 +8,9 @@ import net.minecraft.util.IIcon;
import java.util.List;
/**
* Author: MachineMuse (Claire Semple)
* Created: 4:52 PM, 9/5/13
*
* Ported to Java by lehjr on 11/1/16.
*/
public interface IModeChangingModularItem extends IModeChangingItem{

View file

@ -0,0 +1,44 @@
package net.machinemuse.powersuits.item;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.electricity.IMuseElectricItem;
import net.machinemuse.numina.geometry.Colour;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import java.util.List;
/**
* Author: MachineMuse (Claire Semple)
* Created: 7:49 PM, 4/23/13
*
* Ported to Java by lehjr on 11/4/16.
*/
public interface IModularItemBase extends IModularItem, IMuseElectricItem {
@SideOnly(Side.CLIENT)
int getColorFromItemStack(final ItemStack stack, final int p1);
Colour getGlowFromItemStack(final ItemStack stack);
Colour getColorFromItemStack(final ItemStack stack);
@SideOnly(Side.CLIENT)
boolean requiresMultipleRenderPasses();
@SideOnly(Side.CLIENT)
void addInformation(final ItemStack stack, final EntityPlayer player, final List<?> currentTipList, final boolean advancedToolTips);
String formatInfo(final String string, final double value);
List<String> getLongInfo(final EntityPlayer player, final ItemStack stack);
double getArmorDouble(final EntityPlayer player, final ItemStack stack);
double getPlayerEnergy(final EntityPlayer player);
void drainPlayerEnergy(final EntityPlayer player, final double drainEnergy);
void givePlayerEnergy(final EntityPlayer player, final double joulesToGive);
}

View file

@ -1,24 +1,23 @@
package net.machinemuse.powersuits.item;
import ic2.api.item.IElectricItemManager;
import appeng.api.config.AccessRestriction;
import net.minecraft.item.Item;
import net.minecraft.entity.EntityLivingBase;
import net.machinemuse.api.electricity.MuseElectricItem;
import net.machinemuse.api.electricity.MuseElectricItem$class;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.machinemuse.numina.geometry.Colour;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.item.ItemStack;
import scala.reflect.ScalaSignature;
import net.machinemuse.api.electricity.IMuseElectricItem;
import net.machinemuse.api.electricity.MuseElectricItem;
import net.machinemuse.numina.geometry.Colour;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import java.util.List;
/**
* Ported to Java by lehjr on 10/26/16.
*/
public abstract class ItemElectricArmor extends ItemArmor implements ModularItemBase
public abstract class ItemElectricArmor extends ItemArmor implements IModularItemBase
{
public ItemElectricArmor(final ItemArmor.ArmorMaterial material, final int index1, final int index2) {
super(material, index1, index2);
@ -33,20 +32,20 @@ public abstract class ItemElectricArmor extends ItemArmor implements ModularItem
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(final ItemStack stack, final int par2) {
return ModularItemBase$class.getColorFromItemStack(this, stack, par2);
return ModularItemBase.getInstance().getColorFromItemStack(stack, par2);
}
public Colour getGlowFromItemStack(final ItemStack stack) {
return ModularItemBase$class.getGlowFromItemStack(this, stack);
return ModularItemBase.getInstance().getGlowFromItemStack(stack);
}
public Colour getColorFromItemStack(final ItemStack stack) {
return ModularItemBase$class.getColorFromItemStack(this, stack);
return ModularItemBase.getInstance().getColorFromItemStack(stack);
}
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses() {
return ModularItemBase$class.requiresMultipleRenderPasses(this);
return ModularItemBase.getInstance().requiresMultipleRenderPasses();
}
// @SideOnly(Side.CLIENT)
@ -55,138 +54,139 @@ public abstract class ItemElectricArmor extends ItemArmor implements ModularItem
// }
public String formatInfo(final String string, final double value) {
return ModularItemBase$class.formatInfo(this, string, value);
return ModularItemBase.getInstance().formatInfo(string, value);
}
public List<String> getLongInfo(final EntityPlayer player, final ItemStack stack) {
return (List<String>)ModularItemBase$class.getLongInfo(this, player, stack);
return (List<String>) ModularItemBase.getInstance().getLongInfo(player, stack);
}
public double getArmorDouble(final EntityPlayer player, final ItemStack stack) {
return ModularItemBase$class.getArmorDouble(this, player, stack);
return ModularItemBase.getInstance().getArmorDouble(player, stack);
}
public double getPlayerEnergy(final EntityPlayer player) {
return ModularItemBase$class.getPlayerEnergy(this, player);
return ModularItemBase.getInstance().getPlayerEnergy(player);
}
public void drainPlayerEnergy(final EntityPlayer player, final double drainEnergy) {
ModularItemBase$class.drainPlayerEnergy(this, player, drainEnergy);
ModularItemBase.getInstance().drainPlayerEnergy(player, drainEnergy);
}
public void givePlayerEnergy(final EntityPlayer player, final double joulesToGive) {
ModularItemBase$class.givePlayerEnergy(this, player, joulesToGive);
ModularItemBase.getInstance().givePlayerEnergy(player, joulesToGive);
}
public double getCurrentEnergy(final ItemStack stack) {
return MuseElectricItem$class.getCurrentEnergy(this, stack);
return MuseElectricItem.getInstance().getCurrentEnergy(stack);
}
public double getMaxEnergy(final ItemStack stack) {
return MuseElectricItem$class.getMaxEnergy(this, stack);
return MuseElectricItem.getInstance().getMaxEnergy(stack);
}
public void setCurrentEnergy(final ItemStack stack, final double energy) {
MuseElectricItem$class.setCurrentEnergy(this, stack, energy);
MuseElectricItem.getInstance().setCurrentEnergy(stack, energy);
}
public double drainEnergyFrom(final ItemStack stack, final double requested) {
return MuseElectricItem$class.drainEnergyFrom(this, stack, requested);
return MuseElectricItem.getInstance().drainEnergyFrom(stack, requested);
}
public double giveEnergyTo(final ItemStack stack, final double provided) {
return MuseElectricItem$class.giveEnergyTo(this, stack, provided);
return MuseElectricItem.getInstance().giveEnergyTo(stack, provided);
}
public MuseElectricItem getManager(final ItemStack itemStack) {
return MuseElectricItem$class.getManager(this, itemStack);
public IMuseElectricItem getManager(final ItemStack itemStack) {
return MuseElectricItem.getInstance().getManager(itemStack);
}
public void chargeFromArmor(final ItemStack itemStack, final EntityLivingBase entity) {
MuseElectricItem$class.chargeFromArmor(this, itemStack, entity);
MuseElectricItem.getInstance().chargeFromArmor(itemStack, entity);
}
public boolean use(final ItemStack itemStack, final double amount, final EntityLivingBase entity) {
return MuseElectricItem$class.use(this, itemStack, amount, entity);
return MuseElectricItem.getInstance().use(itemStack, amount, entity);
}
public boolean canProvideEnergy(final ItemStack itemStack) {
return MuseElectricItem$class.canProvideEnergy(this, itemStack);
return MuseElectricItem.getInstance().canProvideEnergy(itemStack);
}
public double getCharge(final ItemStack itemStack) {
return MuseElectricItem$class.getCharge(this, itemStack);
return MuseElectricItem.getInstance().getCharge(itemStack);
}
public double getMaxCharge(final ItemStack itemStack) {
return MuseElectricItem$class.getMaxCharge(this, itemStack);
return MuseElectricItem.getInstance().getMaxCharge(itemStack);
}
public int getTier(final ItemStack itemStack) {
return MuseElectricItem$class.getTier(this, itemStack);
return MuseElectricItem.getInstance().getTier(itemStack);
}
public double getTransferLimit(final ItemStack itemStack) {
return MuseElectricItem$class.getTransferLimit(this, itemStack);
return MuseElectricItem.getInstance().getTransferLimit(itemStack);
}
public double charge(final ItemStack itemStack, final double amount, final int tier, final boolean ignoreTransferLimit, final boolean simulate) {
return MuseElectricItem$class.charge(this, itemStack, amount, tier, ignoreTransferLimit, simulate);
return MuseElectricItem.getInstance().charge(itemStack, amount, tier, ignoreTransferLimit, simulate);
}
public double discharge(final ItemStack itemStack, final double amount, final int tier, final boolean ignoreTransferLimit, final boolean externally, final boolean simulate) {
return MuseElectricItem$class.discharge(this, itemStack, amount, tier, ignoreTransferLimit, externally, simulate);
return MuseElectricItem.getInstance().discharge(itemStack, amount, tier, ignoreTransferLimit, externally, simulate);
}
public boolean canUse(final ItemStack itemStack, final double amount) {
return MuseElectricItem$class.canUse(this, itemStack, amount);
return MuseElectricItem.getInstance().canUse(itemStack, amount);
}
public Item getChargedItem(final ItemStack itemStack) {
return MuseElectricItem$class.getChargedItem(this, itemStack);
return MuseElectricItem.getInstance().getChargedItem(itemStack);
}
public Item getEmptyItem(final ItemStack itemStack) {
return MuseElectricItem$class.getEmptyItem(this, itemStack);
return MuseElectricItem.getInstance().getEmptyItem(itemStack);
}
public int receiveEnergy(final ItemStack stack, final int energy, final boolean simulate) {
return MuseElectricItem$class.receiveEnergy(this, stack, energy, simulate);
return MuseElectricItem.getInstance().receiveEnergy(stack, energy, simulate);
}
public int extractEnergy(final ItemStack stack, final int energy, final boolean simulate) {
return MuseElectricItem$class.extractEnergy(this, stack, energy, simulate);
return MuseElectricItem.getInstance().extractEnergy(stack, energy, simulate);
}
public int getEnergyStored(final ItemStack theItem) {
return MuseElectricItem$class.getEnergyStored(this, theItem);
return MuseElectricItem.getInstance().getEnergyStored(theItem);
}
public int getMaxEnergyStored(final ItemStack theItem) {
return MuseElectricItem$class.getMaxEnergyStored(this, theItem);
return MuseElectricItem.getInstance().getMaxEnergyStored(theItem);
}
public int getMaxDamage(final ItemStack itemStack) {
return MuseElectricItem$class.getMaxDamage(this, itemStack);
return MuseElectricItem.getInstance().getMaxDamage(itemStack);
}
/* Applied Energistics 2 ---------------------------------------------------------------------- */
public double injectAEPower(final ItemStack stack, final double ae) {
return MuseElectricItem$class.injectAEPower(this, stack, ae);
return MuseElectricItem.getInstance().injectAEPower(stack, ae);
}
public double extractAEPower(final ItemStack stack, final double ae) {
return MuseElectricItem$class.extractAEPower(this, stack, ae);
return MuseElectricItem.getInstance().extractAEPower(stack, ae);
}
public double getAEMaxPower(final ItemStack stack) {
return MuseElectricItem$class.getAEMaxPower(this, stack);
return MuseElectricItem.getInstance().getAEMaxPower(stack);
}
public double getAECurrentPower(final ItemStack stack) {
return MuseElectricItem$class.getAECurrentPower(this, stack);
return MuseElectricItem.getInstance().getAECurrentPower(stack);
}
public AccessRestriction getPowerFlow(final ItemStack stack) {
return MuseElectricItem$class.getPowerFlow(this, stack);
return MuseElectricItem.getInstance().getPowerFlow(stack);
}
}

View file

@ -0,0 +1,195 @@
package net.machinemuse.powersuits.item;
import com.google.common.collect.Multimap;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.machinemuse.api.ApiaristArmor;
import net.machinemuse.api.IArmorTraits;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.numina.geometry.Colour;
import net.machinemuse.powersuits.client.render.item.ArmorModel;
import net.machinemuse.powersuits.client.render.item.ArmorModel$;
import net.machinemuse.powersuits.common.Config;
import net.machinemuse.powersuits.powermodule.misc.InvisibilityModule;
import net.machinemuse.utils.ElectricItemUtils;
import net.machinemuse.utils.MuseCommonStrings;
import net.machinemuse.utils.MuseHeatUtils;
import net.machinemuse.utils.MuseItemUtils;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraftforge.common.ISpecialArmor;
import java.util.UUID;
/**
* Describes the 4 different modular armor pieces - head, torso, legs, feet.
*
* @author MachineMuse
*
* Ported to Java by lehjr on 11/4/16.
*/
public abstract class ItemPowerArmor extends ItemElectricArmor implements ISpecialArmor, IArmorTraits {
public ItemPowerArmor(final int renderIndex, final int armorType) {
super(ItemArmor.ArmorMaterial.IRON, renderIndex, armorType);
this.setMaxStackSize(1);
this.setCreativeTab(Config.getCreativeTab());
}
public ISpecialArmor.ArmorProperties getProperties(final EntityLivingBase player, final ItemStack armor, final DamageSource source, final double damage, final int slot) {
final int priority = 0;
Label_0057: {
if (source.isFireDamage()) {
final DamageSource overheatDamage = MuseHeatUtils.overheatDamage;
if (source == null) {
if (overheatDamage == null) {
break Label_0057;
}
}
else if (source.equals(overheatDamage)) {
break Label_0057;
}
return new ISpecialArmor.ArmorProperties(priority, 0.25, (int)(25 * damage));
}
}
if (ModuleManager.itemHasModule(armor, "Radiation Shielding") && (source.damageType.equals("electricity") || source.damageType.equals("radiation"))) {
return new ISpecialArmor.ArmorProperties(priority, 0.25, (int)(25 * damage));
}
double armorDouble2;
if (player instanceof EntityPlayer) {
armorDouble2 = this.getArmorDouble((EntityPlayer)player, armor);
}
else {
armorDouble2 = 2.0;
}
final double armorDouble = armorDouble2;
double absorbRatio = 0.04 * armorDouble;
int absorbMax = (int)armorDouble * 75;
if (source.isUnblockable()) {
absorbMax = 0;
absorbRatio = 0.0;
}
return new ISpecialArmor.ArmorProperties(priority, absorbRatio, absorbMax);
}
public String getArmorTexture(final ItemStack itemstack, final Entity entity, final int slot, final int layer) {
return Config.BLANK_ARMOR_MODEL_PATH();
}
public int getColor(final ItemStack stack) {
final Colour c = this.getColorFromItemStack(stack);
return c.getInt();
}
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(final EntityLivingBase entity, final ItemStack itemstack, final int armorSlot) {
final ArmorModel model = ArmorModel$.MODULE$.instance();
model.visibleSection_$eq(armorSlot);
if (itemstack != null) {
if (entity instanceof EntityPlayer) {
ItemStack armorChest = ((EntityPlayer)entity).getCurrentArmor(2);
if (!armorChest.equals(null) && armorChest.getItem() instanceof ItemPowerArmor)
if (ModuleManager.itemHasActiveModule(armorChest, InvisibilityModule.MODULE_ACTIVE_CAMOUFLAGE)) model.visibleSection_$eq(99);
}
if (ModuleManager.itemHasActiveModule(itemstack, "Transparent Armor")) {
model.visibleSection_$eq(99);
}
model.renderSpec_$eq(MuseItemUtils.getMuseRenderTag(itemstack, armorSlot));
}
return (ModelBiped)model;
}
public Multimap<?, ?> getAttributeModifiers(final ItemStack stack) {
final Multimap parent = super.getAttributeModifiers(stack);
parent.put((Object)"generic.knockbackResistance", (Object)new AttributeModifier(UUID.fromString("448ef0e9-9b7c-4e56-bf3a-6b52aeabff8d"), "generic.knockbackResistance", 0.25, 0));
return (Multimap<?, ?>)parent;
}
public int getItemEnchantability() {
return 0;
}
public boolean hasColor(final ItemStack stack) {
final NBTTagCompound itemTag = MuseItemUtils.getMuseItemTag(stack);
return ModuleManager.tagHasModule(itemTag, "Red Tint") || ModuleManager.tagHasModule(itemTag, "Green Tint") || ModuleManager.tagHasModule(itemTag, "Blue Tint");
}
public int getArmorDisplay(final EntityPlayer player, final ItemStack armor, final int slot) {
return (int)this.getArmorDouble(player, armor);
}
public double getHeatResistance(final EntityPlayer player, final ItemStack stack) {
return MuseHeatUtils.getMaxHeat(stack);
}
@Override
public double getArmorDouble(final EntityPlayer player, final ItemStack stack) {
double totalArmor = 0.0;
final NBTTagCompound props = MuseItemUtils.getMuseItemTag(stack);
final double energy = ElectricItemUtils.getPlayerEnergy(player);
final double physArmor = ModuleManager.computeModularProperty(stack, MuseCommonStrings.ARMOR_VALUE_PHYSICAL);
final double enerArmor = ModuleManager.computeModularProperty(stack, MuseCommonStrings.ARMOR_VALUE_ENERGY);
final double enerConsum = ModuleManager.computeModularProperty(stack, MuseCommonStrings.ARMOR_ENERGY_CONSUMPTION);
totalArmor += physArmor;
if (energy > enerConsum) {
totalArmor += enerArmor;
}
totalArmor = Math.min(Config.getMaximumArmorPerPiece(), totalArmor);
return totalArmor;
}
/**
* Inherited from ISpecialArmor, allows us to customize how the armor
* handles being damaged.
*/
public void damageArmor(final EntityLivingBase entity, final ItemStack stack, final DamageSource source, final int damage, final int slot) {
final NBTTagCompound itemProperties = MuseItemUtils.getMuseItemTag(stack);
if (entity instanceof EntityPlayer) {
final DamageSource overheatDamage = MuseHeatUtils.overheatDamage;
if (source == null) {
if (overheatDamage == null) {
return;
}
}
else if (source.equals(overheatDamage)) {
return;
}
if (source.isFireDamage()) {
final EntityPlayer player = (EntityPlayer)entity;
if (!source.equals(DamageSource.onFire) || MuseHeatUtils.getPlayerHeat(player) < MuseHeatUtils.getMaxHeat(player)) {
MuseHeatUtils.heatPlayer(player, damage);
}
}
else {
final double enerConsum = ModuleManager.computeModularProperty(stack, MuseCommonStrings.ARMOR_ENERGY_CONSUMPTION);
final double drain = enerConsum * damage;
if (entity instanceof EntityPlayer) {
ElectricItemUtils.drainPlayerEnergy((EntityPlayer)entity, drain);
}
else {
this.drainEnergyFrom(stack, drain);
}
}
}
}
@Optional.Method(modid = "Forestry")
public boolean protectPlayer(final EntityPlayer player, final ItemStack armor, final String cause, final boolean doProtect) {
return ApiaristArmor.getInstance().protectPlayer(player, armor, cause, doProtect);
}
@Optional.Method(modid = "Forestry")
public boolean protectEntity(final EntityLivingBase player, final ItemStack armor, final String cause, final boolean doProtect) {
return ApiaristArmor.getInstance().protectEntity(player, armor, cause, doProtect);
}
}

View file

@ -4,8 +4,10 @@ import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IMetalArmor;
import net.machinemuse.api.ApiaristArmor;
import net.machinemuse.utils.render.MuseRenderer;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

View file

@ -8,8 +8,7 @@ import net.minecraft.client.renderer.texture.IIconRegister;
/**
* Ported to Java by lehjr on 10/26/16.
*/
public class ItemPowerArmorChestplate extends ItemPowerArmor
{
public class ItemPowerArmorChestplate extends ItemPowerArmor {
private final String iconpath = MuseRenderer.ICON_PREFIX + "armortorso";
public ItemPowerArmorChestplate() {

View file

@ -13,6 +13,7 @@ import mekanism.api.IMekWrench;
import mods.railcraft.api.core.items.IToolCrowbar;
import net.machinemuse.api.IPowerModule;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IBlockBreakingModule;
import net.machinemuse.api.moduletrigger.IRightClickModule;
import net.machinemuse.general.gui.MuseIcon;
@ -32,16 +33,16 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemTool;
import net.minecraft.util.DamageSource;
import net.minecraft.util.IIcon;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import powercrystals.minefactoryreloaded.api.IMFRHammer;
import javax.annotation.Nullable;
import java.util.List;
/**
* Describes the modular power tool.
*
@ -61,7 +62,19 @@ import java.util.List;
@Optional.Interface(iface = "cofh.api.item.IToolHammer", modid = "CoFHCore", striprefs = true),
@Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraft|Core", striprefs = true),
@Optional.Interface(iface = "appeng.api.implementations.items.IAEWrench", modid = "appliedenergistics2", striprefs = true) })
public class ItemPowerFist extends ItemElectricTool implements IToolGrafter, IToolHammer, IMFRHammer, IToolCrowbar, IAEWrench, IToolWrench, IScrewdriver, mrtjp.projectred.api.IScrewdriver, ITool, IMekWrench, IModeChangingModularItem
public class ItemPowerFist extends MPSItemElectricTool
implements
IToolGrafter,
IToolHammer,
IMFRHammer,
IToolCrowbar,
IAEWrench,
IToolWrench,
IScrewdriver,
mrtjp.projectred.api.IScrewdriver,
ITool, IMekWrench,
IModularItem,
IModeChangingModularItem
{
private final String iconpath = MuseIcon.ICON_PREFIX + "handitem";
public ItemPowerFist() {
@ -425,4 +438,26 @@ public class ItemPowerFist extends ItemElectricTool implements IToolGrafter, ITo
public String getActiveMode(ItemStack stack) {
return ModeChangingModularItem.getInstance().getActiveMode(stack);
}
/* IModularItem ------------------------------------------------------------------------------- */
@Override
public List<String> getLongInfo(EntityPlayer player, ItemStack stack) {
return null;
}
@Override
public double getPlayerEnergy(EntityPlayer player) {
return ElectricItemUtils.getPlayerEnergy(player);
}
@Override
public void drainPlayerEnergy(EntityPlayer player, double drainAmount) {
ElectricItemUtils.drainPlayerEnergy(player, drainAmount);
}
@Override
public void givePlayerEnergy(EntityPlayer player, double joulesToGive) {
ElectricItemUtils.givePlayerEnergy(player, joulesToGive);
}
}

View file

@ -0,0 +1,224 @@
package net.machinemuse.powersuits.item;
import appeng.api.config.AccessRestriction;
import com.google.common.collect.Sets;
import net.machinemuse.api.electricity.IMuseElectricItem;
import net.machinemuse.api.electricity.MuseElectricItem;
import net.machinemuse.numina.geometry.Colour;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemTool;
import java.util.List;
import java.util.Set;
/**
* Ported to Java by lehjr on 11/4/16.
*/
public class MPSItemElectricTool extends ItemTool implements IModularItemBase, IMuseElectricItem {
public static final Set<Block> blocksEffectiveOn = Sets.newHashSet(new Block[] {
Blocks.cobblestone, Blocks.double_stone_slab, Blocks.stone_slab, Blocks.stone, Blocks.sandstone, Blocks.mossy_cobblestone,
Blocks.iron_ore, Blocks.iron_block, Blocks.coal_ore, Blocks.gold_block, Blocks.gold_ore, Blocks.diamond_ore,
Blocks.diamond_block, Blocks.ice, Blocks.netherrack, Blocks.lapis_ore, Blocks.lapis_block, Blocks.redstone_ore,
Blocks.lit_redstone_ore, Blocks.rail, Blocks.detector_rail, Blocks.golden_rail, Blocks.activator_rail});
protected MPSItemElectricTool(float damageBonus, ToolMaterial material) {
super(damageBonus, material, blocksEffectiveOn);
}
@Override
public String getToolTip(ItemStack itemStack) {
return null;
}
@Override
public double getCurrentEnergy(ItemStack stack) {
return MuseElectricItem.getInstance().getCurrentEnergy(stack);
}
@Override
public double getMaxEnergy(ItemStack stack) {
return MuseElectricItem.getInstance().getMaxEnergy(stack);
}
@Override
public void setCurrentEnergy(ItemStack stack, double energy) {
MuseElectricItem.getInstance().setCurrentEnergy(stack, energy);
}
@Override
public double drainEnergyFrom(ItemStack stack, double requested) {
return MuseElectricItem.getInstance().drainEnergyFrom(stack, requested);
}
@Override
public double giveEnergyTo(ItemStack stack, double provided) {
return MuseElectricItem.getInstance().giveEnergyTo(stack, provided);
}
/* Industrialcraft 2 -------------------------------------------------------------------------- */
@Override
public IMuseElectricItem getManager(ItemStack stack) {
return MuseElectricItem.getInstance().getManager(stack);
}
@Override
public void chargeFromArmor(ItemStack itemStack, EntityLivingBase entity) {
MuseElectricItem.getInstance().chargeFromArmor(itemStack, entity);
}
@Override
public boolean use(ItemStack itemStack, double amount, EntityLivingBase entity) {
return MuseElectricItem.getInstance().use(itemStack, amount, entity);
}
@Override
public boolean canProvideEnergy(ItemStack itemStack) {
return MuseElectricItem.getInstance().canProvideEnergy(itemStack);
}
@Override
public double getCharge(ItemStack itemStack) {
return MuseElectricItem.getInstance().getCharge(itemStack);
}
@Override
public double getMaxCharge(ItemStack itemStack) {
return MuseElectricItem.getInstance().getMaxCharge(itemStack);
}
@Override
public int getTier(ItemStack itemStack) {
return MuseElectricItem.getInstance().getTier(itemStack);
}
@Override
public double getTransferLimit(ItemStack itemStack) {
return MuseElectricItem.getInstance().getTransferLimit(itemStack);
}
@Override
public double charge(ItemStack itemStack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate) {
return MuseElectricItem.getInstance().charge(itemStack, amount, tier, ignoreTransferLimit, simulate);
}
@Override
public double discharge(ItemStack itemStack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate) {
return MuseElectricItem.getInstance().discharge(itemStack, amount, tier, ignoreTransferLimit, externally, simulate);
}
@Override
public boolean canUse(ItemStack itemStack, double amount) {
return MuseElectricItem.getInstance().canUse(itemStack, amount);
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return MuseElectricItem.getInstance().getChargedItem(itemStack);
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return MuseElectricItem.getInstance().getEmptyItem(itemStack);
}
/* Thermal Expansion -------------------------------------------------------------------------- */
@Override
public int receiveEnergy(ItemStack stack, int energy, boolean simulate) {
return MuseElectricItem.getInstance().receiveEnergy(stack, energy, simulate);
}
@Override
public int extractEnergy(ItemStack stack, int energy, boolean simulate) {
return MuseElectricItem.getInstance().extractEnergy(stack, energy, simulate);
}
@Override
public int getEnergyStored(ItemStack theItem) {
return MuseElectricItem.getInstance().getEnergyStored(theItem);
}
@Override
public int getMaxEnergyStored(ItemStack theItem) {
return MuseElectricItem.getInstance().getMaxEnergyStored(theItem);
}
/* Applied Energistics 2 ---------------------------------------------------------------------- */
@Override
public double injectAEPower(ItemStack stack, double ae) {
return MuseElectricItem.getInstance().injectAEPower(stack, ae);
}
@Override
public double extractAEPower(ItemStack stack, double ae) {
return MuseElectricItem.getInstance().extractAEPower(stack, ae);
}
@Override
public double getAEMaxPower(ItemStack stack) {
return MuseElectricItem.getInstance().getAEMaxPower(stack);
}
@Override
public double getAECurrentPower(ItemStack stack) {
return MuseElectricItem.getInstance().getAECurrentPower(stack);
}
@Override
public AccessRestriction getPowerFlow(ItemStack stack) {
return MuseElectricItem.getInstance().getPowerFlow(stack);
}
/* IModularItemBase ------------------------------------------------------------------------------ */
@Override
public Colour getGlowFromItemStack(ItemStack stack) {
return ModularItemBase.getInstance().getGlowFromItemStack(stack);
}
@Override
public Colour getColorFromItemStack(ItemStack stack) {
return ModularItemBase.getInstance().getColorFromItemStack(stack);
}
@Override
public String formatInfo(String string, double value) {
return ModularItemBase.getInstance().formatInfo(string, value);
}
@Override
public List<String> getLongInfo(EntityPlayer player, ItemStack stack) {
return ModularItemBase.getInstance().getLongInfo(player, stack);
}
@Override
public double getArmorDouble(EntityPlayer player, ItemStack stack) {
return 0;
}
/* MPSItemElectricTool ------------------------------------------------------------------------ */
@Override
public double getPlayerEnergy(EntityPlayer player) {
return 0;
}
@Override
public void drainPlayerEnergy(EntityPlayer player, double drainEnergy) {
}
@Override
public void givePlayerEnergy(EntityPlayer player, double joulesToGive) {
}
}

View file

@ -9,7 +9,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import scala.Option;
import javax.annotation.Nullable;
import java.util.ArrayList;
@ -81,7 +80,7 @@ public class ModeChangingModularItem implements IModeChangingModularItem {
}
}
/* I M O D E C H A N G I N G I T E M ---------------------------------------------------------- */
/* IModeChangingItem -------------------------------------------------------------------------- */
@Override
public void setActiveMode(ItemStack stack, String newMode) {

View file

@ -0,0 +1,263 @@
package net.machinemuse.powersuits.item;
import appeng.api.config.AccessRestriction;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.electricity.IMuseElectricItem;
import net.machinemuse.api.electricity.MuseElectricItem;
import net.machinemuse.numina.geometry.Colour;
import net.machinemuse.powersuits.powermodule.misc.CosmeticGlowModule;
import net.machinemuse.powersuits.powermodule.misc.TintModule;
import net.machinemuse.utils.ElectricItemUtils;
import net.machinemuse.utils.MuseCommonStrings;
import net.machinemuse.utils.MuseStringUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
import java.util.List;
import static net.machinemuse.numina.general.MuseMathUtils.clampDouble;
/**
* Author: MachineMuse (Claire Semple)
* Created: 7:49 PM, 4/23/13
*
* Ported to Java by lehjr on 11/4/16.
*/
public class ModularItemBase extends Item implements IModularItemBase {
private static ModularItemBase INSTANCE;
public static ModularItemBase getInstance() {
if (INSTANCE == null) {
INSTANCE = new ModularItemBase();
}
return INSTANCE;
}
@SideOnly(Side.CLIENT)
@Override
public int getColorFromItemStack(ItemStack stack, int par2) {
return getColorFromItemStack(stack).getInt();
}
@Override
public Colour getGlowFromItemStack(ItemStack stack) {
if (!ModuleManager.itemHasActiveModule(stack, CosmeticGlowModule.MODULE_GLOW)) {
return Colour.LIGHTBLUE;
}
double computedred = ModuleManager.computeModularProperty(stack, CosmeticGlowModule.RED_GLOW);
double computedgreen = ModuleManager.computeModularProperty(stack, CosmeticGlowModule.GREEN_GLOW);
double computedblue = ModuleManager.computeModularProperty(stack, CosmeticGlowModule.BLUE_GLOW);
Colour colour = new Colour(clampDouble(computedred, 0, 1), clampDouble(computedgreen, 0, 1), clampDouble(computedblue, 0, 1), 0.8);
return colour;
}
@Override
public Colour getColorFromItemStack(ItemStack stack) {
if (!ModuleManager.itemHasActiveModule(stack, TintModule.MODULE_TINT)) {
return Colour.WHITE;
}
double computedred = ModuleManager.computeModularProperty(stack, TintModule.RED_TINT);
double computedgreen = ModuleManager.computeModularProperty(stack, TintModule.GREEN_TINT);
double computedblue = ModuleManager.computeModularProperty(stack, TintModule.BLUE_TINT);
Colour colour = new Colour(clampDouble(computedred, 0, 1), clampDouble(computedgreen, 0, 1), clampDouble(computedblue, 0, 1), 1.0F);
return colour;
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List currentTipList, boolean advancedToolTips) {
MuseCommonStrings.addInformation(stack, player, currentTipList, advancedToolTips);
}
@Override
public String formatInfo(String string, double value) {
return string + '\t' + MuseStringUtils.formatNumberShort(value);
}
/* IModularItem ------------------------------------------------------------------------------- */
@Override
public List<String> getLongInfo(EntityPlayer player, ItemStack stack) {
List<String> info = new ArrayList<>();
info.add("Detailed Summary");
info.add(formatInfo("Armor", getArmorDouble(player, stack)));
info.add(formatInfo("Energy Storage", getCurrentEnergy(stack)) + 'J');
info.add(formatInfo("Weight", MuseCommonStrings.getTotalWeight(stack)) + 'g');
return info;
}
@Override
public double getArmorDouble(EntityPlayer player, ItemStack stack) {
return 0;
}
@Override
public double getPlayerEnergy(EntityPlayer player) {
return ElectricItemUtils.getPlayerEnergy(player);
}
@Override
public void drainPlayerEnergy(EntityPlayer player, double drainEnergy) {
ElectricItemUtils.drainPlayerEnergy(player, drainEnergy);
}
@Override
public void givePlayerEnergy(EntityPlayer player, double joulesToGive) {
ElectricItemUtils.drainPlayerEnergy(player, joulesToGive);
}
/* MuseElectricItem --------------------------------------------------------------------------- */
@Override
public double getCurrentEnergy(ItemStack stack) {
return MuseElectricItem.getInstance().getCurrentEnergy(stack);
}
@Override
public double getMaxEnergy(ItemStack stack) {
return MuseElectricItem.getInstance().getCurrentEnergy(stack);
}
@Override
public void setCurrentEnergy(ItemStack stack, double energy) {
MuseElectricItem.getInstance().setCurrentEnergy(stack, energy);
}
@Override
public double drainEnergyFrom(ItemStack stack, double requested) {
return MuseElectricItem.getInstance().drainEnergyFrom(stack, requested);
}
@Override
public double giveEnergyTo(ItemStack stack, double provided) {
return MuseElectricItem.getInstance().giveEnergyTo(stack, provided);
}
@SideOnly(Side.CLIENT)
@Override
public String getToolTip(ItemStack itemStack) {
return itemStack.getTooltip(Minecraft.getMinecraft().thePlayer, false).toString();
}
/* Industrialcraft 2 -------------------------------------------------------------------------- */
@Override
public IMuseElectricItem getManager(ItemStack stack) {
return MuseElectricItem.getInstance().getManager(stack);
}
@Override
public void chargeFromArmor(ItemStack itemStack, EntityLivingBase entity) {
MuseElectricItem.getInstance().chargeFromArmor(itemStack, entity);
}
@Override
public boolean use(ItemStack itemStack, double amount, EntityLivingBase entity) {
return MuseElectricItem.getInstance().use(itemStack, amount, entity);
}
@Override
public boolean canProvideEnergy(ItemStack itemStack) {
return MuseElectricItem.getInstance().canProvideEnergy(itemStack);
}
@Override
public double getCharge(ItemStack itemStack) {
return MuseElectricItem.getInstance().getCharge(itemStack);
}
@Override
public double getMaxCharge(ItemStack itemStack) {
return MuseElectricItem.getInstance().getMaxCharge(itemStack);
}
@Override
public int getTier(ItemStack itemStack) {
return MuseElectricItem.getInstance().getTier(itemStack);
}
@Override
public double getTransferLimit(ItemStack itemStack) {
return MuseElectricItem.getInstance().getTransferLimit(itemStack);
}
@Override
public double charge(ItemStack itemStack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate) {
return MuseElectricItem.getInstance().charge(itemStack, amount, tier, ignoreTransferLimit, simulate);
}
@Override
public double discharge(ItemStack itemStack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate) {
return MuseElectricItem.getInstance().discharge(itemStack, amount, tier, ignoreTransferLimit, externally, simulate);
}
@Override
public boolean canUse(ItemStack itemStack, double amount) {
return MuseElectricItem.getInstance().canUse(itemStack, amount);
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return MuseElectricItem.getInstance().getChargedItem(itemStack);
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return MuseElectricItem.getInstance().getEmptyItem(itemStack);
}
/* Thermal Expansion -------------------------------------------------------------------------- */
@Override
public int receiveEnergy(ItemStack stack, int energy, boolean simulate) {
return MuseElectricItem.getInstance().receiveEnergy(stack, energy, simulate);
}
@Override
public int extractEnergy(ItemStack stack, int energy, boolean simulate) {
return MuseElectricItem.getInstance().extractEnergy(stack, energy, simulate);
}
@Override
public int getEnergyStored(ItemStack theItem) {
return MuseElectricItem.getInstance().getEnergyStored(theItem);
}
@Override
public int getMaxEnergyStored(ItemStack theItem) {
return MuseElectricItem.getInstance().getMaxEnergyStored(theItem);
}
/* Applied Energistics 2 ---------------------------------------------------------------------- */
@Override
public double injectAEPower(ItemStack stack, double ae) {
return MuseElectricItem.getInstance().injectAEPower(stack, ae);
}
@Override
public double extractAEPower(ItemStack stack, double ae) {
return MuseElectricItem.getInstance().extractAEPower(stack, ae);
}
@Override
public double getAEMaxPower(ItemStack stack) {
return MuseElectricItem.getInstance().getAEMaxPower(stack);
}
@Override
public double getAECurrentPower(ItemStack stack) {
return MuseElectricItem.getInstance().getAECurrentPower(stack);
}
@Override
public AccessRestriction getPowerFlow(ItemStack stack) {
return MuseElectricItem.getInstance().getPowerFlow(stack);
}
}

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import java.util.List;

View file

@ -1,6 +1,7 @@
package net.machinemuse.powersuits.powermodule;
import net.machinemuse.api.*;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.general.gui.MuseIcon;
import net.machinemuse.numina.render.MuseTextureUtils;
import net.machinemuse.powersuits.common.Config;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IRightClickModule;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IToggleableModule;
import java.util.List;

View file

@ -1,7 +1,7 @@
package net.machinemuse.powersuits.powermodule.armor;
import cpw.mods.fml.common.registry.GameRegistry;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
import net.machinemuse.utils.MuseCommonStrings;
import net.minecraft.item.ItemStack;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.armor;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
import net.machinemuse.utils.MuseCommonStrings;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.armor;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
import net.machinemuse.utils.MuseCommonStrings;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.armor;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
import net.machinemuse.utils.MuseCommonStrings;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.armor;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
import net.machinemuse.utils.MuseCommonStrings;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.armor;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
import net.machinemuse.utils.MuseCommonStrings;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.armor;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.armor;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.armor;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.powersuits.item.ItemComponent;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.energy;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.electricity.ElectricConversions;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
@ -20,8 +20,8 @@ public class AdvancedBatteryModule extends PowerModuleBase {
addBaseProperty(MuseCommonStrings.WEIGHT, 2000, "g");
addTradeoffProperty("Battery Size", ElectricItemUtils.MAXIMUM_ENERGY, 400000);
addTradeoffProperty("Battery Size", MuseCommonStrings.WEIGHT, 8000);
addBaseProperty(ElectricConversions.IC2_TIER(), 1);
addTradeoffProperty("IC2 Tier", ElectricConversions.IC2_TIER(), 2);
addBaseProperty(ElectricConversions.IC2_TIER, 1);
addTradeoffProperty("IC2 Tier", ElectricConversions.IC2_TIER, 2);
}
@Override

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.energy;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.powersuits.item.ItemComponent;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.energy;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.electricity.ElectricConversions;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
@ -20,8 +20,8 @@ public class BasicBatteryModule extends PowerModuleBase {
addBaseProperty(MuseCommonStrings.WEIGHT, 2000, "g");
addTradeoffProperty("Battery Size", ElectricItemUtils.MAXIMUM_ENERGY, 80000);
addTradeoffProperty("Battery Size", MuseCommonStrings.WEIGHT, 8000);
addBaseProperty(ElectricConversions.IC2_TIER(), 1);
addTradeoffProperty("IC2 Tier", ElectricConversions.IC2_TIER(), 2);
addBaseProperty(ElectricConversions.IC2_TIER, 1);
addTradeoffProperty("IC2 Tier", ElectricConversions.IC2_TIER, 2);
}
@Override

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.energy;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.energy;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.electricity.ElectricConversions;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
@ -20,8 +20,8 @@ public class EliteBatteryModule extends PowerModuleBase {
addBaseProperty(MuseCommonStrings.WEIGHT, 2000, "g");
addTradeoffProperty("Battery Size", ElectricItemUtils.MAXIMUM_ENERGY, 4250000);
addTradeoffProperty("Battery Size", MuseCommonStrings.WEIGHT, 8000);
addBaseProperty(ElectricConversions.IC2_TIER(), 1);
addTradeoffProperty("IC2 Tier", ElectricConversions.IC2_TIER(), 2);
addBaseProperty(ElectricConversions.IC2_TIER, 1);
addTradeoffProperty("IC2 Tier", ElectricConversions.IC2_TIER, 2);
}
@Override

View file

@ -1,7 +1,7 @@
package net.machinemuse.powersuits.powermodule.energy;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -1,7 +1,7 @@
package net.machinemuse.powersuits.powermodule.energy;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.powersuits.item.ItemComponent;

View file

@ -1,7 +1,7 @@
package net.machinemuse.powersuits.powermodule.energy;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.powersuits.item.ItemComponent;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.misc;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
import net.machinemuse.utils.MuseCommonStrings;
import net.minecraft.init.Blocks;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.misc;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.misc;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IToggleableModule;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.misc;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
import net.machinemuse.utils.MuseCommonStrings;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.misc;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IToggleableModule;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.misc;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IToggleableModule;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.misc;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.misc;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
import net.machinemuse.utils.MuseCommonStrings;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.misc;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IRightClickModule;
import net.machinemuse.powersuits.common.ModularPowersuits;
import net.machinemuse.powersuits.item.ItemComponent;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.misc;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;
import net.machinemuse.powersuits.item.ItemComponent;

View file

@ -3,7 +3,7 @@ package net.machinemuse.powersuits.powermodule.misc;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -1,7 +1,7 @@
package net.machinemuse.powersuits.powermodule.misc;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.misc;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;
import net.machinemuse.powersuits.item.ItemComponent;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.misc;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IToggleableModule;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.misc;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
import net.machinemuse.utils.MuseCommonStrings;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.misc;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
import net.machinemuse.utils.MuseCommonStrings;

View file

@ -2,7 +2,7 @@ package net.machinemuse.powersuits.powermodule.misc;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.movement;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IRightClickModule;
import net.machinemuse.numina.player.NuminaPlayerUtils;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.movement;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;
import net.machinemuse.powersuits.item.ItemComponent;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.movement;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IToggleableModule;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.movement;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -2,7 +2,7 @@ package net.machinemuse.powersuits.powermodule.movement;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -2,7 +2,7 @@ package net.machinemuse.powersuits.powermodule.movement;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.movement;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;
import net.machinemuse.numina.player.NuminaPlayerUtils;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.movement;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.movement;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IToggleableModule;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.movement;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -2,7 +2,7 @@ package net.machinemuse.powersuits.powermodule.movement;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.tool;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IBlockBreakingModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;
import net.machinemuse.powersuits.item.ItemComponent;

View file

@ -2,7 +2,7 @@ package net.machinemuse.powersuits.powermodule.tool;
import com.google.common.base.Optional;
import extracells.api.ECApi;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IRightClickModule;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;

View file

@ -2,7 +2,7 @@ package net.machinemuse.powersuits.powermodule.tool;
import appeng.api.AEApi;
import com.google.common.base.Optional;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IRightClickModule;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.tool;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IBlockBreakingModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.tool;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IBlockBreakingModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -1,7 +1,7 @@
package net.machinemuse.powersuits.powermodule.tool;
import cpw.mods.fml.common.registry.GameRegistry;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IBlockBreakingModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.tool;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IBlockBreakingModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

View file

@ -1,7 +1,7 @@
package net.machinemuse.powersuits.powermodule.tool;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IRightClickModule;
import net.machinemuse.powersuits.item.ItemComponent;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.tool;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IRightClickModule;
import net.machinemuse.powersuits.common.ModularPowersuits;
import net.machinemuse.powersuits.item.ItemComponent;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.tool;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IRightClickModule;
import net.machinemuse.powersuits.item.ItemComponent;

View file

@ -1,7 +1,7 @@
package net.machinemuse.powersuits.powermodule.tool;
import cpw.mods.fml.common.registry.GameRegistry;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
import net.machinemuse.utils.MuseCommonStrings;
import net.minecraft.item.ItemStack;

View file

@ -1,7 +1,7 @@
package net.machinemuse.powersuits.powermodule.tool;
import cpw.mods.fml.common.eventhandler.Event;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.IPowerModule;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IRightClickModule;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.tool;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IRightClickModule;
import net.machinemuse.powersuits.item.ItemComponent;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.tool;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IRightClickModule;
import net.machinemuse.powersuits.entity.EntityLuxCapacitor;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.tool;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;
import net.machinemuse.utils.MuseCommonStrings;

View file

@ -3,7 +3,7 @@ package net.machinemuse.powersuits.powermodule.tool;// package andrew.powersuits
// import cpw.mods.fml.common.registry.GameRegistry;
// import cpw.mods.fml.common.network.NetworkRegistry;
// import cpw.mods.fml.common.Loader;
// import net.machinemuse.api.IModularItem;
// import net.machinemuse.api.electricity.IModularItem;
// import net.machinemuse.api.moduletrigger.IRightClickModule;
// import net.machinemuse.powersuits.item.ItemComponent;
// import net.machinemuse.powersuits.powermodule.PowerModuleBase;

View file

@ -2,7 +2,7 @@ package net.machinemuse.powersuits.powermodule.tool;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IRightClickModule;
import net.machinemuse.powersuits.common.ModCompatibility;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.tool;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IRightClickModule;
import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.powermodule.PowerModuleBase;

View file

@ -1,7 +1,7 @@
package net.machinemuse.powersuits.powermodule.tool;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IRightClickModule;
import net.machinemuse.powersuits.common.Config;

View file

@ -1,7 +1,7 @@
package net.machinemuse.powersuits.powermodule.tool;
import cpw.mods.fml.common.registry.GameRegistry;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.moduletrigger.IPlayerTickModule;
import net.machinemuse.api.moduletrigger.IRightClickModule;
import net.machinemuse.powersuits.item.ItemComponent;

View file

@ -1,6 +1,6 @@
package net.machinemuse.powersuits.powermodule.tool;
import net.machinemuse.api.IModularItem;
import net.machinemuse.api.electricity.IModularItem;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.moduletrigger.IBlockBreakingModule;
import net.machinemuse.api.moduletrigger.IToggleableModule;

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