Commit Graph
545 Commits
Author SHA1 Message Date
Jonathan Coates 7ba8d20f55 Rename "bottom" pocket upgrade slot to "top"
With the introduction of lecterns exposing modem peripherals, the
bottom peripheral slot can be set by both upgrades and modems. Instead,
we replace the "bottom" upgrade slot with a "top" one.

This is a little more messy than I'd like. I'd originally gone for
"bottom" as it means we keep the recipe the same as before (the upgrade
above goes to the back, the upgrade below goes to the bottom). With this
change, the upgrade above now goes to the top slot, while the one below
goes to the back.

This introduces several breaking changes:
 - pocket.(un)equipBottom -> pocket.(un)equipTop.
 - There is no datafixer for this change. I'm not sure we can viably do
   it, given we're making this change inside an MC version. We can
   always write one for 26.1 -> 26.2 if needed.

Given all the versions this has been available for are in alpha, and on
relatively unpopular versions (1.21.11/26.1/26.2) I don't think it's the
end of the world. Fingers crossed.

Closes #2459.
2026-07-05 12:03:22 +01:00
Jonathan Coates 14f047c80f Deprecate ITurtleUpgrade.createKey
There's no IPocketUpgrade version of this, and I'm not actually sure it
adds much benefit.
2026-07-05 11:30:11 +01:00
Jonathan Coates eac8c13d31 Merge branch 'mc-1.21.x' into mc-26.2 2026-07-05 11:25:12 +01:00
Jonathan Coates cc147c36e4 Merge branch 'mc-1.20.x' into mc-1.21.x 2026-07-02 15:21:04 +01:00
Jonathan Coates b4805fd765 Add tests to check dynamic recipes are well-formed
- Check whether impostor recipes (and other custom shaped/shapeless
   recipes) match the "real" recipe.
 - Check whether our upgrade recipe generator generates valid recipes.
   Reasoning about left/right upgrades (and top/back ones on 26.2) is a
   bit confusing, so this should prevent any errors.
2026-07-02 15:03:00 +01:00
Jonathan Coates e7ba061f84 Replace boring List with exciting ColorCollection 2026-07-01 22:21:58 +01:00
Jonathan Coates d57c05a7eb Run datagen
Was somewhat blocked on neoforged/NeoForge#3228.
2026-06-17 19:16:34 +01:00
Jonathan Coates 51c7c1ce3f Update to Minecraft 26.2
- Move block and item ids into separate API-accessible classes, to
   match vanilla.
 - Switch to Fabric's built-in permission API. We no longer need to
   optionally support fabric-permission-api, which makes things a bit
   simpler.
 - Lots of rendering changes. Crucially, switch monitor rendering back
   to using VBOs, using the new FeatureRenderer system. This currently
   requires mixins on Fabric, but there's a PR open to add an API for
   it in the future.
2026-06-16 17:33:30 +01:00
Jonathan Coates 06abd03e9f Re-enable REI integration 2026-06-15 23:32:22 +01:00
Jonathan Coates 5403b7070b Merge branch 'mc-1.21.x' into mc-26.1 2026-06-15 22:37:15 +01:00
Jonathan Coates 95d4b99b13 Support Fabric's getCreatorNamespace
Whoops, only a year late. I'd forgotten this got merged.
2026-05-27 12:23:52 +01:00
Jonathan Coates 810fdcb5ed Merge branch 'mc-1.21.x' into mc-26.1 2026-05-16 15:30:29 +01:00
Jonathan Coates 5f76d42e4d Merge branch 'mc-1.20.x' into mc-1.21.x 2026-05-16 14:57:45 +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 5adb1aa0d9 Reshuffle shaped recipe code to work with JEI
This still does a bunch of "instanceof ShapedRecipe" rather than relying
on DisplayInfo, so didn't work with our custom recipes.
2026-04-28 11:13:28 +01:00
Jonathan Coates 332fcae244 Update JEI to MC 26.1.2 version
Unfortunately it's entirely broken with our custom recipes — JEI is
hard-coded to only work with vanilla's ShapedRecipe, even if a recipe
returns a ShapedCraftingRecipeDisplay.
2026-04-28 10:26:43 +01:00
Jonathan Coates 4edd30c8c4 Transform breaking overlay to match turtle's rotation 2026-04-28 09:46:26 +01:00
Jonathan Coates d7b115c68a Reorgainse recipe serialisers
- Use a fixed instance for colour/uncolour recipes. This prevents
   issues where StreamCodec.unit gets a different instance than what it
   was created with.

   Fixes #2423.

 - Move RecipeSerializer instances to the recipe class, rather than in
   the mod registry. This matches vanilla's structure.
2026-04-28 09:42:35 +01:00
Jonathan Coates b024d4af9a Merge branch 'mc-1.21.x' into mc-26.1 2026-04-26 18:31:12 +01:00
Jonathan Coates 6c701badc9 Merge branch 'mc-1.20.x' into mc-1.21.x 2026-04-26 18:11:59 +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 451edd57ae Fix NF repositories
Apparently the root one was removed at some point, and now one must use
"/releases".
2026-04-21 18:18:47 +01:00
Jonathan Coates 8be5c28484 Update to 26.1
- Replace vanilla-extract with Fabric Loom for common mod. Now that we
   no longer have to worry about remapping, this probably makes more
   sense.

 - Switch turtle upgrades to use ItemStackTemplate. Yay, immutability! I
   think I might change up the upgrade API here a bit, but not a blocker
   for release.

 - Lots of small things. I'm very glad for our game tests — these caught
   a fair few bugs.
2026-04-13 19:06:44 +01:00
Jonathan Coates f31d0b20e6 Merge branch 'mc-1.21.x' into mc-1.21.y 2026-02-22 13:11:47 +00:00
Jonathan Coates bed861fe7a Merge branch 'mc-1.20.x' into mc-1.21.x
Whoops!
2026-02-22 13:01:42 +00:00
Jonathan Coates a2c8e5ec3c Merge branch 'mc-1.20.x' into mc-1.21.x 2026-02-22 12:56:26 +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 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 23985ef41f Remove MoreRed integration
Post 1.21.1, MoreRed switched to using ExMachina[^1] for handling
bundled redstone connections, meaning our existing integration code
crashed. While the changes seem really cool, the documentation is
lacking, and I just haven't got the spoons to puzzle through it all. For
now, let's just remove support — PRs very much welcome to add it back!

Closes #2309

[^1]: https://github.com/Commoble/exmachina
2025-12-28 12:43:20 +00:00
Jonathan Coates 0005ee9657 Add tests for consistent getItemDetails behaviour
Closes #2346.
2025-12-28 11:01:57 +00:00
Jonathan Coates b481aa95f2 Merge branch 'mc-1.21.x' into mc-1.21.y
There's definitely some more work to be done here — I need a datafixer
to move pocket upgrades from the bottom to the top — but it otherwise
seems to work.
2025-12-24 19:06:14 +00:00
Jonathan Coates 17867b5d8b Merge branch 'mc-1.20.x' into mc-1.21.x 2025-12-24 09:16:38 +00:00
Jonathan Coates 24fd27d2a3 Add test for potion durations 2025-12-24 08:51:15 +00:00
Jonathan Coates 446b6772a9 Merge branch 'mc-1.20.x' into mc-1.21.x 2025-12-22 09:58:02 +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 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 309b78eb8a Update JEI to MC 1.21.11 2025-12-17 13:14:14 +00:00
Jonathan Coates a072b116fa Update to 1.21.11
90% just ResourceLocation → Identifier. Also:
 - StandaloneModel now needs to detect which atlas to use, as the block
   and item atlases are different.

 - MultiLineLabel now always draws in white with a drop shadow, so we go
   back to manual word-wrapping for now.
2025-12-17 11:34:12 +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 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 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 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