1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-07-01 01:23:30 +00:00
Commit Graph

81 Commits

Author SHA1 Message Date
SquidDev
55847460c5 Provide an API for registering custom APIs
ILuaAPI has been moved to dan200.computercraft.api.lua. One creates
a new API by registering an instance of ILuaAPIFactory. This takes an
instance of IComputerSystem and returns such an API.

IComputerSystem is an extension of IComputerAccess, with methods to
access additional information about the the computer, such as its label
and filesystem.
2017-11-19 18:23:38 +00:00
Joseph C. Sible
80ec54eaf6 Remove unnecessary code
- Remove unnecessary casts
- Use the diamond operator where possible
- Remove "throws" declarations that aren't actually thrown
- Remove unused local variables
- Remove unused imports
- Remove redundant superinterfaces
2017-09-24 01:23:29 -04:00
Daniel Ratcliffe
6c32d8a57e Merge pull request #394 from Wojbie/bugfix/Filesystem-dots-#35
Modify logic behind ... and more in file path.
2017-09-11 13:27:13 +01:00
Daniel Ratcliffe
61ff91f237 Merge pull request #316 from SquidDev-CC/feature/minecraft-1.12.2
Update to 1.12. Bam!
2017-09-10 20:52:26 +01:00
Wojbie
6aa4a385a3 Requested changes to logic behind ... in file path. 2017-09-10 17:51:29 +02:00
Wojbie
0d5397db34 Modify logic behind ... and more in file path.
Changes all equal or longer then 3 multidots setups to be treated as .
This removes other potentialy dangerus situations and brings it closer to windows in how it treats said dots.
2017-07-30 14:11:25 +02:00
Wilma456
226ae3648f Forget string 2017-07-28 15:21:15 +02:00
Wilma456
0a5155c0ff New style 2017-07-27 16:40:00 +02:00
SquidDev
d29ffed383 Java 8. Java 8. Does whatever Java 8 can.
Default methods, everywhere.
Arrow types, switch on strings.
Lambdas!
Here comes Java 8.
2017-07-25 21:10:48 +01:00
Wilma456
f28a1ba517 Fix Bugs 2017-07-15 16:41:40 +02:00
Wilma456
239a2f0d25 Better Errors for fs API 2017-07-15 16:09:29 +02:00
SquidDev
eb628e9b62 Make error messages more consistent 2017-06-13 19:33:42 +01:00
SquidDev
6ccffe9742 Refactor the filesystem and HTTP code
- Move the encoding/decoding from the Filesystem implementation to the
   individual handles.
 - Move each handle into an core.apis.handles package from the main fs
   API.
 - Move the HTTP response to inherit from these handles.
 - Allow binary handles' read function to accept a number, specifying
   how many characters to read - these will be returned as a Lua string.
 - Add readAll to binary handles
 - Allow binary handles' write function to accept a string which is
   decoded into the individual bytes.
 - Add "binary" argument to http.request and friends in order to return
   a binary handle.
 - Ensure file handles are open when reading from/writing to them.
 - Return the error message when opening a file fails.
2017-05-13 22:47:28 +01:00
ObloxCC
7f754f33bb Updated (C) from 2016 to 2017 (#229)
* Updated (C)

* Fixed Whitespace

bugs, bugs, and more bugs

* Fixed Whitespaces 1/2

* Fixed Whitespaces 2/2

* Fixed Whitespaces 3/2
2017-05-13 19:20:39 +01:00
SquidDev
2e901a063d Remove accessibility modifiers from all enums and interfaces 2017-05-07 13:35:18 +01:00
SquidDev
a2fd0b1f7f Use block comment instead of Javadoc for license 2017-05-07 13:30:10 +01:00
SquidDev
9af15d1e30 Remove some unnecessary constructs
- Replace for and while loops with for iterators
 - Remove unused casts
2017-05-07 13:29:52 +01:00
SquidDev
dc5517303f Add @Nullable and @NonNull annotations 2017-05-07 13:29:49 +01:00
Lignum
988e9f10db
Fix compiler error 2017-05-05 19:13:52 +02:00
Lignum
b0ac48b9a3
Use some sweet tricks to have a weak set to store open files 2017-05-05 19:11:59 +02:00
Daniel Ratcliffe
09215daa03 FileSystem uses a WeakHashMap to store it's open file handles
This means if lua code forgets to free a handle, the java GC will still
be able to collect the stream (andclose the file in the finaliser in the
process)
2017-05-05 00:54:24 +01:00
Daniel Ratcliffe
2436d813e6 Treat a maximumFilesOpen values of 0 as unlimited 2017-05-05 00:54:23 +01:00
Daniel Ratcliffe
f99caed4f2 Merge pull request #169 from Lignum/fd-limit
Configurable file descriptor limit
2017-05-04 22:12:50 +01:00
Lignum
30d191df0b
Avoid casts with generic type args 2017-05-04 23:00:02 +02:00
SquidDev
72dfb0e7cc Sort the result of FileSystem.list
This ensures fs.list and fs.find always return the same result.

For some reason, the ComputerCraft jar was being packaged differently on
some platforms, causing files to appear in a different order. As
computers depend on the colors API being loaded before colours, we need
to ensure that they are loaded in a consistent order.
2017-05-03 22:29:57 +01:00
Lignum
6ff9db89cc
Fix file handle leak 2017-05-02 00:44:33 +02:00
Lignum
2a1e110a65
Make the file descriptor limit configurable 2017-05-02 00:17:16 +02:00
Lignum
2d0690e625
Add file descriptor limit 2017-05-02 00:05:42 +02:00
SquidDev
b3760f58e6 Performance improvements to fs.find
If the path includes no wildcards then it just checks it exists.
If it does, instead of scanning the entire tree, it works out the last
directory before the wildcard and starts scanning from there.

Closes #89
2017-05-01 16:45:41 +01:00
Daniel Ratcliffe
b202b7b8a5 Converted tabs to spaces throughout 2017-05-01 15:48:44 +01:00
Daniel Ratcliffe
e85cdacbc5 ComputerCraft 1.79 initial upload
Added the complete source code to ComputerCraft 1.79 for Minecraft
1.8.9, plus newly written README and LICENSE files for the open source
release.
2017-05-01 14:32:39 +01:00