From 7680c4a1a0bd74c189556c6d6da7018144973c83 Mon Sep 17 00:00:00 2001 From: rokoblox <40763333+rokoblox@users.noreply.github.com> Date: Thu, 15 Dec 2022 15:19:24 +0200 Subject: [PATCH] 0.2.0+1.19.3: updated to 1.19.3 - updated loom version to 1.0 - updated yarn mappings to 1.19.3 build 3 - updated references to minecraft's registry to 1.19.3 - updated dependencies: --- fabric -> fabric-api --- minecraft (1.19) -> (1.19.3) --- fabricloader (0.14.8) -> (0.14.11) --- build.gradle | 4 ++-- gradle.properties | 10 +++++----- src/main/java/com/rokoblox/pinlib/PinLib.java | 9 +++++---- .../java/com/rokoblox/pinlib/mixin/MapStateMixin.java | 2 +- src/main/resources/fabric.mod.json | 6 +++--- srcdev/TestingClass.java | 5 +++-- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index 1b2bd0c..066d40b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.12-SNAPSHOT' + id 'fabric-loom' version '1.0-SNAPSHOT' id 'maven-publish' } @@ -31,7 +31,7 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" // For the dev-env - modRuntimeOnly "maven.modrinth:modmenu:4.0.6" + modRuntimeOnly "maven.modrinth:modmenu:5.0.2" modRuntimeOnly "maven.modrinth:lazydfu:0.1.3" } diff --git a/gradle.properties b/gradle.properties index 5f404b0..9b73188 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,13 +2,13 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=1.19.2 -yarn_mappings=1.19+build.4 -loader_version=0.14.9 +minecraft_version=1.19.3 +yarn_mappings=1.19.3+build.3 +loader_version=0.14.11 # Mod Properties -mod_version=0.2.0+1.19 +mod_version=0.2.0+1.19.3 maven_group=com.rokoblox archives_base_name=pinlib # Dependencies # check this on https://modmuss50.me/fabric.html -fabric_version=0.60.0+1.19.2 +fabric_version=0.69.1+1.19.3 diff --git a/src/main/java/com/rokoblox/pinlib/PinLib.java b/src/main/java/com/rokoblox/pinlib/PinLib.java index 46ca5c8..ec75743 100644 --- a/src/main/java/com/rokoblox/pinlib/PinLib.java +++ b/src/main/java/com/rokoblox/pinlib/PinLib.java @@ -9,10 +9,11 @@ import net.minecraft.item.FilledMapItem; import net.minecraft.item.ItemStack; import net.minecraft.item.map.MapState; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; import net.minecraft.text.Text; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.registry.Registry; import net.minecraft.world.World; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -86,8 +87,8 @@ public static MapMarker createDynamicMarker(Identifier id) { * @return Provided entry */ public static MapMarkedBlock registerMapMarkedBlock(Block entry, CustomMarkerProvider markerProvider, MarkerColorProvider colorProvider, MarkerDisplayNameProvider displayNameProvider) { - Identifier id = Registry.BLOCK.getId(entry); - if (id == Registry.BLOCK.getDefaultId()) + Identifier id = Registries.BLOCK.getId(entry); + if (id == Registries.BLOCK.getDefaultId()) LOGGER.warn("Registering default ID [{}] as a map marked block, this might be because the provided block entry was not registered as a block first.", id.toString()); LOGGER.info("Registering block with id [{}] as a map marked block.", id.toString()); return Registry.register(MAP_MARKED_BLOCKS_REGISTRY, id, new MapMarkedBlock(entry, markerProvider, colorProvider, displayNameProvider)); @@ -245,7 +246,7 @@ public static MapMarkedBlock fromBlock(Block block) { if (cache.containsKey(block)) return cache.get(block); else { - MapMarkedBlock entry = MAP_MARKED_BLOCKS_REGISTRY.get(Registry.BLOCK.getId(block)); + MapMarkedBlock entry = MAP_MARKED_BLOCKS_REGISTRY.get(Registries.BLOCK.getId(block)); cache.put(block, entry); return entry; } diff --git a/src/main/java/com/rokoblox/pinlib/mixin/MapStateMixin.java b/src/main/java/com/rokoblox/pinlib/mixin/MapStateMixin.java index 5bcbe07..444c074 100644 --- a/src/main/java/com/rokoblox/pinlib/mixin/MapStateMixin.java +++ b/src/main/java/com/rokoblox/pinlib/mixin/MapStateMixin.java @@ -95,7 +95,7 @@ public boolean addMapMarker(WorldAccess world, BlockPos pos, MapMarkerEntity map if ((mapMarkerTemp = getMapMarker(pos.getX(), pos.getZ())) != null && this.pinlib$customMarkerEntities.remove(mapMarkerTemp.getKey()) != null) removeIcon(mapMarkerTemp.getKey()); - if (!((MapState) (Object) this).method_37343(256)) { + if (!((MapState) (Object) this).iconCountNotLessThan(256)) { this.pinlib$customMarkerEntities.put(mapMarker.getKey(), mapMarker); pinlib$customIconMarkerToAdd = mapMarker; addIcon(MapIcon.Type.TARGET_POINT, world, mapMarker.getKey(), d, e, 180.0, mapMarker.getDisplayName()); diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index ab9af5c..e6500b0 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -22,8 +22,8 @@ "pinlib.mixins.json" ], "depends": { - "fabricloader": ">=0.14.8", - "fabric": "*", - "minecraft": ">=1.19" + "fabricloader": ">=0.14.11", + "fabric-api": "*", + "minecraft": ">=1.19.3" } } diff --git a/srcdev/TestingClass.java b/srcdev/TestingClass.java index 37aacca..aa234e9 100644 --- a/srcdev/TestingClass.java +++ b/srcdev/TestingClass.java @@ -6,11 +6,12 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.block.Block; import net.minecraft.block.Material; +import net.minecraft.registry.Registries; import net.minecraft.text.Style; import net.minecraft.text.Text; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.registry.Registry; +import net.minecraft.registry.Registry; import net.minecraft.world.BlockView; public class TestingClass { @@ -21,7 +22,7 @@ public class TestingClass { public static void init() { TESTMARKER = PinLib.createDynamicMarker(new Identifier("pinlib", "testmarker")); TESTBLOCK = new TestBlock(FabricBlockSettings.of(Material.STONE)); - Registry.register(Registry.BLOCK, new Identifier("pinlib", "testblock"), TESTBLOCK); + Registry.register(Registries.BLOCK, new Identifier("pinlib", "testblock"), TESTBLOCK); // Map marked blocks should NOT be registered like this, // this is just to demonstrate how to switch from the