mirror of
https://github.com/FabricMC/fabric.git
synced 2025-03-23 21:40:02 -04:00
1.16.2-pre2 - no biomes for now
This commit is contained in:
parent
d54afe8768
commit
91555cd1f0
15 changed files with 38 additions and 18 deletions
build.gradle
fabric-game-rule-api-v1
build.gradle
src/main/java/net/fabricmc/fabric/impl/gamerule/widget
fabric-registry-sync-v0
fabric-rendering-fluids-v1
build.gradle
src/main/java/net/fabricmc/fabric/impl/client/rendering/fluid
fabric-tag-extensions-v0
settings.gradle
|
@ -18,8 +18,8 @@ plugins {
|
|||
def ENV = System.getenv()
|
||||
|
||||
class Globals {
|
||||
static def baseVersion = "0.16.3"
|
||||
static def mcVersion = "1.16.2-pre1"
|
||||
static def baseVersion = "0.16.4"
|
||||
static def mcVersion = "1.16.2-pre2"
|
||||
static def yarnVersion = "+build.1"
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-game-rule-api-v1"
|
||||
version = getSubprojectVersion(project, "1.0.0")
|
||||
version = getSubprojectVersion(project, "1.0.1")
|
||||
|
||||
minecraft {
|
||||
accessWidener = file("src/main/resources/fabric-game-rule-api-v1.accesswidener")
|
||||
|
|
|
@ -18,12 +18,12 @@ package net.fabricmc.fabric.impl.gamerule.widget;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.class_5481;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.world.EditGameRulesScreen;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.OrderedText;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
@ -34,7 +34,7 @@ import net.fabricmc.fabric.mixin.gamerule.client.EditGameRulesScreenAccessor;
|
|||
public final class DoubleRuleWidget extends EditGameRulesScreen.NamedRuleWidget {
|
||||
private final TextFieldWidget textFieldWidget;
|
||||
|
||||
public DoubleRuleWidget(EditGameRulesScreen gameRuleScreen, Text name, List<class_5481> description, final String ruleName, DoubleRule rule) {
|
||||
public DoubleRuleWidget(EditGameRulesScreen gameRuleScreen, Text name, List<OrderedText> description, final String ruleName, DoubleRule rule) {
|
||||
gameRuleScreen.super(description, name);
|
||||
EditGameRulesScreenAccessor accessor = (EditGameRulesScreenAccessor) gameRuleScreen;
|
||||
|
||||
|
|
|
@ -19,11 +19,11 @@ package net.fabricmc.fabric.impl.gamerule.widget;
|
|||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.class_5481;
|
||||
import net.minecraft.client.gui.screen.world.EditGameRulesScreen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.OrderedText;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
@ -37,7 +37,7 @@ public final class EnumRuleWidget<E extends Enum<E>> extends EditGameRulesScreen
|
|||
private final ButtonWidget buttonWidget;
|
||||
private final String rootTranslationKey;
|
||||
|
||||
public EnumRuleWidget(EditGameRulesScreen gameRuleScreen, Text name, List<class_5481> description, final String ruleName, EnumRule<E> rule, String translationKey) {
|
||||
public EnumRuleWidget(EditGameRulesScreen gameRuleScreen, Text name, List<OrderedText> description, final String ruleName, EnumRule<E> rule, String translationKey) {
|
||||
gameRuleScreen.super(description, name);
|
||||
|
||||
// Base translation key needs to be set before the button widget is created.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-registry-sync-v0"
|
||||
version = getSubprojectVersion(project, "0.4.1")
|
||||
version = getSubprojectVersion(project, "0.4.2")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -107,7 +107,7 @@ public final class FabricRegistryBuilder<T, R extends MutableRegistry<T>> {
|
|||
fabricRegistry.build(attributes);
|
||||
|
||||
//noinspection unchecked
|
||||
AccessorRegistry.getROOT().add(((AccessorRegistry) registry).getRegistryKey(), registry);
|
||||
AccessorRegistry.getROOT().add(((AccessorRegistry) registry).getRegistryKey(), registry, Lifecycle.stable());
|
||||
|
||||
return registry;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.util.Set;
|
|||
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
import com.mojang.serialization.Lifecycle;
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
|
@ -135,7 +136,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) {
|
||||
public void setPre(int id, RegistryKey<T> registryId, Object object, Lifecycle lifecycle, CallbackInfoReturnable info) {
|
||||
int indexedEntriesId = field_26683.getInt((T) object);
|
||||
|
||||
if (indexedEntriesId >= 0) {
|
||||
|
@ -164,7 +165,7 @@ public abstract class MixinIdRegistry<T> implements RemappableRegistry, Listenab
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Inject(method = "set", at = @At("RETURN"))
|
||||
public void setPost(int id, RegistryKey<T> registryId, Object object, CallbackInfoReturnable info) {
|
||||
public void setPost(int id, RegistryKey<T> registryId, Object object, Lifecycle lifecycle, CallbackInfoReturnable info) {
|
||||
if (fabric_isObjectNew) {
|
||||
fabric_addObjectEvent.invoker().onEntryAdded(id, registryId.getValue(), object);
|
||||
}
|
||||
|
|
|
@ -43,12 +43,12 @@ public abstract class MixinSimpleRegistry<T> extends Registry<T> {
|
|||
}
|
||||
|
||||
@Inject(method = "add", at = @At("RETURN"))
|
||||
private <V extends T> void add(RegistryKey<Registry<T>> registryKey, V entry, CallbackInfoReturnable<V> info) {
|
||||
private <V extends T> void add(RegistryKey<Registry<T>> registryKey, V entry, Lifecycle lifecycle, CallbackInfoReturnable<V> info) {
|
||||
onChange(registryKey);
|
||||
}
|
||||
|
||||
@Inject(method = "set", at = @At("RETURN"))
|
||||
private <V extends T> void set(int rawId, RegistryKey<Registry<T>> registryKey, V entry, CallbackInfoReturnable<V> info) {
|
||||
private <V extends T> void set(int rawId, RegistryKey<Registry<T>> registryKey, V entry, Lifecycle lifecycle, CallbackInfoReturnable<V> info) {
|
||||
onChange(registryKey);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-rendering-fluids-v1"
|
||||
version = getSubprojectVersion(project, "0.1.8")
|
||||
version = getSubprojectVersion(project, "0.1.9")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -25,6 +25,7 @@ import net.minecraft.fluid.Fluid;
|
|||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.world.BlockRenderView;
|
||||
import net.minecraft.world.biome.Biomes;
|
||||
|
||||
|
@ -33,6 +34,7 @@ import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandlerRegistry
|
|||
|
||||
public class FluidRenderHandlerRegistryImpl implements FluidRenderHandlerRegistry {
|
||||
public static final FluidRenderHandlerRegistryImpl INSTANCE = new FluidRenderHandlerRegistryImpl();
|
||||
private static final int DEFAULT_WATER_COLOR = BuiltinRegistries.BIOME.get(Biomes.OCEAN).getWaterColor();
|
||||
private final Map<Fluid, FluidRenderHandler> handlers = new IdentityHashMap<>();
|
||||
private final Map<Fluid, FluidRenderHandler> modHandlers = new IdentityHashMap<>();
|
||||
|
||||
|
@ -66,7 +68,7 @@ public class FluidRenderHandlerRegistryImpl implements FluidRenderHandlerRegistr
|
|||
if (view != null && pos != null) {
|
||||
return BiomeColors.getWaterColor(view, pos);
|
||||
} else {
|
||||
return Biomes.DEFAULT.getWaterColor();
|
||||
return DEFAULT_WATER_COLOR;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-tag-extensions-v0"
|
||||
version = getSubprojectVersion(project, "1.0.1")
|
||||
version = getSubprojectVersion(project, "1.0.2")
|
||||
|
||||
dependencies {
|
||||
compile project(path: ':fabric-api-base', configuration: 'dev')
|
||||
|
|
|
@ -18,6 +18,7 @@ package net.fabricmc.fabric.api.tag;
|
|||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import net.fabricmc.fabric.mixin.tag.extension.AccessorFluidTags;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tag.TagGroup;
|
||||
import net.minecraft.entity.EntityType;
|
||||
|
@ -51,7 +52,7 @@ public final class TagRegistry {
|
|||
}
|
||||
|
||||
public static Tag<Fluid> fluid(Identifier id) {
|
||||
return create(id, FluidTags::getTagGroup);
|
||||
return create(id, () -> AccessorFluidTags.getRequiredTags().getGroup());
|
||||
}
|
||||
|
||||
public static Tag<Item> item(Identifier id) {
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package net.fabricmc.fabric.mixin.tag.extension;
|
||||
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.tag.FluidTags;
|
||||
import net.minecraft.tag.RequiredTagList;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
@Mixin(FluidTags.class)
|
||||
public interface AccessorFluidTags {
|
||||
@Accessor("REQUIRED_TAGS")
|
||||
static RequiredTagList<Fluid> getRequiredTags() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
"package": "net.fabricmc.fabric.mixin.tag.extension",
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"mixins": [
|
||||
"AccessorFluidTags",
|
||||
"MixinTagImpl",
|
||||
"MixinTagBuilder"
|
||||
],
|
||||
|
|
|
@ -14,7 +14,7 @@ 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'
|
||||
|
|
Loading…
Add table
Reference in a new issue