Search in sources :

Example 1 with StructureVillagerHouses

use of com.wuest.prefab.StructureGen.CustomStructures.StructureVillagerHouses in project MC-Prefab by Brian-Wuest.

the class VillagerHouseConfiguration method ConfigurationSpecificBuildStructure.

/**
 * This is used to actually build the structure as it creates the structure instance and calls build structure.
 * @param player The player which requested the build.
 * @param world The world instance where the build will occur.
 * @param hitBlockPos This hit block position.
 */
@Override
protected void ConfigurationSpecificBuildStructure(EntityPlayer player, World world, BlockPos hitBlockPos) {
    StructureVillagerHouses structure = StructureVillagerHouses.CreateInstance(this.houseStyle.getStructureLocation(), StructureVillagerHouses.class);
    if (structure.BuildStructure(this, world, hitBlockPos, EnumFacing.NORTH, player)) {
        ItemStack stack = player.getHeldItemMainhand().getItem() instanceof ItemVillagerHouses ? player.getHeldItemMainhand() : player.getHeldItemOffhand();
        stack.damageItem(1, player);
        player.inventoryContainer.detectAndSendChanges();
    }
}
Also used : StructureVillagerHouses(com.wuest.prefab.StructureGen.CustomStructures.StructureVillagerHouses) ItemStack(net.minecraft.item.ItemStack) ItemVillagerHouses(com.wuest.prefab.Items.Structures.ItemVillagerHouses)

Aggregations

ItemVillagerHouses (com.wuest.prefab.Items.Structures.ItemVillagerHouses)1 StructureVillagerHouses (com.wuest.prefab.StructureGen.CustomStructures.StructureVillagerHouses)1 ItemStack (net.minecraft.item.ItemStack)1