Made directional breaker need energy in pulse mode.

Duh.
This commit is contained in:
Ellpeck 2016-05-05 13:22:58 +02:00
parent 5f3e8fc748
commit b3729703b7

View file

@ -26,7 +26,6 @@ import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implements IEnergyReceiver, IEnergySaver, IRedstoneToggle{ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implements IEnergyReceiver, IEnergySaver, IRedstoneToggle{
@ -62,7 +61,6 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem
super.updateEntity(); super.updateEntity();
if(!this.worldObj.isRemote){ if(!this.worldObj.isRemote){
if(!this.isRedstonePowered && !this.activateOnceWithSignal){ if(!this.isRedstonePowered && !this.activateOnceWithSignal){
if(this.storage.getEnergyStored() >= ENERGY_USE*RANGE){
if(this.currentTime > 0){ if(this.currentTime > 0){
this.currentTime--; this.currentTime--;
if(this.currentTime <= 0){ if(this.currentTime <= 0){
@ -73,7 +71,6 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem
this.currentTime = 15; this.currentTime = 15;
} }
} }
}
if(this.storage.getEnergyStored() != this.lastEnergy && this.sendUpdateWithInterval()){ if(this.storage.getEnergyStored() != this.lastEnergy && this.sendUpdateWithInterval()){
this.lastEnergy = this.storage.getEnergyStored(); this.lastEnergy = this.storage.getEnergyStored();
@ -82,6 +79,7 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem
} }
private void doWork(){ private void doWork(){
if(this.storage.getEnergyStored() >= ENERGY_USE*RANGE){
EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, this.worldObj)); EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, this.worldObj));
for(int i = 0; i < RANGE; i++){ for(int i = 0; i < RANGE; i++){
@ -107,6 +105,7 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem
} }
} }
} }
}
@Override @Override
public boolean isItemValidForSlot(int i, ItemStack stack){ public boolean isItemValidForSlot(int i, ItemStack stack){