1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-22 09:27:39 +00:00

Update to Minecraft 1.21

API Changes:

 - Minecraft had updated ModelResourceLocation to no longer inherit from
   ResourceLocation.

   To allow referencing both already baked models
   (ModelResourceLocation) and loading new models (via ResourceLocation)
   in turtle model loadders, we add a new "ModelLocation" class, that
   acts as a union between the two.

   I'm not entirely convinced by the design here, so might end up
   changing again before a stable release.o

 - Merge IMedia.getAudioTitle and IMedia.getAudio into a single
   IMedia.getAudio method, which now returns a JukeboxSong rather than a
   SoundEvent.

Other update notes:
 - Minecraft had rewritten how buffers are managed again. This is a
   fairly minor change for us (vertex -> addVertex, normal -> setNormal,
   etc...), with the exception that you can no longer use
   MultiBufferSource.immediate with the tesselator.

   I've replaced this with GuiGraphics.bufferSource, which appears to be
   fine, but worth keeping an eye on in case there's any odd render
   state issues.

 - Crafting now uses a CraftingInput (a list of items) rather than a
   CraftingContainer, which allows us to simplify turtle crafting code.
This commit is contained in:
Jonathan Coates
2024-06-22 16:19:59 +01:00
parent bb933d0100
commit 4b102f16b3
292 changed files with 665 additions and 655 deletions

View File

@@ -14,7 +14,7 @@ import net.neoforged.neoforge.capabilities.BlockCapability;
* from a block.
*/
public final class WiredElementCapability {
public static final ResourceLocation ID = new ResourceLocation(ComputerCraftAPI.MOD_ID, "wired_node");
public static final ResourceLocation ID = ResourceLocation.fromNamespaceAndPath(ComputerCraftAPI.MOD_ID, "wired_node");
private static final BlockCapability<WiredElement, Direction> capability = BlockCapability.create(ID, WiredElement.class, Direction.class);

View File

@@ -14,7 +14,7 @@ import net.neoforged.neoforge.capabilities.BlockCapability;
* for a block. It should <em>NOT</em> be used to query peripherals.
*/
public final class PeripheralCapability {
public static final ResourceLocation ID = new ResourceLocation(ComputerCraftAPI.MOD_ID, "peripheral");
public static final ResourceLocation ID = ResourceLocation.fromNamespaceAndPath(ComputerCraftAPI.MOD_ID, "peripheral");
private static final BlockCapability<IPeripheral, Direction> capability = BlockCapability.create(ID, IPeripheral.class, Direction.class);