20w28a - no biomes or dimensions

This commit is contained in:
modmuss50 2020-07-08 19:31:01 +01:00
parent 8d384cef9a
commit 35e08e3387
14 changed files with 33 additions and 109 deletions
build.gradle
fabric-registry-sync-v0
build.gradle
src/main/java/net/fabricmc/fabric
fabric-resource-loader-v0
build.gradle
src/main/java/net/fabricmc/fabric/mixin/resource/loader
fabric-tag-extensions-v0
build.gradle
src/main/java/net/fabricmc/fabric
api/tag
impl/tag/extension
settings.gradle
src/main/resources

View file

@ -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 {

View file

@ -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')

View file

@ -69,11 +69,6 @@ public class FabricRegistryInit implements ModInitializer {
// 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);

View file

@ -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<Biome>, RegistryEntryRemovedCallback<Biome>, RegistryIdRemapCallback<Biome> {
private final Registry<Biome> registry;
private BiomeParentTracker(Registry<Biome> registry) {
this.registry = registry;
}
public static void register(Registry<Biome> 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<Biome> state) {
for (Int2IntMap.Entry entry : state.getRawIdChangeMap().int2IntEntrySet()) {
if (Biome.PARENT_BIOME_ID_MAP.get(entry.getIntKey()) != null) {
//noinspection unchecked
((RemovableIdList<Biome>) 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>) Biome.PARENT_BIOME_ID_MAP).fabric_remove(object);
((RemovableIdList<Biome>) Biome.PARENT_BIOME_ID_MAP).fabric_removeId(rawId);
}
}

View file

@ -32,7 +32,6 @@ import net.minecraft.world.biome.Biomes;
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 @@ public class MixinBootstrap {
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

View file

@ -129,7 +129,7 @@ public abstract class MixinIdRegistry<T> implements RemappableRegistry, Listenab
@SuppressWarnings({"unchecked", "ConstantConditions"})
@Inject(method = "set", at = @At("HEAD"))
public void setPre(int id, RegistryKey<T> 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 abstract class MixinIdRegistry<T> implements RemappableRegistry, Listenab
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 abstract class MixinIdRegistry<T> implements RemappableRegistry, Listenab
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;

View file

@ -39,7 +39,7 @@ import net.minecraft.nbt.CompoundTag;
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 @@ public class MixinLevelStorageSession {
}
@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;
}

View file

@ -1,2 +1,2 @@
archivesBaseName = "fabric-resource-loader-v0"
version = getSubprojectVersion(project, "0.2.7")
version = getSubprojectVersion(project, "0.2.8")

View file

@ -33,7 +33,7 @@ import net.minecraft.client.texture.TextureManager;
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 class MixinKeyedResourceReloadListener {
@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 class MixinKeyedResourceReloadListener {
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 class MixinKeyedResourceReloadListener {
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));

View file

@ -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')

View file

@ -19,7 +19,7 @@ package net.fabricmc.fabric.api.tag;
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 @@ import net.fabricmc.fabric.impl.tag.extension.TagDelegate;
public final class TagRegistry {
private TagRegistry() { }
public static <T> Tag.Identified<T> create(Identifier id, Supplier<class_5414<T>> containerSupplier) {
public static <T> Tag.Identified<T> create(Identifier id, Supplier<TagGroup<T>> containerSupplier) {
return new TagDelegate<>(id, containerSupplier);
}
public static Tag<Block> block(Identifier id) {
return create(id, BlockTags::getContainer);
return create(id, BlockTags::getTagGroup);
}
public static Tag<EntityType<?>> entityType(Identifier id) {
return create(id, EntityTypeTags::getContainer);
return create(id, EntityTypeTags::getTagGroup);
}
public static Tag<Fluid> fluid(Identifier id) {
return create(id, FluidTags::getContainer);
return create(id, FluidTags::getTagGroup);
}
public static Tag<Item> item(Identifier id) {
return create(id, ItemTags::getContainer);
return create(id, ItemTags::getTagGroup);
}
}

View file

@ -19,7 +19,7 @@ package net.fabricmc.fabric.impl.tag.extension;
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 @@ import net.fabricmc.fabric.api.tag.FabricTag;
public final class TagDelegate<T> implements Tag.Identified<T>, FabricTag<T>, FabricTagHooks {
private final Identifier id;
private final Supplier<class_5414<T>> containerSupplier;
private final Supplier<TagGroup<T>> containerSupplier;
private volatile Target<T> target;
private int clearCount;
public TagDelegate(Identifier id, Supplier<class_5414<T>> containerSupplier) {
public TagDelegate(Identifier id, Supplier<TagGroup<T>> containerSupplier) {
this.id = id;
this.containerSupplier = containerSupplier;
}
@ -57,11 +57,11 @@ public final class TagDelegate<T> implements Tag.Identified<T>, FabricTag<T>, Fa
*/
private Tag<T> getTag() {
Target<T> target = this.target;
class_5414<T> reqContainer = containerSupplier.get();
TagGroup<T> reqContainer = containerSupplier.get();
Tag<T> 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 final class TagDelegate<T> implements Tag.Identified<T>, FabricTag<T>, Fa
}
private static final class Target<T> {
Target(class_5414<T> container, Tag<T> tag) {
Target(TagGroup<T> container, Tag<T> tag) {
this.container = container;
this.tag = tag;
}
final class_5414<T> container;
final TagGroup<T> container;
final Tag<T> tag;
}
}

View file

@ -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'

View file

@ -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."
}