mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 03:56:59 -05:00
Add EntityHooks.fromCollision to retrieve an entity from block collision (#64)
This commit is contained in:
@@ -20,9 +20,16 @@
|
||||
package me.shedaniel.architectury.hooks.forge;
|
||||
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class EntityHooksImpl {
|
||||
public static String getEncodeId(Entity entity) {
|
||||
return entity.getEncodeId();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Entity fromCollision(CollisionContext ctx) {
|
||||
return ctx.getEntity();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user