use of pokefenn.totemic.network.server.PacketTotemEffectMusic in project Totemic by TeamTotemic.
the class StateTotemEffect method update.
@Override
public void update() {
World world = tile.getWorld();
for (Multiset.Entry<TotemEffect> entry : tile.getTotemEffectSet().entrySet()) {
TotemEffect effect = entry.getElement();
if (world.getTotalWorldTime() % effect.getInterval() == 0)
effect.effect(world, tile.getPos(), tile, entry.getCount());
}
// Diminish melody over time, about 5 minutes to fully deplete
if (musicAmount > 0 && world.getTotalWorldTime() % 47 == 0) {
musicAmount--;
tile.markDirty();
}
if (musicAdded && !world.isRemote && world.getTotalWorldTime() % 20 == 0) {
NetworkHandler.sendAround(new PacketTotemEffectMusic(tile.getPos(), musicAmount), tile, 32);
musicAdded = false;
}
if (world.isRemote && world.getTotalWorldTime() % 40 == 0)
spawnParticles();
}
Aggregations