Search in sources :

Example 1 with BuildToolPlaceMessage

use of com.minecolonies.coremod.network.messages.server.BuildToolPlaceMessage in project minecolonies by ldtteam.

the class WindowMinecoloniesShapeTool method place.

@Override
protected void place() {
    final StructureName sn = save();
    // rotation/mirroring already happened server side
    final BuildToolPlaceMessage msg = new BuildToolPlaceMessage(sn.toString(), Settings.instance.getShape().toString(), Settings.instance.getPosition(), 0, false, Mirror.NONE, Blocks.AIR.defaultBlockState());
    Minecraft.getInstance().tell(new WindowBuildDecoration(msg, Settings.instance.getPosition(), sn)::open);
}
Also used : BuildToolPlaceMessage(com.minecolonies.coremod.network.messages.server.BuildToolPlaceMessage) StructureName(com.ldtteam.structurize.management.StructureName)

Example 2 with BuildToolPlaceMessage

use of com.minecolonies.coremod.network.messages.server.BuildToolPlaceMessage in project minecolonies by Minecolonies.

the class WindowMinecoloniesBuildTool method place.

@Override
public void place(final StructureName structureName) {
    final BlockPos offset = Settings.instance.getActiveStructure().getPrimaryBlockOffset();
    final BlockState state = Settings.instance.getActiveStructure().getBlockState(offset).getBlockState();
    BuildToolPlaceMessage msg = new BuildToolPlaceMessage(structureName.toString(), structureName.getLocalizedName(), Settings.instance.getPosition(), Settings.instance.getRotation(), structureName.isHut(), Settings.instance.getMirror(), state);
    if (structureName.isHut()) {
        Network.getNetwork().sendToServer(msg);
    } else {
        Minecraft.getInstance().tell(new WindowBuildDecoration(msg, Settings.instance.getPosition(), structureName)::open);
    }
}
Also used : BlockState(net.minecraft.block.BlockState) BuildToolPlaceMessage(com.minecolonies.coremod.network.messages.server.BuildToolPlaceMessage) BlockPos(net.minecraft.util.math.BlockPos)

Example 3 with BuildToolPlaceMessage

use of com.minecolonies.coremod.network.messages.server.BuildToolPlaceMessage in project minecolonies by Minecolonies.

the class WindowMinecoloniesShapeTool method place.

@Override
protected void place() {
    final StructureName sn = save();
    // rotation/mirroring already happened server side
    final BuildToolPlaceMessage msg = new BuildToolPlaceMessage(sn.toString(), Settings.instance.getShape().toString(), Settings.instance.getPosition(), 0, false, Mirror.NONE, Blocks.AIR.defaultBlockState());
    Minecraft.getInstance().tell(new WindowBuildDecoration(msg, Settings.instance.getPosition(), sn)::open);
}
Also used : BuildToolPlaceMessage(com.minecolonies.coremod.network.messages.server.BuildToolPlaceMessage) StructureName(com.ldtteam.structurize.management.StructureName)

Example 4 with BuildToolPlaceMessage

use of com.minecolonies.coremod.network.messages.server.BuildToolPlaceMessage in project minecolonies by ldtteam.

the class WindowMinecoloniesBuildTool method place.

@Override
public void place(final StructureName structureName) {
    final BlockPos offset = Settings.instance.getActiveStructure().getPrimaryBlockOffset();
    final BlockState state = Settings.instance.getActiveStructure().getBlockState(offset).getBlockState();
    BuildToolPlaceMessage msg = new BuildToolPlaceMessage(structureName.toString(), structureName.getLocalizedName(), Settings.instance.getPosition(), Settings.instance.getRotation(), structureName.isHut(), Settings.instance.getMirror(), state);
    if (structureName.isHut()) {
        Network.getNetwork().sendToServer(msg);
    } else {
        Minecraft.getInstance().tell(new WindowBuildDecoration(msg, Settings.instance.getPosition(), structureName)::open);
    }
}
Also used : BlockState(net.minecraft.block.BlockState) BuildToolPlaceMessage(com.minecolonies.coremod.network.messages.server.BuildToolPlaceMessage) BlockPos(net.minecraft.util.math.BlockPos)

Aggregations

BuildToolPlaceMessage (com.minecolonies.coremod.network.messages.server.BuildToolPlaceMessage)4 StructureName (com.ldtteam.structurize.management.StructureName)2 BlockState (net.minecraft.block.BlockState)2 BlockPos (net.minecraft.util.math.BlockPos)2