mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
The growth ring now only uses RF when growing stuff
This commit is contained in:
parent
493be37ede
commit
fbba25d5ad
2 changed files with 19 additions and 12 deletions
|
@ -47,7 +47,7 @@ public class ItemGrowthRing extends ItemEnergy{
|
||||||
EntityPlayer player = (EntityPlayer)entity;
|
EntityPlayer player = (EntityPlayer)entity;
|
||||||
ItemStack equipped = player.getCurrentEquippedItem();
|
ItemStack equipped = player.getCurrentEquippedItem();
|
||||||
|
|
||||||
int energyUse = 550;
|
int energyUse = 50;
|
||||||
if(equipped != null && equipped == stack && this.getEnergyStored(stack) >= energyUse){
|
if(equipped != null && equipped == stack && this.getEnergyStored(stack) >= energyUse){
|
||||||
ArrayList<Position> blocks = new ArrayList<Position>();
|
ArrayList<Position> blocks = new ArrayList<Position>();
|
||||||
|
|
||||||
|
@ -76,6 +76,7 @@ public class ItemGrowthRing extends ItemEnergy{
|
||||||
//Fertilizing the Blocks
|
//Fertilizing the Blocks
|
||||||
if(!blocks.isEmpty()){
|
if(!blocks.isEmpty()){
|
||||||
for(int i = 0; i < 45; i++){
|
for(int i = 0; i < 45; i++){
|
||||||
|
if(this.getEnergyStored(stack) >= energyUse){
|
||||||
Position pos = blocks.get(Util.RANDOM.nextInt(blocks.size()));
|
Position pos = blocks.get(Util.RANDOM.nextInt(blocks.size()));
|
||||||
|
|
||||||
int metaBefore = pos.getMetadata(world);
|
int metaBefore = pos.getMetadata(world);
|
||||||
|
@ -85,6 +86,14 @@ public class ItemGrowthRing extends ItemEnergy{
|
||||||
if(pos.getMetadata(world) != metaBefore){
|
if(pos.getMetadata(world) != metaBefore){
|
||||||
world.playAuxSFX(2005, pos.getX(), pos.getY(), pos.getZ(), 0);
|
world.playAuxSFX(2005, pos.getX(), pos.getY(), pos.getZ(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!player.capabilities.isCreativeMode){
|
||||||
|
this.extractEnergy(stack, energyUse, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,11 +102,6 @@ public class ItemGrowthRing extends ItemEnergy{
|
||||||
else{
|
else{
|
||||||
stack.stackTagCompound.setInteger("WaitTime", waitTime+1);
|
stack.stackTagCompound.setInteger("WaitTime", waitTime+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Use Energy every tick
|
|
||||||
if(!player.capabilities.isCreativeMode){
|
|
||||||
this.extractEnergy(stack, energyUse, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,9 @@ public class ItemMagnetRing extends ItemEnergy{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue