Search in sources :

Example 1 with CreateColonyMessage

use of com.minecolonies.coremod.network.messages.client.CreateColonyMessage in project minecolonies by Minecolonies.

the class WindowTownHallColonyManage method onCreate.

/**
 * On create button
 */
public void onCreate() {
    final PlayerEntity player = Minecraft.getInstance().player;
    final ITextComponent colonyName = new TranslationTextComponent(DEFAULT_COLONY_NAME, player.getName());
    new VanillaParticleMessage(pos.getX(), pos.getY(), pos.getZ(), ParticleTypes.DRAGON_BREATH).onExecute(null, false);
    player.level.playSound(player, new BlockPos(Minecraft.getInstance().player.position()), SoundEvents.CAMPFIRE_CRACKLE, SoundCategory.AMBIENT, 2.5f, 0.8f);
    Network.getNetwork().sendToServer(new CreateColonyMessage(pos, colonyName.getString()));
    close();
}
Also used : VanillaParticleMessage(com.minecolonies.coremod.network.messages.client.VanillaParticleMessage) CreateColonyMessage(com.minecolonies.coremod.network.messages.client.CreateColonyMessage) ITextComponent(net.minecraft.util.text.ITextComponent) TranslationTextComponent(net.minecraft.util.text.TranslationTextComponent) BlockPos(net.minecraft.util.math.BlockPos) PlayerEntity(net.minecraft.entity.player.PlayerEntity)

Example 2 with CreateColonyMessage

use of com.minecolonies.coremod.network.messages.client.CreateColonyMessage 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)

Aggregations

CreateColonyMessage (com.minecolonies.coremod.network.messages.client.CreateColonyMessage)2 VanillaParticleMessage (com.minecolonies.coremod.network.messages.client.VanillaParticleMessage)2 BlockPos (net.minecraft.util.math.BlockPos)2 PlayerEntity (net.minecraft.entity.player.PlayerEntity)1 ITextComponent (net.minecraft.util.text.ITextComponent)1 TranslationTextComponent (net.minecraft.util.text.TranslationTextComponent)1