1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2026-07-03 10:00:48 +00:00
Commit Graph

748 Commits

Author SHA1 Message Date
Jonathan Coates 715d2e01db Bump CC:T to 1.120.0 2026-06-15 22:30:32 +01:00
Jonathan Coates 3ecc17ec90 Update dependencies
- Update Loom — required for MC 26.2.
 - Update TeaVM, using the new reflection API.
2026-06-15 20:33:55 +01:00
Jonathan Coates a76220b395 Revert redundant indexOf
I'd considered moving this into the HostRange in
27137c67f7, but eventually decided against
it. Just didn't fully revert the commit!
2026-06-15 18:39:49 +01:00
Jonathan Coates 27137c67f7 Refactor host rule code a little
Now we just use builtin INetAddress predicates or HostRange, rather than
a mix of custom predicates, sets and HostRange.

Also add some other ranges from the reserved list, and link to that list
to make it a bit easier to find stuff in the future.
2026-06-08 13:47:29 +01:00
Jonathan Coates 57ea451d60 Fix a few small typos
Well, mostly my inability to spell.
2026-06-06 11:39:29 +01:00
Jonathan Coates d1bfb2571d Block RFC 8215-style addresses too.
I don't konw if this actually matters, but better safe than sorry.
Everything here confuses me — my understanding of RFC 6052 was that
private IP addresses cannot be used with NAT64, but AWS apparently
allows it? Not sure if I or Amazon is wrong (or both!).
2026-06-05 09:42:41 +01:00
Jonathan Coates 8f8e22a06f Some documentation on startup files
Fixes #2233, closes #1069. I don't love this (and the examples are a
massive hack!), but it's better than nothing.
2026-05-28 17:05:14 +01:00
Ruby H 15a5e776cb Support spawning new parallel functions (#2263)
- Split implementation of `parallel.waitFor{All,Any}` up. Their
   implementations are now sufficiently complicated it doesn't make
   sense to share the core.

 - Support spawning new functions from within `parallel.waitForAll`.

 - Flesh out the `parallel.waitForAll` docs a little.
2026-05-26 14:13:07 +00:00
Jonathan Coates 432214f70a Bump CC:T to 1.119.0 2026-05-16 14:57:17 +01:00
Jonathan Coates 585b6d4d39 Block NAT64 addresses 2026-05-16 14:41:37 +01:00
Jonathan Coates 87916cf342 Prohibit specifying interface in IPv6 addresses 2026-05-16 14:37:21 +01:00
Jonathan Coates 39aab8c384 Add cc.base64 module
Don't love the API here, but really trying to overthink *everything*.

Closes #1960.
2026-05-15 14:30:48 +01:00
sircfenner b23ac67702 Fix min & sec field defaults in os.time (#2436)
These defaults are wrongly set to 12. They should be 0 for parity with
stock Lua.
2026-05-09 10:55:07 +01:00
Jonathan Coates defb713483 Add commands.getDimension()
Debated "commands.getBlockDimension()" instead, to match
getBlockPosition, but I think this is fine.

Fixes #1866.
2026-05-07 13:36:05 +01:00
Jonathan Coates 39a12893e3 Fix handling of integer indexes in CobaltLuaTable
- Add a new LuaTable.get(int) overload to handle getting an integer key
   instead.
 - Update CobaltLuaMachine for more sensible Java->LuaValue conversion
   for looking up keys.
 - Add some tests for our two LuaTable implementations.
 - Randomly reformat two files because spotless is ???

Fixes #2430
2026-05-02 13:50:58 +01:00
Jonathan Coates abe3d3410f Remove pathWithExtension
This doesn't actually do anything: paths will never have a trailing
slash, so it's just equivalent to `x..".lua"`.
2026-04-29 11:42:56 +01:00
Jonathan Coates 2c58040ae6 Bump CC:T to 1.118.0 2026-04-26 17:39:17 +01:00
Jonathan Coates c526e9a40c Add commands.getEntity
- Add (very basic) details provider for entities.
 - Add commands.getEntity(selector) function, which gets details for all
   matching entities.

Fixes #2383
2026-04-25 18:22:06 +01:00
Jonathan Coates 813d1151c7 Add timeout to rednet.lookup
Fixes #2364
2026-04-25 17:39:07 +01:00
Jonathan Coates a624f88200 Clear terminal in edit program on resize event (#2401) 2026-04-21 18:26:07 +01:00
ItsVingtdeux db32ddfec5 Add documentation for the setting_changed event (#2405) 2026-04-07 21:35:42 +00:00
Jonathan Coates 2c7da47019 Update dependencies
- Bump Gradle to 9.4.1. This fixes the Kotlin Java 24 warnings.
 - Update Typescript to 6.0
2026-04-07 22:10:14 +01:00
Wojbie 888186bac3 Clear terminal in edit program on resize event 2026-03-22 00:05:25 +01:00
Pink 19b8433653 Fix shebang absolute path handling (#2398)
The shebang/interpreter program is run with the *resolved* path of the
original program. However, this path was not marked with a leading `/`,
meaning interpreters may try to resolve it again.

We now add an explicit leading `/`, to ensure the path is treated as
absolute.
2026-03-19 18:59:51 +00:00
ItsVingtdeux e62dd6df5e Replace references to resource packs with data packs (#2396) 2026-03-19 18:58:28 +00:00
Jonathan Coates 57a6add81a Bump CC:T to 1.117.1 2026-02-22 13:00:32 +00:00
Mariano Alipi 4bc04f1416 Update TurtleAPI documentation for block breaking (#2380)
Clarified the description of block breaking capabilities for mining turtles.
2026-01-30 19:52:43 +00:00
Jonathan Coates a0571e444c Fix getResponseHeaders @since version
Closes #2378
2026-01-28 23:56:53 +00:00
Meme Tech 7292e3298f Fix discrepancy in type help (#2374) 2026-01-28 10:38:26 +00:00
Jonathan Coates 46f5dc485e Fix more issues caused by Java 25 update
- Bump CC:T Javadoc version, to fix issues with dropping newlines when
   converting to Markdown. I'd originally planned to switch to
   Markdown-style Javadocs, but tooling is stil a bit lacking
   (Intelli's formatting of @params is entirely broken for instance).

 - Force more recent ASM version, to allow Forge to run.
2026-01-28 09:24:52 +00:00
Jonathan Coates 4a6ec54813 Remove "CC may be installed incorrectly" message
It /technically/ may be the case, but in the days of modern mod loaders,
much less likely. Normally this is user error.

Closes #2372.
2026-01-25 09:39:13 +00:00
Jonathan Coates c98b99863d Update some build tooling
Mostly now use JDK 25 to build, to allow us to use markdown docstrings
in the future — this makes the javadoc generator *much* simpler.
2026-01-25 09:39:13 +00:00
UQuark 419441164d Fix #2355 (#2367)
If a fluid uses NBT tags, then when we construct our NBT-less
FluidStack, then the fluid does not match and will not be transferred.
Instead, we search the source tank for a matching FluidStack, and use
that directly.

This is a bit limiting if a tank contains multiple versions of the fluid
with different NBT, but hopefully that's not too common.

Fixes #2355
2026-01-17 20:49:56 +00:00
Jonathan Coates b7d1d9d012 Limit lenght of sound name
Fixes #2366
2026-01-17 20:15:28 +00:00
Jonathan Coates 2105c5c13f Don't materialise the whole split list
This should avoid allocating slightly less memory *in some cases*. I
dare say there's still ways to OOM here. But also, if you want to OOM
the server, you don't need to place a sign to do it!

Closes #2365.
2026-01-17 20:03:41 +00:00
Jonathan Coates d5e0b0ad2a Bump CC:T to 1.117.0
A day early, but my commitment to the bit is waning.
2025-12-24 09:07:02 +00:00
Jonathan Coates 24fd27d2a3 Add test for potion durations 2025-12-24 08:51:15 +00:00
Jonathan Coates 90e7307fb4 Fix websocket_closed not always being queued on failure
- Reorganise the HTTP test code to make it a bit more extensible. Add
   support for sending messages to connected websockets.
 - Provide a friendlier message for too-large-payload errors.
 - Return failure reason from Websocket.receive

Fixes #2149.
2025-12-19 21:12:37 +00:00
Jonathan Coates 1520bebb6c Simplify event code in LuaTaskContext
We remove support for multiple event listeners, and now just use a
simple event queue again. This makes the code a little simpler, and
removes the risk of race conditions where we do do something, and it
queues the event before we call pullEvent().
2025-12-19 21:12:31 +00:00
Jonathan Coates 419d823d3b Update Redstone in onNeighborChange
We removed onNeighborChange in 676fb5fb53,
on the basis that this was no longer needed for peripheral updates.
However, it *is* required for redstone updates, as MoreRed does not
trigger any block updates for bundled cables.

Fixes #2316.
2025-12-18 15:06:01 +00:00
Jonathan Coates f820cd8b43 Rewrite the GPS setup guide
Mostly trying to avoid the number of asides, to make it a bit more
straightforward. I'm not entirely sure I succeeded.

Fixes #1681, closes #1542.
2025-12-18 13:30:12 +00:00
Jonathan Coates 4b1541154b Add Websocket.getResponseHeaders method
Closes #1387
2025-12-17 23:11:12 +00:00
Jonathan Coates 8a1a545ab1 Add reference for item details
Also change potion display name to include potency, to match
enchantments.
2025-12-17 18:27:45 +00:00
Jonathan Coates 7659c608a6 Dynamically pick the port in HTTP tests 2025-12-17 14:03:38 +00:00
Jonathan Coates 778805a8d8 Add reference for block details
I do not like the flow of this page, but did not know how better to
structure it.

We really need a way to write things which use the same type syntax as
parameters. I don't like how this (and events!) are formatted so
differently. It'll do for now though.
2025-12-16 23:13:21 +00:00
Jonathan Coates f31d8febbf Handle more of Windows's weird paths
AFAICT, any sequence of ".[ .]*" (except from "") is equivalent to "."
on Windows. Let's handle that in our path sanitisation code.

Fixes #2151.
2025-12-15 23:48:54 +00:00
Jonathan Coates 60bcb9d4d3 Add potion effects to item details
There's some nasty hacks here around potion durations on other items.
This should get a bit cleaner in newer versions of the game, once we
switch to data components.

Fixes #2266.
2025-12-15 22:16:53 +00:00
Jonathan Coates 1ea84fe7d7 Clear turtle player inventory when syncing
Fixes #2332.

I *think* what's going on here is:
 - When we place a block with the turtle, we copy items between the
   turtle's inventory and the fake player's inventory. We *don't* clear
   items from the fake player's inventory after placing, as we'll do it
   next time we use the fake player.

 - At the start of the next tick, Stack Refill then loops over the
   fake player's inventory and moves some items around. However, because
   we just set the items directly (rather than using .copy()), this
   mutates the items in the turtle's inventory too!

To fix this, we just clear the player's inventory after finishing with
it, so Stack Refill never sees these items.
2025-12-15 20:58:01 +00:00
ShreksHellraiser a2ed5c385c Add MapColor metadata provider for block and item details (#2164) 2025-12-15 20:33:42 +00:00
Jonathan Coates 9ad3b03946 Let pocket computer on lecterns wrap the peripheral below
- Shuffle some of the accessors in PocketComputerItem around, to make
   them easier to use in the lectern code.

   I still don't think we've got a good interface here. We could
   possibly move more of the update code into PocketBrain, and just have
   PocketComputerItem responsible for syncing brain<->stack
   state. Something to fiddle with, but not sure it would be any
   cleaner.

 - Set the bottom peripheral when the pocket computer is placed in the
   lectern (and on block updates, etc...), and clear it when removed.

   Again, the code here is uglier than I would like (particularly with
   all the instanceofs). I did wonder about having some LecternBehaviour
   class, which holds the printout/pocket-specific state, but there's so
   many places we need to hook in (and they're so different between the
   two), I'm not sure it's worth it right now.

Fixes #2126, closes #2223.
2025-12-15 19:22:40 +00:00