Skip to content

Commit

Permalink
20w28a - no biomes or dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Jul 8, 2020
1 parent 8d384ce commit 35e08e3
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 109 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion fabric-registry-sync-v0/build.gradle
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public Event<RegistryIdRemapCallback<T>> fabric_getRemapEvent() {
@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 + " )");
Expand All @@ -141,7 +141,7 @@ public void setPre(int id, RegistryKey<T> 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()!");
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion fabric-resource-loader-v0/build.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
archivesBaseName = "fabric-resource-loader-v0"
version = getSubprojectVersion(project, "0.2.7")
version = getSubprojectVersion(project, "0.2.8")
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 {
Expand All @@ -109,7 +109,7 @@ public Collection<Identifier> 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);
Expand All @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion fabric-tag-extensions-v0/build.gradle
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -38,23 +38,23 @@
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@
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;

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;
}
Expand All @@ -57,11 +57,11 @@ public List<T> values() {
*/
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;
Expand All @@ -86,12 +86,12 @@ public void fabric_setExtraData(int clearCount) {
}

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;
}
}
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}

0 comments on commit 35e08e3

Please sign in to comment.