From 2e160e0f267b84c7194a19d74185607829d8619c Mon Sep 17 00:00:00 2001
From: modmuss50 <modmuss50@gmail.com>
Date: Thu, 11 Nov 2021 19:01:49 +0000
Subject: [PATCH] 1.18-pre1: without the biome api

---
 build.gradle                                              | 8 ++++----
 fabric-registry-sync-v0/build.gradle                      | 2 +-
 .../fabric/impl/registry/sync/FabricRegistryInit.java     | 3 ---
 .../mixin/registry/sync/DynamicRegistryManagerMixin.java  | 2 +-
 .../fabricmc/fabric/mixin/registry/sync/MixinIdList.java  | 8 ++++----
 settings.gradle                                           | 2 +-
 6 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/build.gradle b/build.gradle
index ed8941506..c9a0cefda 100644
--- a/build.gradle
+++ b/build.gradle
@@ -9,7 +9,7 @@ plugins {
 	id "eclipse"
 	id "idea"
 	id "maven-publish"
-	id "fabric-loom" version "0.10.50" apply false
+	id "fabric-loom" version "0.10.54" apply false
 	id "org.cadixdev.licenser" version "0.6.1"
 	id "org.ajoberstar.grgit" version "3.1.0"
 	id "com.matthewprenger.cursegradle" version "1.4.0"
@@ -19,9 +19,9 @@ plugins {
 def ENV = System.getenv()
 
 class Globals {
-	static def baseVersion = "0.42.1"
-	static def mcVersion = "21w44a"
-	static def yarnVersion = "+build.1"
+	static def baseVersion = "0.42.2"
+	static def mcVersion = "1.18-pre1"
+	static def yarnVersion = "+build.2"
 	static def loaderVersion = "0.11.7"
 	static def preRelease = true
 }
diff --git a/fabric-registry-sync-v0/build.gradle b/fabric-registry-sync-v0/build.gradle
index 8ffddcc71..8529268b4 100644
--- a/fabric-registry-sync-v0/build.gradle
+++ b/fabric-registry-sync-v0/build.gradle
@@ -1,5 +1,5 @@
 archivesBaseName = "fabric-registry-sync-v0"
-version = getSubprojectVersion(project, "0.8.2")
+version = getSubprojectVersion(project, "0.8.3")
 
 moduleDependencies(project, [
 		'fabric-api-base',
diff --git a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/FabricRegistryInit.java b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/FabricRegistryInit.java
index 967f611a4..147e507b8 100644
--- a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/FabricRegistryInit.java
+++ b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/FabricRegistryInit.java
@@ -63,9 +63,6 @@ public class FabricRegistryInit implements ModInitializer {
 		// Serialised by string, doesnt seem to be synced
 		RegistryAttributeHolder.get(Registry.FEATURE);
 
-		// Serialised by string, doesnt seem to be synced
-		RegistryAttributeHolder.get(Registry.DECORATOR);
-
 		// Serialised by string, doesnt seem to be synced
 		RegistryAttributeHolder.get(Registry.BLOCK_STATE_PROVIDER_TYPE);
 
diff --git a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/DynamicRegistryManagerMixin.java b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/DynamicRegistryManagerMixin.java
index 79bf945f8..d4da62923 100644
--- a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/DynamicRegistryManagerMixin.java
+++ b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/DynamicRegistryManagerMixin.java
@@ -28,7 +28,7 @@ import net.fabricmc.fabric.api.event.registry.DynamicRegistrySetupCallback;
 
 @Mixin(DynamicRegistryManager.class)
 public class DynamicRegistryManagerMixin {
-	@Inject(method = "create", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/dynamic/RegistryOps$EntryLoader$Impl;<init>()V"), locals = LocalCapture.CAPTURE_FAILHARD)
+	@Inject(method = "create", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/dynamic/EntryLoader$Impl;<init>()V"), locals = LocalCapture.CAPTURE_FAILHARD)
 	private static void onCreateImpl(CallbackInfoReturnable<DynamicRegistryManager.Impl> cir, DynamicRegistryManager.Impl registryManager) {
 		DynamicRegistrySetupCallback.EVENT.invoker().onRegistrySetup(registryManager);
 	}
diff --git a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinIdList.java b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinIdList.java
index 12873b7c9..de864b1d0 100644
--- a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinIdList.java
+++ b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinIdList.java
@@ -17,11 +17,11 @@
 package net.fabricmc.fabric.mixin.registry.sync;
 
 import java.util.ArrayList;
-import java.util.IdentityHashMap;
 import java.util.List;
 
 import it.unimi.dsi.fastutil.ints.Int2IntMap;
 import it.unimi.dsi.fastutil.ints.Int2IntMaps;
+import it.unimi.dsi.fastutil.objects.Object2IntMap;
 import org.spongepowered.asm.mixin.Mixin;
 import org.spongepowered.asm.mixin.Shadow;
 import org.spongepowered.asm.mixin.Unique;
@@ -35,7 +35,7 @@ public class MixinIdList<T> implements RemovableIdList<T> {
 	@Shadow
 	private int nextId;
 	@Shadow
-	private IdentityHashMap<T, Integer> idMap;
+	private Object2IntMap<T> idMap;
 	@Shadow
 	private List<T> list;
 
@@ -48,7 +48,7 @@ public class MixinIdList<T> implements RemovableIdList<T> {
 
 	@Unique
 	private void fabric_removeInner(T o) {
-		int value = idMap.remove(o);
+		int value = idMap.removeInt(o);
 		list.set(value, null);
 
 		while (nextId > 1 && list.get(nextId - 1) == null) {
@@ -68,7 +68,7 @@ public class MixinIdList<T> implements RemovableIdList<T> {
 		List<T> removals = new ArrayList<>();
 
 		for (T o : idMap.keySet()) {
-			int j = idMap.get(o);
+			int j = idMap.getInt(o);
 
 			if (i == j) {
 				removals.add(o);
diff --git a/settings.gradle b/settings.gradle
index b2302dcec..2f8fadd88 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -14,7 +14,7 @@ rootProject.name = "fabric-api"
 include 'fabric-api-base'
 
 include 'fabric-api-lookup-api-v1'
-include 'fabric-biome-api-v1'
+//include 'fabric-biome-api-v1'
 include 'fabric-blockrenderlayer-v1'
 include 'fabric-commands-v0'
 include 'fabric-command-api-v1'