more repackaging, changed default joule ratio to be BC joules

This commit is contained in:
MachineMuse 2013-02-02 05:33:02 -07:00
parent e6e075dc74
commit 17bf507c74
16 changed files with 52 additions and 29 deletions

View file

@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import net.machinemuse.general.gui.MuseIcon; import net.machinemuse.general.gui.MuseIcon;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
@ -14,7 +15,7 @@ public interface IPowerModule {
public abstract String getCategory(); public abstract String getCategory();
public abstract boolean isValidForItem(ItemStack stack); public abstract boolean isValidForItem(ItemStack stack, EntityPlayer player);
public abstract String getName(); public abstract String getName();

View file

@ -1,15 +1,13 @@
package net.machinemuse.powersuits.item; package net.machinemuse.api;
import icbm.api.IExplosive; import icbm.api.IExplosive;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import net.machinemuse.api.IPowerModule;
import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.MuseItemUtils;
import net.machinemuse.general.MuseStringUtils; import net.machinemuse.general.MuseStringUtils;
import net.machinemuse.powersuits.common.Config; import net.machinemuse.powersuits.common.Config;
import net.machinemuse.powersuits.item.ItemPowerTool;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -9,7 +9,6 @@ import java.util.Set;
import net.machinemuse.general.MuseMathUtils; import net.machinemuse.general.MuseMathUtils;
import net.machinemuse.powersuits.item.IModularItem; import net.machinemuse.powersuits.item.IModularItem;
import net.machinemuse.powersuits.item.ItemComponent; import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.item.ModularCommon;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
@ -25,7 +24,7 @@ public class MuseItemUtils {
EntityPlayer player, ItemStack stack) { EntityPlayer player, ItemStack stack) {
List<IPowerModule> validModules = new ArrayList(); List<IPowerModule> validModules = new ArrayList();
for (IPowerModule module : ModuleManager.getAllModules()) { for (IPowerModule module : ModuleManager.getAllModules()) {
if (module.isValidForItem(stack)) { if (module.isValidForItem(stack, player)) {
validModules.add(module); validModules.add(module);
} }
} }

View file

@ -0,0 +1,20 @@
package net.machinemuse.general.geometry;
public class MuseRelativeRect extends MuseRect {
public MuseRelativeRect(double left, double top, double right, double bottom) {
super(left, top, right, bottom);
// TODO Auto-generated constructor stub
}
public MuseRelativeRect(double left, double top, double right, double bottom, boolean growFromMiddle) {
super(left, top, right, bottom, growFromMiddle);
// TODO Auto-generated constructor stub
}
public MuseRelativeRect(MusePoint2D ul, MusePoint2D br) {
super(ul, br);
// TODO Auto-generated constructor stub
}
}

View file

@ -2,10 +2,10 @@ package net.machinemuse.general.gui.clickable;
import java.util.List; import java.util.List;
import net.machinemuse.api.ModularCommon;
import net.machinemuse.general.MuseRenderer; import net.machinemuse.general.MuseRenderer;
import net.machinemuse.general.geometry.Colour; import net.machinemuse.general.geometry.Colour;
import net.machinemuse.general.geometry.MusePoint2D; import net.machinemuse.general.geometry.MusePoint2D;
import net.machinemuse.powersuits.item.ModularCommon;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
public class ClickableSlider extends Clickable { public class ClickableSlider extends Clickable {

View file

@ -11,6 +11,7 @@ import net.machinemuse.api.MuseItemUtils;
import net.machinemuse.general.MuseRenderer; import net.machinemuse.general.MuseRenderer;
import net.machinemuse.general.geometry.Colour; import net.machinemuse.general.geometry.Colour;
import net.machinemuse.general.geometry.MusePoint2D; import net.machinemuse.general.geometry.MusePoint2D;
import net.machinemuse.general.geometry.MuseRect;
import net.machinemuse.general.gui.clickable.ClickableItem; import net.machinemuse.general.gui.clickable.ClickableItem;
import net.machinemuse.general.gui.clickable.ClickableModule; import net.machinemuse.general.gui.clickable.ClickableModule;
@ -110,8 +111,11 @@ public class ModuleSelectionFrame extends ScrollableFrame {
} else { } else {
ModuleSelectionSubFrame frame = new ModuleSelectionSubFrame( ModuleSelectionSubFrame frame = new ModuleSelectionSubFrame(
category, category,
new MusePoint2D(border.left() + 4, border.top() + 4 + 30 * categories.size()), new MuseRect(
new MusePoint2D(border.right() - 4, border.bottom() + 34 + 30 * categories.size())); border.left() + 4,
border.top() + 4 + 30 * categories.size(),
border.right() - 4,
border.bottom() + 34 + 30 * categories.size()));
categories.put(category, frame); categories.put(category, frame);
return frame; return frame;

View file

@ -6,32 +6,30 @@ import java.util.List;
import net.machinemuse.api.IPowerModule; import net.machinemuse.api.IPowerModule;
import net.machinemuse.general.MuseRenderer; import net.machinemuse.general.MuseRenderer;
import net.machinemuse.general.geometry.MusePoint2D; import net.machinemuse.general.geometry.MusePoint2D;
import net.machinemuse.general.geometry.MuseRect;
import net.machinemuse.general.gui.clickable.ClickableModule; import net.machinemuse.general.gui.clickable.ClickableModule;
public class ModuleSelectionSubFrame { public class ModuleSelectionSubFrame {
protected List<ClickableModule> moduleButtons; protected List<ClickableModule> moduleButtons;
protected MusePoint2D topleft; protected MuseRect border;
protected MusePoint2D bottomright;
protected String category; protected String category;
public ModuleSelectionSubFrame(String category, MusePoint2D topleft, public ModuleSelectionSubFrame(String category, MuseRect border) {
MusePoint2D bottomright) {
this.category = category; this.category = category;
this.topleft = topleft; this.border = border;
this.bottomright = bottomright;
this.moduleButtons = new ArrayList<ClickableModule>(); this.moduleButtons = new ArrayList<ClickableModule>();
} }
public void draw() { public void draw() {
MuseRenderer.drawString(this.category, topleft.x(), topleft.y()); MuseRenderer.drawString(this.category, border.left(), border.top());
for (ClickableModule clickie : moduleButtons) { for (ClickableModule clickie : moduleButtons) {
clickie.draw(); clickie.draw();
} }
} }
public ClickableModule addModule(IPowerModule module) { public ClickableModule addModule(IPowerModule module) {
double x = topleft.x() + 8 + 16 * moduleButtons.size(); double x = border.left() + 8 + 16 * moduleButtons.size();
double y = topleft.y() + 16; double y = border.top() + 16;
ClickableModule clickie = new ClickableModule(module, new MusePoint2D(x, y)); ClickableModule clickie = new ClickableModule(module, new MusePoint2D(x, y));
this.moduleButtons.add(clickie); this.moduleButtons.add(clickie);
return clickie; return clickie;

View file

@ -4,12 +4,12 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import net.machinemuse.api.IPowerModule; import net.machinemuse.api.IPowerModule;
import net.machinemuse.api.ModularCommon;
import net.machinemuse.api.ModuleManager; import net.machinemuse.api.ModuleManager;
import net.machinemuse.general.MuseStringUtils; import net.machinemuse.general.MuseStringUtils;
import net.machinemuse.general.gui.MuseIcon; import net.machinemuse.general.gui.MuseIcon;
import net.machinemuse.powersuits.item.IModularItem; import net.machinemuse.powersuits.item.IModularItem;
import net.machinemuse.powersuits.item.ItemComponent; import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.item.ModularCommon;
import net.machinemuse.powersuits.powermodule.PowerModule; import net.machinemuse.powersuits.powermodule.PowerModule;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
@ -414,7 +414,7 @@ public class Config {
.addInstallCost(copyAndResize(ItemComponent.servoMotor, 2)); .addInstallCost(copyAndResize(ItemComponent.servoMotor, 2));
addModule(module); addModule(module);
module = new PowerModule(ModularCommon.MODULE_TINT, ARMORONLY, MuseIcon.NETHERSTAR, ModularCommon.CATEGORY_COSMETIC) module = new PowerModule(ModularCommon.MODULE_TINT, ALLITEMS, MuseIcon.NETHERSTAR, ModularCommon.CATEGORY_COSMETIC)
.setDescription("Give your armor some coloured tinting to customize your armor's appearance.") .setDescription("Give your armor some coloured tinting to customize your armor's appearance.")
.addInstallCost(copyAndResize(ItemComponent.laserHologram, 1)) .addInstallCost(copyAndResize(ItemComponent.laserHologram, 1))
.setToggleable(true) .setToggleable(true)

View file

@ -3,11 +3,11 @@ package net.machinemuse.powersuits.common;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.Arrays; import java.util.Arrays;
import net.machinemuse.api.ModularCommon;
import net.machinemuse.api.ModuleManager; import net.machinemuse.api.ModuleManager;
import net.machinemuse.general.gui.MuseIcon; import net.machinemuse.general.gui.MuseIcon;
import net.machinemuse.powersuits.item.IModularItem; import net.machinemuse.powersuits.item.IModularItem;
import net.machinemuse.powersuits.item.ItemComponent; import net.machinemuse.powersuits.item.ItemComponent;
import net.machinemuse.powersuits.item.ModularCommon;
import net.machinemuse.powersuits.powermodule.PowerModule; import net.machinemuse.powersuits.powermodule.PowerModule;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -66,11 +66,11 @@ public class ModCompatability {
} }
public static double getIC2Ratio() { public static double getIC2Ratio() {
return Config.getConfig().get(Configuration.CATEGORY_GENERAL, "Joules per IC2 EU", 50.0).getDouble(50.0); return Config.getConfig().get(Configuration.CATEGORY_GENERAL, "Joules per IC2 EU", 0.4).getDouble(0.4);
} }
public static double getBCRatio() { public static double getBCRatio() {
return Config.getConfig().get(Configuration.CATEGORY_GENERAL, "Joules per MJ", 500.0).getDouble(500.0); return Config.getConfig().get(Configuration.CATEGORY_GENERAL, "Joules per MJ", 1.0).getDouble(1.0);
} }
public static ItemStack getIC2Item(String name) { public static ItemStack getIC2Item(String name) {

View file

@ -1,10 +1,10 @@
package net.machinemuse.powersuits.event; package net.machinemuse.powersuits.event;
import net.machinemuse.api.ModularCommon;
import net.machinemuse.api.MuseItemUtils; import net.machinemuse.api.MuseItemUtils;
import net.machinemuse.api.ModuleManager; import net.machinemuse.api.ModuleManager;
import net.machinemuse.powersuits.item.IModularItem; import net.machinemuse.powersuits.item.IModularItem;
import net.machinemuse.powersuits.item.ItemPowerTool; import net.machinemuse.powersuits.item.ItemPowerTool;
import net.machinemuse.powersuits.item.ModularCommon;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;

View file

@ -3,10 +3,10 @@ package net.machinemuse.powersuits.event;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import net.machinemuse.api.ModularCommon;
import net.machinemuse.api.MuseItemUtils; import net.machinemuse.api.MuseItemUtils;
import net.machinemuse.api.ModuleManager; import net.machinemuse.api.ModuleManager;
import net.machinemuse.powersuits.item.ItemPowerArmor; import net.machinemuse.powersuits.item.ItemPowerArmor;
import net.machinemuse.powersuits.item.ModularCommon;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.ForgeSubscribe;

View file

@ -5,6 +5,7 @@ import icbm.api.IExplosive;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.machinemuse.api.ModularCommon;
import net.machinemuse.api.MuseItemUtils; import net.machinemuse.api.MuseItemUtils;
import net.machinemuse.api.ModuleManager; import net.machinemuse.api.ModuleManager;
import net.machinemuse.general.MuseStringUtils; import net.machinemuse.general.MuseStringUtils;

View file

@ -5,6 +5,7 @@ import icbm.api.IExplosive;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.machinemuse.api.ModularCommon;
import net.machinemuse.api.MuseItemUtils; import net.machinemuse.api.MuseItemUtils;
import net.machinemuse.api.ModuleManager; import net.machinemuse.api.ModuleManager;
import net.machinemuse.general.MuseStringUtils; import net.machinemuse.general.MuseStringUtils;

View file

@ -14,6 +14,7 @@ import net.machinemuse.api.MuseItemUtils;
import net.machinemuse.general.gui.MuseIcon; import net.machinemuse.general.gui.MuseIcon;
import net.machinemuse.powersuits.common.Config; import net.machinemuse.powersuits.common.Config;
import net.machinemuse.powersuits.item.IModularItem; import net.machinemuse.powersuits.item.IModularItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
@ -130,7 +131,7 @@ public class PowerModule implements IPowerModule {
return (NBTTagCompound) defaultTag.copy(); return (NBTTagCompound) defaultTag.copy();
} }
public boolean isValidForItem(ItemStack stack) { public boolean isValidForItem(ItemStack stack, EntityPlayer player) {
if (this.validItems.contains(stack.getItem())) { if (this.validItems.contains(stack.getItem())) {
return true; return true;
} else { } else {

View file

@ -7,12 +7,12 @@ import java.util.Collection;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List; import java.util.List;
import net.machinemuse.api.ModularCommon;
import net.machinemuse.api.ModuleManager; import net.machinemuse.api.ModuleManager;
import net.machinemuse.api.MuseItemUtils; import net.machinemuse.api.MuseItemUtils;
import net.machinemuse.powersuits.common.MuseLogger; import net.machinemuse.powersuits.common.MuseLogger;
import net.machinemuse.powersuits.event.MovementManager; import net.machinemuse.powersuits.event.MovementManager;
import net.machinemuse.powersuits.item.IModularItem; import net.machinemuse.powersuits.item.IModularItem;
import net.machinemuse.powersuits.item.ModularCommon;
import net.machinemuse.powersuits.network.MusePacket; import net.machinemuse.powersuits.network.MusePacket;
import net.machinemuse.powersuits.network.packets.MusePacketPlayerUpdate; import net.machinemuse.powersuits.network.packets.MusePacketPlayerUpdate;
import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.client.entity.EntityClientPlayerMP;

View file

@ -6,10 +6,10 @@ package net.machinemuse.powersuits.tick;
import java.util.Collection; import java.util.Collection;
import java.util.EnumSet; import java.util.EnumSet;
import net.machinemuse.api.ModularCommon;
import net.machinemuse.api.MuseItemUtils; import net.machinemuse.api.MuseItemUtils;
import net.machinemuse.powersuits.common.MuseLogger; import net.machinemuse.powersuits.common.MuseLogger;
import net.machinemuse.powersuits.item.IModularItem; import net.machinemuse.powersuits.item.IModularItem;
import net.machinemuse.powersuits.item.ModularCommon;
import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;