1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-15 22:17:39 +00:00

Compare commits

..

122 Commits

Author SHA1 Message Date
Jonathan Coates
edf372a695 Merge branch 'mc-1.16.x' into mc-1.18.x 2023-07-07 00:02:42 +01:00
Jonathan Coates
aa89e51639 Bump CC:T to 1.101.3
0/10, would not recommend.
2023-07-06 23:54:44 +01:00
Jonathan Coates
7436447a6e Several command permission fixes
- Attach permission checks to the first argument (so the literal
   command name) rather than the last argument. This fixes commands
   showing up when they shouldn't.

 - HelpingArgumentBuilder now inherits permissions of its leaf nodes.
   This only really impacts the "track" subcommand.

 - Don't autocomplete the computer selector for the "queue" subcommand.
   As everyone has permission for this command, it's possible to find
   all computer ids and labels in the world.

   I'm in mixed minds about this, but don't think this is an exploit -
   computer ids/labels are sent to in-range players so shouldn't be
   considered secret - but worth patching none-the-less.
2023-07-06 23:41:23 +01:00
Jonathan Coates
f629831b12 Tighten up the $private HTTP rule
- Block multicast and the fd00::/8 address ranges.
 - Block several cloud metadata providers which sit outside the
   standard address ranges.
2023-07-06 23:27:17 +01:00
Jonathan Coates
f7fdb6e729 Backport a couple of ROM commits
- Improve REPL's handling of expressions
   (655d5aeca8)

 - Some tiny optimisations to the window API
   (4accda6b8e)

 - Be lazy in reporting errors in the lexer
   (54ab98473f)

 - Update lua.lua require logic.
   (88f0c44152)
2023-07-06 23:15:57 +01:00
Jonathan Coates
db2616d1c0 Don't (metaphorically) explode on null explosions
Closes #1423.
2023-05-03 23:38:12 +01:00
Jonathan Coates
c0f982dc97 Use correct model for the turtle modem
Introduced in 0c3de1087e, so should only
affect 1.16.5 and 1.18.2.

Fixes #1426
2023-05-03 23:34:22 +01:00
Jonathan Coates
2a9f35de5e Backport several ROM/Lua commits
- Fix GPS returning nan on duplicate positions.
 - Distinguish between all parsers passing and failing.
 - Improve several comma related parse errors.
 - Ignore metatables in textutils.serialize.
 - Detect common audio containers in "speaker".

Co-authored-by: Wojbie <Wojbie@gmail.com>
2023-05-03 23:26:44 +01:00
Jonathan Coates
0fce3212a3 Distinguish between all parsers passing and failing
Given an input like f(x), which is both a valid statement and
expression, both parsers would accept the whole input. However, this was
treated the same as both parsers rejecting the input, resulting in a
crash when trying to print the error.

We now return immediately when any parser accepts the input.

Fixes #1354
2023-03-11 22:45:50 +00:00
Jonathan Coates
652f954886 Merge pull request #1352 from MCJack123/lets-encrypt
Add certificate workaround for Let's Encrypt on 1.16
2023-03-04 11:11:33 +00:00
JackMacWindows
6f65bad9af Fixed CI 2023-03-04 02:02:05 -05:00
JackMacWindows
e4dd4dbef0 Added version check to certificate addition 2023-03-02 18:30:54 -05:00
MCJack123
e1dffaa334 Add certificate workaround for Let's Encrypt 2023-02-28 20:52:14 -05:00
Jonathan Coates
1f3b781a1d Merge branch 'mc-1.16.x' into mc-1.18.x 2023-02-14 10:10:50 +00:00
Jonathan Coates
d7305fb975 Bump CC:T to 1.101.2
Yes, it was the shiny parse errors, and not the steady accumulation of
bugs which made me finally do a version bump.
2023-02-14 10:00:24 +00:00
Jonathan Coates
9b3cadf57c Cherry pick several changes back from 1.19.3
The main purpose of this is to backport the improved parse/runtime
errors to older versions. I think they're sufficiently useful that we
should try to make it as widely available as possible.

We've been running them for a week now on SC3 and the released version
and not seen any issues, so I think it's probably stable enough.

This is a pretty lazy commit: I ended up copying the whole ROM over and
then picking up a few other related changes along the way.

 - Trim spaces from file paths (b8fce1eecc)

 - Correctly format 12AM/PM with
   %I (9f48395596)

 - Fix http.request and htpt.websocketAsync not handling a few failure
   edge-cases correctly (3b42f22a4f).

 - Move the internal modules into the main package path, hidden under
   cc.internal (34a31abd9c).

 - Gather code coverage in Java instead of
   Lua (28a55349a9).

 - Make error messages in edit more
   obvious (8cfbfe7ceb).

 - Make mcfly's test methods global. This means we don't need to pass
   stub everywhere (7335a892b5).

 - Improve runtime and parse errors. This comes from numerous commits,
   but chiefly a12b405acf, and
   5502412181.

 - Hide the internal redirect methods in
   multishell (33b6f38339).

Note this does /not/ include the shebang changes (sorry Emma!). I've
tried to avoid adding any user-controllable features, mostly because I
don't know how to handle the versioning otherwise :).
2023-02-14 09:45:03 +00:00
Jonathan Coates
68f6fa9343 Fall back to the default item when rendering non-turtles
Closes #1328. This isn't an actual fix - I have no clue what's going on
there - but it should be less crashy.
2023-02-09 12:45:20 +00:00
Jonathan Coates
58f2c0bd71 Update Cobalt to fix yielding inside __len
Closes #1307
2023-01-26 10:09:09 +00:00
Jonathan Coates
b46ad62424 Send the original rednet message to the current computer
We were incorrectly enquing the modem payload, not the underlying rednet
message.

Closes #1308.
2023-01-21 08:25:13 +00:00
Jonathan Coates
12f2f854a6 Include the licences of our dependencies in the credits
I feel like we should have been doing this from the beginning. Love to
uncompliant for 11 years :/.
2023-01-07 12:04:56 +00:00
Jonathan Coates
4078a2dcba Clamp speaker volume again
Looks like this was removed in b048b6666d.
2023-01-01 13:59:58 +00:00
Jonathan Coates
0ad12eeab6 Fix computer upgrade recipes
Fixes #1272
2022-12-26 09:32:02 +00:00
Jonathan Coates
68a5081740 Bump Cobalt version
See #1248 and #1249
2022-12-21 16:01:54 +00:00
Jonathan Coates
5e701f73d6 Use the correct import path in import.lua
Backported from 1.19.3
2022-12-14 21:52:32 +00:00
Jonathan Coates
0db32bd0fe Merge branch 'mc-1.16.x' into mc-1.18.x 2022-11-02 09:55:10 +00:00
Jonathan Coates
1d3ecb551d Improvee changelog 2022-11-02 07:58:31 +00:00
Jonathan Coates
aefda6a381 Fix a couple of issues with the release process
Only way to test these is in prod, alas :D:
2022-11-01 21:53:05 +00:00
Jonathan Coates
11ac865877 Merge branch 'mc-1.16.x' into mc-1.18.x 2022-11-01 20:07:15 +00:00
Jonathan Coates
5d4c34fbac Merge branch 'mc-1.16.x' into mc-1.18.x 2022-10-31 18:03:39 +00:00
Jonathan Coates
c4184a33bc Rewrite our gametest system
This is a noisier diff than I'd like as this is just a direct copy from
the multi-loader branch.

 - Rename "ingame" package to "gametest"

 - Don't chain GameTestSequence methods - it's actually much cleaner if
   we just use Kotlin's implicit this syntax.

 - Use our work in 71f81e1201 to write
   computer tests using Kotlin instead of Lua. This means all the logic
   is in one place, which is nice!

 - Add a couple more tests for some of the more error-prone bits of
   functionality.
2022-10-30 10:50:16 +00:00
Jonathan Coates
b3702fed78 Remove all Minecraft references from the core package
This is an initial step before refactoring this into a separate module.
It's definitely not complete - there's a lot of work needed to remove
referneces to the main ComputerCraft class for instance - but is a
useful first step.
2022-10-30 09:20:26 +00:00
Jonathan Coates
38b2c944f3 Merge branch 'mc-1.16.x' into mc-1.18.x 2022-10-30 08:49:52 +00:00
Jonathan Coates
158850be09 Some Java-17ification
I might just stick on 1.18 for the rest of these refactors. Porting
across the mojmap boundary is painful.
2022-10-25 22:58:31 +01:00
Jonathan Coates
be827a21db Merge branch 'mc-1.16.x' into mc-1.18.x
I dare say there's going to be some bugs with this. I was as careful as
I could be, but yikes it was nasty.
2022-10-25 22:38:26 +01:00
Jonathan Coates
9ed5ebb868 Merge branch 'mc-1.16.x' into mc-1.18.x 2022-10-12 08:32:03 +01:00
Jonathan Coates
08895cdecc Merge branch 'mc-1.16.x' into mc-1.18.x 2022-10-01 12:36:09 +01:00
Jonathan Coates
feb7681c9c Add some missing test timeouts 2022-07-30 18:14:43 +01:00
Jonathan Coates
ad4a2aa68d Mirror Oculus with our maven
In some ways it's probably less reliable than modrinth, but let's be
consistent here.
2022-07-30 17:56:56 +01:00
Jonathan Coates
4228011b84 Support Occulus shaders
This is mostly copied from the work Toad and I did for CC:R.

Instead of not writing to the depth buffer when rendering terminals, we
now render terminal forgrounds with a small glPolygonOffset (or an
emulation of it where not possible). This removes the need for custom
render types, while still avoiding z-fighting between the terminal
foreground and background.

The VBO monitors backend now uses Iris's TextVertexSink API when
available: Iris overwrites the vertex format for RenderType.text, and so
we need to use this API to avoid rendering garbage.

Performance is maybe a little worse than before (<3ms) and definitely
worse than CC:R. Unfortunately we can't do our upload batching as that
conflicts with Optifine's patches - instead we need to maintain two
separate VBOs. This is a bit slower, but not so bad it's unworkable.
2022-07-30 12:15:04 +01:00
Jonathan Coates
bd19fdf350 Merge branch 'mc-1.16.x' into mc-1.18.x 2022-07-28 09:43:06 +01:00
Jonathan Coates
69b211b4fb Fix name of "ingame" time locale
This has been here since 1.17 :D. Class rename gone wrong!
2022-07-21 09:44:36 +01:00
Jonathan Coates
48147fa61c Don't use MultiBufferSource for monitors
We're doing lots of weird OpenGL shenangins anyway, so it doesn't make
sense to use it. Instead just draw directly using the Tesselator
BufferBuilder.

This might improve compatiability with Sodium/Rubidium. Please don't let
me know if it doesn't though - I really don't want to have to deal with
it any more.
2022-07-16 22:07:23 +01:00
Jonathan Coates
f25a73b8f2 Fix packet ID conflict
Merge gone wrong I suspect. I should probably add a check for this.

Fixes #1130. Slightly embarassing that this has been around for 7
months.
2022-07-07 21:45:05 +01:00
Jonathan Coates
d2f94f2653 Merge branch 'mc-1.16.x' into mc-1.18.x 2022-06-23 22:26:09 +01:00
Jonathan Coates
bb0e449560 Switch over to using SLF4J
No bearing on MC, but allows us to drop the depenedency in other
projects (CCEmuX, eval.tweaked.cc, etc...)

I'd quite like to spin the core into a separate project which doesn't
depend on MC at all, but not worth doing right now.
2022-06-23 20:57:24 +01:00
Jonathan Coates
ee495b3359 Merge branch 'mc-1.16.x' into mc-1.18.x 2022-06-23 20:53:37 +01:00
Jonathan Coates
557765d8f0 Merge branch 'mc-1.16.x' into mc-1.18.x 2022-06-10 00:00:19 +01:00
Jonathan Coates
a07bba4ece Merge branch 'mc-1.16.x' into mc-1.18.x 2022-05-27 22:28:55 +01:00
Jonathan Coates
83a1af6526 Merge branch 'mc-1.16.x' into mc-1.18.x 2022-05-27 18:55:51 +01:00
Jonathan Coates
5052718428 Merge branch 'mc-1.16.x' into mc-1.18.x 2022-05-22 15:03:01 +01:00
Jonathan Coates
caa412b7d2 Merge branch 'mc-1.16.x' into mc-1.18.x 2022-04-28 20:27:48 +01:00
Jonathan Coates
159f90896e Merge branch 'mc-1.16.x' into mc-1.18.x 2022-04-27 13:52:11 +01:00
Jonathan Coates
2a4f75ba15 Use Forge's new sound stream API
- Bump Forge version to latest RB.
 - Generate an 8-bit audio stream again, as we no longer need to be
   compatible with MC's existing streams.

No functionality changes, just mildly less hacky.
2022-04-27 10:59:28 +01:00
Jonathan Coates
42b98bce28 Reset the BufferUploader state on Linux
GlStateManager.glDeleteBuffers clears a buffer before deleting it on
Linux - I assume otherwise there's memory leaks on some drivers? - which
clobbers BufferUploader's cache. Roll our own version which resets the
cache when needed.

Also always reset the cache when deleting/creating a DirectVertexBuffer.
2022-04-26 22:39:34 +01:00
Jonathan Coates
59e3608d2a Merge branch 'mc-1.16.x' into mc-1.18.x
I was right: I did not enjoy this.
2022-04-26 22:17:42 +01:00
Jonathan Coates
41fa95bce4 Cleanup and optimise terminal rendering (#1057)
- Remove the POSITION_COLOR render type. Instead we just render a
   background terminal quad as the pocket computer light - it's a little
   (lot?) more cheaty, but saves having to create a render type.

 - Use the existing position_color_tex shader instead of our copy. I
   looked at using RenderType.text, but had a bunch of problems with GUI
   terminals. Its possible we can fix it, but didn't want to spend too
   much time on it.

 - Remove some methods from FixedWidthFontRenderer, inlining them into
   the call site.

 - Switch back to using GL_QUADS rather than GL_TRIANGLES. I know Lig
   will shout at me for this, but the rest of MC uses QUADS, so I don't
   think best practice really matters here.

 - Fix the TBO backend monitor not rendering monitors with fog.
 
   Unfortunately we can't easily do this to the VBO one without writing
   a custom shader (which defeats the whole point of the VBO backend!),
   as the distance calculation of most render types expect an
   already-transformed position (camera-relative I think!) while we pass
   a world-relative one.

 - When rendering to a VBO we push vertices to a ByteBuffer directly,
   rather than going through MC's VertexConsumer system. This removes
   the overhead which comes with VertexConsumer, significantly improving
   performance.

 - Pre-convert palette colours to bytes, storing both the coloured and
   greyscale versions as a byte array. This allows us to remove the
   multiple casts and conversions (double -> float -> (greyscale) ->
   byte), offering noticeable performance improvements (multiple ms per
   frame).

   We're using a byte[] here rather than a record of three bytes as
   notionally it provides better performance when writing to a
   ByteBuffer directly compared to calling .put() four times. [^1]

 - Memorize getRenderBoundingBox. This was taking about 5% of the total
   time on the render thread[^2], so worth doing.

   I don't actually think the allocation is the heavy thing here -
   VisualVM says it's toWorldPos being slow. I'm not sure why - possibly
   just all the block property lookups? [^2]

Note that none of these changes improve compatibility with Optifine.
Right now there's some serious issues where monitors are writing _over_
blocks in front of them. To fix this, we probably need to remove the
depth blocker and just render characters with a z offset. Will do that
in a separate commit, as I need to evaluate how well that change will
work first.

The main advantage of this commit is the improved performance. In my 
stress test with 120 monitors updating every tick, I'm getting 10-20fps
[^3] (still much worse than TBOs, which manages a solid 60-100).

In practice, we'll actually be much better than this. Our network
bandwidth limits means only 40 change in a single tick - and so FPS is
much more reasonable (+60fps).

[^1]: In general, put(byte[]) is faster than put(byte) multiple times.
Just not clear if this is true when dealing with a small (and loop
unrolled) number of bytes.

[^2]: To be clear, this is with 120 monitors and no other block entities
with custom renderers. so not really representative.

[^3]: I wish I could provide a narrower range, but it varies so much
between me restarting the game. Makes it impossible to benchmark
anything!
2022-04-02 10:54:03 +01:00
Jonathan Coates
ba7598c689 Merge branch 'mc-1.17.x' into mc-1.18.x 2022-03-23 08:40:25 +00:00
Jonathan Coates
70c5cbafec Merge branch 'mc-1.16.x' into mc-1.17.x 2022-03-23 08:39:39 +00:00
Jonathan Coates
7731759c77 Bump Forge version one more time 2022-03-23 08:34:57 +00:00
Jonathan Coates
e6339b2847 Update to Forge's latest registry API
Forge 4.0.18 deprecated a lot of methods and moved where
RegistryEvent.NewRegistry lives, so we needed to update. This does break
the CC API a little bit (sorry!) though given Forge 1.18.2 is still in
flux, that's probably inevitable.
2022-03-19 08:45:14 +00:00
Jonathan Coates
6353e8d930 Merge branch 'mc-1.16.x' into mc-1.17.x 2022-03-03 10:45:25 +00:00
Jonathan Coates
78cce4981a Merge branch 'mc-1.17.x' into mc-1.18.x 2022-03-03 10:45:25 +00:00
Jonathan Coates
97c953a9be Fix not running the test server during a build 2022-03-03 10:11:17 +00:00
Jonathan Coates
52df7cb8a4 Switch to Forge's game test system
It's now impossible to run the client tests (tests are still there, but
none of the other infrastructure is). We've not run these for months now
due to their severe flakiness :(.
2022-03-03 09:57:36 +00:00
Jonathan Coates
6735cfd12e Update to 1.18.2
Did not enjoy, would not recommend.
2022-03-03 09:17:40 +00:00
Jonathan Coates
f994696161 Merge branch 'mc-1.17.x' into mc-1.18.x 2022-02-28 16:26:16 +00:00
Jonathan Coates
4a4e8bb4b6 Merge branch 'mc-1.16.x' into mc-1.17.x 2022-02-28 16:25:33 +00:00
Jonathan Coates
9edce36efd Merge branch 'mc-1.17.x' into mc-1.18.x 2022-01-14 23:01:12 +00:00
Jonathan Coates
e05588c662 Merge branch 'mc-1.16.x' into mc-1.17.x 2022-01-14 23:00:17 +00:00
Jonathan Coates
79366bf2f5 Merge branch 'mc-1.17.x' into mc-1.18.x 2022-01-01 15:41:24 +00:00
Jonathan Coates
413fa5bcc8 Merge branch 'mc-1.16.x' into mc-1.17.x 2022-01-01 15:41:05 +00:00
Jonathan Coates
2b901f2d5e Merge branch 'mc-1.17.x' into mc-1.18.x 2021-12-25 08:05:25 +00:00
Jonathan Coates
62f2cd5cb2 Merge branch 'mc-1.16.x' into mc-1.17.x 2021-12-25 08:05:25 +00:00
Jonathan Coates
901d8d4c3b Merge branch 'mc-1.17.x' into mc-1.18.x 2021-12-21 15:15:53 +00:00
Jonathan Coates
f794ce42ab Merge branch 'mc-1.16.x' into mc-1.17.x 2021-12-21 15:10:19 +00:00
Jonathan Coates
2562642664 Re-add JEI integration 2021-12-18 11:42:22 +00:00
Jonathan Coates
632db1cfa5 Merge branch 'mc-1.17.x' into mc-1.18.x 2021-12-18 11:38:48 +00:00
Jonathan Coates
aa0d544bba Remove MoreRed integration
It's not been updated to 1.17/1.18, nor touched since July. Can easily
be added back in if this changes.
2021-12-18 11:35:52 +00:00
Jonathan Coates
2f6ad00764 Use Java 16 ByteBuffer methods where possible 2021-12-18 11:34:44 +00:00
Jonathan Coates
05da4dd362 Merge branch 'mc-1.16.x' into mc-1.17.x 2021-12-18 11:25:28 +00:00
Jonathan Coates
fe3c42ce22 Mark 1.17 (and 1.18) as stable 2021-12-17 16:44:29 +00:00
Jonathan Coates
f6fcba7a39 Merge branch 'mc-1.17.x' into mc-1.18.x 2021-12-14 20:13:53 +00:00
Jonathan Coates
82a7edee12 Merge branch 'mc-1.16.x' into mc-1.17.x 2021-12-14 20:07:48 +00:00
Jonathan Coates
7c373c6e06 Merge branch 'mc-1.17.x' into mc-1.18.x 2021-12-11 07:50:18 +00:00
Jonathan Coates
6196aae488 Merge branch 'mc-1.16.x' into mc-1.17.x 2021-12-11 07:49:33 +00:00
Jonathan Coates
57c5d19f95 Update to Forge 1.18.1 2021-12-11 07:31:41 +00:00
Jonathan Coates
23c17075be save -> saveAdditional
Also add in a janky workabround for handleUpdateTag not being called.
Being an early porter is always fun :D:.
2021-12-02 09:20:06 +00:00
Jonathan Coates
87988a705b Exclude Jetbrains annotations from testModExtra
testModExtra must /strictly/ be the set of dependencies which are not
present in implementation - there can't be any duplicates.

Yes, it's stupid, but the whole lazyToken("minecraft_classpath") thing
wasn't really built with this in mind, so not much we can do :)
2021-12-01 20:40:46 +00:00
Jonathan Coates
179da1d8cf Update to MC 1.18
- Build fails right now due to module issues, so this won't be pushed
   to GitHub.
 - Monitors render transparently when loaded into the world. I don't
   think this is a 1.17 bug, so not sure what's going on here!
2021-11-30 22:48:38 +00:00
Jonathan Coates
92fd93c0e0 Merge branch 'mc-1.16.x' into mc-1.17.x 2021-11-30 22:37:07 +00:00
Jonathan Coates
af966179ce Merge branch 'mc-1.16.x' into mc-1.17.x 2021-11-29 19:40:05 +00:00
Jonathan Coates
2418cfb87b More instanceof pattern matching 2021-11-28 15:58:30 +00:00
Jonathan Coates
095101831c Pin to an older ForgeGradle
This .25 is still borked I think
2021-11-27 09:34:20 +00:00
Jonathan Coates
7b7527ec80 Rewrite turtle upgrade registration to be more data driven (#967)
The feature nobody asked for, but we're getting anyway.

Old way to register a turtle/pocket computer upgrade:

    ComputerCraftAPI.registerTurtleUpgrade(new MyUpgrade(new ResourceLocation("my_mod", "my_upgrade")));

New way to register a turtle/pocket computer upgrade:

First, define a serialiser for your turtle upgrade type:

    static final DeferredRegister<TurtleUpgradeSerialiser<?>> SERIALISERS = DeferredRegister.create( TurtleUpgradeSerialiser.TYPE, "my_mod" );
    public static final RegistryObject<TurtleUpgradeSerialiser<MyUpgrade>> MY_UPGRADE =
        SERIALISERS.register( "my_upgrade", () -> TurtleUpgradeSerialiser.simple( MyUpgrade::new ) );
    SERIALISERS.register(bus); // Call in your mod constructor.

Now either create a JSON string or use a data generator to register your upgrades:

    class TurtleDataGenerator extends TurtleUpgradeDataProvider {
        @Override
        protected void addUpgrades( @Nonnull Consumer<Upgrade<TurtleUpgradeSerialiser<?>>> addUpgrade )
            simple(new ResourceLocation("my_mod", my_upgrade"), MY_UPGRADE.get()).add(addUpgrade);
        }
    }

See much better! In all seriousness, this does offer some benefits,
namely that it's now possible to overwrite or create upgrades via
datapacks.

Actual changes:
 - Remove ComputerCraftAPI.register{Turtle,Pocket}Upgrade functions.

 - Instead add {Turtle,Pocket}UpgradeSerialiser classes, which are used
   to load upgrades from JSON files in datapacks, and then read/write
   them to network packets (much like recipe serialisers).

 - The upgrade registries now subscribe to datapack reload events. They
   find all JSON files in the
   data/$mod_id/computercraft/{turtle,pocket}_upgrades directories,
   parse them, and then register them as upgrades.

   Once datapacks have fully reloaded, these upgrades are then sent over
   the network to the client.

 - Add data generators for turtle and pocket computer upgrades, to make
   the creation of JSON files a bit easier.

 - Port all of CC:T's upgrades over to use the new system.
2021-11-26 23:36:02 +00:00
Jonathan Coates
a4c5ecf8df Don't specify the version number in mods.toml 2021-11-25 14:54:32 +00:00
Jonathan Coates
99de00e16e Remove craft tweaker integration 2021-11-25 13:36:33 +00:00
Jonathan Coates
600227e481 Merge branch 'mc-1.16.x' into mc-1.17.x 2021-11-25 13:34:19 +00:00
Jonathan Coates
cf3f1d3d48 Add correct tool to CC computers
Also rerun data generators, forgot to do it as part of the previous
commit.

Fixes #953
2021-11-03 09:40:30 +00:00
Jonathan Coates
bca964629a Merge branch 'mc-1.16.x' into mc-1.17.x 2021-11-03 09:34:21 +00:00
Jonathan Coates
0e94355a85 Some post-1.17 cleanup
- Fix broken Javadoc references
 - Apply a couple of refactoring suggestions from IDEA
2021-10-13 17:46:29 +01:00
Jonathan Coates
0d35331b82 Default to Java 16 in the gitpod environment 2021-10-06 18:52:36 +01:00
Jonathan Coates
076b454c8f Also convert the turtle model key to a record 2021-10-06 18:40:33 +01:00
Jonathan Coates
36e0dcbad0 Change network packet to a record
Look at all that code we can delete!
2021-10-06 18:38:51 +01:00
Jonathan Coates
0b5fe990e5 Bump Forge version
- Clean up NBT constants, replace with built-in ones
 - Switch over to the new capability system
2021-10-06 18:28:28 +01:00
Jonathan Coates
29ece2a6e3 Don't run client tests on CI
Kinda sucks, but they're so inconsistent between platforms right now,
and I cannot be bothered to get CI working. It only needs to work on my
machine.
2021-10-06 18:23:38 +01:00
Jonathan Coates
eba26dedab Merge branch 'mc-1.16.x' into mc-1.17.x 2021-10-06 18:10:45 +01:00
Jonathan Coates
3eb601e554 Pass lightmap variables around various renderers
- Add lightmap parameters to the text, computer and printout renderers.

 - Printouts are always rendered using the current lightmap. When
   interacting with the GUI, we use the fullbright lightmap coordinate.

 - Pocket computers render their border using the lightmap. Terminal and
   light do not use the lightmap at all.

There's some funkiness going on here with render types - it appears the
"correct" position_color_tex_lightmap render type is actually one used
for text.

Fixes #919. This bug does occur on 1.16 too, but given how complex the
rendering changes are between 1.16 and 1.17 I do /not/ want to have to
implement this twice. Sorry.
2021-09-19 15:49:31 +01:00
Jonathan Coates
d0e79f310e Bump Forge version
Not much has changed, just some cleanup.
2021-09-19 11:57:37 +01:00
Jonathan Coates
0d6528aaf0 Merge branch 'mc-1.16.x' into mc-1.17.x 2021-09-19 11:38:25 +01:00
Jonathan Coates
b447b0e308 Increase memory limit of the gradle daemon
This has been standard in the mdk for a while, but never actually had to
do this before. IntelliJ finally started hitting this limit when
decompiling.
2021-09-18 12:42:36 +01:00
Jonathan Coates
b2273c9b29 Add back JEI integration 2021-08-29 22:20:06 +01:00
Jonathan Coates
bbf3e48763 Increase timeout of some more tests 2021-08-22 18:01:06 +01:00
Jonathan Coates
92fe1d4bc2 Merge branch 'mc-1.16.x' into mc-1.17.x 2021-08-22 17:50:33 +01:00
Jonathan Coates
4d591c600c Use clearRemoved rather than onLoad
Latter is broken on Forge right now.
2021-08-20 21:48:34 +01:00
Jonathan Coates
0a8e427c61 Merge branch 'mc-1.16.x' into mc-1.17.x 2021-08-20 21:47:55 +01:00
Jonathan Coates
0a537eaeee Rewrite some in-hand rendering code
- Fix missing shader for printout render type
 - Use current buffer provider for pocket computers rather than the
   tesselator. This requires us to use a non-depth-writing terminal +
   depth blocker, as otherwise one gets z-fighting.
 - Thus refactor some of the shaders to be terminal wide, not just for
   monitors.

Fixes #894
2021-08-17 13:00:52 +01:00
Jonathan Coates
aa857c1be3 Start using Java's instanceof pattern matching
Well, not really pattern matching, but it's still an improvement!
2021-08-08 12:45:30 +01:00
Jonathan Coates
e4ced551eb Remove most of the turtle events
I don't think anybody actually used these, and I'm not convinced they
had much value anyway.

It might be worth switching the refueling code to work as a registry
instead, though events are kinda nice.
2021-08-08 12:43:03 +01:00
Jonathan Coates
6eec9ba1a3 Merge branch 'mc-1.16.x' into mc-1.17.x 2021-08-08 12:40:00 +01:00
Jonathan Coates
a8f675c59d Make current branch detection more robust 2021-08-06 18:04:05 +01:00
Jonathan Coates
bb1ebaee4f Bump Forge and prepare for a release
I've been shown up[1]. Unacceptable!

[1]: https://twitter.com/SangarWasTaken/status/1423676992336060417
2021-08-06 17:25:34 +01:00
Jonathan Coates
bb1183d274 Update to Minecraft 1.17.1
- Remap everything to use MojMap class names too. This is what Forge
   uses, so \o/.

   This does NOT currently rename any classes to use suffix notation or
   BlockEntity. That will come in a later change. We do however rename
   references of "World" to "Level".

 - Move the test mod into a separate "cctest" source set. As Forge now
   works using Jigsaw we cannot have multiple mods defining the same
   package, which causes problems with our JUnit test classes.

 - Remove our custom test framework and replace it with vanilla's (this
   is no longer stripped from the jar). RIP kotlin coroutines.

   It's still worth using Kotlin here though, just for extension
   methods.

 - Other 1.17-related changes:
    - Use separate tile/block entity tick methods for server and client
      side, often avoiding ticking at all on the client.

    - Switch much of the monitor rendering code to use vanilla's
      built-in shader system. It's still an incredibly ugly hack, so not
      really expecting this to work with any rendering mods, but we'll
      cross that bridge when we come to it.
2021-08-06 17:18:09 +01:00
707 changed files with 18164 additions and 21169 deletions

View File

@@ -14,7 +14,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 8
java-version: 17
distribution: 'temurin'
- name: Setup Gradle

View File

@@ -17,7 +17,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 8
java-version: 17
distribution: 'temurin'
- name: Setup Gradle

View File

@@ -43,6 +43,10 @@ minecraft {
// configureEach would be better, but we need to eagerly configure configs or otherwise the run task doesn't
// get set up properly.
all {
lazyToken("minecraft_classpath") {
configurations["shade"].copyRecursive().resolve().joinToString(File.pathSeparator) { it.absolutePath }
}
property("forge.logging.markers", "REGISTRIES")
property("forge.logging.console.level", "debug")
@@ -75,6 +79,24 @@ minecraft {
}
fun RunConfig.configureForGameTest() {
val old = lazyTokens.get("minecraft_classpath")
lazyToken("minecraft_classpath") {
// We do some terrible hacks here to basically find all things not already on the runtime classpath
// and add them. /Except/ for our source sets, as those need to load inside the Minecraft classpath.
val testMod = configurations["testModRuntimeClasspath"].resolve()
val implementation = configurations.runtimeClasspath.get().resolve()
val new = (testMod - implementation)
.asSequence()
.filter { it.isFile && !it.name.endsWith("-test-fixtures.jar") }
.map { it.absolutePath }
.joinToString(File.pathSeparator)
if (old == null) new else old.get() + File.pathSeparator + new
}
property("cctest.sources", file("src/testMod/resources/data/cctest").absolutePath)
arg("--mixin.config=computercraft-gametest.mixins.json")
mods.register("cctest") {
source(sourceSets["testMod"])
source(sourceSets["testFixtures"])
@@ -87,12 +109,10 @@ minecraft {
configureForGameTest()
}
val testServer by registering {
val gameTestServer by registering {
workingDirectory(file("run/testServer"))
parent(server.get())
configureForGameTest()
property("cctest.run", "true")
property("forge.logging.console.level", "info")
}
}
@@ -100,7 +120,6 @@ minecraft {
mappings("parchment", "${libs.versions.parchmentMc.get()}-${libs.versions.parchment.get()}-$mcVersion")
accessTransformer(file("src/main/resources/META-INF/accesstransformer.cfg"))
accessTransformer(file("src/testMod/resources/META-INF/accesstransformer.cfg"))
}
mixin {
@@ -120,16 +139,14 @@ configurations {
dependencies {
minecraft("net.minecraftforge:forge:$mcVersion-${libs.versions.forge.get()}")
annotationProcessor("org.spongepowered:mixin:0.8.4:processor")
annotationProcessor("org.spongepowered:mixin:0.8.5:processor")
compileOnly(libs.jetbrainsAnnotations)
annotationProcessorEverywhere(libs.autoService)
"extraModsCompileOnly"(fg.deobf("mezz.jei:jei-1.16.5:7.7.0.104:api"))
"extraModsRuntimeOnly"(fg.deobf("mezz.jei:jei-1.16.5:7.7.0.104"))
"extraModsCompileOnly"(fg.deobf("com.blamejared.crafttweaker:CraftTweaker-1.16.5:7.1.0.313"))
"extraModsCompileOnly"(fg.deobf("commoble.morered:morered-1.16.5:2.1.1.0"))
"extraModsCompileOnly"(fg.deobf("mezz.jei:jei-1.18.2:9.4.1.116:api"))
"extraModsRuntimeOnly"(fg.deobf("mezz.jei:jei-1.18.2:9.4.1.116"))
"extraModsCompileOnly"(fg.deobf("maven.modrinth:oculus:1.18.2-1.2.5"))
"shade"(libs.cobalt)
@@ -151,7 +168,7 @@ illuaminate {
tasks.javadoc {
include("dan200/computercraft/api/**/*.java")
(options as StandardJavadocDocletOptions).links("https://docs.oracle.com/javase/8/docs/api/")
(options as StandardJavadocDocletOptions).links("https://docs.oracle.com/en/java/javase/17/docs/api/")
}
val apiJar by tasks.registering(Jar::class) {
@@ -177,7 +194,7 @@ val luaJavadoc by tasks.registering(Javadoc::class) {
javadocTool.set(
javaToolchains.javadocToolFor {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(cc.tweaked.gradle.CCTweakedPlugin.JAVA_VERSION)
},
)
}
@@ -187,7 +204,7 @@ tasks.processResources {
inputs.property("forgeVersion", libs.versions.forge.get())
inputs.property("gitHash", cct.gitHash)
filesMatching("data/computercraft/lua/rom/help/credits.txt") {
filesMatching("data/computercraft/lua/rom/help/credits.md") {
expand(mapOf("gitContributors" to cct.gitContributors.get().joinToString("\n")))
}
@@ -320,25 +337,14 @@ val lintLua by tasks.registering(IlluaminateExec::class) {
doLast { if (System.getenv("GITHUB_ACTIONS") != null) println("::remove-matcher owner=illuaminate::") }
}
val setupRunGametest by tasks.registering(Copy::class) {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Sets up the environment for the test server."
from("src/testMod/server-files") {
include("eula.txt")
include("server.properties")
}
into("run/testServer")
}
val runGametest by tasks.registering(JavaExec::class) {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Runs tests on a temporary Minecraft instance."
dependsOn(setupRunGametest, "cleanRunGametest")
dependsOn("cleanRunGametest")
// Copy from runTestServer. We do it in this slightly odd way as runTestServer
// Copy from runGameTestServer. We do it in this slightly odd way as runGameTestServer
// isn't created until the task is configured (which is no good for us).
val exec = tasks.getByName<JavaExec>("runTestServer")
val exec = tasks.getByName<JavaExec>("runGameTestServer")
dependsOn(exec.dependsOn)
exec.copyToFull(this)
}
@@ -364,7 +370,7 @@ val publishCurseForge by tasks.registering(TaskPublishCurseForge::class) {
apiToken = findProperty("curseForgeApiKey") ?: ""
enabled = apiToken != ""
val mainFile = upload("282001", tasks.shadowJar)
val mainFile = upload("282001", tasks.shadowJar.get().archiveFile)
dependsOn(tasks.shadowJar) // Ughr.
mainFile.changelog = "Release notes can be found on the [GitHub repository](https://github.com/cc-tweaked/CC-Tweaked/releases/tag/v$mcVersion-$modVersion)."
mainFile.changelogType = "markdown"
@@ -445,6 +451,8 @@ publishing {
repositories {
maven("https://squiddev.cc/maven") {
name = "SquidDev"
credentials(PasswordCredentials::class)
}
}
}

View File

@@ -26,12 +26,12 @@ abstract class CCTweakedExtension(
) {
/** Get the hash of the latest git commit. */
val gitHash: Provider<String> = gitProvider(project, "<no git hash>") {
ProcessHelpers.captureOut("git", "-C", project.projectDir.absolutePath, "rev-parse", "HEAD")
ProcessHelpers.captureOut("git", "-C", project.projectDir.absolutePath, "rev-parse", "HEAD").trim()
}
/** Get the current git branch. */
val gitBranch: Provider<String> = gitProvider(project, "<no git branch>") {
ProcessHelpers.captureOut("git", "-C", project.projectDir.absolutePath, "rev-parse", "--abbrev-ref", "HEAD")
ProcessHelpers.captureOut("git", "-C", project.projectDir.absolutePath, "rev-parse", "--abbrev-ref", "HEAD").trim()
}
/** Get a list of all contributors to the project. */

View File

@@ -13,6 +13,6 @@ class CCTweakedPlugin : Plugin<Project> {
}
companion object {
val JAVA_VERSION = JavaLanguageVersion.of(8)
val JAVA_VERSION = JavaLanguageVersion.of(17)
}
}

View File

@@ -58,20 +58,29 @@
<module name="SimplifyBooleanExpression" />
<module name="SimplifyBooleanReturn" />
<module name="StringLiteralEquality" />
<module name="UnnecessaryParentheses" />
<module name="UnnecessaryParentheses">
<!-- Default minus LAND. -->
<property name="tokens" value="EXPR,IDENT,NUM_DOUBLE,NUM_FLOAT,NUM_INT,NUM_LONG,STRING_LITERAL,LITERAL_NULL,LITERAL_FALSE,LITERAL_TRUE,ASSIGN,BAND_ASSIGN,BOR_ASSIGN,BSR_ASSIGN,BXOR_ASSIGN,DIV_ASSIGN,MINUS_ASSIGN,MOD_ASSIGN,PLUS_ASSIGN,SL_ASSIGN,SR_ASSIGN,STAR_ASSIGN,LAMBDA,TEXT_BLOCK_LITERAL_BEGIN,LITERAL_INSTANCEOF,GT,LT,GE,LE,EQUAL,NOT_EQUAL,UNARY_MINUS,UNARY_PLUS,INC,DEC,LNOT,BNOT,POST_INC,POST_DEC" />
</module>
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration" />
<module name="UnnecessarySemicolonInTryWithResources" />
<module name="UnnecessarySemicolonInEnumeration" />
<!-- Imports -->
<module name="CustomImportOrder" />
<module name="CustomImportOrder">
<property name="customImportOrderRules"
value="THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE###STATIC"
/>
</module>
<module name="IllegalImport" />
<module name="RedundantImport" />
<module name="UnusedImports" />
<!-- Javadoc -->
<!-- TODO: Missing* checks for the dan200.computercraft.api package? -->
<module name="AtclauseOrder" />
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
</module>
<module name="InvalidJavadocPosition" />
<module name="JavadocBlockTagLocation" />
<module name="JavadocMethod"/>
@@ -100,7 +109,9 @@
<module name="LocalFinalVariableName" />
<module name="LocalVariableName" />
<module name="MemberName" />
<module name="MethodName" />
<module name="MethodName">
<property name="format" value="^(computercraft\$)?[a-z][a-zA-Z0-9]*$" />
</module>
<module name="MethodTypeParameterName" />
<module name="PackageName">
<property name="format" value="^dan200\.computercraft(\.[a-z][a-z0-9]*)*" />
@@ -108,11 +119,6 @@
<module name="ParameterName" />
<module name="StaticVariableName">
<property name="format" value="^[a-z][a-zA-Z0-9]*|CAPABILITY(_[A-Z_]+)?$" />
<property name="applyToPrivate" value="false" />
</module>
<module name="StaticVariableName">
<property name="format" value="^(s_)?[a-z][a-zA-Z0-9]*|CAPABILITY(_[A-Z_]+)?$" />
<property name="applyToPrivate" value="true" />
</module>
<module name="TypeName" />
@@ -156,6 +162,7 @@
<property name="allowEmptyLambdas" value="true" />
<property name="allowEmptyMethods" value="true" />
<property name="allowEmptyConstructors" value="true" />
<property name="allowEmptyTypes" value="true" />
<property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAMBDA,LAND,LCURLY,LE,LITERAL_RETURN,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND" />
</module>

View File

@@ -3,6 +3,6 @@ FROM gitpod/workspace-base
USER gitpod
RUN sudo apt-get -q update \
&& sudo apt-get install -yq openjdk-8-jdk openjdk-16-jdk python3-pip npm \
&& sudo apt-get install -yq openjdk-16-jdk python3-pip npm \
&& sudo pip3 install pre-commit \
&& sudo update-java-alternatives --set java-1.8.0-openjdk-amd64
&& sudo update-java-alternatives --set java-1.16.0-openjdk-amd64

View File

@@ -1,64 +0,0 @@
--- @module fs
--- Returns true if a path is mounted to the parent filesystem.
--
-- The root filesystem "/" is considered a mount, along with disk folders and
-- the rom folder. Other programs (such as network shares) can exstend this to
-- make other mount types by correctly assigning their return value for getDrive.
--
-- @tparam string path The path to check.
-- @treturn boolean If the path is mounted, rather than a normal file/folder.
-- @throws If the path does not exist.
-- @see getDrive
-- @since 1.87.0
function isDriveRoot(path) end
--[[- Provides completion for a file or directory name, suitable for use with
@{_G.read}.
When a directory is a possible candidate for completion, two entries are
included - one with a trailing slash (indicating that entries within this
directory exist) and one without it (meaning this entry is an immediate
completion candidate). `include_dirs` can be set to @{false} to only include
those with a trailing slash.
@tparam[1] string path The path to complete.
@tparam[1] string location The location where paths are resolved from.
@tparam[1,opt=true] boolean include_files When @{false}, only directories will
be included in the returned list.
@tparam[1,opt=true] boolean include_dirs When @{false}, "raw" directories will
not be included in the returned list.
@tparam[2] string path The path to complete.
@tparam[2] string location The location where paths are resolved from.
@tparam[2] {
include_dirs? = boolean, include_files? = boolean,
include_hidden? = boolean
} options
This table form is an expanded version of the previous syntax. The
`include_files` and `include_dirs` arguments from above are passed in as fields.
This table also accepts the following options:
- `include_hidden`: Whether to include hidden files (those starting with `.`)
by default. They will still be shown when typing a `.`.
@treturn { string... } A list of possible completion candidates.
@since 1.74
@changed 1.101.0
@usage Complete files in the root directory.
read(nil, nil, function(str)
return fs.complete(str, "", true, false)
end)
@usage Complete files in the root directory, hiding hidden files by default.
read(nil, nil, function(str)
return fs.complete(str, "", {
include_files = true,
include_dirs = false,
included_hidden = false,
})
end)
]]
function complete(path, location, include_files, include_dirs) end

View File

@@ -1,177 +0,0 @@
--- Make HTTP requests, sending and receiving data to a remote web server.
--
-- @module http
-- @since 1.1
-- @see local_ips To allow accessing servers running on your local network.
--- Asynchronously make a HTTP request to the given url.
--
-- This returns immediately, a @{http_success} or @{http_failure} will be queued
-- once the request has completed.
--
-- @tparam string url The url to request
-- @tparam[opt] string body An optional string containing the body of the
-- request. If specified, a `POST` request will be made instead.
-- @tparam[opt] { [string] = string } headers Additional headers to send as part
-- of this request.
-- @tparam[opt] boolean binary Whether to make a binary HTTP request. If true,
-- the body will not be UTF-8 encoded, and the received response will not be
-- decoded.
--
-- @tparam[2] {
-- url = string, body? = string, headers? = { [string] = string },
-- binary? = boolean, method? = string, redirect? = boolean,
-- } request Options for the request.
--
-- This table form is an expanded version of the previous syntax. All arguments
-- from above are passed in as fields instead (for instance,
-- `http.request("https://example.com")` becomes `http.request { url =
-- "https://example.com" }`).
--
-- This table also accepts several additional options:
--
-- - `method`: Which HTTP method to use, for instance `"PATCH"` or `"DELETE"`.
-- - `redirect`: Whether to follow HTTP redirects. Defaults to true.
--
-- @see http.get For a synchronous way to make GET requests.
-- @see http.post For a synchronous way to make POST requests.
--
-- @changed 1.63 Added argument for headers.
-- @changed 1.80pr1 Added argument for binary handles.
-- @changed 1.80pr1.6 Added support for table argument.
-- @changed 1.86.0 Added PATCH and TRACE methods.
function request(...) end
--- Make a HTTP GET request to the given url.
--
-- @tparam string url The url to request
-- @tparam[opt] { [string] = string } headers Additional headers to send as part
-- of this request.
-- @tparam[opt] boolean binary Whether to make a binary HTTP request. If true,
-- the body will not be UTF-8 encoded, and the received response will not be
-- decoded.
--
-- @tparam[2] {
-- url = string, headers? = { [string] = string },
-- binary? = boolean, method? = string, redirect? = boolean,
-- } request Options for the request. See @{http.request} for details on how
-- these options behave.
--
-- @treturn Response The resulting http response, which can be read from.
-- @treturn[2] nil When the http request failed, such as in the event of a 404
-- error or connection timeout.
-- @treturn string A message detailing why the request failed.
-- @treturn Response|nil The failing http response, if available.
--
-- @changed 1.63 Added argument for headers.
-- @changed 1.80pr1 Response handles are now returned on error if available.
-- @changed 1.80pr1 Added argument for binary handles.
-- @changed 1.80pr1.6 Added support for table argument.
-- @changed 1.86.0 Added PATCH and TRACE methods.
--
-- @usage Make a request to [example.tweaked.cc](https://example.tweaked.cc),
-- and print the returned page.
-- ```lua
-- local request = http.get("https://example.tweaked.cc")
-- print(request.readAll())
-- -- => HTTP is working!
-- request.close()
-- ```
function get(...) end
--- Make a HTTP POST request to the given url.
--
-- @tparam string url The url to request
-- @tparam string body The body of the POST request.
-- @tparam[opt] { [string] = string } headers Additional headers to send as part
-- of this request.
-- @tparam[opt] boolean binary Whether to make a binary HTTP request. If true,
-- the body will not be UTF-8 encoded, and the received response will not be
-- decoded.
--
-- @tparam[2] {
-- url = string, body? = string, headers? = { [string] = string },
-- binary? = boolean, method? = string, redirect? = boolean,
-- } request Options for the request. See @{http.request} for details on how
-- these options behave.
--
-- @treturn Response The resulting http response, which can be read from.
-- @treturn[2] nil When the http request failed, such as in the event of a 404
-- error or connection timeout.
-- @treturn string A message detailing why the request failed.
-- @treturn Response|nil The failing http response, if available.
--
-- @since 1.31
-- @changed 1.63 Added argument for headers.
-- @changed 1.80pr1 Response handles are now returned on error if available.
-- @changed 1.80pr1 Added argument for binary handles.
-- @changed 1.80pr1.6 Added support for table argument.
-- @changed 1.86.0 Added PATCH and TRACE methods.
function post(...) end
--- Asynchronously determine whether a URL can be requested.
--
-- If this returns `true`, one should also listen for @{http_check} which will
-- container further information about whether the URL is allowed or not.
--
-- @tparam string url The URL to check.
-- @treturn true When this url is not invalid. This does not imply that it is
-- allowed - see the comment above.
-- @treturn[2] false When this url is invalid.
-- @treturn string A reason why this URL is not valid (for instance, if it is
-- malformed, or blocked).
--
-- @see http.checkURL For a synchronous version.
function checkURLAsync(url) end
--- Determine whether a URL can be requested.
--
-- If this returns `true`, one should also listen for @{http_check} which will
-- container further information about whether the URL is allowed or not.
--
-- @tparam string url The URL to check.
-- @treturn true When this url is valid and can be requested via @{http.request}.
-- @treturn[2] false When this url is invalid.
-- @treturn string A reason why this URL is not valid (for instance, if it is
-- malformed, or blocked).
--
-- @see http.checkURLAsync For an asynchronous version.
--
-- @usage
-- ```lua
-- print(http.checkURL("https://example.tweaked.cc/"))
-- -- => true
-- print(http.checkURL("http://localhost/"))
-- -- => false Domain not permitted
-- print(http.checkURL("not a url"))
-- -- => false URL malformed
-- ```
function checkURL(url) end
--- Open a websocket.
--
-- @tparam string url The websocket url to connect to. This should have the
-- `ws://` or `wss://` protocol.
-- @tparam[opt] { [string] = string } headers Additional headers to send as part
-- of the initial websocket connection.
--
-- @treturn Websocket The websocket connection.
-- @treturn[2] false If the websocket connection failed.
-- @treturn string An error message describing why the connection failed.
-- @since 1.80pr1.1
-- @changed 1.80pr1.3 No longer asynchronous.
-- @changed 1.95.3 Added User-Agent to default headers.
function websocket(url, headers) end
--- Asynchronously open a websocket.
--
-- This returns immediately, a @{websocket_success} or @{websocket_failure}
-- will be queued once the request has completed.
--
-- @tparam string url The websocket url to connect to. This should have the
-- `ws://` or `wss://` protocol.
-- @tparam[opt] { [string] = string } headers Additional headers to send as part
-- of the initial websocket connection.
-- @since 1.80pr1.3
-- @changed 1.95.3 Added User-Agent to default headers.
function websocketAsync(url, headers) end

View File

@@ -5,7 +5,7 @@ kotlin.stdlib.default.dependency=false
kotlin.jvm.target.validation.mode=error
# Mod properties
modVersion=1.101.0
modVersion=1.101.3
# Minecraft properties: We want to configure this here so we can read it in settings.gradle
mcVersion=1.16.5
mcVersion=1.18.2

View File

@@ -2,12 +2,12 @@
# Minecraft
# MC version is specified in gradle.properties, as we need that in settings.gradle.
forge = "36.2.34"
parchment = "2021.08.08"
parchmentMc = "1.16.5"
forge = "40.1.0"
parchment = "2022.03.13"
parchmentMc = "1.18.2"
autoService = "1.0.1"
cobalt = { strictly = "[0.5.8,0.6.0)", prefer = "0.5.8" }
cobalt = "0.6.0"
jetbrainsAnnotations = "23.0.0"
kotlin = "1.7.10"
kotlin-coroutines = "1.6.0"
@@ -19,11 +19,11 @@ junit = "5.9.1"
# Build tools
cctJavadoc = "1.5.2"
checkstyle = "8.25" # There's a reason we're pinned on an ancient version, but I can't remember what it is.
checkstyle = "10.3.4"
curseForgeGradle = "1.0.11"
forgeGradle = "5.1.+"
githubRelease = "2.2.12"
illuaminate = "0.1.0-7-g2a5a89c"
illuaminate = "0.1.0-20-g8c483a4"
librarian = "1.+"
minotaur = "2.+"
mixinGradle = "0.7.+"

View File

@@ -111,6 +111,6 @@
(lint
(globals
:max sleep write
cct_test describe expect howlci fail it pending stub)))
cct_test describe expect howlci fail it pending stub before_each)))
(at /src/web/mount/expr_template.lua (lint (globals :max __expr__)))

View File

@@ -3,8 +3,8 @@
{
"when": {
"OR": [
{"east": "false", "north": "false", "south": "false", "cable": "true", "up": "true", "west": "false"},
{"down": "true", "east": "false", "north": "false", "south": "false", "cable": "true", "west": "false"}
{"up": "true", "north": "false", "west": "false", "south": "false", "east": "false", "cable": "true"},
{"north": "false", "west": "false", "south": "false", "east": "false", "down": "true", "cable": "true"}
]
},
"apply": {"model": "computercraft:block/cable_core_facing", "x": 90}
@@ -13,16 +13,16 @@
"when": {
"OR": [
{
"down": "false",
"east": "false",
"north": "false",
"south": "false",
"cable": "true",
"up": "false",
"west": "false"
"north": "false",
"west": "false",
"south": "false",
"east": "false",
"down": "false",
"cable": "true"
},
{"down": "false", "east": "false", "north": "true", "cable": "true", "up": "false", "west": "false"},
{"down": "false", "east": "false", "south": "true", "cable": "true", "up": "false", "west": "false"}
{"up": "false", "west": "false", "north": "true", "east": "false", "down": "false", "cable": "true"},
{"up": "false", "west": "false", "south": "true", "east": "false", "down": "false", "cable": "true"}
]
},
"apply": {"model": "computercraft:block/cable_core_facing", "y": 0}
@@ -30,8 +30,8 @@
{
"when": {
"OR": [
{"down": "false", "east": "true", "north": "false", "south": "false", "cable": "true", "up": "false"},
{"down": "false", "north": "false", "south": "false", "cable": "true", "up": "false", "west": "true"}
{"up": "false", "north": "false", "south": "false", "east": "true", "down": "false", "cable": "true"},
{"up": "false", "north": "false", "west": "true", "south": "false", "down": "false", "cable": "true"}
]
},
"apply": {"model": "computercraft:block/cable_core_facing", "y": 90}
@@ -39,18 +39,18 @@
{
"when": {
"OR": [
{"down": "true", "north": "true", "cable": "true"},
{"down": "true", "south": "true", "cable": "true"},
{"down": "true", "cable": "true", "west": "true"},
{"down": "true", "east": "true", "cable": "true"},
{"north": "true", "cable": "true", "up": "true"},
{"south": "true", "cable": "true", "up": "true"},
{"cable": "true", "up": "true", "west": "true"},
{"east": "true", "cable": "true", "up": "true"},
{"north": "true", "cable": "true", "west": "true"},
{"east": "true", "north": "true", "cable": "true"},
{"south": "true", "cable": "true", "west": "true"},
{"east": "true", "south": "true", "cable": "true"}
{"north": "true", "down": "true", "cable": "true"},
{"south": "true", "down": "true", "cable": "true"},
{"west": "true", "down": "true", "cable": "true"},
{"east": "true", "down": "true", "cable": "true"},
{"up": "true", "north": "true", "cable": "true"},
{"up": "true", "south": "true", "cable": "true"},
{"up": "true", "west": "true", "cable": "true"},
{"up": "true", "east": "true", "cable": "true"},
{"north": "true", "west": "true", "cable": "true"},
{"north": "true", "east": "true", "cable": "true"},
{"west": "true", "south": "true", "cable": "true"},
{"south": "true", "east": "true", "cable": "true"}
]
},
"apply": {"model": "computercraft:block/cable_core_any"}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "minecraft:redstone"
"items": [
"minecraft:redstone"
]
},
{
"item": "minecraft:gold_ingot"
"items": [
"minecraft:gold_ingot"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:computer_normal"
"items": [
"computercraft:computer_normal"
]
},
{
"tag": "forge:ingots/gold"

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "minecraft:command_block"
"items": [
"minecraft:command_block"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:disk_drive"
"items": [
"computercraft:disk_drive"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:disk_drive"
"items": [
"computercraft:disk_drive"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:disk_drive"
"items": [
"computercraft:disk_drive"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:disk_drive"
"items": [
"computercraft:disk_drive"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:disk_drive"
"items": [
"computercraft:disk_drive"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:disk_drive"
"items": [
"computercraft:disk_drive"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:disk_drive"
"items": [
"computercraft:disk_drive"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:disk_drive"
"items": [
"computercraft:disk_drive"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:disk_drive"
"items": [
"computercraft:disk_drive"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:disk_drive"
"items": [
"computercraft:disk_drive"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:disk_drive"
"items": [
"computercraft:disk_drive"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:disk_drive"
"items": [
"computercraft:disk_drive"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:disk_drive"
"items": [
"computercraft:disk_drive"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:disk_drive"
"items": [
"computercraft:disk_drive"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:disk_drive"
"items": [
"computercraft:disk_drive"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:disk_drive"
"items": [
"computercraft:disk_drive"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_advanced"
"items": [
"computercraft:pocket_computer_advanced"
]
},
{
"item": "computercraft:speaker"
"items": [
"computercraft:speaker"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_advanced"
"items": [
"computercraft:pocket_computer_advanced"
]
},
{
"item": "computercraft:wireless_modem_advanced"
"items": [
"computercraft:wireless_modem_advanced"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_advanced"
"items": [
"computercraft:pocket_computer_advanced"
]
},
{
"item": "computercraft:wireless_modem_normal"
"items": [
"computercraft:wireless_modem_normal"
]
}
]
}

View File

@@ -21,7 +21,9 @@
"conditions": {
"items": [
{
"item": "minecraft:golden_apple"
"items": [
"minecraft:golden_apple"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_normal"
"items": [
"computercraft:pocket_computer_normal"
]
},
{
"tag": "forge:ingots/gold"

View File

@@ -21,7 +21,9 @@
"conditions": {
"items": [
{
"item": "minecraft:golden_apple"
"items": [
"minecraft:golden_apple"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_normal"
"items": [
"computercraft:pocket_computer_normal"
]
},
{
"item": "computercraft:speaker"
"items": [
"computercraft:speaker"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_normal"
"items": [
"computercraft:pocket_computer_normal"
]
},
{
"item": "computercraft:wireless_modem_advanced"
"items": [
"computercraft:wireless_modem_advanced"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_normal"
"items": [
"computercraft:pocket_computer_normal"
]
},
{
"item": "computercraft:wireless_modem_normal"
"items": [
"computercraft:wireless_modem_normal"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:printer"
"items": [
"computercraft:printer"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:printer"
"items": [
"computercraft:printer"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:computer_normal"
"items": [
"computercraft:computer_normal"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_advanced"
"items": [
"computercraft:turtle_advanced"
]
},
{
"item": "computercraft:speaker"
"items": [
"computercraft:speaker"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_advanced"
"items": [
"computercraft:turtle_advanced"
]
},
{
"item": "computercraft:wireless_modem_advanced"
"items": [
"computercraft:wireless_modem_advanced"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_advanced"
"items": [
"computercraft:turtle_advanced"
]
},
{
"item": "computercraft:wireless_modem_normal"
"items": [
"computercraft:wireless_modem_normal"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_advanced"
"items": [
"computercraft:turtle_advanced"
]
},
{
"item": "minecraft:crafting_table"
"items": [
"minecraft:crafting_table"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_advanced"
"items": [
"computercraft:turtle_advanced"
]
},
{
"item": "minecraft:diamond_axe"
"items": [
"minecraft:diamond_axe"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_advanced"
"items": [
"computercraft:turtle_advanced"
]
},
{
"item": "minecraft:diamond_hoe"
"items": [
"minecraft:diamond_hoe"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_advanced"
"items": [
"computercraft:turtle_advanced"
]
},
{
"item": "minecraft:diamond_pickaxe"
"items": [
"minecraft:diamond_pickaxe"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_advanced"
"items": [
"computercraft:turtle_advanced"
]
},
{
"item": "minecraft:diamond_shovel"
"items": [
"minecraft:diamond_shovel"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_advanced"
"items": [
"computercraft:turtle_advanced"
]
},
{
"item": "minecraft:diamond_sword"
"items": [
"minecraft:diamond_sword"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_normal"
"items": [
"computercraft:turtle_normal"
]
},
{
"tag": "forge:ingots/gold"

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:computer_normal"
"items": [
"computercraft:computer_normal"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_normal"
"items": [
"computercraft:turtle_normal"
]
},
{
"item": "computercraft:speaker"
"items": [
"computercraft:speaker"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_normal"
"items": [
"computercraft:turtle_normal"
]
},
{
"item": "computercraft:wireless_modem_advanced"
"items": [
"computercraft:wireless_modem_advanced"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_normal"
"items": [
"computercraft:turtle_normal"
]
},
{
"item": "computercraft:wireless_modem_normal"
"items": [
"computercraft:wireless_modem_normal"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_normal"
"items": [
"computercraft:turtle_normal"
]
},
{
"item": "minecraft:crafting_table"
"items": [
"minecraft:crafting_table"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_normal"
"items": [
"computercraft:turtle_normal"
]
},
{
"item": "minecraft:diamond_axe"
"items": [
"minecraft:diamond_axe"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_normal"
"items": [
"computercraft:turtle_normal"
]
},
{
"item": "minecraft:diamond_hoe"
"items": [
"minecraft:diamond_hoe"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_normal"
"items": [
"computercraft:turtle_normal"
]
},
{
"item": "minecraft:diamond_pickaxe"
"items": [
"minecraft:diamond_pickaxe"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_normal"
"items": [
"computercraft:turtle_normal"
]
},
{
"item": "minecraft:diamond_shovel"
"items": [
"minecraft:diamond_shovel"
]
}
]
}

View File

@@ -11,10 +11,14 @@
"conditions": {
"items": [
{
"item": "computercraft:turtle_normal"
"items": [
"computercraft:turtle_normal"
]
},
{
"item": "minecraft:diamond_sword"
"items": [
"minecraft:diamond_sword"
]
}
]
}

View File

@@ -21,7 +21,9 @@
"conditions": {
"items": [
{
"item": "computercraft:cable"
"items": [
"computercraft:cable"
]
}
]
}

View File

@@ -21,7 +21,9 @@
"conditions": {
"items": [
{
"item": "computercraft:wireless_modem_normal"
"items": [
"computercraft:wireless_modem_normal"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:monitor_normal"
"items": [
"computercraft:monitor_normal"
]
}
]
}

View File

@@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "computercraft:computer_advanced"
"items": [
"computercraft:computer_advanced"
]
}
]
}

View File

@@ -0,0 +1,4 @@
{
"type": "computercraft:speaker",
"item": "computercraft:speaker"
}

View File

@@ -0,0 +1,4 @@
{
"type": "computercraft:wireless_modem_advanced",
"item": "computercraft:wireless_modem_advanced"
}

View File

@@ -0,0 +1,4 @@
{
"type": "computercraft:wireless_modem_normal",
"item": "computercraft:wireless_modem_normal"
}

View File

@@ -0,0 +1,4 @@
{
"type": "computercraft:speaker",
"item": "computercraft:speaker"
}

View File

@@ -0,0 +1,4 @@
{
"type": "computercraft:wireless_modem_advanced",
"item": "computercraft:wireless_modem_advanced"
}

View File

@@ -0,0 +1,4 @@
{
"type": "computercraft:wireless_modem_normal",
"item": "computercraft:wireless_modem_normal"
}

View File

@@ -2,7 +2,8 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
@@ -23,7 +24,8 @@
]
},
{
"rolls": 1,
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",

View File

@@ -2,7 +2,8 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:dynamic",

View File

@@ -2,7 +2,8 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:dynamic",

View File

@@ -2,7 +2,8 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:dynamic",

View File

@@ -2,7 +2,8 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",

View File

@@ -2,7 +2,8 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",

View File

@@ -2,7 +2,8 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",

View File

@@ -2,7 +2,8 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",

View File

@@ -2,7 +2,8 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",

View File

@@ -2,7 +2,8 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:dynamic",

View File

@@ -2,7 +2,8 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:dynamic",

View File

@@ -2,7 +2,8 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",

View File

@@ -2,7 +2,8 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",

View File

@@ -2,7 +2,8 @@
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",

View File

@@ -10,7 +10,7 @@
"tag": "forge:ingots/gold"
},
"C": {
"item": "computercraft:computer_advanced"
"item": "computercraft:computer_normal"
}
},
"result": {

View File

@@ -10,7 +10,7 @@
"tag": "forge:ingots/gold"
},
"C": {
"item": "computercraft:computer_advanced"
"item": "computercraft:turtle_normal"
},
"B": {
"tag": "forge:storage_blocks/gold"

View File

@@ -2,6 +2,7 @@
"replace": false,
"values": [
"#minecraft:crops",
"#minecraft:mineable/hoe",
"minecraft:cactus",
"minecraft:melon",
"minecraft:pumpkin",

View File

@@ -1,6 +1,7 @@
{
"replace": false,
"values": [
"#minecraft:mineable/shovel",
"minecraft:melon",
"minecraft:pumpkin",
"minecraft:carved_pumpkin",

View File

@@ -0,0 +1,4 @@
{
"type": "computercraft:workbench",
"item": "minecraft:crafting_table"
}

View File

@@ -0,0 +1,5 @@
{
"type": "computercraft:tool",
"item": "minecraft:diamond_axe",
"damageMultiplier": 6.0
}

View File

@@ -0,0 +1,5 @@
{
"type": "computercraft:tool",
"item": "minecraft:diamond_hoe",
"breakable": "computercraft:turtle_hoe_harvestable"
}

View File

@@ -0,0 +1,4 @@
{
"type": "computercraft:tool",
"item": "minecraft:diamond_pickaxe"
}

View File

@@ -0,0 +1,5 @@
{
"type": "computercraft:tool",
"item": "minecraft:diamond_shovel",
"breakable": "computercraft:turtle_shovel_harvestable"
}

View File

@@ -0,0 +1,6 @@
{
"type": "computercraft:tool",
"item": "minecraft:diamond_sword",
"damageMultiplier": 9.0,
"breakable": "computercraft:turtle_sword_harvestable"
}

View File

@@ -0,0 +1,18 @@
{
"replace": false,
"values": [
"computercraft:computer_normal",
"computercraft:computer_advanced",
"computercraft:turtle_normal",
"computercraft:turtle_advanced",
"computercraft:speaker",
"computercraft:disk_drive",
"computercraft:printer",
"computercraft:monitor_normal",
"computercraft:monitor_advanced",
"computercraft:wireless_modem_normal",
"computercraft:wireless_modem_advanced",
"computercraft:wired_modem_full",
"computercraft:cable"
]
}

View File

@@ -5,20 +5,17 @@
*/
package dan200.computercraft;
import dan200.computercraft.api.turtle.event.TurtleAction;
import dan200.computercraft.core.apis.http.options.Action;
import dan200.computercraft.core.apis.http.options.AddressRule;
import dan200.computercraft.shared.Config;
import dan200.computercraft.shared.Registry;
import dan200.computercraft.shared.peripheral.monitor.MonitorRenderer;
import dan200.computercraft.shared.pocket.peripherals.PocketModem;
import dan200.computercraft.shared.pocket.peripherals.PocketSpeaker;
import dan200.computercraft.shared.turtle.upgrades.*;
import net.minecraftforge.fml.common.Mod;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.*;
import java.util.List;
import java.util.OptionalInt;
import java.util.concurrent.TimeUnit;
@Mod( ComputerCraft.MOD_ID )
@@ -40,10 +37,10 @@ public final class ComputerCraft
public static boolean httpEnabled = true;
public static boolean httpWebsocketEnabled = true;
public static List<AddressRule> httpRules = Collections.unmodifiableList( Arrays.asList(
public static List<AddressRule> httpRules = List.of(
AddressRule.parse( "$private", OptionalInt.empty(), Action.DENY.toPartial() ),
AddressRule.parse( "*", OptionalInt.empty(), Action.ALLOW.toPartial() )
) );
);
public static int httpMaxRequests = 16;
public static int httpMaxWebsockets = 4;
@@ -57,7 +54,7 @@ public final class ComputerCraft
public static int modemHighAltitudeRangeDuringStorm = 384;
public static int maxNotesPerTick = 8;
public static MonitorRenderer monitorRenderer = MonitorRenderer.BEST;
public static double monitorDistanceSq = 4096;
public static int monitorDistance = 65;
public static long monitorBandwidth = 1_000_000;
public static boolean turtlesNeedFuel = true;
@@ -65,7 +62,6 @@ public final class ComputerCraft
public static int advancedTurtleFuelLimit = 100000;
public static boolean turtlesObeyBlockProtection = true;
public static boolean turtlesCanPush = true;
public static EnumSet<TurtleAction> turtleDisabledActions = EnumSet.noneOf( TurtleAction.class );
public static int computerTermWidth = 51;
public static int computerTermHeight = 19;
@@ -81,28 +77,7 @@ public final class ComputerCraft
public static int uploadNagDelay = 5;
public static final class TurtleUpgrades
{
public static TurtleModem wirelessModemNormal;
public static TurtleModem wirelessModemAdvanced;
public static TurtleSpeaker speaker;
public static TurtleCraftingTable craftingTable;
public static TurtleSword diamondSword;
public static TurtleShovel diamondShovel;
public static TurtleTool diamondPickaxe;
public static TurtleAxe diamondAxe;
public static TurtleHoe diamondHoe;
}
public static final class PocketUpgrades
{
public static PocketModem wirelessModemNormal;
public static PocketModem wirelessModemAdvanced;
public static PocketSpeaker speaker;
}
public static final Logger log = LogManager.getLogger( MOD_ID );
public static final Logger log = LoggerFactory.getLogger( MOD_ID );
public ComputerCraft()
{

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