Search in sources :

Example 1 with EntityDimensions

use of net.minecraft.entity.EntityDimensions in project MCDoom by AzureDoom.

the class ProjectilesEntityRegister method projectile.

private static <T extends Entity> EntityType<T> projectile(EntityType.EntityFactory<T> factory, String id, boolean itemRender) {
    EntityType<T> type = FabricEntityTypeBuilder.<T>create(SpawnGroup.MISC, factory).dimensions(new EntityDimensions(0.5F, 0.5F, true)).disableSummon().spawnableFarFromPlayer().trackRangeBlocks(90).trackedUpdateRate(4).build();
    Registry.register(Registry.ENTITY_TYPE, new Identifier(DoomMod.MODID, id), type);
    ENTITY_TYPES.add(type);
    if (itemRender) {
        ENTITY_THAT_USE_ITEM_RENDERS.add(type);
    }
    return type;
}
Also used : EntityDimensions(net.minecraft.entity.EntityDimensions) Identifier(net.minecraft.util.Identifier)

Example 2 with EntityDimensions

use of net.minecraft.entity.EntityDimensions in project ImmersivePortalsMod by qouteall.

the class NewNetherPortalEntity method init.

public static void init() {
    entityType = Registry.register(Registry.ENTITY_TYPE, new Identifier("immersive_portals", "nether_portal_new"), FabricEntityTypeBuilder.create(EntityCategory.MISC, (EntityType<NewNetherPortalEntity> type, World world1) -> new NewNetherPortalEntity(type, world1)).size(new EntityDimensions(1, 1, true)).setImmuneToFire().build());
    PortalPlaceholderBlock.portalBlockUpdateSignal.connect((world, pos) -> {
        McHelper.getEntitiesNearby(world, new Vec3d(pos), NewNetherPortalEntity.class, 20).forEach(NewNetherPortalEntity::notifyToCheckIntegrity);
    });
}
Also used : EntityDimensions(net.minecraft.entity.EntityDimensions) Identifier(net.minecraft.util.Identifier) World(net.minecraft.world.World) ServerWorld(net.minecraft.server.world.ServerWorld) Vec3d(net.minecraft.util.math.Vec3d)

Example 3 with EntityDimensions

use of net.minecraft.entity.EntityDimensions in project ImmersivePortalsMod by qouteall.

the class NetherPortalEntity method init.

public static void init() {
    entityType = Registry.register(Registry.ENTITY_TYPE, new Identifier("immersive_portals", "monitoring_nether_portal"), FabricEntityTypeBuilder.create(EntityCategory.MISC, (EntityType.EntityFactory<NetherPortalEntity>) NetherPortalEntity::new).size(new EntityDimensions(1, 1, true)).setImmuneToFire().build());
    PortalPlaceholderBlock.portalBlockUpdateSignal.connect((world, pos) -> {
        McHelper.getEntitiesNearby(world, new Vec3d(pos), NetherPortalEntity.class, 20).forEach(NetherPortalEntity::notifyToCheckIntegrity);
    });
}
Also used : EntityDimensions(net.minecraft.entity.EntityDimensions) Identifier(net.minecraft.util.Identifier) Vec3d(net.minecraft.util.math.Vec3d)

Example 4 with EntityDimensions

use of net.minecraft.entity.EntityDimensions in project MCDoom by AzureDoom.

the class ProjectilesEntityRegister method projectile2.

private static <T extends Entity> EntityType<T> projectile2(EntityType.EntityFactory<T> factory, String id, boolean itemRender) {
    EntityType<T> type = FabricEntityTypeBuilder.<T>create(SpawnGroup.MISC, factory).dimensions(new EntityDimensions(0.5F, 0.5F, true)).disableSummon().spawnableFarFromPlayer().trackRangeBlocks(90).trackedUpdateRate(4).build();
    Registry.register(Registry.ENTITY_TYPE, new Identifier(DoomMod.MODID, id), type);
    ENTITY_TYPES.add(type);
    if (itemRender) {
        ENTITY_THAT_USE_ITEM_RENDERS.add(type);
    }
    return type;
}
Also used : EntityDimensions(net.minecraft.entity.EntityDimensions) Identifier(net.minecraft.util.Identifier)

Example 5 with EntityDimensions

use of net.minecraft.entity.EntityDimensions in project MCDoom by AzureDoom.

the class ProjectilesEntityRegister method projectile1.

private static <T extends Entity> EntityType<T> projectile1(EntityType.EntityFactory<T> factory, String id, boolean itemRender) {
    EntityType<T> type = FabricEntityTypeBuilder.<T>create(SpawnGroup.MISC, factory).dimensions(new EntityDimensions(2.0F, 2.0F, true)).disableSummon().spawnableFarFromPlayer().trackRangeBlocks(90).trackedUpdateRate(4).build();
    Registry.register(Registry.ENTITY_TYPE, new Identifier(DoomMod.MODID, id), type);
    ENTITY_TYPES.add(type);
    if (itemRender) {
        ENTITY_THAT_USE_ITEM_RENDERS.add(type);
    }
    return type;
}
Also used : EntityDimensions(net.minecraft.entity.EntityDimensions) Identifier(net.minecraft.util.Identifier)

Aggregations

EntityDimensions (net.minecraft.entity.EntityDimensions)7 Identifier (net.minecraft.util.Identifier)5 NearbyEntityListenerProvider (me.jellysquid.mods.lithium.common.entity.tracker.nearby.NearbyEntityListenerProvider)2 Vec3d (net.minecraft.util.math.Vec3d)2 Vec3i (net.minecraft.util.math.Vec3i)2 Inject (org.spongepowered.asm.mixin.injection.Inject)2 ServerWorld (net.minecraft.server.world.ServerWorld)1 World (net.minecraft.world.World)1