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

1635 Commits

Author SHA1 Message Date
Jonathan Coates
695ef0542a
Don't store a mutable array in Colour
It's kinda bad form, and we no longer need it anyway!
2022-10-21 19:07:58 +01:00
Jonathan Coates
c0d20b72c9
Remove ClientTerminal/ServerTerminal
They bring very little to the table now that computers do their own
thing! This also helps simplify the code in ServerMonitor a bit - turns
out we had two "dirty" flags in the implementation!
2022-10-21 19:00:29 +01:00
Jonathan Coates
cf05ab1db1
Store colour support in the Terminal
Previously we stored it alongside the terminal. While this makes sense -
it's not a property of the terminal itself, it ends up duplicating code
in a bunch of places.

We now track the colour flag on the terminal itself. This allows us to
simplify a couple of things:

 - The palette now also knows whether it supports colours or not, and so
   performs greyscale conversion. This means we no longer need to thread
   a "greyscale" flag throughout terminal rendering.

 - Remove isColour() getters from a whole load of
   places (TerminalMethods, ServerTerminal, IComputerEnvironment).
2022-10-21 18:26:57 +01:00
Jonathan Coates
c49547b962
Remove ClientComputer
Historically CC has maintained two computer registries; one on the
server (which runs the actual computer) and one on the client (which
stores the terminal and some small bits of additional data).

This means when a user opens the computer UI, we send the terminal
contents and store it in the client computer registry. We then send the
instance id alongside the "open container" packet, which is used to look
up the client computer (and thus terminal) in our client-side registry.

This patch makes the computer menu syncing behaviour more consistent
with vanilla. The initial terminal contents is sent alongside the "open
container" packet, and subsequent terminal changes apply /just/ to the
open container. Computer on/off state is synced via a vanilla
ContainerData/IIntArray.

Likewise, sending user input to the server now targets the open
container, rather than an arbitrary instance id.

The one remaining usage of ClientComputer is for pocket computers. For
these, we still need to sync the current on/off/blinking state and the
pocket computer light.

We don't need the full ClientComputer interface for this case (after
all, you can't send input to a pocket computer someone else is
holding!). This means we can tear out ClientComputer and
ClientComputerRegistry, replacing it with a much simpler
ClientPocketComputers store.

This in turn allows the following changes:

 - Remove IComputer, as we no longer need to abstract over client and
   server computers.

 - Likewise, we can merge ComputerRegistry into the server
   registry. This commit also cleans up the handling of instance IDs a
   little bit: ServerComputers are now responsible for generating their
   ID and adding/removing themselves from the registry.

 - As the client-side terminal will never be null, we can remove a whole
   bunch of null checks throughout the codebase.

 - As the terminal is available immediately, we don't need to explicitly
   pass in terminal sizes to the computer GUIs. This means we're no
   longer reliant on those config values on the client side!

 - Remove the "request computer state" packet. Pocket computers now
   store which players need to know the computer state, automatically
   sending data when a new player starts tracking the computer.
2022-10-21 18:17:43 +01:00
Jonathan Coates
12b8a0393f
Dump Cobalt's internal state on timeouts
Closes #1180
2022-10-09 11:22:16 +01:00
Patrick 'Quezler' Mounier
8564c1e54b
Add all but 3 of the missing dutch translations 2022-10-08 21:00:58 +02:00
Jonathan Coates
5be290a1e2
Bump version to 1.100.10
One more version and then it's a palendrome! Sort of.
2022-10-01 12:33:06 +01:00
Jonathan Coates
371f931140
Always add HTTP programs to the path (#1172) 2022-09-30 09:00:07 +00:00
Jonathan Coates
da5956e943
Make the sidebar a little wider
I was going to do something productive tonight, but then this happened.

Whatever, I'm retired, I'm allowed to make my entire existence just
adding 50px to things. Heck, maybe I'll do the same tomorrow too.
2022-09-29 22:21:38 +01:00
roland-a
0b7fbcde53
Send block updates to client when the turtle moves #1167 (#1170)
Fixes #1167
2022-09-29 17:49:02 +00:00
Jonathan Coates
c3b7302108
Remove some unused arguments in LuaDateTime
See comments in #1157
2022-09-11 15:03:09 +01:00
Jonathan Coates
61ac48c99f
Mention audio formats in speaker help
Closes #1133. I'm not super happy about any of the versions proposed
there, but I think this is better than nothing.

Co-authored-by: JackMacWindows <jackmacwindowslinux@gmail.com>
2022-09-11 14:57:45 +01:00
Jonathan Coates
d22e138413
Fix numerous off-by-one errors in help program
We clamped various values to the height of the screen, rather than the
height of the content box (height-1). We didn't notice this most of the
time as the last line of a file is empty - it only really mattered when
a file was the same height as the computer's screen.

We now do the following:
 - Strip the trailing new line from a file when reading.
 - Replace most usages of height with height-1.
2022-09-11 14:57:34 +01:00
Ivo Leal
9d18487dc5
Fixed usage example of textuils.pagedTabulate 2022-08-28 15:24:47 +01:00
Jonathan Coates
e2041f7438
Bump version to 1.100.9 2022-07-27 08:25:31 +01:00
Jonathan Coates
d61202e2b8
Fix location of language file 2022-07-27 07:52:05 +01:00
Weblate
6ce88a7dcf Translations for Norwegian Bokmål
Co-authored-by: Erlend <erlend.bergersen@sandnesskolen.no>
2022-07-26 13:17:57 +00:00
Weblate
5d65b3e654 Added translation for Norwegian Bokmål
Co-authored-by: Erlend <erlend.bergersen@sandnesskolen.no>
2022-07-24 15:45:46 +00:00
Erlend
abf857f864
Clearify GPS documentation note (#1139) 2022-07-22 20:27:27 +00:00
Jonathan Coates
b28c1ac8e0
Test various time locales exist
Not clear if we can really test their behaviour too much.

See 69b211b4fb.
2022-07-21 09:44:40 +01:00
Jonathan Coates
ba976f9a16
Fix monitor depth blocker being too small
This allowed you to see transparent blocks through the bottom/right
margins of the monitor when using the VBO renderer.
2022-07-16 22:07:15 +01:00
Luiz Krüger
969feb4a1c
ItemGroup info on getItemDetail (#1127) 2022-07-16 20:30:20 +00:00
JackMacWindows
bd5de11ad5
Add WAV support to speaker program (#1112) 2022-07-09 08:59:35 +01:00
Jonathan Coates
5366fcb9c8
Point people towards the http.rules config option
Rather than blanket disabling http with http.enabled. I think it's still
useful to keep the option around, but hopefully make it clearer what the
ramifications are.
2022-07-08 22:13:39 +01:00
heap-underflow
4cfd0a2d1c
Fix off-by-1 error in generic inventory's getItemLimit() (#1131) 2022-07-08 07:44:13 +00:00
Jonathan Coates
be3a960273
Check for duplicate ids when registering channels
Should prevent #1130 occurring again. Possibly worth submitting a PR to
Forge for this too.
2022-07-08 08:27:37 +01:00
Jonathan Coates
56f0e0674f
Fix term.blit failing on substrings
Hahah. Serves me right for trying to optimise too much. Fixes #1123.
2022-07-02 16:47:43 +01:00
Toad-Dev
51c3a9d8af
Fix z-fighting on bold printout borders.
- Changed page background to render as one quad, instead of two halves.
- Set page background to a z-offset that is between zeroth (potentially
  bold border) and subsequent background pages. Bold borders were at the
  same z-offset before.
2022-07-02 11:24:40 +01:00
Johnny Irvin
b7fa4102df
Fix spell err Turtle API Doc
* `throug` -> `through`
2022-07-01 09:19:11 -04:00
Jonathan Coates
d1e952770d
Bump version to 1.100.8 2022-06-23 20:44:14 +01:00
Jonathan Coates
6d5b13dbbc
Revert "Switch over to using SLF4J"
This reverts commit b7f698d6f7.

Apparently slf4j is on the classpath in dev but not in live. Will apply
this on 1.18 and later instead.
2022-06-20 19:52:23 +01:00
Jonathan Coates
b7f698d6f7
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-19 11:10:53 +01:00
Jonathan Coates
93f3cd4a53
Fix lock code being null for newly placed blocks
This causes an NPE when serialising or opening printers and disk drives.
Fixes #1109
2022-06-16 07:56:54 +01:00
Jonathan Coates
1e044aed68
Bump version to 1.100.6 2022-06-09 23:41:43 +01:00
Jonathan Coates
cbbb34cdd4
Normalise language files again
Weblate keeps making things uppercase >_>
2022-06-09 08:43:19 +01:00
Weblate
ca58e39707 Translations for Ukrainian
Co-authored-by: RobloMinerYT <svatoslatus2005@gmail.com>
2022-06-07 04:23:27 +00:00
Weblate
0aac966239 Added translation for Ukrainian
Co-authored-by: RobloMinerYT <svatoslatus2005@gmail.com>
2022-06-06 11:55:10 +00:00
Jonathan Coates
0e1e8dfa8c
Add recipes to more pages
Might be better if we had pages for each block, but this'll do for now.
2022-06-05 12:20:07 +01:00
Jonathan Coates
a1cbc1d803
Fix turtles not preserving their lock when moving 2022-06-04 15:30:42 +01:00
Jonathan Coates
b91809bfc7
Move some eldritch horrors to another directory
Also fix make-doc.sh uploading the wrong file.
2022-06-01 01:02:26 +01:00
Jonathan Coates
178126725e
Add more eldritch horrors to the build system
- Add a basic data exporter to the test mod, run via a /ccexport
   command. This dumps all of CC's recipes, and the item icons needed to
   display those recipes.

 - Post-process our illuaminate HTML, applying several transforms:
    - Apply syntax highlighting to code blocks. We previously did this
      at runtime, so this shaves some bytes off the bundle.

    - Convert a mc-recipe custom element into a recipe grid using
      react/react-dom.

 - Add a recipe to the speaker page. I'll probably clean this up in the
   future (though someone else is free to too!), but it's a nice
   start and proof-of-concept.

I tried so hard here to use next.js and MDX instead of rolling our own
solution again, but it's so hard to make it play well with "normal"
Markdown, which isn't explicitly written for MDX.
2022-06-01 00:48:36 +01:00
Jonathan Coates
cd76425877
Tiny bits and bobs
Oh my, what good commit discipline!

 - Remove unused method in NetworkHandler.
 - Correctly pass the transformation to ComputerBorderRenderer.
2022-05-30 17:42:33 +01:00
Jonathan Coates
4411756b06
Use a queue rather than a set in TickScheduler
We now track whether a tile is enqueued or not via an atomic boolean on
the block entity itself, rather than using a hash set. This is
significantly faster (>10x).

This is mostly intended for monitors, as they're the only peripheral
likely to call TickScheduler.schedule lots of times (rather than modems,
which just invoke it when opening/closing a channel[^1])[^2]. This
change is enough to allow me to update 120 monitors each tick without
any major tearing.

[^1]: GPS does do this on each gps.locate call, so it will help there,
but modems are typically limited by other computers sending messages,
not peripheral calls themselves.

[^2]: Note that montitors implement their own change tracking, so still
only call this once per tick. But it's enough to introduce some latency!
2022-05-30 14:25:51 +01:00
Jonathan Coates
1fd57a874f
Send terminal text and colours separately
This gives us slightly better compression, as backgrounds will often be
a single run of colours while the foreground won't be.

In practice, this is rarely an issue, as most terminals are small, but
worth doing anyway.
2022-05-30 13:44:11 +01:00
Jonathan Coates
3f0704624e
Fix location of DFPWM test 2022-05-30 13:36:36 +01:00
Jonathan Coates
3b6cd783cb
Don't allow modems to be used in adventure mode
This (along with computer locking) should be Good Enough for BlanketCon.
2022-05-28 09:23:23 +01:00
Jonathan Coates
ab22726883
Preserve on-state of pocket computers
This is far less robust than block-based computers, but I don't think it
needs to be. Fixes #1097 Or closes? Unclear - I'm counting this as a
bug.
2022-05-27 22:23:04 +01:00
Jonathan Coates
2efad38f53
Allow computers and inventories to be locked
Just like vanilla locking, this isn't accessible in survival.

> "im retired! im retired!!", i continue to insist as i slowly shrink
> and transform into a corn cob.
2022-05-27 22:22:54 +01:00
Drew Edwards
8b89d88d04
Allow other mods to provide extra item/block details (#1101) 2022-05-24 22:21:18 +01:00
Drew Edwards
bbc0afa111 Make ComputerScreenBase methods extendable 2022-05-23 17:13:17 +01:00