I want to decouple the storage of upgrades (e.g. in data components) from
what people consume in the public API. This removes UpgradeData from
the API, pushing all interactions to go through UpgradeHandle.
- Split UpgradeHandle into a read-only UpgradeHandle and read/write
MutableUpgradeHandle. {IPocketAccess,ITurtleAccess}.getUpgrade return
a mutable version, and turtle modellers consume a read-only version.
- Remove setUpgrade from the public API. This now lives in the internal
TurtleAccessInternal (much like PocketComputerInternal did already).
Finding/looking-up an upgrade has never been exposed to the API, so
I don't think this is a big loss.
- Remove all other upgrade getters (either returning the upgrade or
UpgradeData) from the turtle/pocket access.
- Configure JUnit tests to write OTR files.
- Add a custom OTR reporter to the gametest framework.
- Update parse-reports to ingest OTR files.
- Gather all report files and publish them as an artifact.
Bump to Nullaway 0.14.3, which fixes the issues we were seeing. This
requires a couple of annotation changes in the code.
Now that we've finally conquered null checking, it's clearly time to add
another static analysis tool. Maybe I'll write my own, who knows.
This is not perfect, but I think as good as we're going to get it.
Because ItemStack's data is not typed in older versions, we don't apply
data fixers to upgrade items (aside from the componentisation fix). This
means that any migration between 3564 and 3818.5 will be skipped.
- `UpgradeData` now (optionally) stores the upgrade's item in addition
to the upgrade's data. If the item is not explicitly specified, the
item is created via `UpgradeBase.getUpgradeItem` as before.
- Add `UpdateBase.getCraftingIngredient`, allowing upgrades to work with
multiple items.
- Add `Abstract{Turtle,Pocket}Upgrade.StackAware` class, for upgrades
which support this new API.
- Add `UpgradeHandle` (and matching `I{Turtle,Pocket}.getUpgradeHandle`
getters), for reading/writing upgrade data.
- Allow TransformedModel to also hold a list of tints for the model.
- Update our turtle item colour provider to fetch tints from the
upgrade's TransformedModel.
This requires rewriting the quads in the upgrade model, mapping the
existing tint indices to (2 * tintIndex) + (left ? 1 : 2). We already
have to rewrite quads to apply transformations, so fortunately this
isn't too bad.
I have no clue how this is going to work on 26.3 though 😬.
- Add a custom turtle upgrade modeller for the storage upgrade that
applies the shulker tint colour.
- Add a new ThreadUtils.newReentrantLock/newReentrantReadWriteLock
functions. These use Guava's CycleDetectingLockFactory to create a
cycle-detecting lock in a development environment.
- Rename ForbiddenImports to ForbiddenAPIs, and forbid constructing
these instances directly, requiring you to go through ThreadUtils.
- Add support for extracting a ContainerTransfer from a container-like
item (shulkers, and in the future, bundles). For Forge we can just
use capabilities, but Fabric doesn't support this in 1.20, so we roll
our own there.
- Adds a new TurtleStorage peripheral, which allows transferring items
to/from these container-like items.
- Register a turtle storage upgrade for every shulker. This is
currently gated behind a datapack, as I want some time to mull on the
API, and don't want to ship this as a stable feature quite yet.
Closes#2213.
- Replace our existing ContainerTransfer class with a more general
ItemContainer. This supports all the functionality we need for our
inventory peripheral.
- Change AbstractInventoryMethod to use ContainerTransfer. This reduces
the duplicated code between the two InventoryMethod implementations
(well, somewhat) — they only now have to handle extracting
ContainerTransfers.
This is what both Fabric and NeoForge uses. This fixes the compilation
mismatch in DataFixersMixin — ModifyArg.at is now an array, so the
annotation data is slightly different. Annoyingly `javap -v` doesn't
show this, but asm's textifier does.
Add a new HttpHandler interface, which handles checkUrl, request and
websocket calls for a computer. The default implementation is provided
by a NettyHttp class, which also stores any related HTTP config and
state.
This is a little over-engineered, but has two advantages:
- Our Javascript/TeaVM implementation can now just implement this
interface, rather than patching/overwriting classes.
- This removes the final (large) bits of global state/config from
CC:T's core. Our tests no longer need to temporarily override global
address rules, and the traffic shaping handler no longer requires
resetting.
It might be a bit nicer to move all the netty-specific code into a
dan200.computercraft.apis.http.netty package, so there's some cleaner
separation from the common code, but I'm trying to avoid moving code
about any more than I have to.
This is an identical fix to 013f2e500f,
but for computers rather than redstone integrators.
I don't love the duplication — it might make more sense to move this
into RedstoneState.updateOutput and have an "initial tick" flag there
instead.
Fixes#2392.
Giving up on waiting for the NeoForge version, so we reshuffle this to
avoid calling getUnderlyingVertexFormat — the RenderType's vertex format
reports this fine.
I did consider dropping all this code and just falling back to the slow
fixed width font renderer when the vertex format doesn't match our
direct one — the overhead is much lower than what it used to be — but
does still touching some internals of BufferBuilder, so probably best
avoided right now.
- Switch GUIs to use SDL. We map keys to the old GLFW key codes to
avoid another hard-coding-the-keys debacle.
- Some changes to data generation, as recipes and loot table providers
now just use registry patches.
Still some small bits which need cleaning up (waiting on an Iris release
for NeoForge, would be good to switch some of our code to number
providers), but it mostly works.
- Fix missing license header and some over-eager gitignore removals.
- Fix several isolated project errors. I think all the remaining ones
come from limitations in other projects:
- MDG's mod configs don't support referencing source sets from other
projects.
- idea-ext is terrible in every way.
There's some nastiness in MergeTrees where we can't do
`resources.elements.map { it.single() }` as it throws a configuration
cache error, so we now use a ConfigurableFileCollection. Somehow it
still works.
- Fix a whole bunch of ErrorProne warnings. It's still quite noisy, but
most of the remaining ones now come from Java.
- Move some config from java-conventions to a new base-conventions,
which can be used for non-Java projects. As part of this, we now kill
the CCTweaked plugin, and just install the cct extension in
base-conventions instead.
- Kill inlineProject/externalSources. We now:
- Add an embeddedProject configuration which is used to define
projects that are embedded within the final jar. We do some fun
variant resolution in ExternalProjectArtifacts to extract the
class/resource/source directories from the configuration.
- Add a new verifyClassesMatch task which recompiles the game and
ensures compiling everything against the loader's version of
Minecraft gives us the same result.
- Fix *some* cross-project isolation issues. This appears to be the
bare minimum to make the configuration cache happy. There is
obviously a lot more work to do here.
- Enable Configuration cache.
- Fix some new checkstyle/errorprone/nullaway warnings.
Using typos[^1]. I wrote a config for this years ago, but never checked
it in. All things considered, there's fewer than I expected.
Fun fact: the CCPL contains the text "if added to to the main
repository", and I can't/shouldn't fix it, because it's an external
license!
[^1]: https://github.com/crate-ci/typos/
- Move some access wideners now that I've (finally) PRed them to
Fabric.
- Fix InventoryMethodsContract test to use the correct empty stack
size.
- Support NF's new mod menu.
Just clarify a couple of things which are a little confusing.
- Explicitly initialise the position within deployOnEntity, rather than
relying on getWithPosition above.
- Rename "position" to "blockPos" in deployOnBlock to make it clearer
whose position it is.
- Clarify that we need to call use(...) for all directions.