aboutsummaryrefslogtreecommitdiff
path: root/src/Java/miscutil/core/item
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/miscutil/core/item')
-rw-r--r--src/Java/miscutil/core/item/general/ItemCloakingDevice.java4
-rw-r--r--src/Java/miscutil/core/item/general/ItemHealingDevice.java27
-rw-r--r--src/Java/miscutil/core/item/tool/staballoy/StaballoyAxe.java42
3 files changed, 39 insertions, 34 deletions
diff --git a/src/Java/miscutil/core/item/general/ItemCloakingDevice.java b/src/Java/miscutil/core/item/general/ItemCloakingDevice.java
index 64e45f34b9..b54bb08a87 100644
--- a/src/Java/miscutil/core/item/general/ItemCloakingDevice.java
+++ b/src/Java/miscutil/core/item/general/ItemCloakingDevice.java
@@ -27,7 +27,7 @@ public class ItemCloakingDevice extends Item implements IElectricItem, IElectric
private final String unlocalizedName = "personalCloakingDevice";
private final ItemStack thisStack;
- private final static int maxValueEU = 100000000;
+ private final static int maxValueEU = 8196*20*5*60;
protected double chargeEU = 0;
public ItemCloakingDevice(){
@@ -131,7 +131,7 @@ public class ItemCloakingDevice extends Item implements IElectricItem, IElectric
list.add("");
list.add(EnumChatFormatting.GOLD+"IC2/EU Information"+EnumChatFormatting.GRAY);
list.add(EnumChatFormatting.GRAY+"Tier: ["+EnumChatFormatting.YELLOW+getTier(thisStack)+EnumChatFormatting.GRAY+"] Transfer Limit: ["+EnumChatFormatting.YELLOW+getTransferLimit(thisStack)+EnumChatFormatting.GRAY +"Eu/t]");
- list.add(EnumChatFormatting.GRAY+"Current Power: ["+EnumChatFormatting.YELLOW+(long) getCharge(stack)+EnumChatFormatting.GRAY+"Eu]");
+ list.add(EnumChatFormatting.GRAY+"Current Power: ["+EnumChatFormatting.YELLOW+(long) getCharge(stack)+EnumChatFormatting.GRAY+"Eu] ["+EnumChatFormatting.YELLOW+MathUtils.findPercentage(getCharge(stack), getMaxCharge(stack))+EnumChatFormatting.GRAY +"%]");
list.add(EnumChatFormatting.GRAY+"Time Remaining: ["+EnumChatFormatting.YELLOW+secondsLeft(stack)+ EnumChatFormatting.GRAY +" seconds]");
super.addInformation(stack, aPlayer, list, bool);
}
diff --git a/src/Java/miscutil/core/item/general/ItemHealingDevice.java b/src/Java/miscutil/core/item/general/ItemHealingDevice.java
index 65c0dc2626..385ab06fdd 100644
--- a/src/Java/miscutil/core/item/general/ItemHealingDevice.java
+++ b/src/Java/miscutil/core/item/general/ItemHealingDevice.java
@@ -8,6 +8,7 @@ import java.util.List;
import miscutil.core.creative.AddToCreativeTab;
import miscutil.core.lib.CORE;
+import miscutil.core.util.Utils;
import miscutil.core.util.item.UtilsItems;
import miscutil.core.util.math.MathUtils;
import net.minecraft.entity.Entity;
@@ -25,7 +26,7 @@ public class ItemHealingDevice extends Item implements IElectricItem, IElectricI
private final String unlocalizedName = "personalHealingDevice";
private final ItemStack thisStack;
- private final static int maxValueEU = 100000000;
+ private final static int maxValueEU = 1000000000;
protected double chargeEU = 0;
public ItemHealingDevice(){
@@ -88,18 +89,18 @@ public class ItemHealingDevice extends Item implements IElectricItem, IElectricI
@Override
public int getTier(ItemStack itemStack) {
- return 4;
+ return 5;
}
@Override
public double getTransferLimit(ItemStack itemStack) {
- return 8196;
+ return 32784;
}
@Override
public String getItemStackDisplayName(ItemStack p_77653_1_) {
- return (EnumChatFormatting.WHITE+"Personal Healing NanoBooster"+EnumChatFormatting.GRAY);
+ return (EnumChatFormatting.BLUE+"Personal Healing NanoBooster"+EnumChatFormatting.RESET);
}
@Override
@@ -118,8 +119,8 @@ public class ItemHealingDevice extends Item implements IElectricItem, IElectricI
public double secondsLeft(ItemStack stack){
double r = 0;
- r = getCharge(stack)/(8196*20);
- return MathUtils.decimalRounding(r);
+ r = getCharge(stack)/(1638400/4);
+ return (int) r;
}
@Override
@@ -130,7 +131,7 @@ public class ItemHealingDevice extends Item implements IElectricItem, IElectricI
list.add("");
list.add(EnumChatFormatting.GOLD+"IC2/EU Information"+EnumChatFormatting.GRAY);
list.add(EnumChatFormatting.GRAY+"Tier: ["+EnumChatFormatting.YELLOW+getTier(thisStack)+EnumChatFormatting.GRAY+"] Transfer Limit: ["+EnumChatFormatting.YELLOW+getTransferLimit(thisStack)+EnumChatFormatting.GRAY +"Eu/t]");
- list.add(EnumChatFormatting.GRAY+"Current Power: ["+EnumChatFormatting.YELLOW+(long) getCharge(stack)+EnumChatFormatting.GRAY+"Eu]");
+ list.add(EnumChatFormatting.GRAY+"Current Power: ["+EnumChatFormatting.YELLOW+(long) getCharge(stack)+EnumChatFormatting.GRAY+"Eu] ["+EnumChatFormatting.YELLOW+MathUtils.findPercentage(getCharge(stack), getMaxCharge(stack))+EnumChatFormatting.GRAY +"%]");
list.add(EnumChatFormatting.GRAY+"Uses Remaining: ["+EnumChatFormatting.YELLOW+secondsLeft(stack)+ EnumChatFormatting.GRAY +"]");
super.addInformation(stack, aPlayer, list, bool);
}
@@ -211,11 +212,15 @@ public class ItemHealingDevice extends Item implements IElectricItem, IElectricI
@Override //TODO
public void onWornTick(ItemStack arg0, EntityLivingBase arg1) {
if (!arg1.worldObj.isRemote){
- if (getCharge(arg0) >= 1638400){
- if (arg1.getHealth() < arg1.getMaxHealth()-2){
- arg1.heal(2);
+ if (getCharge(arg0) >= 1638400/4){
+ if (arg1.getHealth() < arg1.getMaxHealth()){
+ float rx = arg1.getMaxHealth()-arg1.getHealth();
+ Utils.LOG_INFO("rx:"+rx);
+ arg1.heal(rx*2);
+ discharge(arg0, (1638400/4)*rx, 6, true, true, false);
+ Utils.messagePlayer((EntityPlayer) arg1, "Your NanoBooster Whirs! Leaving you feeling stronger. It Healed "+rx+" hp.");
+ Utils.messagePlayer((EntityPlayer) arg1, "You check it's remaining uses, it has "+secondsLeft(arg0)+".");
}
- discharge(arg0, 1638400, 6, true, true, false);
}
}
}
diff --git a/src/Java/miscutil/core/item/tool/staballoy/StaballoyAxe.java b/src/Java/miscutil/core/item/tool/staballoy/StaballoyAxe.java
index 0e66f7aae3..667c57fddc 100644
--- a/src/Java/miscutil/core/item/tool/staballoy/StaballoyAxe.java
+++ b/src/Java/miscutil/core/item/tool/staballoy/StaballoyAxe.java
@@ -82,7 +82,7 @@ public class StaballoyAxe extends ItemAxe{
private int check(World par1World, int x, int y, int z, int xo, int yo,int zo) {
int f=0;
- int o=x+z*40+y*400;
+ int o=x+z*20+y*400;
if (tre[o]==needcheck){
tre[o]=ignore;
Block bit = par1World.getBlock(x+xo, y+yo, z+zo);
@@ -107,18 +107,18 @@ public class StaballoyAxe extends ItemAxe{
boolean f;
for (f=true;f==true;){
f=false;
- for (int y=-10;y<110;y++)
- for(int z=0;z<40;z++)
- for(int x=0;x<40;x++){
+ for (int y=0;y<80;y++)
+ for(int z=0;z<20;z++)
+ for(int x=0;x<20;x++){
int r=check(par1World,x,y,z,xo,yo,zo);
if (r==3) return 3;
if (r==2) return 2;
if (r==1) f=true;
}
- for (int y=109;y>=-10;y--)
- for(int z=39;z>=0;z--)
- for(int x=39;x>=0;x--){
+ for (int y=79;y>=0;y--)
+ for(int z=19;z>=0;z--)
+ for(int x=19;x>=0;x--){
int r=check(par1World,x,y,z,xo,yo,zo);
if (r==2) return 3;
if (r==2) return 2;
@@ -130,11 +130,11 @@ public class StaballoyAxe extends ItemAxe{
private int check2(World par1World, int x, int y, int z, int xo, int yo,int zo) {
int f=0;
- int o=x+z*40+y*400;
+ int o=x+z*20+y*400;
if (tre[o]==needcheck){
tre[o]=ignore;
Block bit = par1World.getBlock(x+xo, y+yo, z+zo);
- if (bit instanceof BlockLog || (bit.getUnlocalizedName().toLowerCase().contains("log")) || (bit.getUnlocalizedName().toLowerCase().contains("wood"))){
+ if (bit instanceof BlockLog){
f=1;
tre[o]=harvest;
//if (bit instanceof BlockLog){
@@ -156,18 +156,18 @@ public class StaballoyAxe extends ItemAxe{
boolean f;
for (f=true;f==true;){
f=false;
- for (int y=-10;y<110;y++)
- for(int z=0;z<40;z++)
- for(int x=0;x<40;x++){
+ for (int y=0;y<80;y++)
+ for(int z=0;z<20;z++)
+ for(int x=0;x<20;x++){
int r=check2(par1World,x,y,z,xo,yo,zo);
if (r==3) return 3;
if (r==2) return 2;
if (r==1) f=true;
}
- for (int y=109;y>=-10;y--)
- for(int z=39;z>=0;z--)
- for(int x=39;x>=0;x--){
+ for (int y=79;y>=0;y--)
+ for(int z=19;z>=0;z--)
+ for(int x=19;x>=0;x--){
int r=check2(par1World,x,y,z,xo,yo,zo);
if (r==2) return 3;
if (r==2) return 2;
@@ -178,15 +178,15 @@ public class StaballoyAxe extends ItemAxe{
}
public void exploadTree(World par1World,int xo,int yo,int zo, EntityPlayer plr){
- for (int y=-10;y<110;y++)
- for(int z=0;z<40;z++)
- for(int x=0;x<40;x++){
- int o=x+z*40+y*400;
+ for (int y=0;y<80;y++)
+ for(int z=0;z<20;z++)
+ for(int x=0;x<20;x++){
+ int o=x+z*20+y*400;
if (tre[o]==harvest){
Block bit = par1World.getBlock(x+xo, y+yo, z+zo);
int met = par1World.getBlockMetadata(x+xo, y+yo, z+zo);
- if ((bit instanceof BlockLog)||(bit instanceof BlockLeavesBase) || (bit.getUnlocalizedName().toLowerCase().contains("log")) || (bit.getUnlocalizedName().toLowerCase().contains("wood"))){
+ if ((bit instanceof BlockLog)||(bit instanceof BlockLeavesBase) || (bit.getUnlocalizedName().toLowerCase().contains("log")) || (bit.getUnlocalizedName().toLowerCase().contains("wood"))){
bit.harvestBlock(par1World, plr, x+xo, y+yo, z+zo,met);
par1World.setBlockToAir(x+xo, y+yo, z+zo);
}
@@ -244,7 +244,7 @@ public class StaballoyAxe extends ItemAxe{
}
}
- if (bit instanceof BlockLog || (bit.getUnlocalizedName().toLowerCase().contains("log")) || (bit.getUnlocalizedName().toLowerCase().contains("wood"))){
+ if (bit instanceof BlockLog || (bit.getUnlocalizedName().toLowerCase().contains("log")) || (bit.getUnlocalizedName().toLowerCase().contains("wood"))){
//LoonTools.log("cutting tree @ "+x+" "+y+" "+z+" ");
for (int n=0;n<32000;n++) tre[n]=unchecked;
int met = wld.getBlockMetadata(x, y, z);