mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-07-04 02:52:56 +00:00
Merge branch 'master' into fix-speakers
This commit is contained in:
commit
0a2cb7442d
@ -5,13 +5,23 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
package dan200.computercraft.shared.turtle.upgrades;
|
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.material.Material;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.item.Item;
|
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.ResourceLocation;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
public class TurtleShovel extends TurtleTool
|
public class TurtleShovel extends TurtleTool
|
||||||
{
|
{
|
||||||
public TurtleShovel( ResourceLocation id, int legacyId, String adjective, Item item )
|
public TurtleShovel( ResourceLocation id, int legacyId, String adjective, Item item )
|
||||||
@ -41,4 +51,20 @@ public class TurtleShovel extends TurtleTool
|
|||||||
}
|
}
|
||||||
return false;
|
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 )
|
sPath = fs.combine( sPath, _sTopic )
|
||||||
if fs.exists( sPath ) and not fs.isDir( sPath ) then
|
if fs.exists( sPath ) and not fs.isDir( sPath ) then
|
||||||
return sPath
|
return sPath
|
||||||
|
elseif fs.exists( sPath..".txt" ) and not fs.isDir( sPath..".txt" ) then
|
||||||
|
return sPath..".txt"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -35,6 +37,9 @@ function topics()
|
|||||||
for n,sFile in pairs( tList ) do
|
for n,sFile in pairs( tList ) do
|
||||||
if string.sub( sFile, 1, 1 ) ~= "." then
|
if string.sub( sFile, 1, 1 ) ~= "." then
|
||||||
if not fs.isDir( fs.combine( sPath, sFile ) ) 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
|
tItems[ sFile ] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user