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:
		| @@ -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()); | ||||
|   | ||||
| @@ -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"); | ||||
| 
 | ||||
|   | ||||
| @@ -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); | ||||
|   | ||||
| @@ -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") | ||||
|   | ||||
| @@ -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", | ||||
|   | ||||
| @@ -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"} | ||||
|   | ||||
| @@ -1 +1 @@ | ||||
| {"type": "computercraft:colour"} | ||||
| {"type": "computercraft:colour", "category": "misc"} | ||||
|   | ||||
| @@ -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"} | ||||
|   | ||||
| @@ -1,5 +1,6 @@ | ||||
| { | ||||
|   "type": "computercraft:computer_upgrade", | ||||
|   "category": "redstone", | ||||
|   "family": "ADVANCED", | ||||
|   "key": {"#": {"tag": "c:gold_ingots"}, "C": {"item": "computercraft:computer_normal"}}, | ||||
|   "pattern": ["###", "#C#", "# #"], | ||||
|   | ||||
| @@ -1,5 +1,6 @@ | ||||
| { | ||||
|   "type": "minecraft:crafting_shaped", | ||||
|   "category": "redstone", | ||||
|   "key": { | ||||
|     "#": {"tag": "c:gold_ingots"}, | ||||
|     "G": {"tag": "c:glass_panes"}, | ||||
|   | ||||
| @@ -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"} | ||||
|   | ||||
| @@ -1 +1 @@ | ||||
| {"type": "computercraft:disk"} | ||||
| {"type": "computercraft:disk", "category": "misc"} | ||||
|   | ||||
| @@ -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}"} | ||||
|   | ||||
| @@ -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}"} | ||||
|   | ||||
| @@ -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}"} | ||||
|   | ||||
| @@ -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}"} | ||||
|   | ||||
| @@ -1,5 +1,6 @@ | ||||
| { | ||||
|   "type": "computercraft:impostor_shapeless", | ||||
|   "category": "redstone", | ||||
|   "group": "computercraft:disk", | ||||
|   "ingredients": [ | ||||
|     {"tag": "c:redstone_dusts"}, | ||||
|   | ||||
| @@ -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}"} | ||||
|   | ||||
| @@ -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}"} | ||||
|   | ||||
| @@ -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}"} | ||||
|   | ||||
| @@ -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}"} | ||||
|   | ||||
| @@ -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}"} | ||||
|   | ||||
| @@ -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}"} | ||||
|   | ||||
| @@ -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}"} | ||||
|   | ||||
| @@ -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}"} | ||||
|   | ||||
| @@ -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}"} | ||||
|   | ||||
| @@ -1,5 +1,6 @@ | ||||
| { | ||||
|   "type": "computercraft:impostor_shapeless", | ||||
|   "category": "redstone", | ||||
|   "group": "computercraft:disk", | ||||
|   "ingredients": [ | ||||
|     {"tag": "c:redstone_dusts"}, | ||||
|   | ||||
| @@ -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}"} | ||||
|   | ||||
| @@ -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"} | ||||
|   | ||||
| @@ -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"} | ||||
|   | ||||
| @@ -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"} | ||||
|   | ||||
| @@ -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"], | ||||
|   | ||||
| @@ -1,5 +1,6 @@ | ||||
| { | ||||
|   "type": "computercraft:impostor_shaped", | ||||
|   "category": "redstone", | ||||
|   "group": "computercraft:pocket_advanced", | ||||
|   "key": { | ||||
|     "#": {"item": "computercraft:wireless_modem_advanced"}, | ||||
|   | ||||
| @@ -1,5 +1,6 @@ | ||||
| { | ||||
|   "type": "computercraft:impostor_shaped", | ||||
|   "category": "redstone", | ||||
|   "group": "computercraft:pocket_advanced", | ||||
|   "key": { | ||||
|     "#": {"item": "computercraft:wireless_modem_normal"}, | ||||
|   | ||||
| @@ -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"} | ||||
|   | ||||
| @@ -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#", "# #"], | ||||
|   | ||||
| @@ -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
		Reference in New Issue
	
	Block a user
	 Jonathan Coates
					Jonathan Coates