1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-31 13:42:59 +00:00

Update to Minecraft 1.19.3

Lots of minor changes, but nothing too nasty - just tedious.

Known bugs/issues:
 - REI and JEI haven't been updated at the time of writing, so our usage
   of their APIs may be incompatible.

 - Crash when opening the config UI in Fabric, as forgeconfigapi-port
   hasn't been updated yet.

Will hold off on doing a release until those mods have updated.
This commit is contained in:
Jonathan Coates
2022-12-08 19:45:02 +00:00
parent 3b42f22a4f
commit c3fe9f00d4
373 changed files with 886 additions and 728 deletions

View File

@@ -8,14 +8,14 @@ package dan200.computercraft.client.model;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.mojang.blaze3d.vertex.VertexFormat;
import com.mojang.blaze3d.vertex.VertexFormatElement;
import com.mojang.math.Matrix4f;
import com.mojang.math.Transformation;
import com.mojang.math.Vector4f;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.core.Direction;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.block.state.BlockState;
import org.joml.Matrix4f;
import org.joml.Vector4f;
import javax.annotation.Nullable;
import java.util.ArrayList;
@@ -64,8 +64,7 @@ public class TransformedBakedModel extends CustomBakedModel {
// Transform the position
var pos = new Vector4f(x, y, z, 1);
pos.transform(transformation);
pos.perspectiveDivide();
transformation.transformProject(pos);
vertexData[start] = Float.floatToRawIntBits(pos.x());
vertexData[start + 1] = Float.floatToRawIntBits(pos.y());

View File

@@ -5,7 +5,6 @@
*/
package dan200.computercraft.client.model.turtle;
import com.mojang.datafixers.util.Pair;
import dan200.computercraft.api.ComputerCraftAPI;
import net.fabricmc.fabric.api.client.model.ModelProviderException;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
@@ -16,7 +15,9 @@ import net.minecraft.util.GsonHelper;
import javax.annotation.Nullable;
import java.io.IOException;
import java.util.*;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.function.Function;
public final class TurtleModelLoader {
@@ -57,15 +58,13 @@ public final class TurtleModelLoader {
}
@Override
public Collection<Material> getMaterials(Function<ResourceLocation, UnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
Set<Material> materials = new HashSet<>();
materials.addAll(modelGetter.apply(model).getMaterials(modelGetter, missingTextureErrors));
materials.addAll(modelGetter.apply(COLOUR_TURTLE_MODEL).getMaterials(modelGetter, missingTextureErrors));
return materials;
public void resolveParents(Function<ResourceLocation, UnbakedModel> function) {
function.apply(model).resolveParents(function);
function.apply(COLOUR_TURTLE_MODEL).resolveParents(function);
}
@Override
public BakedModel bake(ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, ModelState transform, ResourceLocation location) {
public BakedModel bake(ModelBaker bakery, Function<Material, TextureAtlasSprite> spriteGetter, ModelState transform, ResourceLocation location) {
var mainModel = bakery.bake(model, transform);
if (mainModel == null) throw new NullPointerException(model + " failed to bake");

View File

@@ -8,7 +8,7 @@ package dan200.computercraft.mixin.client;
import dan200.computercraft.client.ClientRegistry;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.ShaderInstance;
import net.minecraft.server.packs.resources.ResourceManager;
import net.minecraft.server.packs.resources.ResourceProvider;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@@ -29,7 +29,7 @@ class GameRendererMixin {
@Inject(method = "reloadShaders", at = @At(value = "TAIL"))
@SuppressWarnings("UnusedMethod")
private void onReloadShaders(ResourceManager resourceManager, CallbackInfo ci) {
private void onReloadShaders(ResourceProvider resourceManager, CallbackInfo ci) {
try {
ClientRegistry.registerShaders(resourceManager, (shader, callback) -> {
shaders.put(shader.getName(), shader);

View File

@@ -20,7 +20,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
class ItemFrameRendererMixin {
@Inject(
method = "render(Lnet/minecraft/world/entity/decoration/ItemFrame;FFLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V",
at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/PoseStack;mulPose(Lcom/mojang/math/Quaternion;)V", ordinal = 2, shift = At.Shift.AFTER),
at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/PoseStack;mulPose(Lorg/joml/Quaternionf;)V", ordinal = 2, shift = At.Shift.AFTER),
cancellable = true
)
@SuppressWarnings("UnusedMethod")

View File

@@ -166,6 +166,7 @@
"gui.computercraft.config.upload_nag_delay": "Upload nag delay",
"gui.computercraft.config.upload_nag_delay.tooltip": "The delay in seconds after which we'll notify about unhandled imports. Set to 0 to disable.\nRange: 0 ~ 60",
"gui.computercraft.pocket_computer_overlay": "Pocket computer open. Press ESC to close.",
"gui.computercraft.terminal": "Computer terminal",
"gui.computercraft.tooltip.computer_id": "Computer ID: %s",
"gui.computercraft.tooltip.copy": "Copy to clipboard",
"gui.computercraft.tooltip.disk_id": "Disk ID: %s",

View File

@@ -1,5 +1,6 @@
{
"type": "minecraft:crafting_shaped",
"category": "redstone",
"key": {"#": {"item": "minecraft:stone"}, "R": {"tag": "c:redstone_dusts"}},
"pattern": [" # ", "#R#", " # "],
"result": {"count": 6, "item": "computercraft:cable"}

View File

@@ -1 +1 @@
{"type": "computercraft:colour"}
{"type": "computercraft:colour", "category": "misc"}

View File

@@ -1,5 +1,6 @@
{
"type": "minecraft:crafting_shaped",
"category": "redstone",
"key": {"#": {"tag": "c:gold_ingots"}, "G": {"tag": "c:glass_panes"}, "R": {"tag": "c:redstone_dusts"}},
"pattern": ["###", "#R#", "#G#"],
"result": {"item": "computercraft:computer_advanced"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:computer_upgrade",
"category": "redstone",
"family": "ADVANCED",
"key": {"#": {"tag": "c:gold_ingots"}, "C": {"item": "computercraft:computer_normal"}},
"pattern": ["###", "#C#", "# #"],

View File

@@ -1,5 +1,6 @@
{
"type": "minecraft:crafting_shaped",
"category": "redstone",
"key": {
"#": {"tag": "c:gold_ingots"},
"G": {"tag": "c:glass_panes"},

View File

@@ -1,5 +1,6 @@
{
"type": "minecraft:crafting_shaped",
"category": "redstone",
"key": {"#": {"item": "minecraft:stone"}, "G": {"tag": "c:glass_panes"}, "R": {"tag": "c:redstone_dusts"}},
"pattern": ["###", "#R#", "#G#"],
"result": {"item": "computercraft:computer_normal"}

View File

@@ -1 +1 @@
{"type": "computercraft:disk"}
{"type": "computercraft:disk", "category": "misc"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shapeless",
"category": "redstone",
"group": "computercraft:disk",
"ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:black_dye"}],
"result": {"item": "computercraft:disk", "nbt": "{Color:1118481}"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shapeless",
"category": "redstone",
"group": "computercraft:disk",
"ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:pink_dye"}],
"result": {"item": "computercraft:disk", "nbt": "{Color:15905484}"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shapeless",
"category": "redstone",
"group": "computercraft:disk",
"ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:lime_dye"}],
"result": {"item": "computercraft:disk", "nbt": "{Color:8375321}"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shapeless",
"category": "redstone",
"group": "computercraft:disk",
"ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:yellow_dye"}],
"result": {"item": "computercraft:disk", "nbt": "{Color:14605932}"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shapeless",
"category": "redstone",
"group": "computercraft:disk",
"ingredients": [
{"tag": "c:redstone_dusts"},

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shapeless",
"category": "redstone",
"group": "computercraft:disk",
"ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:magenta_dye"}],
"result": {"item": "computercraft:disk", "nbt": "{Color:15040472}"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shapeless",
"category": "redstone",
"group": "computercraft:disk",
"ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:orange_dye"}],
"result": {"item": "computercraft:disk", "nbt": "{Color:15905331}"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shapeless",
"category": "redstone",
"group": "computercraft:disk",
"ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:white_dye"}],
"result": {"item": "computercraft:disk", "nbt": "{Color:15790320}"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shapeless",
"category": "redstone",
"group": "computercraft:disk",
"ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:red_dye"}],
"result": {"item": "computercraft:disk", "nbt": "{Color:13388876}"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shapeless",
"category": "redstone",
"group": "computercraft:disk",
"ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:green_dye"}],
"result": {"item": "computercraft:disk", "nbt": "{Color:5744206}"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shapeless",
"category": "redstone",
"group": "computercraft:disk",
"ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:brown_dye"}],
"result": {"item": "computercraft:disk", "nbt": "{Color:8349260}"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shapeless",
"category": "redstone",
"group": "computercraft:disk",
"ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:blue_dye"}],
"result": {"item": "computercraft:disk", "nbt": "{Color:3368652}"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shapeless",
"category": "redstone",
"group": "computercraft:disk",
"ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:purple_dye"}],
"result": {"item": "computercraft:disk", "nbt": "{Color:11691749}"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shapeless",
"category": "redstone",
"group": "computercraft:disk",
"ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:cyan_dye"}],
"result": {"item": "computercraft:disk", "nbt": "{Color:5020082}"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shapeless",
"category": "redstone",
"group": "computercraft:disk",
"ingredients": [
{"tag": "c:redstone_dusts"},

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shapeless",
"category": "redstone",
"group": "computercraft:disk",
"ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:gray_dye"}],
"result": {"item": "computercraft:disk", "nbt": "{Color:5000268}"}

View File

@@ -1,5 +1,6 @@
{
"type": "minecraft:crafting_shaped",
"category": "redstone",
"key": {"#": {"item": "minecraft:stone"}, "R": {"tag": "c:redstone_dusts"}},
"pattern": ["###", "#R#", "#R#"],
"result": {"item": "computercraft:disk_drive"}

View File

@@ -1,5 +1,6 @@
{
"type": "minecraft:crafting_shaped",
"category": "redstone",
"key": {"#": {"tag": "c:gold_ingots"}, "G": {"tag": "c:glass_panes"}},
"pattern": ["###", "#G#", "###"],
"result": {"count": 4, "item": "computercraft:monitor_advanced"}

View File

@@ -1,5 +1,6 @@
{
"type": "minecraft:crafting_shaped",
"category": "redstone",
"key": {"#": {"item": "minecraft:stone"}, "G": {"tag": "c:glass_panes"}},
"pattern": ["###", "#G#", "###"],
"result": {"item": "computercraft:monitor_normal"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shaped",
"category": "redstone",
"group": "computercraft:pocket_advanced",
"key": {"#": {"item": "computercraft:speaker"}, "P": {"item": "computercraft:pocket_computer_advanced"}},
"pattern": ["#", "P"],

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shaped",
"category": "redstone",
"group": "computercraft:pocket_advanced",
"key": {
"#": {"item": "computercraft:wireless_modem_advanced"},

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:impostor_shaped",
"category": "redstone",
"group": "computercraft:pocket_advanced",
"key": {
"#": {"item": "computercraft:wireless_modem_normal"},

View File

@@ -1,5 +1,6 @@
{
"type": "minecraft:crafting_shaped",
"category": "redstone",
"key": {"#": {"tag": "c:gold_ingots"}, "A": {"item": "minecraft:golden_apple"}, "G": {"tag": "c:glass_panes"}},
"pattern": ["###", "#A#", "#G#"],
"result": {"item": "computercraft:pocket_computer_advanced"}

View File

@@ -1,5 +1,6 @@
{
"type": "computercraft:computer_upgrade",
"category": "redstone",
"family": "ADVANCED",
"key": {"#": {"tag": "c:gold_ingots"}, "C": {"item": "computercraft:pocket_computer_normal"}},
"pattern": ["###", "#C#", "# #"],

View File

@@ -1,5 +1,6 @@
{
"type": "minecraft:crafting_shaped",
"category": "redstone",
"key": {
"#": {"item": "minecraft:stone"},
"A": {"item": "minecraft:golden_apple"},

Some files were not shown because too many files have changed in this diff Show More