1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-04-21 18:23:14 +00:00

Merge branch 'master' into fix-speakers

This commit is contained in:
Lignum 2017-05-20 13:23:12 +02:00
commit 0a2cb7442d
No known key found for this signature in database
GPG Key ID: E4DE8F54CA0912BA
115 changed files with 33 additions and 2 deletions

@ -5,13 +5,23 @@
*/
package dan200.computercraft.shared.turtle.upgrades;
import dan200.computercraft.api.turtle.ITurtleAccess;
import dan200.computercraft.api.turtle.TurtleCommandResult;
import dan200.computercraft.api.turtle.TurtleSide;
import dan200.computercraft.api.turtle.TurtleVerb;
import dan200.computercraft.shared.turtle.core.TurtlePlaceCommand;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item;
import net.minecraft.util.math.BlockPos;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
public class TurtleShovel extends TurtleTool
{
public TurtleShovel( ResourceLocation id, int legacyId, String adjective, Item item )
@ -41,4 +51,20 @@ public class TurtleShovel extends TurtleTool
}
return false;
}
@Nonnull
@Override
public TurtleCommandResult useTool( @Nonnull ITurtleAccess turtle, @Nonnull TurtleSide side, @Nonnull TurtleVerb verb, @Nonnull EnumFacing direction )
{
if( verb == TurtleVerb.Dig )
{
ItemStack shovel = m_item.copy();
ItemStack remainder = TurtlePlaceCommand.deploy( shovel, turtle, direction, null, null );
if( remainder != shovel )
{
return TurtleCommandResult.success();
}
}
return super.useTool( turtle, side, verb, direction );
}
}

@ -15,6 +15,8 @@ function lookup( _sTopic )
sPath = fs.combine( sPath, _sTopic )
if fs.exists( sPath ) and not fs.isDir( sPath ) then
return sPath
elseif fs.exists( sPath..".txt" ) and not fs.isDir( sPath..".txt" ) then
return sPath..".txt"
end
end
@ -35,6 +37,9 @@ function topics()
for n,sFile in pairs( tList ) do
if string.sub( sFile, 1, 1 ) ~= "." then
if not fs.isDir( fs.combine( sPath, sFile ) ) then
if #sFile > 4 and sFile:sub(-4) == ".txt" then
sFile = sFile:sub(1,-5)
end
tItems[ sFile ] = true
end
end

Some files were not shown because too many files have changed in this diff Show More