From fe5c2a7e1bcd0e7a1eb2b00eea14434b11a3606a Mon Sep 17 00:00:00 2001 From: Motschen Date: Sat, 23 Jan 2021 10:47:14 +0100 Subject: [PATCH] Canvas compat (Closes #2), Fix Z-Fighting --- gradle.properties | 10 +++++----- .../visualoverhaul/VisualOverhaulClient.java | 6 ++++++ .../models/block/jukebox_top_playing.json | 2 +- .../models/block/jukebox_top_stopped.json | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/gradle.properties b/gradle.properties index ba1fef3..e1c9c56 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,18 +3,18 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=1.16.4 - yarn_mappings=1.16.4+build.7 - loader_version=0.10.8 + minecraft_version=1.16.5 + yarn_mappings=1.16.5+build.3 + loader_version=0.11.1 # Mod Properties - mod_version = 1.0.0 + mod_version = 1.1.0 maven_group = eu.midnightdust archives_base_name = visualoverhaul # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api - fabric_version=0.28.4+1.16 + fabric_version=0.29.4+1.16 auto_config_version = 3.2.0-unstable cloth_config_version = 4.7.0-unstable diff --git a/src/main/java/eu/midnightdust/visualoverhaul/VisualOverhaulClient.java b/src/main/java/eu/midnightdust/visualoverhaul/VisualOverhaulClient.java index a366ab4..d5eeb8b 100644 --- a/src/main/java/eu/midnightdust/visualoverhaul/VisualOverhaulClient.java +++ b/src/main/java/eu/midnightdust/visualoverhaul/VisualOverhaulClient.java @@ -10,13 +10,16 @@ import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.client.rendereregistry.v1.BlockEntityRendererRegistry; import net.fabricmc.fabric.api.object.builder.v1.client.model.FabricModelPredicateProviderRegistry; import net.fabricmc.fabric.api.resource.ResourceManagerHelper; +import net.fabricmc.fabric.impl.blockrenderlayer.BlockRenderLayerMapImpl; import net.fabricmc.fabric.impl.networking.ClientSidePacketRegistryImpl; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.block.Block; +import net.minecraft.block.Blocks; import net.minecraft.block.entity.BlockEntityType; import net.minecraft.block.entity.BrewingStandBlockEntity; import net.minecraft.block.entity.JukeboxBlockEntity; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.render.RenderLayer; import net.minecraft.item.ItemStack; import net.minecraft.item.MusicDiscItem; import net.minecraft.util.Identifier; @@ -40,6 +43,9 @@ public class VisualOverhaulClient implements ClientModInitializer { // Block only registered on client, because it's just used for the renderer // Registry.register(Registry.BLOCK, new Identifier("visualoverhaul","jukebox_top"), JukeBoxTop); + BlockRenderLayerMapImpl.INSTANCE.putBlock(Blocks.JUKEBOX, RenderLayer.getCutout()); + BlockRenderLayerMapImpl.INSTANCE.putBlock(JukeBoxTop, RenderLayer.getCutout()); + BlockEntityRendererRegistry.INSTANCE.register(BlockEntityType.BREWING_STAND, BrewingStandBlockEntityRenderer::new); BlockEntityRendererRegistry.INSTANCE.register(BlockEntityType.JUKEBOX, JukeboxBlockEntityRenderer::new); diff --git a/src/main/resources/assets/visualoverhaul/models/block/jukebox_top_playing.json b/src/main/resources/assets/visualoverhaul/models/block/jukebox_top_playing.json index cb9803f..3945266 100644 --- a/src/main/resources/assets/visualoverhaul/models/block/jukebox_top_playing.json +++ b/src/main/resources/assets/visualoverhaul/models/block/jukebox_top_playing.json @@ -10,7 +10,7 @@ "elements": [ { "from": [0, 0, 0], - "to": [16, 0.001, 16], + "to": [16, 0.01, 16], "faces": { "up": {"uv": [0, 0, 16, 16], "texture": "#3"} } diff --git a/src/main/resources/assets/visualoverhaul/models/block/jukebox_top_stopped.json b/src/main/resources/assets/visualoverhaul/models/block/jukebox_top_stopped.json index 0d51089..e1c6cbf 100644 --- a/src/main/resources/assets/visualoverhaul/models/block/jukebox_top_stopped.json +++ b/src/main/resources/assets/visualoverhaul/models/block/jukebox_top_stopped.json @@ -10,7 +10,7 @@ "elements": [ { "from": [0, 0, 0], - "to": [16, 0.001, 16], + "to": [16, 0.01, 16], "faces": { "up": {"uv": [0, 0, 16, 16], "texture": "#3"} }