diff --git a/common/src/main/java/dev/architectury/hooks/LevelResourceHooks.java b/common/src/main/java/dev/architectury/hooks/LevelResourceHooks.java deleted file mode 100644 index 202528c4..00000000 --- a/common/src/main/java/dev/architectury/hooks/LevelResourceHooks.java +++ /dev/null @@ -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); - } -} diff --git a/common/src/main/java/dev/architectury/hooks/block/BlockEntityHooks.java b/common/src/main/java/dev/architectury/hooks/block/BlockEntityHooks.java index 5d286c87..a35434da 100644 --- a/common/src/main/java/dev/architectury/hooks/block/BlockEntityHooks.java +++ b/common/src/main/java/dev/architectury/hooks/block/BlockEntityHooks.java @@ -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 TypeBuilder builder(Constructor constructor, Block... blocks) { - return new TypeBuilder<>(constructor, ImmutableSet.copyOf(blocks)); - } - public static class TypeBuilder { private final Constructor constructor; private final Set validBlocks; diff --git a/common/src/main/java/dev/architectury/hooks/item/tool/HoeItemHooks.java b/common/src/main/java/dev/architectury/hooks/item/tool/HoeItemHooks.java index 78617c36..7d1af3b1 100644 --- a/common/src/main/java/dev/architectury/hooks/item/tool/HoeItemHooks.java +++ b/common/src/main/java/dev/architectury/hooks/item/tool/HoeItemHooks.java @@ -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.

- * - * Tilling uses a predicate/consumer pair system: - *

    - *
  • First, the game tests the context using the predicate.
  • - *
  • Then, if the predicate returns {@code true}, the game will, on the server side only, - * invoke the action and then damage the hoe item by 1.
  • - *
  • Otherwise, no action will be invoked.
  • - *
- * - * @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 predicate, Consumer 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. * diff --git a/common/src/main/java/dev/architectury/hooks/level/ExplosionHooks.java b/common/src/main/java/dev/architectury/hooks/level/ExplosionHooks.java index 8691a21c..77fb93d5 100644 --- a/common/src/main/java/dev/architectury/hooks/level/ExplosionHooks.java +++ b/common/src/main/java/dev/architectury/hooks/level/ExplosionHooks.java @@ -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; - } } diff --git a/common/src/main/java/dev/architectury/hooks/level/entity/EntityHooks.java b/common/src/main/java/dev/architectury/hooks/level/entity/EntityHooks.java index 8423f32e..37361727 100644 --- a/common/src/main/java/dev/architectury/hooks/level/entity/EntityHooks.java +++ b/common/src/main/java/dev/architectury/hooks/level/entity/EntityHooks.java @@ -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; diff --git a/common/src/main/java/dev/architectury/hooks/level/entity/PlayerHooks.java b/common/src/main/java/dev/architectury/hooks/level/entity/PlayerHooks.java index f4e4179c..7ce7ae50 100644 --- a/common/src/main/java/dev/architectury/hooks/level/entity/PlayerHooks.java +++ b/common/src/main/java/dev/architectury/hooks/level/entity/PlayerHooks.java @@ -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(); - } } diff --git a/common/src/main/java/dev/architectury/registry/block/BlockProperties.java b/common/src/main/java/dev/architectury/registry/block/BlockProperties.java deleted file mode 100644 index c42d11a2..00000000 --- a/common/src/main/java/dev/architectury/registry/block/BlockProperties.java +++ /dev/null @@ -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 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 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(); - } -} diff --git a/common/src/main/java/dev/architectury/registry/block/BlockPropertiesExtension.java b/common/src/main/java/dev/architectury/registry/block/BlockPropertiesExtension.java deleted file mode 100644 index 407f523e..00000000 --- a/common/src/main/java/dev/architectury/registry/block/BlockPropertiesExtension.java +++ /dev/null @@ -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 { -} \ No newline at end of file diff --git a/common/src/main/java/dev/architectury/registry/level/GameRuleFactory.java b/common/src/main/java/dev/architectury/registry/level/GameRuleFactory.java deleted file mode 100644 index 0ced127f..00000000 --- a/common/src/main/java/dev/architectury/registry/level/GameRuleFactory.java +++ /dev/null @@ -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 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 createBooleanRule(boolean defaultValue, BiConsumer 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 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 createIntRule(int defaultValue, BiConsumer changedCallback) { - return GameRules.IntegerValue.create(defaultValue, changedCallback); - } -} diff --git a/common/src/main/java/dev/architectury/registry/level/GameRuleRegistry.java b/common/src/main/java/dev/architectury/registry/level/GameRuleRegistry.java deleted file mode 100644 index 49d94e3f..00000000 --- a/common/src/main/java/dev/architectury/registry/level/GameRuleRegistry.java +++ /dev/null @@ -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 the type of the rule value - * @return a key for the registered rule - * @deprecated Use the method directly. - */ - @Deprecated - @ApiStatus.ScheduledForRemoval - public static > GameRules.Key register(String name, GameRules.Category category, GameRules.Type type) { - return GameRules.register(name, category, type); - } -} diff --git a/common/src/main/java/dev/architectury/registry/level/advancement/CriteriaTriggersRegistry.java b/common/src/main/java/dev/architectury/registry/level/advancement/CriteriaTriggersRegistry.java deleted file mode 100644 index a4a95306..00000000 --- a/common/src/main/java/dev/architectury/registry/level/advancement/CriteriaTriggersRegistry.java +++ /dev/null @@ -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 The type of trigger - * @return The trigger registered - * @deprecated Use the method directly. - */ - @Deprecated - @ApiStatus.ScheduledForRemoval - public static > T register(T trigger) { - return CriteriaTriggers.register(trigger); - } -} diff --git a/common/src/main/java/dev/architectury/registry/level/entity/EntityRendererRegistry.java b/common/src/main/java/dev/architectury/registry/level/entity/EntityRendererRegistry.java deleted file mode 100644 index 3e409069..00000000 --- a/common/src/main/java/dev/architectury/registry/level/entity/EntityRendererRegistry.java +++ /dev/null @@ -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 void register(Supplier> type, EntityRendererProvider provider) { - dev.architectury.registry.client.level.entity.EntityRendererRegistry.register(type, provider); - } -} diff --git a/common/src/main/java/dev/architectury/utils/NbtType.java b/common/src/main/java/dev/architectury/utils/NbtType.java deleted file mode 100644 index a45803c3..00000000 --- a/common/src/main/java/dev/architectury/utils/NbtType.java +++ /dev/null @@ -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() { - } -} diff --git a/fabric/build.gradle b/fabric/build.gradle index b3db0713..40d123be 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -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 { diff --git a/fabric/src/main/java/dev/architectury/registry/block/fabric/BlockPropertiesImpl.java b/fabric/src/main/java/dev/architectury/registry/block/fabric/BlockPropertiesImpl.java deleted file mode 100644 index 4342bd99..00000000 --- a/fabric/src/main/java/dev/architectury/registry/block/fabric/BlockPropertiesImpl.java +++ /dev/null @@ -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 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 function) { - super(material, function); - } - } -} diff --git a/forge/build.gradle b/forge/build.gradle index 3951daa9..8d03fdde 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -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) { diff --git a/forge/src/main/java/dev/architectury/mixin/forge/MixinChunkSerializer.java b/forge/src/main/java/dev/architectury/mixin/forge/MixinChunkSerializer.java index ccdc9739..03cdb6b6 100644 --- a/forge/src/main/java/dev/architectury/mixin/forge/MixinChunkSerializer.java +++ b/forge/src/main/java/dev/architectury/mixin/forge/MixinChunkSerializer.java @@ -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; diff --git a/forge/src/main/java/dev/architectury/registry/block/forge/BlockPropertiesImpl.java b/forge/src/main/java/dev/architectury/registry/block/forge/BlockPropertiesImpl.java deleted file mode 100644 index 552cc3cf..00000000 --- a/forge/src/main/java/dev/architectury/registry/block/forge/BlockPropertiesImpl.java +++ /dev/null @@ -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 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 function) { - super(material, function); - } - } -} diff --git a/gradle.properties b/gradle.properties index eacb499f..54b3ae8c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 752c1f7d..938c20fb 100644 --- a/settings.gradle +++ b/settings.gradle @@ -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" diff --git a/testmod-common/build.gradle b/testmod-common/build.gradle index 21d3a050..cb6aef5b 100644 --- a/testmod-common/build.gradle +++ b/testmod-common/build.gradle @@ -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 diff --git a/testmod-common/src/main/java/dev/architectury/test/gamerule/TestGameRules.java b/testmod-common/src/main/java/dev/architectury/test/gamerule/TestGameRules.java index d9df03c8..3911b496 100644 --- a/testmod-common/src/main/java/dev/architectury/test/gamerule/TestGameRules.java +++ b/testmod-common/src/main/java/dev/architectury/test/gamerule/TestGameRules.java @@ -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 SIMPLE_BOOL = register("simpleBool", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true)); - public static final GameRules.Key SIMPLE_INT = register("simpleInt", GameRules.Category.MISC, GameRuleFactory.createIntRule(10)); - public static final GameRules.Key CALLBACK_BOOL = register("callbackBool", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true, (server, value) -> LOGGER.info("changed to {}", value.get()))); - public static final GameRules.Key CALLBACK_INT = register("callbackInt", GameRules.Category.MISC, GameRuleFactory.createIntRule(10, (server, value) -> LOGGER.info("changed to {}", value.get()))); + public static final GameRules.Key SIMPLE_BOOL = GameRules.register("simpleBool", GameRules.Category.MISC, GameRules.BooleanValue.create(true)); + public static final GameRules.Key SIMPLE_INT = GameRules.register("simpleInt", GameRules.Category.MISC, GameRules.IntegerValue.create(10)); + public static final GameRules.Key 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 CALLBACK_INT = GameRules.register("callbackInt", GameRules.Category.MISC, GameRules.IntegerValue.create(10, (server, value) -> LOGGER.info("changed to {}", value.get()))); public static void init() { }