Skip to content

Commit

Permalink
0.2.0+1.19.3: updated to 1.19.3
Browse files Browse the repository at this point in the history
- 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)
  • Loading branch information
rokoblox committed Dec 15, 2022
1 parent 661f8c1 commit 7680c4a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'fabric-loom' version '1.0-SNAPSHOT'
id 'maven-publish'
}

Expand Down Expand Up @@ -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"
}

Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 5 additions & 4 deletions src/main/java/com/rokoblox/pinlib/PinLib.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/rokoblox/pinlib/mixin/MapStateMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
5 changes: 3 additions & 2 deletions srcdev/TestingClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit 7680c4a

Please sign in to comment.