1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2026-06-02 02:42:06 +00:00
Commit Graph

2910 Commits

Author SHA1 Message Date
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
Jonathan Coates 5f704b2c58 Test for relay initial input 2025-12-15 15:45:11 +00:00
Jonathan Coates 53509b0d82 Revert disableRecompilation
This doesn't apply parchment mappings, and so parameters are all named
"o". This confuses OverridingMethodInconsistentArgumentNamesChecker, so
let's ignore this for now.
2025-12-15 15:03:52 +00:00
Jonathan Coates 013f2e500f Refresh relay input/output on load
We now forcibly update all redstone inputs/outputs when the relay is
first placed.

It's not entirely clear to me if this is the right solution. The
alternative one would be to persist the redstone state instead. However,
most peripherals do *not* do this (e.g. monitor, speaker), so let's
match that for now.

Fixes #2175.
2025-12-15 14:47:27 +00:00
Jonathan Coates 6702ab8f9d Enable TeaVM WASM GC Backend
I'd tried this ages ago, and had some issues I utterly failed to find a
minimal reproducer for. Now it Just Works.
2025-12-15 14:17:03 +00:00
Jonathan Coates 16d934265a Update TeaVM version
We no longer require any patches against TeaVM. Still shipping our own
for now, until 0.14 is stable.

<3 konsoletyper
2025-12-15 14:07:11 +00:00
Jonathan Coates ff9f038275 Another build tooling bump
- Update to latest MDG, to avoid decompiling Minecraft in CI.
 - Fix several Gradle warnings.
 - Bump ErrorProne, and fix a few more nits.
2025-12-15 12:42:38 +00:00
Jonathan Coates 1f5339c86e Avoid using TickScheduler unless needed
Fixes #2190, or at least works around the problems in BuildingGadgets
enough.
2025-12-14 22:30:09 +00:00
Jonathan Coates 28e569f2b4 Support mouse events for lectern pocket computers
Ideally we'd be able to support right clicking on anything when we have
a NoTermComputerScreen open. However, that's incredibly awkward to do
(see c45fc94752, and discussion in #2160),
so instead we create a new PocketComputerLecternScreen, which handles
mouse events.

We need to do some awkward converting the player's position and look
vector into the terminal's coordinate space, and then projecting it onto
the terminal screen, but otherwise this is fairly straightforward.

Closes #2330.
2025-12-14 17:22:15 +00:00
Jonathan Coates 28682aa468 Rewrite computer input handling (again)
Hey, it lasted almost a year!

Computer input is somewhat stateful, as we need to track things like
which key(s) are currently held, and what the last mouse button/position
was. This code is currently duplicated in several places (specifically
TerminalWidget, ServerInputState and the standalone emulator).

In order to implement lectern pocket computer mouse interactions, we'd
have to duplicate this logic once again. Instead, we move this code into
a common class.

 - Replace the InputHandler interface with a simpler ComputerInput one
   (this no longer has computer actions, like reboot or terminate). This
   interface never made much sense (aside from hiding implementation
   details), as code only ever consumed a single implementation of it.

   On the client, this requires a new "ClientComputerActions" class.
   This feels a bit clunky to me, but it's simple and it works.

 - Replace ComputerEvents with a EventComputerInput class (terrible
   name, I know!), which queues events on a computer.

 - Move common input state tracking and validation into a single
   UserComputerInput class, which wraps an existing ComputerInput. This
   is used by both the terminal widget, and the server-side input state.
2025-12-14 16:53:18 +00:00
Jonathan Coates 2a35d17906 Clarify behaviour around drawImage cursor 2025-12-09 23:15:45 +00:00
Jonathan Coates d39c91b25a Update build tooling 2025-12-09 17:52:18 +00:00
Tomodachi94 61e9626302 Retroactively document changes to os.version() (#2323) 2025-11-23 13:49:55 +00:00
JackMacWindows 307bebd5d2 Fix missing return value docs in shell.openTab (#2333) 2025-11-22 08:16:58 +00:00
Jonathan Coates 6334a9df15 Clarify which sounds can be played with speaker
Closes #2327
2025-11-18 19:23:14 +00:00
Jonathan Coates 08d12f2b0e Remove Fabric config patcher 2025-11-09 09:37:26 +00:00
Jonathan Coates fbdf0d677f Sync translations from Crowdin 2025-11-09 09:23:59 +00:00
Jonathan Coates 18f3426f1d Bump CC:T to 1.116.2 v1.20.1-1.116.2 2025-11-01 19:40:52 +00:00
Jonathan Coates 0ec46fe38e Update CI to use Java 21 2025-10-31 22:27:38 +00:00
Jonathan Coates 569de7fafb Update to Gradle 9.2
- Update to Loom 1.12. This requires Java 21, so we now build with Java
   21, but targetting 17. The new "-release" flag does make this much
   easier, so hopefully shouldn't cause too many issues.

 - Bump versions of a lot of other things.

 - Fix various errorprone/checkstyle grumbles.
2025-10-31 19:50:44 +00:00
Jonathan Coates 157ce4fa55 Update Create for Fabric
Awww no, here we go again.

The Forge/Fabric versions are identical again, but keeping them separate
for now, as I'm a) lazy and b) not convinced they won't diverge again.

Fixes #2311
2025-10-26 12:39:08 +00:00
Jonathan Coates b9ed66983d Fix some isues in SNBT parsing
- Accept the full range of unquoted strings
 - Fix error when failing to parse an unquoted string

See #2277. This is not sufficient to close the issue (wow, there's so
much more wrong with the code), but at least stops unserialiseJSON
crashing.
2025-08-31 12:11:34 +01:00
Jonathan Coates d0fbec6c6b Add bounds checks for compartment lookup
This *shouldn't* be needed, as the compartment index is always >= 0, and
Inventory.getItem returns an empty stack if the item is not found.

However, some mods pass a negative compartment index, which causes
getItem to throw an AIOOB instead.

Fixes #2267
2025-08-28 08:10:35 +01:00
Zirunis a683697e8c Fixed two typos in dfpwm.lua (#2272) 2025-08-27 06:47:42 +01:00
Zirunis 9e233a916f Fixed typo in docstring of textutils.serializeJSON (#2260) 2025-08-08 10:45:46 +01:00
Jonathan Coates 5a9e21ccc3 Clarify behaviour of itemGroups field
The availability of this field changes between Minecraft versions, but we
didn't make that entirely clear.

See #2247
2025-07-20 11:16:39 +01:00
Jonathan Coates 5f16909d4b Remove empty-argument optimisation
This doesn't work with getTableUnsafe, as empty arguments are considered
closed already. We could argubly special-case the empty args, but the
optimisation has very minor benefits, so I don't think worrying about too
much.

Fixes #2246.
2025-07-19 22:24:32 +01:00
Jonathan Coates 00475b9bb0 Support LuaTable arguments in @LuaFunction 2025-07-14 08:11:35 +01:00
Jonathan Coates 018ce7c8a5 Bump CC:T to 1.116.1 v1.20.1-1.116.1 2025-07-12 18:57:05 +01:00
Jonathan Coates 44726827b4 Sync translations from Crowdin 2025-07-12 09:49:14 +01:00
Jonathan Coates 3cf914cb4c Fix NPE when loading mcfunctions
CommandSourceStack.getServer can be null, despite being marked as
non-nullable. Mojang!!! *shakes fist*

Fixes #2235.
2025-07-10 00:47:42 +01:00
Batári Balázs László 180156ff1c Add lang hu_hu (#2232) 2025-07-06 21:47:22 +00:00
Jonathan Coates c6ba753568 Update allowed Minecraft versions 2025-07-06 22:34:43 +01:00
Jonathan Coates 9f45c91925 Update to latest TeaVM 2025-07-02 09:21:43 +01:00
Jonathan Coates 8344c0a5c2 Bump CC:T to 1.116.0 v1.20.1-1.116.0 2025-06-28 11:03:52 +01:00
Jonathan Coates a292d33830 Syntax highlighting for multiline tokens in edit
I don't love the implementation of this (see discussion in #2220), but
it's better than nothing. Wow, the editor really needs a bit of a
rewrite, the code is kinda messy.

Fixes #1396.
2025-06-25 22:50:23 +01:00
Jonathan Coates 341d1c7bc2 Move paint/edit menu bar into common module
I want to add a menu bar to the edit runner too, so let's make this code
a little more reusable first.
2025-06-25 22:14:09 +01:00
Jonathan Coates 531eacfac7 Merge pull request #2224 from matematikaadit/patch-1
Miniscule typo fix in the shell.path() doc comment
2025-06-21 16:59:01 +01:00
Adit Cahya Ramadhan 1f3da5205c Miniscule typo fix in the shell.path() doc comment
Noticed this when reading the shell API page in the wiki.
2025-06-21 22:29:04 +07:00