mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-21 11:20:55 -04:00
20w14a
This commit is contained in:
parent
b50ffc7bfb
commit
c808269fb2
22 changed files with 74 additions and 50 deletions
build.gradle
fabric-commands-v0
fabric-content-registries-v0
fabric-object-builders-v0
build.gradle
src/main/java/net/fabricmc/fabric
fabric-renderer-indigo
build.gradle
src/main/java/net/fabricmc/fabric/impl/client/indigo/renderer/render
fabric-tag-extensions-v0
src/main/resources
|
@ -12,8 +12,8 @@ plugins {
|
|||
def ENV = System.getenv()
|
||||
|
||||
class Globals {
|
||||
static def baseVersion = "0.5.6"
|
||||
static def mcVersion = "20w13a"
|
||||
static def baseVersion = "0.5.7"
|
||||
static def mcVersion = "20w14a"
|
||||
static def yarnVersion = "+build.1"
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,9 @@ publishing {
|
|||
artifact(sourcesJar) {
|
||||
builtBy remapSourcesJar
|
||||
}
|
||||
artifact javadocJar
|
||||
artifact (javadocJar) {
|
||||
builtBy javadocJar
|
||||
}
|
||||
pom.withXml {
|
||||
def depsNode = asNode().appendNode("dependencies")
|
||||
subprojects.each {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-commands-v0"
|
||||
version = getSubprojectVersion(project, "0.1.2")
|
||||
version = getSubprojectVersion(project, "0.1.3")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -16,12 +16,10 @@
|
|||
|
||||
package net.fabricmc.fabric.mixin.command;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.Proxy;
|
||||
|
||||
import com.mojang.authlib.GameProfileRepository;
|
||||
import com.mojang.authlib.minecraft.MinecraftSessionService;
|
||||
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
|
||||
import com.mojang.datafixers.DataFixer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
@ -32,14 +30,15 @@ import net.minecraft.server.MinecraftServer;
|
|||
import net.minecraft.server.WorldGenerationProgressListenerFactory;
|
||||
import net.minecraft.server.command.CommandManager;
|
||||
import net.minecraft.server.dedicated.MinecraftDedicatedServer;
|
||||
import net.minecraft.world.level.storage.LevelStorage;
|
||||
import net.minecraft.util.UserCache;
|
||||
|
||||
import net.fabricmc.fabric.impl.command.CommandRegistryImpl;
|
||||
|
||||
@Mixin(MinecraftDedicatedServer.class)
|
||||
public abstract class MixinMinecraftDedicatedServer extends MinecraftServer {
|
||||
public MixinMinecraftDedicatedServer(File file_1, Proxy proxy_1, DataFixer dataFixer_1, CommandManager serverCommandManager_1, YggdrasilAuthenticationService yggdrasilAuthenticationService_1, MinecraftSessionService minecraftSessionService_1, GameProfileRepository gameProfileRepository_1, UserCache userCache_1, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory_1, String string_1) {
|
||||
super(file_1, proxy_1, dataFixer_1, serverCommandManager_1, yggdrasilAuthenticationService_1, minecraftSessionService_1, gameProfileRepository_1, userCache_1, worldGenerationProgressListenerFactory_1, string_1);
|
||||
public MixinMinecraftDedicatedServer(LevelStorage.class_5143 arg, Proxy proxy, DataFixer dataFixer, CommandManager commandManager, MinecraftSessionService minecraftSessionService, GameProfileRepository gameProfileRepository, UserCache userCache, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory) {
|
||||
super(arg, proxy, dataFixer, commandManager, minecraftSessionService, gameProfileRepository, userCache, worldGenerationProgressListenerFactory);
|
||||
}
|
||||
|
||||
@Inject(method = "setupServer", at = @At("HEAD"))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-content-registries-v0"
|
||||
version = getSubprojectVersion(project, "0.1.3")
|
||||
version = getSubprojectVersion(project, "0.1.4")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -56,7 +56,7 @@ public class FuelRegistryImpl implements FuelRegistry {
|
|||
@Override
|
||||
public void add(Tag<Item> tag, Integer cookTime) {
|
||||
if (cookTime > 32767) {
|
||||
LOGGER.warn("Tried to register an overly high cookTime: " + cookTime + " > 32767! (" + tag.getId() + ")");
|
||||
LOGGER.warn("Tried to register an overly high cookTime: " + cookTime + " > 32767! (" + getTagName(tag) + ")");
|
||||
}
|
||||
|
||||
tagCookTimes.put(tag, cookTime.intValue());
|
||||
|
@ -108,4 +108,12 @@ public class FuelRegistryImpl implements FuelRegistry {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static String getTagName(Tag<?> tag) {
|
||||
if (tag instanceof Tag.class_5123) {
|
||||
return ((Tag.class_5123<?>) tag).method_26791().toString();
|
||||
}
|
||||
|
||||
return tag.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-object-builders"
|
||||
version = getSubprojectVersion(project, "0.2.2")
|
||||
version = getSubprojectVersion(project, "0.2.3")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -78,7 +78,7 @@ public final class BlockSettingsExtensions {
|
|||
}
|
||||
|
||||
public static void dynamicBounds(Settings settings) {
|
||||
((BlockSettingsHooks) settings).invokeHasDynamicBounds();
|
||||
((BlockSettingsHooks) settings).invokeDynamicBounds();
|
||||
}
|
||||
|
||||
public static void dropsNothing(Settings settings) {
|
||||
|
|
|
@ -63,7 +63,7 @@ public interface BlockSettingsHooks {
|
|||
Block.Settings invokeTicksRandomly();
|
||||
|
||||
@Invoker
|
||||
Block.Settings invokeHasDynamicBounds();
|
||||
Block.Settings invokeDynamicBounds();
|
||||
|
||||
@Invoker
|
||||
Block.Settings invokeDropsNothing();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-renderer-indigo"
|
||||
version = getSubprojectVersion(project, "0.2.27")
|
||||
version = getSubprojectVersion(project, "0.2.28")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -25,10 +25,10 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.render.WorldRenderer;
|
||||
import net.minecraft.client.util.math.Matrix4f;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.client.util.math.Matrix3f;
|
||||
import net.minecraft.util.math.Matrix3f;
|
||||
|
||||
import net.fabricmc.fabric.api.renderer.v1.render.RenderContext.QuadTransform;
|
||||
import net.fabricmc.fabric.impl.client.indigo.renderer.aocalc.AoCalculator;
|
||||
|
|
|
@ -18,8 +18,8 @@ package net.fabricmc.fabric.impl.client.indigo.renderer.render;
|
|||
|
||||
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
||||
|
||||
import net.minecraft.client.util.math.Matrix4f;
|
||||
import net.minecraft.client.util.math.Matrix3f;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
import net.minecraft.util.math.Matrix3f;
|
||||
|
||||
import net.fabricmc.fabric.api.renderer.v1.mesh.MutableQuadView;
|
||||
import net.fabricmc.fabric.api.renderer.v1.render.RenderContext;
|
||||
|
|
|
@ -26,8 +26,8 @@ import net.minecraft.client.render.VertexConsumer;
|
|||
import net.minecraft.client.render.WorldRenderer;
|
||||
import net.minecraft.client.render.block.BlockModelRenderer;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.util.math.Matrix4f;
|
||||
import net.minecraft.client.util.math.Matrix3f;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
import net.minecraft.util.math.Matrix3f;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.BlockRenderView;
|
||||
|
|
|
@ -33,7 +33,7 @@ import net.minecraft.client.render.model.BakedModel;
|
|||
import net.minecraft.client.render.model.BakedQuad;
|
||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
||||
import net.minecraft.client.render.model.json.ModelTransformation.Mode;
|
||||
import net.minecraft.client.util.math.Matrix4f;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
|
|
@ -24,12 +24,12 @@ import net.minecraft.client.render.chunk.ChunkBuilder.ChunkData;
|
|||
import net.minecraft.client.render.chunk.ChunkBuilder.BuiltChunk;
|
||||
import net.minecraft.client.render.chunk.ChunkRendererRegion;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.util.math.Matrix4f;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
import net.minecraft.util.crash.CrashException;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashReportSection;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.client.util.math.Matrix3f;
|
||||
import net.minecraft.util.math.Matrix3f;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
import net.fabricmc.fabric.api.renderer.v1.mesh.Mesh;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-tag-extensions-v0"
|
||||
version = getSubprojectVersion(project, "0.1.3")
|
||||
version = getSubprojectVersion(project, "0.2.0")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -40,7 +40,7 @@ import net.fabricmc.fabric.impl.tag.extension.TagDelegate;
|
|||
public final class TagRegistry {
|
||||
private TagRegistry() { }
|
||||
|
||||
public static <T> Tag<T> create(Identifier id, Supplier<TagContainer<T>> containerSupplier) {
|
||||
public static <T> Tag.class_5123<T> create(Identifier id, Supplier<TagContainer<T>> containerSupplier) {
|
||||
return new TagDelegate<>(id, containerSupplier);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,20 +16,23 @@
|
|||
|
||||
package net.fabricmc.fabric.impl.tag.extension;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import net.minecraft.tag.Tag;
|
||||
import net.minecraft.tag.TagContainer;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public final class TagDelegate<T> extends Tag<T> {
|
||||
import net.fabricmc.fabric.api.tag.FabricTag;
|
||||
|
||||
public final class TagDelegate<T> implements Tag.class_5123<T>, FabricTag<T>, FabricTagHooks {
|
||||
private final Identifier id;
|
||||
private final Supplier<TagContainer<T>> containerSupplier;
|
||||
private volatile Target<T> target;
|
||||
private int clearCount;
|
||||
|
||||
public TagDelegate(Identifier id, Supplier<TagContainer<T>> containerSupplier) {
|
||||
super(id);
|
||||
|
||||
this.id = id;
|
||||
this.containerSupplier = containerSupplier;
|
||||
}
|
||||
|
||||
|
@ -39,15 +42,10 @@ public final class TagDelegate<T> extends Tag<T> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<T> values() {
|
||||
public List<T> values() {
|
||||
return getTag().values();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Tag.Entry<T>> entries() {
|
||||
return getTag().entries();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the tag this delegate is pointing to, computing it if missing or outdated.
|
||||
*
|
||||
|
@ -63,7 +61,7 @@ public final class TagDelegate<T> extends Tag<T> {
|
|||
Tag<T> ret;
|
||||
|
||||
if (target == null || target.container != reqContainer) {
|
||||
ret = reqContainer.getOrCreate(getId());
|
||||
ret = reqContainer.getOrCreate(method_26791());
|
||||
this.target = new Target<>(reqContainer, ret);
|
||||
} else {
|
||||
ret = target.tag;
|
||||
|
@ -72,6 +70,21 @@ public final class TagDelegate<T> extends Tag<T> {
|
|||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier method_26791() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBeenReplaced() {
|
||||
return clearCount > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fabric_setExtraData(int clearCount) {
|
||||
this.clearCount = clearCount;
|
||||
}
|
||||
|
||||
private static final class Target<T> {
|
||||
Target(TagContainer<T> container, Tag<T> tag) {
|
||||
this.container = container;
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
|
||||
package net.fabricmc.fabric.mixin.tag.extension;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
@ -25,10 +25,10 @@ import org.spongepowered.asm.mixin.Shadow;
|
|||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import net.minecraft.tag.Tag;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import net.fabricmc.fabric.api.tag.FabricTagBuilder;
|
||||
import net.fabricmc.fabric.impl.tag.extension.FabricTagHooks;
|
||||
|
@ -36,24 +36,25 @@ import net.fabricmc.fabric.impl.tag.extension.FabricTagHooks;
|
|||
@Mixin(Tag.Builder.class)
|
||||
public class MixinTagBuilder<T> implements FabricTagBuilder<T> {
|
||||
@Shadow
|
||||
private Set<Tag.Entry<T>> entries;
|
||||
private Set<Tag.Entry> field_23688;
|
||||
|
||||
@Unique
|
||||
private int fabric_clearCount;
|
||||
|
||||
@Inject(at = @At("RETURN"), method = "build")
|
||||
public void onBuildFinished(Identifier id, CallbackInfoReturnable<Tag<T>> info) {
|
||||
((FabricTagHooks) info.getReturnValue()).fabric_setExtraData(fabric_clearCount);
|
||||
@Redirect(method = "method_26782", at = @At(value = "INVOKE", target = "Ljava/util/Optional;of(Ljava/lang/Object;)Ljava/util/Optional;"))
|
||||
private Optional<?> build(Object tagObj) {
|
||||
((FabricTagHooks) tagObj).fabric_setExtraData(fabric_clearCount);
|
||||
return Optional.of(tagObj);
|
||||
}
|
||||
|
||||
@Inject(at = @At(value = "INVOKE", target = "Ljava/util/Set;clear()V"), method = "fromJson")
|
||||
public void onFromJsonClear(Function<Identifier, T> function_1, JsonObject jsonObject_1, CallbackInfoReturnable<Tag.Builder<T>> info) {
|
||||
@Inject(at = @At(value = "INVOKE", target = "Ljava/util/Set;clear()V"), method = "method_26780")
|
||||
public void onFromJsonClear(JsonObject jsonObject_1, CallbackInfoReturnable<Tag.Builder> info) {
|
||||
fabric_clearCount++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearTagEntries() {
|
||||
entries.clear();
|
||||
field_23688.clear();
|
||||
fabric_clearCount++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ import net.minecraft.tag.Tag;
|
|||
import net.fabricmc.fabric.api.tag.FabricTag;
|
||||
import net.fabricmc.fabric.impl.tag.extension.FabricTagHooks;
|
||||
|
||||
@Mixin(Tag.class)
|
||||
public class MixinTag<T> implements FabricTag<T>, FabricTagHooks {
|
||||
@Mixin(targets = {"net.minecraft.tag.Tag$1", "net.minecraft.class_5120.class_5121"})
|
||||
public abstract class MixinTagImpl<T> implements FabricTag<T>, FabricTagHooks, Tag<T> {
|
||||
@Unique
|
||||
private int fabric_clearCount;
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
"package": "net.fabricmc.fabric.mixin.tag.extension",
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"mixins": [
|
||||
"MixinTag",
|
||||
"MixinTagImpl",
|
||||
"MixinTagBuilder"
|
||||
],
|
||||
"injectors": {
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
"depends": {
|
||||
"fabricloader": ">=0.4.0",
|
||||
"fabric-api-base": "*",
|
||||
"fabric-resource-loader-v0": "*"
|
||||
"fabric-resource-loader-v0": "*",
|
||||
"minecraft": "~1.16-alpha.20.14.a"
|
||||
},
|
||||
"description": "Hooks for tags.",
|
||||
"mixins": [
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.7.8",
|
||||
"minecraft": "~1.16-alpha.20.10.a"
|
||||
"minecraft": "~1.16-alpha.20.14.a"
|
||||
},
|
||||
"description": "Core API module providing key hooks and intercompatibility features."
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue