Merge pull request #130 from ZeldoKavira/master

Closes #60
This commit is contained in:
Krapht 2012-07-26 04:07:31 -07:00
commit c51c68b2ba
3 changed files with 37 additions and 1 deletions

View file

@ -376,7 +376,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
IPowerReceptor receptor = (IPowerReceptor) tile;
IPowerProvider provider = receptor.getPowerProvider();
return provider != null && provider.getClass().equals(PneumaticPowerProvider.class);
return provider != null && provider.getClass().getSuperclass().equals(PowerProvider.class);
}
return false;

View file

@ -12,15 +12,24 @@ package buildcraft.factory;
import java.util.ArrayList;
import buildcraft.BuildCraftFactory;
import buildcraft.mod_BuildCraftEnergy;
import buildcraft.api.APIProxy;
import buildcraft.api.core.Orientations;
import buildcraft.api.core.Position;
import buildcraft.api.tools.IToolWrench;
import buildcraft.core.Box;
import buildcraft.core.DefaultProps;
import buildcraft.core.GuiIds;
import buildcraft.core.IItemPipe;
import buildcraft.core.Utils;
import buildcraft.energy.EngineIron;
import buildcraft.energy.EngineStone;
import buildcraft.energy.TileEngine;
import buildcraft.factory.BlockMachineRoot;
import net.minecraft.src.EntityLiving;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
import net.minecraft.src.TileEntity;
@ -195,6 +204,27 @@ public class BlockQuarry extends BlockMachineRoot implements ITextureProvider {
super.onBlockRemoval(world, i, j, k);
}
@Override
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) {
TileQuarry tile = (TileQuarry) world.getBlockTileEntity(i, j, k);
// Drop through if the player is sneaking
if (entityplayer.isSneaking())
return false;
// Restart the quarry if its a wrench
Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer.getCurrentEquippedItem().getItem() : null;
if (equipped instanceof IToolWrench && ((IToolWrench) equipped).canWrench(entityplayer, i, j, k)) {
tile.reinitalize();
((IToolWrench) equipped).wrenchUsed(entityplayer, i, j, k);
return true;
}
return false;
}
@Override
public String getTextureFile() {
return DefaultProps.TEXTURE_BLOCKS;

View file

@ -618,6 +618,12 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, I
sendNetworkUpdate();
}
public void reinitalize() {
builderDone = false;
initializeBluePrintBuilder();
isDigging = true;
}
@Override
public void setPowerProvider(IPowerProvider provider) {
provider = powerProvider;