Unicopia/src/main/java/com/minelittlepony/unicopia/entity/LightEmittingEntity.java
2022-03-26 21:34:15 +02:00

25 lines
614 B
Java

package com.minelittlepony.unicopia.entity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.world.World;
public abstract class LightEmittingEntity extends Entity implements DynamicLightSource {
private final LightEmitter<?> emitter = new LightEmitter<>(this);
public LightEmittingEntity(EntityType<?> type, World world) {
super(type, world);
}
@Override
public void tick() {
super.tick();
emitter.tick();
}
@Override
public void onRemoved() {
super.onRemoved();
emitter.remove();
}
}