use of com.minecolonies.coremod.network.messages.client.VanillaParticleMessage in project minecolonies by ldtteam.
the class WindowTownHallColonyManage method onCreate.
/**
* On create button
*/
public void onCreate() {
new VanillaParticleMessage(pos.getX(), pos.getY(), pos.getZ(), ParticleTypes.DRAGON_BREATH).onExecute(null, false);
Minecraft.getInstance().level.playSound(Minecraft.getInstance().player, new BlockPos(Minecraft.getInstance().player.position()), SoundEvents.CAMPFIRE_CRACKLE, SoundCategory.AMBIENT, 2.5f, 0.8f);
Network.getNetwork().sendToServer(new CreateColonyMessage(pos));
close();
}
use of com.minecolonies.coremod.network.messages.client.VanillaParticleMessage in project minecolonies by ldtteam.
the class CitizenSkillHandler method levelUp.
@Override
public void levelUp(final ICitizenData data) {
// Show level-up particles
if (data.getEntity().isPresent()) {
final AbstractEntityCitizen citizen = data.getEntity().get();
Network.getNetwork().sendToTrackingEntity(new VanillaParticleMessage(citizen.getX(), citizen.getY(), citizen.getZ(), ParticleTypes.HAPPY_VILLAGER), data.getEntity().get());
}
if (data.getJob() != null) {
data.getJob().onLevelUp();
}
}
use of com.minecolonies.coremod.network.messages.client.VanillaParticleMessage in project minecolonies by ldtteam.
the class ItemScrollBuff method addRegenerationWithParticles.
/**
* Adds a regeneration potion instance and displays particles
*
* @param entity entity to apply to
*/
private void addRegenerationWithParticles(final LivingEntity entity) {
entity.addEffect(new EffectInstance(Effects.REGENERATION, TICKS_SECOND * 60));
Network.getNetwork().sendToTrackingEntity(new VanillaParticleMessage(entity.getX(), entity.getY(), entity.getZ(), ParticleTypes.HEART), entity);
}
use of com.minecolonies.coremod.network.messages.client.VanillaParticleMessage in project minecolonies by ldtteam.
the class ItemScrollColonyAreaTP method onUseTick.
@Override
public void onUseTick(World worldIn, LivingEntity entity, ItemStack stack, int count) {
if (!worldIn.isClientSide && worldIn.getGameTime() % 5 == 0 && entity instanceof PlayerEntity) {
final ServerPlayerEntity sPlayer = (ServerPlayerEntity) entity;
for (final Entity player : getAffectedPlayers(sPlayer)) {
Network.getNetwork().sendToTrackingEntity(new VanillaParticleMessage(player.getX(), player.getY(), player.getZ(), ParticleTypes.INSTANT_EFFECT), player);
}
Network.getNetwork().sendToPlayer(new VanillaParticleMessage(sPlayer.getX(), sPlayer.getY(), sPlayer.getZ(), ParticleTypes.INSTANT_EFFECT), sPlayer);
}
}
use of com.minecolonies.coremod.network.messages.client.VanillaParticleMessage in project minecolonies by ldtteam.
the class ItemScrollColonyTP method onUseTick.
@Override
public void onUseTick(World worldIn, LivingEntity entity, ItemStack stack, int count) {
if (!worldIn.isClientSide && worldIn.getGameTime() % 5 == 0) {
Network.getNetwork().sendToTrackingEntity(new VanillaParticleMessage(entity.getX(), entity.getY(), entity.getZ(), ParticleTypes.INSTANT_EFFECT), entity);
Network.getNetwork().sendToPlayer(new VanillaParticleMessage(entity.getX(), entity.getY(), entity.getZ(), ParticleTypes.INSTANT_EFFECT), (ServerPlayerEntity) entity);
}
}
Aggregations