mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-21 11:20:55 -04:00
20w27a
This commit is contained in:
parent
f41e2098ef
commit
c668f41520
10 changed files with 24 additions and 25 deletions
build.gradle
fabric-lifecycle-events-v1
fabric-resource-loader-v0
build.gradle
src/main/java/net/fabricmc/fabric
fabric-tag-extensions-v0
build.gradle
src/main/java/net/fabricmc/fabric
10
build.gradle
10
build.gradle
|
@ -12,9 +12,9 @@ plugins {
|
|||
def ENV = System.getenv()
|
||||
|
||||
class Globals {
|
||||
static def baseVersion = "0.14.1"
|
||||
static def mcVersion = "1.16.1"
|
||||
static def yarnVersion = "+build.5"
|
||||
static def baseVersion = "0.14.2"
|
||||
static def mcVersion = "20w27a"
|
||||
static def yarnVersion = "+build.1"
|
||||
}
|
||||
|
||||
version = Globals.baseVersion + "+" + (ENV.BUILD_NUMBER ? ("build." + ENV.BUILD_NUMBER) : "local") + "-" + getBranch()
|
||||
|
@ -262,8 +262,8 @@ curseforge {
|
|||
project {
|
||||
id = '306612'
|
||||
changelog = 'A changelog can be found at https://github.com/FabricMC/fabric/commits'
|
||||
releaseType = 'release'
|
||||
addGameVersion '1.16.1'
|
||||
releaseType = 'beta'
|
||||
addGameVersion '1.16-Snapshot'
|
||||
addGameVersion 'Fabric'
|
||||
mainArtifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar")) {
|
||||
displayName = "[$Globals.mcVersion] Fabric API $Globals.baseVersion build $ENV.BUILD_NUMBER"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-lifecycle-events-v1"
|
||||
version = getSubprojectVersion(project, "1.0.0")
|
||||
version = getSubprojectVersion(project, "1.0.1")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -37,7 +37,7 @@ import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
|
|||
|
||||
@Mixin(MinecraftServer.class)
|
||||
public abstract class MinecraftServerMixin {
|
||||
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/server/MinecraftServer;setFavicon(Lnet/minecraft/server/ServerMetadata;)V", ordinal = 0), method = "method_29741")
|
||||
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/server/MinecraftServer;setFavicon(Lnet/minecraft/server/ServerMetadata;)V", ordinal = 0), method = "runServer")
|
||||
private void afterSetupServer(CallbackInfo info) {
|
||||
ServerLifecycleEvents.SERVER_STARTED.invoker().onServerStarted((MinecraftServer) (Object) this);
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
archivesBaseName = "fabric-resource-loader-v0"
|
||||
version = getSubprojectVersion(project, "0.2.6")
|
||||
version = getSubprojectVersion(project, "0.2.7")
|
||||
|
|
|
@ -38,7 +38,7 @@ public class ModResourcePackCreator implements ResourcePackProvider {
|
|||
}
|
||||
|
||||
@Override
|
||||
public <T extends ResourcePackProfile> void register(Consumer<T> consumer, ResourcePackProfile.Factory<T> factory) {
|
||||
public void register(Consumer<ResourcePackProfile> consumer, ResourcePackProfile.Factory factory) {
|
||||
// TODO: "vanilla" does not emit a message; neither should a modded datapack
|
||||
List<ResourcePack> packs = new ArrayList<>();
|
||||
ModResourcePackUtil.appendModResourcePacks(packs, type);
|
||||
|
@ -48,12 +48,12 @@ public class ModResourcePackCreator implements ResourcePackProvider {
|
|||
throw new RuntimeException("Not a ModResourcePack!");
|
||||
}
|
||||
|
||||
T var3 = ResourcePackProfile.of("fabric/" + ((ModResourcePack) pack).getFabricModMetadata().getId(),
|
||||
ResourcePackProfile resourcePackProfile = ResourcePackProfile.of("fabric/" + ((ModResourcePack) pack).getFabricModMetadata().getId(),
|
||||
false, () -> pack, factory, ResourcePackProfile.InsertionPosition.TOP,
|
||||
RESOURCE_PACK_SOURCE);
|
||||
|
||||
if (var3 != null) {
|
||||
consumer.accept(var3);
|
||||
if (resourcePackProfile != null) {
|
||||
consumer.accept(resourcePackProfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class MixinResourcePackManager<T extends ResourcePackProfile> {
|
|||
private Set<ResourcePackProvider> providers;
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
public void construct(ResourcePackProfile.Factory<T> arg, ResourcePackProvider[] resourcePackProviders, CallbackInfo info) {
|
||||
public void construct(ResourcePackProfile.Factory arg, ResourcePackProvider[] resourcePackProviders, CallbackInfo info) {
|
||||
providers = new HashSet<>(providers);
|
||||
providers.add(new ModResourcePackCreator(ResourceType.SERVER_DATA));
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-tag-extensions-v0"
|
||||
version = getSubprojectVersion(project, "0.2.7")
|
||||
version = getSubprojectVersion(project, "1.0.0")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -19,6 +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.entity.EntityType;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -27,7 +28,6 @@ import net.minecraft.tag.EntityTypeTags;
|
|||
import net.minecraft.tag.FluidTags;
|
||||
import net.minecraft.tag.ItemTags;
|
||||
import net.minecraft.tag.Tag;
|
||||
import net.minecraft.tag.TagContainer;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import net.fabricmc.fabric.impl.tag.extension.TagDelegate;
|
||||
|
@ -38,7 +38,7 @@ import net.fabricmc.fabric.impl.tag.extension.TagDelegate;
|
|||
public final class TagRegistry {
|
||||
private TagRegistry() { }
|
||||
|
||||
public static <T> Tag.Identified<T> create(Identifier id, Supplier<TagContainer<T>> containerSupplier) {
|
||||
public static <T> Tag.Identified<T> create(Identifier id, Supplier<class_5414<T>> containerSupplier) {
|
||||
return new TagDelegate<>(id, containerSupplier);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,19 +19,19 @@ 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.Tag;
|
||||
import net.minecraft.tag.TagContainer;
|
||||
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<TagContainer<T>> containerSupplier;
|
||||
private final Supplier<class_5414<T>> containerSupplier;
|
||||
private volatile Target<T> target;
|
||||
private int clearCount;
|
||||
|
||||
public TagDelegate(Identifier id, Supplier<TagContainer<T>> containerSupplier) {
|
||||
public TagDelegate(Identifier id, Supplier<class_5414<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;
|
||||
TagContainer<T> reqContainer = containerSupplier.get();
|
||||
class_5414<T> reqContainer = containerSupplier.get();
|
||||
Tag<T> ret;
|
||||
|
||||
if (target == null || target.container != reqContainer) {
|
||||
ret = reqContainer.getOrCreate(getId());
|
||||
ret = reqContainer.method_30213(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(TagContainer<T> container, Tag<T> tag) {
|
||||
Target(class_5414<T> container, Tag<T> tag) {
|
||||
this.container = container;
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
final TagContainer<T> container;
|
||||
final class_5414<T> container;
|
||||
final Tag<T> tag;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,13 +20,12 @@ import org.spongepowered.asm.mixin.Mixin;
|
|||
import org.spongepowered.asm.mixin.Unique;
|
||||
|
||||
import net.minecraft.tag.Tag;
|
||||
import net.minecraft.tag.GlobalTagAccessor;
|
||||
import net.minecraft.tag.SetTag;
|
||||
|
||||
import net.fabricmc.fabric.api.tag.FabricTag;
|
||||
import net.fabricmc.fabric.impl.tag.extension.FabricTagHooks;
|
||||
|
||||
@Mixin(value = {GlobalTagAccessor.CachedTag.class, SetTag.class}, targets = {"net.minecraft.tag.Tag$1"})
|
||||
@Mixin(value = {SetTag.class}, targets = {"net.minecraft.tag.Tag$1", "net.minecraft.tag.GlobalTagAccessor$CachedTag"})
|
||||
public abstract class MixinTagImpl<T> implements FabricTag<T>, FabricTagHooks, Tag<T> {
|
||||
@Unique
|
||||
private int fabric_clearCount;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue