Skip to content

Commit

Permalink
updated Architectury for new Neoforge 21.0.31 entity damage pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
desht committed Jun 24, 2024
1 parent 289ed46 commit 72d8b4e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ interface LivingDeath {
interface LivingHurt {
/**
* Invoked before an entity is hurt by a damage source.
* Equivalent to Forge's {@code LivingAttackEvent} event.
* Equivalent to NeoForge's {@code LivingIncomingDamageEvent} or Forge's {@code LivingAttackEvent} event.
*
* <p>You currently cannot override the amount of damage the entity receives.
*
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fabric_api_version=0.100.0+1.21
mod_menu_version=10.0.0-beta.1

forge_version=51.0.0
neoforge_version=21.0.0-beta
neoforge_version=21.0.31-beta

# Set to empty if not snapshots
neoforge_pr=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import dev.architectury.event.EventResult;
import dev.architectury.event.events.common.PlayerEvent;
import dev.architectury.event.events.common.*;
import dev.architectury.utils.value.IntValue;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceKey;
Expand All @@ -32,7 +31,6 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.neoforged.bus.api.Event;
import net.neoforged.bus.api.EventPriority;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
Expand All @@ -41,15 +39,12 @@
import net.neoforged.neoforge.event.LootTableLoadEvent;
import net.neoforged.neoforge.event.RegisterCommandsEvent;
import net.neoforged.neoforge.event.ServerChatEvent;
import net.neoforged.neoforge.event.tick.LevelTickEvent;
import net.neoforged.neoforge.event.tick.PlayerTickEvent;
import net.neoforged.neoforge.event.tick.ServerTickEvent;
import net.neoforged.neoforge.event.entity.EntityJoinLevelEvent;
import net.neoforged.neoforge.event.entity.item.ItemTossEvent;
import net.neoforged.neoforge.event.entity.living.AnimalTameEvent;
import net.neoforged.neoforge.event.entity.living.FinalizeSpawnEvent;
import net.neoforged.neoforge.event.entity.living.LivingAttackEvent;
import net.neoforged.neoforge.event.entity.living.LivingDeathEvent;
import net.neoforged.neoforge.event.entity.living.LivingIncomingDamageEvent;
import net.neoforged.neoforge.event.entity.player.*;
import net.neoforged.neoforge.event.entity.player.PlayerEvent.*;
import net.neoforged.neoforge.event.level.BlockEvent.BreakEvent;
Expand All @@ -60,6 +55,9 @@
import net.neoforged.neoforge.event.level.ExplosionEvent.Start;
import net.neoforged.neoforge.event.level.LevelEvent;
import net.neoforged.neoforge.event.server.*;
import net.neoforged.neoforge.event.tick.LevelTickEvent;
import net.neoforged.neoforge.event.tick.PlayerTickEvent;
import net.neoforged.neoforge.event.tick.ServerTickEvent;
import net.neoforged.neoforge.server.ServerLifecycleHooks;

public class EventHandlerImplCommon {
Expand Down Expand Up @@ -228,7 +226,7 @@ public static void eventExplosionEvent(Detonate event) {
}

@SubscribeEvent(priority = EventPriority.HIGH)
public static void event(LivingAttackEvent event) {
public static void event(LivingIncomingDamageEvent event) {
if (EntityEvent.LIVING_HURT.invoker().hurt(event.getEntity(), event.getSource(), event.getAmount()).isFalse()) {
event.setCanceled(true);
}
Expand Down
2 changes: 1 addition & 1 deletion neoforge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ side = "BOTH"
[[dependencies.architectury]]
modId = "neoforge"
type = "required"
versionRange = "[20.1.0-beta,)"
versionRange = "[20.1.31-beta,)"
ordering = "NONE"
side = "BOTH"

Expand Down

0 comments on commit 72d8b4e

Please sign in to comment.