Add 1.18-1.18.1 version constraints

This commit is contained in:
shedaniel
2022-04-02 22:03:35 +08:00
parent 53928d8180
commit b2e02df67c
7 changed files with 6 additions and 40 deletions

View File

@@ -20,7 +20,6 @@
package dev.architectury.hooks.tags;
import dev.architectury.injectables.annotations.ExpectPlatform;
import dev.architectury.mixin.FluidTagsAccessor;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.*;
import net.minecraft.world.entity.EntityType;
@@ -48,7 +47,7 @@ public final class TagHooks {
}
public static Tag.Named<Fluid> optionalFluid(ResourceLocation id) {
return optional(id, FluidTagsAccessor.getHelper()::getAllTags);
return optional(id, FluidTags.HELPER::getAllTags);
}
public static Tag.Named<EntityType<?>> optionalEntityType(ResourceLocation id) {

View File

@@ -1,34 +0,0 @@
/*
* This file is part of architectury.
* Copyright (C) 2020, 2021, 2022 architectury
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package dev.architectury.mixin;
import net.minecraft.tags.FluidTags;
import net.minecraft.tags.StaticTagHelper;
import net.minecraft.world.level.material.Fluid;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(FluidTags.class)
public interface FluidTagsAccessor {
@Accessor("HELPER")
static StaticTagHelper<Fluid> getHelper() {
throw new AssertionError();
}
}

View File

@@ -44,6 +44,8 @@ accessible field net/minecraft/world/item/ShovelItem FLATTENABLES Ljava/util/Map
mutable field net/minecraft/world/item/ShovelItem FLATTENABLES Ljava/util/Map;
accessible field net/minecraft/world/item/HoeItem TILLABLES Ljava/util/Map;
mutable field net/minecraft/world/item/HoeItem TILLABLES Ljava/util/Map;
accessible field net/minecraft/tags/FluidTags HELPER Lnet/minecraft/tags/StaticTagHelper;
mutable field net/minecraft/tags/FluidTags HELPER Lnet/minecraft/tags/StaticTagHelper;
transitive-accessible field net/minecraft/world/level/Explosion source Lnet/minecraft/world/entity/Entity;
transitive-mutable field net/minecraft/world/level/Explosion source Lnet/minecraft/world/entity/Entity;
transitive-accessible field net/minecraft/world/level/Explosion radius F

View File

@@ -6,7 +6,6 @@
"client": [
],
"mixins": [
"FluidTagsAccessor",
"MixinLightningBolt"
],
"injectors": {