more repackaging, changed default joule ratio to be BC joules
This commit is contained in:
parent
e6e075dc74
commit
17bf507c74
16 changed files with 52 additions and 29 deletions
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import net.machinemuse.general.gui.MuseIcon;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
|
@ -14,7 +15,7 @@ public interface IPowerModule {
|
|||
|
||||
public abstract String getCategory();
|
||||
|
||||
public abstract boolean isValidForItem(ItemStack stack);
|
||||
public abstract boolean isValidForItem(ItemStack stack, EntityPlayer player);
|
||||
|
||||
public abstract String getName();
|
||||
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package net.machinemuse.powersuits.item;
|
||||
package net.machinemuse.api;
|
||||
|
||||
import icbm.api.IExplosive;
|
||||
|
||||
import java.util.LinkedList;
|
||||
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.powersuits.common.Config;
|
||||
import net.machinemuse.powersuits.item.ItemPowerTool;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
|
@ -9,7 +9,6 @@ import java.util.Set;
|
|||
import net.machinemuse.general.MuseMathUtils;
|
||||
import net.machinemuse.powersuits.item.IModularItem;
|
||||
import net.machinemuse.powersuits.item.ItemComponent;
|
||||
import net.machinemuse.powersuits.item.ModularCommon;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
@ -25,7 +24,7 @@ public class MuseItemUtils {
|
|||
EntityPlayer player, ItemStack stack) {
|
||||
List<IPowerModule> validModules = new ArrayList();
|
||||
for (IPowerModule module : ModuleManager.getAllModules()) {
|
||||
if (module.isValidForItem(stack)) {
|
||||
if (module.isValidForItem(stack, player)) {
|
||||
validModules.add(module);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
}
|
|
@ -2,10 +2,10 @@ package net.machinemuse.general.gui.clickable;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import net.machinemuse.api.ModularCommon;
|
||||
import net.machinemuse.general.MuseRenderer;
|
||||
import net.machinemuse.general.geometry.Colour;
|
||||
import net.machinemuse.general.geometry.MusePoint2D;
|
||||
import net.machinemuse.powersuits.item.ModularCommon;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class ClickableSlider extends Clickable {
|
||||
|
|
|
@ -11,6 +11,7 @@ import net.machinemuse.api.MuseItemUtils;
|
|||
import net.machinemuse.general.MuseRenderer;
|
||||
import net.machinemuse.general.geometry.Colour;
|
||||
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.ClickableModule;
|
||||
|
||||
|
@ -110,8 +111,11 @@ public class ModuleSelectionFrame extends ScrollableFrame {
|
|||
} else {
|
||||
ModuleSelectionSubFrame frame = new ModuleSelectionSubFrame(
|
||||
category,
|
||||
new MusePoint2D(border.left() + 4, border.top() + 4 + 30 * categories.size()),
|
||||
new MusePoint2D(border.right() - 4, border.bottom() + 34 + 30 * categories.size()));
|
||||
new MuseRect(
|
||||
border.left() + 4,
|
||||
border.top() + 4 + 30 * categories.size(),
|
||||
border.right() - 4,
|
||||
border.bottom() + 34 + 30 * categories.size()));
|
||||
|
||||
categories.put(category, frame);
|
||||
return frame;
|
||||
|
|
|
@ -6,32 +6,30 @@ import java.util.List;
|
|||
import net.machinemuse.api.IPowerModule;
|
||||
import net.machinemuse.general.MuseRenderer;
|
||||
import net.machinemuse.general.geometry.MusePoint2D;
|
||||
import net.machinemuse.general.geometry.MuseRect;
|
||||
import net.machinemuse.general.gui.clickable.ClickableModule;
|
||||
|
||||
public class ModuleSelectionSubFrame {
|
||||
protected List<ClickableModule> moduleButtons;
|
||||
protected MusePoint2D topleft;
|
||||
protected MusePoint2D bottomright;
|
||||
protected MuseRect border;
|
||||
protected String category;
|
||||
|
||||
public ModuleSelectionSubFrame(String category, MusePoint2D topleft,
|
||||
MusePoint2D bottomright) {
|
||||
public ModuleSelectionSubFrame(String category, MuseRect border) {
|
||||
this.category = category;
|
||||
this.topleft = topleft;
|
||||
this.bottomright = bottomright;
|
||||
this.border = border;
|
||||
this.moduleButtons = new ArrayList<ClickableModule>();
|
||||
}
|
||||
|
||||
public void draw() {
|
||||
MuseRenderer.drawString(this.category, topleft.x(), topleft.y());
|
||||
MuseRenderer.drawString(this.category, border.left(), border.top());
|
||||
for (ClickableModule clickie : moduleButtons) {
|
||||
clickie.draw();
|
||||
}
|
||||
}
|
||||
|
||||
public ClickableModule addModule(IPowerModule module) {
|
||||
double x = topleft.x() + 8 + 16 * moduleButtons.size();
|
||||
double y = topleft.y() + 16;
|
||||
double x = border.left() + 8 + 16 * moduleButtons.size();
|
||||
double y = border.top() + 16;
|
||||
ClickableModule clickie = new ClickableModule(module, new MusePoint2D(x, y));
|
||||
this.moduleButtons.add(clickie);
|
||||
return clickie;
|
||||
|
|
|
@ -4,12 +4,12 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
|
||||
import net.machinemuse.api.IPowerModule;
|
||||
import net.machinemuse.api.ModularCommon;
|
||||
import net.machinemuse.api.ModuleManager;
|
||||
import net.machinemuse.general.MuseStringUtils;
|
||||
import net.machinemuse.general.gui.MuseIcon;
|
||||
import net.machinemuse.powersuits.item.IModularItem;
|
||||
import net.machinemuse.powersuits.item.ItemComponent;
|
||||
import net.machinemuse.powersuits.item.ModularCommon;
|
||||
import net.machinemuse.powersuits.powermodule.PowerModule;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
@ -414,7 +414,7 @@ public class Config {
|
|||
.addInstallCost(copyAndResize(ItemComponent.servoMotor, 2));
|
||||
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.")
|
||||
.addInstallCost(copyAndResize(ItemComponent.laserHologram, 1))
|
||||
.setToggleable(true)
|
||||
|
|
|
@ -3,11 +3,11 @@ package net.machinemuse.powersuits.common;
|
|||
import java.lang.reflect.Field;
|
||||
import java.util.Arrays;
|
||||
|
||||
import net.machinemuse.api.ModularCommon;
|
||||
import net.machinemuse.api.ModuleManager;
|
||||
import net.machinemuse.general.gui.MuseIcon;
|
||||
import net.machinemuse.powersuits.item.IModularItem;
|
||||
import net.machinemuse.powersuits.item.ItemComponent;
|
||||
import net.machinemuse.powersuits.item.ModularCommon;
|
||||
import net.machinemuse.powersuits.powermodule.PowerModule;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -66,11 +66,11 @@ public class ModCompatability {
|
|||
}
|
||||
|
||||
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() {
|
||||
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) {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package net.machinemuse.powersuits.event;
|
||||
|
||||
import net.machinemuse.api.ModularCommon;
|
||||
import net.machinemuse.api.MuseItemUtils;
|
||||
import net.machinemuse.api.ModuleManager;
|
||||
import net.machinemuse.powersuits.item.IModularItem;
|
||||
import net.machinemuse.powersuits.item.ItemPowerTool;
|
||||
import net.machinemuse.powersuits.item.ModularCommon;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
|
|
@ -3,10 +3,10 @@ package net.machinemuse.powersuits.event;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.machinemuse.api.ModularCommon;
|
||||
import net.machinemuse.api.MuseItemUtils;
|
||||
import net.machinemuse.api.ModuleManager;
|
||||
import net.machinemuse.powersuits.item.ItemPowerArmor;
|
||||
import net.machinemuse.powersuits.item.ModularCommon;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
|
|
|
@ -5,6 +5,7 @@ import icbm.api.IExplosive;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.machinemuse.api.ModularCommon;
|
||||
import net.machinemuse.api.MuseItemUtils;
|
||||
import net.machinemuse.api.ModuleManager;
|
||||
import net.machinemuse.general.MuseStringUtils;
|
||||
|
|
|
@ -5,6 +5,7 @@ import icbm.api.IExplosive;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.machinemuse.api.ModularCommon;
|
||||
import net.machinemuse.api.MuseItemUtils;
|
||||
import net.machinemuse.api.ModuleManager;
|
||||
import net.machinemuse.general.MuseStringUtils;
|
||||
|
|
|
@ -14,6 +14,7 @@ import net.machinemuse.api.MuseItemUtils;
|
|||
import net.machinemuse.general.gui.MuseIcon;
|
||||
import net.machinemuse.powersuits.common.Config;
|
||||
import net.machinemuse.powersuits.item.IModularItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
|
@ -130,7 +131,7 @@ public class PowerModule implements IPowerModule {
|
|||
return (NBTTagCompound) defaultTag.copy();
|
||||
}
|
||||
|
||||
public boolean isValidForItem(ItemStack stack) {
|
||||
public boolean isValidForItem(ItemStack stack, EntityPlayer player) {
|
||||
if (this.validItems.contains(stack.getItem())) {
|
||||
return true;
|
||||
} else {
|
||||
|
|
|
@ -7,12 +7,12 @@ import java.util.Collection;
|
|||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import net.machinemuse.api.ModularCommon;
|
||||
import net.machinemuse.api.ModuleManager;
|
||||
import net.machinemuse.api.MuseItemUtils;
|
||||
import net.machinemuse.powersuits.common.MuseLogger;
|
||||
import net.machinemuse.powersuits.event.MovementManager;
|
||||
import net.machinemuse.powersuits.item.IModularItem;
|
||||
import net.machinemuse.powersuits.item.ModularCommon;
|
||||
import net.machinemuse.powersuits.network.MusePacket;
|
||||
import net.machinemuse.powersuits.network.packets.MusePacketPlayerUpdate;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
|
|
|
@ -6,10 +6,10 @@ package net.machinemuse.powersuits.tick;
|
|||
import java.util.Collection;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.machinemuse.api.ModularCommon;
|
||||
import net.machinemuse.api.MuseItemUtils;
|
||||
import net.machinemuse.powersuits.common.MuseLogger;
|
||||
import net.machinemuse.powersuits.item.IModularItem;
|
||||
import net.machinemuse.powersuits.item.ModularCommon;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
|
|
Loading…
Reference in a new issue