From 35e08e338756bf1e674bf9c17d6bf8fe4bb42757 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 8 Jul 2020 19:31:01 +0100 Subject: [PATCH] 20w28a - no biomes or dimensions --- build.gradle | 8 +-- fabric-registry-sync-v0/build.gradle | 2 +- .../registry/sync/FabricRegistryInit.java | 5 -- .../trackers/vanilla/BiomeParentTracker.java | 69 ------------------- .../mixin/registry/sync/MixinBootstrap.java | 2 - .../mixin/registry/sync/MixinIdRegistry.java | 6 +- .../sync/MixinLevelStorageSession.java | 4 +- fabric-resource-loader-v0/build.gradle | 2 +- .../MixinKeyedResourceReloadListener.java | 8 +-- fabric-tag-extensions-v0/build.gradle | 2 +- .../fabricmc/fabric/api/tag/TagRegistry.java | 12 ++-- .../impl/tag/extension/TagDelegate.java | 14 ++-- settings.gradle | 4 +- src/main/resources/fabric.mod.json | 4 +- 14 files changed, 33 insertions(+), 109 deletions(-) delete mode 100644 fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/trackers/vanilla/BiomeParentTracker.java diff --git a/build.gradle b/build.gradle index c27f33373b..9d4d6f7c7b 100644 --- a/build.gradle +++ b/build.gradle @@ -18,9 +18,9 @@ plugins { def ENV = System.getenv() class Globals { - static def baseVersion = "0.14.2" - static def mcVersion = "20w27a" - static def yarnVersion = "+build.1" + static def baseVersion = "0.14.3" + static def mcVersion = "20w28a" + static def yarnVersion = "+build.2" } version = Globals.baseVersion + "+" + (ENV.BUILD_NUMBER ? ("build." + ENV.BUILD_NUMBER) : "local") + "-" + getBranch() @@ -73,7 +73,7 @@ allprojects { dependencies { minecraft "com.mojang:minecraft:$Globals.mcVersion" mappings "net.fabricmc:yarn:${Globals.mcVersion}${Globals.yarnVersion}:v2" - modCompile "net.fabricmc:fabric-loader:0.8.8+build.202" + modCompile "net.fabricmc:fabric-loader:0.8.9+build.203" } configurations { diff --git a/fabric-registry-sync-v0/build.gradle b/fabric-registry-sync-v0/build.gradle index 7ef8dd24c8..e11e74fa3f 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.3.8") +version = getSubprojectVersion(project, "0.3.9") dependencies { compile project(path: ':fabric-api-base', configuration: 'dev') 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 0e4f841515..13a71e6242 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 @@ -69,11 +69,6 @@ public void onInitialize() { // Serialised by string, doesnt seem to be synced RegistryAttributeHolder.get(Registry.DECORATOR); - // Saved to level format - RegistryAttributeHolder.get(Registry.BIOME) - .addAttribute(RegistryAttribute.SYNCED) - .addAttribute(RegistryAttribute.PERSISTED); - // 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/impl/registry/sync/trackers/vanilla/BiomeParentTracker.java b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/trackers/vanilla/BiomeParentTracker.java deleted file mode 100644 index debaba7ad7..0000000000 --- a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/trackers/vanilla/BiomeParentTracker.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2016, 2017, 2018, 2019 FabricMC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.fabricmc.fabric.impl.registry.sync.trackers.vanilla; - -import java.util.Objects; - -import it.unimi.dsi.fastutil.ints.Int2IntMap; - -import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; -import net.minecraft.world.biome.Biome; - -import net.fabricmc.fabric.api.event.registry.RegistryEntryAddedCallback; -import net.fabricmc.fabric.api.event.registry.RegistryEntryRemovedCallback; -import net.fabricmc.fabric.api.event.registry.RegistryIdRemapCallback; -import net.fabricmc.fabric.impl.registry.sync.RemovableIdList; - -public final class BiomeParentTracker implements RegistryEntryAddedCallback, RegistryEntryRemovedCallback, RegistryIdRemapCallback { - private final Registry registry; - - private BiomeParentTracker(Registry registry) { - this.registry = registry; - } - - public static void register(Registry registry) { - BiomeParentTracker tracker = new BiomeParentTracker(registry); - RegistryEntryAddedCallback.event(registry).register(tracker); - RegistryIdRemapCallback.event(registry).register(tracker); - RegistryEntryRemovedCallback.event(registry).register(tracker); - } - - @Override - public void onEntryAdded(int rawId, Identifier id, Biome object) { - if (object.hasParent()) { - Biome.PARENT_BIOME_ID_MAP.set(object, registry.getRawId(registry.get(new Identifier(Objects.requireNonNull(object.getParent()))))); - } - } - - @Override - public void onRemap(RemapState state) { - for (Int2IntMap.Entry entry : state.getRawIdChangeMap().int2IntEntrySet()) { - if (Biome.PARENT_BIOME_ID_MAP.get(entry.getIntKey()) != null) { - //noinspection unchecked - ((RemovableIdList) Biome.PARENT_BIOME_ID_MAP).fabric_remapId(entry.getIntKey(), entry.getIntValue()); - } - } - } - - @SuppressWarnings("unchecked") - @Override - public void onEntryRemoved(int rawId, Identifier id, Biome object) { - ((RemovableIdList) Biome.PARENT_BIOME_ID_MAP).fabric_remove(object); - ((RemovableIdList) Biome.PARENT_BIOME_ID_MAP).fabric_removeId(rawId); - } -} diff --git a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinBootstrap.java b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinBootstrap.java index 41e13059bb..f46b25df0a 100644 --- a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinBootstrap.java +++ b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinBootstrap.java @@ -32,7 +32,6 @@ import net.fabricmc.fabric.impl.registry.sync.RegistrySyncManager; import net.fabricmc.fabric.impl.registry.sync.trackers.StateIdTracker; -import net.fabricmc.fabric.impl.registry.sync.trackers.vanilla.BiomeParentTracker; import net.fabricmc.fabric.impl.registry.sync.trackers.vanilla.BlockInitTracker; import net.fabricmc.fabric.impl.registry.sync.trackers.vanilla.BlockItemTracker; @@ -55,7 +54,6 @@ private static void initialize(CallbackInfo info) { StateIdTracker.register(Registry.FLUID, Fluid.STATE_IDS, (fluid) -> fluid.getStateManager().getStates()); // map tracking - BiomeParentTracker.register(Registry.BIOME); BlockItemTracker.register(Registry.ITEM); // block initialization, like Blocks diff --git a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinIdRegistry.java b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinIdRegistry.java index d8e567bd98..8147367d6a 100644 --- a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinIdRegistry.java +++ b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinIdRegistry.java @@ -129,7 +129,7 @@ public Event> fabric_getRemapEvent() { @SuppressWarnings({"unchecked", "ConstantConditions"}) @Inject(method = "set", at = @At("HEAD")) public void setPre(int id, RegistryKey registryId, Object object, CallbackInfoReturnable info) { - int indexedEntriesId = indexedEntries.getId((T) object); + int indexedEntriesId = indexedEntries.getRawId((T) object); if (indexedEntriesId >= 0) { throw new RuntimeException("Attempted to register object " + object + " twice! (at raw IDs " + indexedEntriesId + " and " + id + " )"); @@ -141,7 +141,7 @@ public void setPre(int id, RegistryKey registryId, Object object, CallbackInf T oldObject = entriesById.get(registryId.getValue()); if (oldObject != null && oldObject != object) { - int oldId = indexedEntries.getId(oldObject); + int oldId = indexedEntries.getRawId(oldObject); if (oldId != id) { throw new RuntimeException("Attempted to register ID " + registryId + " at different raw IDs (" + oldId + ", " + id + ")! If you're trying to override an item, use .set(), not .register()!"); @@ -370,7 +370,7 @@ public void unmap(String name) throws RemapException { remap(name, fabric_prevIndexedEntries, RemapMode.AUTHORITATIVE); for (Identifier id : addedIds) { - fabric_getAddObjectEvent().invoker().onEntryAdded(indexedEntries.getId(entriesById.get(id)), id, entriesById.get(id)); + fabric_getAddObjectEvent().invoker().onEntryAdded(indexedEntries.getRawId(entriesById.get(id)), id, entriesById.get(id)); } fabric_prevIndexedEntries = null; diff --git a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinLevelStorageSession.java b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinLevelStorageSession.java index 73d4ce48a0..09206d4dd6 100644 --- a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinLevelStorageSession.java +++ b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/MixinLevelStorageSession.java @@ -39,7 +39,7 @@ import net.minecraft.nbt.NbtIo; import net.minecraft.world.SaveProperties; import net.minecraft.world.level.storage.LevelStorage; -import net.minecraft.util.registry.RegistryTracker; +import net.minecraft.class_5455; import net.fabricmc.fabric.impl.registry.sync.RegistrySyncManager; import net.fabricmc.fabric.impl.registry.sync.RemapException; @@ -130,7 +130,7 @@ private void fabric_saveRegistryData() { } @Inject(method = "method_27426", at = @At("HEAD")) - public void saveWorld(RegistryTracker registryTracker, SaveProperties saveProperties, CompoundTag compoundTag, CallbackInfo info) { + public void saveWorld(class_5455 registryTracker, SaveProperties saveProperties, CompoundTag compoundTag, CallbackInfo info) { if (!Files.exists(directory)) { return; } diff --git a/fabric-resource-loader-v0/build.gradle b/fabric-resource-loader-v0/build.gradle index 6344239762..84a3471c26 100644 --- a/fabric-resource-loader-v0/build.gradle +++ b/fabric-resource-loader-v0/build.gradle @@ -1,2 +1,2 @@ archivesBaseName = "fabric-resource-loader-v0" -version = getSubprojectVersion(project, "0.2.7") +version = getSubprojectVersion(project, "0.2.8") diff --git a/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/mixin/resource/loader/MixinKeyedResourceReloadListener.java b/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/mixin/resource/loader/MixinKeyedResourceReloadListener.java index 1b70ab8eec..cc329acc23 100644 --- a/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/mixin/resource/loader/MixinKeyedResourceReloadListener.java +++ b/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/mixin/resource/loader/MixinKeyedResourceReloadListener.java @@ -33,7 +33,7 @@ import net.minecraft.recipe.RecipeManager; import net.minecraft.server.ServerAdvancementLoader; import net.minecraft.server.function.CommandFunctionManager; -import net.minecraft.tag.RegistryTagManager; +import net.minecraft.tag.TagManagerLoader; import net.minecraft.util.Identifier; import net.minecraft.loot.LootManager; @@ -96,7 +96,7 @@ public Identifier getFabricId() { @Mixin({ /* public */ - RecipeManager.class, ServerAdvancementLoader.class, CommandFunctionManager.class, LootManager.class, RegistryTagManager.class + RecipeManager.class, ServerAdvancementLoader.class, CommandFunctionManager.class, LootManager.class, TagManagerLoader.class /* private */ }) public abstract static class Server implements IdentifiableResourceReloadListener { @@ -109,7 +109,7 @@ public Collection getFabricDependencies() { if (fabric_idDeps == null) { Object self = this; - if (self instanceof RegistryTagManager) { + if (self instanceof TagManagerLoader) { fabric_idDeps = Collections.emptyList(); } else { fabric_idDeps = Collections.singletonList(ResourceReloadListenerKeys.TAGS); @@ -133,7 +133,7 @@ public Identifier getFabricId() { fabric_id = ResourceReloadListenerKeys.FUNCTIONS; } else if (self instanceof LootManager) { fabric_id = ResourceReloadListenerKeys.LOOT_TABLES; - } else if (self instanceof RegistryTagManager) { + } else if (self instanceof TagManagerLoader) { fabric_id = ResourceReloadListenerKeys.TAGS; } else { fabric_id = new Identifier("minecraft", "private/" + self.getClass().getSimpleName().toLowerCase(Locale.ROOT)); diff --git a/fabric-tag-extensions-v0/build.gradle b/fabric-tag-extensions-v0/build.gradle index 7ce160cc51..53c78b6676 100644 --- a/fabric-tag-extensions-v0/build.gradle +++ b/fabric-tag-extensions-v0/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-tag-extensions-v0" -version = getSubprojectVersion(project, "1.0.0") +version = getSubprojectVersion(project, "1.0.1") dependencies { compile project(path: ':fabric-api-base', configuration: 'dev') diff --git a/fabric-tag-extensions-v0/src/main/java/net/fabricmc/fabric/api/tag/TagRegistry.java b/fabric-tag-extensions-v0/src/main/java/net/fabricmc/fabric/api/tag/TagRegistry.java index bbe08a6a77..eba76bd5c9 100644 --- a/fabric-tag-extensions-v0/src/main/java/net/fabricmc/fabric/api/tag/TagRegistry.java +++ b/fabric-tag-extensions-v0/src/main/java/net/fabricmc/fabric/api/tag/TagRegistry.java @@ -19,7 +19,7 @@ import java.util.function.Supplier; import net.minecraft.block.Block; -import net.minecraft.class_5414; +import net.minecraft.tag.TagGroup; import net.minecraft.entity.EntityType; import net.minecraft.fluid.Fluid; import net.minecraft.item.Item; @@ -38,23 +38,23 @@ public final class TagRegistry { private TagRegistry() { } - public static Tag.Identified create(Identifier id, Supplier> containerSupplier) { + public static Tag.Identified create(Identifier id, Supplier> containerSupplier) { return new TagDelegate<>(id, containerSupplier); } public static Tag block(Identifier id) { - return create(id, BlockTags::getContainer); + return create(id, BlockTags::getTagGroup); } public static Tag> entityType(Identifier id) { - return create(id, EntityTypeTags::getContainer); + return create(id, EntityTypeTags::getTagGroup); } public static Tag fluid(Identifier id) { - return create(id, FluidTags::getContainer); + return create(id, FluidTags::getTagGroup); } public static Tag item(Identifier id) { - return create(id, ItemTags::getContainer); + return create(id, ItemTags::getTagGroup); } } diff --git a/fabric-tag-extensions-v0/src/main/java/net/fabricmc/fabric/impl/tag/extension/TagDelegate.java b/fabric-tag-extensions-v0/src/main/java/net/fabricmc/fabric/impl/tag/extension/TagDelegate.java index 104b3568e0..db6ebbe316 100644 --- a/fabric-tag-extensions-v0/src/main/java/net/fabricmc/fabric/impl/tag/extension/TagDelegate.java +++ b/fabric-tag-extensions-v0/src/main/java/net/fabricmc/fabric/impl/tag/extension/TagDelegate.java @@ -19,7 +19,7 @@ import java.util.List; import java.util.function.Supplier; -import net.minecraft.class_5414; +import net.minecraft.tag.TagGroup; import net.minecraft.tag.Tag; import net.minecraft.util.Identifier; @@ -27,11 +27,11 @@ public final class TagDelegate implements Tag.Identified, FabricTag, FabricTagHooks { private final Identifier id; - private final Supplier> containerSupplier; + private final Supplier> containerSupplier; private volatile Target target; private int clearCount; - public TagDelegate(Identifier id, Supplier> containerSupplier) { + public TagDelegate(Identifier id, Supplier> containerSupplier) { this.id = id; this.containerSupplier = containerSupplier; } @@ -57,11 +57,11 @@ public List values() { */ private Tag getTag() { Target target = this.target; - class_5414 reqContainer = containerSupplier.get(); + TagGroup reqContainer = containerSupplier.get(); Tag ret; if (target == null || target.container != reqContainer) { - ret = reqContainer.method_30213(getId()); + ret = reqContainer.getTagOrEmpty(getId()); this.target = new Target<>(reqContainer, ret); } else { ret = target.tag; @@ -86,12 +86,12 @@ public void fabric_setExtraData(int clearCount) { } private static final class Target { - Target(class_5414 container, Tag tag) { + Target(TagGroup container, Tag tag) { this.container = container; this.tag = tag; } - final class_5414 container; + final TagGroup container; final Tag tag; } } diff --git a/settings.gradle b/settings.gradle index 3b458247c2..e30e3c16e0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -14,14 +14,14 @@ rootProject.name = "fabric-api" include 'fabric-api-base' -include 'fabric-biomes-v1' +//include 'fabric-biomes-v1' include 'fabric-blockrenderlayer-v1' include 'fabric-commands-v0' include 'fabric-command-api-v1' include 'fabric-containers-v0' include 'fabric-content-registries-v0' include 'fabric-crash-report-info-v1' -include 'fabric-dimensions-v1' +//include 'fabric-dimensions-v1' include 'fabric-events-interaction-v0' include 'fabric-events-lifecycle-v0' include 'fabric-item-api-v1' diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index b50bf82253..535c84f1e5 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -16,8 +16,8 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.8.7", - "minecraft": "~1.16-alpha.20.14.a" + "fabricloader": ">=0.8.9", + "minecraft": "~1.16.2-alpha.20.28.a" }, "description": "Core API module providing key hooks and intercompatibility features." }