From c66748ab0725fdaf5f83c2d35186a84f1f2ff823 Mon Sep 17 00:00:00 2001 From: "Joseph T. McQuigg" Date: Fri, 20 Dec 2024 11:58:29 -0500 Subject: [PATCH] Make some stuff final, Add some doc Signed-off-by: Joseph T. McQuigg --- .../biomeswevegone/forge/VanillaCompatForge.java | 6 +++++- .../biomeswevegone/neoforge/VanillaCompatNeoForge.java | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Forge/src/main/java/net/potionstudios/biomeswevegone/forge/VanillaCompatForge.java b/Forge/src/main/java/net/potionstudios/biomeswevegone/forge/VanillaCompatForge.java index e51f23e88..1565439ea 100644 --- a/Forge/src/main/java/net/potionstudios/biomeswevegone/forge/VanillaCompatForge.java +++ b/Forge/src/main/java/net/potionstudios/biomeswevegone/forge/VanillaCompatForge.java @@ -48,7 +48,7 @@ public static void init() { ToolInteractions.registerFlattenables(ShovelItem.FLATTENABLES::put); } - public static void registerVanillaCompatEvents(IEventBus bus) { + public static void registerVanillaCompatEvents(final IEventBus bus) { bus.addListener(VanillaCompatForge::registerTillables); bus.addListener(VanillaCompatForge::registerFuels); if (BWGTradesConfig.INSTANCE.get().enableTrades()) bus.addListener(VanillaCompatForge::onVillagerTrade); @@ -57,6 +57,10 @@ public static void registerVanillaCompatEvents(IEventBus bus) { bus.addListener(VanillaCompatForge::onEnderManAnger); } + /** + * Register tillable blocks. + * @see BlockEvent.BlockToolModificationEvent + */ private static void registerTillables(final BlockEvent.BlockToolModificationEvent event) { if (event.getToolAction() == ToolActions.HOE_TILL && event.getLevel().getBlockState(event.getPos().above()).isAir()) { BlockState state = event.getState(); diff --git a/NeoForge/src/main/java/net/potionstudios/biomeswevegone/neoforge/VanillaCompatNeoForge.java b/NeoForge/src/main/java/net/potionstudios/biomeswevegone/neoforge/VanillaCompatNeoForge.java index a797713ae..306eb5d46 100644 --- a/NeoForge/src/main/java/net/potionstudios/biomeswevegone/neoforge/VanillaCompatNeoForge.java +++ b/NeoForge/src/main/java/net/potionstudios/biomeswevegone/neoforge/VanillaCompatNeoForge.java @@ -46,7 +46,7 @@ public static void init() { ToolInteractions.registerFlattenables(ShovelItem.FLATTENABLES::put); } - public static void registerVanillaCompatEvents(IEventBus bus) { + public static void registerVanillaCompatEvents(final IEventBus bus) { bus.addListener(VanillaCompatNeoForge::registerTillables); if (BWGTradesConfig.INSTANCE.get().enableTrades()) bus.addListener(VanillaCompatNeoForge::onVillagerTrade); bus.addListener(VanillaCompatNeoForge::onBoneMealUse); @@ -54,6 +54,10 @@ public static void registerVanillaCompatEvents(IEventBus bus) { bus.addListener(VanillaCompatNeoForge::onEnderManAnger); } + /** + * Register tillable blocks. + * @see BlockEvent.BlockToolModificationEvent + */ private static void registerTillables(final BlockEvent.BlockToolModificationEvent event) { if (event.getItemAbility() == ItemAbilities.HOE_TILL && event.getLevel().getBlockState(event.getPos().above()).isAir()) { BlockState state = event.getState(); @@ -66,6 +70,10 @@ else if (state.is(BWGBlocks.PEAT.get())) } } + /** + * Register villager trades. + * @see VillagerTradesEvent + */ private static void onVillagerTrade(final VillagerTradesEvent event) { if (BWGVillagerTrades.TRADES.containsKey(event.getType())) { Int2ObjectMap> trades = event.getTrades();