use of com.witchworks.common.core.net.EnergyMessage in project Witchworks by Um-Mitternacht.
the class EnergyEvents method onWorldJoin.
@SubscribeEvent
public void onWorldJoin(EntityJoinWorldEvent event) {
if (event.getEntity() instanceof EntityPlayerMP) {
EntityPlayerMP entity = (EntityPlayerMP) event.getEntity();
Optional<IEnergy> optional = EnergyHandler.getEnergy(entity);
if (optional.isPresent()) {
PacketHandler.sendTo(entity, new EnergyMessage(optional.get(), entity.getUniqueID()));
}
}
}
Aggregations