Remove most deprecated features marked for removal in previous versions

Signed-off-by: Max <maxh2709@gmail.com>
This commit is contained in:
Max
2022-06-08 13:17:21 +02:00
parent 5b42f8d2dd
commit c870ccab83
22 changed files with 18 additions and 655 deletions

View File

@@ -1,37 +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.hooks;
import net.minecraft.world.level.storage.LevelResource;
import org.jetbrains.annotations.ApiStatus;
public class LevelResourceHooks {
private LevelResourceHooks() {
}
/**
* @deprecated Use the constructor directly.
*/
@Deprecated
@ApiStatus.ScheduledForRemoval
public static LevelResource create(String id) {
return new LevelResource(id);
}
}

View File

@@ -19,7 +19,6 @@
package dev.architectury.hooks.block;
import com.google.common.collect.ImmutableSet;
import com.mojang.datafixers.types.Type;
import dev.architectury.injectables.annotations.ExpectPlatform;
import net.minecraft.core.BlockPos;
@@ -27,7 +26,6 @@ import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import java.util.Set;
@@ -36,15 +34,6 @@ public class BlockEntityHooks {
private BlockEntityHooks() {
}
/**
* @deprecated Use the Builder from vanilla directly.
*/
@Deprecated
@ApiStatus.ScheduledForRemoval
public static <T extends BlockEntity> TypeBuilder<T> builder(Constructor<? extends T> constructor, Block... blocks) {
return new TypeBuilder<>(constructor, ImmutableSet.copyOf(blocks));
}
public static class TypeBuilder<T extends BlockEntity> {
private final Constructor<? extends T> constructor;
private final Set<Block> validBlocks;

View File

@@ -19,16 +19,11 @@
package dev.architectury.hooks.item.tool;
import com.google.common.collect.ImmutableMap;
import com.mojang.datafixers.util.Pair;
import dev.architectury.injectables.annotations.ExpectPlatform;
import net.minecraft.world.item.HoeItem;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import org.jetbrains.annotations.ApiStatus;
import java.util.HashMap;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
@@ -37,30 +32,6 @@ public final class HoeItemHooks {
private HoeItemHooks() {
}
/**
* Adds a new tilling (interact with hoe) interaction to the game.<p>
*
* Tilling uses a predicate/consumer pair system:
* <ul>
* <li>First, the game tests the context using the predicate.</li>
* <li>Then, if the predicate returns {@code true}, the game will, <em>on the server side only</em>,
* invoke the action and then damage the hoe item by 1.</li>
* <li>Otherwise, no action will be invoked.</li>
* </ul>
*
* @param input input block
* @param predicate context predicate
* @param action action to run
*/
@Deprecated(forRemoval = true)
@ApiStatus.ScheduledForRemoval
public static void addTillable(Block input, Predicate<UseOnContext> predicate, Consumer<UseOnContext> action) {
if (HoeItem.TILLABLES instanceof ImmutableMap) {
HoeItem.TILLABLES = new HashMap<>(HoeItem.TILLABLES);
}
HoeItem.TILLABLES.put(input, new Pair<>(predicate, action));
}
/**
* Adds a new tilling action.
*

View File

@@ -20,11 +20,8 @@
package dev.architectury.hooks.level;
import dev.architectury.injectables.annotations.ExpectPlatform;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
public final class ExplosionHooks {
private ExplosionHooks() {
@@ -34,32 +31,4 @@ public final class ExplosionHooks {
public static Vec3 getPosition(Explosion explosion) {
throw new AssertionError();
}
/**
* @deprecated Use the field directly.
*/
@Nullable
@Deprecated
@ApiStatus.ScheduledForRemoval
public static Entity getSource(Explosion explosion) {
return explosion.source;
}
/**
* @deprecated Use the field directly.
*/
@Deprecated
@ApiStatus.ScheduledForRemoval
public static float getRadius(Explosion explosion) {
return explosion.radius;
}
/**
* @deprecated Use the field directly.
*/
@Deprecated
@ApiStatus.ScheduledForRemoval
public static void setRadius(Explosion explosion, float radius) {
explosion.radius = radius;
}
}

View File

@@ -19,26 +19,15 @@
package dev.architectury.hooks.level.entity;
import dev.architectury.injectables.annotations.ExpectPlatform;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.EntityCollisionContext;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
public final class EntityHooks {
private EntityHooks() {
}
/**
* @deprecated Use the field directly.
*/
@Deprecated
@ApiStatus.ScheduledForRemoval
public static String getEncodeId(Entity entity) {
return entity.getEncodeId();
}
@Nullable
public static Entity fromCollision(CollisionContext ctx) {
return ctx instanceof EntityCollisionContext ? ((EntityCollisionContext) ctx).getEntity() : null;

View File

@@ -21,8 +21,6 @@ package dev.architectury.hooks.level.entity;
import dev.architectury.injectables.annotations.ExpectPlatform;
import net.minecraft.world.entity.player.Player;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
public final class PlayerHooks {
private PlayerHooks() {
@@ -32,13 +30,4 @@ public final class PlayerHooks {
public static boolean isFake(Player player) {
throw new AssertionError();
}
/**
* @deprecated Use the method directly.
*/
@Deprecated
@ApiStatus.ScheduledForRemoval
public static void closeContainer(Player player) {
player.closeContainer();
}
}

View File

@@ -1,66 +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.registry.block;
import dev.architectury.injectables.annotations.ExpectPlatform;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import org.jetbrains.annotations.ApiStatus;
import java.util.function.Function;
@Deprecated
@ApiStatus.ScheduledForRemoval
public abstract class BlockProperties extends BlockBehaviour.Properties implements BlockPropertiesExtension {
public BlockProperties(Material material, Function<BlockState, MaterialColor> function) {
super(material, function);
}
public static BlockProperties of(Material material) {
return of(material, material.getColor());
}
public static BlockProperties of(Material material, DyeColor color) {
return of(material, color.getMaterialColor());
}
@ExpectPlatform
public static BlockProperties of(Material material, MaterialColor color) {
throw new AssertionError();
}
@ExpectPlatform
public static BlockProperties of(Material material, Function<BlockState, MaterialColor> color) {
throw new AssertionError();
}
@ExpectPlatform
public static BlockProperties copy(BlockBehaviour block) {
throw new AssertionError();
}
@ExpectPlatform
public static BlockProperties copy(BlockBehaviour.Properties properties) {
throw new AssertionError();
}
}

View File

@@ -1,27 +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.registry.block;
import org.jetbrains.annotations.ApiStatus;
@Deprecated
@ApiStatus.ScheduledForRemoval
public interface BlockPropertiesExtension {
}

View File

@@ -1,88 +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.registry.level;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.level.GameRules;
import org.jetbrains.annotations.ApiStatus;
import java.util.function.BiConsumer;
/**
* A utility class for creating game rule types.
*/
public final class GameRuleFactory {
private GameRuleFactory() {
}
/**
* Creates a boolean rule type.
*
* @param defaultValue the rule's default value
* @return the created type
* @deprecated Use the method directly.
*/
@Deprecated
@ApiStatus.ScheduledForRemoval
public static GameRules.Type<GameRules.BooleanValue> createBooleanRule(boolean defaultValue) {
return GameRules.BooleanValue.create(defaultValue);
}
/**
* Creates a boolean rule type.
*
* @param defaultValue the rule's default value
* @param changedCallback a callback that is called when the rule's value is changed
* @return the created type
* @deprecated Use the method directly.
*/
@Deprecated
@ApiStatus.ScheduledForRemoval
public static GameRules.Type<GameRules.BooleanValue> createBooleanRule(boolean defaultValue, BiConsumer<MinecraftServer, GameRules.BooleanValue> changedCallback) {
return GameRules.BooleanValue.create(defaultValue, changedCallback);
}
/**
* Creates an integer rule type.
*
* @param defaultValue the rule's default value
* @return the created type
* @deprecated Use the method directly.
*/
@Deprecated
@ApiStatus.ScheduledForRemoval
public static GameRules.Type<GameRules.IntegerValue> createIntRule(int defaultValue) {
return GameRules.IntegerValue.create(defaultValue);
}
/**
* Creates an integer rule type.
*
* @param defaultValue the rule's default value
* @param changedCallback a callback that is called when the rule's value is changed
* @return the created type
* @deprecated Use the method directly.
*/
@Deprecated
@ApiStatus.ScheduledForRemoval
public static GameRules.Type<GameRules.IntegerValue> createIntRule(int defaultValue, BiConsumer<MinecraftServer, GameRules.IntegerValue> changedCallback) {
return GameRules.IntegerValue.create(defaultValue, changedCallback);
}
}

View File

@@ -1,47 +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.registry.level;
import net.minecraft.world.level.GameRules;
import org.jetbrains.annotations.ApiStatus;
/**
* A registry for registering game rules.
*/
public final class GameRuleRegistry {
private GameRuleRegistry() {
}
/**
* Registers a game rule.
*
* @param name the rule's name
* @param category the rule category
* @param type the type of the rule
* @param <T> the type of the rule value
* @return a key for the registered rule
* @deprecated Use the method directly.
*/
@Deprecated
@ApiStatus.ScheduledForRemoval
public static <T extends GameRules.Value<T>> GameRules.Key<T> register(String name, GameRules.Category category, GameRules.Type<T> type) {
return GameRules.register(name, category, type);
}
}

View File

@@ -1,43 +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.registry.level.advancement;
import net.minecraft.advancements.CriteriaTriggers;
import net.minecraft.advancements.CriterionTrigger;
import org.jetbrains.annotations.ApiStatus;
public final class CriteriaTriggersRegistry {
private CriteriaTriggersRegistry() {
}
/**
* Invokes {@link net.minecraft.advancements.CriteriaTriggers#register(CriterionTrigger)}.
*
* @param trigger The trigger to register
* @param <T> The type of trigger
* @return The trigger registered
* @deprecated Use the method directly.
*/
@Deprecated
@ApiStatus.ScheduledForRemoval
public static <T extends CriterionTrigger<?>> T register(T trigger) {
return CriteriaTriggers.register(trigger);
}
}

View File

@@ -1,44 +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.registry.level.entity;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import org.jetbrains.annotations.ApiStatus;
import java.util.function.Supplier;
@Environment(EnvType.CLIENT)
public final class EntityRendererRegistry {
private EntityRendererRegistry() {
}
/**
* @deprecated Migrate to {@link dev.architectury.registry.client.level.entity.EntityRendererRegistry}
*/
@Deprecated
@ApiStatus.ScheduledForRemoval
public static <T extends Entity> void register(Supplier<EntityType<? extends T>> type, EntityRendererProvider<T> provider) {
dev.architectury.registry.client.level.entity.EntityRendererRegistry.register(type, provider);
}
}

View File

@@ -1,52 +0,0 @@
/*
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dev.architectury.utils;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.Tag;
import org.jetbrains.annotations.ApiStatus;
/**
* @deprecated Use the vanilla constants (e.g. {@link Tag#TAG_END}) instead.
*/
@Deprecated
@ApiStatus.ScheduledForRemoval
public final class NbtType {
public static final int END = 0;
public static final int BYTE = 1;
public static final int SHORT = 2;
public static final int INT = 3;
public static final int LONG = 4;
public static final int FLOAT = 5;
public static final int DOUBLE = 6;
public static final int BYTE_ARRAY = 7;
public static final int STRING = 8;
public static final int LIST = 9;
public static final int COMPOUND = 10;
public static final int INT_ARRAY = 11;
public static final int LONG_ARRAY = 12;
/**
* Any numeric value: byte, short, int, long, float, double.
*
* @see CompoundTag#contains(String, int)
*/
public static final int NUMBER = 99;
private NbtType() {
}
}

View File

@@ -108,7 +108,7 @@ curseforge {
releaseType = "$rootProject.artifact_type"
changelogType = "html"
changelog = releaseChangelog()
addGameVersion "1.19-Snapshot"
addGameVersion "1.19"
addGameVersion "Java 17"
addGameVersion "Fabric"
relations {

View File

@@ -1,70 +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.registry.block.fabric;
import dev.architectury.registry.block.BlockProperties;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import org.jetbrains.annotations.ApiStatus;
import java.util.function.Function;
@Deprecated
@ApiStatus.ScheduledForRemoval
public class BlockPropertiesImpl {
public static BlockProperties of(Material material, MaterialColor color) {
return new Impl(material, (state) -> color);
}
public static BlockProperties of(Material material, Function<BlockState, MaterialColor> color) {
return new Impl(material, color);
}
public static BlockProperties copy(BlockBehaviour old) {
return copy(old.properties);
}
public static BlockProperties copy(BlockBehaviour.Properties old) {
var properties = of(old.material, old.materialColor);
properties.material = old.material;
properties.destroyTime = old.destroyTime;
properties.explosionResistance = old.explosionResistance;
properties.hasCollision = old.hasCollision;
properties.isRandomlyTicking = old.isRandomlyTicking;
properties.lightEmission = old.lightEmission;
properties.materialColor = old.materialColor;
properties.soundType = old.soundType;
properties.friction = old.friction;
properties.speedFactor = old.speedFactor;
properties.dynamicShape = old.dynamicShape;
properties.canOcclude = old.canOcclude;
properties.isAir = old.isAir;
properties.requiresCorrectToolForDrops = old.requiresCorrectToolForDrops;
return properties;
}
private static final class Impl extends BlockProperties {
public Impl(Material material, Function<BlockState, MaterialColor> function) {
super(material, function);
}
}
}

View File

@@ -121,7 +121,7 @@ curseforge {
releaseType = "$rootProject.artifact_type"
changelogType = "html"
changelog = releaseChangelog()
addGameVersion "1.19-Snapshot"
addGameVersion "1.19"
addGameVersion "Java 17"
addGameVersion "Forge"
mainArtifact(remapJar.archivePath) {

View File

@@ -26,7 +26,6 @@ import net.minecraft.world.entity.ai.village.poi.PoiManager;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.chunk.ProtoChunk;
import net.minecraft.world.level.chunk.storage.ChunkSerializer;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
import net.minecraftforge.event.world.ChunkDataEvent;
import net.minecraftforge.eventbus.api.Event;
import org.spongepowered.asm.mixin.Mixin;

View File

@@ -1,70 +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.registry.block.forge;
import dev.architectury.registry.block.BlockProperties;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import org.jetbrains.annotations.ApiStatus;
import java.util.function.Function;
@Deprecated
@ApiStatus.ScheduledForRemoval
public class BlockPropertiesImpl {
public static BlockProperties of(Material material, MaterialColor materialColor) {
return new Impl(material, (state) -> materialColor);
}
public static BlockProperties of(Material material, Function<BlockState, MaterialColor> function) {
return new Impl(material, function);
}
public static BlockProperties copy(BlockBehaviour abstractBlock) {
return copy(abstractBlock.properties);
}
public static BlockProperties copy(BlockBehaviour.Properties old) {
BlockProperties properties = of(old.material, old.materialColor);
properties.material = old.material;
properties.destroyTime = old.destroyTime;
properties.explosionResistance = old.explosionResistance;
properties.hasCollision = old.hasCollision;
properties.isRandomlyTicking = old.isRandomlyTicking;
properties.lightEmission = old.lightEmission;
properties.materialColor = old.materialColor;
properties.soundType = old.soundType;
properties.friction = old.friction;
properties.speedFactor = old.speedFactor;
properties.dynamicShape = old.dynamicShape;
properties.canOcclude = old.canOcclude;
properties.isAir = old.isAir;
properties.requiresCorrectToolForDrops = old.requiresCorrectToolForDrops;
return properties;
}
private static final class Impl extends BlockProperties {
public Impl(Material material, Function<BlockState, MaterialColor> function) {
super(material, function);
}
}
}

View File

@@ -1,23 +1,23 @@
org.gradle.jvmargs=-Xmx6G
org.gradle.daemon=false
platforms=fabric
platforms=fabric,forge
minecraft_version=1.19-rc1
supported_version=1.19-rc1
minecraft_version=1.19
supported_version=1.19
artifact_type=beta
archives_base_name=architectury
archives_base_name_snapshot=architectury-snapshot
base_version=5.4
base_version=5.5
maven_group=dev.architectury
fabric_loader_version=0.14.6
fabric_api_version=0.55.0+1.19
fabric_api_version=0.55.1+1.19
mod_menu_version=3.1.0
forge_version=40.1.14
forge_version=41.0.1
curseforge_id=419699
modrinth_id=lhGA9TYQ

View File

@@ -14,9 +14,9 @@ if (JavaVersion.current().ordinal() + 1 < 17) {
include("common")
include("fabric")
//include("forge")
include("forge")
include("testmod-common")
include("testmod-fabric")
//include("testmod-forge")
include("testmod-forge")
rootProject.name = "architectury"

View File

@@ -1,3 +1,7 @@
loom {
accessWidenerPath = project(':common').file("src/main/resources/architectury.accessWidener")
}
dependencies {
// We depend on fabric loader here to use the fabric @Environment annotations
// Do NOT use other classes from fabric loader

View File

@@ -19,20 +19,17 @@
package dev.architectury.test.gamerule;
import dev.architectury.registry.level.GameRuleFactory;
import net.minecraft.world.level.GameRules;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import static dev.architectury.registry.level.GameRuleRegistry.register;
public class TestGameRules {
private static final Logger LOGGER = LogManager.getLogger();
public static final GameRules.Key<GameRules.BooleanValue> SIMPLE_BOOL = register("simpleBool", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true));
public static final GameRules.Key<GameRules.IntegerValue> SIMPLE_INT = register("simpleInt", GameRules.Category.MISC, GameRuleFactory.createIntRule(10));
public static final GameRules.Key<GameRules.BooleanValue> CALLBACK_BOOL = register("callbackBool", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true, (server, value) -> LOGGER.info("changed to {}", value.get())));
public static final GameRules.Key<GameRules.IntegerValue> CALLBACK_INT = register("callbackInt", GameRules.Category.MISC, GameRuleFactory.createIntRule(10, (server, value) -> LOGGER.info("changed to {}", value.get())));
public static final GameRules.Key<GameRules.BooleanValue> SIMPLE_BOOL = GameRules.register("simpleBool", GameRules.Category.MISC, GameRules.BooleanValue.create(true));
public static final GameRules.Key<GameRules.IntegerValue> SIMPLE_INT = GameRules.register("simpleInt", GameRules.Category.MISC, GameRules.IntegerValue.create(10));
public static final GameRules.Key<GameRules.BooleanValue> CALLBACK_BOOL = GameRules.register("callbackBool", GameRules.Category.MISC, GameRules.BooleanValue.create(true, (server, value) -> LOGGER.info("changed to {}", value.get())));
public static final GameRules.Key<GameRules.IntegerValue> CALLBACK_INT = GameRules.register("callbackInt", GameRules.Category.MISC, GameRules.IntegerValue.create(10, (server, value) -> LOGGER.info("changed to {}", value.get())));
public static void init() {
}