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:
commit
0a2cb7442d
src/main
java/dan200/computercraft/shared/turtle/upgrades
resources/assets/computercraft/lua/rom
apis
help
adventure.txtalias.txtapis.txtbg.txtbit.txtbundled.txtcd.txtchangelog.txtchat.txtclear.txtcolors.txtcolours.txtcommands.txtcommandsapi.txtcopy.txtcoroutine.txtcraft.txtcredits.txtdance.txtdelete.txtdisk.txtdj.txtdrive.txtdrives.txtearth.txtedit.txteject.txtequip.txtevents.txtexcavate.txtexec.txtexit.txtfalling.txtfg.txtfs.txtgo.txtgps.txtgpsapi.txthello.txthelp.txthelpapi.txthttp.txtid.txtintro.txtio.txtkeys.txtlabel.txtlist.txtlua.txtmath.txtmkdir.txtmodems.txtmonitor.txtmonitors.txtmove.txtmultishell.txtos.txtpaint.txtpaintutils.txtparallel.txtpastebin.txtperipheral.txtperipherals.txtpocket.txtprinters.txtprogramming.txtprograms.txtreboot.txtredirection.txtrednet.txtredstone.txtredstoneapi.txtrefuel.txtrename.txtrepeat.txtrs.txtset.txtsettings.txtshell.txtshellapi.txtshutdown.txtsleep.txtspeakers.txtstring.txttable.txtterm.txttextutils.txttime.txttunnel.txtturn.txtturtle.txttype.txtunequip.txtvector.txtwget.txtwhatsnew.txtwindow.txtworkbench.txt
@ -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
Loading…
x
Reference in New Issue
Block a user