diff --git a/common/src/main/java/me/shedaniel/architectury/ExpectPlatform.java b/common/src/main/java/me/shedaniel/architectury/ExpectPlatform.java deleted file mode 100644 index 0cb81338..00000000 --- a/common/src/main/java/me/shedaniel/architectury/ExpectPlatform.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is part of architectury. - * Copyright (C) 2020, 2021 shedaniel - * - * 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 me.shedaniel.architectury; - -import org.jetbrains.annotations.ApiStatus; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Please migrate to {@link me.shedaniel.architectury.annotations.ExpectPlatform}. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.METHOD) -@Deprecated -@ApiStatus.ScheduledForRemoval(inVersion = "2.0") -public @interface ExpectPlatform { -} diff --git a/common/src/main/java/me/shedaniel/architectury/event/EventHandler.java b/common/src/main/java/me/shedaniel/architectury/event/EventHandler.java index 339f005a..6502540b 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/EventHandler.java +++ b/common/src/main/java/me/shedaniel/architectury/event/EventHandler.java @@ -41,8 +41,6 @@ public final class EventHandler { registerCommon(); if (Platform.getEnvironment() == Env.SERVER) registerServer(); - - registerDelegates(); } @ExpectPlatform @@ -61,10 +59,4 @@ public final class EventHandler { private static void registerServer() { throw new AssertionError(); } - - @SuppressWarnings("deprecation") - private static void registerDelegates() { - BlockEvent.PLACE.register((EntityEvent.PLACE_BLOCK.invoker()::placeBlock)); - BlockEvent.BREAK.register((PlayerEvent.BREAK_BLOCK.invoker()::breakBlock)); - } } diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/EntityEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/EntityEvent.java index 9bafe120..2120d6df 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/EntityEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/EntityEvent.java @@ -45,13 +45,6 @@ public interface EntityEvent { */ Event ADD = EventFactory.createInteractionResult(); - /** - * @deprecated use {@link BlockEvent#PLACE} - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2.0") - Event PLACE_BLOCK = EventFactory.createInteractionResult(); - interface LivingDeath { InteractionResult die(LivingEntity entity, DamageSource source); } @@ -63,8 +56,4 @@ public interface EntityEvent { interface Add { InteractionResult add(Entity entity, Level world); } - - interface PlaceBlock { - InteractionResult placeBlock(Level world, BlockPos pos, BlockState state, @Nullable Entity placer); - } } diff --git a/common/src/main/java/me/shedaniel/architectury/event/events/PlayerEvent.java b/common/src/main/java/me/shedaniel/architectury/event/events/PlayerEvent.java index b86aae90..2c7320dd 100644 --- a/common/src/main/java/me/shedaniel/architectury/event/events/PlayerEvent.java +++ b/common/src/main/java/me/shedaniel/architectury/event/events/PlayerEvent.java @@ -52,13 +52,6 @@ public interface PlayerEvent { Event OPEN_MENU = EventFactory.createLoop(); Event CLOSE_MENU = EventFactory.createLoop(); - /** - * @deprecated use {@link BlockEvent#BREAK} - */ - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2.0") - Event BREAK_BLOCK = EventFactory.createInteractionResult(); - interface PlayerJoin { void join(ServerPlayer player); } @@ -103,10 +96,6 @@ public interface PlayerEvent { InteractionResult drop(Player player, ItemEntity entity); } - interface BreakBlock { - InteractionResult breakBlock(Level world, BlockPos pos, BlockState state, ServerPlayer player, @Nullable IntValue xp); - } - interface OpenMenu { void open(Player player, AbstractContainerMenu menu); } diff --git a/common/src/main/java/me/shedaniel/architectury/hooks/BlockEntityHooks.java b/common/src/main/java/me/shedaniel/architectury/hooks/BlockEntityHooks.java index c471c9e9..0027d319 100644 --- a/common/src/main/java/me/shedaniel/architectury/hooks/BlockEntityHooks.java +++ b/common/src/main/java/me/shedaniel/architectury/hooks/BlockEntityHooks.java @@ -19,7 +19,7 @@ package me.shedaniel.architectury.hooks; -import me.shedaniel.architectury.ExpectPlatform; +import me.shedaniel.architectury.annotations.ExpectPlatform; import net.minecraft.world.level.block.entity.BlockEntity; public class BlockEntityHooks { diff --git a/common/src/main/java/me/shedaniel/architectury/networking/NetworkChannel.java b/common/src/main/java/me/shedaniel/architectury/networking/NetworkChannel.java index b2c203a3..8e4fab79 100644 --- a/common/src/main/java/me/shedaniel/architectury/networking/NetworkChannel.java +++ b/common/src/main/java/me/shedaniel/architectury/networking/NetworkChannel.java @@ -57,18 +57,6 @@ public final class NetworkChannel { return new NetworkChannel(id); } - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2.0") - public void register(NetworkManager.Side side, Class type, BiConsumer encoder, Function decoder, BiConsumer> messageConsumer) { - register(type, encoder, decoder, messageConsumer); - } - - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2.0") - public void register(Optional side, Class type, BiConsumer encoder, Function decoder, BiConsumer> messageConsumer) { - register(type, encoder, decoder, messageConsumer); - } - public void register(Class type, BiConsumer encoder, Function decoder, BiConsumer> messageConsumer) { // TODO: this is pretty wasteful; add a way to specify custom or numeric ids String s = UUID.nameUUIDFromBytes(type.getName().getBytes(StandardCharsets.UTF_8)).toString().replace("-", ""); @@ -92,24 +80,6 @@ public final class NetworkChannel { return h; } - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2.0") - public void register(int id, Class type, BiConsumer encoder, Function decoder, BiConsumer> messageConsumer) { - register(type, encoder, decoder, messageConsumer); - } - - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2.0") - public void register(NetworkManager.Side side, int id, Class type, BiConsumer encoder, Function decoder, BiConsumer> messageConsumer) { - register(type, encoder, decoder, messageConsumer); - } - - @Deprecated - @ApiStatus.ScheduledForRemoval(inVersion = "2.0") - public void register(Optional side, int id, Class type, BiConsumer encoder, Function decoder, BiConsumer> messageConsumer) { - register(type, encoder, decoder, messageConsumer); - } - public Packet toPacket(NetworkManager.Side side, T message) { MessageInfo messageInfo = (MessageInfo) Objects.requireNonNull(encoders.get(message.getClass()), "Unknown message type! " + message); FriendlyByteBuf buf = new FriendlyByteBuf(Unpooled.buffer());