Search in sources :

Example 11 with VanillaParticleMessage

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();
}
Also used : VanillaParticleMessage(com.minecolonies.coremod.network.messages.client.VanillaParticleMessage) CreateColonyMessage(com.minecolonies.coremod.network.messages.client.CreateColonyMessage) BlockPos(net.minecraft.util.math.BlockPos)

Example 12 with VanillaParticleMessage

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();
    }
}
Also used : VanillaParticleMessage(com.minecolonies.coremod.network.messages.client.VanillaParticleMessage) AbstractEntityCitizen(com.minecolonies.api.entity.citizen.AbstractEntityCitizen)

Example 13 with VanillaParticleMessage

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);
}
Also used : VanillaParticleMessage(com.minecolonies.coremod.network.messages.client.VanillaParticleMessage) EffectInstance(net.minecraft.potion.EffectInstance)

Example 14 with VanillaParticleMessage

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);
    }
}
Also used : Entity(net.minecraft.entity.Entity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) LivingEntity(net.minecraft.entity.LivingEntity) ServerPlayerEntity(net.minecraft.entity.player.ServerPlayerEntity) VanillaParticleMessage(com.minecolonies.coremod.network.messages.client.VanillaParticleMessage) ServerPlayerEntity(net.minecraft.entity.player.ServerPlayerEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) ServerPlayerEntity(net.minecraft.entity.player.ServerPlayerEntity)

Example 15 with VanillaParticleMessage

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);
    }
}
Also used : VanillaParticleMessage(com.minecolonies.coremod.network.messages.client.VanillaParticleMessage)

Aggregations

VanillaParticleMessage (com.minecolonies.coremod.network.messages.client.VanillaParticleMessage)15 EffectInstance (net.minecraft.potion.EffectInstance)5 LivingEntity (net.minecraft.entity.LivingEntity)4 PlayerEntity (net.minecraft.entity.player.PlayerEntity)3 AbstractEntityCitizen (com.minecolonies.api.entity.citizen.AbstractEntityCitizen)2 CreateColonyMessage (com.minecolonies.coremod.network.messages.client.CreateColonyMessage)2 Entity (net.minecraft.entity.Entity)2 ServerPlayerEntity (net.minecraft.entity.player.ServerPlayerEntity)2 BlockPos (net.minecraft.util.math.BlockPos)2 ItemStack (net.minecraft.item.ItemStack)1 ITextComponent (net.minecraft.util.text.ITextComponent)1 TranslationTextComponent (net.minecraft.util.text.TranslationTextComponent)1