Hadn't realised that a MDG version bump started enabling this in CI.
Ughgr, wish people didn't change behaviour based on environment
variables, makes it harder to test.
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
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.
- 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.
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().
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.
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.
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.
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.
- 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.
This doesn't apply parchment mappings, and so parameters are all named
"o". This confuses OverridingMethodInconsistentArgumentNamesChecker, so
let's ignore this for now.
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.
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.
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.
- 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.
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
- 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.
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
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.